@acedatacloud/nexior 3.167.0 → 3.168.0
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/assets/{Auth-BYDwGwaF.js → Auth-BDyXSjIe.js} +1 -1
- package/dist/assets/{BotPlaceholder-BqeR06y3.js → BotPlaceholder-BEomWKuP.js} +1 -1
- package/dist/assets/{Callback--SyBMjm7.js → Callback-DoJBHDRi.js} +1 -1
- package/dist/assets/{Console-WixW6BSu.js → Console-B85hzCWD.js} +1 -1
- package/dist/assets/{Consumption-CL3WRYVN.js → Consumption-Vrs9Ym-e.js} +1 -1
- package/dist/assets/{Conversation-Brvaxxml.js → Conversation-yBAeOfTL.js} +1 -1
- package/dist/assets/{CopyToClipboard-TC6O9s7V.js → CopyToClipboard-BKPPPZex.js} +1 -1
- package/dist/assets/{Detail-oRAPiSXy.js → Detail-IqUP_8Rf.js} +2 -2
- package/dist/assets/{EditArray-Cr1IK11e.js → EditArray-c0xJ35n-.js} +1 -1
- package/dist/assets/{Extra-9TZNXkOm.js → Extra-B0rcl4cC.js} +1 -1
- package/dist/assets/{FilePreview-BHbzMFA3.js → FilePreview-B83vVjmo.js} +1 -1
- package/dist/assets/{History-DArAVdnl.js → History-CLZkfWJ_.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-VGkf-8vn.js → IconPark.vue_vue_type_script_setup_true_lang-ksQMUIfc.js} +1 -1
- package/dist/assets/{ImagePreview-CATcaSwT.js → ImagePreview-B0AGcjB1.js} +1 -1
- package/dist/assets/{ImageWrapper-C-2wIJYB.js → ImageWrapper-_iiM_a6H.js} +1 -1
- package/dist/assets/{Index-ip063XOA.js → Index-B672ipBS.js} +1 -1
- package/dist/assets/{Index-6O25pgqo.js → Index-B7N_ZM2U.js} +1 -1
- package/dist/assets/{Index-Ba9ChGUK.js → Index-BKjB-9Oe.js} +2 -2
- package/dist/assets/{Index-CofV8BK0.js → Index-By3xsmxj.js} +1 -1
- package/dist/assets/{Index-BKgJVlqc.js → Index-CSuhKEjt.js} +1 -1
- package/dist/assets/{Index-DbBMgNaM.js → Index-CezD43xH.js} +1 -1
- package/dist/assets/{Index-BmLW9xeN.js → Index-CxsRl-11.js} +1 -1
- package/dist/assets/{Index-Cl3Lz1dF.js → Index-D-qTlC3Z.js} +1 -1
- package/dist/assets/{Index-Bvrq7JLb.js → Index-D1tmlbyD.js} +1 -1
- package/dist/assets/Index-DC676h74.js +1 -0
- package/dist/assets/{Index-C01475yx.js → Index-DHx4p08s.js} +1 -1
- package/dist/assets/{Index-eTNf6k_N.js → Index-DZ47oisV.js} +1 -1
- package/dist/assets/{Index-BZkdecyf.js → Index-DbKTdta8.js} +1 -1
- package/dist/assets/{Index-Dh9rUBhI.js → Index-Dc2nFTk1.js} +1 -1
- package/dist/assets/{Index-DBlvbTmY.js → Index-Did7kzpk.js} +1 -1
- package/dist/assets/{Index-DZl1YUel.js → Index-DpHIGaEz.js} +1 -1
- package/dist/assets/{Index-C3f-qhzZ.js → Index-F42-VQFW.js} +1 -1
- package/dist/assets/{Index-BQQpmfdB.js → Index-NTKMlpsi.js} +1 -1
- package/dist/assets/{Index-C5HV03FO.js → Index-T9ebwI8G.js} +1 -1
- package/dist/assets/Index-YCV8wVla.css +1 -0
- package/dist/assets/{Index-BQL51iA5.js → Index-ah7mFp7z.js} +1 -1
- package/dist/assets/{Index-BGjqeGFj.js → Index-mAdg-qFC.js} +1 -1
- package/dist/assets/{Index-ogoTClu0.js → Index-mfKfVj3g.js} +1 -1
- package/dist/assets/{Index-DIF8W8Uc.js → Index-pNqGPmBt.js} +1 -1
- package/dist/assets/{Index-BUxrI5H9.js → Index-vu_JhkJW.js} +1 -1
- package/dist/assets/{Invitees-Cc3NpC2g.js → Invitees-B_jQ5kVN.js} +1 -1
- package/dist/assets/{List-DvSsX3Z0.js → List-7Wl_Izc4.js} +1 -1
- package/dist/assets/{List-D7DfvKQy.js → List-BCkL1DtJ.js} +1 -1
- package/dist/assets/{List-B4p4ZhQE.js → List-CvW8rP13.js} +1 -1
- package/dist/assets/{Main-BVKGaNZg.js → Main-QbmvnnMG.js} +1 -1
- package/dist/assets/{Navigator-9ddEoj7J.js → Navigator-C-p3RzVC.js} +1 -1
- package/dist/assets/{NoTasks-C3t8bmtA.js → NoTasks-DTEzeszL.js} +1 -1
- package/dist/assets/{NotFound-Hnpwk4F4.js → NotFound-CVtQTglJ.js} +1 -1
- package/dist/assets/{OAuthCallback-COGnrcdn.js → OAuthCallback-CpR2-nmg.js} +1 -1
- package/dist/assets/{Pagination-wNLMuHeO.js → Pagination-DmumC74j.js} +1 -1
- package/dist/assets/{Status-CIYhFNcJ.js → Status-Bf9lfqL1.js} +1 -1
- package/dist/assets/{Subscribe-lEko0pof.js → Subscribe-Db51l7te.js} +1 -1
- package/dist/assets/{VideoPlayer-c9dt-3yZ.js → VideoPlayer-DLqpJWFk.js} +1 -1
- package/dist/assets/_Uint8Array-BXWVuq2q.js +1 -0
- package/dist/assets/{_baseClone-Bmu_sg3j.js → _baseClone-CdH871Qw.js} +1 -1
- package/dist/assets/{_baseIteratee-lG75D4iw.js → _baseIteratee-BD8B7GME.js} +1 -1
- package/dist/assets/{_initCloneObject-C-Q8oqTt.js → _initCloneObject-BBeThwBy.js} +1 -1
- package/dist/assets/{add-6LL9G5Z5.js → add-UrLMzye7.js} +1 -1
- package/dist/assets/{all-wallets-aEppbPWX.js → all-wallets-opGrYoFq.js} +1 -1
- package/dist/assets/{app-store-DID464Wp.js → app-store-eRITh79T.js} +1 -1
- package/dist/assets/{apple-DORiIW02.js → apple-BJrlVv7w.js} +1 -1
- package/dist/assets/{arrow-bottom-CmCVBSrV.js → arrow-bottom-Bjnbevqv.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-dyY9qLpT.js → arrow-bottom-circle-B3cg2xpo.js} +1 -1
- package/dist/assets/{arrow-left-BaoMx2wj.js → arrow-left-BIRR85uZ.js} +1 -1
- package/dist/assets/{arrow-right-6ZIR8uWG.js → arrow-right-CMkhN4--.js} +1 -1
- package/dist/assets/{arrow-top-DV5TBwIJ.js → arrow-top-D-ULF3EB.js} +1 -1
- package/dist/assets/{avatar-CZpCU7-m.js → avatar-D0aH2OKD.js} +1 -1
- package/dist/assets/{bank-DYz2uXPn.js → bank-B9xrTyFs.js} +1 -1
- package/dist/assets/{basic-CH4UgvMg.js → basic-LOPbFEDH.js} +60 -60
- package/dist/assets/{browser-CKmIG2h_.js → browser-Da5KzxtX.js} +1 -1
- package/dist/assets/{byokCredential-BdY2oFpq.js → byokCredential-Pee77Xtw.js} +1 -1
- package/dist/assets/{card-3UfZE5zt.js → card-Cmds_I_j.js} +1 -1
- package/dist/assets/{castArray-YvIMFTc9.js → castArray-CUDnQsIK.js} +1 -1
- package/dist/assets/{chat-CpxTF3jE.js → chat-E_RwqKGz.js} +1 -1
- package/dist/assets/{checkmark-BWZoFv2_.js → checkmark-D5qigt51.js} +1 -1
- package/dist/assets/{checkmark-bold-CEX8QndR.js → checkmark-bold-LvKhYYxu.js} +1 -1
- package/dist/assets/{chevron-bottom-BI142s1X.js → chevron-bottom-CCJifxR0.js} +1 -1
- package/dist/assets/{chevron-left-tLzTrSXr.js → chevron-left-DoFRVtBs.js} +1 -1
- package/dist/assets/{chevron-right-Dyf_ffQQ.js → chevron-right-7VzYWBD3.js} +1 -1
- package/dist/assets/{chevron-top-DPDBxfl4.js → chevron-top-Cr09TF1o.js} +1 -1
- package/dist/assets/{chrome-store-D5SW-iy-.js → chrome-store-tZ5X31Ib.js} +1 -1
- package/dist/assets/{clock-CKF6goQf.js → clock-DhSlFX8L.js} +1 -1
- package/dist/assets/{close-De8y1RWE.js → close-8NNhk5MQ.js} +1 -1
- package/dist/assets/{coinPlaceholder-Dkkrmbg7.js → coinPlaceholder-CGqCWk_o.js} +1 -1
- package/dist/assets/{compass-cqEFwAme.js → compass-DcyOP90T.js} +1 -1
- package/dist/assets/{copy-Es56qz4c.js → copy-D1WNYxGL.js} +1 -1
- package/dist/assets/{createTaskActions-BXbGVAyn.js → createTaskActions-DAYGdsVq.js} +1 -1
- package/dist/assets/{cursor-Cq5X5f50.js → cursor-cMwhnIk5.js} +1 -1
- package/dist/assets/{cursor-transparent-xlWXmwGt.js → cursor-transparent-CrQv8Onm.js} +1 -1
- package/dist/assets/{debounce-BpWk7nuI.js → debounce-DCSodorO.js} +1 -1
- package/dist/assets/{desktop-D1J2Uie2.js → desktop-B93vdfc0.js} +1 -1
- package/dist/assets/{disconnect-Cks823Of.js → disconnect-CTOrg89I.js} +1 -1
- package/dist/assets/{discord-zkmftcBQ.js → discord-B928iac1.js} +1 -1
- package/dist/assets/{distribution-o7xqSpRT.js → distribution-CnJXY8oi.js} +1 -1
- package/dist/assets/{dropdown-Bvb4dRSD.js → dropdown-BDLqMJ6c.js} +1 -1
- package/dist/assets/{etherscan-I41foa4d.js → etherscan-C7rdhh_l.js} +1 -1
- package/dist/assets/{exclamation-triangle-DoIkNHiW.js → exclamation-triangle-TLEW8o_8.js} +1 -1
- package/dist/assets/{extension-C2DGwOS2.js → extension-BCPc05eE.js} +1 -1
- package/dist/assets/{external-link-B2ZBFNNw.js → external-link-BVSFanSk.js} +1 -1
- package/dist/assets/{facebook-CO7UwlKf.js → facebook-yWzRWreo.js} +1 -1
- package/dist/assets/{farcaster-DFerNXVJ.js → farcaster-ObXhKU7L.js} +1 -1
- package/dist/assets/{filters-Cq5-UFL3.js → filters-D65QChWv.js} +1 -1
- package/dist/assets/{github-BOpdRs3D.js → github-CfpVGN4l.js} +1 -1
- package/dist/assets/{google-B1iBXSb_.js → google-DgM2THGc.js} +1 -1
- package/dist/assets/{help-circle-FMe2_GKk.js → help-circle-BuTaWLeN.js} +1 -1
- package/dist/assets/{id-B8JtAbxm.js → id-BDpIvgHc.js} +1 -1
- package/dist/assets/{image-B7X95LW6.js → image-BPV6AkRv.js} +1 -1
- package/dist/assets/{index-DqHEB8wJ.js → index--_ruvatY.js} +1 -1
- package/dist/assets/{index-5PCSoafl.js → index-50IhPevG.js} +2 -2
- package/dist/assets/{index-HTtxGNNR.js → index-B0_GI7q2.js} +1 -1
- package/dist/assets/{index-BD55w4j0.js → index-B6H89xyY.js} +1 -1
- package/dist/assets/{index-C8WbvFlX.js → index-BEB0_UvQ.js} +1 -1
- package/dist/assets/{index-0u_G2kSj.js → index-BFQ7oRfU.js} +1 -1
- package/dist/assets/{index-DC9KLk-Y.js → index-BJD6-2dA.js} +1 -1
- package/dist/assets/{index-DSRawDTE.js → index-BKkACFcM.js} +1 -1
- package/dist/assets/{index-CmMnj3Xx.js → index-BNn6E6CM.js} +1 -1
- package/dist/assets/{index-BbcE4PaG.js → index-BP0i0DI0.js} +1 -1
- package/dist/assets/{index-Cjg_OuWc.js → index-BS0e3mH-.js} +1 -1
- package/dist/assets/{index-BVZShYNY.js → index-BT6khhJu.js} +1 -1
- package/dist/assets/{index-CniEO1Oz.js → index-BX7sWEUw.js} +1 -1
- package/dist/assets/{index-XpcsQaS3.js → index-BZ0LCluE.js} +1 -1
- package/dist/assets/{index-BMe4XQdI.js → index-BfTKfSn5.js} +1 -1
- package/dist/assets/{index-yXdj_vJc.js → index-BgIT6hC5.js} +1 -1
- package/dist/assets/{index-Df86EZ4H.js → index-BmuW8LII.js} +1 -1
- package/dist/assets/{index-CbnoagxV.js → index-Bo_W4_wC.js} +1 -1
- package/dist/assets/{index--MBG5Bxw.js → index-C2Ix0O_U.js} +1 -1
- package/dist/assets/{index-DZXPcke9.js → index-CAjrQ30c.js} +1 -1
- package/dist/assets/{index-BiXpC_cY.js → index-CAk112Jj.js} +1 -1
- package/dist/assets/{index-gQH-ITVc.js → index-CNiheU_Y.js} +1 -1
- package/dist/assets/{index-DtaZfQsb.js → index-COHCLZDM.js} +1 -1
- package/dist/assets/{index-BPRTWZ0b.js → index-CajQSidV.js} +1 -1
- package/dist/assets/{index-qJmkBTaB.js → index-CeewlRvZ.js} +1 -1
- package/dist/assets/{index-CP6lS__f.js → index-CfNLp6F4.js} +1 -1
- package/dist/assets/{index-DzqsLvLw.js → index-CfmUVjcp.js} +1 -1
- package/dist/assets/{index-DTq8xdm6.js → index-CjU5cdO7.js} +1 -1
- package/dist/assets/{index-8jmQ7jsv.js → index-ClmF6hRq.js} +1 -1
- package/dist/assets/{index-CTspmpeX.js → index-Cncx8-l_.js} +1 -1
- package/dist/assets/{index-B05MCcWV.js → index-CnleZlCG.js} +1 -1
- package/dist/assets/{index-DWkcw7l1.js → index-CoVdVq1Z.js} +1 -1
- package/dist/assets/{index--FfOeMhK.js → index-D6Kzs1Nw.js} +1 -1
- package/dist/assets/{index-CVzcynKu.js → index-D9DK1isc.js} +1 -1
- package/dist/assets/{index-COPlSq-K.js → index-DCbpcMpj.js} +1 -1
- package/dist/assets/{index-DvJO3nj9.js → index-DHULlsKQ.js} +1 -1
- package/dist/assets/{index-cnvaHQUI.js → index-DHnWz_8g.js} +1 -1
- package/dist/assets/{index-ruJel4IC.js → index-DHoQZLtm.js} +1 -1
- package/dist/assets/{index-CD8qf4tY.js → index-DLUXCsx1.js} +1 -1
- package/dist/assets/{index-BXuYZoDz.js → index-DMucU6uG.js} +1 -1
- package/dist/assets/{index-BzRVav2J.js → index-DXwCOxQx.js} +14 -14
- package/dist/assets/{index-DLlZmkfC.js → index-DZM-NR6G.js} +1 -1
- package/dist/assets/{index-karJESpY.js → index-DcjROC1z.js} +1 -1
- package/dist/assets/{index-SAsUj7Pk.js → index-DcjdVEoX.js} +1 -1
- package/dist/assets/{index-DTbz6TSn.js → index-DdSlwtcL.js} +1 -1
- package/dist/assets/{index-DEcBa7gX.js → index-Df15q-se.js} +1 -1
- package/dist/assets/{index-De-wy4Tc.js → index-DfM49-13.js} +1 -1
- package/dist/assets/{index-ZhVk9kkG.js → index-DgEnLOYy.js} +5 -5
- package/dist/assets/{index-BkvfyPBC.js → index-Dttr4JHi.js} +1 -1
- package/dist/assets/{index-D5ReSuuO.js → index-Gby8YUdT.js} +1 -1
- package/dist/assets/{index-CMexzqoP.js → index-OKrnShZm.js} +1 -1
- package/dist/assets/{index-D7b8OrcI.js → index-Pf9Yjl5V.js} +1 -1
- package/dist/assets/{index-C3GoyrG4.js → index-RCOqdLUs.js} +1 -1
- package/dist/assets/{index-CIdZDW4_.js → index-TEpyQgfK.js} +3 -3
- package/dist/assets/{index-Dt0xHpag.js → index-jU7GB09F.js} +1 -1
- package/dist/assets/{index-F7u9olkI.js → index-tZ_Ise3S.js} +1 -1
- package/dist/assets/{index--UH2lqMs.js → index-uHPJAWOO.js} +1 -1
- package/dist/assets/{index-CMTPLs4z.js → index-uvAG1r2M.js} +1 -1
- package/dist/assets/{index-DYXoPIXH.js → index-wIXuMScl.js} +1 -1
- package/dist/assets/{index-bUBBPa9N.js → index-y4M9HGmQ.js} +1 -1
- package/dist/assets/{index.browser.esm-DkzdYcbc.js → index.browser.esm-D7d8Rln2.js} +1 -1
- package/dist/assets/{index.es-C_WLtS18.js → index.es-CGNqC7gi.js} +1 -1
- package/dist/assets/{info-CWQKBayg.js → info-DM9rskjg.js} +1 -1
- package/dist/assets/{info-circle-xZWu29E_.js → info-circle-DlTmoyc5.js} +1 -1
- package/dist/assets/{isEqual-yYS0dh2f.js → isEqual-DBKyqIIt.js} +1 -1
- package/dist/assets/{isPlainObject-CRl4nmqU.js → isPlainObject-BEU12YqN.js} +1 -1
- package/dist/assets/{lightbulb-DDxET3cE.js → lightbulb-DHpQkifU.js} +1 -1
- package/dist/assets/{mail-CFH0lanX.js → mail-RQ1QwebF.js} +1 -1
- package/dist/assets/{midjourney-DRsfJ6XL.js → midjourney-DtyT0jZS.js} +1 -1
- package/dist/assets/{mobile-ikIUiDOY.js → mobile-VdDXMKEH.js} +1 -1
- package/dist/assets/{more-BOWsr6fH.js → more-BE6J6IIj.js} +1 -1
- package/dist/assets/{network-placeholder-WAP_pG5W.js → network-placeholder-Mx5SY88G.js} +1 -1
- package/dist/assets/{nftPlaceholder-mS2qsTTR.js → nftPlaceholder-C7cAVXAB.js} +1 -1
- package/dist/assets/{off-DgdEkHnP.js → off-D5KoU2IH.js} +1 -1
- package/dist/assets/{order-Cb2RT6uu.js → order-BscwC2FZ.js} +1 -1
- package/dist/assets/{pagination-mZXKDVMd.js → pagination-ttqKdzba.js} +1 -1
- package/dist/assets/{play-store-8C4ifU8u.js → play-store-NLHYHAzn.js} +1 -1
- package/dist/assets/{plus-FPrDhto7.js → plus-B4X29bak.js} +1 -1
- package/dist/assets/{price-Cr67gCty.js → price-DpiQB5Yf.js} +1 -1
- package/dist/assets/{producer-Q-cOb_Ne.js → producer-CvNMCVkQ.js} +1 -1
- package/dist/assets/{qr-code-DRShCRVn.js → qr-code-DeoPDarM.js} +1 -1
- package/dist/assets/{recycle-horizontal-C8dBoRZt.js → recycle-horizontal-C8vaKTfu.js} +1 -1
- package/dist/assets/{refresh-CImlMCgq.js → refresh-BTBS0EUI.js} +1 -1
- package/dist/assets/{reown-logo-4ZKneMrf.js → reown-logo-D682jtgT.js} +1 -1
- package/dist/assets/{search-CGNtTO4W.js → search-CLA1DAiY.js} +1 -1
- package/dist/assets/{secp256k1-BWP6UeVl.js → secp256k1-C0KaaotE.js} +1 -1
- package/dist/assets/{secp256k1-C2CXj9YW.js → secp256k1-UQxLo_3_.js} +1 -1
- package/dist/assets/{seedream-DpE59ZMf.js → seedream-D8o6AzwQ.js} +1 -1
- package/dist/assets/seedream-DcTLW5r2.js +1 -0
- package/dist/assets/seedream-rLJUDb-d.js +1 -0
- package/dist/assets/{send-DCL9Yk32.js → send-aX_GxPEK.js} +1 -1
- package/dist/assets/{service-BJ-ypgj8.js → service-Bl8gGQ55.js} +1 -1
- package/dist/assets/{solana-wallets-yxjVsaPt.js → solana-wallets-DplP8WdI.js} +2 -2
- package/dist/assets/{solana-wallets-vue-C8Fkxc_p.js → solana-wallets-vue-Ci7B_C6i.js} +1 -1
- package/dist/assets/{suno-BZWrSxwO.js → suno-Cx2k0nCv.js} +1 -1
- package/dist/assets/{swapHorizontal-Bfn7eZ90.js → swapHorizontal-C0y88R1i.js} +1 -1
- package/dist/assets/{swapHorizontalBold-DGPhnPkP.js → swapHorizontalBold-ChU04fWb.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-DqzPWlW6.js → swapHorizontalMedium-DJDVePDM.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-DPpuDpww.js → swapHorizontalRoundedBold-DX-bndMU.js} +1 -1
- package/dist/assets/{swapVertical--7_aleOl.js → swapVertical-AcQg_Wvo.js} +1 -1
- package/dist/assets/{telegram-DkMIuO8p.js → telegram-Lgnv9Ozw.js} +1 -1
- package/dist/assets/{three-dots-DIIrfSEt.js → three-dots-BWmtbAZ_.js} +1 -1
- package/dist/assets/{twitch-CiiHF84Y.js → twitch-DOUAsbJl.js} +1 -1
- package/dist/assets/{twitterIcon-ocXCXtXI.js → twitterIcon-CbBbPa9k.js} +1 -1
- package/dist/assets/{typescript-D6sat8h_.js → typescript-BS0psKoU.js} +1 -1
- package/dist/assets/{use-form-item-B5rZE33a.js → use-form-item-BCHl5hOu.js} +1 -1
- package/dist/assets/validator-CmY_SPNn.js +1 -0
- package/dist/assets/{verify-BNbMn2WA.js → verify-D8_6usMb.js} +1 -1
- package/dist/assets/{verify-filled-BYrl9ds5.js → verify-filled-YSomKc90.js} +1 -1
- package/dist/assets/{w3m-modal-1D4qbzJa.js → w3m-modal-CjCjnI4-.js} +1 -1
- package/dist/assets/{wallet-FOzEXpqB.js → wallet-CQ4eeF60.js} +1 -1
- package/dist/assets/{wallet-placeholder-B68god-e.js → wallet-placeholder-BWHCAd0e.js} +1 -1
- package/dist/assets/{walletconnect-BgAZqbXg.js → walletconnect-CCdGO7JL.js} +1 -1
- package/dist/assets/{warning-circle-OFLJWcAI.js → warning-circle-gDsO_gdI.js} +1 -1
- package/dist/assets/{web-DWdZiDY7.js → web-BIxDucrP.js} +1 -1
- package/dist/assets/{web-MzbMqkc3.js → web-VeP6mq4A.js} +1 -1
- package/dist/assets/{x-CIb6zO-n.js → x-DgWe3wGg.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-CwVq3Ycf.js +0 -1
- package/dist/assets/Index-D_5VDtZe.css +0 -1
- package/dist/assets/_Uint8Array-BP4C5DZm.js +0 -1
- package/dist/assets/seedream-CBaTJXUS.js +0 -1
- package/dist/assets/seedream-CXCUm_0w.js +0 -1
- package/dist/assets/validator-DGv8iqeP.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secp256k1-
|
|
2
|
-
import{PublicKey as ZE,VersionedTransaction as e4,Transaction as t4}from"./index.browser.esm-DkzdYcbc.js";import{g as wh,j as Yv,c as Yr}from"./vendor-dayjs-v0j1UNZp.js";import{_ as Jl,eD as Jv}from"./index-BzRVav2J.js";import{e as r4,w as c0,b as i4,n as Yh,l as s4,u as n4,g as o4,k as Qu,r as Jh,q as a4}from"./signer-VxQoXw0x.js";import{W as c4}from"./types-Cvj5H4DH.js";var Ql;(function(t){t.Mainnet="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",t.Devnet="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",t.Deprecated_Mainnet="solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",t.Deprecated_Devnet="solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"})(Ql||(Ql={}));var $i;(function(t){t.signTransaction="solana_signTransaction",t.signMessage="solana_signMessage",t.signAndSendTransaction="solana_signAndSendTransaction",t.signAndSendAllTransactions="solana_signAndSendAllTransactions",t.signAllTransactions="solana_signAllTransactions"})($i||($i={}));const tr={Mainnet:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Devnet:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",Deprecated_Mainnet:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",Deprecated_Devnet:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"};var Xu={exports:{}},u0;function u4(){if(u0)return Xu.exports;u0=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(T,x,M){return Function.prototype.apply.call(T,x,M)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:r=function(T){return Object.getOwnPropertyNames(T)};function i(O){console&&console.warn&&console.warn(O)}var s=Number.isNaN||function(T){return T!==T};function n(){n.init.call(this)}Xu.exports=n,Xu.exports.once=S,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var o=10;function a(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(O){if(typeof O!="number"||O<0||s(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");o=O}}),n.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(T){if(typeof T!="number"||T<0||s(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function u(O){return O._maxListeners===void 0?n.defaultMaxListeners:O._maxListeners}n.prototype.getMaxListeners=function(){return u(this)},n.prototype.emit=function(T){for(var x=[],M=1;M<arguments.length;M++)x.push(arguments[M]);var U=T==="error",R=this._events;if(R!==void 0)U=U&&R.error===void 0;else if(!U)return!1;if(U){var L;if(x.length>0&&(L=x[0]),L instanceof Error)throw L;var $=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw $.context=L,$}var d=R[T];if(d===void 0)return!1;if(typeof d=="function")e(d,this,x);else for(var b=d.length,_=g(d,b),M=0;M<b;++M)e(_[M],this,x);return!0};function c(O,T,x,M){var U,R,L;if(a(x),R=O._events,R===void 0?(R=O._events=Object.create(null),O._eventsCount=0):(R.newListener!==void 0&&(O.emit("newListener",T,x.listener?x.listener:x),R=O._events),L=R[T]),L===void 0)L=R[T]=x,++O._eventsCount;else if(typeof L=="function"?L=R[T]=M?[x,L]:[L,x]:M?L.unshift(x):L.push(x),U=u(O),U>0&&L.length>U&&!L.warned){L.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=O,$.type=T,$.count=L.length,i($)}return O}n.prototype.addListener=function(T,x){return c(this,T,x,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(T,x){return c(this,T,x,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(O,T,x){var M={fired:!1,wrapFn:void 0,target:O,type:T,listener:x},U=l.bind(M);return U.listener=x,M.wrapFn=U,U}n.prototype.once=function(T,x){return a(x),this.on(T,h(this,T,x)),this},n.prototype.prependOnceListener=function(T,x){return a(x),this.prependListener(T,h(this,T,x)),this},n.prototype.removeListener=function(T,x){var M,U,R,L,$;if(a(x),U=this._events,U===void 0)return this;if(M=U[T],M===void 0)return this;if(M===x||M.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete U[T],U.removeListener&&this.emit("removeListener",T,M.listener||x));else if(typeof M!="function"){for(R=-1,L=M.length-1;L>=0;L--)if(M[L]===x||M[L].listener===x){$=M[L].listener,R=L;break}if(R<0)return this;R===0?M.shift():y(M,R),M.length===1&&(U[T]=M[0]),U.removeListener!==void 0&&this.emit("removeListener",T,$||x)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(T){var x,M,U;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[T]),this;if(arguments.length===0){var R=Object.keys(M),L;for(U=0;U<R.length;++U)L=R[U],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(x=M[T],typeof x=="function")this.removeListener(T,x);else if(x!==void 0)for(U=x.length-1;U>=0;U--)this.removeListener(T,x[U]);return this};function f(O,T,x){var M=O._events;if(M===void 0)return[];var U=M[T];return U===void 0?[]:typeof U=="function"?x?[U.listener||U]:[U]:x?C(U):g(U,U.length)}n.prototype.listeners=function(T){return f(this,T,!0)},n.prototype.rawListeners=function(T){return f(this,T,!1)},n.listenerCount=function(O,T){return typeof O.listenerCount=="function"?O.listenerCount(T):m.call(O,T)},n.prototype.listenerCount=m;function m(O){var T=this._events;if(T!==void 0){var x=T[O];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function g(O,T){for(var x=new Array(T),M=0;M<T;++M)x[M]=O[M];return x}function y(O,T){for(;T+1<O.length;T++)O[T]=O[T+1];O.pop()}function C(O){for(var T=new Array(O.length),x=0;x<T.length;++x)T[x]=O[x].listener||O[x];return T}function S(O,T){return new Promise(function(x,M){function U(L){O.removeListener(T,R),M(L)}function R(){typeof O.removeListener=="function"&&O.removeListener("error",U),x([].slice.call(arguments))}D(O,T,R,{once:!0}),T!=="error"&&A(O,U,{once:!0})})}function A(O,T,x){typeof O.on=="function"&&D(O,"error",T,x)}function D(O,T,x,M){if(typeof O.on=="function")M.once?O.once(T,x):O.on(T,x);else if(typeof O.addEventListener=="function")O.addEventListener(T,function U(R){M.once&&O.removeEventListener(T,U),x(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof O)}return Xu.exports}var sr=u4();const wa=wh(sr);var Qh={};var qf=function(t,e){return qf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},qf(t,e)};function l4(t,e){qf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Bf=function(){return Bf=Object.assign||function(e){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bf.apply(this,arguments)};function h4(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(r[i[s]]=t[i[s]]);return r}function d4(t,e,r,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,r,n):o(e,r))||n);return s>3&&n&&Object.defineProperty(e,r,n),n}function f4(t,e){return function(r,i){e(r,i,t)}}function p4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g4(t,e,r,i){function s(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function a(l){try{c(i.next(l))}catch(h){o(h)}}function u(l){try{c(i.throw(l))}catch(h){o(h)}}function c(l){l.done?n(l.value):s(l.value).then(a,u)}c((i=i.apply(t,e||[])).next())})}function b4(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,s&&(n=c[0]&2?s.return:c[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,c[1])).done)return n;switch(s=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){r.label=c[1];break}if(c[0]===6&&r.label<n[1]){r.label=n[1],n=c;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(c);break}n[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],s=0}finally{i=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function m4(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function y4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function zf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qv(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),s,n=[],o;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return n}function w4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Qv(arguments[e]));return t}function v4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),s=0,e=0;e<r;e++)for(var n=arguments[e],o=0,a=n.length;o<a;o++,s++)i[s]=n[o];return i}function Lc(t){return this instanceof Lc?(this.v=t,this):new Lc(t)}function _4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),s,n=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(f){i[f]&&(s[f]=function(m){return new Promise(function(g,y){n.push([f,m,g,y])>1||a(f,m)})})}function a(f,m){try{u(i[f](m))}catch(g){h(n[0][3],g)}}function u(f){f.value instanceof Lc?Promise.resolve(f.value.v).then(c,l):h(n[0][2],f)}function c(f){a("next",f)}function l(f){a("throw",f)}function h(f,m){f(m),n.shift(),n.length&&a(n[0][0],n[0][1])}}function E4(t){var e,r;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=t[s]?function(o){return(r=!r)?{value:Lc(t[s](o)),done:s==="return"}:n?n(o):o}:n}}function I4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof zf=="function"?zf(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(n){r[n]=t[n]&&function(o){return new Promise(function(a,u){o=t[n](o),s(a,u,o.done,o.value)})}}function s(n,o,a,u){Promise.resolve(u).then(function(c){n({value:c,done:a})},o)}}function A4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function C4(t){return t&&t.__esModule?t:{default:t}}function $4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const P4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Bf},__asyncDelegator:E4,__asyncGenerator:_4,__asyncValues:I4,__await:Lc,__awaiter:g4,__classPrivateFieldGet:$4,__classPrivateFieldSet:x4,__createBinding:m4,__decorate:d4,__exportStar:y4,__extends:l4,__generator:b4,__importDefault:C4,__importStar:S4,__makeTemplateObject:A4,__metadata:p4,__param:f4,__read:Qv,__rest:h4,__spread:w4,__spreadArrays:v4,__values:zf},Symbol.toStringTag,{value:"Module"})),vh=Yv(P4);var Xh={},Ga={},l0;function N4(){if(l0)return Ga;l0=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Ga.delay=t,Ga}var bn={},Zh={},mn={},h0;function O4(){return h0||(h0=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.ONE_THOUSAND=mn.ONE_HUNDRED=void 0,mn.ONE_HUNDRED=100,mn.ONE_THOUSAND=1e3),mn}var ed={},d0;function T4(){return d0||(d0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365})(ed)),ed}var f0;function Xv(){return f0||(f0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(O4(),t),e.__exportStar(T4(),t)})(Zh)),Zh}var p0;function D4(){if(p0)return bn;p0=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.fromMiliseconds=bn.toMiliseconds=void 0;const t=Xv();function e(i){return i*t.ONE_THOUSAND}bn.toMiliseconds=e;function r(i){return Math.floor(i/t.ONE_THOUSAND)}return bn.fromMiliseconds=r,bn}var g0;function R4(){return g0||(g0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(N4(),t),e.__exportStar(D4(),t)})(Xh)),Xh}var oo={},b0;function M4(){if(b0)return oo;b0=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const s=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:s})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return oo.Watch=t,oo.default=t,oo}var td={},Ya={},m0;function k4(){if(m0)return Ya;m0=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.IWatch=void 0;class t{}return Ya.IWatch=t,Ya}var y0;function U4(){return y0||(y0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),vh.__exportStar(k4(),t)})(td)),td}var w0;function L4(){return w0||(w0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(R4(),t),e.__exportStar(M4(),t),e.__exportStar(U4(),t),e.__exportStar(Xv(),t)})(Qh)),Qh}var B=L4();class pi{}let F4=class extends pi{constructor(e){super()}};const v0=B.FIVE_SECONDS,Hi={pulse:"heartbeat_pulse"};let Zv=class e1 extends F4{constructor(e){super(e),this.events=new sr.EventEmitter,this.interval=v0,this.interval=e?.interval||v0}static async init(e){const r=new e1(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),B.toMiliseconds(this.interval))}pulse(){this.events.emit(Hi.pulse)}};const j4=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,q4=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,B4=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function z4(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){H4(t);return}return e}function H4(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Zu(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!B4.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(j4.test(t)||q4.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,z4)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function V4(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function lr(t,...e){try{return V4(t(...e))}catch(r){return Promise.reject(r)}}function K4(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function W4(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function Dl(t){if(K4(t))return String(t);if(W4(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Dl(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const Hf="base64:";function G4(t){return typeof t=="string"?t:Hf+Q4(t)}function Y4(t){return typeof t!="string"||!t.startsWith(Hf)?t:J4(t.slice(Hf.length))}function J4(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function Q4(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Kr(t){return t&&t.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function X4(...t){return Kr(t.join(":"))}function el(t){return t=Kr(t),t?t+":":""}function Z4(t,e){if(e===void 0)return!0;let r=0,i=t.indexOf(":");for(;i>-1;)r++,i=t.indexOf(":",i+1);return r<=e}function e5(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const t5="memory",r5=()=>{const t=new Map;return{name:t5,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function i5(t={}){const e={mounts:{"":t.driver||r5()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const l of e.mountpoints)if(c.startsWith(l))return{base:l,relativeKey:c.slice(l.length),driver:e.mounts[l]};return{base:"",relativeKey:c,driver:e.mounts[""]}},i=(c,l)=>e.mountpoints.filter(h=>h.startsWith(c)||l&&c.startsWith(h)).map(h=>({relativeBase:c.length>h.length?c.slice(h.length):void 0,mountpoint:h,driver:e.mounts[h]})),s=(c,l)=>{if(e.watching){l=Kr(l);for(const h of e.watchListeners)h(c,l)}},n=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await _0(e.mounts[c],s,c)}},o=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},a=(c,l,h)=>{const f=new Map,m=g=>{let y=f.get(g.base);return y||(y={driver:g.driver,base:g.base,items:[]},f.set(g.base,y)),y};for(const g of c){const y=typeof g=="string",C=Kr(y?g:g.key),S=y?void 0:g.value,A=y||!g.options?l:{...l,...g.options},D=r(C);m(D).items.push({key:C,value:S,relativeKey:D.relativeKey,options:A})}return Promise.all([...f.values()].map(g=>h(g))).then(g=>g.flat())},u={hasItem(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return lr(f.hasItem,h,l)},getItem(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return lr(f.getItem,h,l).then(m=>Zu(m))},getItems(c,l={}){return a(c,l,h=>h.driver.getItems?lr(h.driver.getItems,h.items.map(f=>({key:f.relativeKey,options:f.options})),l).then(f=>f.map(m=>({key:X4(h.base,m.key),value:Zu(m.value)}))):Promise.all(h.items.map(f=>lr(h.driver.getItem,f.relativeKey,f.options).then(m=>({key:f.key,value:Zu(m)})))))},getItemRaw(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return f.getItemRaw?lr(f.getItemRaw,h,l):lr(f.getItem,h,l).then(m=>Y4(m))},async setItem(c,l,h={}){if(l===void 0)return u.removeItem(c);c=Kr(c);const{relativeKey:f,driver:m}=r(c);m.setItem&&(await lr(m.setItem,f,Dl(l),h),m.watch||s("update",c))},async setItems(c,l){await a(c,l,async h=>{if(h.driver.setItems)return lr(h.driver.setItems,h.items.map(f=>({key:f.relativeKey,value:Dl(f.value),options:f.options})),l);h.driver.setItem&&await Promise.all(h.items.map(f=>lr(h.driver.setItem,f.relativeKey,Dl(f.value),f.options)))})},async setItemRaw(c,l,h={}){if(l===void 0)return u.removeItem(c,h);c=Kr(c);const{relativeKey:f,driver:m}=r(c);if(m.setItemRaw)await lr(m.setItemRaw,f,l,h);else if(m.setItem)await lr(m.setItem,f,G4(l),h);else return;m.watch||s("update",c)},async removeItem(c,l={}){typeof l=="boolean"&&(l={removeMeta:l}),c=Kr(c);const{relativeKey:h,driver:f}=r(c);f.removeItem&&(await lr(f.removeItem,h,l),(l.removeMeta||l.removeMata)&&await lr(f.removeItem,h+"$",l),f.watch||s("remove",c))},async getMeta(c,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),c=Kr(c);const{relativeKey:h,driver:f}=r(c),m=Object.create(null);if(f.getMeta&&Object.assign(m,await lr(f.getMeta,h,l)),!l.nativeOnly){const g=await lr(f.getItem,h+"$",l).then(y=>Zu(y));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(m,g))}return m},setMeta(c,l,h={}){return this.setItem(c+"$",l,h)},removeMeta(c,l={}){return this.removeItem(c+"$",l)},async getKeys(c,l={}){c=el(c);const h=i(c,!0);let f=[];const m=[];let g=!0;for(const C of h){C.driver.flags?.maxDepth||(g=!1);const S=await lr(C.driver.getKeys,C.relativeBase,l);for(const A of S){const D=C.mountpoint+Kr(A);f.some(O=>D.startsWith(O))||m.push(D)}f=[C.mountpoint,...f.filter(A=>!A.startsWith(C.mountpoint))]}const y=l.maxDepth!==void 0&&!g;return m.filter(C=>(!y||Z4(C,l.maxDepth))&&e5(C,c))},async clear(c,l={}){c=el(c),await Promise.all(i(c,!1).map(async h=>{if(h.driver.clear)return lr(h.driver.clear,h.relativeBase,l);if(h.driver.removeItem){const f=await h.driver.getKeys(h.relativeBase||"",l);return Promise.all(f.map(m=>h.driver.removeItem(m,l)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>E0(c)))},async watch(c){return await n(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(l=>l!==c),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(c,l){if(c=el(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((h,f)=>f.length-h.length)),e.mounts[c]=l,e.watching&&Promise.resolve(_0(l,s,c)).then(h=>{e.unwatch[c]=h}).catch(console.error),u},async unmount(c,l=!0){c=el(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&(e.unwatch[c]?.(),delete e.unwatch[c]),l&&await E0(e.mounts[c]),e.mountpoints=e.mountpoints.filter(h=>h!==c),delete e.mounts[c])},getMount(c=""){c=Kr(c)+":";const l=r(c);return{driver:l.driver,base:l.base}},getMounts(c="",l={}){return c=Kr(c),i(c,l.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(c,l={})=>u.getKeys(c,l),get:(c,l={})=>u.getItem(c,l),set:(c,l,h={})=>u.setItem(c,l,h),has:(c,l={})=>u.hasItem(c,l),del:(c,l={})=>u.removeItem(c,l),remove:(c,l={})=>u.removeItem(c,l)};return u}function _0(t,e,r){return t.watch?t.watch((i,s)=>e(i,r+s)):()=>{}}async function E0(t){typeof t.dispose=="function"&&await lr(t.dispose)}function Wn(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function t1(t,e){let r;const i=()=>{if(r)return r;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),r=Wn(s),r.then(n=>{n.onclose=()=>r=void 0},()=>{}),r};return(s,n)=>i().then(o=>n(o.transaction(e,s).objectStore(e)))}let rd;function vu(){return rd||(rd=t1("keyval-store","keyval")),rd}function I0(t,e=vu()){return e("readonly",r=>Wn(r.get(t)))}function s5(t,e,r=vu()){return r("readwrite",i=>(i.put(e,t),Wn(i.transaction)))}function n5(t,e=vu()){return e("readwrite",r=>(r.delete(t),Wn(r.transaction)))}function o5(t=vu()){return t("readwrite",e=>(e.clear(),Wn(e.transaction)))}function a5(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Wn(t.transaction)}function c5(t=vu()){return t("readonly",e=>{if(e.getAllKeys)return Wn(e.getAllKeys());const r=[];return a5(e,i=>r.push(i.key)).then(()=>r)})}const u5=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),l5=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Os(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return l5(t)}catch{return t}}function us(t){return typeof t=="string"?t:u5(t)||""}const h5="idb-keyval";var d5=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=s=>e+s;let i;return t.dbName&&t.storeName&&(i=t1(t.dbName,t.storeName)),{name:h5,options:t,async hasItem(s){return!(typeof await I0(r(s),i)>"u")},async getItem(s){return await I0(r(s),i)??null},setItem(s,n){return s5(r(s),n,i)},removeItem(s){return n5(r(s),i)},getKeys(){return c5(i)},clear(){return o5(i)}}};const f5="WALLET_CONNECT_V2_INDEXED_DB",p5="keyvaluestorage";let g5=class{constructor(){this.indexedDb=i5({driver:d5({dbName:f5,storeName:p5})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,us(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var id=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rl={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,i){this[r]=String(i)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(i){r[i]=void 0,delete r[i]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof id<"u"&&id.localStorage?Rl.exports=id.localStorage:typeof window<"u"&&window.localStorage?Rl.exports=window.localStorage:Rl.exports=new e})();function b5(t){var e;return[t[0],Os((e=t[1])!=null?e:"")]}let m5=class{constructor(){this.localStorage=Rl.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(b5)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Os(r)}async setItem(e,r){this.localStorage.setItem(e,us(r))}async removeItem(e){this.localStorage.removeItem(e)}};const y5="wc_storage_version",A0=1,w5=async(t,e,r)=>{const i=y5,s=await e.getItem(i);if(s&&s>=A0){r(e);return}const n=await t.getKeys();if(!n.length){r(e);return}const o=[];for(;n.length;){const a=n.shift();if(!a)continue;const u=a.toLowerCase();if(u.includes("wc@")||u.includes("walletconnect")||u.includes("wc_")||u.includes("wallet_connect")){const c=await t.getItem(a);await e.setItem(a,c),o.push(a)}}await e.setItem(i,A0),r(e),v5(t,o)},v5=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let r1=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new m5;this.storage=e;try{const r=new g5;w5(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var sd,S0;function _5(){if(S0)return sd;S0=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}sd=e;function e(r,i,s){var n=s&&s.stringify||t,o=1;if(typeof r=="object"&&r!==null){var a=i.length+o;if(a===1)return r;var u=new Array(a);u[0]=n(r);for(var c=1;c<a;c++)u[c]=n(i[c]);return u.join(" ")}if(typeof r!="string")return r;var l=i.length;if(l===0)return r;for(var h="",f=1-o,m=-1,g=r&&r.length||0,y=0;y<g;){if(r.charCodeAt(y)===37&&y+1<g){switch(m=m>-1?m:0,r.charCodeAt(y+1)){case 100:case 102:if(f>=l||i[f]==null)break;m<y&&(h+=r.slice(m,y)),h+=Number(i[f]),m=y+2,y++;break;case 105:if(f>=l||i[f]==null)break;m<y&&(h+=r.slice(m,y)),h+=Math.floor(Number(i[f])),m=y+2,y++;break;case 79:case 111:case 106:if(f>=l||i[f]===void 0)break;m<y&&(h+=r.slice(m,y));var C=typeof i[f];if(C==="string"){h+="'"+i[f]+"'",m=y+2,y++;break}if(C==="function"){h+=i[f].name||"<anonymous>",m=y+2,y++;break}h+=n(i[f]),m=y+2,y++;break;case 115:if(f>=l)break;m<y&&(h+=r.slice(m,y)),h+=String(i[f]),m=y+2,y++;break;case 37:m<y&&(h+=r.slice(m,y)),h+="%",m=y+2,y++,f--;break}++f}++y}return m===-1?r:(m<g&&(h+=r.slice(m)),h)}return sd}var nd,C0;function E5(){if(C0)return nd;C0=1;const t=_5();nd=s;const e=T().console||{},r={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:g,res:g,err:f};function i(x,M){return Array.isArray(x)?x.filter(function(R){return R!=="!stdSerializers.err"}):x===!0?Object.keys(M):!1}function s(x){x=x||{},x.browser=x.browser||{};const M=x.browser.transmit;if(M&&typeof M.send!="function")throw Error("pino: transmit option must have a send function");const U=x.browser.write||e;x.browser.write&&(x.browser.asObject=!0);const R=x.serializers||{},L=i(x.browser.serialize,R);let $=x.browser.serialize;Array.isArray(x.browser.serialize)&&x.browser.serialize.indexOf("!stdSerializers.err")>-1&&($=!1);const d=["error","fatal","warn","info","debug","trace"];typeof U=="function"&&(U.error=U.fatal=U.warn=U.info=U.debug=U.trace=U),x.enabled===!1&&(x.level="silent");const b=x.level||"info",_=Object.create(U);_.log||(_.log=C),Object.defineProperty(_,"levelVal",{get:v}),Object.defineProperty(_,"level",{get:I,set:P});const w={transmit:M,serialize:L,asObject:x.browser.asObject,levels:d,timestamp:m(x)};_.levels=s.levels,_.level=b,_.setMaxListeners=_.getMaxListeners=_.emit=_.addListener=_.on=_.prependListener=_.once=_.prependOnceListener=_.removeListener=_.removeAllListeners=_.listeners=_.listenerCount=_.eventNames=_.write=_.flush=C,_.serializers=R,_._serialize=L,_._stdErrSerialize=$,_.child=E,M&&(_._logEvent=h());function v(){return this.level==="silent"?1/0:this.levels.values[this.level]}function I(){return this._level}function P(p){if(p!=="silent"&&!this.levels.values[p])throw Error("unknown level "+p);this._level=p,n(w,_,"error","log"),n(w,_,"fatal","error"),n(w,_,"warn","error"),n(w,_,"info","log"),n(w,_,"debug","log"),n(w,_,"trace","log")}function E(p,N){if(!p)throw new Error("missing bindings for child Pino");N=N||{},L&&p.serializers&&(N.serializers=p.serializers);const q=N.serializers;if(L&&q){var H=Object.assign({},R,q),z=x.browser.serialize===!0?Object.keys(H):L;delete p.serializers,u([p],z,H,this._stdErrSerialize)}function V(Y){this._childLevel=(Y._childLevel|0)+1,this.error=c(Y,p,"error"),this.fatal=c(Y,p,"fatal"),this.warn=c(Y,p,"warn"),this.info=c(Y,p,"info"),this.debug=c(Y,p,"debug"),this.trace=c(Y,p,"trace"),H&&(this.serializers=H,this._serialize=z),M&&(this._logEvent=h([].concat(Y._logEvent.bindings,p)))}return V.prototype=this,new V(this)}return _}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers=r,s.stdTimeFunctions=Object.assign({},{nullTime:S,epochTime:A,unixTime:D,isoTime:O});function n(x,M,U,R){const L=Object.getPrototypeOf(M);M[U]=M.levelVal>M.levels.values[U]?C:L[U]?L[U]:e[U]||e[R]||C,o(x,M,U)}function o(x,M,U){!x.transmit&&M[U]===C||(M[U]=(function(R){return function(){const $=x.timestamp(),d=new Array(arguments.length),b=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var _=0;_<d.length;_++)d[_]=arguments[_];if(x.serialize&&!x.asObject&&u(d,this._serialize,this.serializers,this._stdErrSerialize),x.asObject?R.call(b,a(this,U,d,$)):R.apply(b,d),x.transmit){const w=x.transmit.level||M.level,v=s.levels.values[w],I=s.levels.values[U];if(I<v)return;l(this,{ts:$,methodLevel:U,methodValue:I,transmitValue:s.levels.values[x.transmit.level||M.level],send:x.transmit.send,val:M.levelVal},d)}}})(M[U]))}function a(x,M,U,R){x._serialize&&u(U,x._serialize,x.serializers,x._stdErrSerialize);const L=U.slice();let $=L[0];const d={};R&&(d.time=R),d.level=s.levels.values[M];let b=(x._childLevel|0)+1;if(b<1&&(b=1),$!==null&&typeof $=="object"){for(;b--&&typeof L[0]=="object";)Object.assign(d,L.shift());$=L.length?t(L.shift(),L):void 0}else typeof $=="string"&&($=t(L.shift(),L));return $!==void 0&&(d.msg=$),d}function u(x,M,U,R){for(const L in x)if(R&&x[L]instanceof Error)x[L]=s.stdSerializers.err(x[L]);else if(typeof x[L]=="object"&&!Array.isArray(x[L]))for(const $ in x[L])M&&M.indexOf($)>-1&&$ in U&&(x[L][$]=U[$](x[L][$]))}function c(x,M,U){return function(){const R=new Array(1+arguments.length);R[0]=M;for(var L=1;L<R.length;L++)R[L]=arguments[L-1];return x[U].apply(this,R)}}function l(x,M,U){const R=M.send,L=M.ts,$=M.methodLevel,d=M.methodValue,b=M.val,_=x._logEvent.bindings;u(U,x._serialize||Object.keys(x.serializers),x.serializers,x._stdErrSerialize===void 0?!0:x._stdErrSerialize),x._logEvent.ts=L,x._logEvent.messages=U.filter(function(w){return _.indexOf(w)===-1}),x._logEvent.level.label=$,x._logEvent.level.value=d,R($,x._logEvent,b),x._logEvent=h(_)}function h(x){return{ts:0,messages:[],bindings:x||[],level:{label:"",value:0}}}function f(x){const M={type:x.constructor.name,msg:x.message,stack:x.stack};for(const U in x)M[U]===void 0&&(M[U]=x[U]);return M}function m(x){return typeof x.timestamp=="function"?x.timestamp:x.timestamp===!1?S:A}function g(){return{}}function y(x){return x}function C(){}function S(){return!1}function A(){return Date.now()}function D(){return Math.round(Date.now()/1e3)}function O(){return new Date(Date.now()).toISOString()}function T(){function x(M){return typeof M<"u"&&M}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return x(self)||x(window)||x(this)||{}}}return nd}var Bo=E5();const cn=wh(Bo),I5={level:"info"},_u="custom_context",ig=1e3*1024;let A5=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},$0=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new A5(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},i1=class{constructor(e,r=ig){this.level=e??"error",this.levelValue=Bo.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new $0(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Bo.levels.values.error?console.error(e):r===Bo.levels.values.warn?console.warn(e):r===Bo.levels.values.debug?console.debug(e):r===Bo.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(us({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new $0(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(us({extraMetadata:e})),new Blob(r,{type:"application/json"})}},S5=class{constructor(e,r=ig){this.baseChunkLogger=new i1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=r,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}},C5=class{constructor(e,r=ig){this.baseChunkLogger=new i1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var $5=Object.defineProperty,x5=Object.defineProperties,P5=Object.getOwnPropertyDescriptors,x0=Object.getOwnPropertySymbols,N5=Object.prototype.hasOwnProperty,O5=Object.prototype.propertyIsEnumerable,P0=(t,e,r)=>e in t?$5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xl=(t,e)=>{for(var r in e||(e={}))N5.call(e,r)&&P0(t,r,e[r]);if(x0)for(var r of x0(e))O5.call(e,r)&&P0(t,r,e[r]);return t},Zl=(t,e)=>x5(t,P5(e));function Ts(t){return Zl(Xl({},t),{level:t?.level||I5.level})}function T5(t,e=_u){return t[e]||""}function D5(t,e,r=_u){return t[r]=e,t}function it(t,e=_u){let r="";return typeof t.bindings>"u"?r=T5(t,e):r=t.bindings().context||"",r}function R5(t,e,r=_u){const i=it(t,r);return i.trim()?`${i}/${e}`:e}function je(t,e,r=_u){const i=R5(t,e,r),s=t.child({context:i});return D5(s,i,r)}function M5(t){var e,r;const i=new S5((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cn(Zl(Xl({},t.opts),{level:"trace",browser:Zl(Xl({},(r=t.opts)==null?void 0:r.browser),{write:s=>i.write(s)})})),chunkLoggerController:i}}function k5(t){var e;const r=new C5((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cn(Zl(Xl({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function sg(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?M5(t):k5(t)}var U5=Object.defineProperty,L5=(t,e,r)=>e in t?U5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N0=(t,e,r)=>L5(t,typeof e!="symbol"?e+"":e,r);let F5=class extends pi{constructor(e){super(),this.opts=e,N0(this,"protocol","wc"),N0(this,"version",2)}};var j5=Object.defineProperty,q5=(t,e,r)=>e in t?j5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B5=(t,e,r)=>q5(t,e+"",r);let z5=class extends pi{constructor(e,r){super(),this.core=e,this.logger=r,B5(this,"records",new Map)}},H5=class{constructor(e,r){this.logger=e,this.core=r}},V5=class extends pi{constructor(e,r){super(),this.relayer=e,this.logger=r}},K5=class extends pi{constructor(e){super()}},W5=class{constructor(e,r,i,s){this.core=e,this.logger=r,this.name=i}},G5=class extends pi{constructor(e,r){super(),this.relayer=e,this.logger=r}},Y5=class extends pi{constructor(e,r){super(),this.core=e,this.logger=r}},J5=class{constructor(e,r,i){this.core=e,this.logger=r,this.store=i}},Q5=class{constructor(e,r){this.projectId=e,this.logger=r}},X5=class{constructor(e,r,i){this.core=e,this.logger=r,this.telemetryEnabled=i}};function Z5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function s1(t,...e){if(!Z5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function O0(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function e6(t,e){s1(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const ao=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const od=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function t6(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function n1(t){return typeof t=="string"&&(t=t6(t)),s1(t),t}let r6=class{clone(){return this._cloneInto()}};function i6(t){const e=i=>t().update(n1(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function o1(t=32){if(ao&&typeof ao.getRandomValues=="function")return ao.getRandomValues(new Uint8Array(t));if(ao&&typeof ao.randomBytes=="function")return ao.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function s6(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n),u=i?4:0,c=i?0:4;t.setUint32(e+u,o,i),t.setUint32(e+c,a,i)}let n6=class extends r6{constructor(e,r,i,s){super(),this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=od(this.buffer)}update(e){O0(this);const{view:r,buffer:i,blockLen:s}=this;e=n1(e);const n=e.length;for(let o=0;o<n;){const a=Math.min(s-this.pos,n-o);if(a===s){const u=od(e);for(;s<=n-o;o+=s)this.process(u,o);continue}i.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){O0(this),e6(e,this),this.finished=!0;const{buffer:r,view:i,blockLen:s,isLE:n}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(i,0),o=0);for(let h=o;h<s;h++)r[h]=0;s6(i,s-8,BigInt(this.length*8),n),this.process(i,0);const a=od(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<c;h++)a.setUint32(4*h,l[h],n)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:i,length:s,finished:n,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=n,e.destroyed=o,s%r&&e.buffer.set(i),e}};const tl=BigInt(2**32-1),Vf=BigInt(32);function a1(t,e=!1){return e?{h:Number(t&tl),l:Number(t>>Vf&tl)}:{h:Number(t>>Vf&tl)|0,l:Number(t&tl)|0}}function o6(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=a1(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const a6=(t,e)=>BigInt(t>>>0)<<Vf|BigInt(e>>>0),c6=(t,e,r)=>t>>>r,u6=(t,e,r)=>t<<32-r|e>>>r,l6=(t,e,r)=>t>>>r|e<<32-r,h6=(t,e,r)=>t<<32-r|e>>>r,d6=(t,e,r)=>t<<64-r|e>>>r-32,f6=(t,e,r)=>t>>>r-32|e<<64-r,p6=(t,e)=>e,g6=(t,e)=>t,b6=(t,e,r)=>t<<r|e>>>32-r,m6=(t,e,r)=>e<<r|t>>>32-r,y6=(t,e,r)=>e<<r-32|t>>>64-r,w6=(t,e,r)=>t<<r-32|e>>>64-r;function v6(t,e,r,i){const s=(e>>>0)+(i>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}const _6=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),E6=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,I6=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),A6=(t,e,r,i,s)=>e+r+i+s+(t/2**32|0)|0,S6=(t,e,r,i,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(s>>>0),C6=(t,e,r,i,s,n)=>e+r+i+s+n+(t/2**32|0)|0,de={fromBig:a1,split:o6,toBig:a6,shrSH:c6,shrSL:u6,rotrSH:l6,rotrSL:h6,rotrBH:d6,rotrBL:f6,rotr32H:p6,rotr32L:g6,rotlSH:b6,rotlSL:m6,rotlBH:y6,rotlBL:w6,add:v6,add3L:_6,add3H:E6,add4L:I6,add4H:A6,add5H:C6,add5L:S6},[$6,x6]=de.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ls=new Uint32Array(80),Fs=new Uint32Array(80);let P6=class extends n6{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:i,Bl:s,Ch:n,Cl:o,Dh:a,Dl:u,Eh:c,El:l,Fh:h,Fl:f,Gh:m,Gl:g,Hh:y,Hl:C}=this;return[e,r,i,s,n,o,a,u,c,l,h,f,m,g,y,C]}set(e,r,i,s,n,o,a,u,c,l,h,f,m,g,y,C){this.Ah=e|0,this.Al=r|0,this.Bh=i|0,this.Bl=s|0,this.Ch=n|0,this.Cl=o|0,this.Dh=a|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=h|0,this.Fl=f|0,this.Gh=m|0,this.Gl=g|0,this.Hh=y|0,this.Hl=C|0}process(e,r){for(let D=0;D<16;D++,r+=4)Ls[D]=e.getUint32(r),Fs[D]=e.getUint32(r+=4);for(let D=16;D<80;D++){const O=Ls[D-15]|0,T=Fs[D-15]|0,x=de.rotrSH(O,T,1)^de.rotrSH(O,T,8)^de.shrSH(O,T,7),M=de.rotrSL(O,T,1)^de.rotrSL(O,T,8)^de.shrSL(O,T,7),U=Ls[D-2]|0,R=Fs[D-2]|0,L=de.rotrSH(U,R,19)^de.rotrBH(U,R,61)^de.shrSH(U,R,6),$=de.rotrSL(U,R,19)^de.rotrBL(U,R,61)^de.shrSL(U,R,6),d=de.add4L(M,$,Fs[D-7],Fs[D-16]),b=de.add4H(d,x,L,Ls[D-7],Ls[D-16]);Ls[D]=b|0,Fs[D]=d|0}let{Ah:i,Al:s,Bh:n,Bl:o,Ch:a,Cl:u,Dh:c,Dl:l,Eh:h,El:f,Fh:m,Fl:g,Gh:y,Gl:C,Hh:S,Hl:A}=this;for(let D=0;D<80;D++){const O=de.rotrSH(h,f,14)^de.rotrSH(h,f,18)^de.rotrBH(h,f,41),T=de.rotrSL(h,f,14)^de.rotrSL(h,f,18)^de.rotrBL(h,f,41),x=h&m^~h&y,M=f&g^~f&C,U=de.add5L(A,T,M,x6[D],Fs[D]),R=de.add5H(U,S,O,x,$6[D],Ls[D]),L=U|0,$=de.rotrSH(i,s,28)^de.rotrBH(i,s,34)^de.rotrBH(i,s,39),d=de.rotrSL(i,s,28)^de.rotrBL(i,s,34)^de.rotrBL(i,s,39),b=i&n^i&a^n&a,_=s&o^s&u^o&u;S=y|0,A=C|0,y=m|0,C=g|0,m=h|0,g=f|0,{h,l:f}=de.add(c|0,l|0,R|0,L|0),c=a|0,l=u|0,a=n|0,u=o|0,n=i|0,o=s|0;const w=de.add3L(L,d,_);i=de.add3H(w,R,$,b),s=w|0}({h:i,l:s}=de.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:n,l:o}=de.add(this.Bh|0,this.Bl|0,n|0,o|0),{h:a,l:u}=de.add(this.Ch|0,this.Cl|0,a|0,u|0),{h:c,l}=de.add(this.Dh|0,this.Dl|0,c|0,l|0),{h,l:f}=de.add(this.Eh|0,this.El|0,h|0,f|0),{h:m,l:g}=de.add(this.Fh|0,this.Fl|0,m|0,g|0),{h:y,l:C}=de.add(this.Gh|0,this.Gl|0,y|0,C|0),{h:S,l:A}=de.add(this.Hh|0,this.Hl|0,S|0,A|0),this.set(i,s,n,o,a,u,c,l,h,f,m,g,y,C,S,A)}roundClean(){Ls.fill(0),Fs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const N6=i6(()=>new P6);const ng=BigInt(0),c1=BigInt(1),O6=BigInt(2);function og(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ag(t){if(!og(t))throw new Error("Uint8Array expected")}function ad(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const T6=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function cg(t){ag(t);let e="";for(let r=0;r<t.length;r++)e+=T6[t[r]];return e}function u1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?ng:BigInt("0x"+t)}const gs={_0:48,_9:57,A:65,F:70,a:97,f:102};function T0(t){if(t>=gs._0&&t<=gs._9)return t-gs._0;if(t>=gs.A&&t<=gs.F)return t-(gs.A-10);if(t>=gs.a&&t<=gs.f)return t-(gs.a-10)}function l1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(r);for(let s=0,n=0;s<r;s++,n+=2){const o=T0(t.charCodeAt(n)),a=T0(t.charCodeAt(n+1));if(o===void 0||a===void 0){const u=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+n)}i[s]=o*16+a}return i}function D6(t){return u1(cg(t))}function Ml(t){return ag(t),u1(cg(Uint8Array.from(t).reverse()))}function h1(t,e){return l1(t.toString(16).padStart(e*2,"0"))}function Kf(t,e){return h1(t,e).reverse()}function bs(t,e,r){let i;if(typeof e=="string")try{i=l1(e)}catch(n){throw new Error(t+" must be hex string or Uint8Array, cause: "+n)}else if(og(e))i=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=i.length;if(typeof r=="number"&&s!==r)throw new Error(t+" of length "+r+" expected, got "+s);return i}function D0(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];ag(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}const cd=t=>typeof t=="bigint"&&ng<=t;function R6(t,e,r){return cd(t)&&cd(e)&&cd(r)&&e<=t&&t<r}function Ja(t,e,r,i){if(!R6(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function M6(t){let e;for(e=0;t>ng;t>>=c1,e+=1);return e}const k6=t=>(O6<<BigInt(t-1))-c1,U6={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||og(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ug(t,e,r={}){const i=(s,n,o)=>{const a=U6[n];if(typeof a!="function")throw new Error("invalid validator function");const u=t[s];if(!(o&&u===void 0)&&!a(u,t))throw new Error("param "+String(s)+" is invalid. Expected "+n+", got "+u)};for(const[s,n]of Object.entries(e))i(s,n,!1);for(const[s,n]of Object.entries(r))i(s,n,!0);return t}function R0(t){const e=new WeakMap;return(r,...i)=>{const s=e.get(r);if(s!==void 0)return s;const n=t(r,...i);return e.set(r,n),n}}const gr=BigInt(0),Wt=BigInt(1),$n=BigInt(2),L6=BigInt(3),Wf=BigInt(4),M0=BigInt(5),k0=BigInt(8);function rr(t,e){const r=t%e;return r>=gr?r:e+r}function F6(t,e,r){if(e<gr)throw new Error("invalid exponent, negatives unsupported");if(r<=gr)throw new Error("invalid modulus");if(r===Wt)return gr;let i=Wt;for(;e>gr;)e&Wt&&(i=i*t%r),t=t*t%r,e>>=Wt;return i}function Yi(t,e,r){let i=t;for(;e-- >gr;)i*=i,i%=r;return i}function U0(t,e){if(t===gr)throw new Error("invert: expected non-zero number");if(e<=gr)throw new Error("invert: expected positive modulus, got "+e);let r=rr(t,e),i=e,s=gr,n=Wt;for(;r!==gr;){const o=i/r,a=i%r,u=s-n*o;i=r,r=a,s=n,n=u}if(i!==Wt)throw new Error("invert: does not exist");return rr(s,e)}function j6(t){const e=(t-Wt)/$n;let r,i,s;for(r=t-Wt,i=0;r%$n===gr;r/=$n,i++);for(s=$n;s<t&&F6(s,e,t)!==t-Wt;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){const o=(t+Wt)/Wf;return function(a,u){const c=a.pow(u,o);if(!a.eql(a.sqr(c),u))throw new Error("Cannot find square root");return c}}const n=(r+Wt)/$n;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let u=i,c=o.pow(o.mul(o.ONE,s),r),l=o.pow(a,n),h=o.pow(a,r);for(;!o.eql(h,o.ONE);){if(o.eql(h,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(h);f<u&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const m=o.pow(c,Wt<<BigInt(u-f-1));c=o.sqr(m),l=o.mul(l,m),h=o.mul(h,c),u=f}return l}}function q6(t){if(t%Wf===L6){const e=(t+Wt)/Wf;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%k0===M0){const e=(t-M0)/k0;return function(r,i){const s=r.mul(i,$n),n=r.pow(s,e),o=r.mul(i,n),a=r.mul(r.mul(o,$n),n),u=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return j6(t)}const B6=(t,e)=>(rr(t,e)&Wt)===Wt,z6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function H6(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=z6.reduce((i,s)=>(i[s]="function",i),e);return ug(t,r)}function V6(t,e,r){if(r<gr)throw new Error("invalid exponent, negatives unsupported");if(r===gr)return t.ONE;if(r===Wt)return e;let i=t.ONE,s=e;for(;r>gr;)r&Wt&&(i=t.mul(i,s)),s=t.sqr(s),r>>=Wt;return i}function K6(t,e){const r=new Array(e.length),i=e.reduce((n,o,a)=>t.is0(o)?n:(r[a]=n,t.mul(n,o)),t.ONE),s=t.inv(i);return e.reduceRight((n,o,a)=>t.is0(o)?n:(r[a]=t.mul(n,r[a]),t.mul(n,o)),s),r}function d1(t,e){const r=e!==void 0?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function f1(t,e,r=!1,i={}){if(t<=gr)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:n}=d1(t,e);if(n>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:s,BYTES:n,MASK:k6(s),ZERO:gr,ONE:Wt,create:u=>rr(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return gr<=u&&u<t},is0:u=>u===gr,isOdd:u=>(u&Wt)===Wt,neg:u=>rr(-u,t),eql:(u,c)=>u===c,sqr:u=>rr(u*u,t),add:(u,c)=>rr(u+c,t),sub:(u,c)=>rr(u-c,t),mul:(u,c)=>rr(u*c,t),pow:(u,c)=>V6(a,u,c),div:(u,c)=>rr(u*U0(c,t),t),sqrN:u=>u*u,addN:(u,c)=>u+c,subN:(u,c)=>u-c,mulN:(u,c)=>u*c,inv:u=>U0(u,t),sqrt:i.sqrt||(u=>(o||(o=q6(t)),o(a,u))),invertBatch:u=>K6(a,u),cmov:(u,c,l)=>l?c:u,toBytes:u=>r?Kf(u,n):h1(u,n),fromBytes:u=>{if(u.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+u.length);return r?Ml(u):D6(u)}});return Object.freeze(a)}const L0=BigInt(0),rl=BigInt(1);function ud(t,e){const r=e.negate();return t?r:e}function p1(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function ld(t,e){p1(t,e);const r=Math.ceil(e/t)+1,i=2**(t-1);return{windows:r,windowSize:i}}function W6(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,i)=>{if(!(r instanceof e))throw new Error("invalid point at index "+i)})}function G6(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,i)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+i)})}const hd=new WeakMap,g1=new WeakMap;function dd(t){return g1.get(t)||1}function Y6(t,e){return{constTimeNegate:ud,hasPrecomputes(r){return dd(r)!==1},unsafeLadder(r,i,s=t.ZERO){let n=r;for(;i>L0;)i&rl&&(s=s.add(n)),n=n.double(),i>>=rl;return s},precomputeWindow(r,i){const{windows:s,windowSize:n}=ld(i,e),o=[];let a=r,u=a;for(let c=0;c<s;c++){u=a,o.push(u);for(let l=1;l<n;l++)u=u.add(a),o.push(u);a=u.double()}return o},wNAF(r,i,s){const{windows:n,windowSize:o}=ld(r,e);let a=t.ZERO,u=t.BASE;const c=BigInt(2**r-1),l=2**r,h=BigInt(r);for(let f=0;f<n;f++){const m=f*o;let g=Number(s&c);s>>=h,g>o&&(g-=l,s+=rl);const y=m,C=m+Math.abs(g)-1,S=f%2!==0,A=g<0;g===0?u=u.add(ud(S,i[y])):a=a.add(ud(A,i[C]))}return{p:a,f:u}},wNAFUnsafe(r,i,s,n=t.ZERO){const{windows:o,windowSize:a}=ld(r,e),u=BigInt(2**r-1),c=2**r,l=BigInt(r);for(let h=0;h<o;h++){const f=h*a;if(s===L0)break;let m=Number(s&u);if(s>>=l,m>a&&(m-=c,s+=rl),m===0)continue;let g=i[f+Math.abs(m)-1];m<0&&(g=g.negate()),n=n.add(g)}return n},getPrecomputes(r,i,s){let n=hd.get(i);return n||(n=this.precomputeWindow(i,r),r!==1&&hd.set(i,s(n))),n},wNAFCached(r,i,s){const n=dd(r);return this.wNAF(n,this.getPrecomputes(n,r,s),i)},wNAFCachedUnsafe(r,i,s,n){const o=dd(r);return o===1?this.unsafeLadder(r,i,n):this.wNAFUnsafe(o,this.getPrecomputes(o,r,s),i,n)},setWindowSize(r,i){p1(i,e),g1.set(r,i),hd.delete(r)}}}function J6(t,e,r,i){if(W6(r,t),G6(i,e),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,n=M6(BigInt(r.length)),o=n>12?n-3:n>4?n-2:n?2:1,a=(1<<o)-1,u=new Array(a+1).fill(s),c=Math.floor((e.BITS-1)/o)*o;let l=s;for(let h=c;h>=0;h-=o){u.fill(s);for(let m=0;m<i.length;m++){const g=i[m],y=Number(g>>BigInt(h)&BigInt(a));u[y]=u[y].add(r[m])}let f=s;for(let m=u.length-1,g=s;m>0;m--)g=g.add(u[m]),f=f.add(g);if(l=l.add(f),h!==0)for(let m=0;m<o;m++)l=l.double()}return l}function Q6(t){return H6(t.Fp),ug(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...d1(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Di=BigInt(0),jr=BigInt(1),il=BigInt(2),X6=BigInt(8),Z6={zip215:!0};function eI(t){const e=Q6(t);return ug(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function tI(t){const e=eI(t),{Fp:r,n:i,prehash:s,hash:n,randomBytes:o,nByteLength:a,h:u}=e,c=il<<BigInt(a*8)-jr,l=r.create,h=f1(e.n,e.nBitLength),f=e.uvRatio||((w,v)=>{try{return{isValid:!0,value:r.sqrt(w*r.inv(v))}}catch{return{isValid:!1,value:Di}}}),m=e.adjustScalarBytes||(w=>w),g=e.domain||((w,v,I)=>{if(ad("phflag",I),v.length||I)throw new Error("Contexts/pre-hash are not supported");return w});function y(w,v){Ja("coordinate "+w,v,Di,c)}function C(w){if(!(w instanceof D))throw new Error("ExtendedPoint expected")}const S=R0((w,v)=>{const{ex:I,ey:P,ez:E}=w,p=w.is0();v==null&&(v=p?X6:r.inv(E));const N=l(I*v),q=l(P*v),H=l(E*v);if(p)return{x:Di,y:jr};if(H!==jr)throw new Error("invZ was invalid");return{x:N,y:q}}),A=R0(w=>{const{a:v,d:I}=e;if(w.is0())throw new Error("bad point: ZERO");const{ex:P,ey:E,ez:p,et:N}=w,q=l(P*P),H=l(E*E),z=l(p*p),V=l(z*z),Y=l(q*v),te=l(z*l(Y+H)),ie=l(V+l(I*l(q*H)));if(te!==ie)throw new Error("bad point: equation left != right (1)");const Z=l(P*E),ae=l(p*N);if(Z!==ae)throw new Error("bad point: equation left != right (2)");return!0});class D{constructor(v,I,P,E){this.ex=v,this.ey=I,this.ez=P,this.et=E,y("x",v),y("y",I),y("z",P),y("t",E),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(v){if(v instanceof D)throw new Error("extended point not allowed");const{x:I,y:P}=v||{};return y("x",I),y("y",P),new D(I,P,jr,l(I*P))}static normalizeZ(v){const I=r.invertBatch(v.map(P=>P.ez));return v.map((P,E)=>P.toAffine(I[E])).map(D.fromAffine)}static msm(v,I){return J6(D,h,v,I)}_setWindowSize(v){x.setWindowSize(this,v)}assertValidity(){A(this)}equals(v){C(v);const{ex:I,ey:P,ez:E}=this,{ex:p,ey:N,ez:q}=v,H=l(I*q),z=l(p*E),V=l(P*q),Y=l(N*E);return H===z&&V===Y}is0(){return this.equals(D.ZERO)}negate(){return new D(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:v}=e,{ex:I,ey:P,ez:E}=this,p=l(I*I),N=l(P*P),q=l(il*l(E*E)),H=l(v*p),z=I+P,V=l(l(z*z)-p-N),Y=H+N,te=Y-q,ie=H-N,Z=l(V*te),ae=l(Y*ie),ht=l(V*ie),ge=l(te*Y);return new D(Z,ae,ge,ht)}add(v){C(v);const{a:I,d:P}=e,{ex:E,ey:p,ez:N,et:q}=this,{ex:H,ey:z,ez:V,et:Y}=v;if(I===BigInt(-1)){const Ke=l((p-E)*(z+H)),Vi=l((p+E)*(z-H)),qe=l(Vi-Ke);if(qe===Di)return this.double();const We=l(N*il*Y),Ki=l(q*il*V),De=Ki+We,Re=Vi+Ke,Wi=Ki-We,Me=l(De*qe),st=l(Re*Wi),dn=l(De*Wi),Se=l(qe*Re);return new D(Me,st,Se,dn)}const te=l(E*H),ie=l(p*z),Z=l(q*P*Y),ae=l(N*V),ht=l((E+p)*(H+z)-te-ie),ge=ae-Z,ye=ae+Z,Dt=l(ie-I*te),Ie=l(ht*ge),Te=l(ye*Dt),bi=l(ht*Dt),Ze=l(ge*ye);return new D(Ie,Te,Ze,bi)}subtract(v){return this.add(v.negate())}wNAF(v){return x.wNAFCached(this,v,D.normalizeZ)}multiply(v){const I=v;Ja("scalar",I,jr,i);const{p:P,f:E}=this.wNAF(I);return D.normalizeZ([P,E])[0]}multiplyUnsafe(v,I=D.ZERO){const P=v;return Ja("scalar",P,Di,i),P===Di?T:this.is0()||P===jr?this:x.wNAFCachedUnsafe(this,P,D.normalizeZ,I)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return x.unsafeLadder(this,i).is0()}toAffine(v){return S(this,v)}clearCofactor(){const{h:v}=e;return v===jr?this:this.multiplyUnsafe(v)}static fromHex(v,I=!1){const{d:P,a:E}=e,p=r.BYTES;v=bs("pointHex",v,p),ad("zip215",I);const N=v.slice(),q=v[p-1];N[p-1]=q&-129;const H=Ml(N),z=I?c:r.ORDER;Ja("pointHex.y",H,Di,z);const V=l(H*H),Y=l(V-jr),te=l(P*V-E);let{isValid:ie,value:Z}=f(Y,te);if(!ie)throw new Error("Point.fromHex: invalid y coordinate");const ae=(Z&jr)===jr,ht=(q&128)!==0;if(!I&&Z===Di&&ht)throw new Error("Point.fromHex: x=0 and x_0=1");return ht!==ae&&(Z=l(-Z)),D.fromAffine({x:Z,y:H})}static fromPrivateKey(v){return R(v).point}toRawBytes(){const{x:v,y:I}=this.toAffine(),P=Kf(I,r.BYTES);return P[P.length-1]|=v&jr?128:0,P}toHex(){return cg(this.toRawBytes())}}D.BASE=new D(e.Gx,e.Gy,jr,l(e.Gx*e.Gy)),D.ZERO=new D(Di,jr,jr,Di);const{BASE:O,ZERO:T}=D,x=Y6(D,a*8);function M(w){return rr(w,i)}function U(w){return M(Ml(w))}function R(w){const v=r.BYTES;w=bs("private key",w,v);const I=bs("hashed private key",n(w),2*v),P=m(I.slice(0,v)),E=I.slice(v,2*v),p=U(P),N=O.multiply(p),q=N.toRawBytes();return{head:P,prefix:E,scalar:p,point:N,pointBytes:q}}function L(w){return R(w).pointBytes}function $(w=new Uint8Array,...v){const I=D0(...v);return U(n(g(I,bs("context",w),!!s)))}function d(w,v,I={}){w=bs("message",w),s&&(w=s(w));const{prefix:P,scalar:E,pointBytes:p}=R(v),N=$(I.context,P,w),q=O.multiply(N).toRawBytes(),H=$(I.context,q,p,w),z=M(N+H*E);Ja("signature.s",z,Di,i);const V=D0(q,Kf(z,r.BYTES));return bs("result",V,r.BYTES*2)}const b=Z6;function _(w,v,I,P=b){const{context:E,zip215:p}=P,N=r.BYTES;w=bs("signature",w,2*N),v=bs("message",v),I=bs("publicKey",I,N),p!==void 0&&ad("zip215",p),s&&(v=s(v));const q=Ml(w.slice(N,2*N));let H,z,V;try{H=D.fromHex(I,p),z=D.fromHex(w.slice(0,N),p),V=O.multiplyUnsafe(q)}catch{return!1}if(!p&&H.isSmallOrder())return!1;const Y=$(E,z.toRawBytes(),H.toRawBytes(),v);return z.add(H.multiplyUnsafe(Y)).subtract(V).clearCofactor().equals(D.ZERO)}return O._setWindowSize(8),{CURVE:e,getPublicKey:L,sign:d,verify:_,ExtendedPoint:D,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>o(r.BYTES),precompute(w=8,v=D.BASE){return v._setWindowSize(w),v.multiply(BigInt(3)),v}}}}BigInt(0),BigInt(1);const lg=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),F0=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const rI=BigInt(1),j0=BigInt(2);BigInt(3);const iI=BigInt(5),sI=BigInt(8);function nI(t){const e=BigInt(10),r=BigInt(20),i=BigInt(40),s=BigInt(80),n=lg,o=t*t%n*t%n,a=Yi(o,j0,n)*o%n,u=Yi(a,rI,n)*t%n,c=Yi(u,iI,n)*u%n,l=Yi(c,e,n)*c%n,h=Yi(l,r,n)*l%n,f=Yi(h,i,n)*h%n,m=Yi(f,s,n)*f%n,g=Yi(m,s,n)*f%n,y=Yi(g,e,n)*c%n;return{pow_p_5_8:Yi(y,j0,n)*t%n,b2:o}}function oI(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function aI(t,e){const r=lg,i=rr(e*e*e,r),s=rr(i*i*e,r),n=nI(t*s).pow_p_5_8;let o=rr(t*i*n,r);const a=rr(e*o*o,r),u=o,c=rr(o*F0,r),l=a===t,h=a===rr(-t,r),f=a===rr(-t*F0,r);return l&&(o=u),(h||f)&&(o=c),B6(o,r)&&(o=rr(-o,r)),{isValid:l||h,value:o}}const cI=f1(lg,void 0,!0),uI={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cI,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:sI,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:N6,randomBytes:o1,adjustScalarBytes:oI,uvRatio:aI},b1=tI(uI),lI="EdDSA",hI="JWT",eh=".",_h="base64url",m1="utf8",y1="utf8",dI=":",fI="did",pI="key",q0="base58btc",gI="z",bI="K36",mI=32;function hg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function w1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?hg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function v1(t,e){e||(e=t.reduce((s,n)=>s+n.length,0));const r=w1(e);let i=0;for(const s of t)r.set(s,i),i+=s.length;return hg(r)}function yI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var n=t.charAt(s),o=n.charCodeAt(0);if(r[o]!==255)throw new TypeError(n+" is ambiguous");r[o]=s}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var y=0,C=0,S=0,A=g.length;S!==A&&g[S]===0;)S++,y++;for(var D=(A-S)*l+1>>>0,O=new Uint8Array(D);S!==A;){for(var T=g[S],x=0,M=D-1;(T!==0||x<C)&&M!==-1;M--,x++)T+=256*O[M]>>>0,O[M]=T%a>>>0,T=T/a>>>0;if(T!==0)throw new Error("Non-zero carry");C=x,S++}for(var U=D-C;U!==D&&O[U]===0;)U++;for(var R=u.repeat(y);U<D;++U)R+=t.charAt(O[U]);return R}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var y=0;if(g[y]!==" "){for(var C=0,S=0;g[y]===u;)C++,y++;for(var A=(g.length-y)*c+1>>>0,D=new Uint8Array(A);g[y];){var O=r[g.charCodeAt(y)];if(O===255)return;for(var T=0,x=A-1;(O!==0||T<S)&&x!==-1;x--,T++)O+=a*D[x]>>>0,D[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");S=T,y++}if(g[y]!==" "){for(var M=A-S;M!==A&&D[M]===0;)M++;for(var U=new Uint8Array(C+(A-M)),R=C;M!==A;)U[R++]=D[M++];return U}}}function m(g){var y=f(g);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:f,decode:m}}var wI=yI,vI=wI;const _1=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},_I=t=>new TextEncoder().encode(t),EI=t=>new TextDecoder().decode(t);let II=class{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},AI=class{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return E1(this,e)}},SI=class{constructor(e){this.decoders=e}or(e){return E1(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const E1=(t,e)=>new SI({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let CI=class{constructor(e,r,i,s){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=s,this.encoder=new II(e,r,i),this.decoder=new AI(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const Eh=({name:t,prefix:e,encode:r,decode:i})=>new CI(t,e,r,i),Eu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:s}=vI(r,e);return Eh({prefix:t,name:e,encode:i,decode:n=>_1(s(n))})},$I=(t,e,r,i)=>{const s={};for(let l=0;l<e.length;++l)s[e[l]]=l;let n=t.length;for(;t[n-1]==="=";)--n;const o=new Uint8Array(n*r/8|0);let a=0,u=0,c=0;for(let l=0;l<n;++l){const h=s[t[l]];if(h===void 0)throw new SyntaxError(`Non-${i} character`);u=u<<r|h,a+=r,a>=8&&(a-=8,o[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return o},xI=(t,e,r)=>{const i=e[e.length-1]==="=",s=(1<<r)-1;let n="",o=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],o+=8;o>r;)o-=r,n+=e[s&a>>o];if(o&&(n+=e[s&a<<r-o]),i)for(;n.length*r&7;)n+="=";return n},Sr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Eh({prefix:e,name:t,encode(s){return xI(s,i,r)},decode(s){return $I(s,i,r,t)}}),PI=Eh({prefix:"\0",name:"identity",encode:t=>EI(t),decode:t=>_I(t)});var NI=Object.freeze({__proto__:null,identity:PI});const OI=Sr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var TI=Object.freeze({__proto__:null,base2:OI});const DI=Sr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var RI=Object.freeze({__proto__:null,base8:DI});const MI=Eu({prefix:"9",name:"base10",alphabet:"0123456789"});var kI=Object.freeze({__proto__:null,base10:MI});const UI=Sr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LI=Sr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var FI=Object.freeze({__proto__:null,base16:UI,base16upper:LI});const jI=Sr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qI=Sr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BI=Sr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zI=Sr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),HI=Sr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),VI=Sr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),KI=Sr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WI=Sr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),GI=Sr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var YI=Object.freeze({__proto__:null,base32:jI,base32upper:qI,base32pad:BI,base32padupper:zI,base32hex:HI,base32hexupper:VI,base32hexpad:KI,base32hexpadupper:WI,base32z:GI});const JI=Eu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QI=Eu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var XI=Object.freeze({__proto__:null,base36:JI,base36upper:QI});const ZI=Eu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),e8=Eu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var t8=Object.freeze({__proto__:null,base58btc:ZI,base58flickr:e8});const r8=Sr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),i8=Sr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s8=Sr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n8=Sr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var o8=Object.freeze({__proto__:null,base64:r8,base64pad:i8,base64url:s8,base64urlpad:n8});const I1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),a8=I1.reduce((t,e,r)=>(t[r]=e,t),[]),c8=I1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function u8(t){return t.reduce((e,r)=>(e+=a8[r],e),"")}function l8(t){const e=[];for(const r of t){const i=c8[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const h8=Eh({prefix:"🚀",name:"base256emoji",encode:u8,decode:l8});var d8=Object.freeze({__proto__:null,base256emoji:h8}),f8=A1,B0=128,p8=-128,g8=Math.pow(2,31);function A1(t,e,r){e=e||[],r=r||0;for(var i=r;t>=g8;)e[r++]=t&255|B0,t/=128;for(;t&p8;)e[r++]=t&255|B0,t>>>=7;return e[r]=t|0,A1.bytes=r-i+1,e}var b8=Gf,m8=128,z0=127;function Gf(t,i){var r=0,i=i||0,s=0,n=i,o,a=t.length;do{if(n>=a)throw Gf.bytes=0,new RangeError("Could not decode varint");o=t[n++],r+=s<28?(o&z0)<<s:(o&z0)*Math.pow(2,s),s+=7}while(o>=m8);return Gf.bytes=n-i,r}var y8=Math.pow(2,7),w8=Math.pow(2,14),v8=Math.pow(2,21),_8=Math.pow(2,28),E8=Math.pow(2,35),I8=Math.pow(2,42),A8=Math.pow(2,49),S8=Math.pow(2,56),C8=Math.pow(2,63),$8=function(t){return t<y8?1:t<w8?2:t<v8?3:t<_8?4:t<E8?5:t<I8?6:t<A8?7:t<S8?8:t<C8?9:10},x8={encode:f8,decode:b8,encodingLength:$8},S1=x8;const H0=(t,e,r=0)=>(S1.encode(t,e,r),e),V0=t=>S1.encodingLength(t),Yf=(t,e)=>{const r=e.byteLength,i=V0(t),s=i+V0(r),n=new Uint8Array(s+r);return H0(t,n,0),H0(r,n,i),n.set(e,s),new P8(t,r,e,n)};let P8=class{constructor(e,r,i,s){this.code=e,this.size=r,this.digest=i,this.bytes=s}};const C1=({name:t,code:e,encode:r})=>new N8(t,e,r);let N8=class{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Yf(this.code,r):r.then(i=>Yf(this.code,i))}else throw Error("Unknown type, must be binary type")}};const $1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),O8=C1({name:"sha2-256",code:18,encode:$1("SHA-256")}),T8=C1({name:"sha2-512",code:19,encode:$1("SHA-512")});var D8=Object.freeze({__proto__:null,sha256:O8,sha512:T8});const x1=0,R8="identity",P1=_1,M8=t=>Yf(x1,P1(t)),k8={code:x1,name:R8,encode:P1,digest:M8};var U8=Object.freeze({__proto__:null,identity:k8});new TextEncoder,new TextDecoder;const K0={...NI,...TI,...RI,...kI,...FI,...YI,...XI,...t8,...o8,...d8};({...D8,...U8});function N1(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const W0=N1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fd=N1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=w1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),O1={utf8:W0,"utf-8":W0,hex:K0.base16,latin1:fd,ascii:fd,binary:fd,...K0};function Ih(t,e="utf8"){const r=O1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function va(t,e="utf8"){const r=O1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?hg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function G0(t){return Os(Ih(va(t,_h),m1))}function th(t){return Ih(va(us(t),m1),_h)}function dg(t){const e=va(bI,q0),r=gI+Ih(v1([e,t]),q0);return[fI,pI,r].join(dI)}function L8(t){return Ih(t,_h)}function F8(t){return va(t,_h)}function j8(t){return va([th(t.header),th(t.payload)].join(eh),y1)}function q8(t){return[th(t.header),th(t.payload),L8(t.signature)].join(eh)}function oa(t){const e=t.split(eh),r=G0(e[0]),i=G0(e[1]),s=F8(e[2]),n=va(e.slice(0,2).join(eh),y1);return{header:r,payload:i,signature:s,data:n}}function rh(t=o1(mI)){const e=b1.getPublicKey(t);return{secretKey:v1([t,e]),publicKey:e}}async function T1(t,e,r,i,s=B.fromMiliseconds(Date.now())){const n={alg:lI,typ:hI},o=dg(i.publicKey),a=s+r,u={iss:o,sub:t,aud:e,iat:s,exp:a},c=j8({header:n,payload:u}),l=b1.sign(c,i.secretKey.slice(0,32));return q8({header:n,payload:u,signature:l})}var Y0=function(t,e,r){if(r||arguments.length===2)for(var i=0,s=e.length,n;i<s;i++)(n||!(i in e))&&(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},B8=(function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t})(),z8=(function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t})(),H8=(function(){function t(e,r,i,s){this.name=e,this.version=r,this.os=i,this.bot=s,this.type="bot-device"}return t})(),V8=(function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t})(),K8=(function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t})(),W8=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,G8=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,J0=3,Y8=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",W8]],Q0=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function D1(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new K8:typeof navigator<"u"?Q8(navigator.userAgent):Z8()}function J8(t){return t!==""&&Y8.reduce(function(e,r){var i=r[0],s=r[1];if(e)return e;var n=s.exec(t);return!!n&&[i,n]},!1)}function Q8(t){var e=J8(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new V8;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<J0&&(s=Y0(Y0([],s,!0),eA(J0-s.length),!0)):s=[];var n=s.join("."),o=X8(t),a=G8.exec(t);return a&&a[1]?new H8(r,n,o,a[1]):new B8(r,n,o)}function X8(t){for(var e=0,r=Q0.length;e<r;e++){var i=Q0[e],s=i[0],n=i[1],o=n.exec(t);if(o)return s}return null}function Z8(){var t=typeof process<"u"&&process.version;return t?new z8(process.version.slice(1)):null}function eA(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var et={},X0;function R1(){if(X0)return et;X0=1,Object.defineProperty(et,"__esModule",{value:!0}),et.getLocalStorage=et.getLocalStorageOrThrow=et.getCrypto=et.getCryptoOrThrow=et.getLocation=et.getLocationOrThrow=et.getNavigator=et.getNavigatorOrThrow=et.getDocument=et.getDocumentOrThrow=et.getFromWindowOrThrow=et.getFromWindow=void 0;function t(f){let m;return typeof window<"u"&&typeof window[f]<"u"&&(m=window[f]),m}et.getFromWindow=t;function e(f){const m=t(f);if(!m)throw new Error(`${f} is not defined in Window`);return m}et.getFromWindowOrThrow=e;function r(){return e("document")}et.getDocumentOrThrow=r;function i(){return t("document")}et.getDocument=i;function s(){return e("navigator")}et.getNavigatorOrThrow=s;function n(){return t("navigator")}et.getNavigator=n;function o(){return e("location")}et.getLocationOrThrow=o;function a(){return t("location")}et.getLocation=a;function u(){return e("crypto")}et.getCryptoOrThrow=u;function c(){return t("crypto")}et.getCrypto=c;function l(){return e("localStorage")}et.getLocalStorageOrThrow=l;function h(){return t("localStorage")}return et.getLocalStorage=h,et}var Qr=R1(),Qa={},Z0;function tA(){if(Z0)return Qa;Z0=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.getWindowMetadata=void 0;const t=R1();function e(){let r,i;try{r=t.getDocumentOrThrow(),i=t.getLocationOrThrow()}catch{return null}function s(){const m=r.getElementsByTagName("link"),g=[];for(let y=0;y<m.length;y++){const C=m[y],S=C.getAttribute("rel");if(S&&S.toLowerCase().indexOf("icon")>-1){const A=C.getAttribute("href");if(A)if(A.toLowerCase().indexOf("https:")===-1&&A.toLowerCase().indexOf("http:")===-1&&A.indexOf("//")!==0){let D=i.protocol+"//"+i.host;if(A.indexOf("/")===0)D+=A;else{const O=i.pathname.split("/");O.pop();const T=O.join("/");D+=T+"/"+A}g.push(D)}else if(A.indexOf("//")===0){const D=i.protocol+A;g.push(D)}else g.push(A)}}return g}function n(...m){const g=r.getElementsByTagName("meta");for(let y=0;y<g.length;y++){const C=g[y],S=["itemprop","property","name"].map(A=>C.getAttribute(A)).filter(A=>A?m.includes(A):!1);if(S.length&&S){const A=C.getAttribute("content");if(A)return A}}return""}function o(){let m=n("name","og:site_name","og:title","twitter:title");return m||(m=r.title),m}function a(){return n("description","og:description","twitter:description","keywords")}const u=o(),c=a(),l=i.origin,h=s();return{description:c,url:l,icons:h,name:u}}return Qa.getWindowMetadata=e,Qa}var M1=tA();function Fc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function eb(t){return Fc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const k1="2.23.2";let pd={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${k1}`},Ah=class Jf extends Error{constructor(e,r={}){const i=r.cause instanceof Jf?r.cause.details:r.cause?.message?r.cause.message:r.details,s=r.cause instanceof Jf&&r.cause.docsPath||r.docsPath,n=pd.getDocsUrl?.({...r,docsPath:s}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...n?[`Docs: ${n}`]:[],...i?[`Details: ${i}`]:[],...pd.version?[`Version: ${pd.version}`]:[]].join(`
|
|
3
|
-
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=k1}walk(e){return U1(this,e)}};function U1(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?U1(t.cause,e):e?null:t}let L1=class extends Ah{constructor({size:e,targetSize:r,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};function _a(t,{dir:e,size:r=32}={}){return typeof t=="string"?rA(t,{dir:e,size:r}):iA(t,{dir:e,size:r})}function rA(t,{dir:e,size:r=32}={}){if(r===null)return t;const i=t.replace("0x","");if(i.length>r*2)throw new L1({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function iA(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new L1({size:t.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const n=e==="right";i[n?s:r-s-1]=t[n?s:t.length-s-1]}return i}let sA=class extends Ah{constructor({max:e,min:r,signed:i,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},nA=class extends Ah{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function Ea(t,{size:e}){if(eb(t)>e)throw new nA({givenSize:eb(t),maxSize:e})}function Qf(t,e={}){const{signed:r}=e;e.size&&Ea(t,{size:e.size});const i=BigInt(t);if(!r)return i;const s=(t.length-2)/2,n=(1n<<BigInt(s)*8n-1n)-1n;return i<=n?i:i-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function oA(t,e={}){return Number(Qf(t,e))}const aA=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Xf(t,e={}){return typeof t=="number"||typeof t=="bigint"?j1(t,e):typeof t=="string"?lA(t,e):typeof t=="boolean"?cA(t,e):F1(t,e)}function cA(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{size:e.size})):r}function F1(t,e={}){let r="";for(let s=0;s<t.length;s++)r+=aA[t[s]];const i=`0x${r}`;return typeof e.size=="number"?(Ea(i,{size:e.size}),_a(i,{dir:"right",size:e.size})):i}function j1(t,e={}){const{signed:r,size:i}=e,s=BigInt(t);let n;i?r?n=(1n<<BigInt(i)*8n-1n)-1n:n=2n**(BigInt(i)*8n)-1n:typeof t=="number"&&(n=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof n=="bigint"&&r?-n-1n:0;if(n&&s>n||s<o){const u=typeof t=="bigint"?"n":"";throw new sA({max:n?`${n}${u}`:void 0,min:`${o}${u}`,signed:r,size:i,value:`${t}${u}`})}const a=`0x${(r&&s<0?(1n<<BigInt(i*8))+BigInt(s):s).toString(16)}`;return i?_a(a,{size:i}):a}const uA=new TextEncoder;function lA(t,e={}){const r=uA.encode(t);return F1(r,e)}const hA=new TextEncoder;function dA(t,e={}){return typeof t=="number"||typeof t=="bigint"?pA(t,e):typeof t=="boolean"?fA(t,e):Fc(t)?q1(t,e):B1(t,e)}function fA(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{size:e.size})):r}const ms={zero:48,nine:57,A:65,F:70,a:97,f:102};function tb(t){if(t>=ms.zero&&t<=ms.nine)return t-ms.zero;if(t>=ms.A&&t<=ms.F)return t-(ms.A-10);if(t>=ms.a&&t<=ms.f)return t-(ms.a-10)}function q1(t,e={}){let r=t;e.size&&(Ea(r,{size:e.size}),r=_a(r,{dir:"right",size:e.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,n=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const u=tb(i.charCodeAt(a++)),c=tb(i.charCodeAt(a++));if(u===void 0||c===void 0)throw new Ah(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);n[o]=u*16+c}return n}function pA(t,e){const r=j1(t,e);return q1(r)}function B1(t,e={}){const r=hA.encode(t);return typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{dir:"right",size:e.size})):r}function ih(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function gA(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Sh(t,...e){if(!gA(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function QQ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ih(t.outputLen),ih(t.blockLen)}function rb(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function bA(t,e){Sh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const sl=BigInt(2**32-1),ib=BigInt(32);function mA(t,e=!1){return e?{h:Number(t&sl),l:Number(t>>ib&sl)}:{h:Number(t>>ib&sl)|0,l:Number(t&sl)|0}}function yA(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=mA(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const wA=(t,e,r)=>t<<r|e>>>32-r,vA=(t,e,r)=>e<<r|t>>>32-r,_A=(t,e,r)=>e<<r-32|t>>>64-r,EA=(t,e,r)=>t<<r-32|e>>>64-r,co=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function IA(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function XQ(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ZQ(t,e){return t<<32-e|t>>>e}const sb=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function AA(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function nb(t){for(let e=0;e<t.length;e++)t[e]=AA(t[e])}function SA(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function z1(t){return typeof t=="string"&&(t=SA(t)),Sh(t),t}function eX(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];Sh(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}let CA=class{clone(){return this._cloneInto()}};function $A(t){const e=i=>t().update(z1(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function rX(t=32){if(co&&typeof co.getRandomValues=="function")return co.getRandomValues(new Uint8Array(t));if(co&&typeof co.randomBytes=="function")return co.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const H1=[],V1=[],K1=[],xA=BigInt(0),Xa=BigInt(1),PA=BigInt(2),NA=BigInt(7),OA=BigInt(256),TA=BigInt(113);for(let t=0,e=Xa,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],H1.push(2*(5*i+r)),V1.push((t+1)*(t+2)/2%64);let s=xA;for(let n=0;n<7;n++)e=(e<<Xa^(e>>NA)*TA)%OA,e&PA&&(s^=Xa<<(Xa<<BigInt(n))-Xa);K1.push(s)}const[DA,RA]=yA(K1,!0),ob=(t,e,r)=>r>32?_A(t,e,r):wA(t,e,r),ab=(t,e,r)=>r>32?EA(t,e,r):vA(t,e,r);function MA(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=ob(c,l,1)^r[a],f=ab(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=V1[o],u=ob(s,n,a),c=ab(s,n,a),l=H1[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=DA[i],t[1]^=RA[i]}r.fill(0)}let kA=class W1 extends CA{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ih(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=IA(this.state)}keccak(){sb||nb(this.state32),MA(this.state32,this.rounds),sb||nb(this.state32),this.posOut=0,this.pos=0}update(e){rb(this);const{blockLen:r,state:i}=this;e=z1(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){rb(this,!1),Sh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ih(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(bA(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new W1(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const UA=(t,e,r)=>$A(()=>new kA(e,t,r)),LA=UA(1,136,256/8);function G1(t,e){const r=e||"hex",i=LA(Fc(t,{strict:!1})?dA(t):t);return r==="bytes"?i:Xf(i)}let FA=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}};const gd=new FA(8192);function jA(t,e){if(gd.has(`${t}.${e}`))return gd.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),i=G1(B1(r),"bytes"),s=r.split("");for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(i[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const n=`0x${s.join("")}`;return gd.set(`${t}.${e}`,n),n}function qA(t){const e=G1(`0x${t.substring(4)}`).substring(26);return jA(`0x${e}`)}async function BA({hash:t,signature:e}){const r=Fc(t)?t:Xf(t),{secp256k1:i}=await Jl(async()=>{const{secp256k1:o}=await import("./secp256k1-BWP6UeVl.js");return{secp256k1:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:l,v:h,yParity:f}=e,m=Number(f??h),g=cb(m);return new i.Signature(Qf(c),Qf(l)).addRecoveryBit(g)}const o=Fc(e)?e:Xf(e),a=oA(`0x${o.slice(130)}`),u=cb(a);return i.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(u)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function cb(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function zA({hash:t,signature:e}){return qA(await BA({hash:t,signature:e}))}function Y1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function ta(t,e){e||(e=t.reduce((s,n)=>s+n.length,0));const r=Y1(e);let i=0;for(const s of t)r.set(s,i),i+=s.length;return r}function HA(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var n=t.charAt(s),o=n.charCodeAt(0);if(r[o]!==255)throw new TypeError(n+" is ambiguous");r[o]=s}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var y=0,C=0,S=0,A=g.length;S!==A&&g[S]===0;)S++,y++;for(var D=(A-S)*l+1>>>0,O=new Uint8Array(D);S!==A;){for(var T=g[S],x=0,M=D-1;(T!==0||x<C)&&M!==-1;M--,x++)T+=256*O[M]>>>0,O[M]=T%a>>>0,T=T/a>>>0;if(T!==0)throw new Error("Non-zero carry");C=x,S++}for(var U=D-C;U!==D&&O[U]===0;)U++;for(var R=u.repeat(y);U<D;++U)R+=t.charAt(O[U]);return R}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var y=0;if(g[y]!==" "){for(var C=0,S=0;g[y]===u;)C++,y++;for(var A=(g.length-y)*c+1>>>0,D=new Uint8Array(A);g[y];){var O=r[g.charCodeAt(y)];if(O===255)return;for(var T=0,x=A-1;(O!==0||T<S)&&x!==-1;x--,T++)O+=a*D[x]>>>0,D[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");S=T,y++}if(g[y]!==" "){for(var M=A-S;M!==A&&D[M]===0;)M++;for(var U=new Uint8Array(C+(A-M)),R=C;M!==A;)U[R++]=D[M++];return U}}}function m(g){var y=f(g);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:f,decode:m}}var VA=HA,KA=VA;const WA=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},GA=t=>new TextEncoder().encode(t),YA=t=>new TextDecoder().decode(t);class JA{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class QA{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return J1(this,e)}}class XA{constructor(e){this.decoders=e}or(e){return J1(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const J1=(t,e)=>new XA({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class ZA{constructor(e,r,i,s){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=s,this.encoder=new JA(e,r,i),this.decoder=new QA(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ch=({name:t,prefix:e,encode:r,decode:i})=>new ZA(t,e,r,i),Iu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:s}=KA(r,e);return Ch({prefix:t,name:e,encode:i,decode:n=>WA(s(n))})},eS=(t,e,r,i)=>{const s={};for(let l=0;l<e.length;++l)s[e[l]]=l;let n=t.length;for(;t[n-1]==="=";)--n;const o=new Uint8Array(n*r/8|0);let a=0,u=0,c=0;for(let l=0;l<n;++l){const h=s[t[l]];if(h===void 0)throw new SyntaxError(`Non-${i} character`);u=u<<r|h,a+=r,a>=8&&(a-=8,o[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return o},tS=(t,e,r)=>{const i=e[e.length-1]==="=",s=(1<<r)-1;let n="",o=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],o+=8;o>r;)o-=r,n+=e[s&a>>o];if(o&&(n+=e[s&a<<r-o]),i)for(;n.length*r&7;)n+="=";return n},Cr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Ch({prefix:e,name:t,encode(s){return tS(s,i,r)},decode(s){return eS(s,i,r,t)}}),rS=Ch({prefix:"\0",name:"identity",encode:t=>YA(t),decode:t=>GA(t)}),iS=Object.freeze(Object.defineProperty({__proto__:null,identity:rS},Symbol.toStringTag,{value:"Module"})),sS=Cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),nS=Object.freeze(Object.defineProperty({__proto__:null,base2:sS},Symbol.toStringTag,{value:"Module"})),oS=Cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),aS=Object.freeze(Object.defineProperty({__proto__:null,base8:oS},Symbol.toStringTag,{value:"Module"})),cS=Iu({prefix:"9",name:"base10",alphabet:"0123456789"}),uS=Object.freeze(Object.defineProperty({__proto__:null,base10:cS},Symbol.toStringTag,{value:"Module"})),lS=Cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hS=Cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),dS=Object.freeze(Object.defineProperty({__proto__:null,base16:lS,base16upper:hS},Symbol.toStringTag,{value:"Module"})),fS=Cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),pS=Cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gS=Cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bS=Cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mS=Cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yS=Cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wS=Cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vS=Cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_S=Cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ES=Object.freeze(Object.defineProperty({__proto__:null,base32:fS,base32hex:mS,base32hexpad:wS,base32hexpadupper:vS,base32hexupper:yS,base32pad:gS,base32padupper:bS,base32upper:pS,base32z:_S},Symbol.toStringTag,{value:"Module"})),IS=Iu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AS=Iu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),SS=Object.freeze(Object.defineProperty({__proto__:null,base36:IS,base36upper:AS},Symbol.toStringTag,{value:"Module"})),CS=Iu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),$S=Iu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),xS=Object.freeze(Object.defineProperty({__proto__:null,base58btc:CS,base58flickr:$S},Symbol.toStringTag,{value:"Module"})),PS=Cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),NS=Cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),OS=Cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TS=Cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),DS=Object.freeze(Object.defineProperty({__proto__:null,base64:PS,base64pad:NS,base64url:OS,base64urlpad:TS},Symbol.toStringTag,{value:"Module"})),Q1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),RS=Q1.reduce((t,e,r)=>(t[r]=e,t),[]),MS=Q1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function kS(t){return t.reduce((e,r)=>(e+=RS[r],e),"")}function US(t){const e=[];for(const r of t){const i=MS[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const LS=Ch({prefix:"🚀",name:"base256emoji",encode:kS,decode:US}),FS=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:LS},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const ub={...iS,...nS,...aS,...uS,...dS,...ES,...SS,...xS,...DS,...FS};function X1(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const lb=X1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),bd=X1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Y1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Z1={utf8:lb,"utf-8":lb,hex:ub.base16,latin1:bd,ascii:bd,binary:bd,...ub};function _t(t,e="utf8"){const r=Z1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Fe(t,e="utf8"){const r=Z1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var md={};const jS="6.6.1",qS={version:jS};var yd={},kl={exports:{}},BS=kl.exports,hb;function Ds(){return hb||(hb=1,(function(t){(function(e,r){function i($,d){if(!$)throw new Error(d||"Assertion failed")}function s($,d){$.super_=d;var b=function(){};b.prototype=d.prototype,$.prototype=new b,$.prototype.constructor=$}function n($,d,b){if(n.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((d==="le"||d==="be")&&(b=d,d=10),this._init($||0,d||10,b||"be"))}typeof e=="object"?e.exports=n:r.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Jv.Buffer}catch{}n.isBN=function(d){return d instanceof n?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===n.wordSize&&Array.isArray(d.words)},n.max=function(d,b){return d.cmp(b)>0?d:b},n.min=function(d,b){return d.cmp(b)<0?d:b},n.prototype._init=function(d,b,_){if(typeof d=="number")return this._initNumber(d,b,_);if(typeof d=="object")return this._initArray(d,b,_);b==="hex"&&(b=16),i(b===(b|0)&&b>=2&&b<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(b===16?this._parseHex(d,w,_):(this._parseBase(d,b,w),_==="le"&&this._initArray(this.toArray(),b,_)))},n.prototype._initNumber=function(d,b,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(i(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),b,_)},n.prototype._initArray=function(d,b,_){if(i(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v,I,P=0;if(_==="be")for(w=d.length-1,v=0;w>=0;w-=3)I=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[v]|=I<<P&67108863,this.words[v+1]=I>>>26-P&67108863,P+=24,P>=26&&(P-=26,v++);else if(_==="le")for(w=0,v=0;w<d.length;w+=3)I=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[v]|=I<<P&67108863,this.words[v+1]=I>>>26-P&67108863,P+=24,P>=26&&(P-=26,v++);return this.strip()};function a($,d){var b=$.charCodeAt(d);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}function u($,d,b){var _=a($,b);return b-1>=d&&(_|=a($,b-1)<<4),_}n.prototype._parseHex=function(d,b,_){this.length=Math.ceil((d.length-b)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v=0,I=0,P;if(_==="be")for(w=d.length-1;w>=b;w-=2)P=u(d,b,w)<<v,this.words[I]|=P&67108863,v>=18?(v-=18,I+=1,this.words[I]|=P>>>26):v+=8;else{var E=d.length-b;for(w=E%2===0?b+1:b;w<d.length;w+=2)P=u(d,b,w)<<v,this.words[I]|=P&67108863,v>=18?(v-=18,I+=1,this.words[I]|=P>>>26):v+=8}this.strip()};function c($,d,b,_){for(var w=0,v=Math.min($.length,b),I=d;I<v;I++){var P=$.charCodeAt(I)-48;w*=_,P>=49?w+=P-49+10:P>=17?w+=P-17+10:w+=P}return w}n.prototype._parseBase=function(d,b,_){this.words=[0],this.length=1;for(var w=0,v=1;v<=67108863;v*=b)w++;w--,v=v/b|0;for(var I=d.length-_,P=I%w,E=Math.min(I,I-P)+_,p=0,N=_;N<E;N+=w)p=c(d,N,N+w,b),this.imuln(v),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(P!==0){var q=1;for(p=c(d,N,d.length,b),N=0;N<P;N++)q*=b;this.imuln(q),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},n.prototype.copy=function(d){d.words=new Array(this.length);for(var b=0;b<this.length;b++)d.words[b]=this.words[b];d.length=this.length,d.negative=this.negative,d.red=this.red},n.prototype.clone=function(){var d=new n(null);return this.copy(d),d},n.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(d,b){d=d||10,b=b|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,v=0,I=0;I<this.length;I++){var P=this.words[I],E=((P<<w|v)&16777215).toString(16);v=P>>>24-w&16777215,w+=2,w>=26&&(w-=26,I--),v!==0||I!==this.length-1?_=l[6-E.length]+E+_:_=E+_}for(v!==0&&(_=v.toString(16)+_);_.length%b!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var p=h[d],N=f[d];_="";var q=this.clone();for(q.negative=0;!q.isZero();){var H=q.modn(N).toString(d);q=q.idivn(N),q.isZero()?_=H+_:_=l[p-H.length]+H+_}for(this.isZero()&&(_="0"+_);_.length%b!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(d,b){return i(typeof o<"u"),this.toArrayLike(o,d,b)},n.prototype.toArray=function(d,b){return this.toArrayLike(Array,d,b)},n.prototype.toArrayLike=function(d,b,_){var w=this.byteLength(),v=_||Math.max(1,w);i(w<=v,"byte array longer than desired length"),i(v>0,"Requested array length <= 0"),this.strip();var I=b==="le",P=new d(v),E,p,N=this.clone();if(I){for(p=0;!N.isZero();p++)E=N.andln(255),N.iushrn(8),P[p]=E;for(;p<v;p++)P[p]=0}else{for(p=0;p<v-w;p++)P[p]=0;for(p=0;!N.isZero();p++)E=N.andln(255),N.iushrn(8),P[v-p-1]=E}return P},Math.clz32?n.prototype._countBits=function(d){return 32-Math.clz32(d)}:n.prototype._countBits=function(d){var b=d,_=0;return b>=4096&&(_+=13,b>>>=13),b>=64&&(_+=7,b>>>=7),b>=8&&(_+=4,b>>>=4),b>=2&&(_+=2,b>>>=2),_+b},n.prototype._zeroBits=function(d){if(d===0)return 26;var b=d,_=0;return(b&8191)===0&&(_+=13,b>>>=13),(b&127)===0&&(_+=7,b>>>=7),(b&15)===0&&(_+=4,b>>>=4),(b&3)===0&&(_+=2,b>>>=2),(b&1)===0&&_++,_},n.prototype.bitLength=function(){var d=this.words[this.length-1],b=this._countBits(d);return(this.length-1)*26+b};function m($){for(var d=new Array($.bitLength()),b=0;b<d.length;b++){var _=b/26|0,w=b%26;d[b]=($.words[_]&1<<w)>>>w}return d}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,b=0;b<this.length;b++){var _=this._zeroBits(this.words[b]);if(d+=_,_!==26)break}return d},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},n.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var b=0;b<d.length;b++)this.words[b]=this.words[b]|d.words[b];return this.strip()},n.prototype.ior=function(d){return i((this.negative|d.negative)===0),this.iuor(d)},n.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},n.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},n.prototype.iuand=function(d){var b;this.length>d.length?b=d:b=this;for(var _=0;_<b.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=b.length,this.strip()},n.prototype.iand=function(d){return i((this.negative|d.negative)===0),this.iuand(d)},n.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},n.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},n.prototype.iuxor=function(d){var b,_;this.length>d.length?(b=this,_=d):(b=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=b.words[w]^_.words[w];if(this!==b)for(;w<b.length;w++)this.words[w]=b.words[w];return this.length=b.length,this.strip()},n.prototype.ixor=function(d){return i((this.negative|d.negative)===0),this.iuxor(d)},n.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},n.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},n.prototype.inotn=function(d){i(typeof d=="number"&&d>=0);var b=Math.ceil(d/26)|0,_=d%26;this._expand(b),_>0&&b--;for(var w=0;w<b;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},n.prototype.notn=function(d){return this.clone().inotn(d)},n.prototype.setn=function(d,b){i(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),b?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},n.prototype.iadd=function(d){var b;if(this.negative!==0&&d.negative===0)return this.negative=0,b=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,b=this.isub(d),d.negative=1,b._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var v=0,I=0;I<w.length;I++)b=(_.words[I]|0)+(w.words[I]|0)+v,this.words[I]=b&67108863,v=b>>>26;for(;v!==0&&I<_.length;I++)b=(_.words[I]|0)+v,this.words[I]=b&67108863,v=b>>>26;if(this.length=_.length,v!==0)this.words[this.length]=v,this.length++;else if(_!==this)for(;I<_.length;I++)this.words[I]=_.words[I];return this},n.prototype.add=function(d){var b;return d.negative!==0&&this.negative===0?(d.negative=0,b=this.sub(d),d.negative^=1,b):d.negative===0&&this.negative!==0?(this.negative=0,b=d.sub(this),this.negative=1,b):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},n.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var b=this.iadd(d);return d.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,v;_>0?(w=this,v=d):(w=d,v=this);for(var I=0,P=0;P<v.length;P++)b=(w.words[P]|0)-(v.words[P]|0)+I,I=b>>26,this.words[P]=b&67108863;for(;I!==0&&P<w.length;P++)b=(w.words[P]|0)+I,I=b>>26,this.words[P]=b&67108863;if(I===0&&P<w.length&&w!==this)for(;P<w.length;P++)this.words[P]=w.words[P];return this.length=Math.max(this.length,P),w!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(d){return this.clone().isub(d)};function g($,d,b){b.negative=d.negative^$.negative;var _=$.length+d.length|0;b.length=_,_=_-1|0;var w=$.words[0]|0,v=d.words[0]|0,I=w*v,P=I&67108863,E=I/67108864|0;b.words[0]=P;for(var p=1;p<_;p++){for(var N=E>>>26,q=E&67108863,H=Math.min(p,d.length-1),z=Math.max(0,p-$.length+1);z<=H;z++){var V=p-z|0;w=$.words[V]|0,v=d.words[z]|0,I=w*v+q,N+=I/67108864|0,q=I&67108863}b.words[p]=q|0,E=N|0}return E!==0?b.words[p]=E|0:b.length--,b.strip()}var y=function(d,b,_){var w=d.words,v=b.words,I=_.words,P=0,E,p,N,q=w[0]|0,H=q&8191,z=q>>>13,V=w[1]|0,Y=V&8191,te=V>>>13,ie=w[2]|0,Z=ie&8191,ae=ie>>>13,ht=w[3]|0,ge=ht&8191,ye=ht>>>13,Dt=w[4]|0,Ie=Dt&8191,Te=Dt>>>13,bi=w[5]|0,Ze=bi&8191,Ke=bi>>>13,Vi=w[6]|0,qe=Vi&8191,We=Vi>>>13,Ki=w[7]|0,De=Ki&8191,Re=Ki>>>13,Wi=w[8]|0,Me=Wi&8191,st=Wi>>>13,dn=w[9]|0,Se=dn&8191,It=dn>>>13,Na=v[0]|0,Rt=Na&8191,At=Na>>>13,fn=v[1]|0,St=fn&8191,Ct=fn>>>13,qu=v[2]|0,Ge=qu&8191,$t=qu>>>13,Bu=v[3]|0,Mt=Bu&8191,bt=Bu>>>13,Rs=v[4]|0,mt=Rs&8191,yt=Rs>>>13,so=v[5]|0,nt=so&8191,kt=so>>>13,zu=v[6]|0,Ut=zu&8191,Lt=zu>>>13,Hu=v[7]|0,xt=Hu&8191,wt=Hu>>>13,Gi=v[8]|0,Ft=Gi&8191,jt=Gi>>>13,Vu=v[9]|0,qt=Vu&8191,Bt=Vu>>>13;_.negative=d.negative^b.negative,_.length=19,E=Math.imul(H,Rt),p=Math.imul(H,At),p=p+Math.imul(z,Rt)|0,N=Math.imul(z,At);var ei=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ei>>>26)|0,ei&=67108863,E=Math.imul(Y,Rt),p=Math.imul(Y,At),p=p+Math.imul(te,Rt)|0,N=Math.imul(te,At),E=E+Math.imul(H,St)|0,p=p+Math.imul(H,Ct)|0,p=p+Math.imul(z,St)|0,N=N+Math.imul(z,Ct)|0;var Oa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,E=Math.imul(Z,Rt),p=Math.imul(Z,At),p=p+Math.imul(ae,Rt)|0,N=Math.imul(ae,At),E=E+Math.imul(Y,St)|0,p=p+Math.imul(Y,Ct)|0,p=p+Math.imul(te,St)|0,N=N+Math.imul(te,Ct)|0,E=E+Math.imul(H,Ge)|0,p=p+Math.imul(H,$t)|0,p=p+Math.imul(z,Ge)|0,N=N+Math.imul(z,$t)|0;var Ta=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,E=Math.imul(ge,Rt),p=Math.imul(ge,At),p=p+Math.imul(ye,Rt)|0,N=Math.imul(ye,At),E=E+Math.imul(Z,St)|0,p=p+Math.imul(Z,Ct)|0,p=p+Math.imul(ae,St)|0,N=N+Math.imul(ae,Ct)|0,E=E+Math.imul(Y,Ge)|0,p=p+Math.imul(Y,$t)|0,p=p+Math.imul(te,Ge)|0,N=N+Math.imul(te,$t)|0,E=E+Math.imul(H,Mt)|0,p=p+Math.imul(H,bt)|0,p=p+Math.imul(z,Mt)|0,N=N+Math.imul(z,bt)|0;var Da=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Da>>>26)|0,Da&=67108863,E=Math.imul(Ie,Rt),p=Math.imul(Ie,At),p=p+Math.imul(Te,Rt)|0,N=Math.imul(Te,At),E=E+Math.imul(ge,St)|0,p=p+Math.imul(ge,Ct)|0,p=p+Math.imul(ye,St)|0,N=N+Math.imul(ye,Ct)|0,E=E+Math.imul(Z,Ge)|0,p=p+Math.imul(Z,$t)|0,p=p+Math.imul(ae,Ge)|0,N=N+Math.imul(ae,$t)|0,E=E+Math.imul(Y,Mt)|0,p=p+Math.imul(Y,bt)|0,p=p+Math.imul(te,Mt)|0,N=N+Math.imul(te,bt)|0,E=E+Math.imul(H,mt)|0,p=p+Math.imul(H,yt)|0,p=p+Math.imul(z,mt)|0,N=N+Math.imul(z,yt)|0;var Ra=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,E=Math.imul(Ze,Rt),p=Math.imul(Ze,At),p=p+Math.imul(Ke,Rt)|0,N=Math.imul(Ke,At),E=E+Math.imul(Ie,St)|0,p=p+Math.imul(Ie,Ct)|0,p=p+Math.imul(Te,St)|0,N=N+Math.imul(Te,Ct)|0,E=E+Math.imul(ge,Ge)|0,p=p+Math.imul(ge,$t)|0,p=p+Math.imul(ye,Ge)|0,N=N+Math.imul(ye,$t)|0,E=E+Math.imul(Z,Mt)|0,p=p+Math.imul(Z,bt)|0,p=p+Math.imul(ae,Mt)|0,N=N+Math.imul(ae,bt)|0,E=E+Math.imul(Y,mt)|0,p=p+Math.imul(Y,yt)|0,p=p+Math.imul(te,mt)|0,N=N+Math.imul(te,yt)|0,E=E+Math.imul(H,nt)|0,p=p+Math.imul(H,kt)|0,p=p+Math.imul(z,nt)|0,N=N+Math.imul(z,kt)|0;var Ma=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,E=Math.imul(qe,Rt),p=Math.imul(qe,At),p=p+Math.imul(We,Rt)|0,N=Math.imul(We,At),E=E+Math.imul(Ze,St)|0,p=p+Math.imul(Ze,Ct)|0,p=p+Math.imul(Ke,St)|0,N=N+Math.imul(Ke,Ct)|0,E=E+Math.imul(Ie,Ge)|0,p=p+Math.imul(Ie,$t)|0,p=p+Math.imul(Te,Ge)|0,N=N+Math.imul(Te,$t)|0,E=E+Math.imul(ge,Mt)|0,p=p+Math.imul(ge,bt)|0,p=p+Math.imul(ye,Mt)|0,N=N+Math.imul(ye,bt)|0,E=E+Math.imul(Z,mt)|0,p=p+Math.imul(Z,yt)|0,p=p+Math.imul(ae,mt)|0,N=N+Math.imul(ae,yt)|0,E=E+Math.imul(Y,nt)|0,p=p+Math.imul(Y,kt)|0,p=p+Math.imul(te,nt)|0,N=N+Math.imul(te,kt)|0,E=E+Math.imul(H,Ut)|0,p=p+Math.imul(H,Lt)|0,p=p+Math.imul(z,Ut)|0,N=N+Math.imul(z,Lt)|0;var Oi=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,E=Math.imul(De,Rt),p=Math.imul(De,At),p=p+Math.imul(Re,Rt)|0,N=Math.imul(Re,At),E=E+Math.imul(qe,St)|0,p=p+Math.imul(qe,Ct)|0,p=p+Math.imul(We,St)|0,N=N+Math.imul(We,Ct)|0,E=E+Math.imul(Ze,Ge)|0,p=p+Math.imul(Ze,$t)|0,p=p+Math.imul(Ke,Ge)|0,N=N+Math.imul(Ke,$t)|0,E=E+Math.imul(Ie,Mt)|0,p=p+Math.imul(Ie,bt)|0,p=p+Math.imul(Te,Mt)|0,N=N+Math.imul(Te,bt)|0,E=E+Math.imul(ge,mt)|0,p=p+Math.imul(ge,yt)|0,p=p+Math.imul(ye,mt)|0,N=N+Math.imul(ye,yt)|0,E=E+Math.imul(Z,nt)|0,p=p+Math.imul(Z,kt)|0,p=p+Math.imul(ae,nt)|0,N=N+Math.imul(ae,kt)|0,E=E+Math.imul(Y,Ut)|0,p=p+Math.imul(Y,Lt)|0,p=p+Math.imul(te,Ut)|0,N=N+Math.imul(te,Lt)|0,E=E+Math.imul(H,xt)|0,p=p+Math.imul(H,wt)|0,p=p+Math.imul(z,xt)|0,N=N+Math.imul(z,wt)|0;var ka=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ka>>>26)|0,ka&=67108863,E=Math.imul(Me,Rt),p=Math.imul(Me,At),p=p+Math.imul(st,Rt)|0,N=Math.imul(st,At),E=E+Math.imul(De,St)|0,p=p+Math.imul(De,Ct)|0,p=p+Math.imul(Re,St)|0,N=N+Math.imul(Re,Ct)|0,E=E+Math.imul(qe,Ge)|0,p=p+Math.imul(qe,$t)|0,p=p+Math.imul(We,Ge)|0,N=N+Math.imul(We,$t)|0,E=E+Math.imul(Ze,Mt)|0,p=p+Math.imul(Ze,bt)|0,p=p+Math.imul(Ke,Mt)|0,N=N+Math.imul(Ke,bt)|0,E=E+Math.imul(Ie,mt)|0,p=p+Math.imul(Ie,yt)|0,p=p+Math.imul(Te,mt)|0,N=N+Math.imul(Te,yt)|0,E=E+Math.imul(ge,nt)|0,p=p+Math.imul(ge,kt)|0,p=p+Math.imul(ye,nt)|0,N=N+Math.imul(ye,kt)|0,E=E+Math.imul(Z,Ut)|0,p=p+Math.imul(Z,Lt)|0,p=p+Math.imul(ae,Ut)|0,N=N+Math.imul(ae,Lt)|0,E=E+Math.imul(Y,xt)|0,p=p+Math.imul(Y,wt)|0,p=p+Math.imul(te,xt)|0,N=N+Math.imul(te,wt)|0,E=E+Math.imul(H,Ft)|0,p=p+Math.imul(H,jt)|0,p=p+Math.imul(z,Ft)|0,N=N+Math.imul(z,jt)|0;var Ua=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,E=Math.imul(Se,Rt),p=Math.imul(Se,At),p=p+Math.imul(It,Rt)|0,N=Math.imul(It,At),E=E+Math.imul(Me,St)|0,p=p+Math.imul(Me,Ct)|0,p=p+Math.imul(st,St)|0,N=N+Math.imul(st,Ct)|0,E=E+Math.imul(De,Ge)|0,p=p+Math.imul(De,$t)|0,p=p+Math.imul(Re,Ge)|0,N=N+Math.imul(Re,$t)|0,E=E+Math.imul(qe,Mt)|0,p=p+Math.imul(qe,bt)|0,p=p+Math.imul(We,Mt)|0,N=N+Math.imul(We,bt)|0,E=E+Math.imul(Ze,mt)|0,p=p+Math.imul(Ze,yt)|0,p=p+Math.imul(Ke,mt)|0,N=N+Math.imul(Ke,yt)|0,E=E+Math.imul(Ie,nt)|0,p=p+Math.imul(Ie,kt)|0,p=p+Math.imul(Te,nt)|0,N=N+Math.imul(Te,kt)|0,E=E+Math.imul(ge,Ut)|0,p=p+Math.imul(ge,Lt)|0,p=p+Math.imul(ye,Ut)|0,N=N+Math.imul(ye,Lt)|0,E=E+Math.imul(Z,xt)|0,p=p+Math.imul(Z,wt)|0,p=p+Math.imul(ae,xt)|0,N=N+Math.imul(ae,wt)|0,E=E+Math.imul(Y,Ft)|0,p=p+Math.imul(Y,jt)|0,p=p+Math.imul(te,Ft)|0,N=N+Math.imul(te,jt)|0,E=E+Math.imul(H,qt)|0,p=p+Math.imul(H,Bt)|0,p=p+Math.imul(z,qt)|0,N=N+Math.imul(z,Bt)|0;var La=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(La>>>26)|0,La&=67108863,E=Math.imul(Se,St),p=Math.imul(Se,Ct),p=p+Math.imul(It,St)|0,N=Math.imul(It,Ct),E=E+Math.imul(Me,Ge)|0,p=p+Math.imul(Me,$t)|0,p=p+Math.imul(st,Ge)|0,N=N+Math.imul(st,$t)|0,E=E+Math.imul(De,Mt)|0,p=p+Math.imul(De,bt)|0,p=p+Math.imul(Re,Mt)|0,N=N+Math.imul(Re,bt)|0,E=E+Math.imul(qe,mt)|0,p=p+Math.imul(qe,yt)|0,p=p+Math.imul(We,mt)|0,N=N+Math.imul(We,yt)|0,E=E+Math.imul(Ze,nt)|0,p=p+Math.imul(Ze,kt)|0,p=p+Math.imul(Ke,nt)|0,N=N+Math.imul(Ke,kt)|0,E=E+Math.imul(Ie,Ut)|0,p=p+Math.imul(Ie,Lt)|0,p=p+Math.imul(Te,Ut)|0,N=N+Math.imul(Te,Lt)|0,E=E+Math.imul(ge,xt)|0,p=p+Math.imul(ge,wt)|0,p=p+Math.imul(ye,xt)|0,N=N+Math.imul(ye,wt)|0,E=E+Math.imul(Z,Ft)|0,p=p+Math.imul(Z,jt)|0,p=p+Math.imul(ae,Ft)|0,N=N+Math.imul(ae,jt)|0,E=E+Math.imul(Y,qt)|0,p=p+Math.imul(Y,Bt)|0,p=p+Math.imul(te,qt)|0,N=N+Math.imul(te,Bt)|0;var Fa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,E=Math.imul(Se,Ge),p=Math.imul(Se,$t),p=p+Math.imul(It,Ge)|0,N=Math.imul(It,$t),E=E+Math.imul(Me,Mt)|0,p=p+Math.imul(Me,bt)|0,p=p+Math.imul(st,Mt)|0,N=N+Math.imul(st,bt)|0,E=E+Math.imul(De,mt)|0,p=p+Math.imul(De,yt)|0,p=p+Math.imul(Re,mt)|0,N=N+Math.imul(Re,yt)|0,E=E+Math.imul(qe,nt)|0,p=p+Math.imul(qe,kt)|0,p=p+Math.imul(We,nt)|0,N=N+Math.imul(We,kt)|0,E=E+Math.imul(Ze,Ut)|0,p=p+Math.imul(Ze,Lt)|0,p=p+Math.imul(Ke,Ut)|0,N=N+Math.imul(Ke,Lt)|0,E=E+Math.imul(Ie,xt)|0,p=p+Math.imul(Ie,wt)|0,p=p+Math.imul(Te,xt)|0,N=N+Math.imul(Te,wt)|0,E=E+Math.imul(ge,Ft)|0,p=p+Math.imul(ge,jt)|0,p=p+Math.imul(ye,Ft)|0,N=N+Math.imul(ye,jt)|0,E=E+Math.imul(Z,qt)|0,p=p+Math.imul(Z,Bt)|0,p=p+Math.imul(ae,qt)|0,N=N+Math.imul(ae,Bt)|0;var ja=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ja>>>26)|0,ja&=67108863,E=Math.imul(Se,Mt),p=Math.imul(Se,bt),p=p+Math.imul(It,Mt)|0,N=Math.imul(It,bt),E=E+Math.imul(Me,mt)|0,p=p+Math.imul(Me,yt)|0,p=p+Math.imul(st,mt)|0,N=N+Math.imul(st,yt)|0,E=E+Math.imul(De,nt)|0,p=p+Math.imul(De,kt)|0,p=p+Math.imul(Re,nt)|0,N=N+Math.imul(Re,kt)|0,E=E+Math.imul(qe,Ut)|0,p=p+Math.imul(qe,Lt)|0,p=p+Math.imul(We,Ut)|0,N=N+Math.imul(We,Lt)|0,E=E+Math.imul(Ze,xt)|0,p=p+Math.imul(Ze,wt)|0,p=p+Math.imul(Ke,xt)|0,N=N+Math.imul(Ke,wt)|0,E=E+Math.imul(Ie,Ft)|0,p=p+Math.imul(Ie,jt)|0,p=p+Math.imul(Te,Ft)|0,N=N+Math.imul(Te,jt)|0,E=E+Math.imul(ge,qt)|0,p=p+Math.imul(ge,Bt)|0,p=p+Math.imul(ye,qt)|0,N=N+Math.imul(ye,Bt)|0;var Ms=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,E=Math.imul(Se,mt),p=Math.imul(Se,yt),p=p+Math.imul(It,mt)|0,N=Math.imul(It,yt),E=E+Math.imul(Me,nt)|0,p=p+Math.imul(Me,kt)|0,p=p+Math.imul(st,nt)|0,N=N+Math.imul(st,kt)|0,E=E+Math.imul(De,Ut)|0,p=p+Math.imul(De,Lt)|0,p=p+Math.imul(Re,Ut)|0,N=N+Math.imul(Re,Lt)|0,E=E+Math.imul(qe,xt)|0,p=p+Math.imul(qe,wt)|0,p=p+Math.imul(We,xt)|0,N=N+Math.imul(We,wt)|0,E=E+Math.imul(Ze,Ft)|0,p=p+Math.imul(Ze,jt)|0,p=p+Math.imul(Ke,Ft)|0,N=N+Math.imul(Ke,jt)|0,E=E+Math.imul(Ie,qt)|0,p=p+Math.imul(Ie,Bt)|0,p=p+Math.imul(Te,qt)|0,N=N+Math.imul(Te,Bt)|0;var qa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(qa>>>26)|0,qa&=67108863,E=Math.imul(Se,nt),p=Math.imul(Se,kt),p=p+Math.imul(It,nt)|0,N=Math.imul(It,kt),E=E+Math.imul(Me,Ut)|0,p=p+Math.imul(Me,Lt)|0,p=p+Math.imul(st,Ut)|0,N=N+Math.imul(st,Lt)|0,E=E+Math.imul(De,xt)|0,p=p+Math.imul(De,wt)|0,p=p+Math.imul(Re,xt)|0,N=N+Math.imul(Re,wt)|0,E=E+Math.imul(qe,Ft)|0,p=p+Math.imul(qe,jt)|0,p=p+Math.imul(We,Ft)|0,N=N+Math.imul(We,jt)|0,E=E+Math.imul(Ze,qt)|0,p=p+Math.imul(Ze,Bt)|0,p=p+Math.imul(Ke,qt)|0,N=N+Math.imul(Ke,Bt)|0;var Ba=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,E=Math.imul(Se,Ut),p=Math.imul(Se,Lt),p=p+Math.imul(It,Ut)|0,N=Math.imul(It,Lt),E=E+Math.imul(Me,xt)|0,p=p+Math.imul(Me,wt)|0,p=p+Math.imul(st,xt)|0,N=N+Math.imul(st,wt)|0,E=E+Math.imul(De,Ft)|0,p=p+Math.imul(De,jt)|0,p=p+Math.imul(Re,Ft)|0,N=N+Math.imul(Re,jt)|0,E=E+Math.imul(qe,qt)|0,p=p+Math.imul(qe,Bt)|0,p=p+Math.imul(We,qt)|0,N=N+Math.imul(We,Bt)|0;var mi=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(mi>>>26)|0,mi&=67108863,E=Math.imul(Se,xt),p=Math.imul(Se,wt),p=p+Math.imul(It,xt)|0,N=Math.imul(It,wt),E=E+Math.imul(Me,Ft)|0,p=p+Math.imul(Me,jt)|0,p=p+Math.imul(st,Ft)|0,N=N+Math.imul(st,jt)|0,E=E+Math.imul(De,qt)|0,p=p+Math.imul(De,Bt)|0,p=p+Math.imul(Re,qt)|0,N=N+Math.imul(Re,Bt)|0;var za=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(za>>>26)|0,za&=67108863,E=Math.imul(Se,Ft),p=Math.imul(Se,jt),p=p+Math.imul(It,Ft)|0,N=Math.imul(It,jt),E=E+Math.imul(Me,qt)|0,p=p+Math.imul(Me,Bt)|0,p=p+Math.imul(st,qt)|0,N=N+Math.imul(st,Bt)|0;var Ha=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,E=Math.imul(Se,qt),p=Math.imul(Se,Bt),p=p+Math.imul(It,qt)|0,N=Math.imul(It,Bt);var Va=(P+E|0)+((p&8191)<<13)|0;return P=(N+(p>>>13)|0)+(Va>>>26)|0,Va&=67108863,I[0]=ei,I[1]=Oa,I[2]=Ta,I[3]=Da,I[4]=Ra,I[5]=Ma,I[6]=Oi,I[7]=ka,I[8]=Ua,I[9]=La,I[10]=Fa,I[11]=ja,I[12]=Ms,I[13]=qa,I[14]=Ba,I[15]=mi,I[16]=za,I[17]=Ha,I[18]=Va,P!==0&&(I[19]=P,_.length++),_};Math.imul||(y=g);function C($,d,b){b.negative=d.negative^$.negative,b.length=$.length+d.length;for(var _=0,w=0,v=0;v<b.length-1;v++){var I=w;w=0;for(var P=_&67108863,E=Math.min(v,d.length-1),p=Math.max(0,v-$.length+1);p<=E;p++){var N=v-p,q=$.words[N]|0,H=d.words[p]|0,z=q*H,V=z&67108863;I=I+(z/67108864|0)|0,V=V+P|0,P=V&67108863,I=I+(V>>>26)|0,w+=I>>>26,I&=67108863}b.words[v]=P,_=I,I=w}return _!==0?b.words[v]=_:b.length--,b.strip()}function S($,d,b){var _=new A;return _.mulp($,d,b)}n.prototype.mulTo=function(d,b){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=y(this,d,b):w<63?_=g(this,d,b):w<1024?_=C(this,d,b):_=S(this,d,b),_};function A($,d){this.x=$,this.y=d}A.prototype.makeRBT=function(d){for(var b=new Array(d),_=n.prototype._countBits(d)-1,w=0;w<d;w++)b[w]=this.revBin(w,_,d);return b},A.prototype.revBin=function(d,b,_){if(d===0||d===_-1)return d;for(var w=0,v=0;v<b;v++)w|=(d&1)<<b-v-1,d>>=1;return w},A.prototype.permute=function(d,b,_,w,v,I){for(var P=0;P<I;P++)w[P]=b[d[P]],v[P]=_[d[P]]},A.prototype.transform=function(d,b,_,w,v,I){this.permute(I,d,b,_,w,v);for(var P=1;P<v;P<<=1)for(var E=P<<1,p=Math.cos(2*Math.PI/E),N=Math.sin(2*Math.PI/E),q=0;q<v;q+=E)for(var H=p,z=N,V=0;V<P;V++){var Y=_[q+V],te=w[q+V],ie=_[q+V+P],Z=w[q+V+P],ae=H*ie-z*Z;Z=H*Z+z*ie,ie=ae,_[q+V]=Y+ie,w[q+V]=te+Z,_[q+V+P]=Y-ie,w[q+V+P]=te-Z,V!==E&&(ae=p*H-N*z,z=p*z+N*H,H=ae)}},A.prototype.guessLen13b=function(d,b){var _=Math.max(b,d)|1,w=_&1,v=0;for(_=_/2|0;_;_=_>>>1)v++;return 1<<v+1+w},A.prototype.conjugate=function(d,b,_){if(!(_<=1))for(var w=0;w<_/2;w++){var v=d[w];d[w]=d[_-w-1],d[_-w-1]=v,v=b[w],b[w]=-b[_-w-1],b[_-w-1]=-v}},A.prototype.normalize13b=function(d,b){for(var _=0,w=0;w<b/2;w++){var v=Math.round(d[2*w+1]/b)*8192+Math.round(d[2*w]/b)+_;d[w]=v&67108863,v<67108864?_=0:_=v/67108864|0}return d},A.prototype.convert13b=function(d,b,_,w){for(var v=0,I=0;I<b;I++)v=v+(d[I]|0),_[2*I]=v&8191,v=v>>>13,_[2*I+1]=v&8191,v=v>>>13;for(I=2*b;I<w;++I)_[I]=0;i(v===0),i((v&-8192)===0)},A.prototype.stub=function(d){for(var b=new Array(d),_=0;_<d;_++)b[_]=0;return b},A.prototype.mulp=function(d,b,_){var w=2*this.guessLen13b(d.length,b.length),v=this.makeRBT(w),I=this.stub(w),P=new Array(w),E=new Array(w),p=new Array(w),N=new Array(w),q=new Array(w),H=new Array(w),z=_.words;z.length=w,this.convert13b(d.words,d.length,P,w),this.convert13b(b.words,b.length,N,w),this.transform(P,I,E,p,w,v),this.transform(N,I,q,H,w,v);for(var V=0;V<w;V++){var Y=E[V]*q[V]-p[V]*H[V];p[V]=E[V]*H[V]+p[V]*q[V],E[V]=Y}return this.conjugate(E,p,w),this.transform(E,p,z,I,w,v),this.conjugate(z,I,w),this.normalize13b(z,w),_.negative=d.negative^b.negative,_.length=d.length+b.length,_.strip()},n.prototype.mul=function(d){var b=new n(null);return b.words=new Array(this.length+d.length),this.mulTo(d,b)},n.prototype.mulf=function(d){var b=new n(null);return b.words=new Array(this.length+d.length),S(this,d,b)},n.prototype.imul=function(d){return this.clone().mulTo(d,this)},n.prototype.imuln=function(d){i(typeof d=="number"),i(d<67108864);for(var b=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,v=(w&67108863)+(b&67108863);b>>=26,b+=w/67108864|0,b+=v>>>26,this.words[_]=v&67108863}return b!==0&&(this.words[_]=b,this.length++),this.length=d===0?1:this.length,this},n.prototype.muln=function(d){return this.clone().imuln(d)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(d){var b=m(d);if(b.length===0)return new n(1);for(var _=this,w=0;w<b.length&&b[w]===0;w++,_=_.sqr());if(++w<b.length)for(var v=_.sqr();w<b.length;w++,v=v.sqr())b[w]!==0&&(_=_.mul(v));return _},n.prototype.iushln=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26,w=67108863>>>26-b<<26-b,v;if(b!==0){var I=0;for(v=0;v<this.length;v++){var P=this.words[v]&w,E=(this.words[v]|0)-P<<b;this.words[v]=E|I,I=P>>>26-b}I&&(this.words[v]=I,this.length++)}if(_!==0){for(v=this.length-1;v>=0;v--)this.words[v+_]=this.words[v];for(v=0;v<_;v++)this.words[v]=0;this.length+=_}return this.strip()},n.prototype.ishln=function(d){return i(this.negative===0),this.iushln(d)},n.prototype.iushrn=function(d,b,_){i(typeof d=="number"&&d>=0);var w;b?w=(b-b%26)/26:w=0;var v=d%26,I=Math.min((d-v)/26,this.length),P=67108863^67108863>>>v<<v,E=_;if(w-=I,w=Math.max(0,w),E){for(var p=0;p<I;p++)E.words[p]=this.words[p];E.length=I}if(I!==0)if(this.length>I)for(this.length-=I,p=0;p<this.length;p++)this.words[p]=this.words[p+I];else this.words[0]=0,this.length=1;var N=0;for(p=this.length-1;p>=0&&(N!==0||p>=w);p--){var q=this.words[p]|0;this.words[p]=N<<26-v|q>>>v,N=q&P}return E&&N!==0&&(E.words[E.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(d,b,_){return i(this.negative===0),this.iushrn(d,b,_)},n.prototype.shln=function(d){return this.clone().ishln(d)},n.prototype.ushln=function(d){return this.clone().iushln(d)},n.prototype.shrn=function(d){return this.clone().ishrn(d)},n.prototype.ushrn=function(d){return this.clone().iushrn(d)},n.prototype.testn=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26,w=1<<b;if(this.length<=_)return!1;var v=this.words[_];return!!(v&w)},n.prototype.imaskn=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(b!==0&&_++,this.length=Math.min(_,this.length),b!==0){var w=67108863^67108863>>>b<<b;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(d){return this.clone().imaskn(d)},n.prototype.iaddn=function(d){return i(typeof d=="number"),i(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},n.prototype._iaddn=function(d){this.words[0]+=d;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},n.prototype.isubn=function(d){if(i(typeof d=="number"),i(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},n.prototype.addn=function(d){return this.clone().iaddn(d)},n.prototype.subn=function(d){return this.clone().isubn(d)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(d,b,_){var w=d.length+_,v;this._expand(w);var I,P=0;for(v=0;v<d.length;v++){I=(this.words[v+_]|0)+P;var E=(d.words[v]|0)*b;I-=E&67108863,P=(I>>26)-(E/67108864|0),this.words[v+_]=I&67108863}for(;v<this.length-_;v++)I=(this.words[v+_]|0)+P,P=I>>26,this.words[v+_]=I&67108863;if(P===0)return this.strip();for(i(P===-1),P=0,v=0;v<this.length;v++)I=-(this.words[v]|0)+P,P=I>>26,this.words[v]=I&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(d,b){var _=this.length-d.length,w=this.clone(),v=d,I=v.words[v.length-1]|0,P=this._countBits(I);_=26-P,_!==0&&(v=v.ushln(_),w.iushln(_),I=v.words[v.length-1]|0);var E=w.length-v.length,p;if(b!=="mod"){p=new n(null),p.length=E+1,p.words=new Array(p.length);for(var N=0;N<p.length;N++)p.words[N]=0}var q=w.clone()._ishlnsubmul(v,1,E);q.negative===0&&(w=q,p&&(p.words[E]=1));for(var H=E-1;H>=0;H--){var z=(w.words[v.length+H]|0)*67108864+(w.words[v.length+H-1]|0);for(z=Math.min(z/I|0,67108863),w._ishlnsubmul(v,z,H);w.negative!==0;)z--,w.negative=0,w._ishlnsubmul(v,1,H),w.isZero()||(w.negative^=1);p&&(p.words[H]=z)}return p&&p.strip(),w.strip(),b!=="div"&&_!==0&&w.iushrn(_),{div:p||null,mod:w}},n.prototype.divmod=function(d,b,_){if(i(!d.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var w,v,I;return this.negative!==0&&d.negative===0?(I=this.neg().divmod(d,b),b!=="mod"&&(w=I.div.neg()),b!=="div"&&(v=I.mod.neg(),_&&v.negative!==0&&v.iadd(d)),{div:w,mod:v}):this.negative===0&&d.negative!==0?(I=this.divmod(d.neg(),b),b!=="mod"&&(w=I.div.neg()),{div:w,mod:I.mod}):(this.negative&d.negative)!==0?(I=this.neg().divmod(d.neg(),b),b!=="div"&&(v=I.mod.neg(),_&&v.negative!==0&&v.isub(d)),{div:I.div,mod:v}):d.length>this.length||this.cmp(d)<0?{div:new n(0),mod:this}:d.length===1?b==="div"?{div:this.divn(d.words[0]),mod:null}:b==="mod"?{div:null,mod:new n(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new n(this.modn(d.words[0]))}:this._wordDiv(d,b)},n.prototype.div=function(d){return this.divmod(d,"div",!1).div},n.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},n.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},n.prototype.divRound=function(d){var b=this.divmod(d);if(b.mod.isZero())return b.div;var _=b.div.negative!==0?b.mod.isub(d):b.mod,w=d.ushrn(1),v=d.andln(1),I=_.cmp(w);return I<0||v===1&&I===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},n.prototype.modn=function(d){i(d<=67108863);for(var b=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(b*_+(this.words[w]|0))%d;return _},n.prototype.idivn=function(d){i(d<=67108863);for(var b=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+b*67108864;this.words[_]=w/d|0,b=w%d}return this.strip()},n.prototype.divn=function(d){return this.clone().idivn(d)},n.prototype.egcd=function(d){i(d.negative===0),i(!d.isZero());var b=this,_=d.clone();b.negative!==0?b=b.umod(d):b=b.clone();for(var w=new n(1),v=new n(0),I=new n(0),P=new n(1),E=0;b.isEven()&&_.isEven();)b.iushrn(1),_.iushrn(1),++E;for(var p=_.clone(),N=b.clone();!b.isZero();){for(var q=0,H=1;(b.words[0]&H)===0&&q<26;++q,H<<=1);if(q>0)for(b.iushrn(q);q-- >0;)(w.isOdd()||v.isOdd())&&(w.iadd(p),v.isub(N)),w.iushrn(1),v.iushrn(1);for(var z=0,V=1;(_.words[0]&V)===0&&z<26;++z,V<<=1);if(z>0)for(_.iushrn(z);z-- >0;)(I.isOdd()||P.isOdd())&&(I.iadd(p),P.isub(N)),I.iushrn(1),P.iushrn(1);b.cmp(_)>=0?(b.isub(_),w.isub(I),v.isub(P)):(_.isub(b),I.isub(w),P.isub(v))}return{a:I,b:P,gcd:_.iushln(E)}},n.prototype._invmp=function(d){i(d.negative===0),i(!d.isZero());var b=this,_=d.clone();b.negative!==0?b=b.umod(d):b=b.clone();for(var w=new n(1),v=new n(0),I=_.clone();b.cmpn(1)>0&&_.cmpn(1)>0;){for(var P=0,E=1;(b.words[0]&E)===0&&P<26;++P,E<<=1);if(P>0)for(b.iushrn(P);P-- >0;)w.isOdd()&&w.iadd(I),w.iushrn(1);for(var p=0,N=1;(_.words[0]&N)===0&&p<26;++p,N<<=1);if(p>0)for(_.iushrn(p);p-- >0;)v.isOdd()&&v.iadd(I),v.iushrn(1);b.cmp(_)>=0?(b.isub(_),w.isub(v)):(_.isub(b),v.isub(w))}var q;return b.cmpn(1)===0?q=w:q=v,q.cmpn(0)<0&&q.iadd(d),q},n.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var b=this.clone(),_=d.clone();b.negative=0,_.negative=0;for(var w=0;b.isEven()&&_.isEven();w++)b.iushrn(1),_.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;_.isEven();)_.iushrn(1);var v=b.cmp(_);if(v<0){var I=b;b=_,_=I}else if(v===0||_.cmpn(1)===0)break;b.isub(_)}while(!0);return _.iushln(w)},n.prototype.invm=function(d){return this.egcd(d).a.umod(d)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(d){return this.words[0]&d},n.prototype.bincn=function(d){i(typeof d=="number");var b=d%26,_=(d-b)/26,w=1<<b;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var v=w,I=_;v!==0&&I<this.length;I++){var P=this.words[I]|0;P+=v,v=P>>>26,P&=67108863,this.words[I]=P}return v!==0&&(this.words[I]=v,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(d){var b=d<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this.strip();var _;if(this.length>1)_=1;else{b&&(d=-d),i(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},n.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var b=this.ucmp(d);return this.negative!==0?-b|0:b},n.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var b=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,v=d.words[_]|0;if(w!==v){w<v?b=-1:w>v&&(b=1);break}}return b},n.prototype.gtn=function(d){return this.cmpn(d)===1},n.prototype.gt=function(d){return this.cmp(d)===1},n.prototype.gten=function(d){return this.cmpn(d)>=0},n.prototype.gte=function(d){return this.cmp(d)>=0},n.prototype.ltn=function(d){return this.cmpn(d)===-1},n.prototype.lt=function(d){return this.cmp(d)===-1},n.prototype.lten=function(d){return this.cmpn(d)<=0},n.prototype.lte=function(d){return this.cmp(d)<=0},n.prototype.eqn=function(d){return this.cmpn(d)===0},n.prototype.eq=function(d){return this.cmp(d)===0},n.red=function(d){return new R(d)},n.prototype.toRed=function(d){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(d){return this.red=d,this},n.prototype.forceRed=function(d){return i(!this.red,"Already a number in reduction context"),this._forceRed(d)},n.prototype.redAdd=function(d){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},n.prototype.redIAdd=function(d){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},n.prototype.redSub=function(d){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},n.prototype.redISub=function(d){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},n.prototype.redShl=function(d){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},n.prototype.redMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},n.prototype.redIMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(d){return i(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var D={k256:null,p224:null,p192:null,p25519:null};function O($,d){this.name=$,this.p=new n(d,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var d=new n(null);return d.words=new Array(Math.ceil(this.n/13)),d},O.prototype.ireduce=function(d){var b=d,_;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),_=b.bitLength();while(_>this.n);var w=_<this.n?-1:b.ucmp(this.p);return w===0?(b.words[0]=0,b.length=1):w>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},O.prototype.split=function(d,b){d.iushrn(this.n,0,b)},O.prototype.imulK=function(d){return d.imul(this.k)};function T(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(T,O),T.prototype.split=function(d,b){for(var _=4194303,w=Math.min(d.length,9),v=0;v<w;v++)b.words[v]=d.words[v];if(b.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var I=d.words[9];for(b.words[b.length++]=I&_,v=10;v<d.length;v++){var P=d.words[v]|0;d.words[v-10]=(P&_)<<4|I>>>22,I=P}I>>>=22,d.words[v-10]=I,I===0&&d.length>10?d.length-=10:d.length-=9},T.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var b=0,_=0;_<d.length;_++){var w=d.words[_]|0;b+=w*977,d.words[_]=b&67108863,b=w*64+(b/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function x(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(x,O);function M(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(M,O);function U(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(U,O),U.prototype.imulK=function(d){for(var b=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+b,v=w&67108863;w>>>=26,d.words[_]=v,b=w}return b!==0&&(d.words[d.length++]=b),d},n._prime=function(d){if(D[d])return D[d];var b;if(d==="k256")b=new T;else if(d==="p224")b=new x;else if(d==="p192")b=new M;else if(d==="p25519")b=new U;else throw new Error("Unknown prime "+d);return D[d]=b,b};function R($){if(typeof $=="string"){var d=n._prime($);this.m=d.p,this.prime=d}else i($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}R.prototype._verify1=function(d){i(d.negative===0,"red works only with positives"),i(d.red,"red works only with red numbers")},R.prototype._verify2=function(d,b){i((d.negative|b.negative)===0,"red works only with positives"),i(d.red&&d.red===b.red,"red works only with red numbers")},R.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},R.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},R.prototype.add=function(d,b){this._verify2(d,b);var _=d.add(b);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},R.prototype.iadd=function(d,b){this._verify2(d,b);var _=d.iadd(b);return _.cmp(this.m)>=0&&_.isub(this.m),_},R.prototype.sub=function(d,b){this._verify2(d,b);var _=d.sub(b);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},R.prototype.isub=function(d,b){this._verify2(d,b);var _=d.isub(b);return _.cmpn(0)<0&&_.iadd(this.m),_},R.prototype.shl=function(d,b){return this._verify1(d),this.imod(d.ushln(b))},R.prototype.imul=function(d,b){return this._verify2(d,b),this.imod(d.imul(b))},R.prototype.mul=function(d,b){return this._verify2(d,b),this.imod(d.mul(b))},R.prototype.isqr=function(d){return this.imul(d,d.clone())},R.prototype.sqr=function(d){return this.mul(d,d)},R.prototype.sqrt=function(d){if(d.isZero())return d.clone();var b=this.m.andln(3);if(i(b%2===1),b===3){var _=this.m.add(new n(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),v=0;!w.isZero()&&w.andln(1)===0;)v++,w.iushrn(1);i(!w.isZero());var I=new n(1).toRed(this),P=I.redNeg(),E=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);this.pow(p,E).cmp(P)!==0;)p.redIAdd(P);for(var N=this.pow(p,w),q=this.pow(d,w.addn(1).iushrn(1)),H=this.pow(d,w),z=v;H.cmp(I)!==0;){for(var V=H,Y=0;V.cmp(I)!==0;Y++)V=V.redSqr();i(Y<z);var te=this.pow(N,new n(1).iushln(z-Y-1));q=q.redMul(te),N=te.redSqr(),H=H.redMul(N),z=Y}return q},R.prototype.invm=function(d){var b=d._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},R.prototype.pow=function(d,b){if(b.isZero())return new n(1).toRed(this);if(b.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new n(1).toRed(this),w[1]=d;for(var v=2;v<w.length;v++)w[v]=this.mul(w[v-1],d);var I=w[0],P=0,E=0,p=b.bitLength()%26;for(p===0&&(p=26),v=b.length-1;v>=0;v--){for(var N=b.words[v],q=p-1;q>=0;q--){var H=N>>q&1;if(I!==w[0]&&(I=this.sqr(I)),H===0&&P===0){E=0;continue}P<<=1,P|=H,E++,!(E!==_&&(v!==0||q!==0))&&(I=this.mul(I,w[P]),E=0,P=0)}p=26}return I},R.prototype.convertTo=function(d){var b=d.umod(this.m);return b===d?b.clone():b},R.prototype.convertFrom=function(d){var b=d.clone();return b.red=null,b},n.mont=function(d){return new L(d)};function L($){R.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(L,R),L.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},L.prototype.convertFrom=function(d){var b=this.imod(d.mul(this.rinv));return b.red=null,b},L.prototype.imul=function(d,b){if(d.isZero()||b.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(b),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=_.isub(w).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},L.prototype.mul=function(d,b){if(d.isZero()||b.isZero())return new n(0)._forceRed(this);var _=d.mul(b),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=_.isub(w).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},L.prototype.invm=function(d){var b=this.imod(d._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(t,BS)})(kl)),kl.exports}var wd,db;function Gn(){if(db)return wd;db=1,wd=t;function t(e,r){if(!e)throw new Error(r||"Assertion failed")}return t.equal=function(r,i,s){if(r!=i)throw new Error(s||"Assertion failed: "+r+" != "+i)},wd}var vd={},fb;function e2(){return fb||(fb=1,(function(t){var e=t;function r(n,o){if(Array.isArray(n))return n.slice();if(!n)return[];var a=[];if(typeof n!="string"){for(var u=0;u<n.length;u++)a[u]=n[u]|0;return a}if(o==="hex"){n=n.replace(/[^a-z0-9]+/ig,""),n.length%2!==0&&(n="0"+n);for(var u=0;u<n.length;u+=2)a.push(parseInt(n[u]+n[u+1],16))}else for(var u=0;u<n.length;u++){var c=n.charCodeAt(u),l=c>>8,h=c&255;l?a.push(l,h):a.push(h)}return a}e.toArray=r;function i(n){return n.length===1?"0"+n:n}e.zero2=i;function s(n){for(var o="",a=0;a<n.length;a++)o+=i(n[a].toString(16));return o}e.toHex=s,e.encode=function(o,a){return a==="hex"?s(o):o}})(vd)),vd}var pb;function xi(){return pb||(pb=1,(function(t){var e=t,r=Ds(),i=Gn(),s=e2();e.assert=i,e.toArray=s.toArray,e.zero2=s.zero2,e.toHex=s.toHex,e.encode=s.encode;function n(l,h,f){var m=new Array(Math.max(l.bitLength(),f)+1),g;for(g=0;g<m.length;g+=1)m[g]=0;var y=1<<h+1,C=l.clone();for(g=0;g<m.length;g++){var S,A=C.andln(y-1);C.isOdd()?(A>(y>>1)-1?S=(y>>1)-A:S=A,C.isubn(S)):S=0,m[g]=S,C.iushrn(1)}return m}e.getNAF=n;function o(l,h){var f=[[],[]];l=l.clone(),h=h.clone();for(var m=0,g=0,y;l.cmpn(-m)>0||h.cmpn(-g)>0;){var C=l.andln(3)+m&3,S=h.andln(3)+g&3;C===3&&(C=-1),S===3&&(S=-1);var A;(C&1)===0?A=0:(y=l.andln(7)+m&7,(y===3||y===5)&&S===2?A=-C:A=C),f[0].push(A);var D;(S&1)===0?D=0:(y=h.andln(7)+g&7,(y===3||y===5)&&C===2?D=-S:D=S),f[1].push(D),2*m===A+1&&(m=1-m),2*g===D+1&&(g=1-g),l.iushrn(1),h.iushrn(1)}return f}e.getJSF=o;function a(l,h,f){var m="_"+h;l.prototype[h]=function(){return this[m]!==void 0?this[m]:this[m]=f.call(this)}}e.cachedProperty=a;function u(l){return typeof l=="string"?e.toArray(l,"hex"):l}e.parseBytes=u;function c(l){return new r(l,"hex","le")}e.intFromLE=c})(yd)),yd}var nl={exports:{}},gb;function t2(){if(gb)return nl.exports;gb=1;var t;nl.exports=function(s){return t||(t=new e(null)),t.generate(s)};function e(i){this.rand=i}if(nl.exports.Rand=e,e.prototype.generate=function(s){return this._rand(s)},e.prototype._rand=function(s){if(this.rand.getBytes)return this.rand.getBytes(s);for(var n=new Uint8Array(s),o=0;o<n.length;o++)n[o]=this.rand.getByte();return n},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(s){var n=new Uint8Array(s);return self.crypto.getRandomValues(n),n}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(s){var n=new Uint8Array(s);return self.msCrypto.getRandomValues(n),n}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=Jv;if(typeof r.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(s){return r.randomBytes(s)}}catch{}return nl.exports}var _d={},Ed,bb;function $h(){if(bb)return Ed;bb=1;var t=Ds(),e=xi(),r=e.getNAF,i=e.getJSF,s=e.assert;function n(a,u){this.type=a,this.p=new t(u.p,16),this.red=u.prime?t.red(u.prime):t.mont(this.p),this.zero=new t(0).toRed(this.red),this.one=new t(1).toRed(this.red),this.two=new t(2).toRed(this.red),this.n=u.n&&new t(u.n,16),this.g=u.g&&this.pointFromJSON(u.g,u.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Ed=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(u,c){s(u.precomputed);var l=u._getDoubles(),h=r(c,1,this._bitLength),f=(1<<l.step+1)-(l.step%2===0?2:1);f/=3;var m=[],g,y;for(g=0;g<h.length;g+=l.step){y=0;for(var C=g+l.step-1;C>=g;C--)y=(y<<1)+h[C];m.push(y)}for(var S=this.jpoint(null,null,null),A=this.jpoint(null,null,null),D=f;D>0;D--){for(g=0;g<m.length;g++)y=m[g],y===D?A=A.mixedAdd(l.points[g]):y===-D&&(A=A.mixedAdd(l.points[g].neg()));S=S.add(A)}return S.toP()},n.prototype._wnafMul=function(u,c){var l=4,h=u._getNAFPoints(l);l=h.wnd;for(var f=h.points,m=r(c,l,this._bitLength),g=this.jpoint(null,null,null),y=m.length-1;y>=0;y--){for(var C=0;y>=0&&m[y]===0;y--)C++;if(y>=0&&C++,g=g.dblp(C),y<0)break;var S=m[y];s(S!==0),u.type==="affine"?S>0?g=g.mixedAdd(f[S-1>>1]):g=g.mixedAdd(f[-S-1>>1].neg()):S>0?g=g.add(f[S-1>>1]):g=g.add(f[-S-1>>1].neg())}return u.type==="affine"?g.toP():g},n.prototype._wnafMulAdd=function(u,c,l,h,f){var m=this._wnafT1,g=this._wnafT2,y=this._wnafT3,C=0,S,A,D;for(S=0;S<h;S++){D=c[S];var O=D._getNAFPoints(u);m[S]=O.wnd,g[S]=O.points}for(S=h-1;S>=1;S-=2){var T=S-1,x=S;if(m[T]!==1||m[x]!==1){y[T]=r(l[T],m[T],this._bitLength),y[x]=r(l[x],m[x],this._bitLength),C=Math.max(y[T].length,C),C=Math.max(y[x].length,C);continue}var M=[c[T],null,null,c[x]];c[T].y.cmp(c[x].y)===0?(M[1]=c[T].add(c[x]),M[2]=c[T].toJ().mixedAdd(c[x].neg())):c[T].y.cmp(c[x].y.redNeg())===0?(M[1]=c[T].toJ().mixedAdd(c[x]),M[2]=c[T].add(c[x].neg())):(M[1]=c[T].toJ().mixedAdd(c[x]),M[2]=c[T].toJ().mixedAdd(c[x].neg()));var U=[-3,-1,-5,-7,0,7,5,1,3],R=i(l[T],l[x]);for(C=Math.max(R[0].length,C),y[T]=new Array(C),y[x]=new Array(C),A=0;A<C;A++){var L=R[0][A]|0,$=R[1][A]|0;y[T][A]=U[(L+1)*3+($+1)],y[x][A]=0,g[T]=M}}var d=this.jpoint(null,null,null),b=this._wnafT4;for(S=C;S>=0;S--){for(var _=0;S>=0;){var w=!0;for(A=0;A<h;A++)b[A]=y[A][S]|0,b[A]!==0&&(w=!1);if(!w)break;_++,S--}if(S>=0&&_++,d=d.dblp(_),S<0)break;for(A=0;A<h;A++){var v=b[A];v!==0&&(v>0?D=g[A][v-1>>1]:v<0&&(D=g[A][-v-1>>1].neg()),D.type==="affine"?d=d.mixedAdd(D):d=d.add(D))}}for(S=0;S<h;S++)g[S]=null;return f?d:d.toP()};function o(a,u){this.curve=a,this.type=u,this.precomputed=null}return n.BasePoint=o,o.prototype.eq=function(){throw new Error("Not implemented")},o.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(u,c){u=e.toArray(u,c);var l=this.p.byteLength();if((u[0]===4||u[0]===6||u[0]===7)&&u.length-1===2*l){u[0]===6?s(u[u.length-1]%2===0):u[0]===7&&s(u[u.length-1]%2===1);var h=this.point(u.slice(1,1+l),u.slice(1+l,1+2*l));return h}else if((u[0]===2||u[0]===3)&&u.length-1===l)return this.pointFromX(u.slice(1,1+l),u[0]===3);throw new Error("Unknown point format")},o.prototype.encodeCompressed=function(u){return this.encode(u,!0)},o.prototype._encode=function(u){var c=this.curve.p.byteLength(),l=this.getX().toArray("be",c);return u?[this.getY().isEven()?2:3].concat(l):[4].concat(l,this.getY().toArray("be",c))},o.prototype.encode=function(u,c){return e.encode(this._encode(c),u)},o.prototype.precompute=function(u){if(this.precomputed)return this;var c={doubles:null,naf:null,beta:null};return c.naf=this._getNAFPoints(8),c.doubles=this._getDoubles(4,u),c.beta=this._getBeta(),this.precomputed=c,this},o.prototype._hasDoubles=function(u){if(!this.precomputed)return!1;var c=this.precomputed.doubles;return c?c.points.length>=Math.ceil((u.bitLength()+1)/c.step):!1},o.prototype._getDoubles=function(u,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var l=[this],h=this,f=0;f<c;f+=u){for(var m=0;m<u;m++)h=h.dbl();l.push(h)}return{step:u,points:l}},o.prototype._getNAFPoints=function(u){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var c=[this],l=(1<<u)-1,h=l===1?null:this.dbl(),f=1;f<l;f++)c[f]=c[f-1].add(h);return{wnd:u,points:c}},o.prototype._getBeta=function(){return null},o.prototype.dblp=function(u){for(var c=this,l=0;l<u;l++)c=c.dbl();return c},Ed}var ol={exports:{}},mb;function xh(){return mb||(mb=1,typeof Object.create=="function"?ol.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ol.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}),ol.exports}var Id,yb;function zS(){if(yb)return Id;yb=1;var t=xi(),e=Ds(),r=xh(),i=$h(),s=t.assert;function n(u){i.call(this,"short",u),this.a=new e(u.a,16).toRed(this.red),this.b=new e(u.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(u),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r(n,i),Id=n,n.prototype._getEndomorphism=function(c){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var l,h;if(c.beta)l=new e(c.beta,16).toRed(this.red);else{var f=this._getEndoRoots(this.p);l=f[0].cmp(f[1])<0?f[0]:f[1],l=l.toRed(this.red)}if(c.lambda)h=new e(c.lambda,16);else{var m=this._getEndoRoots(this.n);this.g.mul(m[0]).x.cmp(this.g.x.redMul(l))===0?h=m[0]:(h=m[1],s(this.g.mul(h).x.cmp(this.g.x.redMul(l))===0))}var g;return c.basis?g=c.basis.map(function(y){return{a:new e(y.a,16),b:new e(y.b,16)}}):g=this._getEndoBasis(h),{beta:l,lambda:h,basis:g}}},n.prototype._getEndoRoots=function(c){var l=c===this.p?this.red:e.mont(c),h=new e(2).toRed(l).redInvm(),f=h.redNeg(),m=new e(3).toRed(l).redNeg().redSqrt().redMul(h),g=f.redAdd(m).fromRed(),y=f.redSub(m).fromRed();return[g,y]},n.prototype._getEndoBasis=function(c){for(var l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=c,f=this.n.clone(),m=new e(1),g=new e(0),y=new e(0),C=new e(1),S,A,D,O,T,x,M,U=0,R,L;h.cmpn(0)!==0;){var $=f.div(h);R=f.sub($.mul(h)),L=y.sub($.mul(m));var d=C.sub($.mul(g));if(!D&&R.cmp(l)<0)S=M.neg(),A=m,D=R.neg(),O=L;else if(D&&++U===2)break;M=R,f=h,h=R,y=m,m=L,C=g,g=d}T=R.neg(),x=L;var b=D.sqr().add(O.sqr()),_=T.sqr().add(x.sqr());return _.cmp(b)>=0&&(T=S,x=A),D.negative&&(D=D.neg(),O=O.neg()),T.negative&&(T=T.neg(),x=x.neg()),[{a:D,b:O},{a:T,b:x}]},n.prototype._endoSplit=function(c){var l=this.endo.basis,h=l[0],f=l[1],m=f.b.mul(c).divRound(this.n),g=h.b.neg().mul(c).divRound(this.n),y=m.mul(h.a),C=g.mul(f.a),S=m.mul(h.b),A=g.mul(f.b),D=c.sub(y).sub(C),O=S.add(A).neg();return{k1:D,k2:O}},n.prototype.pointFromX=function(c,l){c=new e(c,16),c.red||(c=c.toRed(this.red));var h=c.redSqr().redMul(c).redIAdd(c.redMul(this.a)).redIAdd(this.b),f=h.redSqrt();if(f.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var m=f.fromRed().isOdd();return(l&&!m||!l&&m)&&(f=f.redNeg()),this.point(c,f)},n.prototype.validate=function(c){if(c.inf)return!0;var l=c.x,h=c.y,f=this.a.redMul(l),m=l.redSqr().redMul(l).redIAdd(f).redIAdd(this.b);return h.redSqr().redISub(m).cmpn(0)===0},n.prototype._endoWnafMulAdd=function(c,l,h){for(var f=this._endoWnafT1,m=this._endoWnafT2,g=0;g<c.length;g++){var y=this._endoSplit(l[g]),C=c[g],S=C._getBeta();y.k1.negative&&(y.k1.ineg(),C=C.neg(!0)),y.k2.negative&&(y.k2.ineg(),S=S.neg(!0)),f[g*2]=C,f[g*2+1]=S,m[g*2]=y.k1,m[g*2+1]=y.k2}for(var A=this._wnafMulAdd(1,f,m,g*2,h),D=0;D<g*2;D++)f[D]=null,m[D]=null;return A};function o(u,c,l,h){i.BasePoint.call(this,u,"affine"),c===null&&l===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(c,16),this.y=new e(l,16),h&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}r(o,i.BasePoint),n.prototype.point=function(c,l,h){return new o(this,c,l,h)},n.prototype.pointFromJSON=function(c,l){return o.fromJSON(this,c,l)},o.prototype._getBeta=function(){if(this.curve.endo){var c=this.precomputed;if(c&&c.beta)return c.beta;var l=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(c){var h=this.curve,f=function(m){return h.point(m.x.redMul(h.endo.beta),m.y)};c.beta=l,l.precomputed={beta:null,naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(f)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(f)}}}return l}},o.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},o.fromJSON=function(c,l,h){typeof l=="string"&&(l=JSON.parse(l));var f=c.point(l[0],l[1],h);if(!l[2])return f;function m(y){return c.point(y[0],y[1],h)}var g=l[2];return f.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[f].concat(g.doubles.points.map(m))},naf:g.naf&&{wnd:g.naf.wnd,points:[f].concat(g.naf.points.map(m))}},f},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return this.inf},o.prototype.add=function(c){if(this.inf)return c;if(c.inf)return this;if(this.eq(c))return this.dbl();if(this.neg().eq(c))return this.curve.point(null,null);if(this.x.cmp(c.x)===0)return this.curve.point(null,null);var l=this.y.redSub(c.y);l.cmpn(0)!==0&&(l=l.redMul(this.x.redSub(c.x).redInvm()));var h=l.redSqr().redISub(this.x).redISub(c.x),f=l.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,f)},o.prototype.dbl=function(){if(this.inf)return this;var c=this.y.redAdd(this.y);if(c.cmpn(0)===0)return this.curve.point(null,null);var l=this.curve.a,h=this.x.redSqr(),f=c.redInvm(),m=h.redAdd(h).redIAdd(h).redIAdd(l).redMul(f),g=m.redSqr().redISub(this.x.redAdd(this.x)),y=m.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)},o.prototype.getX=function(){return this.x.fromRed()},o.prototype.getY=function(){return this.y.fromRed()},o.prototype.mul=function(c){return c=new e(c,16),this.isInfinity()?this:this._hasDoubles(c)?this.curve._fixedNafMul(this,c):this.curve.endo?this.curve._endoWnafMulAdd([this],[c]):this.curve._wnafMul(this,c)},o.prototype.mulAdd=function(c,l,h){var f=[this,l],m=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(f,m):this.curve._wnafMulAdd(1,f,m,2)},o.prototype.jmulAdd=function(c,l,h){var f=[this,l],m=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(f,m,!0):this.curve._wnafMulAdd(1,f,m,2,!0)},o.prototype.eq=function(c){return this===c||this.inf===c.inf&&(this.inf||this.x.cmp(c.x)===0&&this.y.cmp(c.y)===0)},o.prototype.neg=function(c){if(this.inf)return this;var l=this.curve.point(this.x,this.y.redNeg());if(c&&this.precomputed){var h=this.precomputed,f=function(m){return m.neg()};l.precomputed={naf:h.naf&&{wnd:h.naf.wnd,points:h.naf.points.map(f)},doubles:h.doubles&&{step:h.doubles.step,points:h.doubles.points.map(f)}}}return l},o.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var c=this.curve.jpoint(this.x,this.y,this.curve.one);return c};function a(u,c,l,h){i.BasePoint.call(this,u,"jacobian"),c===null&&l===null&&h===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(c,16),this.y=new e(l,16),this.z=new e(h,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(a,i.BasePoint),n.prototype.jpoint=function(c,l,h){return new a(this,c,l,h)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var c=this.z.redInvm(),l=c.redSqr(),h=this.x.redMul(l),f=this.y.redMul(l).redMul(c);return this.curve.point(h,f)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(c){if(this.isInfinity())return c;if(c.isInfinity())return this;var l=c.z.redSqr(),h=this.z.redSqr(),f=this.x.redMul(l),m=c.x.redMul(h),g=this.y.redMul(l.redMul(c.z)),y=c.y.redMul(h.redMul(this.z)),C=f.redSub(m),S=g.redSub(y);if(C.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var A=C.redSqr(),D=A.redMul(C),O=f.redMul(A),T=S.redSqr().redIAdd(D).redISub(O).redISub(O),x=S.redMul(O.redISub(T)).redISub(g.redMul(D)),M=this.z.redMul(c.z).redMul(C);return this.curve.jpoint(T,x,M)},a.prototype.mixedAdd=function(c){if(this.isInfinity())return c.toJ();if(c.isInfinity())return this;var l=this.z.redSqr(),h=this.x,f=c.x.redMul(l),m=this.y,g=c.y.redMul(l).redMul(this.z),y=h.redSub(f),C=m.redSub(g);if(y.cmpn(0)===0)return C.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=y.redSqr(),A=S.redMul(y),D=h.redMul(S),O=C.redSqr().redIAdd(A).redISub(D).redISub(D),T=C.redMul(D.redISub(O)).redISub(m.redMul(A)),x=this.z.redMul(y);return this.curve.jpoint(O,T,x)},a.prototype.dblp=function(c){if(c===0)return this;if(this.isInfinity())return this;if(!c)return this.dbl();var l;if(this.curve.zeroA||this.curve.threeA){var h=this;for(l=0;l<c;l++)h=h.dbl();return h}var f=this.curve.a,m=this.curve.tinv,g=this.x,y=this.y,C=this.z,S=C.redSqr().redSqr(),A=y.redAdd(y);for(l=0;l<c;l++){var D=g.redSqr(),O=A.redSqr(),T=O.redSqr(),x=D.redAdd(D).redIAdd(D).redIAdd(f.redMul(S)),M=g.redMul(O),U=x.redSqr().redISub(M.redAdd(M)),R=M.redISub(U),L=x.redMul(R);L=L.redIAdd(L).redISub(T);var $=A.redMul(C);l+1<c&&(S=S.redMul(T)),g=U,C=$,A=L}return this.curve.jpoint(g,A.redMul(m),C)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var c,l,h;if(this.zOne){var f=this.x.redSqr(),m=this.y.redSqr(),g=m.redSqr(),y=this.x.redAdd(m).redSqr().redISub(f).redISub(g);y=y.redIAdd(y);var C=f.redAdd(f).redIAdd(f),S=C.redSqr().redISub(y).redISub(y),A=g.redIAdd(g);A=A.redIAdd(A),A=A.redIAdd(A),c=S,l=C.redMul(y.redISub(S)).redISub(A),h=this.y.redAdd(this.y)}else{var D=this.x.redSqr(),O=this.y.redSqr(),T=O.redSqr(),x=this.x.redAdd(O).redSqr().redISub(D).redISub(T);x=x.redIAdd(x);var M=D.redAdd(D).redIAdd(D),U=M.redSqr(),R=T.redIAdd(T);R=R.redIAdd(R),R=R.redIAdd(R),c=U.redISub(x).redISub(x),l=M.redMul(x.redISub(c)).redISub(R),h=this.y.redMul(this.z),h=h.redIAdd(h)}return this.curve.jpoint(c,l,h)},a.prototype._threeDbl=function(){var c,l,h;if(this.zOne){var f=this.x.redSqr(),m=this.y.redSqr(),g=m.redSqr(),y=this.x.redAdd(m).redSqr().redISub(f).redISub(g);y=y.redIAdd(y);var C=f.redAdd(f).redIAdd(f).redIAdd(this.curve.a),S=C.redSqr().redISub(y).redISub(y);c=S;var A=g.redIAdd(g);A=A.redIAdd(A),A=A.redIAdd(A),l=C.redMul(y.redISub(S)).redISub(A),h=this.y.redAdd(this.y)}else{var D=this.z.redSqr(),O=this.y.redSqr(),T=this.x.redMul(O),x=this.x.redSub(D).redMul(this.x.redAdd(D));x=x.redAdd(x).redIAdd(x);var M=T.redIAdd(T);M=M.redIAdd(M);var U=M.redAdd(M);c=x.redSqr().redISub(U),h=this.y.redAdd(this.z).redSqr().redISub(O).redISub(D);var R=O.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R),l=x.redMul(M.redISub(c)).redISub(R)}return this.curve.jpoint(c,l,h)},a.prototype._dbl=function(){var c=this.curve.a,l=this.x,h=this.y,f=this.z,m=f.redSqr().redSqr(),g=l.redSqr(),y=h.redSqr(),C=g.redAdd(g).redIAdd(g).redIAdd(c.redMul(m)),S=l.redAdd(l);S=S.redIAdd(S);var A=S.redMul(y),D=C.redSqr().redISub(A.redAdd(A)),O=A.redISub(D),T=y.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T);var x=C.redMul(O).redISub(T),M=h.redAdd(h).redMul(f);return this.curve.jpoint(D,x,M)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var c=this.x.redSqr(),l=this.y.redSqr(),h=this.z.redSqr(),f=l.redSqr(),m=c.redAdd(c).redIAdd(c),g=m.redSqr(),y=this.x.redAdd(l).redSqr().redISub(c).redISub(f);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var C=y.redSqr(),S=f.redIAdd(f);S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var A=m.redIAdd(y).redSqr().redISub(g).redISub(C).redISub(S),D=l.redMul(A);D=D.redIAdd(D),D=D.redIAdd(D);var O=this.x.redMul(C).redISub(D);O=O.redIAdd(O),O=O.redIAdd(O);var T=this.y.redMul(A.redMul(S.redISub(A)).redISub(y.redMul(C)));T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T);var x=this.z.redAdd(y).redSqr().redISub(h).redISub(C);return this.curve.jpoint(O,T,x)},a.prototype.mul=function(c,l){return c=new e(c,l),this.curve._wnafMul(this,c)},a.prototype.eq=function(c){if(c.type==="affine")return this.eq(c.toJ());if(this===c)return!0;var l=this.z.redSqr(),h=c.z.redSqr();if(this.x.redMul(h).redISub(c.x.redMul(l)).cmpn(0)!==0)return!1;var f=l.redMul(this.z),m=h.redMul(c.z);return this.y.redMul(m).redISub(c.y.redMul(f)).cmpn(0)===0},a.prototype.eqXToP=function(c){var l=this.z.redSqr(),h=c.toRed(this.curve.red).redMul(l);if(this.x.cmp(h)===0)return!0;for(var f=c.clone(),m=this.curve.redN.redMul(l);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(h.redIAdd(m),this.x.cmp(h)===0)return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Id}var Ad,wb;function HS(){if(wb)return Ad;wb=1;var t=Ds(),e=xh(),r=$h(),i=xi();function s(o){r.call(this,"mont",o),this.a=new t(o.a,16).toRed(this.red),this.b=new t(o.b,16).toRed(this.red),this.i4=new t(4).toRed(this.red).redInvm(),this.two=new t(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}e(s,r),Ad=s,s.prototype.validate=function(a){var u=a.normalize().x,c=u.redSqr(),l=c.redMul(u).redAdd(c.redMul(this.a)).redAdd(u),h=l.redSqrt();return h.redSqr().cmp(l)===0};function n(o,a,u){r.BasePoint.call(this,o,"projective"),a===null&&u===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new t(a,16),this.z=new t(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(n,r.BasePoint),s.prototype.decodePoint=function(a,u){return this.point(i.toArray(a,u),1)},s.prototype.point=function(a,u){return new n(this,a,u)},s.prototype.pointFromJSON=function(a){return n.fromJSON(this,a)},n.prototype.precompute=function(){},n.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(a,u){return new n(a,u[0],u[1]||a.one)},n.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},n.prototype.isInfinity=function(){return this.z.cmpn(0)===0},n.prototype.dbl=function(){var a=this.x.redAdd(this.z),u=a.redSqr(),c=this.x.redSub(this.z),l=c.redSqr(),h=u.redSub(l),f=u.redMul(l),m=h.redMul(l.redAdd(this.curve.a24.redMul(h)));return this.curve.point(f,m)},n.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.diffAdd=function(a,u){var c=this.x.redAdd(this.z),l=this.x.redSub(this.z),h=a.x.redAdd(a.z),f=a.x.redSub(a.z),m=f.redMul(c),g=h.redMul(l),y=u.z.redMul(m.redAdd(g).redSqr()),C=u.x.redMul(m.redISub(g).redSqr());return this.curve.point(y,C)},n.prototype.mul=function(a){for(var u=a.clone(),c=this,l=this.curve.point(null,null),h=this,f=[];u.cmpn(0)!==0;u.iushrn(1))f.push(u.andln(1));for(var m=f.length-1;m>=0;m--)f[m]===0?(c=c.diffAdd(l,h),l=l.dbl()):(l=c.diffAdd(l,h),c=c.dbl());return l},n.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.eq=function(a){return this.getX().cmp(a.getX())===0},n.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Ad}var Sd,vb;function VS(){if(vb)return Sd;vb=1;var t=xi(),e=Ds(),r=xh(),i=$h(),s=t.assert;function n(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new e(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}r(n,i),Sd=n,n.prototype._mulA=function(u){return this.mOneA?u.redNeg():this.a.redMul(u)},n.prototype._mulC=function(u){return this.oneC?u:this.c.redMul(u)},n.prototype.jpoint=function(u,c,l,h){return this.point(u,c,l,h)},n.prototype.pointFromX=function(u,c){u=new e(u,16),u.red||(u=u.toRed(this.red));var l=u.redSqr(),h=this.c2.redSub(this.a.redMul(l)),f=this.one.redSub(this.c2.redMul(this.d).redMul(l)),m=h.redMul(f.redInvm()),g=m.redSqrt();if(g.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");var y=g.fromRed().isOdd();return(c&&!y||!c&&y)&&(g=g.redNeg()),this.point(u,g)},n.prototype.pointFromY=function(u,c){u=new e(u,16),u.red||(u=u.toRed(this.red));var l=u.redSqr(),h=l.redSub(this.c2),f=l.redMul(this.d).redMul(this.c2).redSub(this.a),m=h.redMul(f.redInvm());if(m.cmp(this.zero)===0){if(c)throw new Error("invalid point");return this.point(this.zero,u)}var g=m.redSqrt();if(g.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");return g.fromRed().isOdd()!==c&&(g=g.redNeg()),this.point(g,u)},n.prototype.validate=function(u){if(u.isInfinity())return!0;u.normalize();var c=u.x.redSqr(),l=u.y.redSqr(),h=c.redMul(this.a).redAdd(l),f=this.c2.redMul(this.one.redAdd(this.d.redMul(c).redMul(l)));return h.cmp(f)===0};function o(a,u,c,l,h){i.BasePoint.call(this,a,"projective"),u===null&&c===null&&l===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(u,16),this.y=new e(c,16),this.z=l?new e(l,16):this.curve.one,this.t=h&&new e(h,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,i.BasePoint),n.prototype.pointFromJSON=function(u){return o.fromJSON(this,u)},n.prototype.point=function(u,c,l,h){return new o(this,u,c,l,h)},o.fromJSON=function(u,c){return new o(u,c[0],c[1],c[2])},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},o.prototype._extDbl=function(){var u=this.x.redSqr(),c=this.y.redSqr(),l=this.z.redSqr();l=l.redIAdd(l);var h=this.curve._mulA(u),f=this.x.redAdd(this.y).redSqr().redISub(u).redISub(c),m=h.redAdd(c),g=m.redSub(l),y=h.redSub(c),C=f.redMul(g),S=m.redMul(y),A=f.redMul(y),D=g.redMul(m);return this.curve.point(C,S,D,A)},o.prototype._projDbl=function(){var u=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),l=this.y.redSqr(),h,f,m,g,y,C;if(this.curve.twisted){g=this.curve._mulA(c);var S=g.redAdd(l);this.zOne?(h=u.redSub(c).redSub(l).redMul(S.redSub(this.curve.two)),f=S.redMul(g.redSub(l)),m=S.redSqr().redSub(S).redSub(S)):(y=this.z.redSqr(),C=S.redSub(y).redISub(y),h=u.redSub(c).redISub(l).redMul(C),f=S.redMul(g.redSub(l)),m=S.redMul(C))}else g=c.redAdd(l),y=this.curve._mulC(this.z).redSqr(),C=g.redSub(y).redSub(y),h=this.curve._mulC(u.redISub(g)).redMul(C),f=this.curve._mulC(g).redMul(c.redISub(l)),m=g.redMul(C);return this.curve.point(h,f,m)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},o.prototype._extAdd=function(u){var c=this.y.redSub(this.x).redMul(u.y.redSub(u.x)),l=this.y.redAdd(this.x).redMul(u.y.redAdd(u.x)),h=this.t.redMul(this.curve.dd).redMul(u.t),f=this.z.redMul(u.z.redAdd(u.z)),m=l.redSub(c),g=f.redSub(h),y=f.redAdd(h),C=l.redAdd(c),S=m.redMul(g),A=y.redMul(C),D=m.redMul(C),O=g.redMul(y);return this.curve.point(S,A,O,D)},o.prototype._projAdd=function(u){var c=this.z.redMul(u.z),l=c.redSqr(),h=this.x.redMul(u.x),f=this.y.redMul(u.y),m=this.curve.d.redMul(h).redMul(f),g=l.redSub(m),y=l.redAdd(m),C=this.x.redAdd(this.y).redMul(u.x.redAdd(u.y)).redISub(h).redISub(f),S=c.redMul(g).redMul(C),A,D;return this.curve.twisted?(A=c.redMul(y).redMul(f.redSub(this.curve._mulA(h))),D=g.redMul(y)):(A=c.redMul(y).redMul(f.redSub(h)),D=this.curve._mulC(g).redMul(y)),this.curve.point(S,A,D)},o.prototype.add=function(u){return this.isInfinity()?u:u.isInfinity()?this:this.curve.extended?this._extAdd(u):this._projAdd(u)},o.prototype.mul=function(u){return this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve._wnafMul(this,u)},o.prototype.mulAdd=function(u,c,l){return this.curve._wnafMulAdd(1,[this,c],[u,l],2,!1)},o.prototype.jmulAdd=function(u,c,l){return this.curve._wnafMulAdd(1,[this,c],[u,l],2,!0)},o.prototype.normalize=function(){if(this.zOne)return this;var u=this.z.redInvm();return this.x=this.x.redMul(u),this.y=this.y.redMul(u),this.t&&(this.t=this.t.redMul(u)),this.z=this.curve.one,this.zOne=!0,this},o.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},o.prototype.getY=function(){return this.normalize(),this.y.fromRed()},o.prototype.eq=function(u){return this===u||this.getX().cmp(u.getX())===0&&this.getY().cmp(u.getY())===0},o.prototype.eqXToP=function(u){var c=u.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(c)===0)return!0;for(var l=u.clone(),h=this.curve.redN.redMul(this.z);;){if(l.iadd(this.curve.n),l.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(h),this.x.cmp(c)===0)return!0}},o.prototype.toP=o.prototype.normalize,o.prototype.mixedAdd=o.prototype.add,Sd}var _b;function r2(){return _b||(_b=1,(function(t){var e=t;e.base=$h(),e.short=zS(),e.mont=HS(),e.edwards=VS()})(_d)),_d}var Cd={},$d={},Ye={},Eb;function ds(){if(Eb)return Ye;Eb=1;var t=Gn(),e=xh();Ye.inherits=e;function r(d,b){return(d.charCodeAt(b)&64512)!==55296||b<0||b+1>=d.length?!1:(d.charCodeAt(b+1)&64512)===56320}function i(d,b){if(Array.isArray(d))return d.slice();if(!d)return[];var _=[];if(typeof d=="string")if(b){if(b==="hex")for(d=d.replace(/[^a-z0-9]+/ig,""),d.length%2!==0&&(d="0"+d),v=0;v<d.length;v+=2)_.push(parseInt(d[v]+d[v+1],16))}else for(var w=0,v=0;v<d.length;v++){var I=d.charCodeAt(v);I<128?_[w++]=I:I<2048?(_[w++]=I>>6|192,_[w++]=I&63|128):r(d,v)?(I=65536+((I&1023)<<10)+(d.charCodeAt(++v)&1023),_[w++]=I>>18|240,_[w++]=I>>12&63|128,_[w++]=I>>6&63|128,_[w++]=I&63|128):(_[w++]=I>>12|224,_[w++]=I>>6&63|128,_[w++]=I&63|128)}else for(v=0;v<d.length;v++)_[v]=d[v]|0;return _}Ye.toArray=i;function s(d){for(var b="",_=0;_<d.length;_++)b+=a(d[_].toString(16));return b}Ye.toHex=s;function n(d){var b=d>>>24|d>>>8&65280|d<<8&16711680|(d&255)<<24;return b>>>0}Ye.htonl=n;function o(d,b){for(var _="",w=0;w<d.length;w++){var v=d[w];b==="little"&&(v=n(v)),_+=u(v.toString(16))}return _}Ye.toHex32=o;function a(d){return d.length===1?"0"+d:d}Ye.zero2=a;function u(d){return d.length===7?"0"+d:d.length===6?"00"+d:d.length===5?"000"+d:d.length===4?"0000"+d:d.length===3?"00000"+d:d.length===2?"000000"+d:d.length===1?"0000000"+d:d}Ye.zero8=u;function c(d,b,_,w){var v=_-b;t(v%4===0);for(var I=new Array(v/4),P=0,E=b;P<I.length;P++,E+=4){var p;w==="big"?p=d[E]<<24|d[E+1]<<16|d[E+2]<<8|d[E+3]:p=d[E+3]<<24|d[E+2]<<16|d[E+1]<<8|d[E],I[P]=p>>>0}return I}Ye.join32=c;function l(d,b){for(var _=new Array(d.length*4),w=0,v=0;w<d.length;w++,v+=4){var I=d[w];b==="big"?(_[v]=I>>>24,_[v+1]=I>>>16&255,_[v+2]=I>>>8&255,_[v+3]=I&255):(_[v+3]=I>>>24,_[v+2]=I>>>16&255,_[v+1]=I>>>8&255,_[v]=I&255)}return _}Ye.split32=l;function h(d,b){return d>>>b|d<<32-b}Ye.rotr32=h;function f(d,b){return d<<b|d>>>32-b}Ye.rotl32=f;function m(d,b){return d+b>>>0}Ye.sum32=m;function g(d,b,_){return d+b+_>>>0}Ye.sum32_3=g;function y(d,b,_,w){return d+b+_+w>>>0}Ye.sum32_4=y;function C(d,b,_,w,v){return d+b+_+w+v>>>0}Ye.sum32_5=C;function S(d,b,_,w){var v=d[b],I=d[b+1],P=w+I>>>0,E=(P<w?1:0)+_+v;d[b]=E>>>0,d[b+1]=P}Ye.sum64=S;function A(d,b,_,w){var v=b+w>>>0,I=(v<b?1:0)+d+_;return I>>>0}Ye.sum64_hi=A;function D(d,b,_,w){var v=b+w;return v>>>0}Ye.sum64_lo=D;function O(d,b,_,w,v,I,P,E){var p=0,N=b;N=N+w>>>0,p+=N<b?1:0,N=N+I>>>0,p+=N<I?1:0,N=N+E>>>0,p+=N<E?1:0;var q=d+_+v+P+p;return q>>>0}Ye.sum64_4_hi=O;function T(d,b,_,w,v,I,P,E){var p=b+w+I+E;return p>>>0}Ye.sum64_4_lo=T;function x(d,b,_,w,v,I,P,E,p,N){var q=0,H=b;H=H+w>>>0,q+=H<b?1:0,H=H+I>>>0,q+=H<I?1:0,H=H+E>>>0,q+=H<E?1:0,H=H+N>>>0,q+=H<N?1:0;var z=d+_+v+P+p+q;return z>>>0}Ye.sum64_5_hi=x;function M(d,b,_,w,v,I,P,E,p,N){var q=b+w+I+E+N;return q>>>0}Ye.sum64_5_lo=M;function U(d,b,_){var w=b<<32-_|d>>>_;return w>>>0}Ye.rotr64_hi=U;function R(d,b,_){var w=d<<32-_|b>>>_;return w>>>0}Ye.rotr64_lo=R;function L(d,b,_){return d>>>_}Ye.shr64_hi=L;function $(d,b,_){var w=d<<32-_|b>>>_;return w>>>0}return Ye.shr64_lo=$,Ye}var xd={},Ib;function Au(){if(Ib)return xd;Ib=1;var t=ds(),e=Gn();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return xd.BlockHash=r,r.prototype.update=function(s,n){if(s=t.toArray(s,n),this.pending?this.pending=this.pending.concat(s):this.pending=s,this.pendingTotal+=s.length,this.pending.length>=this._delta8){s=this.pending;var o=s.length%this._delta8;this.pending=s.slice(s.length-o,s.length),this.pending.length===0&&(this.pending=null),s=t.join32(s,0,s.length-o,this.endian);for(var a=0;a<s.length;a+=this._delta32)this._update(s,a,a+this._delta32)}return this},r.prototype.digest=function(s){return this.update(this._pad()),e(this.pending===null),this._digest(s)},r.prototype._pad=function(){var s=this.pendingTotal,n=this._delta8,o=n-(s+this.padLength)%n,a=new Array(o+this.padLength);a[0]=128;for(var u=1;u<o;u++)a[u]=0;if(s<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)a[u++]=0;a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=s>>>24&255,a[u++]=s>>>16&255,a[u++]=s>>>8&255,a[u++]=s&255}else for(a[u++]=s&255,a[u++]=s>>>8&255,a[u++]=s>>>16&255,a[u++]=s>>>24&255,a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=0,c=8;c<this.padLength;c++)a[u++]=0;return a},xd}var yn={},Ji={},Ab;function i2(){if(Ab)return Ji;Ab=1;var t=ds(),e=t.rotr32;function r(l,h,f,m){if(l===0)return i(h,f,m);if(l===1||l===3)return n(h,f,m);if(l===2)return s(h,f,m)}Ji.ft_1=r;function i(l,h,f){return l&h^~l&f}Ji.ch32=i;function s(l,h,f){return l&h^l&f^h&f}Ji.maj32=s;function n(l,h,f){return l^h^f}Ji.p32=n;function o(l){return e(l,2)^e(l,13)^e(l,22)}Ji.s0_256=o;function a(l){return e(l,6)^e(l,11)^e(l,25)}Ji.s1_256=a;function u(l){return e(l,7)^e(l,18)^l>>>3}Ji.g0_256=u;function c(l){return e(l,17)^e(l,19)^l>>>10}return Ji.g1_256=c,Ji}var Pd,Sb;function KS(){if(Sb)return Pd;Sb=1;var t=ds(),e=Au(),r=i2(),i=t.rotl32,s=t.sum32,n=t.sum32_5,o=r.ft_1,a=e.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return t.inherits(c,a),Pd=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(h,f){for(var m=this.W,g=0;g<16;g++)m[g]=h[f+g];for(;g<m.length;g++)m[g]=i(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);var y=this.h[0],C=this.h[1],S=this.h[2],A=this.h[3],D=this.h[4];for(g=0;g<m.length;g++){var O=~~(g/20),T=n(i(y,5),o(O,C,S,A),D,m[g],u[O]);D=A,A=S,S=i(C,30),C=y,y=T}this.h[0]=s(this.h[0],y),this.h[1]=s(this.h[1],C),this.h[2]=s(this.h[2],S),this.h[3]=s(this.h[3],A),this.h[4]=s(this.h[4],D)},c.prototype._digest=function(h){return h==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Pd}var Nd,Cb;function s2(){if(Cb)return Nd;Cb=1;var t=ds(),e=Au(),r=i2(),i=Gn(),s=t.sum32,n=t.sum32_4,o=t.sum32_5,a=r.ch32,u=r.maj32,c=r.s0_256,l=r.s1_256,h=r.g0_256,f=r.g1_256,m=e.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}return t.inherits(y,m),Nd=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(S,A){for(var D=this.W,O=0;O<16;O++)D[O]=S[A+O];for(;O<D.length;O++)D[O]=n(f(D[O-2]),D[O-7],h(D[O-15]),D[O-16]);var T=this.h[0],x=this.h[1],M=this.h[2],U=this.h[3],R=this.h[4],L=this.h[5],$=this.h[6],d=this.h[7];for(i(this.k.length===D.length),O=0;O<D.length;O++){var b=o(d,l(R),a(R,L,$),this.k[O],D[O]),_=s(c(T),u(T,x,M));d=$,$=L,L=R,R=s(U,b),U=M,M=x,x=T,T=s(b,_)}this.h[0]=s(this.h[0],T),this.h[1]=s(this.h[1],x),this.h[2]=s(this.h[2],M),this.h[3]=s(this.h[3],U),this.h[4]=s(this.h[4],R),this.h[5]=s(this.h[5],L),this.h[6]=s(this.h[6],$),this.h[7]=s(this.h[7],d)},y.prototype._digest=function(S){return S==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Nd}var Od,$b;function WS(){if($b)return Od;$b=1;var t=ds(),e=s2();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return t.inherits(r,e),Od=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(s){return s==="hex"?t.toHex32(this.h.slice(0,7),"big"):t.split32(this.h.slice(0,7),"big")},Od}var Td,xb;function n2(){if(xb)return Td;xb=1;var t=ds(),e=Au(),r=Gn(),i=t.rotr64_hi,s=t.rotr64_lo,n=t.shr64_hi,o=t.shr64_lo,a=t.sum64,u=t.sum64_hi,c=t.sum64_lo,l=t.sum64_4_hi,h=t.sum64_4_lo,f=t.sum64_5_hi,m=t.sum64_5_lo,g=e.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function C(){if(!(this instanceof C))return new C;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}t.inherits(C,g),Td=C,C.blockSize=1024,C.outSize=512,C.hmacStrength=192,C.padLength=128,C.prototype._prepareBlock=function(_,w){for(var v=this.W,I=0;I<32;I++)v[I]=_[w+I];for(;I<v.length;I+=2){var P=$(v[I-4],v[I-3]),E=d(v[I-4],v[I-3]),p=v[I-14],N=v[I-13],q=R(v[I-30],v[I-29]),H=L(v[I-30],v[I-29]),z=v[I-32],V=v[I-31];v[I]=l(P,E,p,N,q,H,z,V),v[I+1]=h(P,E,p,N,q,H,z,V)}},C.prototype._update=function(_,w){this._prepareBlock(_,w);var v=this.W,I=this.h[0],P=this.h[1],E=this.h[2],p=this.h[3],N=this.h[4],q=this.h[5],H=this.h[6],z=this.h[7],V=this.h[8],Y=this.h[9],te=this.h[10],ie=this.h[11],Z=this.h[12],ae=this.h[13],ht=this.h[14],ge=this.h[15];r(this.k.length===v.length);for(var ye=0;ye<v.length;ye+=2){var Dt=ht,Ie=ge,Te=M(V,Y),bi=U(V,Y),Ze=S(V,Y,te,ie,Z),Ke=A(V,Y,te,ie,Z,ae),Vi=this.k[ye],qe=this.k[ye+1],We=v[ye],Ki=v[ye+1],De=f(Dt,Ie,Te,bi,Ze,Ke,Vi,qe,We,Ki),Re=m(Dt,Ie,Te,bi,Ze,Ke,Vi,qe,We,Ki);Dt=T(I,P),Ie=x(I,P),Te=D(I,P,E,p,N),bi=O(I,P,E,p,N,q);var Wi=u(Dt,Ie,Te,bi),Me=c(Dt,Ie,Te,bi);ht=Z,ge=ae,Z=te,ae=ie,te=V,ie=Y,V=u(H,z,De,Re),Y=c(z,z,De,Re),H=N,z=q,N=E,q=p,E=I,p=P,I=u(De,Re,Wi,Me),P=c(De,Re,Wi,Me)}a(this.h,0,I,P),a(this.h,2,E,p),a(this.h,4,N,q),a(this.h,6,H,z),a(this.h,8,V,Y),a(this.h,10,te,ie),a(this.h,12,Z,ae),a(this.h,14,ht,ge)},C.prototype._digest=function(_){return _==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")};function S(b,_,w,v,I){var P=b&w^~b&I;return P<0&&(P+=4294967296),P}function A(b,_,w,v,I,P){var E=_&v^~_&P;return E<0&&(E+=4294967296),E}function D(b,_,w,v,I){var P=b&w^b&I^w&I;return P<0&&(P+=4294967296),P}function O(b,_,w,v,I,P){var E=_&v^_&P^v&P;return E<0&&(E+=4294967296),E}function T(b,_){var w=i(b,_,28),v=i(_,b,2),I=i(_,b,7),P=w^v^I;return P<0&&(P+=4294967296),P}function x(b,_){var w=s(b,_,28),v=s(_,b,2),I=s(_,b,7),P=w^v^I;return P<0&&(P+=4294967296),P}function M(b,_){var w=i(b,_,14),v=i(b,_,18),I=i(_,b,9),P=w^v^I;return P<0&&(P+=4294967296),P}function U(b,_){var w=s(b,_,14),v=s(b,_,18),I=s(_,b,9),P=w^v^I;return P<0&&(P+=4294967296),P}function R(b,_){var w=i(b,_,1),v=i(b,_,8),I=n(b,_,7),P=w^v^I;return P<0&&(P+=4294967296),P}function L(b,_){var w=s(b,_,1),v=s(b,_,8),I=o(b,_,7),P=w^v^I;return P<0&&(P+=4294967296),P}function $(b,_){var w=i(b,_,19),v=i(_,b,29),I=n(b,_,6),P=w^v^I;return P<0&&(P+=4294967296),P}function d(b,_){var w=s(b,_,19),v=s(_,b,29),I=o(b,_,6),P=w^v^I;return P<0&&(P+=4294967296),P}return Td}var Dd,Pb;function GS(){if(Pb)return Dd;Pb=1;var t=ds(),e=n2();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return t.inherits(r,e),Dd=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(s){return s==="hex"?t.toHex32(this.h.slice(0,12),"big"):t.split32(this.h.slice(0,12),"big")},Dd}var Nb;function YS(){return Nb||(Nb=1,yn.sha1=KS(),yn.sha224=WS(),yn.sha256=s2(),yn.sha384=GS(),yn.sha512=n2()),yn}var Rd={},Ob;function JS(){if(Ob)return Rd;Ob=1;var t=ds(),e=Au(),r=t.rotl32,i=t.sum32,s=t.sum32_3,n=t.sum32_4,o=e.BlockHash;function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}t.inherits(a,o),Rd.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(C,S){for(var A=this.h[0],D=this.h[1],O=this.h[2],T=this.h[3],x=this.h[4],M=A,U=D,R=O,L=T,$=x,d=0;d<80;d++){var b=i(r(n(A,u(d,D,O,T),C[h[d]+S],c(d)),m[d]),x);A=x,x=T,T=r(O,10),O=D,D=b,b=i(r(n(M,u(79-d,U,R,L),C[f[d]+S],l(d)),g[d]),$),M=$,$=L,L=r(R,10),R=U,U=b}b=s(this.h[1],O,L),this.h[1]=s(this.h[2],T,$),this.h[2]=s(this.h[3],x,M),this.h[3]=s(this.h[4],A,U),this.h[4]=s(this.h[0],D,R),this.h[0]=b},a.prototype._digest=function(C){return C==="hex"?t.toHex32(this.h,"little"):t.split32(this.h,"little")};function u(y,C,S,A){return y<=15?C^S^A:y<=31?C&S|~C&A:y<=47?(C|~S)^A:y<=63?C&A|S&~A:C^(S|~A)}function c(y){return y<=15?0:y<=31?1518500249:y<=47?1859775393:y<=63?2400959708:2840853838}function l(y){return y<=15?1352829926:y<=31?1548603684:y<=47?1836072691:y<=63?2053994217:0}var h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return Rd}var Md,Tb;function QS(){if(Tb)return Md;Tb=1;var t=ds(),e=Gn();function r(i,s,n){if(!(this instanceof r))return new r(i,s,n);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(s,n))}return Md=r,r.prototype._init=function(s){s.length>this.blockSize&&(s=new this.Hash().update(s).digest()),e(s.length<=this.blockSize);for(var n=s.length;n<this.blockSize;n++)s.push(0);for(n=0;n<s.length;n++)s[n]^=54;for(this.inner=new this.Hash().update(s),n=0;n<s.length;n++)s[n]^=106;this.outer=new this.Hash().update(s)},r.prototype.update=function(s,n){return this.inner.update(s,n),this},r.prototype.digest=function(s){return this.outer.update(this.inner.digest()),this.outer.digest(s)},Md}var Db;function fg(){return Db||(Db=1,(function(t){var e=t;e.utils=ds(),e.common=Au(),e.sha=YS(),e.ripemd=JS(),e.hmac=QS(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})($d)),$d}var kd,Rb;function XS(){return Rb||(Rb=1,kd={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),kd}var Mb;function pg(){return Mb||(Mb=1,(function(t){var e=t,r=fg(),i=r2(),s=xi(),n=s.assert;function o(c){c.type==="short"?this.curve=new i.short(c):c.type==="edwards"?this.curve=new i.edwards(c):this.curve=new i.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(c,l){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var h=new o(l);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:h}),h}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=XS()}catch{u=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})})(Cd)),Cd}var Ud,kb;function ZS(){if(kb)return Ud;kb=1;var t=fg(),e=e2(),r=Gn();function i(s){if(!(this instanceof i))return new i(s);this.hash=s.hash,this.predResist=!!s.predResist,this.outLen=this.hash.outSize,this.minEntropy=s.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=e.toArray(s.entropy,s.entropyEnc||"hex"),o=e.toArray(s.nonce,s.nonceEnc||"hex"),a=e.toArray(s.pers,s.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,o,a)}return Ud=i,i.prototype._init=function(n,o,a){var u=n.concat(o).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c<this.V.length;c++)this.K[c]=0,this.V[c]=1;this._update(u),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new t.hmac(this.hash,this.K)},i.prototype._update=function(n){var o=this._hmac().update(this.V).update([0]);n&&(o=o.update(n)),this.K=o.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(n,o,a,u){typeof o!="string"&&(u=a,a=o,o=null),n=e.toArray(n,o),a=e.toArray(a,u),r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(a||[])),this._reseed=1},i.prototype.generate=function(n,o,a,u){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof o!="string"&&(u=a,a=o,o=null),a&&(a=e.toArray(a,u||"hex"),this._update(a));for(var c=[];c.length<n;)this.V=this._hmac().update(this.V).digest(),c=c.concat(this.V);var l=c.slice(0,n);return this._update(a),this._reseed++,e.encode(l,o)},Ud}var Ld,Ub;function eC(){if(Ub)return Ld;Ub=1;var t=Ds(),e=xi(),r=e.assert;function i(s,n){this.ec=s,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}return Ld=i,i.fromPublic=function(n,o,a){return o instanceof i?o:new i(n,{pub:o,pubEnc:a})},i.fromPrivate=function(n,o,a){return o instanceof i?o:new i(n,{priv:o,privEnc:a})},i.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(n,o){return typeof n=="string"&&(o=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),o?this.pub.encode(o,n):this.pub},i.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(n,o){this.priv=new t(n,o||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(n,o){if(n.x||n.y){this.ec.curve.type==="mont"?r(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&r(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,o)},i.prototype.derive=function(n){return n.validate()||r(n.validate(),"public point not validated"),n.mul(this.priv).getX()},i.prototype.sign=function(n,o,a){return this.ec.sign(n,this,o,a)},i.prototype.verify=function(n,o,a){return this.ec.verify(n,o,this,void 0,a)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ld}var Fd,Lb;function tC(){if(Lb)return Fd;Lb=1;var t=Ds(),e=xi(),r=e.assert;function i(u,c){if(u instanceof i)return u;this._importDER(u,c)||(r(u.r&&u.s,"Signature without r or s"),this.r=new t(u.r,16),this.s=new t(u.s,16),u.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=u.recoveryParam)}Fd=i;function s(){this.place=0}function n(u,c){var l=u[c.place++];if(!(l&128))return l;var h=l&15;if(h===0||h>4||u[c.place]===0)return!1;for(var f=0,m=0,g=c.place;m<h;m++,g++)f<<=8,f|=u[g],f>>>=0;return f<=127?!1:(c.place=g,f)}function o(u){for(var c=0,l=u.length-1;!u[c]&&!(u[c+1]&128)&&c<l;)c++;return c===0?u:u.slice(c)}i.prototype._importDER=function(c,l){c=e.toArray(c,l);var h=new s;if(c[h.place++]!==48)return!1;var f=n(c,h);if(f===!1||f+h.place!==c.length||c[h.place++]!==2)return!1;var m=n(c,h);if(m===!1||(c[h.place]&128)!==0)return!1;var g=c.slice(h.place,m+h.place);if(h.place+=m,c[h.place++]!==2)return!1;var y=n(c,h);if(y===!1||c.length!==y+h.place||(c[h.place]&128)!==0)return!1;var C=c.slice(h.place,y+h.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(C[0]===0)if(C[1]&128)C=C.slice(1);else return!1;return this.r=new t(g),this.s=new t(C),this.recoveryParam=null,!0};function a(u,c){if(c<128){u.push(c);return}var l=1+(Math.log(c)/Math.LN2>>>3);for(u.push(l|128);--l;)u.push(c>>>(l<<3)&255);u.push(c)}return i.prototype.toDER=function(c){var l=this.r.toArray(),h=this.s.toArray();for(l[0]&128&&(l=[0].concat(l)),h[0]&128&&(h=[0].concat(h)),l=o(l),h=o(h);!h[0]&&!(h[1]&128);)h=h.slice(1);var f=[2];a(f,l.length),f=f.concat(l),f.push(2),a(f,h.length);var m=f.concat(h),g=[48];return a(g,m.length),g=g.concat(m),e.encode(g,c)},Fd}var jd,Fb;function rC(){if(Fb)return jd;Fb=1;var t=Ds(),e=ZS(),r=xi(),i=pg(),s=t2(),n=r.assert,o=eC(),a=tC();function u(c){if(!(this instanceof u))return new u(c);typeof c=="string"&&(n(Object.prototype.hasOwnProperty.call(i,c),"Unknown curve "+c),c=i[c]),c instanceof i.PresetCurve&&(c={curve:c}),this.curve=c.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=c.curve.g,this.g.precompute(c.curve.n.bitLength()+1),this.hash=c.hash||c.curve.hash}return jd=u,u.prototype.keyPair=function(l){return new o(this,l)},u.prototype.keyFromPrivate=function(l,h){return o.fromPrivate(this,l,h)},u.prototype.keyFromPublic=function(l,h){return o.fromPublic(this,l,h)},u.prototype.genKeyPair=function(l){l||(l={});for(var h=new e({hash:this.hash,pers:l.pers,persEnc:l.persEnc||"utf8",entropy:l.entropy||s(this.hash.hmacStrength),entropyEnc:l.entropy&&l.entropyEnc||"utf8",nonce:this.n.toArray()}),f=this.n.byteLength(),m=this.n.sub(new t(2));;){var g=new t(h.generate(f));if(!(g.cmp(m)>0))return g.iaddn(1),this.keyFromPrivate(g)}},u.prototype._truncateToN=function(l,h,f){var m;if(t.isBN(l)||typeof l=="number")l=new t(l,16),m=l.byteLength();else if(typeof l=="object")m=l.length,l=new t(l,16);else{var g=l.toString();m=g.length+1>>>1,l=new t(g,16)}typeof f!="number"&&(f=m*8);var y=f-this.n.bitLength();return y>0&&(l=l.ushrn(y)),!h&&l.cmp(this.n)>=0?l.sub(this.n):l},u.prototype.sign=function(l,h,f,m){if(typeof f=="object"&&(m=f,f=null),m||(m={}),typeof l!="string"&&typeof l!="number"&&!t.isBN(l)){n(typeof l=="object"&&l&&typeof l.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),n(l.length>>>0===l.length);for(var g=0;g<l.length;g++)n((l[g]&255)===l[g])}h=this.keyFromPrivate(h,f),l=this._truncateToN(l,!1,m.msgBitLength),n(!l.isNeg(),"Can not sign a negative message");var y=this.n.byteLength(),C=h.getPrivate().toArray("be",y),S=l.toArray("be",y);n(new t(S).eq(l),"Can not sign message");for(var A=new e({hash:this.hash,entropy:C,nonce:S,pers:m.pers,persEnc:m.persEnc||"utf8"}),D=this.n.sub(new t(1)),O=0;;O++){var T=m.k?m.k(O):new t(A.generate(this.n.byteLength()));if(T=this._truncateToN(T,!0),!(T.cmpn(1)<=0||T.cmp(D)>=0)){var x=this.g.mul(T);if(!x.isInfinity()){var M=x.getX(),U=M.umod(this.n);if(U.cmpn(0)!==0){var R=T.invm(this.n).mul(U.mul(h.getPrivate()).iadd(l));if(R=R.umod(this.n),R.cmpn(0)!==0){var L=(x.getY().isOdd()?1:0)|(M.cmp(U)!==0?2:0);return m.canonical&&R.cmp(this.nh)>0&&(R=this.n.sub(R),L^=1),new a({r:U,s:R,recoveryParam:L})}}}}}},u.prototype.verify=function(l,h,f,m,g){g||(g={}),l=this._truncateToN(l,!1,g.msgBitLength),f=this.keyFromPublic(f,m),h=new a(h,"hex");var y=h.r,C=h.s;if(y.cmpn(1)<0||y.cmp(this.n)>=0||C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;var S=C.invm(this.n),A=S.mul(l).umod(this.n),D=S.mul(y).umod(this.n),O;return this.curve._maxwellTrick?(O=this.g.jmulAdd(A,f.getPublic(),D),O.isInfinity()?!1:O.eqXToP(y)):(O=this.g.mulAdd(A,f.getPublic(),D),O.isInfinity()?!1:O.getX().umod(this.n).cmp(y)===0)},u.prototype.recoverPubKey=function(c,l,h,f){n((3&h)===h,"The recovery param is more than two bits"),l=new a(l,f);var m=this.n,g=new t(c),y=l.r,C=l.s,S=h&1,A=h>>1;if(y.cmp(this.curve.p.umod(this.curve.n))>=0&&A)throw new Error("Unable to find sencond key candinate");A?y=this.curve.pointFromX(y.add(this.curve.n),S):y=this.curve.pointFromX(y,S);var D=l.r.invm(m),O=m.sub(g).mul(D).umod(m),T=C.mul(D).umod(m);return this.g.mulAdd(O,y,T)},u.prototype.getKeyRecoveryParam=function(c,l,h,f){if(l=new a(l,f),l.recoveryParam!==null)return l.recoveryParam;for(var m=0;m<4;m++){var g;try{g=this.recoverPubKey(c,l,m)}catch{continue}if(g.eq(h))return m}throw new Error("Unable to find valid recovery factor")},jd}var qd,jb;function iC(){if(jb)return qd;jb=1;var t=xi(),e=t.assert,r=t.parseBytes,i=t.cachedProperty;function s(n,o){this.eddsa=n,this._secret=r(o.secret),n.isPoint(o.pub)?this._pub=o.pub:this._pubBytes=r(o.pub)}return s.fromPublic=function(o,a){return a instanceof s?a:new s(o,{pub:a})},s.fromSecret=function(o,a){return a instanceof s?a:new s(o,{secret:a})},s.prototype.secret=function(){return this._secret},i(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(s,"privBytes",function(){var o=this.eddsa,a=this.hash(),u=o.encodingLength-1,c=a.slice(0,o.encodingLength);return c[0]&=248,c[u]&=127,c[u]|=64,c}),i(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(o){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(o,this)},s.prototype.verify=function(o,a){return this.eddsa.verify(o,a,this)},s.prototype.getSecret=function(o){return e(this._secret,"KeyPair is public only"),t.encode(this.secret(),o)},s.prototype.getPublic=function(o){return t.encode(this.pubBytes(),o)},qd=s,qd}var Bd,qb;function sC(){if(qb)return Bd;qb=1;var t=Ds(),e=xi(),r=e.assert,i=e.cachedProperty,s=e.parseBytes;function n(o,a){this.eddsa=o,typeof a!="object"&&(a=s(a)),Array.isArray(a)&&(r(a.length===o.encodingLength*2,"Signature has invalid size"),a={R:a.slice(0,o.encodingLength),S:a.slice(o.encodingLength)}),r(a.R&&a.S,"Signature without R or S"),o.isPoint(a.R)&&(this._R=a.R),a.S instanceof t&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}return i(n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},Bd=n,Bd}var zd,Bb;function nC(){if(Bb)return zd;Bb=1;var t=fg(),e=pg(),r=xi(),i=r.assert,s=r.parseBytes,n=iC(),o=sC();function a(u){if(i(u==="ed25519","only tested with ed25519 so far"),!(this instanceof a))return new a(u);u=e[u].curve,this.curve=u,this.g=u.g,this.g.precompute(u.n.bitLength()+1),this.pointClass=u.point().constructor,this.encodingLength=Math.ceil(u.n.bitLength()/8),this.hash=t.sha512}return zd=a,a.prototype.sign=function(c,l){c=s(c);var h=this.keyFromSecret(l),f=this.hashInt(h.messagePrefix(),c),m=this.g.mul(f),g=this.encodePoint(m),y=this.hashInt(g,h.pubBytes(),c).mul(h.priv()),C=f.add(y).umod(this.curve.n);return this.makeSignature({R:m,S:C,Rencoded:g})},a.prototype.verify=function(c,l,h){if(c=s(c),l=this.makeSignature(l),l.S().gte(l.eddsa.curve.n)||l.S().isNeg())return!1;var f=this.keyFromPublic(h),m=this.hashInt(l.Rencoded(),f.pubBytes(),c),g=this.g.mul(l.S()),y=l.R().add(f.pub().mul(m));return y.eq(g)},a.prototype.hashInt=function(){for(var c=this.hash(),l=0;l<arguments.length;l++)c.update(arguments[l]);return r.intFromLE(c.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(c){return n.fromPublic(this,c)},a.prototype.keyFromSecret=function(c){return n.fromSecret(this,c)},a.prototype.makeSignature=function(c){return c instanceof o?c:new o(this,c)},a.prototype.encodePoint=function(c){var l=c.getY().toArray("le",this.encodingLength);return l[this.encodingLength-1]|=c.getX().isOdd()?128:0,l},a.prototype.decodePoint=function(c){c=r.parseBytes(c);var l=c.length-1,h=c.slice(0,l).concat(c[l]&-129),f=(c[l]&128)!==0,m=r.intFromLE(h);return this.curve.pointFromY(m,f)},a.prototype.encodeInt=function(c){return c.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(c){return r.intFromLE(c)},a.prototype.isPoint=function(c){return c instanceof this.pointClass},zd}var zb;function oC(){return zb||(zb=1,(function(t){var e=t;e.version=qS.version,e.utils=xi(),e.rand=t2(),e.curve=r2(),e.curves=pg(),e.ec=rC(),e.eddsa=nC()})(md)),md}var o2=oC();const a2={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var aC={};const c2=":";function ra(t){const[e,r]=t.split(c2);return{namespace:e,reference:r}}function cC(t){const[e,r,i]=t.split(c2);return{namespace:e,reference:r,address:i}}function u2(t,e){return t.includes(":")?[t]:e.chains||[]}const uC="ReactNative",ui={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},lC="js";function sh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function un(){return!Qr.getDocument()&&!!Qr.getNavigator()&&navigator.product===uC}function hC(){return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function dC(){return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Su(){return!sh()&&!!Qr.getNavigator()&&!!Qr.getDocument()}function Cu(){return un()?ui.reactNative:sh()?ui.node:Su()?ui.browser:ui.unknown}function Hb(){var t;try{return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function fC(t,e){const r=new URLSearchParams(t);for(const i of Object.keys(e).sort())if(e.hasOwnProperty(i)){const s=e[i];s!==void 0&&r.set(i,s)}return r.toString()}function l2(){return M1.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function pC(){if(Cu()===ui.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=D1();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function gC(){var t;const e=Cu();return e===ui.browser?[e,((t=Qr.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function h2(t,e,r){const i=pC(),s=gC();return[[t,e].join("-"),[lC,r].join("-"),i,s].join("/")}function bC({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:s,projectId:n,useOnCloseEvent:o,bundleId:a,packageName:u}){const c=r.split("?"),l=h2(t,e,i),h={auth:s,ua:l,projectId:n,useOnCloseEvent:o,packageName:u||void 0,bundleId:a||void 0},f=fC(c[1]||"",h);return c[0]+"?"+f}function On(t,e){return t.filter(r=>e.includes(r)).length===t.length}function d2(t){return Object.fromEntries(t.entries())}function f2(t){return new Map(Object.entries(t))}function An(t=B.FIVE_MINUTES,e){const r=B.toMiliseconds(t||B.FIVE_MINUTES);let i,s,n,o;return{resolve:a=>{n&&i&&(clearTimeout(n),i(a),o=Promise.resolve(a))},reject:a=>{n&&s&&(clearTimeout(n),s(a))},done:()=>new Promise((a,u)=>{if(o)return a(o);n=setTimeout(()=>{const c=new Error(e);o=Promise.reject(c),u(c)},r),i=a,s=u})}}function Xs(t,e,r){return new Promise(async(i,s)=>{const n=setTimeout(()=>s(new Error(r)),e);try{const o=await t;i(o)}catch(o){s(o)}clearTimeout(n)})}function p2(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function mC(t){return p2("topic",t)}function yC(t){return p2("id",t)}function g2(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function Zt(t,e){return B.fromMiliseconds(Date.now()+B.toMiliseconds(t))}function Ws(t){return Date.now()>=B.toMiliseconds(t)}function Ue(t,e){return`${t}${e?`:${e}`:""}`}function Ul(t=[],e=[]){return[...new Set([...t,...e])]}async function wC({id:t,topic:e,wcDeepLink:r}){var i;try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r,n=s?.href;if(typeof n!="string")return;const o=vC(n,t,e),a=Cu();if(a===ui.browser){if(!((i=Qr.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}_C(o)}else a===ui.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(s){console.error(s)}}function vC(t,e,r){const i=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let s=`${t}`;if(t.startsWith("https://t.me")){const n=t.includes("?")?"&startapp=":"?startapp=";s=`${s}${n}${SC(i,!0)}`}else s=`${s}/wc?${i}`;return s}function _C(t){let e="_self";AC()?e="_top":(IC()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function EC(t,e){let r="";try{if(Su()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(i){console.error(i)}return r}function Vb(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function Kb(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function gg(){return typeof process<"u"&&aC.IS_VITEST==="true"}function IC(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function AC(){try{return window.self!==window.top}catch{return!1}}function SC(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function b2(t){return Buffer.from(t,"base64").toString("utf-8")}function CC(t){return new Promise(e=>setTimeout(e,t))}function jc(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function $C(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ph(t,...e){if(!$C(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function bg(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");jc(t.outputLen),jc(t.blockLen)}function aa(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function m2(t,e){Ph(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const al=BigInt(2**32-1),Wb=BigInt(32);function xC(t,e=!1){return e?{h:Number(t&al),l:Number(t>>Wb&al)}:{h:Number(t>>Wb&al)|0,l:Number(t&al)|0}}function PC(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=xC(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const NC=(t,e,r)=>t<<r|e>>>32-r,OC=(t,e,r)=>e<<r|t>>>32-r,TC=(t,e,r)=>e<<r-32|t>>>64-r,DC=(t,e,r)=>t<<r-32|e>>>64-r,uo=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function RC(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Hd(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Qi(t,e){return t<<32-e|t>>>e}const Gb=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function MC(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Yb(t){for(let e=0;e<t.length;e++)t[e]=MC(t[e])}function kC(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function ca(t){return typeof t=="string"&&(t=kC(t)),Ph(t),t}let mg=class{clone(){return this._cloneInto()}};function y2(t){const e=i=>t().update(ca(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function $u(t=32){if(uo&&typeof uo.getRandomValues=="function")return uo.getRandomValues(new Uint8Array(t));if(uo&&typeof uo.randomBytes=="function")return uo.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const w2=[],v2=[],_2=[],UC=BigInt(0),Za=BigInt(1),LC=BigInt(2),FC=BigInt(7),jC=BigInt(256),qC=BigInt(113);for(let t=0,e=Za,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],w2.push(2*(5*i+r)),v2.push((t+1)*(t+2)/2%64);let s=UC;for(let n=0;n<7;n++)e=(e<<Za^(e>>FC)*qC)%jC,e&LC&&(s^=Za<<(Za<<BigInt(n))-Za);_2.push(s)}const[BC,zC]=PC(_2,!0),Jb=(t,e,r)=>r>32?TC(t,e,r):NC(t,e,r),Qb=(t,e,r)=>r>32?DC(t,e,r):OC(t,e,r);function HC(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=Jb(c,l,1)^r[a],f=Qb(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=v2[o],u=Jb(s,n,a),c=Qb(s,n,a),l=w2[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=BC[i],t[1]^=zC[i]}r.fill(0)}let VC=class E2 extends mg{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,jc(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=RC(this.state)}keccak(){Gb||Yb(this.state32),HC(this.state32,this.rounds),Gb||Yb(this.state32),this.posOut=0,this.pos=0}update(e){aa(this);const{blockLen:r,state:i}=this;e=ca(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){aa(this,!1),Ph(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return jc(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(m2(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new E2(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const KC=(t,e,r)=>y2(()=>new VC(e,t,r)),WC=KC(1,136,256/8),GC="https://rpc.walletconnect.org/v1";function I2(t){const e=`Ethereum Signed Message:
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secp256k1-C0KaaotE.js","assets/index.browser.esm-D7d8Rln2.js","assets/vendor-dayjs-v0j1UNZp.js","assets/index-DXwCOxQx.js","assets/vendor-vue-NSDaktjZ.js","assets/vendor-axios-B8_nURbH.js","assets/vendor-vue-router-Kg6s1a65.js","assets/index-CyoihLmI.css","assets/index-9HGDSJTR.js","assets/signer-VxQoXw0x.js","assets/types-Cvj5H4DH.js","assets/secp256k1-UQxLo_3_.js","assets/basic-LOPbFEDH.js","assets/index-TEpyQgfK.js","assets/w3m-modal-CjCjnI4-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{PublicKey as ZE,VersionedTransaction as e4,Transaction as t4}from"./index.browser.esm-D7d8Rln2.js";import{g as wh,j as Yv,c as Yr}from"./vendor-dayjs-v0j1UNZp.js";import{_ as Jl,eL as Jv}from"./index-DXwCOxQx.js";import{e as r4,w as c0,b as i4,n as Yh,l as s4,u as n4,g as o4,k as Qu,r as Jh,q as a4}from"./signer-VxQoXw0x.js";import{W as c4}from"./types-Cvj5H4DH.js";var Ql;(function(t){t.Mainnet="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",t.Devnet="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",t.Deprecated_Mainnet="solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",t.Deprecated_Devnet="solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"})(Ql||(Ql={}));var $i;(function(t){t.signTransaction="solana_signTransaction",t.signMessage="solana_signMessage",t.signAndSendTransaction="solana_signAndSendTransaction",t.signAndSendAllTransactions="solana_signAndSendAllTransactions",t.signAllTransactions="solana_signAllTransactions"})($i||($i={}));const tr={Mainnet:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Devnet:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",Deprecated_Mainnet:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",Deprecated_Devnet:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"};var Xu={exports:{}},u0;function u4(){if(u0)return Xu.exports;u0=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(T,x,M){return Function.prototype.apply.call(T,x,M)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:r=function(T){return Object.getOwnPropertyNames(T)};function i(O){console&&console.warn&&console.warn(O)}var s=Number.isNaN||function(T){return T!==T};function n(){n.init.call(this)}Xu.exports=n,Xu.exports.once=S,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var o=10;function a(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(O){if(typeof O!="number"||O<0||s(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");o=O}}),n.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(T){if(typeof T!="number"||T<0||s(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function u(O){return O._maxListeners===void 0?n.defaultMaxListeners:O._maxListeners}n.prototype.getMaxListeners=function(){return u(this)},n.prototype.emit=function(T){for(var x=[],M=1;M<arguments.length;M++)x.push(arguments[M]);var U=T==="error",R=this._events;if(R!==void 0)U=U&&R.error===void 0;else if(!U)return!1;if(U){var L;if(x.length>0&&(L=x[0]),L instanceof Error)throw L;var $=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw $.context=L,$}var d=R[T];if(d===void 0)return!1;if(typeof d=="function")e(d,this,x);else for(var b=d.length,_=g(d,b),M=0;M<b;++M)e(_[M],this,x);return!0};function c(O,T,x,M){var U,R,L;if(a(x),R=O._events,R===void 0?(R=O._events=Object.create(null),O._eventsCount=0):(R.newListener!==void 0&&(O.emit("newListener",T,x.listener?x.listener:x),R=O._events),L=R[T]),L===void 0)L=R[T]=x,++O._eventsCount;else if(typeof L=="function"?L=R[T]=M?[x,L]:[L,x]:M?L.unshift(x):L.push(x),U=u(O),U>0&&L.length>U&&!L.warned){L.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=O,$.type=T,$.count=L.length,i($)}return O}n.prototype.addListener=function(T,x){return c(this,T,x,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(T,x){return c(this,T,x,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(O,T,x){var M={fired:!1,wrapFn:void 0,target:O,type:T,listener:x},U=l.bind(M);return U.listener=x,M.wrapFn=U,U}n.prototype.once=function(T,x){return a(x),this.on(T,h(this,T,x)),this},n.prototype.prependOnceListener=function(T,x){return a(x),this.prependListener(T,h(this,T,x)),this},n.prototype.removeListener=function(T,x){var M,U,R,L,$;if(a(x),U=this._events,U===void 0)return this;if(M=U[T],M===void 0)return this;if(M===x||M.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete U[T],U.removeListener&&this.emit("removeListener",T,M.listener||x));else if(typeof M!="function"){for(R=-1,L=M.length-1;L>=0;L--)if(M[L]===x||M[L].listener===x){$=M[L].listener,R=L;break}if(R<0)return this;R===0?M.shift():y(M,R),M.length===1&&(U[T]=M[0]),U.removeListener!==void 0&&this.emit("removeListener",T,$||x)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(T){var x,M,U;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[T]),this;if(arguments.length===0){var R=Object.keys(M),L;for(U=0;U<R.length;++U)L=R[U],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(x=M[T],typeof x=="function")this.removeListener(T,x);else if(x!==void 0)for(U=x.length-1;U>=0;U--)this.removeListener(T,x[U]);return this};function f(O,T,x){var M=O._events;if(M===void 0)return[];var U=M[T];return U===void 0?[]:typeof U=="function"?x?[U.listener||U]:[U]:x?C(U):g(U,U.length)}n.prototype.listeners=function(T){return f(this,T,!0)},n.prototype.rawListeners=function(T){return f(this,T,!1)},n.listenerCount=function(O,T){return typeof O.listenerCount=="function"?O.listenerCount(T):m.call(O,T)},n.prototype.listenerCount=m;function m(O){var T=this._events;if(T!==void 0){var x=T[O];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function g(O,T){for(var x=new Array(T),M=0;M<T;++M)x[M]=O[M];return x}function y(O,T){for(;T+1<O.length;T++)O[T]=O[T+1];O.pop()}function C(O){for(var T=new Array(O.length),x=0;x<T.length;++x)T[x]=O[x].listener||O[x];return T}function S(O,T){return new Promise(function(x,M){function U(L){O.removeListener(T,R),M(L)}function R(){typeof O.removeListener=="function"&&O.removeListener("error",U),x([].slice.call(arguments))}D(O,T,R,{once:!0}),T!=="error"&&A(O,U,{once:!0})})}function A(O,T,x){typeof O.on=="function"&&D(O,"error",T,x)}function D(O,T,x,M){if(typeof O.on=="function")M.once?O.once(T,x):O.on(T,x);else if(typeof O.addEventListener=="function")O.addEventListener(T,function U(R){M.once&&O.removeEventListener(T,U),x(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof O)}return Xu.exports}var sr=u4();const wa=wh(sr);var Qh={};var qf=function(t,e){return qf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},qf(t,e)};function l4(t,e){qf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Bf=function(){return Bf=Object.assign||function(e){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bf.apply(this,arguments)};function h4(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(r[i[s]]=t[i[s]]);return r}function d4(t,e,r,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,r,n):o(e,r))||n);return s>3&&n&&Object.defineProperty(e,r,n),n}function f4(t,e){return function(r,i){e(r,i,t)}}function p4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g4(t,e,r,i){function s(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function a(l){try{c(i.next(l))}catch(h){o(h)}}function u(l){try{c(i.throw(l))}catch(h){o(h)}}function c(l){l.done?n(l.value):s(l.value).then(a,u)}c((i=i.apply(t,e||[])).next())})}function b4(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,s&&(n=c[0]&2?s.return:c[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,c[1])).done)return n;switch(s=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){r.label=c[1];break}if(c[0]===6&&r.label<n[1]){r.label=n[1],n=c;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(c);break}n[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],s=0}finally{i=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function m4(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function y4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function zf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qv(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),s,n=[],o;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return n}function w4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Qv(arguments[e]));return t}function v4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),s=0,e=0;e<r;e++)for(var n=arguments[e],o=0,a=n.length;o<a;o++,s++)i[s]=n[o];return i}function Lc(t){return this instanceof Lc?(this.v=t,this):new Lc(t)}function _4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),s,n=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(f){i[f]&&(s[f]=function(m){return new Promise(function(g,y){n.push([f,m,g,y])>1||a(f,m)})})}function a(f,m){try{u(i[f](m))}catch(g){h(n[0][3],g)}}function u(f){f.value instanceof Lc?Promise.resolve(f.value.v).then(c,l):h(n[0][2],f)}function c(f){a("next",f)}function l(f){a("throw",f)}function h(f,m){f(m),n.shift(),n.length&&a(n[0][0],n[0][1])}}function E4(t){var e,r;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=t[s]?function(o){return(r=!r)?{value:Lc(t[s](o)),done:s==="return"}:n?n(o):o}:n}}function I4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof zf=="function"?zf(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(n){r[n]=t[n]&&function(o){return new Promise(function(a,u){o=t[n](o),s(a,u,o.done,o.value)})}}function s(n,o,a,u){Promise.resolve(u).then(function(c){n({value:c,done:a})},o)}}function A4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function C4(t){return t&&t.__esModule?t:{default:t}}function $4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const P4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Bf},__asyncDelegator:E4,__asyncGenerator:_4,__asyncValues:I4,__await:Lc,__awaiter:g4,__classPrivateFieldGet:$4,__classPrivateFieldSet:x4,__createBinding:m4,__decorate:d4,__exportStar:y4,__extends:l4,__generator:b4,__importDefault:C4,__importStar:S4,__makeTemplateObject:A4,__metadata:p4,__param:f4,__read:Qv,__rest:h4,__spread:w4,__spreadArrays:v4,__values:zf},Symbol.toStringTag,{value:"Module"})),vh=Yv(P4);var Xh={},Ga={},l0;function N4(){if(l0)return Ga;l0=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Ga.delay=t,Ga}var bn={},Zh={},mn={},h0;function O4(){return h0||(h0=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.ONE_THOUSAND=mn.ONE_HUNDRED=void 0,mn.ONE_HUNDRED=100,mn.ONE_THOUSAND=1e3),mn}var ed={},d0;function T4(){return d0||(d0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365})(ed)),ed}var f0;function Xv(){return f0||(f0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(O4(),t),e.__exportStar(T4(),t)})(Zh)),Zh}var p0;function D4(){if(p0)return bn;p0=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.fromMiliseconds=bn.toMiliseconds=void 0;const t=Xv();function e(i){return i*t.ONE_THOUSAND}bn.toMiliseconds=e;function r(i){return Math.floor(i/t.ONE_THOUSAND)}return bn.fromMiliseconds=r,bn}var g0;function R4(){return g0||(g0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(N4(),t),e.__exportStar(D4(),t)})(Xh)),Xh}var oo={},b0;function M4(){if(b0)return oo;b0=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const s=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:s})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return oo.Watch=t,oo.default=t,oo}var td={},Ya={},m0;function k4(){if(m0)return Ya;m0=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.IWatch=void 0;class t{}return Ya.IWatch=t,Ya}var y0;function U4(){return y0||(y0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),vh.__exportStar(k4(),t)})(td)),td}var w0;function L4(){return w0||(w0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=vh;e.__exportStar(R4(),t),e.__exportStar(M4(),t),e.__exportStar(U4(),t),e.__exportStar(Xv(),t)})(Qh)),Qh}var B=L4();class pi{}let F4=class extends pi{constructor(e){super()}};const v0=B.FIVE_SECONDS,Hi={pulse:"heartbeat_pulse"};let Zv=class e1 extends F4{constructor(e){super(e),this.events=new sr.EventEmitter,this.interval=v0,this.interval=e?.interval||v0}static async init(e){const r=new e1(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),B.toMiliseconds(this.interval))}pulse(){this.events.emit(Hi.pulse)}};const j4=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,q4=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,B4=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function z4(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){H4(t);return}return e}function H4(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Zu(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!B4.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(j4.test(t)||q4.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,z4)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function V4(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function lr(t,...e){try{return V4(t(...e))}catch(r){return Promise.reject(r)}}function K4(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function W4(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function Dl(t){if(K4(t))return String(t);if(W4(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Dl(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const Hf="base64:";function G4(t){return typeof t=="string"?t:Hf+Q4(t)}function Y4(t){return typeof t!="string"||!t.startsWith(Hf)?t:J4(t.slice(Hf.length))}function J4(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function Q4(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Kr(t){return t&&t.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function X4(...t){return Kr(t.join(":"))}function el(t){return t=Kr(t),t?t+":":""}function Z4(t,e){if(e===void 0)return!0;let r=0,i=t.indexOf(":");for(;i>-1;)r++,i=t.indexOf(":",i+1);return r<=e}function e5(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const t5="memory",r5=()=>{const t=new Map;return{name:t5,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function i5(t={}){const e={mounts:{"":t.driver||r5()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const l of e.mountpoints)if(c.startsWith(l))return{base:l,relativeKey:c.slice(l.length),driver:e.mounts[l]};return{base:"",relativeKey:c,driver:e.mounts[""]}},i=(c,l)=>e.mountpoints.filter(h=>h.startsWith(c)||l&&c.startsWith(h)).map(h=>({relativeBase:c.length>h.length?c.slice(h.length):void 0,mountpoint:h,driver:e.mounts[h]})),s=(c,l)=>{if(e.watching){l=Kr(l);for(const h of e.watchListeners)h(c,l)}},n=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await _0(e.mounts[c],s,c)}},o=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},a=(c,l,h)=>{const f=new Map,m=g=>{let y=f.get(g.base);return y||(y={driver:g.driver,base:g.base,items:[]},f.set(g.base,y)),y};for(const g of c){const y=typeof g=="string",C=Kr(y?g:g.key),S=y?void 0:g.value,A=y||!g.options?l:{...l,...g.options},D=r(C);m(D).items.push({key:C,value:S,relativeKey:D.relativeKey,options:A})}return Promise.all([...f.values()].map(g=>h(g))).then(g=>g.flat())},u={hasItem(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return lr(f.hasItem,h,l)},getItem(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return lr(f.getItem,h,l).then(m=>Zu(m))},getItems(c,l={}){return a(c,l,h=>h.driver.getItems?lr(h.driver.getItems,h.items.map(f=>({key:f.relativeKey,options:f.options})),l).then(f=>f.map(m=>({key:X4(h.base,m.key),value:Zu(m.value)}))):Promise.all(h.items.map(f=>lr(h.driver.getItem,f.relativeKey,f.options).then(m=>({key:f.key,value:Zu(m)})))))},getItemRaw(c,l={}){c=Kr(c);const{relativeKey:h,driver:f}=r(c);return f.getItemRaw?lr(f.getItemRaw,h,l):lr(f.getItem,h,l).then(m=>Y4(m))},async setItem(c,l,h={}){if(l===void 0)return u.removeItem(c);c=Kr(c);const{relativeKey:f,driver:m}=r(c);m.setItem&&(await lr(m.setItem,f,Dl(l),h),m.watch||s("update",c))},async setItems(c,l){await a(c,l,async h=>{if(h.driver.setItems)return lr(h.driver.setItems,h.items.map(f=>({key:f.relativeKey,value:Dl(f.value),options:f.options})),l);h.driver.setItem&&await Promise.all(h.items.map(f=>lr(h.driver.setItem,f.relativeKey,Dl(f.value),f.options)))})},async setItemRaw(c,l,h={}){if(l===void 0)return u.removeItem(c,h);c=Kr(c);const{relativeKey:f,driver:m}=r(c);if(m.setItemRaw)await lr(m.setItemRaw,f,l,h);else if(m.setItem)await lr(m.setItem,f,G4(l),h);else return;m.watch||s("update",c)},async removeItem(c,l={}){typeof l=="boolean"&&(l={removeMeta:l}),c=Kr(c);const{relativeKey:h,driver:f}=r(c);f.removeItem&&(await lr(f.removeItem,h,l),(l.removeMeta||l.removeMata)&&await lr(f.removeItem,h+"$",l),f.watch||s("remove",c))},async getMeta(c,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),c=Kr(c);const{relativeKey:h,driver:f}=r(c),m=Object.create(null);if(f.getMeta&&Object.assign(m,await lr(f.getMeta,h,l)),!l.nativeOnly){const g=await lr(f.getItem,h+"$",l).then(y=>Zu(y));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(m,g))}return m},setMeta(c,l,h={}){return this.setItem(c+"$",l,h)},removeMeta(c,l={}){return this.removeItem(c+"$",l)},async getKeys(c,l={}){c=el(c);const h=i(c,!0);let f=[];const m=[];let g=!0;for(const C of h){C.driver.flags?.maxDepth||(g=!1);const S=await lr(C.driver.getKeys,C.relativeBase,l);for(const A of S){const D=C.mountpoint+Kr(A);f.some(O=>D.startsWith(O))||m.push(D)}f=[C.mountpoint,...f.filter(A=>!A.startsWith(C.mountpoint))]}const y=l.maxDepth!==void 0&&!g;return m.filter(C=>(!y||Z4(C,l.maxDepth))&&e5(C,c))},async clear(c,l={}){c=el(c),await Promise.all(i(c,!1).map(async h=>{if(h.driver.clear)return lr(h.driver.clear,h.relativeBase,l);if(h.driver.removeItem){const f=await h.driver.getKeys(h.relativeBase||"",l);return Promise.all(f.map(m=>h.driver.removeItem(m,l)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>E0(c)))},async watch(c){return await n(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(l=>l!==c),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(c,l){if(c=el(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((h,f)=>f.length-h.length)),e.mounts[c]=l,e.watching&&Promise.resolve(_0(l,s,c)).then(h=>{e.unwatch[c]=h}).catch(console.error),u},async unmount(c,l=!0){c=el(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&(e.unwatch[c]?.(),delete e.unwatch[c]),l&&await E0(e.mounts[c]),e.mountpoints=e.mountpoints.filter(h=>h!==c),delete e.mounts[c])},getMount(c=""){c=Kr(c)+":";const l=r(c);return{driver:l.driver,base:l.base}},getMounts(c="",l={}){return c=Kr(c),i(c,l.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(c,l={})=>u.getKeys(c,l),get:(c,l={})=>u.getItem(c,l),set:(c,l,h={})=>u.setItem(c,l,h),has:(c,l={})=>u.hasItem(c,l),del:(c,l={})=>u.removeItem(c,l),remove:(c,l={})=>u.removeItem(c,l)};return u}function _0(t,e,r){return t.watch?t.watch((i,s)=>e(i,r+s)):()=>{}}async function E0(t){typeof t.dispose=="function"&&await lr(t.dispose)}function Wn(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function t1(t,e){let r;const i=()=>{if(r)return r;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),r=Wn(s),r.then(n=>{n.onclose=()=>r=void 0},()=>{}),r};return(s,n)=>i().then(o=>n(o.transaction(e,s).objectStore(e)))}let rd;function vu(){return rd||(rd=t1("keyval-store","keyval")),rd}function I0(t,e=vu()){return e("readonly",r=>Wn(r.get(t)))}function s5(t,e,r=vu()){return r("readwrite",i=>(i.put(e,t),Wn(i.transaction)))}function n5(t,e=vu()){return e("readwrite",r=>(r.delete(t),Wn(r.transaction)))}function o5(t=vu()){return t("readwrite",e=>(e.clear(),Wn(e.transaction)))}function a5(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Wn(t.transaction)}function c5(t=vu()){return t("readonly",e=>{if(e.getAllKeys)return Wn(e.getAllKeys());const r=[];return a5(e,i=>r.push(i.key)).then(()=>r)})}const u5=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),l5=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Os(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return l5(t)}catch{return t}}function us(t){return typeof t=="string"?t:u5(t)||""}const h5="idb-keyval";var d5=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=s=>e+s;let i;return t.dbName&&t.storeName&&(i=t1(t.dbName,t.storeName)),{name:h5,options:t,async hasItem(s){return!(typeof await I0(r(s),i)>"u")},async getItem(s){return await I0(r(s),i)??null},setItem(s,n){return s5(r(s),n,i)},removeItem(s){return n5(r(s),i)},getKeys(){return c5(i)},clear(){return o5(i)}}};const f5="WALLET_CONNECT_V2_INDEXED_DB",p5="keyvaluestorage";let g5=class{constructor(){this.indexedDb=i5({driver:d5({dbName:f5,storeName:p5})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,us(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var id=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rl={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,i){this[r]=String(i)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(i){r[i]=void 0,delete r[i]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof id<"u"&&id.localStorage?Rl.exports=id.localStorage:typeof window<"u"&&window.localStorage?Rl.exports=window.localStorage:Rl.exports=new e})();function b5(t){var e;return[t[0],Os((e=t[1])!=null?e:"")]}let m5=class{constructor(){this.localStorage=Rl.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(b5)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Os(r)}async setItem(e,r){this.localStorage.setItem(e,us(r))}async removeItem(e){this.localStorage.removeItem(e)}};const y5="wc_storage_version",A0=1,w5=async(t,e,r)=>{const i=y5,s=await e.getItem(i);if(s&&s>=A0){r(e);return}const n=await t.getKeys();if(!n.length){r(e);return}const o=[];for(;n.length;){const a=n.shift();if(!a)continue;const u=a.toLowerCase();if(u.includes("wc@")||u.includes("walletconnect")||u.includes("wc_")||u.includes("wallet_connect")){const c=await t.getItem(a);await e.setItem(a,c),o.push(a)}}await e.setItem(i,A0),r(e),v5(t,o)},v5=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let r1=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new m5;this.storage=e;try{const r=new g5;w5(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var sd,S0;function _5(){if(S0)return sd;S0=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}sd=e;function e(r,i,s){var n=s&&s.stringify||t,o=1;if(typeof r=="object"&&r!==null){var a=i.length+o;if(a===1)return r;var u=new Array(a);u[0]=n(r);for(var c=1;c<a;c++)u[c]=n(i[c]);return u.join(" ")}if(typeof r!="string")return r;var l=i.length;if(l===0)return r;for(var h="",f=1-o,m=-1,g=r&&r.length||0,y=0;y<g;){if(r.charCodeAt(y)===37&&y+1<g){switch(m=m>-1?m:0,r.charCodeAt(y+1)){case 100:case 102:if(f>=l||i[f]==null)break;m<y&&(h+=r.slice(m,y)),h+=Number(i[f]),m=y+2,y++;break;case 105:if(f>=l||i[f]==null)break;m<y&&(h+=r.slice(m,y)),h+=Math.floor(Number(i[f])),m=y+2,y++;break;case 79:case 111:case 106:if(f>=l||i[f]===void 0)break;m<y&&(h+=r.slice(m,y));var C=typeof i[f];if(C==="string"){h+="'"+i[f]+"'",m=y+2,y++;break}if(C==="function"){h+=i[f].name||"<anonymous>",m=y+2,y++;break}h+=n(i[f]),m=y+2,y++;break;case 115:if(f>=l)break;m<y&&(h+=r.slice(m,y)),h+=String(i[f]),m=y+2,y++;break;case 37:m<y&&(h+=r.slice(m,y)),h+="%",m=y+2,y++,f--;break}++f}++y}return m===-1?r:(m<g&&(h+=r.slice(m)),h)}return sd}var nd,C0;function E5(){if(C0)return nd;C0=1;const t=_5();nd=s;const e=T().console||{},r={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:g,res:g,err:f};function i(x,M){return Array.isArray(x)?x.filter(function(R){return R!=="!stdSerializers.err"}):x===!0?Object.keys(M):!1}function s(x){x=x||{},x.browser=x.browser||{};const M=x.browser.transmit;if(M&&typeof M.send!="function")throw Error("pino: transmit option must have a send function");const U=x.browser.write||e;x.browser.write&&(x.browser.asObject=!0);const R=x.serializers||{},L=i(x.browser.serialize,R);let $=x.browser.serialize;Array.isArray(x.browser.serialize)&&x.browser.serialize.indexOf("!stdSerializers.err")>-1&&($=!1);const d=["error","fatal","warn","info","debug","trace"];typeof U=="function"&&(U.error=U.fatal=U.warn=U.info=U.debug=U.trace=U),x.enabled===!1&&(x.level="silent");const b=x.level||"info",_=Object.create(U);_.log||(_.log=C),Object.defineProperty(_,"levelVal",{get:v}),Object.defineProperty(_,"level",{get:I,set:P});const w={transmit:M,serialize:L,asObject:x.browser.asObject,levels:d,timestamp:m(x)};_.levels=s.levels,_.level=b,_.setMaxListeners=_.getMaxListeners=_.emit=_.addListener=_.on=_.prependListener=_.once=_.prependOnceListener=_.removeListener=_.removeAllListeners=_.listeners=_.listenerCount=_.eventNames=_.write=_.flush=C,_.serializers=R,_._serialize=L,_._stdErrSerialize=$,_.child=E,M&&(_._logEvent=h());function v(){return this.level==="silent"?1/0:this.levels.values[this.level]}function I(){return this._level}function P(p){if(p!=="silent"&&!this.levels.values[p])throw Error("unknown level "+p);this._level=p,n(w,_,"error","log"),n(w,_,"fatal","error"),n(w,_,"warn","error"),n(w,_,"info","log"),n(w,_,"debug","log"),n(w,_,"trace","log")}function E(p,N){if(!p)throw new Error("missing bindings for child Pino");N=N||{},L&&p.serializers&&(N.serializers=p.serializers);const q=N.serializers;if(L&&q){var H=Object.assign({},R,q),z=x.browser.serialize===!0?Object.keys(H):L;delete p.serializers,u([p],z,H,this._stdErrSerialize)}function V(Y){this._childLevel=(Y._childLevel|0)+1,this.error=c(Y,p,"error"),this.fatal=c(Y,p,"fatal"),this.warn=c(Y,p,"warn"),this.info=c(Y,p,"info"),this.debug=c(Y,p,"debug"),this.trace=c(Y,p,"trace"),H&&(this.serializers=H,this._serialize=z),M&&(this._logEvent=h([].concat(Y._logEvent.bindings,p)))}return V.prototype=this,new V(this)}return _}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers=r,s.stdTimeFunctions=Object.assign({},{nullTime:S,epochTime:A,unixTime:D,isoTime:O});function n(x,M,U,R){const L=Object.getPrototypeOf(M);M[U]=M.levelVal>M.levels.values[U]?C:L[U]?L[U]:e[U]||e[R]||C,o(x,M,U)}function o(x,M,U){!x.transmit&&M[U]===C||(M[U]=(function(R){return function(){const $=x.timestamp(),d=new Array(arguments.length),b=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var _=0;_<d.length;_++)d[_]=arguments[_];if(x.serialize&&!x.asObject&&u(d,this._serialize,this.serializers,this._stdErrSerialize),x.asObject?R.call(b,a(this,U,d,$)):R.apply(b,d),x.transmit){const w=x.transmit.level||M.level,v=s.levels.values[w],I=s.levels.values[U];if(I<v)return;l(this,{ts:$,methodLevel:U,methodValue:I,transmitValue:s.levels.values[x.transmit.level||M.level],send:x.transmit.send,val:M.levelVal},d)}}})(M[U]))}function a(x,M,U,R){x._serialize&&u(U,x._serialize,x.serializers,x._stdErrSerialize);const L=U.slice();let $=L[0];const d={};R&&(d.time=R),d.level=s.levels.values[M];let b=(x._childLevel|0)+1;if(b<1&&(b=1),$!==null&&typeof $=="object"){for(;b--&&typeof L[0]=="object";)Object.assign(d,L.shift());$=L.length?t(L.shift(),L):void 0}else typeof $=="string"&&($=t(L.shift(),L));return $!==void 0&&(d.msg=$),d}function u(x,M,U,R){for(const L in x)if(R&&x[L]instanceof Error)x[L]=s.stdSerializers.err(x[L]);else if(typeof x[L]=="object"&&!Array.isArray(x[L]))for(const $ in x[L])M&&M.indexOf($)>-1&&$ in U&&(x[L][$]=U[$](x[L][$]))}function c(x,M,U){return function(){const R=new Array(1+arguments.length);R[0]=M;for(var L=1;L<R.length;L++)R[L]=arguments[L-1];return x[U].apply(this,R)}}function l(x,M,U){const R=M.send,L=M.ts,$=M.methodLevel,d=M.methodValue,b=M.val,_=x._logEvent.bindings;u(U,x._serialize||Object.keys(x.serializers),x.serializers,x._stdErrSerialize===void 0?!0:x._stdErrSerialize),x._logEvent.ts=L,x._logEvent.messages=U.filter(function(w){return _.indexOf(w)===-1}),x._logEvent.level.label=$,x._logEvent.level.value=d,R($,x._logEvent,b),x._logEvent=h(_)}function h(x){return{ts:0,messages:[],bindings:x||[],level:{label:"",value:0}}}function f(x){const M={type:x.constructor.name,msg:x.message,stack:x.stack};for(const U in x)M[U]===void 0&&(M[U]=x[U]);return M}function m(x){return typeof x.timestamp=="function"?x.timestamp:x.timestamp===!1?S:A}function g(){return{}}function y(x){return x}function C(){}function S(){return!1}function A(){return Date.now()}function D(){return Math.round(Date.now()/1e3)}function O(){return new Date(Date.now()).toISOString()}function T(){function x(M){return typeof M<"u"&&M}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return x(self)||x(window)||x(this)||{}}}return nd}var Bo=E5();const cn=wh(Bo),I5={level:"info"},_u="custom_context",ig=1e3*1024;let A5=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},$0=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new A5(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},i1=class{constructor(e,r=ig){this.level=e??"error",this.levelValue=Bo.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new $0(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Bo.levels.values.error?console.error(e):r===Bo.levels.values.warn?console.warn(e):r===Bo.levels.values.debug?console.debug(e):r===Bo.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(us({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new $0(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(us({extraMetadata:e})),new Blob(r,{type:"application/json"})}},S5=class{constructor(e,r=ig){this.baseChunkLogger=new i1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=r,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}},C5=class{constructor(e,r=ig){this.baseChunkLogger=new i1(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var $5=Object.defineProperty,x5=Object.defineProperties,P5=Object.getOwnPropertyDescriptors,x0=Object.getOwnPropertySymbols,N5=Object.prototype.hasOwnProperty,O5=Object.prototype.propertyIsEnumerable,P0=(t,e,r)=>e in t?$5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xl=(t,e)=>{for(var r in e||(e={}))N5.call(e,r)&&P0(t,r,e[r]);if(x0)for(var r of x0(e))O5.call(e,r)&&P0(t,r,e[r]);return t},Zl=(t,e)=>x5(t,P5(e));function Ts(t){return Zl(Xl({},t),{level:t?.level||I5.level})}function T5(t,e=_u){return t[e]||""}function D5(t,e,r=_u){return t[r]=e,t}function it(t,e=_u){let r="";return typeof t.bindings>"u"?r=T5(t,e):r=t.bindings().context||"",r}function R5(t,e,r=_u){const i=it(t,r);return i.trim()?`${i}/${e}`:e}function je(t,e,r=_u){const i=R5(t,e,r),s=t.child({context:i});return D5(s,i,r)}function M5(t){var e,r;const i=new S5((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cn(Zl(Xl({},t.opts),{level:"trace",browser:Zl(Xl({},(r=t.opts)==null?void 0:r.browser),{write:s=>i.write(s)})})),chunkLoggerController:i}}function k5(t){var e;const r=new C5((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cn(Zl(Xl({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function sg(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?M5(t):k5(t)}var U5=Object.defineProperty,L5=(t,e,r)=>e in t?U5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N0=(t,e,r)=>L5(t,typeof e!="symbol"?e+"":e,r);let F5=class extends pi{constructor(e){super(),this.opts=e,N0(this,"protocol","wc"),N0(this,"version",2)}};var j5=Object.defineProperty,q5=(t,e,r)=>e in t?j5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B5=(t,e,r)=>q5(t,e+"",r);let z5=class extends pi{constructor(e,r){super(),this.core=e,this.logger=r,B5(this,"records",new Map)}},H5=class{constructor(e,r){this.logger=e,this.core=r}},V5=class extends pi{constructor(e,r){super(),this.relayer=e,this.logger=r}},K5=class extends pi{constructor(e){super()}},W5=class{constructor(e,r,i,s){this.core=e,this.logger=r,this.name=i}},G5=class extends pi{constructor(e,r){super(),this.relayer=e,this.logger=r}},Y5=class extends pi{constructor(e,r){super(),this.core=e,this.logger=r}},J5=class{constructor(e,r,i){this.core=e,this.logger=r,this.store=i}},Q5=class{constructor(e,r){this.projectId=e,this.logger=r}},X5=class{constructor(e,r,i){this.core=e,this.logger=r,this.telemetryEnabled=i}};function Z5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function s1(t,...e){if(!Z5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function O0(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function e6(t,e){s1(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const ao=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const od=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function t6(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function n1(t){return typeof t=="string"&&(t=t6(t)),s1(t),t}let r6=class{clone(){return this._cloneInto()}};function i6(t){const e=i=>t().update(n1(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function o1(t=32){if(ao&&typeof ao.getRandomValues=="function")return ao.getRandomValues(new Uint8Array(t));if(ao&&typeof ao.randomBytes=="function")return ao.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function s6(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n),u=i?4:0,c=i?0:4;t.setUint32(e+u,o,i),t.setUint32(e+c,a,i)}let n6=class extends r6{constructor(e,r,i,s){super(),this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=od(this.buffer)}update(e){O0(this);const{view:r,buffer:i,blockLen:s}=this;e=n1(e);const n=e.length;for(let o=0;o<n;){const a=Math.min(s-this.pos,n-o);if(a===s){const u=od(e);for(;s<=n-o;o+=s)this.process(u,o);continue}i.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){O0(this),e6(e,this),this.finished=!0;const{buffer:r,view:i,blockLen:s,isLE:n}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(i,0),o=0);for(let h=o;h<s;h++)r[h]=0;s6(i,s-8,BigInt(this.length*8),n),this.process(i,0);const a=od(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<c;h++)a.setUint32(4*h,l[h],n)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:i,length:s,finished:n,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=n,e.destroyed=o,s%r&&e.buffer.set(i),e}};const tl=BigInt(2**32-1),Vf=BigInt(32);function a1(t,e=!1){return e?{h:Number(t&tl),l:Number(t>>Vf&tl)}:{h:Number(t>>Vf&tl)|0,l:Number(t&tl)|0}}function o6(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=a1(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const a6=(t,e)=>BigInt(t>>>0)<<Vf|BigInt(e>>>0),c6=(t,e,r)=>t>>>r,u6=(t,e,r)=>t<<32-r|e>>>r,l6=(t,e,r)=>t>>>r|e<<32-r,h6=(t,e,r)=>t<<32-r|e>>>r,d6=(t,e,r)=>t<<64-r|e>>>r-32,f6=(t,e,r)=>t>>>r-32|e<<64-r,p6=(t,e)=>e,g6=(t,e)=>t,b6=(t,e,r)=>t<<r|e>>>32-r,m6=(t,e,r)=>e<<r|t>>>32-r,y6=(t,e,r)=>e<<r-32|t>>>64-r,w6=(t,e,r)=>t<<r-32|e>>>64-r;function v6(t,e,r,i){const s=(e>>>0)+(i>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}const _6=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),E6=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,I6=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),A6=(t,e,r,i,s)=>e+r+i+s+(t/2**32|0)|0,S6=(t,e,r,i,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(s>>>0),C6=(t,e,r,i,s,n)=>e+r+i+s+n+(t/2**32|0)|0,de={fromBig:a1,split:o6,toBig:a6,shrSH:c6,shrSL:u6,rotrSH:l6,rotrSL:h6,rotrBH:d6,rotrBL:f6,rotr32H:p6,rotr32L:g6,rotlSH:b6,rotlSL:m6,rotlBH:y6,rotlBL:w6,add:v6,add3L:_6,add3H:E6,add4L:I6,add4H:A6,add5H:C6,add5L:S6},[$6,x6]=de.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ls=new Uint32Array(80),Fs=new Uint32Array(80);let P6=class extends n6{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:i,Bl:s,Ch:n,Cl:o,Dh:a,Dl:u,Eh:c,El:l,Fh:h,Fl:f,Gh:m,Gl:g,Hh:y,Hl:C}=this;return[e,r,i,s,n,o,a,u,c,l,h,f,m,g,y,C]}set(e,r,i,s,n,o,a,u,c,l,h,f,m,g,y,C){this.Ah=e|0,this.Al=r|0,this.Bh=i|0,this.Bl=s|0,this.Ch=n|0,this.Cl=o|0,this.Dh=a|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=h|0,this.Fl=f|0,this.Gh=m|0,this.Gl=g|0,this.Hh=y|0,this.Hl=C|0}process(e,r){for(let D=0;D<16;D++,r+=4)Ls[D]=e.getUint32(r),Fs[D]=e.getUint32(r+=4);for(let D=16;D<80;D++){const O=Ls[D-15]|0,T=Fs[D-15]|0,x=de.rotrSH(O,T,1)^de.rotrSH(O,T,8)^de.shrSH(O,T,7),M=de.rotrSL(O,T,1)^de.rotrSL(O,T,8)^de.shrSL(O,T,7),U=Ls[D-2]|0,R=Fs[D-2]|0,L=de.rotrSH(U,R,19)^de.rotrBH(U,R,61)^de.shrSH(U,R,6),$=de.rotrSL(U,R,19)^de.rotrBL(U,R,61)^de.shrSL(U,R,6),d=de.add4L(M,$,Fs[D-7],Fs[D-16]),b=de.add4H(d,x,L,Ls[D-7],Ls[D-16]);Ls[D]=b|0,Fs[D]=d|0}let{Ah:i,Al:s,Bh:n,Bl:o,Ch:a,Cl:u,Dh:c,Dl:l,Eh:h,El:f,Fh:m,Fl:g,Gh:y,Gl:C,Hh:S,Hl:A}=this;for(let D=0;D<80;D++){const O=de.rotrSH(h,f,14)^de.rotrSH(h,f,18)^de.rotrBH(h,f,41),T=de.rotrSL(h,f,14)^de.rotrSL(h,f,18)^de.rotrBL(h,f,41),x=h&m^~h&y,M=f&g^~f&C,U=de.add5L(A,T,M,x6[D],Fs[D]),R=de.add5H(U,S,O,x,$6[D],Ls[D]),L=U|0,$=de.rotrSH(i,s,28)^de.rotrBH(i,s,34)^de.rotrBH(i,s,39),d=de.rotrSL(i,s,28)^de.rotrBL(i,s,34)^de.rotrBL(i,s,39),b=i&n^i&a^n&a,_=s&o^s&u^o&u;S=y|0,A=C|0,y=m|0,C=g|0,m=h|0,g=f|0,{h,l:f}=de.add(c|0,l|0,R|0,L|0),c=a|0,l=u|0,a=n|0,u=o|0,n=i|0,o=s|0;const w=de.add3L(L,d,_);i=de.add3H(w,R,$,b),s=w|0}({h:i,l:s}=de.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:n,l:o}=de.add(this.Bh|0,this.Bl|0,n|0,o|0),{h:a,l:u}=de.add(this.Ch|0,this.Cl|0,a|0,u|0),{h:c,l}=de.add(this.Dh|0,this.Dl|0,c|0,l|0),{h,l:f}=de.add(this.Eh|0,this.El|0,h|0,f|0),{h:m,l:g}=de.add(this.Fh|0,this.Fl|0,m|0,g|0),{h:y,l:C}=de.add(this.Gh|0,this.Gl|0,y|0,C|0),{h:S,l:A}=de.add(this.Hh|0,this.Hl|0,S|0,A|0),this.set(i,s,n,o,a,u,c,l,h,f,m,g,y,C,S,A)}roundClean(){Ls.fill(0),Fs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const N6=i6(()=>new P6);const ng=BigInt(0),c1=BigInt(1),O6=BigInt(2);function og(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ag(t){if(!og(t))throw new Error("Uint8Array expected")}function ad(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const T6=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function cg(t){ag(t);let e="";for(let r=0;r<t.length;r++)e+=T6[t[r]];return e}function u1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?ng:BigInt("0x"+t)}const gs={_0:48,_9:57,A:65,F:70,a:97,f:102};function T0(t){if(t>=gs._0&&t<=gs._9)return t-gs._0;if(t>=gs.A&&t<=gs.F)return t-(gs.A-10);if(t>=gs.a&&t<=gs.f)return t-(gs.a-10)}function l1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(r);for(let s=0,n=0;s<r;s++,n+=2){const o=T0(t.charCodeAt(n)),a=T0(t.charCodeAt(n+1));if(o===void 0||a===void 0){const u=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+n)}i[s]=o*16+a}return i}function D6(t){return u1(cg(t))}function Ml(t){return ag(t),u1(cg(Uint8Array.from(t).reverse()))}function h1(t,e){return l1(t.toString(16).padStart(e*2,"0"))}function Kf(t,e){return h1(t,e).reverse()}function bs(t,e,r){let i;if(typeof e=="string")try{i=l1(e)}catch(n){throw new Error(t+" must be hex string or Uint8Array, cause: "+n)}else if(og(e))i=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=i.length;if(typeof r=="number"&&s!==r)throw new Error(t+" of length "+r+" expected, got "+s);return i}function D0(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];ag(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}const cd=t=>typeof t=="bigint"&&ng<=t;function R6(t,e,r){return cd(t)&&cd(e)&&cd(r)&&e<=t&&t<r}function Ja(t,e,r,i){if(!R6(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function M6(t){let e;for(e=0;t>ng;t>>=c1,e+=1);return e}const k6=t=>(O6<<BigInt(t-1))-c1,U6={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||og(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ug(t,e,r={}){const i=(s,n,o)=>{const a=U6[n];if(typeof a!="function")throw new Error("invalid validator function");const u=t[s];if(!(o&&u===void 0)&&!a(u,t))throw new Error("param "+String(s)+" is invalid. Expected "+n+", got "+u)};for(const[s,n]of Object.entries(e))i(s,n,!1);for(const[s,n]of Object.entries(r))i(s,n,!0);return t}function R0(t){const e=new WeakMap;return(r,...i)=>{const s=e.get(r);if(s!==void 0)return s;const n=t(r,...i);return e.set(r,n),n}}const gr=BigInt(0),Wt=BigInt(1),$n=BigInt(2),L6=BigInt(3),Wf=BigInt(4),M0=BigInt(5),k0=BigInt(8);function rr(t,e){const r=t%e;return r>=gr?r:e+r}function F6(t,e,r){if(e<gr)throw new Error("invalid exponent, negatives unsupported");if(r<=gr)throw new Error("invalid modulus");if(r===Wt)return gr;let i=Wt;for(;e>gr;)e&Wt&&(i=i*t%r),t=t*t%r,e>>=Wt;return i}function Yi(t,e,r){let i=t;for(;e-- >gr;)i*=i,i%=r;return i}function U0(t,e){if(t===gr)throw new Error("invert: expected non-zero number");if(e<=gr)throw new Error("invert: expected positive modulus, got "+e);let r=rr(t,e),i=e,s=gr,n=Wt;for(;r!==gr;){const o=i/r,a=i%r,u=s-n*o;i=r,r=a,s=n,n=u}if(i!==Wt)throw new Error("invert: does not exist");return rr(s,e)}function j6(t){const e=(t-Wt)/$n;let r,i,s;for(r=t-Wt,i=0;r%$n===gr;r/=$n,i++);for(s=$n;s<t&&F6(s,e,t)!==t-Wt;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){const o=(t+Wt)/Wf;return function(a,u){const c=a.pow(u,o);if(!a.eql(a.sqr(c),u))throw new Error("Cannot find square root");return c}}const n=(r+Wt)/$n;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let u=i,c=o.pow(o.mul(o.ONE,s),r),l=o.pow(a,n),h=o.pow(a,r);for(;!o.eql(h,o.ONE);){if(o.eql(h,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(h);f<u&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const m=o.pow(c,Wt<<BigInt(u-f-1));c=o.sqr(m),l=o.mul(l,m),h=o.mul(h,c),u=f}return l}}function q6(t){if(t%Wf===L6){const e=(t+Wt)/Wf;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%k0===M0){const e=(t-M0)/k0;return function(r,i){const s=r.mul(i,$n),n=r.pow(s,e),o=r.mul(i,n),a=r.mul(r.mul(o,$n),n),u=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return j6(t)}const B6=(t,e)=>(rr(t,e)&Wt)===Wt,z6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function H6(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=z6.reduce((i,s)=>(i[s]="function",i),e);return ug(t,r)}function V6(t,e,r){if(r<gr)throw new Error("invalid exponent, negatives unsupported");if(r===gr)return t.ONE;if(r===Wt)return e;let i=t.ONE,s=e;for(;r>gr;)r&Wt&&(i=t.mul(i,s)),s=t.sqr(s),r>>=Wt;return i}function K6(t,e){const r=new Array(e.length),i=e.reduce((n,o,a)=>t.is0(o)?n:(r[a]=n,t.mul(n,o)),t.ONE),s=t.inv(i);return e.reduceRight((n,o,a)=>t.is0(o)?n:(r[a]=t.mul(n,r[a]),t.mul(n,o)),s),r}function d1(t,e){const r=e!==void 0?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function f1(t,e,r=!1,i={}){if(t<=gr)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:n}=d1(t,e);if(n>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:s,BYTES:n,MASK:k6(s),ZERO:gr,ONE:Wt,create:u=>rr(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return gr<=u&&u<t},is0:u=>u===gr,isOdd:u=>(u&Wt)===Wt,neg:u=>rr(-u,t),eql:(u,c)=>u===c,sqr:u=>rr(u*u,t),add:(u,c)=>rr(u+c,t),sub:(u,c)=>rr(u-c,t),mul:(u,c)=>rr(u*c,t),pow:(u,c)=>V6(a,u,c),div:(u,c)=>rr(u*U0(c,t),t),sqrN:u=>u*u,addN:(u,c)=>u+c,subN:(u,c)=>u-c,mulN:(u,c)=>u*c,inv:u=>U0(u,t),sqrt:i.sqrt||(u=>(o||(o=q6(t)),o(a,u))),invertBatch:u=>K6(a,u),cmov:(u,c,l)=>l?c:u,toBytes:u=>r?Kf(u,n):h1(u,n),fromBytes:u=>{if(u.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+u.length);return r?Ml(u):D6(u)}});return Object.freeze(a)}const L0=BigInt(0),rl=BigInt(1);function ud(t,e){const r=e.negate();return t?r:e}function p1(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function ld(t,e){p1(t,e);const r=Math.ceil(e/t)+1,i=2**(t-1);return{windows:r,windowSize:i}}function W6(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,i)=>{if(!(r instanceof e))throw new Error("invalid point at index "+i)})}function G6(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,i)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+i)})}const hd=new WeakMap,g1=new WeakMap;function dd(t){return g1.get(t)||1}function Y6(t,e){return{constTimeNegate:ud,hasPrecomputes(r){return dd(r)!==1},unsafeLadder(r,i,s=t.ZERO){let n=r;for(;i>L0;)i&rl&&(s=s.add(n)),n=n.double(),i>>=rl;return s},precomputeWindow(r,i){const{windows:s,windowSize:n}=ld(i,e),o=[];let a=r,u=a;for(let c=0;c<s;c++){u=a,o.push(u);for(let l=1;l<n;l++)u=u.add(a),o.push(u);a=u.double()}return o},wNAF(r,i,s){const{windows:n,windowSize:o}=ld(r,e);let a=t.ZERO,u=t.BASE;const c=BigInt(2**r-1),l=2**r,h=BigInt(r);for(let f=0;f<n;f++){const m=f*o;let g=Number(s&c);s>>=h,g>o&&(g-=l,s+=rl);const y=m,C=m+Math.abs(g)-1,S=f%2!==0,A=g<0;g===0?u=u.add(ud(S,i[y])):a=a.add(ud(A,i[C]))}return{p:a,f:u}},wNAFUnsafe(r,i,s,n=t.ZERO){const{windows:o,windowSize:a}=ld(r,e),u=BigInt(2**r-1),c=2**r,l=BigInt(r);for(let h=0;h<o;h++){const f=h*a;if(s===L0)break;let m=Number(s&u);if(s>>=l,m>a&&(m-=c,s+=rl),m===0)continue;let g=i[f+Math.abs(m)-1];m<0&&(g=g.negate()),n=n.add(g)}return n},getPrecomputes(r,i,s){let n=hd.get(i);return n||(n=this.precomputeWindow(i,r),r!==1&&hd.set(i,s(n))),n},wNAFCached(r,i,s){const n=dd(r);return this.wNAF(n,this.getPrecomputes(n,r,s),i)},wNAFCachedUnsafe(r,i,s,n){const o=dd(r);return o===1?this.unsafeLadder(r,i,n):this.wNAFUnsafe(o,this.getPrecomputes(o,r,s),i,n)},setWindowSize(r,i){p1(i,e),g1.set(r,i),hd.delete(r)}}}function J6(t,e,r,i){if(W6(r,t),G6(i,e),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,n=M6(BigInt(r.length)),o=n>12?n-3:n>4?n-2:n?2:1,a=(1<<o)-1,u=new Array(a+1).fill(s),c=Math.floor((e.BITS-1)/o)*o;let l=s;for(let h=c;h>=0;h-=o){u.fill(s);for(let m=0;m<i.length;m++){const g=i[m],y=Number(g>>BigInt(h)&BigInt(a));u[y]=u[y].add(r[m])}let f=s;for(let m=u.length-1,g=s;m>0;m--)g=g.add(u[m]),f=f.add(g);if(l=l.add(f),h!==0)for(let m=0;m<o;m++)l=l.double()}return l}function Q6(t){return H6(t.Fp),ug(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...d1(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Di=BigInt(0),jr=BigInt(1),il=BigInt(2),X6=BigInt(8),Z6={zip215:!0};function eI(t){const e=Q6(t);return ug(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function tI(t){const e=eI(t),{Fp:r,n:i,prehash:s,hash:n,randomBytes:o,nByteLength:a,h:u}=e,c=il<<BigInt(a*8)-jr,l=r.create,h=f1(e.n,e.nBitLength),f=e.uvRatio||((w,v)=>{try{return{isValid:!0,value:r.sqrt(w*r.inv(v))}}catch{return{isValid:!1,value:Di}}}),m=e.adjustScalarBytes||(w=>w),g=e.domain||((w,v,I)=>{if(ad("phflag",I),v.length||I)throw new Error("Contexts/pre-hash are not supported");return w});function y(w,v){Ja("coordinate "+w,v,Di,c)}function C(w){if(!(w instanceof D))throw new Error("ExtendedPoint expected")}const S=R0((w,v)=>{const{ex:I,ey:P,ez:E}=w,p=w.is0();v==null&&(v=p?X6:r.inv(E));const N=l(I*v),q=l(P*v),H=l(E*v);if(p)return{x:Di,y:jr};if(H!==jr)throw new Error("invZ was invalid");return{x:N,y:q}}),A=R0(w=>{const{a:v,d:I}=e;if(w.is0())throw new Error("bad point: ZERO");const{ex:P,ey:E,ez:p,et:N}=w,q=l(P*P),H=l(E*E),z=l(p*p),V=l(z*z),Y=l(q*v),te=l(z*l(Y+H)),ie=l(V+l(I*l(q*H)));if(te!==ie)throw new Error("bad point: equation left != right (1)");const Z=l(P*E),ae=l(p*N);if(Z!==ae)throw new Error("bad point: equation left != right (2)");return!0});class D{constructor(v,I,P,E){this.ex=v,this.ey=I,this.ez=P,this.et=E,y("x",v),y("y",I),y("z",P),y("t",E),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(v){if(v instanceof D)throw new Error("extended point not allowed");const{x:I,y:P}=v||{};return y("x",I),y("y",P),new D(I,P,jr,l(I*P))}static normalizeZ(v){const I=r.invertBatch(v.map(P=>P.ez));return v.map((P,E)=>P.toAffine(I[E])).map(D.fromAffine)}static msm(v,I){return J6(D,h,v,I)}_setWindowSize(v){x.setWindowSize(this,v)}assertValidity(){A(this)}equals(v){C(v);const{ex:I,ey:P,ez:E}=this,{ex:p,ey:N,ez:q}=v,H=l(I*q),z=l(p*E),V=l(P*q),Y=l(N*E);return H===z&&V===Y}is0(){return this.equals(D.ZERO)}negate(){return new D(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:v}=e,{ex:I,ey:P,ez:E}=this,p=l(I*I),N=l(P*P),q=l(il*l(E*E)),H=l(v*p),z=I+P,V=l(l(z*z)-p-N),Y=H+N,te=Y-q,ie=H-N,Z=l(V*te),ae=l(Y*ie),ht=l(V*ie),ge=l(te*Y);return new D(Z,ae,ge,ht)}add(v){C(v);const{a:I,d:P}=e,{ex:E,ey:p,ez:N,et:q}=this,{ex:H,ey:z,ez:V,et:Y}=v;if(I===BigInt(-1)){const Ke=l((p-E)*(z+H)),Vi=l((p+E)*(z-H)),qe=l(Vi-Ke);if(qe===Di)return this.double();const We=l(N*il*Y),Ki=l(q*il*V),De=Ki+We,Re=Vi+Ke,Wi=Ki-We,Me=l(De*qe),st=l(Re*Wi),dn=l(De*Wi),Se=l(qe*Re);return new D(Me,st,Se,dn)}const te=l(E*H),ie=l(p*z),Z=l(q*P*Y),ae=l(N*V),ht=l((E+p)*(H+z)-te-ie),ge=ae-Z,ye=ae+Z,Dt=l(ie-I*te),Ie=l(ht*ge),Te=l(ye*Dt),bi=l(ht*Dt),Ze=l(ge*ye);return new D(Ie,Te,Ze,bi)}subtract(v){return this.add(v.negate())}wNAF(v){return x.wNAFCached(this,v,D.normalizeZ)}multiply(v){const I=v;Ja("scalar",I,jr,i);const{p:P,f:E}=this.wNAF(I);return D.normalizeZ([P,E])[0]}multiplyUnsafe(v,I=D.ZERO){const P=v;return Ja("scalar",P,Di,i),P===Di?T:this.is0()||P===jr?this:x.wNAFCachedUnsafe(this,P,D.normalizeZ,I)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return x.unsafeLadder(this,i).is0()}toAffine(v){return S(this,v)}clearCofactor(){const{h:v}=e;return v===jr?this:this.multiplyUnsafe(v)}static fromHex(v,I=!1){const{d:P,a:E}=e,p=r.BYTES;v=bs("pointHex",v,p),ad("zip215",I);const N=v.slice(),q=v[p-1];N[p-1]=q&-129;const H=Ml(N),z=I?c:r.ORDER;Ja("pointHex.y",H,Di,z);const V=l(H*H),Y=l(V-jr),te=l(P*V-E);let{isValid:ie,value:Z}=f(Y,te);if(!ie)throw new Error("Point.fromHex: invalid y coordinate");const ae=(Z&jr)===jr,ht=(q&128)!==0;if(!I&&Z===Di&&ht)throw new Error("Point.fromHex: x=0 and x_0=1");return ht!==ae&&(Z=l(-Z)),D.fromAffine({x:Z,y:H})}static fromPrivateKey(v){return R(v).point}toRawBytes(){const{x:v,y:I}=this.toAffine(),P=Kf(I,r.BYTES);return P[P.length-1]|=v&jr?128:0,P}toHex(){return cg(this.toRawBytes())}}D.BASE=new D(e.Gx,e.Gy,jr,l(e.Gx*e.Gy)),D.ZERO=new D(Di,jr,jr,Di);const{BASE:O,ZERO:T}=D,x=Y6(D,a*8);function M(w){return rr(w,i)}function U(w){return M(Ml(w))}function R(w){const v=r.BYTES;w=bs("private key",w,v);const I=bs("hashed private key",n(w),2*v),P=m(I.slice(0,v)),E=I.slice(v,2*v),p=U(P),N=O.multiply(p),q=N.toRawBytes();return{head:P,prefix:E,scalar:p,point:N,pointBytes:q}}function L(w){return R(w).pointBytes}function $(w=new Uint8Array,...v){const I=D0(...v);return U(n(g(I,bs("context",w),!!s)))}function d(w,v,I={}){w=bs("message",w),s&&(w=s(w));const{prefix:P,scalar:E,pointBytes:p}=R(v),N=$(I.context,P,w),q=O.multiply(N).toRawBytes(),H=$(I.context,q,p,w),z=M(N+H*E);Ja("signature.s",z,Di,i);const V=D0(q,Kf(z,r.BYTES));return bs("result",V,r.BYTES*2)}const b=Z6;function _(w,v,I,P=b){const{context:E,zip215:p}=P,N=r.BYTES;w=bs("signature",w,2*N),v=bs("message",v),I=bs("publicKey",I,N),p!==void 0&&ad("zip215",p),s&&(v=s(v));const q=Ml(w.slice(N,2*N));let H,z,V;try{H=D.fromHex(I,p),z=D.fromHex(w.slice(0,N),p),V=O.multiplyUnsafe(q)}catch{return!1}if(!p&&H.isSmallOrder())return!1;const Y=$(E,z.toRawBytes(),H.toRawBytes(),v);return z.add(H.multiplyUnsafe(Y)).subtract(V).clearCofactor().equals(D.ZERO)}return O._setWindowSize(8),{CURVE:e,getPublicKey:L,sign:d,verify:_,ExtendedPoint:D,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>o(r.BYTES),precompute(w=8,v=D.BASE){return v._setWindowSize(w),v.multiply(BigInt(3)),v}}}}BigInt(0),BigInt(1);const lg=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),F0=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const rI=BigInt(1),j0=BigInt(2);BigInt(3);const iI=BigInt(5),sI=BigInt(8);function nI(t){const e=BigInt(10),r=BigInt(20),i=BigInt(40),s=BigInt(80),n=lg,o=t*t%n*t%n,a=Yi(o,j0,n)*o%n,u=Yi(a,rI,n)*t%n,c=Yi(u,iI,n)*u%n,l=Yi(c,e,n)*c%n,h=Yi(l,r,n)*l%n,f=Yi(h,i,n)*h%n,m=Yi(f,s,n)*f%n,g=Yi(m,s,n)*f%n,y=Yi(g,e,n)*c%n;return{pow_p_5_8:Yi(y,j0,n)*t%n,b2:o}}function oI(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function aI(t,e){const r=lg,i=rr(e*e*e,r),s=rr(i*i*e,r),n=nI(t*s).pow_p_5_8;let o=rr(t*i*n,r);const a=rr(e*o*o,r),u=o,c=rr(o*F0,r),l=a===t,h=a===rr(-t,r),f=a===rr(-t*F0,r);return l&&(o=u),(h||f)&&(o=c),B6(o,r)&&(o=rr(-o,r)),{isValid:l||h,value:o}}const cI=f1(lg,void 0,!0),uI={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cI,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:sI,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:N6,randomBytes:o1,adjustScalarBytes:oI,uvRatio:aI},b1=tI(uI),lI="EdDSA",hI="JWT",eh=".",_h="base64url",m1="utf8",y1="utf8",dI=":",fI="did",pI="key",q0="base58btc",gI="z",bI="K36",mI=32;function hg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function w1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?hg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function v1(t,e){e||(e=t.reduce((s,n)=>s+n.length,0));const r=w1(e);let i=0;for(const s of t)r.set(s,i),i+=s.length;return hg(r)}function yI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var n=t.charAt(s),o=n.charCodeAt(0);if(r[o]!==255)throw new TypeError(n+" is ambiguous");r[o]=s}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var y=0,C=0,S=0,A=g.length;S!==A&&g[S]===0;)S++,y++;for(var D=(A-S)*l+1>>>0,O=new Uint8Array(D);S!==A;){for(var T=g[S],x=0,M=D-1;(T!==0||x<C)&&M!==-1;M--,x++)T+=256*O[M]>>>0,O[M]=T%a>>>0,T=T/a>>>0;if(T!==0)throw new Error("Non-zero carry");C=x,S++}for(var U=D-C;U!==D&&O[U]===0;)U++;for(var R=u.repeat(y);U<D;++U)R+=t.charAt(O[U]);return R}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var y=0;if(g[y]!==" "){for(var C=0,S=0;g[y]===u;)C++,y++;for(var A=(g.length-y)*c+1>>>0,D=new Uint8Array(A);g[y];){var O=r[g.charCodeAt(y)];if(O===255)return;for(var T=0,x=A-1;(O!==0||T<S)&&x!==-1;x--,T++)O+=a*D[x]>>>0,D[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");S=T,y++}if(g[y]!==" "){for(var M=A-S;M!==A&&D[M]===0;)M++;for(var U=new Uint8Array(C+(A-M)),R=C;M!==A;)U[R++]=D[M++];return U}}}function m(g){var y=f(g);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:f,decode:m}}var wI=yI,vI=wI;const _1=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},_I=t=>new TextEncoder().encode(t),EI=t=>new TextDecoder().decode(t);let II=class{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},AI=class{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return E1(this,e)}},SI=class{constructor(e){this.decoders=e}or(e){return E1(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const E1=(t,e)=>new SI({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let CI=class{constructor(e,r,i,s){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=s,this.encoder=new II(e,r,i),this.decoder=new AI(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const Eh=({name:t,prefix:e,encode:r,decode:i})=>new CI(t,e,r,i),Eu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:s}=vI(r,e);return Eh({prefix:t,name:e,encode:i,decode:n=>_1(s(n))})},$I=(t,e,r,i)=>{const s={};for(let l=0;l<e.length;++l)s[e[l]]=l;let n=t.length;for(;t[n-1]==="=";)--n;const o=new Uint8Array(n*r/8|0);let a=0,u=0,c=0;for(let l=0;l<n;++l){const h=s[t[l]];if(h===void 0)throw new SyntaxError(`Non-${i} character`);u=u<<r|h,a+=r,a>=8&&(a-=8,o[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return o},xI=(t,e,r)=>{const i=e[e.length-1]==="=",s=(1<<r)-1;let n="",o=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],o+=8;o>r;)o-=r,n+=e[s&a>>o];if(o&&(n+=e[s&a<<r-o]),i)for(;n.length*r&7;)n+="=";return n},Sr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Eh({prefix:e,name:t,encode(s){return xI(s,i,r)},decode(s){return $I(s,i,r,t)}}),PI=Eh({prefix:"\0",name:"identity",encode:t=>EI(t),decode:t=>_I(t)});var NI=Object.freeze({__proto__:null,identity:PI});const OI=Sr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var TI=Object.freeze({__proto__:null,base2:OI});const DI=Sr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var RI=Object.freeze({__proto__:null,base8:DI});const MI=Eu({prefix:"9",name:"base10",alphabet:"0123456789"});var kI=Object.freeze({__proto__:null,base10:MI});const UI=Sr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LI=Sr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var FI=Object.freeze({__proto__:null,base16:UI,base16upper:LI});const jI=Sr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qI=Sr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BI=Sr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zI=Sr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),HI=Sr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),VI=Sr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),KI=Sr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WI=Sr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),GI=Sr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var YI=Object.freeze({__proto__:null,base32:jI,base32upper:qI,base32pad:BI,base32padupper:zI,base32hex:HI,base32hexupper:VI,base32hexpad:KI,base32hexpadupper:WI,base32z:GI});const JI=Eu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QI=Eu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var XI=Object.freeze({__proto__:null,base36:JI,base36upper:QI});const ZI=Eu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),e8=Eu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var t8=Object.freeze({__proto__:null,base58btc:ZI,base58flickr:e8});const r8=Sr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),i8=Sr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s8=Sr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n8=Sr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var o8=Object.freeze({__proto__:null,base64:r8,base64pad:i8,base64url:s8,base64urlpad:n8});const I1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),a8=I1.reduce((t,e,r)=>(t[r]=e,t),[]),c8=I1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function u8(t){return t.reduce((e,r)=>(e+=a8[r],e),"")}function l8(t){const e=[];for(const r of t){const i=c8[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const h8=Eh({prefix:"🚀",name:"base256emoji",encode:u8,decode:l8});var d8=Object.freeze({__proto__:null,base256emoji:h8}),f8=A1,B0=128,p8=-128,g8=Math.pow(2,31);function A1(t,e,r){e=e||[],r=r||0;for(var i=r;t>=g8;)e[r++]=t&255|B0,t/=128;for(;t&p8;)e[r++]=t&255|B0,t>>>=7;return e[r]=t|0,A1.bytes=r-i+1,e}var b8=Gf,m8=128,z0=127;function Gf(t,i){var r=0,i=i||0,s=0,n=i,o,a=t.length;do{if(n>=a)throw Gf.bytes=0,new RangeError("Could not decode varint");o=t[n++],r+=s<28?(o&z0)<<s:(o&z0)*Math.pow(2,s),s+=7}while(o>=m8);return Gf.bytes=n-i,r}var y8=Math.pow(2,7),w8=Math.pow(2,14),v8=Math.pow(2,21),_8=Math.pow(2,28),E8=Math.pow(2,35),I8=Math.pow(2,42),A8=Math.pow(2,49),S8=Math.pow(2,56),C8=Math.pow(2,63),$8=function(t){return t<y8?1:t<w8?2:t<v8?3:t<_8?4:t<E8?5:t<I8?6:t<A8?7:t<S8?8:t<C8?9:10},x8={encode:f8,decode:b8,encodingLength:$8},S1=x8;const H0=(t,e,r=0)=>(S1.encode(t,e,r),e),V0=t=>S1.encodingLength(t),Yf=(t,e)=>{const r=e.byteLength,i=V0(t),s=i+V0(r),n=new Uint8Array(s+r);return H0(t,n,0),H0(r,n,i),n.set(e,s),new P8(t,r,e,n)};let P8=class{constructor(e,r,i,s){this.code=e,this.size=r,this.digest=i,this.bytes=s}};const C1=({name:t,code:e,encode:r})=>new N8(t,e,r);let N8=class{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Yf(this.code,r):r.then(i=>Yf(this.code,i))}else throw Error("Unknown type, must be binary type")}};const $1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),O8=C1({name:"sha2-256",code:18,encode:$1("SHA-256")}),T8=C1({name:"sha2-512",code:19,encode:$1("SHA-512")});var D8=Object.freeze({__proto__:null,sha256:O8,sha512:T8});const x1=0,R8="identity",P1=_1,M8=t=>Yf(x1,P1(t)),k8={code:x1,name:R8,encode:P1,digest:M8};var U8=Object.freeze({__proto__:null,identity:k8});new TextEncoder,new TextDecoder;const K0={...NI,...TI,...RI,...kI,...FI,...YI,...XI,...t8,...o8,...d8};({...D8,...U8});function N1(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const W0=N1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fd=N1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=w1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),O1={utf8:W0,"utf-8":W0,hex:K0.base16,latin1:fd,ascii:fd,binary:fd,...K0};function Ih(t,e="utf8"){const r=O1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function va(t,e="utf8"){const r=O1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?hg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function G0(t){return Os(Ih(va(t,_h),m1))}function th(t){return Ih(va(us(t),m1),_h)}function dg(t){const e=va(bI,q0),r=gI+Ih(v1([e,t]),q0);return[fI,pI,r].join(dI)}function L8(t){return Ih(t,_h)}function F8(t){return va(t,_h)}function j8(t){return va([th(t.header),th(t.payload)].join(eh),y1)}function q8(t){return[th(t.header),th(t.payload),L8(t.signature)].join(eh)}function oa(t){const e=t.split(eh),r=G0(e[0]),i=G0(e[1]),s=F8(e[2]),n=va(e.slice(0,2).join(eh),y1);return{header:r,payload:i,signature:s,data:n}}function rh(t=o1(mI)){const e=b1.getPublicKey(t);return{secretKey:v1([t,e]),publicKey:e}}async function T1(t,e,r,i,s=B.fromMiliseconds(Date.now())){const n={alg:lI,typ:hI},o=dg(i.publicKey),a=s+r,u={iss:o,sub:t,aud:e,iat:s,exp:a},c=j8({header:n,payload:u}),l=b1.sign(c,i.secretKey.slice(0,32));return q8({header:n,payload:u,signature:l})}var Y0=function(t,e,r){if(r||arguments.length===2)for(var i=0,s=e.length,n;i<s;i++)(n||!(i in e))&&(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},B8=(function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t})(),z8=(function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t})(),H8=(function(){function t(e,r,i,s){this.name=e,this.version=r,this.os=i,this.bot=s,this.type="bot-device"}return t})(),V8=(function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t})(),K8=(function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t})(),W8=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,G8=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,J0=3,Y8=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",W8]],Q0=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function D1(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new K8:typeof navigator<"u"?Q8(navigator.userAgent):Z8()}function J8(t){return t!==""&&Y8.reduce(function(e,r){var i=r[0],s=r[1];if(e)return e;var n=s.exec(t);return!!n&&[i,n]},!1)}function Q8(t){var e=J8(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new V8;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<J0&&(s=Y0(Y0([],s,!0),eA(J0-s.length),!0)):s=[];var n=s.join("."),o=X8(t),a=G8.exec(t);return a&&a[1]?new H8(r,n,o,a[1]):new B8(r,n,o)}function X8(t){for(var e=0,r=Q0.length;e<r;e++){var i=Q0[e],s=i[0],n=i[1],o=n.exec(t);if(o)return s}return null}function Z8(){var t=typeof process<"u"&&process.version;return t?new z8(process.version.slice(1)):null}function eA(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var et={},X0;function R1(){if(X0)return et;X0=1,Object.defineProperty(et,"__esModule",{value:!0}),et.getLocalStorage=et.getLocalStorageOrThrow=et.getCrypto=et.getCryptoOrThrow=et.getLocation=et.getLocationOrThrow=et.getNavigator=et.getNavigatorOrThrow=et.getDocument=et.getDocumentOrThrow=et.getFromWindowOrThrow=et.getFromWindow=void 0;function t(f){let m;return typeof window<"u"&&typeof window[f]<"u"&&(m=window[f]),m}et.getFromWindow=t;function e(f){const m=t(f);if(!m)throw new Error(`${f} is not defined in Window`);return m}et.getFromWindowOrThrow=e;function r(){return e("document")}et.getDocumentOrThrow=r;function i(){return t("document")}et.getDocument=i;function s(){return e("navigator")}et.getNavigatorOrThrow=s;function n(){return t("navigator")}et.getNavigator=n;function o(){return e("location")}et.getLocationOrThrow=o;function a(){return t("location")}et.getLocation=a;function u(){return e("crypto")}et.getCryptoOrThrow=u;function c(){return t("crypto")}et.getCrypto=c;function l(){return e("localStorage")}et.getLocalStorageOrThrow=l;function h(){return t("localStorage")}return et.getLocalStorage=h,et}var Qr=R1(),Qa={},Z0;function tA(){if(Z0)return Qa;Z0=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.getWindowMetadata=void 0;const t=R1();function e(){let r,i;try{r=t.getDocumentOrThrow(),i=t.getLocationOrThrow()}catch{return null}function s(){const m=r.getElementsByTagName("link"),g=[];for(let y=0;y<m.length;y++){const C=m[y],S=C.getAttribute("rel");if(S&&S.toLowerCase().indexOf("icon")>-1){const A=C.getAttribute("href");if(A)if(A.toLowerCase().indexOf("https:")===-1&&A.toLowerCase().indexOf("http:")===-1&&A.indexOf("//")!==0){let D=i.protocol+"//"+i.host;if(A.indexOf("/")===0)D+=A;else{const O=i.pathname.split("/");O.pop();const T=O.join("/");D+=T+"/"+A}g.push(D)}else if(A.indexOf("//")===0){const D=i.protocol+A;g.push(D)}else g.push(A)}}return g}function n(...m){const g=r.getElementsByTagName("meta");for(let y=0;y<g.length;y++){const C=g[y],S=["itemprop","property","name"].map(A=>C.getAttribute(A)).filter(A=>A?m.includes(A):!1);if(S.length&&S){const A=C.getAttribute("content");if(A)return A}}return""}function o(){let m=n("name","og:site_name","og:title","twitter:title");return m||(m=r.title),m}function a(){return n("description","og:description","twitter:description","keywords")}const u=o(),c=a(),l=i.origin,h=s();return{description:c,url:l,icons:h,name:u}}return Qa.getWindowMetadata=e,Qa}var M1=tA();function Fc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function eb(t){return Fc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const k1="2.23.2";let pd={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${k1}`},Ah=class Jf extends Error{constructor(e,r={}){const i=r.cause instanceof Jf?r.cause.details:r.cause?.message?r.cause.message:r.details,s=r.cause instanceof Jf&&r.cause.docsPath||r.docsPath,n=pd.getDocsUrl?.({...r,docsPath:s}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...n?[`Docs: ${n}`]:[],...i?[`Details: ${i}`]:[],...pd.version?[`Version: ${pd.version}`]:[]].join(`
|
|
3
|
+
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=k1}walk(e){return U1(this,e)}};function U1(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?U1(t.cause,e):e?null:t}let L1=class extends Ah{constructor({size:e,targetSize:r,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};function _a(t,{dir:e,size:r=32}={}){return typeof t=="string"?rA(t,{dir:e,size:r}):iA(t,{dir:e,size:r})}function rA(t,{dir:e,size:r=32}={}){if(r===null)return t;const i=t.replace("0x","");if(i.length>r*2)throw new L1({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function iA(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new L1({size:t.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const n=e==="right";i[n?s:r-s-1]=t[n?s:t.length-s-1]}return i}let sA=class extends Ah{constructor({max:e,min:r,signed:i,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},nA=class extends Ah{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function Ea(t,{size:e}){if(eb(t)>e)throw new nA({givenSize:eb(t),maxSize:e})}function Qf(t,e={}){const{signed:r}=e;e.size&&Ea(t,{size:e.size});const i=BigInt(t);if(!r)return i;const s=(t.length-2)/2,n=(1n<<BigInt(s)*8n-1n)-1n;return i<=n?i:i-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function oA(t,e={}){return Number(Qf(t,e))}const aA=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Xf(t,e={}){return typeof t=="number"||typeof t=="bigint"?j1(t,e):typeof t=="string"?lA(t,e):typeof t=="boolean"?cA(t,e):F1(t,e)}function cA(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{size:e.size})):r}function F1(t,e={}){let r="";for(let s=0;s<t.length;s++)r+=aA[t[s]];const i=`0x${r}`;return typeof e.size=="number"?(Ea(i,{size:e.size}),_a(i,{dir:"right",size:e.size})):i}function j1(t,e={}){const{signed:r,size:i}=e,s=BigInt(t);let n;i?r?n=(1n<<BigInt(i)*8n-1n)-1n:n=2n**(BigInt(i)*8n)-1n:typeof t=="number"&&(n=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof n=="bigint"&&r?-n-1n:0;if(n&&s>n||s<o){const u=typeof t=="bigint"?"n":"";throw new sA({max:n?`${n}${u}`:void 0,min:`${o}${u}`,signed:r,size:i,value:`${t}${u}`})}const a=`0x${(r&&s<0?(1n<<BigInt(i*8))+BigInt(s):s).toString(16)}`;return i?_a(a,{size:i}):a}const uA=new TextEncoder;function lA(t,e={}){const r=uA.encode(t);return F1(r,e)}const hA=new TextEncoder;function dA(t,e={}){return typeof t=="number"||typeof t=="bigint"?pA(t,e):typeof t=="boolean"?fA(t,e):Fc(t)?q1(t,e):B1(t,e)}function fA(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{size:e.size})):r}const ms={zero:48,nine:57,A:65,F:70,a:97,f:102};function tb(t){if(t>=ms.zero&&t<=ms.nine)return t-ms.zero;if(t>=ms.A&&t<=ms.F)return t-(ms.A-10);if(t>=ms.a&&t<=ms.f)return t-(ms.a-10)}function q1(t,e={}){let r=t;e.size&&(Ea(r,{size:e.size}),r=_a(r,{dir:"right",size:e.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,n=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const u=tb(i.charCodeAt(a++)),c=tb(i.charCodeAt(a++));if(u===void 0||c===void 0)throw new Ah(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);n[o]=u*16+c}return n}function pA(t,e){const r=j1(t,e);return q1(r)}function B1(t,e={}){const r=hA.encode(t);return typeof e.size=="number"?(Ea(r,{size:e.size}),_a(r,{dir:"right",size:e.size})):r}function ih(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function gA(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Sh(t,...e){if(!gA(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function QQ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ih(t.outputLen),ih(t.blockLen)}function rb(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function bA(t,e){Sh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const sl=BigInt(2**32-1),ib=BigInt(32);function mA(t,e=!1){return e?{h:Number(t&sl),l:Number(t>>ib&sl)}:{h:Number(t>>ib&sl)|0,l:Number(t&sl)|0}}function yA(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=mA(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const wA=(t,e,r)=>t<<r|e>>>32-r,vA=(t,e,r)=>e<<r|t>>>32-r,_A=(t,e,r)=>e<<r-32|t>>>64-r,EA=(t,e,r)=>t<<r-32|e>>>64-r,co=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function IA(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function XQ(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ZQ(t,e){return t<<32-e|t>>>e}const sb=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function AA(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function nb(t){for(let e=0;e<t.length;e++)t[e]=AA(t[e])}function SA(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function z1(t){return typeof t=="string"&&(t=SA(t)),Sh(t),t}function eX(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];Sh(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}let CA=class{clone(){return this._cloneInto()}};function $A(t){const e=i=>t().update(z1(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function rX(t=32){if(co&&typeof co.getRandomValues=="function")return co.getRandomValues(new Uint8Array(t));if(co&&typeof co.randomBytes=="function")return co.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const H1=[],V1=[],K1=[],xA=BigInt(0),Xa=BigInt(1),PA=BigInt(2),NA=BigInt(7),OA=BigInt(256),TA=BigInt(113);for(let t=0,e=Xa,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],H1.push(2*(5*i+r)),V1.push((t+1)*(t+2)/2%64);let s=xA;for(let n=0;n<7;n++)e=(e<<Xa^(e>>NA)*TA)%OA,e&PA&&(s^=Xa<<(Xa<<BigInt(n))-Xa);K1.push(s)}const[DA,RA]=yA(K1,!0),ob=(t,e,r)=>r>32?_A(t,e,r):wA(t,e,r),ab=(t,e,r)=>r>32?EA(t,e,r):vA(t,e,r);function MA(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=ob(c,l,1)^r[a],f=ab(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=V1[o],u=ob(s,n,a),c=ab(s,n,a),l=H1[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=DA[i],t[1]^=RA[i]}r.fill(0)}let kA=class W1 extends CA{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ih(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=IA(this.state)}keccak(){sb||nb(this.state32),MA(this.state32,this.rounds),sb||nb(this.state32),this.posOut=0,this.pos=0}update(e){rb(this);const{blockLen:r,state:i}=this;e=z1(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){rb(this,!1),Sh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ih(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(bA(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new W1(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const UA=(t,e,r)=>$A(()=>new kA(e,t,r)),LA=UA(1,136,256/8);function G1(t,e){const r=e||"hex",i=LA(Fc(t,{strict:!1})?dA(t):t);return r==="bytes"?i:Xf(i)}let FA=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}};const gd=new FA(8192);function jA(t,e){if(gd.has(`${t}.${e}`))return gd.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),i=G1(B1(r),"bytes"),s=r.split("");for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(i[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const n=`0x${s.join("")}`;return gd.set(`${t}.${e}`,n),n}function qA(t){const e=G1(`0x${t.substring(4)}`).substring(26);return jA(`0x${e}`)}async function BA({hash:t,signature:e}){const r=Fc(t)?t:Xf(t),{secp256k1:i}=await Jl(async()=>{const{secp256k1:o}=await import("./secp256k1-C0KaaotE.js");return{secp256k1:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:l,v:h,yParity:f}=e,m=Number(f??h),g=cb(m);return new i.Signature(Qf(c),Qf(l)).addRecoveryBit(g)}const o=Fc(e)?e:Xf(e),a=oA(`0x${o.slice(130)}`),u=cb(a);return i.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(u)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function cb(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function zA({hash:t,signature:e}){return qA(await BA({hash:t,signature:e}))}function Y1(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function ta(t,e){e||(e=t.reduce((s,n)=>s+n.length,0));const r=Y1(e);let i=0;for(const s of t)r.set(s,i),i+=s.length;return r}function HA(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var n=t.charAt(s),o=n.charCodeAt(0);if(r[o]!==255)throw new TypeError(n+" is ambiguous");r[o]=s}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var y=0,C=0,S=0,A=g.length;S!==A&&g[S]===0;)S++,y++;for(var D=(A-S)*l+1>>>0,O=new Uint8Array(D);S!==A;){for(var T=g[S],x=0,M=D-1;(T!==0||x<C)&&M!==-1;M--,x++)T+=256*O[M]>>>0,O[M]=T%a>>>0,T=T/a>>>0;if(T!==0)throw new Error("Non-zero carry");C=x,S++}for(var U=D-C;U!==D&&O[U]===0;)U++;for(var R=u.repeat(y);U<D;++U)R+=t.charAt(O[U]);return R}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var y=0;if(g[y]!==" "){for(var C=0,S=0;g[y]===u;)C++,y++;for(var A=(g.length-y)*c+1>>>0,D=new Uint8Array(A);g[y];){var O=r[g.charCodeAt(y)];if(O===255)return;for(var T=0,x=A-1;(O!==0||T<S)&&x!==-1;x--,T++)O+=a*D[x]>>>0,D[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");S=T,y++}if(g[y]!==" "){for(var M=A-S;M!==A&&D[M]===0;)M++;for(var U=new Uint8Array(C+(A-M)),R=C;M!==A;)U[R++]=D[M++];return U}}}function m(g){var y=f(g);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:f,decode:m}}var VA=HA,KA=VA;const WA=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},GA=t=>new TextEncoder().encode(t),YA=t=>new TextDecoder().decode(t);class JA{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class QA{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return J1(this,e)}}class XA{constructor(e){this.decoders=e}or(e){return J1(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const J1=(t,e)=>new XA({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class ZA{constructor(e,r,i,s){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=s,this.encoder=new JA(e,r,i),this.decoder=new QA(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ch=({name:t,prefix:e,encode:r,decode:i})=>new ZA(t,e,r,i),Iu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:s}=KA(r,e);return Ch({prefix:t,name:e,encode:i,decode:n=>WA(s(n))})},eS=(t,e,r,i)=>{const s={};for(let l=0;l<e.length;++l)s[e[l]]=l;let n=t.length;for(;t[n-1]==="=";)--n;const o=new Uint8Array(n*r/8|0);let a=0,u=0,c=0;for(let l=0;l<n;++l){const h=s[t[l]];if(h===void 0)throw new SyntaxError(`Non-${i} character`);u=u<<r|h,a+=r,a>=8&&(a-=8,o[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return o},tS=(t,e,r)=>{const i=e[e.length-1]==="=",s=(1<<r)-1;let n="",o=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],o+=8;o>r;)o-=r,n+=e[s&a>>o];if(o&&(n+=e[s&a<<r-o]),i)for(;n.length*r&7;)n+="=";return n},Cr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Ch({prefix:e,name:t,encode(s){return tS(s,i,r)},decode(s){return eS(s,i,r,t)}}),rS=Ch({prefix:"\0",name:"identity",encode:t=>YA(t),decode:t=>GA(t)}),iS=Object.freeze(Object.defineProperty({__proto__:null,identity:rS},Symbol.toStringTag,{value:"Module"})),sS=Cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),nS=Object.freeze(Object.defineProperty({__proto__:null,base2:sS},Symbol.toStringTag,{value:"Module"})),oS=Cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),aS=Object.freeze(Object.defineProperty({__proto__:null,base8:oS},Symbol.toStringTag,{value:"Module"})),cS=Iu({prefix:"9",name:"base10",alphabet:"0123456789"}),uS=Object.freeze(Object.defineProperty({__proto__:null,base10:cS},Symbol.toStringTag,{value:"Module"})),lS=Cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hS=Cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),dS=Object.freeze(Object.defineProperty({__proto__:null,base16:lS,base16upper:hS},Symbol.toStringTag,{value:"Module"})),fS=Cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),pS=Cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gS=Cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bS=Cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mS=Cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yS=Cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wS=Cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vS=Cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_S=Cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ES=Object.freeze(Object.defineProperty({__proto__:null,base32:fS,base32hex:mS,base32hexpad:wS,base32hexpadupper:vS,base32hexupper:yS,base32pad:gS,base32padupper:bS,base32upper:pS,base32z:_S},Symbol.toStringTag,{value:"Module"})),IS=Iu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AS=Iu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),SS=Object.freeze(Object.defineProperty({__proto__:null,base36:IS,base36upper:AS},Symbol.toStringTag,{value:"Module"})),CS=Iu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),$S=Iu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),xS=Object.freeze(Object.defineProperty({__proto__:null,base58btc:CS,base58flickr:$S},Symbol.toStringTag,{value:"Module"})),PS=Cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),NS=Cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),OS=Cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TS=Cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),DS=Object.freeze(Object.defineProperty({__proto__:null,base64:PS,base64pad:NS,base64url:OS,base64urlpad:TS},Symbol.toStringTag,{value:"Module"})),Q1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),RS=Q1.reduce((t,e,r)=>(t[r]=e,t),[]),MS=Q1.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function kS(t){return t.reduce((e,r)=>(e+=RS[r],e),"")}function US(t){const e=[];for(const r of t){const i=MS[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const LS=Ch({prefix:"🚀",name:"base256emoji",encode:kS,decode:US}),FS=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:LS},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const ub={...iS,...nS,...aS,...uS,...dS,...ES,...SS,...xS,...DS,...FS};function X1(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const lb=X1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),bd=X1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Y1(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Z1={utf8:lb,"utf-8":lb,hex:ub.base16,latin1:bd,ascii:bd,binary:bd,...ub};function _t(t,e="utf8"){const r=Z1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Fe(t,e="utf8"){const r=Z1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var md={};const jS="6.6.1",qS={version:jS};var yd={},kl={exports:{}},BS=kl.exports,hb;function Ds(){return hb||(hb=1,(function(t){(function(e,r){function i($,d){if(!$)throw new Error(d||"Assertion failed")}function s($,d){$.super_=d;var b=function(){};b.prototype=d.prototype,$.prototype=new b,$.prototype.constructor=$}function n($,d,b){if(n.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((d==="le"||d==="be")&&(b=d,d=10),this._init($||0,d||10,b||"be"))}typeof e=="object"?e.exports=n:r.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Jv.Buffer}catch{}n.isBN=function(d){return d instanceof n?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===n.wordSize&&Array.isArray(d.words)},n.max=function(d,b){return d.cmp(b)>0?d:b},n.min=function(d,b){return d.cmp(b)<0?d:b},n.prototype._init=function(d,b,_){if(typeof d=="number")return this._initNumber(d,b,_);if(typeof d=="object")return this._initArray(d,b,_);b==="hex"&&(b=16),i(b===(b|0)&&b>=2&&b<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(b===16?this._parseHex(d,w,_):(this._parseBase(d,b,w),_==="le"&&this._initArray(this.toArray(),b,_)))},n.prototype._initNumber=function(d,b,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(i(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),b,_)},n.prototype._initArray=function(d,b,_){if(i(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v,I,P=0;if(_==="be")for(w=d.length-1,v=0;w>=0;w-=3)I=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[v]|=I<<P&67108863,this.words[v+1]=I>>>26-P&67108863,P+=24,P>=26&&(P-=26,v++);else if(_==="le")for(w=0,v=0;w<d.length;w+=3)I=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[v]|=I<<P&67108863,this.words[v+1]=I>>>26-P&67108863,P+=24,P>=26&&(P-=26,v++);return this.strip()};function a($,d){var b=$.charCodeAt(d);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}function u($,d,b){var _=a($,b);return b-1>=d&&(_|=a($,b-1)<<4),_}n.prototype._parseHex=function(d,b,_){this.length=Math.ceil((d.length-b)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v=0,I=0,P;if(_==="be")for(w=d.length-1;w>=b;w-=2)P=u(d,b,w)<<v,this.words[I]|=P&67108863,v>=18?(v-=18,I+=1,this.words[I]|=P>>>26):v+=8;else{var E=d.length-b;for(w=E%2===0?b+1:b;w<d.length;w+=2)P=u(d,b,w)<<v,this.words[I]|=P&67108863,v>=18?(v-=18,I+=1,this.words[I]|=P>>>26):v+=8}this.strip()};function c($,d,b,_){for(var w=0,v=Math.min($.length,b),I=d;I<v;I++){var P=$.charCodeAt(I)-48;w*=_,P>=49?w+=P-49+10:P>=17?w+=P-17+10:w+=P}return w}n.prototype._parseBase=function(d,b,_){this.words=[0],this.length=1;for(var w=0,v=1;v<=67108863;v*=b)w++;w--,v=v/b|0;for(var I=d.length-_,P=I%w,E=Math.min(I,I-P)+_,p=0,N=_;N<E;N+=w)p=c(d,N,N+w,b),this.imuln(v),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(P!==0){var q=1;for(p=c(d,N,d.length,b),N=0;N<P;N++)q*=b;this.imuln(q),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},n.prototype.copy=function(d){d.words=new Array(this.length);for(var b=0;b<this.length;b++)d.words[b]=this.words[b];d.length=this.length,d.negative=this.negative,d.red=this.red},n.prototype.clone=function(){var d=new n(null);return this.copy(d),d},n.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(d,b){d=d||10,b=b|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,v=0,I=0;I<this.length;I++){var P=this.words[I],E=((P<<w|v)&16777215).toString(16);v=P>>>24-w&16777215,w+=2,w>=26&&(w-=26,I--),v!==0||I!==this.length-1?_=l[6-E.length]+E+_:_=E+_}for(v!==0&&(_=v.toString(16)+_);_.length%b!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var p=h[d],N=f[d];_="";var q=this.clone();for(q.negative=0;!q.isZero();){var H=q.modn(N).toString(d);q=q.idivn(N),q.isZero()?_=H+_:_=l[p-H.length]+H+_}for(this.isZero()&&(_="0"+_);_.length%b!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(d,b){return i(typeof o<"u"),this.toArrayLike(o,d,b)},n.prototype.toArray=function(d,b){return this.toArrayLike(Array,d,b)},n.prototype.toArrayLike=function(d,b,_){var w=this.byteLength(),v=_||Math.max(1,w);i(w<=v,"byte array longer than desired length"),i(v>0,"Requested array length <= 0"),this.strip();var I=b==="le",P=new d(v),E,p,N=this.clone();if(I){for(p=0;!N.isZero();p++)E=N.andln(255),N.iushrn(8),P[p]=E;for(;p<v;p++)P[p]=0}else{for(p=0;p<v-w;p++)P[p]=0;for(p=0;!N.isZero();p++)E=N.andln(255),N.iushrn(8),P[v-p-1]=E}return P},Math.clz32?n.prototype._countBits=function(d){return 32-Math.clz32(d)}:n.prototype._countBits=function(d){var b=d,_=0;return b>=4096&&(_+=13,b>>>=13),b>=64&&(_+=7,b>>>=7),b>=8&&(_+=4,b>>>=4),b>=2&&(_+=2,b>>>=2),_+b},n.prototype._zeroBits=function(d){if(d===0)return 26;var b=d,_=0;return(b&8191)===0&&(_+=13,b>>>=13),(b&127)===0&&(_+=7,b>>>=7),(b&15)===0&&(_+=4,b>>>=4),(b&3)===0&&(_+=2,b>>>=2),(b&1)===0&&_++,_},n.prototype.bitLength=function(){var d=this.words[this.length-1],b=this._countBits(d);return(this.length-1)*26+b};function m($){for(var d=new Array($.bitLength()),b=0;b<d.length;b++){var _=b/26|0,w=b%26;d[b]=($.words[_]&1<<w)>>>w}return d}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,b=0;b<this.length;b++){var _=this._zeroBits(this.words[b]);if(d+=_,_!==26)break}return d},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},n.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var b=0;b<d.length;b++)this.words[b]=this.words[b]|d.words[b];return this.strip()},n.prototype.ior=function(d){return i((this.negative|d.negative)===0),this.iuor(d)},n.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},n.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},n.prototype.iuand=function(d){var b;this.length>d.length?b=d:b=this;for(var _=0;_<b.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=b.length,this.strip()},n.prototype.iand=function(d){return i((this.negative|d.negative)===0),this.iuand(d)},n.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},n.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},n.prototype.iuxor=function(d){var b,_;this.length>d.length?(b=this,_=d):(b=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=b.words[w]^_.words[w];if(this!==b)for(;w<b.length;w++)this.words[w]=b.words[w];return this.length=b.length,this.strip()},n.prototype.ixor=function(d){return i((this.negative|d.negative)===0),this.iuxor(d)},n.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},n.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},n.prototype.inotn=function(d){i(typeof d=="number"&&d>=0);var b=Math.ceil(d/26)|0,_=d%26;this._expand(b),_>0&&b--;for(var w=0;w<b;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},n.prototype.notn=function(d){return this.clone().inotn(d)},n.prototype.setn=function(d,b){i(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),b?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},n.prototype.iadd=function(d){var b;if(this.negative!==0&&d.negative===0)return this.negative=0,b=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,b=this.isub(d),d.negative=1,b._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var v=0,I=0;I<w.length;I++)b=(_.words[I]|0)+(w.words[I]|0)+v,this.words[I]=b&67108863,v=b>>>26;for(;v!==0&&I<_.length;I++)b=(_.words[I]|0)+v,this.words[I]=b&67108863,v=b>>>26;if(this.length=_.length,v!==0)this.words[this.length]=v,this.length++;else if(_!==this)for(;I<_.length;I++)this.words[I]=_.words[I];return this},n.prototype.add=function(d){var b;return d.negative!==0&&this.negative===0?(d.negative=0,b=this.sub(d),d.negative^=1,b):d.negative===0&&this.negative!==0?(this.negative=0,b=d.sub(this),this.negative=1,b):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},n.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var b=this.iadd(d);return d.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,v;_>0?(w=this,v=d):(w=d,v=this);for(var I=0,P=0;P<v.length;P++)b=(w.words[P]|0)-(v.words[P]|0)+I,I=b>>26,this.words[P]=b&67108863;for(;I!==0&&P<w.length;P++)b=(w.words[P]|0)+I,I=b>>26,this.words[P]=b&67108863;if(I===0&&P<w.length&&w!==this)for(;P<w.length;P++)this.words[P]=w.words[P];return this.length=Math.max(this.length,P),w!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(d){return this.clone().isub(d)};function g($,d,b){b.negative=d.negative^$.negative;var _=$.length+d.length|0;b.length=_,_=_-1|0;var w=$.words[0]|0,v=d.words[0]|0,I=w*v,P=I&67108863,E=I/67108864|0;b.words[0]=P;for(var p=1;p<_;p++){for(var N=E>>>26,q=E&67108863,H=Math.min(p,d.length-1),z=Math.max(0,p-$.length+1);z<=H;z++){var V=p-z|0;w=$.words[V]|0,v=d.words[z]|0,I=w*v+q,N+=I/67108864|0,q=I&67108863}b.words[p]=q|0,E=N|0}return E!==0?b.words[p]=E|0:b.length--,b.strip()}var y=function(d,b,_){var w=d.words,v=b.words,I=_.words,P=0,E,p,N,q=w[0]|0,H=q&8191,z=q>>>13,V=w[1]|0,Y=V&8191,te=V>>>13,ie=w[2]|0,Z=ie&8191,ae=ie>>>13,ht=w[3]|0,ge=ht&8191,ye=ht>>>13,Dt=w[4]|0,Ie=Dt&8191,Te=Dt>>>13,bi=w[5]|0,Ze=bi&8191,Ke=bi>>>13,Vi=w[6]|0,qe=Vi&8191,We=Vi>>>13,Ki=w[7]|0,De=Ki&8191,Re=Ki>>>13,Wi=w[8]|0,Me=Wi&8191,st=Wi>>>13,dn=w[9]|0,Se=dn&8191,It=dn>>>13,Na=v[0]|0,Rt=Na&8191,At=Na>>>13,fn=v[1]|0,St=fn&8191,Ct=fn>>>13,qu=v[2]|0,Ge=qu&8191,$t=qu>>>13,Bu=v[3]|0,Mt=Bu&8191,bt=Bu>>>13,Rs=v[4]|0,mt=Rs&8191,yt=Rs>>>13,so=v[5]|0,nt=so&8191,kt=so>>>13,zu=v[6]|0,Ut=zu&8191,Lt=zu>>>13,Hu=v[7]|0,xt=Hu&8191,wt=Hu>>>13,Gi=v[8]|0,Ft=Gi&8191,jt=Gi>>>13,Vu=v[9]|0,qt=Vu&8191,Bt=Vu>>>13;_.negative=d.negative^b.negative,_.length=19,E=Math.imul(H,Rt),p=Math.imul(H,At),p=p+Math.imul(z,Rt)|0,N=Math.imul(z,At);var ei=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ei>>>26)|0,ei&=67108863,E=Math.imul(Y,Rt),p=Math.imul(Y,At),p=p+Math.imul(te,Rt)|0,N=Math.imul(te,At),E=E+Math.imul(H,St)|0,p=p+Math.imul(H,Ct)|0,p=p+Math.imul(z,St)|0,N=N+Math.imul(z,Ct)|0;var Oa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,E=Math.imul(Z,Rt),p=Math.imul(Z,At),p=p+Math.imul(ae,Rt)|0,N=Math.imul(ae,At),E=E+Math.imul(Y,St)|0,p=p+Math.imul(Y,Ct)|0,p=p+Math.imul(te,St)|0,N=N+Math.imul(te,Ct)|0,E=E+Math.imul(H,Ge)|0,p=p+Math.imul(H,$t)|0,p=p+Math.imul(z,Ge)|0,N=N+Math.imul(z,$t)|0;var Ta=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,E=Math.imul(ge,Rt),p=Math.imul(ge,At),p=p+Math.imul(ye,Rt)|0,N=Math.imul(ye,At),E=E+Math.imul(Z,St)|0,p=p+Math.imul(Z,Ct)|0,p=p+Math.imul(ae,St)|0,N=N+Math.imul(ae,Ct)|0,E=E+Math.imul(Y,Ge)|0,p=p+Math.imul(Y,$t)|0,p=p+Math.imul(te,Ge)|0,N=N+Math.imul(te,$t)|0,E=E+Math.imul(H,Mt)|0,p=p+Math.imul(H,bt)|0,p=p+Math.imul(z,Mt)|0,N=N+Math.imul(z,bt)|0;var Da=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Da>>>26)|0,Da&=67108863,E=Math.imul(Ie,Rt),p=Math.imul(Ie,At),p=p+Math.imul(Te,Rt)|0,N=Math.imul(Te,At),E=E+Math.imul(ge,St)|0,p=p+Math.imul(ge,Ct)|0,p=p+Math.imul(ye,St)|0,N=N+Math.imul(ye,Ct)|0,E=E+Math.imul(Z,Ge)|0,p=p+Math.imul(Z,$t)|0,p=p+Math.imul(ae,Ge)|0,N=N+Math.imul(ae,$t)|0,E=E+Math.imul(Y,Mt)|0,p=p+Math.imul(Y,bt)|0,p=p+Math.imul(te,Mt)|0,N=N+Math.imul(te,bt)|0,E=E+Math.imul(H,mt)|0,p=p+Math.imul(H,yt)|0,p=p+Math.imul(z,mt)|0,N=N+Math.imul(z,yt)|0;var Ra=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,E=Math.imul(Ze,Rt),p=Math.imul(Ze,At),p=p+Math.imul(Ke,Rt)|0,N=Math.imul(Ke,At),E=E+Math.imul(Ie,St)|0,p=p+Math.imul(Ie,Ct)|0,p=p+Math.imul(Te,St)|0,N=N+Math.imul(Te,Ct)|0,E=E+Math.imul(ge,Ge)|0,p=p+Math.imul(ge,$t)|0,p=p+Math.imul(ye,Ge)|0,N=N+Math.imul(ye,$t)|0,E=E+Math.imul(Z,Mt)|0,p=p+Math.imul(Z,bt)|0,p=p+Math.imul(ae,Mt)|0,N=N+Math.imul(ae,bt)|0,E=E+Math.imul(Y,mt)|0,p=p+Math.imul(Y,yt)|0,p=p+Math.imul(te,mt)|0,N=N+Math.imul(te,yt)|0,E=E+Math.imul(H,nt)|0,p=p+Math.imul(H,kt)|0,p=p+Math.imul(z,nt)|0,N=N+Math.imul(z,kt)|0;var Ma=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,E=Math.imul(qe,Rt),p=Math.imul(qe,At),p=p+Math.imul(We,Rt)|0,N=Math.imul(We,At),E=E+Math.imul(Ze,St)|0,p=p+Math.imul(Ze,Ct)|0,p=p+Math.imul(Ke,St)|0,N=N+Math.imul(Ke,Ct)|0,E=E+Math.imul(Ie,Ge)|0,p=p+Math.imul(Ie,$t)|0,p=p+Math.imul(Te,Ge)|0,N=N+Math.imul(Te,$t)|0,E=E+Math.imul(ge,Mt)|0,p=p+Math.imul(ge,bt)|0,p=p+Math.imul(ye,Mt)|0,N=N+Math.imul(ye,bt)|0,E=E+Math.imul(Z,mt)|0,p=p+Math.imul(Z,yt)|0,p=p+Math.imul(ae,mt)|0,N=N+Math.imul(ae,yt)|0,E=E+Math.imul(Y,nt)|0,p=p+Math.imul(Y,kt)|0,p=p+Math.imul(te,nt)|0,N=N+Math.imul(te,kt)|0,E=E+Math.imul(H,Ut)|0,p=p+Math.imul(H,Lt)|0,p=p+Math.imul(z,Ut)|0,N=N+Math.imul(z,Lt)|0;var Oi=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,E=Math.imul(De,Rt),p=Math.imul(De,At),p=p+Math.imul(Re,Rt)|0,N=Math.imul(Re,At),E=E+Math.imul(qe,St)|0,p=p+Math.imul(qe,Ct)|0,p=p+Math.imul(We,St)|0,N=N+Math.imul(We,Ct)|0,E=E+Math.imul(Ze,Ge)|0,p=p+Math.imul(Ze,$t)|0,p=p+Math.imul(Ke,Ge)|0,N=N+Math.imul(Ke,$t)|0,E=E+Math.imul(Ie,Mt)|0,p=p+Math.imul(Ie,bt)|0,p=p+Math.imul(Te,Mt)|0,N=N+Math.imul(Te,bt)|0,E=E+Math.imul(ge,mt)|0,p=p+Math.imul(ge,yt)|0,p=p+Math.imul(ye,mt)|0,N=N+Math.imul(ye,yt)|0,E=E+Math.imul(Z,nt)|0,p=p+Math.imul(Z,kt)|0,p=p+Math.imul(ae,nt)|0,N=N+Math.imul(ae,kt)|0,E=E+Math.imul(Y,Ut)|0,p=p+Math.imul(Y,Lt)|0,p=p+Math.imul(te,Ut)|0,N=N+Math.imul(te,Lt)|0,E=E+Math.imul(H,xt)|0,p=p+Math.imul(H,wt)|0,p=p+Math.imul(z,xt)|0,N=N+Math.imul(z,wt)|0;var ka=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ka>>>26)|0,ka&=67108863,E=Math.imul(Me,Rt),p=Math.imul(Me,At),p=p+Math.imul(st,Rt)|0,N=Math.imul(st,At),E=E+Math.imul(De,St)|0,p=p+Math.imul(De,Ct)|0,p=p+Math.imul(Re,St)|0,N=N+Math.imul(Re,Ct)|0,E=E+Math.imul(qe,Ge)|0,p=p+Math.imul(qe,$t)|0,p=p+Math.imul(We,Ge)|0,N=N+Math.imul(We,$t)|0,E=E+Math.imul(Ze,Mt)|0,p=p+Math.imul(Ze,bt)|0,p=p+Math.imul(Ke,Mt)|0,N=N+Math.imul(Ke,bt)|0,E=E+Math.imul(Ie,mt)|0,p=p+Math.imul(Ie,yt)|0,p=p+Math.imul(Te,mt)|0,N=N+Math.imul(Te,yt)|0,E=E+Math.imul(ge,nt)|0,p=p+Math.imul(ge,kt)|0,p=p+Math.imul(ye,nt)|0,N=N+Math.imul(ye,kt)|0,E=E+Math.imul(Z,Ut)|0,p=p+Math.imul(Z,Lt)|0,p=p+Math.imul(ae,Ut)|0,N=N+Math.imul(ae,Lt)|0,E=E+Math.imul(Y,xt)|0,p=p+Math.imul(Y,wt)|0,p=p+Math.imul(te,xt)|0,N=N+Math.imul(te,wt)|0,E=E+Math.imul(H,Ft)|0,p=p+Math.imul(H,jt)|0,p=p+Math.imul(z,Ft)|0,N=N+Math.imul(z,jt)|0;var Ua=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,E=Math.imul(Se,Rt),p=Math.imul(Se,At),p=p+Math.imul(It,Rt)|0,N=Math.imul(It,At),E=E+Math.imul(Me,St)|0,p=p+Math.imul(Me,Ct)|0,p=p+Math.imul(st,St)|0,N=N+Math.imul(st,Ct)|0,E=E+Math.imul(De,Ge)|0,p=p+Math.imul(De,$t)|0,p=p+Math.imul(Re,Ge)|0,N=N+Math.imul(Re,$t)|0,E=E+Math.imul(qe,Mt)|0,p=p+Math.imul(qe,bt)|0,p=p+Math.imul(We,Mt)|0,N=N+Math.imul(We,bt)|0,E=E+Math.imul(Ze,mt)|0,p=p+Math.imul(Ze,yt)|0,p=p+Math.imul(Ke,mt)|0,N=N+Math.imul(Ke,yt)|0,E=E+Math.imul(Ie,nt)|0,p=p+Math.imul(Ie,kt)|0,p=p+Math.imul(Te,nt)|0,N=N+Math.imul(Te,kt)|0,E=E+Math.imul(ge,Ut)|0,p=p+Math.imul(ge,Lt)|0,p=p+Math.imul(ye,Ut)|0,N=N+Math.imul(ye,Lt)|0,E=E+Math.imul(Z,xt)|0,p=p+Math.imul(Z,wt)|0,p=p+Math.imul(ae,xt)|0,N=N+Math.imul(ae,wt)|0,E=E+Math.imul(Y,Ft)|0,p=p+Math.imul(Y,jt)|0,p=p+Math.imul(te,Ft)|0,N=N+Math.imul(te,jt)|0,E=E+Math.imul(H,qt)|0,p=p+Math.imul(H,Bt)|0,p=p+Math.imul(z,qt)|0,N=N+Math.imul(z,Bt)|0;var La=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(La>>>26)|0,La&=67108863,E=Math.imul(Se,St),p=Math.imul(Se,Ct),p=p+Math.imul(It,St)|0,N=Math.imul(It,Ct),E=E+Math.imul(Me,Ge)|0,p=p+Math.imul(Me,$t)|0,p=p+Math.imul(st,Ge)|0,N=N+Math.imul(st,$t)|0,E=E+Math.imul(De,Mt)|0,p=p+Math.imul(De,bt)|0,p=p+Math.imul(Re,Mt)|0,N=N+Math.imul(Re,bt)|0,E=E+Math.imul(qe,mt)|0,p=p+Math.imul(qe,yt)|0,p=p+Math.imul(We,mt)|0,N=N+Math.imul(We,yt)|0,E=E+Math.imul(Ze,nt)|0,p=p+Math.imul(Ze,kt)|0,p=p+Math.imul(Ke,nt)|0,N=N+Math.imul(Ke,kt)|0,E=E+Math.imul(Ie,Ut)|0,p=p+Math.imul(Ie,Lt)|0,p=p+Math.imul(Te,Ut)|0,N=N+Math.imul(Te,Lt)|0,E=E+Math.imul(ge,xt)|0,p=p+Math.imul(ge,wt)|0,p=p+Math.imul(ye,xt)|0,N=N+Math.imul(ye,wt)|0,E=E+Math.imul(Z,Ft)|0,p=p+Math.imul(Z,jt)|0,p=p+Math.imul(ae,Ft)|0,N=N+Math.imul(ae,jt)|0,E=E+Math.imul(Y,qt)|0,p=p+Math.imul(Y,Bt)|0,p=p+Math.imul(te,qt)|0,N=N+Math.imul(te,Bt)|0;var Fa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,E=Math.imul(Se,Ge),p=Math.imul(Se,$t),p=p+Math.imul(It,Ge)|0,N=Math.imul(It,$t),E=E+Math.imul(Me,Mt)|0,p=p+Math.imul(Me,bt)|0,p=p+Math.imul(st,Mt)|0,N=N+Math.imul(st,bt)|0,E=E+Math.imul(De,mt)|0,p=p+Math.imul(De,yt)|0,p=p+Math.imul(Re,mt)|0,N=N+Math.imul(Re,yt)|0,E=E+Math.imul(qe,nt)|0,p=p+Math.imul(qe,kt)|0,p=p+Math.imul(We,nt)|0,N=N+Math.imul(We,kt)|0,E=E+Math.imul(Ze,Ut)|0,p=p+Math.imul(Ze,Lt)|0,p=p+Math.imul(Ke,Ut)|0,N=N+Math.imul(Ke,Lt)|0,E=E+Math.imul(Ie,xt)|0,p=p+Math.imul(Ie,wt)|0,p=p+Math.imul(Te,xt)|0,N=N+Math.imul(Te,wt)|0,E=E+Math.imul(ge,Ft)|0,p=p+Math.imul(ge,jt)|0,p=p+Math.imul(ye,Ft)|0,N=N+Math.imul(ye,jt)|0,E=E+Math.imul(Z,qt)|0,p=p+Math.imul(Z,Bt)|0,p=p+Math.imul(ae,qt)|0,N=N+Math.imul(ae,Bt)|0;var ja=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(ja>>>26)|0,ja&=67108863,E=Math.imul(Se,Mt),p=Math.imul(Se,bt),p=p+Math.imul(It,Mt)|0,N=Math.imul(It,bt),E=E+Math.imul(Me,mt)|0,p=p+Math.imul(Me,yt)|0,p=p+Math.imul(st,mt)|0,N=N+Math.imul(st,yt)|0,E=E+Math.imul(De,nt)|0,p=p+Math.imul(De,kt)|0,p=p+Math.imul(Re,nt)|0,N=N+Math.imul(Re,kt)|0,E=E+Math.imul(qe,Ut)|0,p=p+Math.imul(qe,Lt)|0,p=p+Math.imul(We,Ut)|0,N=N+Math.imul(We,Lt)|0,E=E+Math.imul(Ze,xt)|0,p=p+Math.imul(Ze,wt)|0,p=p+Math.imul(Ke,xt)|0,N=N+Math.imul(Ke,wt)|0,E=E+Math.imul(Ie,Ft)|0,p=p+Math.imul(Ie,jt)|0,p=p+Math.imul(Te,Ft)|0,N=N+Math.imul(Te,jt)|0,E=E+Math.imul(ge,qt)|0,p=p+Math.imul(ge,Bt)|0,p=p+Math.imul(ye,qt)|0,N=N+Math.imul(ye,Bt)|0;var Ms=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,E=Math.imul(Se,mt),p=Math.imul(Se,yt),p=p+Math.imul(It,mt)|0,N=Math.imul(It,yt),E=E+Math.imul(Me,nt)|0,p=p+Math.imul(Me,kt)|0,p=p+Math.imul(st,nt)|0,N=N+Math.imul(st,kt)|0,E=E+Math.imul(De,Ut)|0,p=p+Math.imul(De,Lt)|0,p=p+Math.imul(Re,Ut)|0,N=N+Math.imul(Re,Lt)|0,E=E+Math.imul(qe,xt)|0,p=p+Math.imul(qe,wt)|0,p=p+Math.imul(We,xt)|0,N=N+Math.imul(We,wt)|0,E=E+Math.imul(Ze,Ft)|0,p=p+Math.imul(Ze,jt)|0,p=p+Math.imul(Ke,Ft)|0,N=N+Math.imul(Ke,jt)|0,E=E+Math.imul(Ie,qt)|0,p=p+Math.imul(Ie,Bt)|0,p=p+Math.imul(Te,qt)|0,N=N+Math.imul(Te,Bt)|0;var qa=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(qa>>>26)|0,qa&=67108863,E=Math.imul(Se,nt),p=Math.imul(Se,kt),p=p+Math.imul(It,nt)|0,N=Math.imul(It,kt),E=E+Math.imul(Me,Ut)|0,p=p+Math.imul(Me,Lt)|0,p=p+Math.imul(st,Ut)|0,N=N+Math.imul(st,Lt)|0,E=E+Math.imul(De,xt)|0,p=p+Math.imul(De,wt)|0,p=p+Math.imul(Re,xt)|0,N=N+Math.imul(Re,wt)|0,E=E+Math.imul(qe,Ft)|0,p=p+Math.imul(qe,jt)|0,p=p+Math.imul(We,Ft)|0,N=N+Math.imul(We,jt)|0,E=E+Math.imul(Ze,qt)|0,p=p+Math.imul(Ze,Bt)|0,p=p+Math.imul(Ke,qt)|0,N=N+Math.imul(Ke,Bt)|0;var Ba=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,E=Math.imul(Se,Ut),p=Math.imul(Se,Lt),p=p+Math.imul(It,Ut)|0,N=Math.imul(It,Lt),E=E+Math.imul(Me,xt)|0,p=p+Math.imul(Me,wt)|0,p=p+Math.imul(st,xt)|0,N=N+Math.imul(st,wt)|0,E=E+Math.imul(De,Ft)|0,p=p+Math.imul(De,jt)|0,p=p+Math.imul(Re,Ft)|0,N=N+Math.imul(Re,jt)|0,E=E+Math.imul(qe,qt)|0,p=p+Math.imul(qe,Bt)|0,p=p+Math.imul(We,qt)|0,N=N+Math.imul(We,Bt)|0;var mi=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(mi>>>26)|0,mi&=67108863,E=Math.imul(Se,xt),p=Math.imul(Se,wt),p=p+Math.imul(It,xt)|0,N=Math.imul(It,wt),E=E+Math.imul(Me,Ft)|0,p=p+Math.imul(Me,jt)|0,p=p+Math.imul(st,Ft)|0,N=N+Math.imul(st,jt)|0,E=E+Math.imul(De,qt)|0,p=p+Math.imul(De,Bt)|0,p=p+Math.imul(Re,qt)|0,N=N+Math.imul(Re,Bt)|0;var za=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(za>>>26)|0,za&=67108863,E=Math.imul(Se,Ft),p=Math.imul(Se,jt),p=p+Math.imul(It,Ft)|0,N=Math.imul(It,jt),E=E+Math.imul(Me,qt)|0,p=p+Math.imul(Me,Bt)|0,p=p+Math.imul(st,qt)|0,N=N+Math.imul(st,Bt)|0;var Ha=(P+E|0)+((p&8191)<<13)|0;P=(N+(p>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,E=Math.imul(Se,qt),p=Math.imul(Se,Bt),p=p+Math.imul(It,qt)|0,N=Math.imul(It,Bt);var Va=(P+E|0)+((p&8191)<<13)|0;return P=(N+(p>>>13)|0)+(Va>>>26)|0,Va&=67108863,I[0]=ei,I[1]=Oa,I[2]=Ta,I[3]=Da,I[4]=Ra,I[5]=Ma,I[6]=Oi,I[7]=ka,I[8]=Ua,I[9]=La,I[10]=Fa,I[11]=ja,I[12]=Ms,I[13]=qa,I[14]=Ba,I[15]=mi,I[16]=za,I[17]=Ha,I[18]=Va,P!==0&&(I[19]=P,_.length++),_};Math.imul||(y=g);function C($,d,b){b.negative=d.negative^$.negative,b.length=$.length+d.length;for(var _=0,w=0,v=0;v<b.length-1;v++){var I=w;w=0;for(var P=_&67108863,E=Math.min(v,d.length-1),p=Math.max(0,v-$.length+1);p<=E;p++){var N=v-p,q=$.words[N]|0,H=d.words[p]|0,z=q*H,V=z&67108863;I=I+(z/67108864|0)|0,V=V+P|0,P=V&67108863,I=I+(V>>>26)|0,w+=I>>>26,I&=67108863}b.words[v]=P,_=I,I=w}return _!==0?b.words[v]=_:b.length--,b.strip()}function S($,d,b){var _=new A;return _.mulp($,d,b)}n.prototype.mulTo=function(d,b){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=y(this,d,b):w<63?_=g(this,d,b):w<1024?_=C(this,d,b):_=S(this,d,b),_};function A($,d){this.x=$,this.y=d}A.prototype.makeRBT=function(d){for(var b=new Array(d),_=n.prototype._countBits(d)-1,w=0;w<d;w++)b[w]=this.revBin(w,_,d);return b},A.prototype.revBin=function(d,b,_){if(d===0||d===_-1)return d;for(var w=0,v=0;v<b;v++)w|=(d&1)<<b-v-1,d>>=1;return w},A.prototype.permute=function(d,b,_,w,v,I){for(var P=0;P<I;P++)w[P]=b[d[P]],v[P]=_[d[P]]},A.prototype.transform=function(d,b,_,w,v,I){this.permute(I,d,b,_,w,v);for(var P=1;P<v;P<<=1)for(var E=P<<1,p=Math.cos(2*Math.PI/E),N=Math.sin(2*Math.PI/E),q=0;q<v;q+=E)for(var H=p,z=N,V=0;V<P;V++){var Y=_[q+V],te=w[q+V],ie=_[q+V+P],Z=w[q+V+P],ae=H*ie-z*Z;Z=H*Z+z*ie,ie=ae,_[q+V]=Y+ie,w[q+V]=te+Z,_[q+V+P]=Y-ie,w[q+V+P]=te-Z,V!==E&&(ae=p*H-N*z,z=p*z+N*H,H=ae)}},A.prototype.guessLen13b=function(d,b){var _=Math.max(b,d)|1,w=_&1,v=0;for(_=_/2|0;_;_=_>>>1)v++;return 1<<v+1+w},A.prototype.conjugate=function(d,b,_){if(!(_<=1))for(var w=0;w<_/2;w++){var v=d[w];d[w]=d[_-w-1],d[_-w-1]=v,v=b[w],b[w]=-b[_-w-1],b[_-w-1]=-v}},A.prototype.normalize13b=function(d,b){for(var _=0,w=0;w<b/2;w++){var v=Math.round(d[2*w+1]/b)*8192+Math.round(d[2*w]/b)+_;d[w]=v&67108863,v<67108864?_=0:_=v/67108864|0}return d},A.prototype.convert13b=function(d,b,_,w){for(var v=0,I=0;I<b;I++)v=v+(d[I]|0),_[2*I]=v&8191,v=v>>>13,_[2*I+1]=v&8191,v=v>>>13;for(I=2*b;I<w;++I)_[I]=0;i(v===0),i((v&-8192)===0)},A.prototype.stub=function(d){for(var b=new Array(d),_=0;_<d;_++)b[_]=0;return b},A.prototype.mulp=function(d,b,_){var w=2*this.guessLen13b(d.length,b.length),v=this.makeRBT(w),I=this.stub(w),P=new Array(w),E=new Array(w),p=new Array(w),N=new Array(w),q=new Array(w),H=new Array(w),z=_.words;z.length=w,this.convert13b(d.words,d.length,P,w),this.convert13b(b.words,b.length,N,w),this.transform(P,I,E,p,w,v),this.transform(N,I,q,H,w,v);for(var V=0;V<w;V++){var Y=E[V]*q[V]-p[V]*H[V];p[V]=E[V]*H[V]+p[V]*q[V],E[V]=Y}return this.conjugate(E,p,w),this.transform(E,p,z,I,w,v),this.conjugate(z,I,w),this.normalize13b(z,w),_.negative=d.negative^b.negative,_.length=d.length+b.length,_.strip()},n.prototype.mul=function(d){var b=new n(null);return b.words=new Array(this.length+d.length),this.mulTo(d,b)},n.prototype.mulf=function(d){var b=new n(null);return b.words=new Array(this.length+d.length),S(this,d,b)},n.prototype.imul=function(d){return this.clone().mulTo(d,this)},n.prototype.imuln=function(d){i(typeof d=="number"),i(d<67108864);for(var b=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,v=(w&67108863)+(b&67108863);b>>=26,b+=w/67108864|0,b+=v>>>26,this.words[_]=v&67108863}return b!==0&&(this.words[_]=b,this.length++),this.length=d===0?1:this.length,this},n.prototype.muln=function(d){return this.clone().imuln(d)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(d){var b=m(d);if(b.length===0)return new n(1);for(var _=this,w=0;w<b.length&&b[w]===0;w++,_=_.sqr());if(++w<b.length)for(var v=_.sqr();w<b.length;w++,v=v.sqr())b[w]!==0&&(_=_.mul(v));return _},n.prototype.iushln=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26,w=67108863>>>26-b<<26-b,v;if(b!==0){var I=0;for(v=0;v<this.length;v++){var P=this.words[v]&w,E=(this.words[v]|0)-P<<b;this.words[v]=E|I,I=P>>>26-b}I&&(this.words[v]=I,this.length++)}if(_!==0){for(v=this.length-1;v>=0;v--)this.words[v+_]=this.words[v];for(v=0;v<_;v++)this.words[v]=0;this.length+=_}return this.strip()},n.prototype.ishln=function(d){return i(this.negative===0),this.iushln(d)},n.prototype.iushrn=function(d,b,_){i(typeof d=="number"&&d>=0);var w;b?w=(b-b%26)/26:w=0;var v=d%26,I=Math.min((d-v)/26,this.length),P=67108863^67108863>>>v<<v,E=_;if(w-=I,w=Math.max(0,w),E){for(var p=0;p<I;p++)E.words[p]=this.words[p];E.length=I}if(I!==0)if(this.length>I)for(this.length-=I,p=0;p<this.length;p++)this.words[p]=this.words[p+I];else this.words[0]=0,this.length=1;var N=0;for(p=this.length-1;p>=0&&(N!==0||p>=w);p--){var q=this.words[p]|0;this.words[p]=N<<26-v|q>>>v,N=q&P}return E&&N!==0&&(E.words[E.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(d,b,_){return i(this.negative===0),this.iushrn(d,b,_)},n.prototype.shln=function(d){return this.clone().ishln(d)},n.prototype.ushln=function(d){return this.clone().iushln(d)},n.prototype.shrn=function(d){return this.clone().ishrn(d)},n.prototype.ushrn=function(d){return this.clone().iushrn(d)},n.prototype.testn=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26,w=1<<b;if(this.length<=_)return!1;var v=this.words[_];return!!(v&w)},n.prototype.imaskn=function(d){i(typeof d=="number"&&d>=0);var b=d%26,_=(d-b)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(b!==0&&_++,this.length=Math.min(_,this.length),b!==0){var w=67108863^67108863>>>b<<b;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(d){return this.clone().imaskn(d)},n.prototype.iaddn=function(d){return i(typeof d=="number"),i(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},n.prototype._iaddn=function(d){this.words[0]+=d;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},n.prototype.isubn=function(d){if(i(typeof d=="number"),i(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},n.prototype.addn=function(d){return this.clone().iaddn(d)},n.prototype.subn=function(d){return this.clone().isubn(d)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(d,b,_){var w=d.length+_,v;this._expand(w);var I,P=0;for(v=0;v<d.length;v++){I=(this.words[v+_]|0)+P;var E=(d.words[v]|0)*b;I-=E&67108863,P=(I>>26)-(E/67108864|0),this.words[v+_]=I&67108863}for(;v<this.length-_;v++)I=(this.words[v+_]|0)+P,P=I>>26,this.words[v+_]=I&67108863;if(P===0)return this.strip();for(i(P===-1),P=0,v=0;v<this.length;v++)I=-(this.words[v]|0)+P,P=I>>26,this.words[v]=I&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(d,b){var _=this.length-d.length,w=this.clone(),v=d,I=v.words[v.length-1]|0,P=this._countBits(I);_=26-P,_!==0&&(v=v.ushln(_),w.iushln(_),I=v.words[v.length-1]|0);var E=w.length-v.length,p;if(b!=="mod"){p=new n(null),p.length=E+1,p.words=new Array(p.length);for(var N=0;N<p.length;N++)p.words[N]=0}var q=w.clone()._ishlnsubmul(v,1,E);q.negative===0&&(w=q,p&&(p.words[E]=1));for(var H=E-1;H>=0;H--){var z=(w.words[v.length+H]|0)*67108864+(w.words[v.length+H-1]|0);for(z=Math.min(z/I|0,67108863),w._ishlnsubmul(v,z,H);w.negative!==0;)z--,w.negative=0,w._ishlnsubmul(v,1,H),w.isZero()||(w.negative^=1);p&&(p.words[H]=z)}return p&&p.strip(),w.strip(),b!=="div"&&_!==0&&w.iushrn(_),{div:p||null,mod:w}},n.prototype.divmod=function(d,b,_){if(i(!d.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var w,v,I;return this.negative!==0&&d.negative===0?(I=this.neg().divmod(d,b),b!=="mod"&&(w=I.div.neg()),b!=="div"&&(v=I.mod.neg(),_&&v.negative!==0&&v.iadd(d)),{div:w,mod:v}):this.negative===0&&d.negative!==0?(I=this.divmod(d.neg(),b),b!=="mod"&&(w=I.div.neg()),{div:w,mod:I.mod}):(this.negative&d.negative)!==0?(I=this.neg().divmod(d.neg(),b),b!=="div"&&(v=I.mod.neg(),_&&v.negative!==0&&v.isub(d)),{div:I.div,mod:v}):d.length>this.length||this.cmp(d)<0?{div:new n(0),mod:this}:d.length===1?b==="div"?{div:this.divn(d.words[0]),mod:null}:b==="mod"?{div:null,mod:new n(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new n(this.modn(d.words[0]))}:this._wordDiv(d,b)},n.prototype.div=function(d){return this.divmod(d,"div",!1).div},n.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},n.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},n.prototype.divRound=function(d){var b=this.divmod(d);if(b.mod.isZero())return b.div;var _=b.div.negative!==0?b.mod.isub(d):b.mod,w=d.ushrn(1),v=d.andln(1),I=_.cmp(w);return I<0||v===1&&I===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},n.prototype.modn=function(d){i(d<=67108863);for(var b=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(b*_+(this.words[w]|0))%d;return _},n.prototype.idivn=function(d){i(d<=67108863);for(var b=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+b*67108864;this.words[_]=w/d|0,b=w%d}return this.strip()},n.prototype.divn=function(d){return this.clone().idivn(d)},n.prototype.egcd=function(d){i(d.negative===0),i(!d.isZero());var b=this,_=d.clone();b.negative!==0?b=b.umod(d):b=b.clone();for(var w=new n(1),v=new n(0),I=new n(0),P=new n(1),E=0;b.isEven()&&_.isEven();)b.iushrn(1),_.iushrn(1),++E;for(var p=_.clone(),N=b.clone();!b.isZero();){for(var q=0,H=1;(b.words[0]&H)===0&&q<26;++q,H<<=1);if(q>0)for(b.iushrn(q);q-- >0;)(w.isOdd()||v.isOdd())&&(w.iadd(p),v.isub(N)),w.iushrn(1),v.iushrn(1);for(var z=0,V=1;(_.words[0]&V)===0&&z<26;++z,V<<=1);if(z>0)for(_.iushrn(z);z-- >0;)(I.isOdd()||P.isOdd())&&(I.iadd(p),P.isub(N)),I.iushrn(1),P.iushrn(1);b.cmp(_)>=0?(b.isub(_),w.isub(I),v.isub(P)):(_.isub(b),I.isub(w),P.isub(v))}return{a:I,b:P,gcd:_.iushln(E)}},n.prototype._invmp=function(d){i(d.negative===0),i(!d.isZero());var b=this,_=d.clone();b.negative!==0?b=b.umod(d):b=b.clone();for(var w=new n(1),v=new n(0),I=_.clone();b.cmpn(1)>0&&_.cmpn(1)>0;){for(var P=0,E=1;(b.words[0]&E)===0&&P<26;++P,E<<=1);if(P>0)for(b.iushrn(P);P-- >0;)w.isOdd()&&w.iadd(I),w.iushrn(1);for(var p=0,N=1;(_.words[0]&N)===0&&p<26;++p,N<<=1);if(p>0)for(_.iushrn(p);p-- >0;)v.isOdd()&&v.iadd(I),v.iushrn(1);b.cmp(_)>=0?(b.isub(_),w.isub(v)):(_.isub(b),v.isub(w))}var q;return b.cmpn(1)===0?q=w:q=v,q.cmpn(0)<0&&q.iadd(d),q},n.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var b=this.clone(),_=d.clone();b.negative=0,_.negative=0;for(var w=0;b.isEven()&&_.isEven();w++)b.iushrn(1),_.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;_.isEven();)_.iushrn(1);var v=b.cmp(_);if(v<0){var I=b;b=_,_=I}else if(v===0||_.cmpn(1)===0)break;b.isub(_)}while(!0);return _.iushln(w)},n.prototype.invm=function(d){return this.egcd(d).a.umod(d)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(d){return this.words[0]&d},n.prototype.bincn=function(d){i(typeof d=="number");var b=d%26,_=(d-b)/26,w=1<<b;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var v=w,I=_;v!==0&&I<this.length;I++){var P=this.words[I]|0;P+=v,v=P>>>26,P&=67108863,this.words[I]=P}return v!==0&&(this.words[I]=v,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(d){var b=d<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this.strip();var _;if(this.length>1)_=1;else{b&&(d=-d),i(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},n.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var b=this.ucmp(d);return this.negative!==0?-b|0:b},n.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var b=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,v=d.words[_]|0;if(w!==v){w<v?b=-1:w>v&&(b=1);break}}return b},n.prototype.gtn=function(d){return this.cmpn(d)===1},n.prototype.gt=function(d){return this.cmp(d)===1},n.prototype.gten=function(d){return this.cmpn(d)>=0},n.prototype.gte=function(d){return this.cmp(d)>=0},n.prototype.ltn=function(d){return this.cmpn(d)===-1},n.prototype.lt=function(d){return this.cmp(d)===-1},n.prototype.lten=function(d){return this.cmpn(d)<=0},n.prototype.lte=function(d){return this.cmp(d)<=0},n.prototype.eqn=function(d){return this.cmpn(d)===0},n.prototype.eq=function(d){return this.cmp(d)===0},n.red=function(d){return new R(d)},n.prototype.toRed=function(d){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(d){return this.red=d,this},n.prototype.forceRed=function(d){return i(!this.red,"Already a number in reduction context"),this._forceRed(d)},n.prototype.redAdd=function(d){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},n.prototype.redIAdd=function(d){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},n.prototype.redSub=function(d){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},n.prototype.redISub=function(d){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},n.prototype.redShl=function(d){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},n.prototype.redMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},n.prototype.redIMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(d){return i(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var D={k256:null,p224:null,p192:null,p25519:null};function O($,d){this.name=$,this.p=new n(d,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var d=new n(null);return d.words=new Array(Math.ceil(this.n/13)),d},O.prototype.ireduce=function(d){var b=d,_;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),_=b.bitLength();while(_>this.n);var w=_<this.n?-1:b.ucmp(this.p);return w===0?(b.words[0]=0,b.length=1):w>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},O.prototype.split=function(d,b){d.iushrn(this.n,0,b)},O.prototype.imulK=function(d){return d.imul(this.k)};function T(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(T,O),T.prototype.split=function(d,b){for(var _=4194303,w=Math.min(d.length,9),v=0;v<w;v++)b.words[v]=d.words[v];if(b.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var I=d.words[9];for(b.words[b.length++]=I&_,v=10;v<d.length;v++){var P=d.words[v]|0;d.words[v-10]=(P&_)<<4|I>>>22,I=P}I>>>=22,d.words[v-10]=I,I===0&&d.length>10?d.length-=10:d.length-=9},T.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var b=0,_=0;_<d.length;_++){var w=d.words[_]|0;b+=w*977,d.words[_]=b&67108863,b=w*64+(b/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function x(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(x,O);function M(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(M,O);function U(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(U,O),U.prototype.imulK=function(d){for(var b=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+b,v=w&67108863;w>>>=26,d.words[_]=v,b=w}return b!==0&&(d.words[d.length++]=b),d},n._prime=function(d){if(D[d])return D[d];var b;if(d==="k256")b=new T;else if(d==="p224")b=new x;else if(d==="p192")b=new M;else if(d==="p25519")b=new U;else throw new Error("Unknown prime "+d);return D[d]=b,b};function R($){if(typeof $=="string"){var d=n._prime($);this.m=d.p,this.prime=d}else i($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}R.prototype._verify1=function(d){i(d.negative===0,"red works only with positives"),i(d.red,"red works only with red numbers")},R.prototype._verify2=function(d,b){i((d.negative|b.negative)===0,"red works only with positives"),i(d.red&&d.red===b.red,"red works only with red numbers")},R.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},R.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},R.prototype.add=function(d,b){this._verify2(d,b);var _=d.add(b);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},R.prototype.iadd=function(d,b){this._verify2(d,b);var _=d.iadd(b);return _.cmp(this.m)>=0&&_.isub(this.m),_},R.prototype.sub=function(d,b){this._verify2(d,b);var _=d.sub(b);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},R.prototype.isub=function(d,b){this._verify2(d,b);var _=d.isub(b);return _.cmpn(0)<0&&_.iadd(this.m),_},R.prototype.shl=function(d,b){return this._verify1(d),this.imod(d.ushln(b))},R.prototype.imul=function(d,b){return this._verify2(d,b),this.imod(d.imul(b))},R.prototype.mul=function(d,b){return this._verify2(d,b),this.imod(d.mul(b))},R.prototype.isqr=function(d){return this.imul(d,d.clone())},R.prototype.sqr=function(d){return this.mul(d,d)},R.prototype.sqrt=function(d){if(d.isZero())return d.clone();var b=this.m.andln(3);if(i(b%2===1),b===3){var _=this.m.add(new n(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),v=0;!w.isZero()&&w.andln(1)===0;)v++,w.iushrn(1);i(!w.isZero());var I=new n(1).toRed(this),P=I.redNeg(),E=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);this.pow(p,E).cmp(P)!==0;)p.redIAdd(P);for(var N=this.pow(p,w),q=this.pow(d,w.addn(1).iushrn(1)),H=this.pow(d,w),z=v;H.cmp(I)!==0;){for(var V=H,Y=0;V.cmp(I)!==0;Y++)V=V.redSqr();i(Y<z);var te=this.pow(N,new n(1).iushln(z-Y-1));q=q.redMul(te),N=te.redSqr(),H=H.redMul(N),z=Y}return q},R.prototype.invm=function(d){var b=d._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},R.prototype.pow=function(d,b){if(b.isZero())return new n(1).toRed(this);if(b.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new n(1).toRed(this),w[1]=d;for(var v=2;v<w.length;v++)w[v]=this.mul(w[v-1],d);var I=w[0],P=0,E=0,p=b.bitLength()%26;for(p===0&&(p=26),v=b.length-1;v>=0;v--){for(var N=b.words[v],q=p-1;q>=0;q--){var H=N>>q&1;if(I!==w[0]&&(I=this.sqr(I)),H===0&&P===0){E=0;continue}P<<=1,P|=H,E++,!(E!==_&&(v!==0||q!==0))&&(I=this.mul(I,w[P]),E=0,P=0)}p=26}return I},R.prototype.convertTo=function(d){var b=d.umod(this.m);return b===d?b.clone():b},R.prototype.convertFrom=function(d){var b=d.clone();return b.red=null,b},n.mont=function(d){return new L(d)};function L($){R.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(L,R),L.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},L.prototype.convertFrom=function(d){var b=this.imod(d.mul(this.rinv));return b.red=null,b},L.prototype.imul=function(d,b){if(d.isZero()||b.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(b),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=_.isub(w).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},L.prototype.mul=function(d,b){if(d.isZero()||b.isZero())return new n(0)._forceRed(this);var _=d.mul(b),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=_.isub(w).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},L.prototype.invm=function(d){var b=this.imod(d._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(t,BS)})(kl)),kl.exports}var wd,db;function Gn(){if(db)return wd;db=1,wd=t;function t(e,r){if(!e)throw new Error(r||"Assertion failed")}return t.equal=function(r,i,s){if(r!=i)throw new Error(s||"Assertion failed: "+r+" != "+i)},wd}var vd={},fb;function e2(){return fb||(fb=1,(function(t){var e=t;function r(n,o){if(Array.isArray(n))return n.slice();if(!n)return[];var a=[];if(typeof n!="string"){for(var u=0;u<n.length;u++)a[u]=n[u]|0;return a}if(o==="hex"){n=n.replace(/[^a-z0-9]+/ig,""),n.length%2!==0&&(n="0"+n);for(var u=0;u<n.length;u+=2)a.push(parseInt(n[u]+n[u+1],16))}else for(var u=0;u<n.length;u++){var c=n.charCodeAt(u),l=c>>8,h=c&255;l?a.push(l,h):a.push(h)}return a}e.toArray=r;function i(n){return n.length===1?"0"+n:n}e.zero2=i;function s(n){for(var o="",a=0;a<n.length;a++)o+=i(n[a].toString(16));return o}e.toHex=s,e.encode=function(o,a){return a==="hex"?s(o):o}})(vd)),vd}var pb;function xi(){return pb||(pb=1,(function(t){var e=t,r=Ds(),i=Gn(),s=e2();e.assert=i,e.toArray=s.toArray,e.zero2=s.zero2,e.toHex=s.toHex,e.encode=s.encode;function n(l,h,f){var m=new Array(Math.max(l.bitLength(),f)+1),g;for(g=0;g<m.length;g+=1)m[g]=0;var y=1<<h+1,C=l.clone();for(g=0;g<m.length;g++){var S,A=C.andln(y-1);C.isOdd()?(A>(y>>1)-1?S=(y>>1)-A:S=A,C.isubn(S)):S=0,m[g]=S,C.iushrn(1)}return m}e.getNAF=n;function o(l,h){var f=[[],[]];l=l.clone(),h=h.clone();for(var m=0,g=0,y;l.cmpn(-m)>0||h.cmpn(-g)>0;){var C=l.andln(3)+m&3,S=h.andln(3)+g&3;C===3&&(C=-1),S===3&&(S=-1);var A;(C&1)===0?A=0:(y=l.andln(7)+m&7,(y===3||y===5)&&S===2?A=-C:A=C),f[0].push(A);var D;(S&1)===0?D=0:(y=h.andln(7)+g&7,(y===3||y===5)&&C===2?D=-S:D=S),f[1].push(D),2*m===A+1&&(m=1-m),2*g===D+1&&(g=1-g),l.iushrn(1),h.iushrn(1)}return f}e.getJSF=o;function a(l,h,f){var m="_"+h;l.prototype[h]=function(){return this[m]!==void 0?this[m]:this[m]=f.call(this)}}e.cachedProperty=a;function u(l){return typeof l=="string"?e.toArray(l,"hex"):l}e.parseBytes=u;function c(l){return new r(l,"hex","le")}e.intFromLE=c})(yd)),yd}var nl={exports:{}},gb;function t2(){if(gb)return nl.exports;gb=1;var t;nl.exports=function(s){return t||(t=new e(null)),t.generate(s)};function e(i){this.rand=i}if(nl.exports.Rand=e,e.prototype.generate=function(s){return this._rand(s)},e.prototype._rand=function(s){if(this.rand.getBytes)return this.rand.getBytes(s);for(var n=new Uint8Array(s),o=0;o<n.length;o++)n[o]=this.rand.getByte();return n},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(s){var n=new Uint8Array(s);return self.crypto.getRandomValues(n),n}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(s){var n=new Uint8Array(s);return self.msCrypto.getRandomValues(n),n}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=Jv;if(typeof r.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(s){return r.randomBytes(s)}}catch{}return nl.exports}var _d={},Ed,bb;function $h(){if(bb)return Ed;bb=1;var t=Ds(),e=xi(),r=e.getNAF,i=e.getJSF,s=e.assert;function n(a,u){this.type=a,this.p=new t(u.p,16),this.red=u.prime?t.red(u.prime):t.mont(this.p),this.zero=new t(0).toRed(this.red),this.one=new t(1).toRed(this.red),this.two=new t(2).toRed(this.red),this.n=u.n&&new t(u.n,16),this.g=u.g&&this.pointFromJSON(u.g,u.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Ed=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(u,c){s(u.precomputed);var l=u._getDoubles(),h=r(c,1,this._bitLength),f=(1<<l.step+1)-(l.step%2===0?2:1);f/=3;var m=[],g,y;for(g=0;g<h.length;g+=l.step){y=0;for(var C=g+l.step-1;C>=g;C--)y=(y<<1)+h[C];m.push(y)}for(var S=this.jpoint(null,null,null),A=this.jpoint(null,null,null),D=f;D>0;D--){for(g=0;g<m.length;g++)y=m[g],y===D?A=A.mixedAdd(l.points[g]):y===-D&&(A=A.mixedAdd(l.points[g].neg()));S=S.add(A)}return S.toP()},n.prototype._wnafMul=function(u,c){var l=4,h=u._getNAFPoints(l);l=h.wnd;for(var f=h.points,m=r(c,l,this._bitLength),g=this.jpoint(null,null,null),y=m.length-1;y>=0;y--){for(var C=0;y>=0&&m[y]===0;y--)C++;if(y>=0&&C++,g=g.dblp(C),y<0)break;var S=m[y];s(S!==0),u.type==="affine"?S>0?g=g.mixedAdd(f[S-1>>1]):g=g.mixedAdd(f[-S-1>>1].neg()):S>0?g=g.add(f[S-1>>1]):g=g.add(f[-S-1>>1].neg())}return u.type==="affine"?g.toP():g},n.prototype._wnafMulAdd=function(u,c,l,h,f){var m=this._wnafT1,g=this._wnafT2,y=this._wnafT3,C=0,S,A,D;for(S=0;S<h;S++){D=c[S];var O=D._getNAFPoints(u);m[S]=O.wnd,g[S]=O.points}for(S=h-1;S>=1;S-=2){var T=S-1,x=S;if(m[T]!==1||m[x]!==1){y[T]=r(l[T],m[T],this._bitLength),y[x]=r(l[x],m[x],this._bitLength),C=Math.max(y[T].length,C),C=Math.max(y[x].length,C);continue}var M=[c[T],null,null,c[x]];c[T].y.cmp(c[x].y)===0?(M[1]=c[T].add(c[x]),M[2]=c[T].toJ().mixedAdd(c[x].neg())):c[T].y.cmp(c[x].y.redNeg())===0?(M[1]=c[T].toJ().mixedAdd(c[x]),M[2]=c[T].add(c[x].neg())):(M[1]=c[T].toJ().mixedAdd(c[x]),M[2]=c[T].toJ().mixedAdd(c[x].neg()));var U=[-3,-1,-5,-7,0,7,5,1,3],R=i(l[T],l[x]);for(C=Math.max(R[0].length,C),y[T]=new Array(C),y[x]=new Array(C),A=0;A<C;A++){var L=R[0][A]|0,$=R[1][A]|0;y[T][A]=U[(L+1)*3+($+1)],y[x][A]=0,g[T]=M}}var d=this.jpoint(null,null,null),b=this._wnafT4;for(S=C;S>=0;S--){for(var _=0;S>=0;){var w=!0;for(A=0;A<h;A++)b[A]=y[A][S]|0,b[A]!==0&&(w=!1);if(!w)break;_++,S--}if(S>=0&&_++,d=d.dblp(_),S<0)break;for(A=0;A<h;A++){var v=b[A];v!==0&&(v>0?D=g[A][v-1>>1]:v<0&&(D=g[A][-v-1>>1].neg()),D.type==="affine"?d=d.mixedAdd(D):d=d.add(D))}}for(S=0;S<h;S++)g[S]=null;return f?d:d.toP()};function o(a,u){this.curve=a,this.type=u,this.precomputed=null}return n.BasePoint=o,o.prototype.eq=function(){throw new Error("Not implemented")},o.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(u,c){u=e.toArray(u,c);var l=this.p.byteLength();if((u[0]===4||u[0]===6||u[0]===7)&&u.length-1===2*l){u[0]===6?s(u[u.length-1]%2===0):u[0]===7&&s(u[u.length-1]%2===1);var h=this.point(u.slice(1,1+l),u.slice(1+l,1+2*l));return h}else if((u[0]===2||u[0]===3)&&u.length-1===l)return this.pointFromX(u.slice(1,1+l),u[0]===3);throw new Error("Unknown point format")},o.prototype.encodeCompressed=function(u){return this.encode(u,!0)},o.prototype._encode=function(u){var c=this.curve.p.byteLength(),l=this.getX().toArray("be",c);return u?[this.getY().isEven()?2:3].concat(l):[4].concat(l,this.getY().toArray("be",c))},o.prototype.encode=function(u,c){return e.encode(this._encode(c),u)},o.prototype.precompute=function(u){if(this.precomputed)return this;var c={doubles:null,naf:null,beta:null};return c.naf=this._getNAFPoints(8),c.doubles=this._getDoubles(4,u),c.beta=this._getBeta(),this.precomputed=c,this},o.prototype._hasDoubles=function(u){if(!this.precomputed)return!1;var c=this.precomputed.doubles;return c?c.points.length>=Math.ceil((u.bitLength()+1)/c.step):!1},o.prototype._getDoubles=function(u,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var l=[this],h=this,f=0;f<c;f+=u){for(var m=0;m<u;m++)h=h.dbl();l.push(h)}return{step:u,points:l}},o.prototype._getNAFPoints=function(u){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var c=[this],l=(1<<u)-1,h=l===1?null:this.dbl(),f=1;f<l;f++)c[f]=c[f-1].add(h);return{wnd:u,points:c}},o.prototype._getBeta=function(){return null},o.prototype.dblp=function(u){for(var c=this,l=0;l<u;l++)c=c.dbl();return c},Ed}var ol={exports:{}},mb;function xh(){return mb||(mb=1,typeof Object.create=="function"?ol.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ol.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}),ol.exports}var Id,yb;function zS(){if(yb)return Id;yb=1;var t=xi(),e=Ds(),r=xh(),i=$h(),s=t.assert;function n(u){i.call(this,"short",u),this.a=new e(u.a,16).toRed(this.red),this.b=new e(u.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(u),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r(n,i),Id=n,n.prototype._getEndomorphism=function(c){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var l,h;if(c.beta)l=new e(c.beta,16).toRed(this.red);else{var f=this._getEndoRoots(this.p);l=f[0].cmp(f[1])<0?f[0]:f[1],l=l.toRed(this.red)}if(c.lambda)h=new e(c.lambda,16);else{var m=this._getEndoRoots(this.n);this.g.mul(m[0]).x.cmp(this.g.x.redMul(l))===0?h=m[0]:(h=m[1],s(this.g.mul(h).x.cmp(this.g.x.redMul(l))===0))}var g;return c.basis?g=c.basis.map(function(y){return{a:new e(y.a,16),b:new e(y.b,16)}}):g=this._getEndoBasis(h),{beta:l,lambda:h,basis:g}}},n.prototype._getEndoRoots=function(c){var l=c===this.p?this.red:e.mont(c),h=new e(2).toRed(l).redInvm(),f=h.redNeg(),m=new e(3).toRed(l).redNeg().redSqrt().redMul(h),g=f.redAdd(m).fromRed(),y=f.redSub(m).fromRed();return[g,y]},n.prototype._getEndoBasis=function(c){for(var l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=c,f=this.n.clone(),m=new e(1),g=new e(0),y=new e(0),C=new e(1),S,A,D,O,T,x,M,U=0,R,L;h.cmpn(0)!==0;){var $=f.div(h);R=f.sub($.mul(h)),L=y.sub($.mul(m));var d=C.sub($.mul(g));if(!D&&R.cmp(l)<0)S=M.neg(),A=m,D=R.neg(),O=L;else if(D&&++U===2)break;M=R,f=h,h=R,y=m,m=L,C=g,g=d}T=R.neg(),x=L;var b=D.sqr().add(O.sqr()),_=T.sqr().add(x.sqr());return _.cmp(b)>=0&&(T=S,x=A),D.negative&&(D=D.neg(),O=O.neg()),T.negative&&(T=T.neg(),x=x.neg()),[{a:D,b:O},{a:T,b:x}]},n.prototype._endoSplit=function(c){var l=this.endo.basis,h=l[0],f=l[1],m=f.b.mul(c).divRound(this.n),g=h.b.neg().mul(c).divRound(this.n),y=m.mul(h.a),C=g.mul(f.a),S=m.mul(h.b),A=g.mul(f.b),D=c.sub(y).sub(C),O=S.add(A).neg();return{k1:D,k2:O}},n.prototype.pointFromX=function(c,l){c=new e(c,16),c.red||(c=c.toRed(this.red));var h=c.redSqr().redMul(c).redIAdd(c.redMul(this.a)).redIAdd(this.b),f=h.redSqrt();if(f.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var m=f.fromRed().isOdd();return(l&&!m||!l&&m)&&(f=f.redNeg()),this.point(c,f)},n.prototype.validate=function(c){if(c.inf)return!0;var l=c.x,h=c.y,f=this.a.redMul(l),m=l.redSqr().redMul(l).redIAdd(f).redIAdd(this.b);return h.redSqr().redISub(m).cmpn(0)===0},n.prototype._endoWnafMulAdd=function(c,l,h){for(var f=this._endoWnafT1,m=this._endoWnafT2,g=0;g<c.length;g++){var y=this._endoSplit(l[g]),C=c[g],S=C._getBeta();y.k1.negative&&(y.k1.ineg(),C=C.neg(!0)),y.k2.negative&&(y.k2.ineg(),S=S.neg(!0)),f[g*2]=C,f[g*2+1]=S,m[g*2]=y.k1,m[g*2+1]=y.k2}for(var A=this._wnafMulAdd(1,f,m,g*2,h),D=0;D<g*2;D++)f[D]=null,m[D]=null;return A};function o(u,c,l,h){i.BasePoint.call(this,u,"affine"),c===null&&l===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(c,16),this.y=new e(l,16),h&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}r(o,i.BasePoint),n.prototype.point=function(c,l,h){return new o(this,c,l,h)},n.prototype.pointFromJSON=function(c,l){return o.fromJSON(this,c,l)},o.prototype._getBeta=function(){if(this.curve.endo){var c=this.precomputed;if(c&&c.beta)return c.beta;var l=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(c){var h=this.curve,f=function(m){return h.point(m.x.redMul(h.endo.beta),m.y)};c.beta=l,l.precomputed={beta:null,naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(f)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(f)}}}return l}},o.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},o.fromJSON=function(c,l,h){typeof l=="string"&&(l=JSON.parse(l));var f=c.point(l[0],l[1],h);if(!l[2])return f;function m(y){return c.point(y[0],y[1],h)}var g=l[2];return f.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[f].concat(g.doubles.points.map(m))},naf:g.naf&&{wnd:g.naf.wnd,points:[f].concat(g.naf.points.map(m))}},f},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return this.inf},o.prototype.add=function(c){if(this.inf)return c;if(c.inf)return this;if(this.eq(c))return this.dbl();if(this.neg().eq(c))return this.curve.point(null,null);if(this.x.cmp(c.x)===0)return this.curve.point(null,null);var l=this.y.redSub(c.y);l.cmpn(0)!==0&&(l=l.redMul(this.x.redSub(c.x).redInvm()));var h=l.redSqr().redISub(this.x).redISub(c.x),f=l.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,f)},o.prototype.dbl=function(){if(this.inf)return this;var c=this.y.redAdd(this.y);if(c.cmpn(0)===0)return this.curve.point(null,null);var l=this.curve.a,h=this.x.redSqr(),f=c.redInvm(),m=h.redAdd(h).redIAdd(h).redIAdd(l).redMul(f),g=m.redSqr().redISub(this.x.redAdd(this.x)),y=m.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)},o.prototype.getX=function(){return this.x.fromRed()},o.prototype.getY=function(){return this.y.fromRed()},o.prototype.mul=function(c){return c=new e(c,16),this.isInfinity()?this:this._hasDoubles(c)?this.curve._fixedNafMul(this,c):this.curve.endo?this.curve._endoWnafMulAdd([this],[c]):this.curve._wnafMul(this,c)},o.prototype.mulAdd=function(c,l,h){var f=[this,l],m=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(f,m):this.curve._wnafMulAdd(1,f,m,2)},o.prototype.jmulAdd=function(c,l,h){var f=[this,l],m=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(f,m,!0):this.curve._wnafMulAdd(1,f,m,2,!0)},o.prototype.eq=function(c){return this===c||this.inf===c.inf&&(this.inf||this.x.cmp(c.x)===0&&this.y.cmp(c.y)===0)},o.prototype.neg=function(c){if(this.inf)return this;var l=this.curve.point(this.x,this.y.redNeg());if(c&&this.precomputed){var h=this.precomputed,f=function(m){return m.neg()};l.precomputed={naf:h.naf&&{wnd:h.naf.wnd,points:h.naf.points.map(f)},doubles:h.doubles&&{step:h.doubles.step,points:h.doubles.points.map(f)}}}return l},o.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var c=this.curve.jpoint(this.x,this.y,this.curve.one);return c};function a(u,c,l,h){i.BasePoint.call(this,u,"jacobian"),c===null&&l===null&&h===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(c,16),this.y=new e(l,16),this.z=new e(h,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(a,i.BasePoint),n.prototype.jpoint=function(c,l,h){return new a(this,c,l,h)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var c=this.z.redInvm(),l=c.redSqr(),h=this.x.redMul(l),f=this.y.redMul(l).redMul(c);return this.curve.point(h,f)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(c){if(this.isInfinity())return c;if(c.isInfinity())return this;var l=c.z.redSqr(),h=this.z.redSqr(),f=this.x.redMul(l),m=c.x.redMul(h),g=this.y.redMul(l.redMul(c.z)),y=c.y.redMul(h.redMul(this.z)),C=f.redSub(m),S=g.redSub(y);if(C.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var A=C.redSqr(),D=A.redMul(C),O=f.redMul(A),T=S.redSqr().redIAdd(D).redISub(O).redISub(O),x=S.redMul(O.redISub(T)).redISub(g.redMul(D)),M=this.z.redMul(c.z).redMul(C);return this.curve.jpoint(T,x,M)},a.prototype.mixedAdd=function(c){if(this.isInfinity())return c.toJ();if(c.isInfinity())return this;var l=this.z.redSqr(),h=this.x,f=c.x.redMul(l),m=this.y,g=c.y.redMul(l).redMul(this.z),y=h.redSub(f),C=m.redSub(g);if(y.cmpn(0)===0)return C.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=y.redSqr(),A=S.redMul(y),D=h.redMul(S),O=C.redSqr().redIAdd(A).redISub(D).redISub(D),T=C.redMul(D.redISub(O)).redISub(m.redMul(A)),x=this.z.redMul(y);return this.curve.jpoint(O,T,x)},a.prototype.dblp=function(c){if(c===0)return this;if(this.isInfinity())return this;if(!c)return this.dbl();var l;if(this.curve.zeroA||this.curve.threeA){var h=this;for(l=0;l<c;l++)h=h.dbl();return h}var f=this.curve.a,m=this.curve.tinv,g=this.x,y=this.y,C=this.z,S=C.redSqr().redSqr(),A=y.redAdd(y);for(l=0;l<c;l++){var D=g.redSqr(),O=A.redSqr(),T=O.redSqr(),x=D.redAdd(D).redIAdd(D).redIAdd(f.redMul(S)),M=g.redMul(O),U=x.redSqr().redISub(M.redAdd(M)),R=M.redISub(U),L=x.redMul(R);L=L.redIAdd(L).redISub(T);var $=A.redMul(C);l+1<c&&(S=S.redMul(T)),g=U,C=$,A=L}return this.curve.jpoint(g,A.redMul(m),C)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var c,l,h;if(this.zOne){var f=this.x.redSqr(),m=this.y.redSqr(),g=m.redSqr(),y=this.x.redAdd(m).redSqr().redISub(f).redISub(g);y=y.redIAdd(y);var C=f.redAdd(f).redIAdd(f),S=C.redSqr().redISub(y).redISub(y),A=g.redIAdd(g);A=A.redIAdd(A),A=A.redIAdd(A),c=S,l=C.redMul(y.redISub(S)).redISub(A),h=this.y.redAdd(this.y)}else{var D=this.x.redSqr(),O=this.y.redSqr(),T=O.redSqr(),x=this.x.redAdd(O).redSqr().redISub(D).redISub(T);x=x.redIAdd(x);var M=D.redAdd(D).redIAdd(D),U=M.redSqr(),R=T.redIAdd(T);R=R.redIAdd(R),R=R.redIAdd(R),c=U.redISub(x).redISub(x),l=M.redMul(x.redISub(c)).redISub(R),h=this.y.redMul(this.z),h=h.redIAdd(h)}return this.curve.jpoint(c,l,h)},a.prototype._threeDbl=function(){var c,l,h;if(this.zOne){var f=this.x.redSqr(),m=this.y.redSqr(),g=m.redSqr(),y=this.x.redAdd(m).redSqr().redISub(f).redISub(g);y=y.redIAdd(y);var C=f.redAdd(f).redIAdd(f).redIAdd(this.curve.a),S=C.redSqr().redISub(y).redISub(y);c=S;var A=g.redIAdd(g);A=A.redIAdd(A),A=A.redIAdd(A),l=C.redMul(y.redISub(S)).redISub(A),h=this.y.redAdd(this.y)}else{var D=this.z.redSqr(),O=this.y.redSqr(),T=this.x.redMul(O),x=this.x.redSub(D).redMul(this.x.redAdd(D));x=x.redAdd(x).redIAdd(x);var M=T.redIAdd(T);M=M.redIAdd(M);var U=M.redAdd(M);c=x.redSqr().redISub(U),h=this.y.redAdd(this.z).redSqr().redISub(O).redISub(D);var R=O.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R),l=x.redMul(M.redISub(c)).redISub(R)}return this.curve.jpoint(c,l,h)},a.prototype._dbl=function(){var c=this.curve.a,l=this.x,h=this.y,f=this.z,m=f.redSqr().redSqr(),g=l.redSqr(),y=h.redSqr(),C=g.redAdd(g).redIAdd(g).redIAdd(c.redMul(m)),S=l.redAdd(l);S=S.redIAdd(S);var A=S.redMul(y),D=C.redSqr().redISub(A.redAdd(A)),O=A.redISub(D),T=y.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T);var x=C.redMul(O).redISub(T),M=h.redAdd(h).redMul(f);return this.curve.jpoint(D,x,M)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var c=this.x.redSqr(),l=this.y.redSqr(),h=this.z.redSqr(),f=l.redSqr(),m=c.redAdd(c).redIAdd(c),g=m.redSqr(),y=this.x.redAdd(l).redSqr().redISub(c).redISub(f);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var C=y.redSqr(),S=f.redIAdd(f);S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var A=m.redIAdd(y).redSqr().redISub(g).redISub(C).redISub(S),D=l.redMul(A);D=D.redIAdd(D),D=D.redIAdd(D);var O=this.x.redMul(C).redISub(D);O=O.redIAdd(O),O=O.redIAdd(O);var T=this.y.redMul(A.redMul(S.redISub(A)).redISub(y.redMul(C)));T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T);var x=this.z.redAdd(y).redSqr().redISub(h).redISub(C);return this.curve.jpoint(O,T,x)},a.prototype.mul=function(c,l){return c=new e(c,l),this.curve._wnafMul(this,c)},a.prototype.eq=function(c){if(c.type==="affine")return this.eq(c.toJ());if(this===c)return!0;var l=this.z.redSqr(),h=c.z.redSqr();if(this.x.redMul(h).redISub(c.x.redMul(l)).cmpn(0)!==0)return!1;var f=l.redMul(this.z),m=h.redMul(c.z);return this.y.redMul(m).redISub(c.y.redMul(f)).cmpn(0)===0},a.prototype.eqXToP=function(c){var l=this.z.redSqr(),h=c.toRed(this.curve.red).redMul(l);if(this.x.cmp(h)===0)return!0;for(var f=c.clone(),m=this.curve.redN.redMul(l);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(h.redIAdd(m),this.x.cmp(h)===0)return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Id}var Ad,wb;function HS(){if(wb)return Ad;wb=1;var t=Ds(),e=xh(),r=$h(),i=xi();function s(o){r.call(this,"mont",o),this.a=new t(o.a,16).toRed(this.red),this.b=new t(o.b,16).toRed(this.red),this.i4=new t(4).toRed(this.red).redInvm(),this.two=new t(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}e(s,r),Ad=s,s.prototype.validate=function(a){var u=a.normalize().x,c=u.redSqr(),l=c.redMul(u).redAdd(c.redMul(this.a)).redAdd(u),h=l.redSqrt();return h.redSqr().cmp(l)===0};function n(o,a,u){r.BasePoint.call(this,o,"projective"),a===null&&u===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new t(a,16),this.z=new t(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(n,r.BasePoint),s.prototype.decodePoint=function(a,u){return this.point(i.toArray(a,u),1)},s.prototype.point=function(a,u){return new n(this,a,u)},s.prototype.pointFromJSON=function(a){return n.fromJSON(this,a)},n.prototype.precompute=function(){},n.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(a,u){return new n(a,u[0],u[1]||a.one)},n.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},n.prototype.isInfinity=function(){return this.z.cmpn(0)===0},n.prototype.dbl=function(){var a=this.x.redAdd(this.z),u=a.redSqr(),c=this.x.redSub(this.z),l=c.redSqr(),h=u.redSub(l),f=u.redMul(l),m=h.redMul(l.redAdd(this.curve.a24.redMul(h)));return this.curve.point(f,m)},n.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.diffAdd=function(a,u){var c=this.x.redAdd(this.z),l=this.x.redSub(this.z),h=a.x.redAdd(a.z),f=a.x.redSub(a.z),m=f.redMul(c),g=h.redMul(l),y=u.z.redMul(m.redAdd(g).redSqr()),C=u.x.redMul(m.redISub(g).redSqr());return this.curve.point(y,C)},n.prototype.mul=function(a){for(var u=a.clone(),c=this,l=this.curve.point(null,null),h=this,f=[];u.cmpn(0)!==0;u.iushrn(1))f.push(u.andln(1));for(var m=f.length-1;m>=0;m--)f[m]===0?(c=c.diffAdd(l,h),l=l.dbl()):(l=c.diffAdd(l,h),c=c.dbl());return l},n.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.eq=function(a){return this.getX().cmp(a.getX())===0},n.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Ad}var Sd,vb;function VS(){if(vb)return Sd;vb=1;var t=xi(),e=Ds(),r=xh(),i=$h(),s=t.assert;function n(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new e(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}r(n,i),Sd=n,n.prototype._mulA=function(u){return this.mOneA?u.redNeg():this.a.redMul(u)},n.prototype._mulC=function(u){return this.oneC?u:this.c.redMul(u)},n.prototype.jpoint=function(u,c,l,h){return this.point(u,c,l,h)},n.prototype.pointFromX=function(u,c){u=new e(u,16),u.red||(u=u.toRed(this.red));var l=u.redSqr(),h=this.c2.redSub(this.a.redMul(l)),f=this.one.redSub(this.c2.redMul(this.d).redMul(l)),m=h.redMul(f.redInvm()),g=m.redSqrt();if(g.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");var y=g.fromRed().isOdd();return(c&&!y||!c&&y)&&(g=g.redNeg()),this.point(u,g)},n.prototype.pointFromY=function(u,c){u=new e(u,16),u.red||(u=u.toRed(this.red));var l=u.redSqr(),h=l.redSub(this.c2),f=l.redMul(this.d).redMul(this.c2).redSub(this.a),m=h.redMul(f.redInvm());if(m.cmp(this.zero)===0){if(c)throw new Error("invalid point");return this.point(this.zero,u)}var g=m.redSqrt();if(g.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");return g.fromRed().isOdd()!==c&&(g=g.redNeg()),this.point(g,u)},n.prototype.validate=function(u){if(u.isInfinity())return!0;u.normalize();var c=u.x.redSqr(),l=u.y.redSqr(),h=c.redMul(this.a).redAdd(l),f=this.c2.redMul(this.one.redAdd(this.d.redMul(c).redMul(l)));return h.cmp(f)===0};function o(a,u,c,l,h){i.BasePoint.call(this,a,"projective"),u===null&&c===null&&l===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(u,16),this.y=new e(c,16),this.z=l?new e(l,16):this.curve.one,this.t=h&&new e(h,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,i.BasePoint),n.prototype.pointFromJSON=function(u){return o.fromJSON(this,u)},n.prototype.point=function(u,c,l,h){return new o(this,u,c,l,h)},o.fromJSON=function(u,c){return new o(u,c[0],c[1],c[2])},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},o.prototype._extDbl=function(){var u=this.x.redSqr(),c=this.y.redSqr(),l=this.z.redSqr();l=l.redIAdd(l);var h=this.curve._mulA(u),f=this.x.redAdd(this.y).redSqr().redISub(u).redISub(c),m=h.redAdd(c),g=m.redSub(l),y=h.redSub(c),C=f.redMul(g),S=m.redMul(y),A=f.redMul(y),D=g.redMul(m);return this.curve.point(C,S,D,A)},o.prototype._projDbl=function(){var u=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),l=this.y.redSqr(),h,f,m,g,y,C;if(this.curve.twisted){g=this.curve._mulA(c);var S=g.redAdd(l);this.zOne?(h=u.redSub(c).redSub(l).redMul(S.redSub(this.curve.two)),f=S.redMul(g.redSub(l)),m=S.redSqr().redSub(S).redSub(S)):(y=this.z.redSqr(),C=S.redSub(y).redISub(y),h=u.redSub(c).redISub(l).redMul(C),f=S.redMul(g.redSub(l)),m=S.redMul(C))}else g=c.redAdd(l),y=this.curve._mulC(this.z).redSqr(),C=g.redSub(y).redSub(y),h=this.curve._mulC(u.redISub(g)).redMul(C),f=this.curve._mulC(g).redMul(c.redISub(l)),m=g.redMul(C);return this.curve.point(h,f,m)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},o.prototype._extAdd=function(u){var c=this.y.redSub(this.x).redMul(u.y.redSub(u.x)),l=this.y.redAdd(this.x).redMul(u.y.redAdd(u.x)),h=this.t.redMul(this.curve.dd).redMul(u.t),f=this.z.redMul(u.z.redAdd(u.z)),m=l.redSub(c),g=f.redSub(h),y=f.redAdd(h),C=l.redAdd(c),S=m.redMul(g),A=y.redMul(C),D=m.redMul(C),O=g.redMul(y);return this.curve.point(S,A,O,D)},o.prototype._projAdd=function(u){var c=this.z.redMul(u.z),l=c.redSqr(),h=this.x.redMul(u.x),f=this.y.redMul(u.y),m=this.curve.d.redMul(h).redMul(f),g=l.redSub(m),y=l.redAdd(m),C=this.x.redAdd(this.y).redMul(u.x.redAdd(u.y)).redISub(h).redISub(f),S=c.redMul(g).redMul(C),A,D;return this.curve.twisted?(A=c.redMul(y).redMul(f.redSub(this.curve._mulA(h))),D=g.redMul(y)):(A=c.redMul(y).redMul(f.redSub(h)),D=this.curve._mulC(g).redMul(y)),this.curve.point(S,A,D)},o.prototype.add=function(u){return this.isInfinity()?u:u.isInfinity()?this:this.curve.extended?this._extAdd(u):this._projAdd(u)},o.prototype.mul=function(u){return this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve._wnafMul(this,u)},o.prototype.mulAdd=function(u,c,l){return this.curve._wnafMulAdd(1,[this,c],[u,l],2,!1)},o.prototype.jmulAdd=function(u,c,l){return this.curve._wnafMulAdd(1,[this,c],[u,l],2,!0)},o.prototype.normalize=function(){if(this.zOne)return this;var u=this.z.redInvm();return this.x=this.x.redMul(u),this.y=this.y.redMul(u),this.t&&(this.t=this.t.redMul(u)),this.z=this.curve.one,this.zOne=!0,this},o.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},o.prototype.getY=function(){return this.normalize(),this.y.fromRed()},o.prototype.eq=function(u){return this===u||this.getX().cmp(u.getX())===0&&this.getY().cmp(u.getY())===0},o.prototype.eqXToP=function(u){var c=u.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(c)===0)return!0;for(var l=u.clone(),h=this.curve.redN.redMul(this.z);;){if(l.iadd(this.curve.n),l.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(h),this.x.cmp(c)===0)return!0}},o.prototype.toP=o.prototype.normalize,o.prototype.mixedAdd=o.prototype.add,Sd}var _b;function r2(){return _b||(_b=1,(function(t){var e=t;e.base=$h(),e.short=zS(),e.mont=HS(),e.edwards=VS()})(_d)),_d}var Cd={},$d={},Ye={},Eb;function ds(){if(Eb)return Ye;Eb=1;var t=Gn(),e=xh();Ye.inherits=e;function r(d,b){return(d.charCodeAt(b)&64512)!==55296||b<0||b+1>=d.length?!1:(d.charCodeAt(b+1)&64512)===56320}function i(d,b){if(Array.isArray(d))return d.slice();if(!d)return[];var _=[];if(typeof d=="string")if(b){if(b==="hex")for(d=d.replace(/[^a-z0-9]+/ig,""),d.length%2!==0&&(d="0"+d),v=0;v<d.length;v+=2)_.push(parseInt(d[v]+d[v+1],16))}else for(var w=0,v=0;v<d.length;v++){var I=d.charCodeAt(v);I<128?_[w++]=I:I<2048?(_[w++]=I>>6|192,_[w++]=I&63|128):r(d,v)?(I=65536+((I&1023)<<10)+(d.charCodeAt(++v)&1023),_[w++]=I>>18|240,_[w++]=I>>12&63|128,_[w++]=I>>6&63|128,_[w++]=I&63|128):(_[w++]=I>>12|224,_[w++]=I>>6&63|128,_[w++]=I&63|128)}else for(v=0;v<d.length;v++)_[v]=d[v]|0;return _}Ye.toArray=i;function s(d){for(var b="",_=0;_<d.length;_++)b+=a(d[_].toString(16));return b}Ye.toHex=s;function n(d){var b=d>>>24|d>>>8&65280|d<<8&16711680|(d&255)<<24;return b>>>0}Ye.htonl=n;function o(d,b){for(var _="",w=0;w<d.length;w++){var v=d[w];b==="little"&&(v=n(v)),_+=u(v.toString(16))}return _}Ye.toHex32=o;function a(d){return d.length===1?"0"+d:d}Ye.zero2=a;function u(d){return d.length===7?"0"+d:d.length===6?"00"+d:d.length===5?"000"+d:d.length===4?"0000"+d:d.length===3?"00000"+d:d.length===2?"000000"+d:d.length===1?"0000000"+d:d}Ye.zero8=u;function c(d,b,_,w){var v=_-b;t(v%4===0);for(var I=new Array(v/4),P=0,E=b;P<I.length;P++,E+=4){var p;w==="big"?p=d[E]<<24|d[E+1]<<16|d[E+2]<<8|d[E+3]:p=d[E+3]<<24|d[E+2]<<16|d[E+1]<<8|d[E],I[P]=p>>>0}return I}Ye.join32=c;function l(d,b){for(var _=new Array(d.length*4),w=0,v=0;w<d.length;w++,v+=4){var I=d[w];b==="big"?(_[v]=I>>>24,_[v+1]=I>>>16&255,_[v+2]=I>>>8&255,_[v+3]=I&255):(_[v+3]=I>>>24,_[v+2]=I>>>16&255,_[v+1]=I>>>8&255,_[v]=I&255)}return _}Ye.split32=l;function h(d,b){return d>>>b|d<<32-b}Ye.rotr32=h;function f(d,b){return d<<b|d>>>32-b}Ye.rotl32=f;function m(d,b){return d+b>>>0}Ye.sum32=m;function g(d,b,_){return d+b+_>>>0}Ye.sum32_3=g;function y(d,b,_,w){return d+b+_+w>>>0}Ye.sum32_4=y;function C(d,b,_,w,v){return d+b+_+w+v>>>0}Ye.sum32_5=C;function S(d,b,_,w){var v=d[b],I=d[b+1],P=w+I>>>0,E=(P<w?1:0)+_+v;d[b]=E>>>0,d[b+1]=P}Ye.sum64=S;function A(d,b,_,w){var v=b+w>>>0,I=(v<b?1:0)+d+_;return I>>>0}Ye.sum64_hi=A;function D(d,b,_,w){var v=b+w;return v>>>0}Ye.sum64_lo=D;function O(d,b,_,w,v,I,P,E){var p=0,N=b;N=N+w>>>0,p+=N<b?1:0,N=N+I>>>0,p+=N<I?1:0,N=N+E>>>0,p+=N<E?1:0;var q=d+_+v+P+p;return q>>>0}Ye.sum64_4_hi=O;function T(d,b,_,w,v,I,P,E){var p=b+w+I+E;return p>>>0}Ye.sum64_4_lo=T;function x(d,b,_,w,v,I,P,E,p,N){var q=0,H=b;H=H+w>>>0,q+=H<b?1:0,H=H+I>>>0,q+=H<I?1:0,H=H+E>>>0,q+=H<E?1:0,H=H+N>>>0,q+=H<N?1:0;var z=d+_+v+P+p+q;return z>>>0}Ye.sum64_5_hi=x;function M(d,b,_,w,v,I,P,E,p,N){var q=b+w+I+E+N;return q>>>0}Ye.sum64_5_lo=M;function U(d,b,_){var w=b<<32-_|d>>>_;return w>>>0}Ye.rotr64_hi=U;function R(d,b,_){var w=d<<32-_|b>>>_;return w>>>0}Ye.rotr64_lo=R;function L(d,b,_){return d>>>_}Ye.shr64_hi=L;function $(d,b,_){var w=d<<32-_|b>>>_;return w>>>0}return Ye.shr64_lo=$,Ye}var xd={},Ib;function Au(){if(Ib)return xd;Ib=1;var t=ds(),e=Gn();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return xd.BlockHash=r,r.prototype.update=function(s,n){if(s=t.toArray(s,n),this.pending?this.pending=this.pending.concat(s):this.pending=s,this.pendingTotal+=s.length,this.pending.length>=this._delta8){s=this.pending;var o=s.length%this._delta8;this.pending=s.slice(s.length-o,s.length),this.pending.length===0&&(this.pending=null),s=t.join32(s,0,s.length-o,this.endian);for(var a=0;a<s.length;a+=this._delta32)this._update(s,a,a+this._delta32)}return this},r.prototype.digest=function(s){return this.update(this._pad()),e(this.pending===null),this._digest(s)},r.prototype._pad=function(){var s=this.pendingTotal,n=this._delta8,o=n-(s+this.padLength)%n,a=new Array(o+this.padLength);a[0]=128;for(var u=1;u<o;u++)a[u]=0;if(s<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)a[u++]=0;a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=s>>>24&255,a[u++]=s>>>16&255,a[u++]=s>>>8&255,a[u++]=s&255}else for(a[u++]=s&255,a[u++]=s>>>8&255,a[u++]=s>>>16&255,a[u++]=s>>>24&255,a[u++]=0,a[u++]=0,a[u++]=0,a[u++]=0,c=8;c<this.padLength;c++)a[u++]=0;return a},xd}var yn={},Ji={},Ab;function i2(){if(Ab)return Ji;Ab=1;var t=ds(),e=t.rotr32;function r(l,h,f,m){if(l===0)return i(h,f,m);if(l===1||l===3)return n(h,f,m);if(l===2)return s(h,f,m)}Ji.ft_1=r;function i(l,h,f){return l&h^~l&f}Ji.ch32=i;function s(l,h,f){return l&h^l&f^h&f}Ji.maj32=s;function n(l,h,f){return l^h^f}Ji.p32=n;function o(l){return e(l,2)^e(l,13)^e(l,22)}Ji.s0_256=o;function a(l){return e(l,6)^e(l,11)^e(l,25)}Ji.s1_256=a;function u(l){return e(l,7)^e(l,18)^l>>>3}Ji.g0_256=u;function c(l){return e(l,17)^e(l,19)^l>>>10}return Ji.g1_256=c,Ji}var Pd,Sb;function KS(){if(Sb)return Pd;Sb=1;var t=ds(),e=Au(),r=i2(),i=t.rotl32,s=t.sum32,n=t.sum32_5,o=r.ft_1,a=e.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return t.inherits(c,a),Pd=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(h,f){for(var m=this.W,g=0;g<16;g++)m[g]=h[f+g];for(;g<m.length;g++)m[g]=i(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);var y=this.h[0],C=this.h[1],S=this.h[2],A=this.h[3],D=this.h[4];for(g=0;g<m.length;g++){var O=~~(g/20),T=n(i(y,5),o(O,C,S,A),D,m[g],u[O]);D=A,A=S,S=i(C,30),C=y,y=T}this.h[0]=s(this.h[0],y),this.h[1]=s(this.h[1],C),this.h[2]=s(this.h[2],S),this.h[3]=s(this.h[3],A),this.h[4]=s(this.h[4],D)},c.prototype._digest=function(h){return h==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Pd}var Nd,Cb;function s2(){if(Cb)return Nd;Cb=1;var t=ds(),e=Au(),r=i2(),i=Gn(),s=t.sum32,n=t.sum32_4,o=t.sum32_5,a=r.ch32,u=r.maj32,c=r.s0_256,l=r.s1_256,h=r.g0_256,f=r.g1_256,m=e.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}return t.inherits(y,m),Nd=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(S,A){for(var D=this.W,O=0;O<16;O++)D[O]=S[A+O];for(;O<D.length;O++)D[O]=n(f(D[O-2]),D[O-7],h(D[O-15]),D[O-16]);var T=this.h[0],x=this.h[1],M=this.h[2],U=this.h[3],R=this.h[4],L=this.h[5],$=this.h[6],d=this.h[7];for(i(this.k.length===D.length),O=0;O<D.length;O++){var b=o(d,l(R),a(R,L,$),this.k[O],D[O]),_=s(c(T),u(T,x,M));d=$,$=L,L=R,R=s(U,b),U=M,M=x,x=T,T=s(b,_)}this.h[0]=s(this.h[0],T),this.h[1]=s(this.h[1],x),this.h[2]=s(this.h[2],M),this.h[3]=s(this.h[3],U),this.h[4]=s(this.h[4],R),this.h[5]=s(this.h[5],L),this.h[6]=s(this.h[6],$),this.h[7]=s(this.h[7],d)},y.prototype._digest=function(S){return S==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Nd}var Od,$b;function WS(){if($b)return Od;$b=1;var t=ds(),e=s2();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return t.inherits(r,e),Od=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(s){return s==="hex"?t.toHex32(this.h.slice(0,7),"big"):t.split32(this.h.slice(0,7),"big")},Od}var Td,xb;function n2(){if(xb)return Td;xb=1;var t=ds(),e=Au(),r=Gn(),i=t.rotr64_hi,s=t.rotr64_lo,n=t.shr64_hi,o=t.shr64_lo,a=t.sum64,u=t.sum64_hi,c=t.sum64_lo,l=t.sum64_4_hi,h=t.sum64_4_lo,f=t.sum64_5_hi,m=t.sum64_5_lo,g=e.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function C(){if(!(this instanceof C))return new C;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}t.inherits(C,g),Td=C,C.blockSize=1024,C.outSize=512,C.hmacStrength=192,C.padLength=128,C.prototype._prepareBlock=function(_,w){for(var v=this.W,I=0;I<32;I++)v[I]=_[w+I];for(;I<v.length;I+=2){var P=$(v[I-4],v[I-3]),E=d(v[I-4],v[I-3]),p=v[I-14],N=v[I-13],q=R(v[I-30],v[I-29]),H=L(v[I-30],v[I-29]),z=v[I-32],V=v[I-31];v[I]=l(P,E,p,N,q,H,z,V),v[I+1]=h(P,E,p,N,q,H,z,V)}},C.prototype._update=function(_,w){this._prepareBlock(_,w);var v=this.W,I=this.h[0],P=this.h[1],E=this.h[2],p=this.h[3],N=this.h[4],q=this.h[5],H=this.h[6],z=this.h[7],V=this.h[8],Y=this.h[9],te=this.h[10],ie=this.h[11],Z=this.h[12],ae=this.h[13],ht=this.h[14],ge=this.h[15];r(this.k.length===v.length);for(var ye=0;ye<v.length;ye+=2){var Dt=ht,Ie=ge,Te=M(V,Y),bi=U(V,Y),Ze=S(V,Y,te,ie,Z),Ke=A(V,Y,te,ie,Z,ae),Vi=this.k[ye],qe=this.k[ye+1],We=v[ye],Ki=v[ye+1],De=f(Dt,Ie,Te,bi,Ze,Ke,Vi,qe,We,Ki),Re=m(Dt,Ie,Te,bi,Ze,Ke,Vi,qe,We,Ki);Dt=T(I,P),Ie=x(I,P),Te=D(I,P,E,p,N),bi=O(I,P,E,p,N,q);var Wi=u(Dt,Ie,Te,bi),Me=c(Dt,Ie,Te,bi);ht=Z,ge=ae,Z=te,ae=ie,te=V,ie=Y,V=u(H,z,De,Re),Y=c(z,z,De,Re),H=N,z=q,N=E,q=p,E=I,p=P,I=u(De,Re,Wi,Me),P=c(De,Re,Wi,Me)}a(this.h,0,I,P),a(this.h,2,E,p),a(this.h,4,N,q),a(this.h,6,H,z),a(this.h,8,V,Y),a(this.h,10,te,ie),a(this.h,12,Z,ae),a(this.h,14,ht,ge)},C.prototype._digest=function(_){return _==="hex"?t.toHex32(this.h,"big"):t.split32(this.h,"big")};function S(b,_,w,v,I){var P=b&w^~b&I;return P<0&&(P+=4294967296),P}function A(b,_,w,v,I,P){var E=_&v^~_&P;return E<0&&(E+=4294967296),E}function D(b,_,w,v,I){var P=b&w^b&I^w&I;return P<0&&(P+=4294967296),P}function O(b,_,w,v,I,P){var E=_&v^_&P^v&P;return E<0&&(E+=4294967296),E}function T(b,_){var w=i(b,_,28),v=i(_,b,2),I=i(_,b,7),P=w^v^I;return P<0&&(P+=4294967296),P}function x(b,_){var w=s(b,_,28),v=s(_,b,2),I=s(_,b,7),P=w^v^I;return P<0&&(P+=4294967296),P}function M(b,_){var w=i(b,_,14),v=i(b,_,18),I=i(_,b,9),P=w^v^I;return P<0&&(P+=4294967296),P}function U(b,_){var w=s(b,_,14),v=s(b,_,18),I=s(_,b,9),P=w^v^I;return P<0&&(P+=4294967296),P}function R(b,_){var w=i(b,_,1),v=i(b,_,8),I=n(b,_,7),P=w^v^I;return P<0&&(P+=4294967296),P}function L(b,_){var w=s(b,_,1),v=s(b,_,8),I=o(b,_,7),P=w^v^I;return P<0&&(P+=4294967296),P}function $(b,_){var w=i(b,_,19),v=i(_,b,29),I=n(b,_,6),P=w^v^I;return P<0&&(P+=4294967296),P}function d(b,_){var w=s(b,_,19),v=s(_,b,29),I=o(b,_,6),P=w^v^I;return P<0&&(P+=4294967296),P}return Td}var Dd,Pb;function GS(){if(Pb)return Dd;Pb=1;var t=ds(),e=n2();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return t.inherits(r,e),Dd=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(s){return s==="hex"?t.toHex32(this.h.slice(0,12),"big"):t.split32(this.h.slice(0,12),"big")},Dd}var Nb;function YS(){return Nb||(Nb=1,yn.sha1=KS(),yn.sha224=WS(),yn.sha256=s2(),yn.sha384=GS(),yn.sha512=n2()),yn}var Rd={},Ob;function JS(){if(Ob)return Rd;Ob=1;var t=ds(),e=Au(),r=t.rotl32,i=t.sum32,s=t.sum32_3,n=t.sum32_4,o=e.BlockHash;function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}t.inherits(a,o),Rd.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(C,S){for(var A=this.h[0],D=this.h[1],O=this.h[2],T=this.h[3],x=this.h[4],M=A,U=D,R=O,L=T,$=x,d=0;d<80;d++){var b=i(r(n(A,u(d,D,O,T),C[h[d]+S],c(d)),m[d]),x);A=x,x=T,T=r(O,10),O=D,D=b,b=i(r(n(M,u(79-d,U,R,L),C[f[d]+S],l(d)),g[d]),$),M=$,$=L,L=r(R,10),R=U,U=b}b=s(this.h[1],O,L),this.h[1]=s(this.h[2],T,$),this.h[2]=s(this.h[3],x,M),this.h[3]=s(this.h[4],A,U),this.h[4]=s(this.h[0],D,R),this.h[0]=b},a.prototype._digest=function(C){return C==="hex"?t.toHex32(this.h,"little"):t.split32(this.h,"little")};function u(y,C,S,A){return y<=15?C^S^A:y<=31?C&S|~C&A:y<=47?(C|~S)^A:y<=63?C&A|S&~A:C^(S|~A)}function c(y){return y<=15?0:y<=31?1518500249:y<=47?1859775393:y<=63?2400959708:2840853838}function l(y){return y<=15?1352829926:y<=31?1548603684:y<=47?1836072691:y<=63?2053994217:0}var h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return Rd}var Md,Tb;function QS(){if(Tb)return Md;Tb=1;var t=ds(),e=Gn();function r(i,s,n){if(!(this instanceof r))return new r(i,s,n);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(s,n))}return Md=r,r.prototype._init=function(s){s.length>this.blockSize&&(s=new this.Hash().update(s).digest()),e(s.length<=this.blockSize);for(var n=s.length;n<this.blockSize;n++)s.push(0);for(n=0;n<s.length;n++)s[n]^=54;for(this.inner=new this.Hash().update(s),n=0;n<s.length;n++)s[n]^=106;this.outer=new this.Hash().update(s)},r.prototype.update=function(s,n){return this.inner.update(s,n),this},r.prototype.digest=function(s){return this.outer.update(this.inner.digest()),this.outer.digest(s)},Md}var Db;function fg(){return Db||(Db=1,(function(t){var e=t;e.utils=ds(),e.common=Au(),e.sha=YS(),e.ripemd=JS(),e.hmac=QS(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})($d)),$d}var kd,Rb;function XS(){return Rb||(Rb=1,kd={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),kd}var Mb;function pg(){return Mb||(Mb=1,(function(t){var e=t,r=fg(),i=r2(),s=xi(),n=s.assert;function o(c){c.type==="short"?this.curve=new i.short(c):c.type==="edwards"?this.curve=new i.edwards(c):this.curve=new i.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(c,l){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var h=new o(l);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:h}),h}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=XS()}catch{u=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})})(Cd)),Cd}var Ud,kb;function ZS(){if(kb)return Ud;kb=1;var t=fg(),e=e2(),r=Gn();function i(s){if(!(this instanceof i))return new i(s);this.hash=s.hash,this.predResist=!!s.predResist,this.outLen=this.hash.outSize,this.minEntropy=s.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=e.toArray(s.entropy,s.entropyEnc||"hex"),o=e.toArray(s.nonce,s.nonceEnc||"hex"),a=e.toArray(s.pers,s.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,o,a)}return Ud=i,i.prototype._init=function(n,o,a){var u=n.concat(o).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c<this.V.length;c++)this.K[c]=0,this.V[c]=1;this._update(u),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new t.hmac(this.hash,this.K)},i.prototype._update=function(n){var o=this._hmac().update(this.V).update([0]);n&&(o=o.update(n)),this.K=o.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(n,o,a,u){typeof o!="string"&&(u=a,a=o,o=null),n=e.toArray(n,o),a=e.toArray(a,u),r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(a||[])),this._reseed=1},i.prototype.generate=function(n,o,a,u){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof o!="string"&&(u=a,a=o,o=null),a&&(a=e.toArray(a,u||"hex"),this._update(a));for(var c=[];c.length<n;)this.V=this._hmac().update(this.V).digest(),c=c.concat(this.V);var l=c.slice(0,n);return this._update(a),this._reseed++,e.encode(l,o)},Ud}var Ld,Ub;function eC(){if(Ub)return Ld;Ub=1;var t=Ds(),e=xi(),r=e.assert;function i(s,n){this.ec=s,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}return Ld=i,i.fromPublic=function(n,o,a){return o instanceof i?o:new i(n,{pub:o,pubEnc:a})},i.fromPrivate=function(n,o,a){return o instanceof i?o:new i(n,{priv:o,privEnc:a})},i.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(n,o){return typeof n=="string"&&(o=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),o?this.pub.encode(o,n):this.pub},i.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(n,o){this.priv=new t(n,o||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(n,o){if(n.x||n.y){this.ec.curve.type==="mont"?r(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&r(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,o)},i.prototype.derive=function(n){return n.validate()||r(n.validate(),"public point not validated"),n.mul(this.priv).getX()},i.prototype.sign=function(n,o,a){return this.ec.sign(n,this,o,a)},i.prototype.verify=function(n,o,a){return this.ec.verify(n,o,this,void 0,a)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ld}var Fd,Lb;function tC(){if(Lb)return Fd;Lb=1;var t=Ds(),e=xi(),r=e.assert;function i(u,c){if(u instanceof i)return u;this._importDER(u,c)||(r(u.r&&u.s,"Signature without r or s"),this.r=new t(u.r,16),this.s=new t(u.s,16),u.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=u.recoveryParam)}Fd=i;function s(){this.place=0}function n(u,c){var l=u[c.place++];if(!(l&128))return l;var h=l&15;if(h===0||h>4||u[c.place]===0)return!1;for(var f=0,m=0,g=c.place;m<h;m++,g++)f<<=8,f|=u[g],f>>>=0;return f<=127?!1:(c.place=g,f)}function o(u){for(var c=0,l=u.length-1;!u[c]&&!(u[c+1]&128)&&c<l;)c++;return c===0?u:u.slice(c)}i.prototype._importDER=function(c,l){c=e.toArray(c,l);var h=new s;if(c[h.place++]!==48)return!1;var f=n(c,h);if(f===!1||f+h.place!==c.length||c[h.place++]!==2)return!1;var m=n(c,h);if(m===!1||(c[h.place]&128)!==0)return!1;var g=c.slice(h.place,m+h.place);if(h.place+=m,c[h.place++]!==2)return!1;var y=n(c,h);if(y===!1||c.length!==y+h.place||(c[h.place]&128)!==0)return!1;var C=c.slice(h.place,y+h.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(C[0]===0)if(C[1]&128)C=C.slice(1);else return!1;return this.r=new t(g),this.s=new t(C),this.recoveryParam=null,!0};function a(u,c){if(c<128){u.push(c);return}var l=1+(Math.log(c)/Math.LN2>>>3);for(u.push(l|128);--l;)u.push(c>>>(l<<3)&255);u.push(c)}return i.prototype.toDER=function(c){var l=this.r.toArray(),h=this.s.toArray();for(l[0]&128&&(l=[0].concat(l)),h[0]&128&&(h=[0].concat(h)),l=o(l),h=o(h);!h[0]&&!(h[1]&128);)h=h.slice(1);var f=[2];a(f,l.length),f=f.concat(l),f.push(2),a(f,h.length);var m=f.concat(h),g=[48];return a(g,m.length),g=g.concat(m),e.encode(g,c)},Fd}var jd,Fb;function rC(){if(Fb)return jd;Fb=1;var t=Ds(),e=ZS(),r=xi(),i=pg(),s=t2(),n=r.assert,o=eC(),a=tC();function u(c){if(!(this instanceof u))return new u(c);typeof c=="string"&&(n(Object.prototype.hasOwnProperty.call(i,c),"Unknown curve "+c),c=i[c]),c instanceof i.PresetCurve&&(c={curve:c}),this.curve=c.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=c.curve.g,this.g.precompute(c.curve.n.bitLength()+1),this.hash=c.hash||c.curve.hash}return jd=u,u.prototype.keyPair=function(l){return new o(this,l)},u.prototype.keyFromPrivate=function(l,h){return o.fromPrivate(this,l,h)},u.prototype.keyFromPublic=function(l,h){return o.fromPublic(this,l,h)},u.prototype.genKeyPair=function(l){l||(l={});for(var h=new e({hash:this.hash,pers:l.pers,persEnc:l.persEnc||"utf8",entropy:l.entropy||s(this.hash.hmacStrength),entropyEnc:l.entropy&&l.entropyEnc||"utf8",nonce:this.n.toArray()}),f=this.n.byteLength(),m=this.n.sub(new t(2));;){var g=new t(h.generate(f));if(!(g.cmp(m)>0))return g.iaddn(1),this.keyFromPrivate(g)}},u.prototype._truncateToN=function(l,h,f){var m;if(t.isBN(l)||typeof l=="number")l=new t(l,16),m=l.byteLength();else if(typeof l=="object")m=l.length,l=new t(l,16);else{var g=l.toString();m=g.length+1>>>1,l=new t(g,16)}typeof f!="number"&&(f=m*8);var y=f-this.n.bitLength();return y>0&&(l=l.ushrn(y)),!h&&l.cmp(this.n)>=0?l.sub(this.n):l},u.prototype.sign=function(l,h,f,m){if(typeof f=="object"&&(m=f,f=null),m||(m={}),typeof l!="string"&&typeof l!="number"&&!t.isBN(l)){n(typeof l=="object"&&l&&typeof l.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),n(l.length>>>0===l.length);for(var g=0;g<l.length;g++)n((l[g]&255)===l[g])}h=this.keyFromPrivate(h,f),l=this._truncateToN(l,!1,m.msgBitLength),n(!l.isNeg(),"Can not sign a negative message");var y=this.n.byteLength(),C=h.getPrivate().toArray("be",y),S=l.toArray("be",y);n(new t(S).eq(l),"Can not sign message");for(var A=new e({hash:this.hash,entropy:C,nonce:S,pers:m.pers,persEnc:m.persEnc||"utf8"}),D=this.n.sub(new t(1)),O=0;;O++){var T=m.k?m.k(O):new t(A.generate(this.n.byteLength()));if(T=this._truncateToN(T,!0),!(T.cmpn(1)<=0||T.cmp(D)>=0)){var x=this.g.mul(T);if(!x.isInfinity()){var M=x.getX(),U=M.umod(this.n);if(U.cmpn(0)!==0){var R=T.invm(this.n).mul(U.mul(h.getPrivate()).iadd(l));if(R=R.umod(this.n),R.cmpn(0)!==0){var L=(x.getY().isOdd()?1:0)|(M.cmp(U)!==0?2:0);return m.canonical&&R.cmp(this.nh)>0&&(R=this.n.sub(R),L^=1),new a({r:U,s:R,recoveryParam:L})}}}}}},u.prototype.verify=function(l,h,f,m,g){g||(g={}),l=this._truncateToN(l,!1,g.msgBitLength),f=this.keyFromPublic(f,m),h=new a(h,"hex");var y=h.r,C=h.s;if(y.cmpn(1)<0||y.cmp(this.n)>=0||C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;var S=C.invm(this.n),A=S.mul(l).umod(this.n),D=S.mul(y).umod(this.n),O;return this.curve._maxwellTrick?(O=this.g.jmulAdd(A,f.getPublic(),D),O.isInfinity()?!1:O.eqXToP(y)):(O=this.g.mulAdd(A,f.getPublic(),D),O.isInfinity()?!1:O.getX().umod(this.n).cmp(y)===0)},u.prototype.recoverPubKey=function(c,l,h,f){n((3&h)===h,"The recovery param is more than two bits"),l=new a(l,f);var m=this.n,g=new t(c),y=l.r,C=l.s,S=h&1,A=h>>1;if(y.cmp(this.curve.p.umod(this.curve.n))>=0&&A)throw new Error("Unable to find sencond key candinate");A?y=this.curve.pointFromX(y.add(this.curve.n),S):y=this.curve.pointFromX(y,S);var D=l.r.invm(m),O=m.sub(g).mul(D).umod(m),T=C.mul(D).umod(m);return this.g.mulAdd(O,y,T)},u.prototype.getKeyRecoveryParam=function(c,l,h,f){if(l=new a(l,f),l.recoveryParam!==null)return l.recoveryParam;for(var m=0;m<4;m++){var g;try{g=this.recoverPubKey(c,l,m)}catch{continue}if(g.eq(h))return m}throw new Error("Unable to find valid recovery factor")},jd}var qd,jb;function iC(){if(jb)return qd;jb=1;var t=xi(),e=t.assert,r=t.parseBytes,i=t.cachedProperty;function s(n,o){this.eddsa=n,this._secret=r(o.secret),n.isPoint(o.pub)?this._pub=o.pub:this._pubBytes=r(o.pub)}return s.fromPublic=function(o,a){return a instanceof s?a:new s(o,{pub:a})},s.fromSecret=function(o,a){return a instanceof s?a:new s(o,{secret:a})},s.prototype.secret=function(){return this._secret},i(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(s,"privBytes",function(){var o=this.eddsa,a=this.hash(),u=o.encodingLength-1,c=a.slice(0,o.encodingLength);return c[0]&=248,c[u]&=127,c[u]|=64,c}),i(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(o){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(o,this)},s.prototype.verify=function(o,a){return this.eddsa.verify(o,a,this)},s.prototype.getSecret=function(o){return e(this._secret,"KeyPair is public only"),t.encode(this.secret(),o)},s.prototype.getPublic=function(o){return t.encode(this.pubBytes(),o)},qd=s,qd}var Bd,qb;function sC(){if(qb)return Bd;qb=1;var t=Ds(),e=xi(),r=e.assert,i=e.cachedProperty,s=e.parseBytes;function n(o,a){this.eddsa=o,typeof a!="object"&&(a=s(a)),Array.isArray(a)&&(r(a.length===o.encodingLength*2,"Signature has invalid size"),a={R:a.slice(0,o.encodingLength),S:a.slice(o.encodingLength)}),r(a.R&&a.S,"Signature without R or S"),o.isPoint(a.R)&&(this._R=a.R),a.S instanceof t&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}return i(n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},Bd=n,Bd}var zd,Bb;function nC(){if(Bb)return zd;Bb=1;var t=fg(),e=pg(),r=xi(),i=r.assert,s=r.parseBytes,n=iC(),o=sC();function a(u){if(i(u==="ed25519","only tested with ed25519 so far"),!(this instanceof a))return new a(u);u=e[u].curve,this.curve=u,this.g=u.g,this.g.precompute(u.n.bitLength()+1),this.pointClass=u.point().constructor,this.encodingLength=Math.ceil(u.n.bitLength()/8),this.hash=t.sha512}return zd=a,a.prototype.sign=function(c,l){c=s(c);var h=this.keyFromSecret(l),f=this.hashInt(h.messagePrefix(),c),m=this.g.mul(f),g=this.encodePoint(m),y=this.hashInt(g,h.pubBytes(),c).mul(h.priv()),C=f.add(y).umod(this.curve.n);return this.makeSignature({R:m,S:C,Rencoded:g})},a.prototype.verify=function(c,l,h){if(c=s(c),l=this.makeSignature(l),l.S().gte(l.eddsa.curve.n)||l.S().isNeg())return!1;var f=this.keyFromPublic(h),m=this.hashInt(l.Rencoded(),f.pubBytes(),c),g=this.g.mul(l.S()),y=l.R().add(f.pub().mul(m));return y.eq(g)},a.prototype.hashInt=function(){for(var c=this.hash(),l=0;l<arguments.length;l++)c.update(arguments[l]);return r.intFromLE(c.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(c){return n.fromPublic(this,c)},a.prototype.keyFromSecret=function(c){return n.fromSecret(this,c)},a.prototype.makeSignature=function(c){return c instanceof o?c:new o(this,c)},a.prototype.encodePoint=function(c){var l=c.getY().toArray("le",this.encodingLength);return l[this.encodingLength-1]|=c.getX().isOdd()?128:0,l},a.prototype.decodePoint=function(c){c=r.parseBytes(c);var l=c.length-1,h=c.slice(0,l).concat(c[l]&-129),f=(c[l]&128)!==0,m=r.intFromLE(h);return this.curve.pointFromY(m,f)},a.prototype.encodeInt=function(c){return c.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(c){return r.intFromLE(c)},a.prototype.isPoint=function(c){return c instanceof this.pointClass},zd}var zb;function oC(){return zb||(zb=1,(function(t){var e=t;e.version=qS.version,e.utils=xi(),e.rand=t2(),e.curve=r2(),e.curves=pg(),e.ec=rC(),e.eddsa=nC()})(md)),md}var o2=oC();const a2={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var aC={};const c2=":";function ra(t){const[e,r]=t.split(c2);return{namespace:e,reference:r}}function cC(t){const[e,r,i]=t.split(c2);return{namespace:e,reference:r,address:i}}function u2(t,e){return t.includes(":")?[t]:e.chains||[]}const uC="ReactNative",ui={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},lC="js";function sh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function un(){return!Qr.getDocument()&&!!Qr.getNavigator()&&navigator.product===uC}function hC(){return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function dC(){return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Su(){return!sh()&&!!Qr.getNavigator()&&!!Qr.getDocument()}function Cu(){return un()?ui.reactNative:sh()?ui.node:Su()?ui.browser:ui.unknown}function Hb(){var t;try{return un()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function fC(t,e){const r=new URLSearchParams(t);for(const i of Object.keys(e).sort())if(e.hasOwnProperty(i)){const s=e[i];s!==void 0&&r.set(i,s)}return r.toString()}function l2(){return M1.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function pC(){if(Cu()===ui.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=D1();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function gC(){var t;const e=Cu();return e===ui.browser?[e,((t=Qr.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function h2(t,e,r){const i=pC(),s=gC();return[[t,e].join("-"),[lC,r].join("-"),i,s].join("/")}function bC({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:s,projectId:n,useOnCloseEvent:o,bundleId:a,packageName:u}){const c=r.split("?"),l=h2(t,e,i),h={auth:s,ua:l,projectId:n,useOnCloseEvent:o,packageName:u||void 0,bundleId:a||void 0},f=fC(c[1]||"",h);return c[0]+"?"+f}function On(t,e){return t.filter(r=>e.includes(r)).length===t.length}function d2(t){return Object.fromEntries(t.entries())}function f2(t){return new Map(Object.entries(t))}function An(t=B.FIVE_MINUTES,e){const r=B.toMiliseconds(t||B.FIVE_MINUTES);let i,s,n,o;return{resolve:a=>{n&&i&&(clearTimeout(n),i(a),o=Promise.resolve(a))},reject:a=>{n&&s&&(clearTimeout(n),s(a))},done:()=>new Promise((a,u)=>{if(o)return a(o);n=setTimeout(()=>{const c=new Error(e);o=Promise.reject(c),u(c)},r),i=a,s=u})}}function Xs(t,e,r){return new Promise(async(i,s)=>{const n=setTimeout(()=>s(new Error(r)),e);try{const o=await t;i(o)}catch(o){s(o)}clearTimeout(n)})}function p2(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function mC(t){return p2("topic",t)}function yC(t){return p2("id",t)}function g2(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function Zt(t,e){return B.fromMiliseconds(Date.now()+B.toMiliseconds(t))}function Ws(t){return Date.now()>=B.toMiliseconds(t)}function Ue(t,e){return`${t}${e?`:${e}`:""}`}function Ul(t=[],e=[]){return[...new Set([...t,...e])]}async function wC({id:t,topic:e,wcDeepLink:r}){var i;try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r,n=s?.href;if(typeof n!="string")return;const o=vC(n,t,e),a=Cu();if(a===ui.browser){if(!((i=Qr.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}_C(o)}else a===ui.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(s){console.error(s)}}function vC(t,e,r){const i=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let s=`${t}`;if(t.startsWith("https://t.me")){const n=t.includes("?")?"&startapp=":"?startapp=";s=`${s}${n}${SC(i,!0)}`}else s=`${s}/wc?${i}`;return s}function _C(t){let e="_self";AC()?e="_top":(IC()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function EC(t,e){let r="";try{if(Su()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(i){console.error(i)}return r}function Vb(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function Kb(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function gg(){return typeof process<"u"&&aC.IS_VITEST==="true"}function IC(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function AC(){try{return window.self!==window.top}catch{return!1}}function SC(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function b2(t){return Buffer.from(t,"base64").toString("utf-8")}function CC(t){return new Promise(e=>setTimeout(e,t))}function jc(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function $C(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ph(t,...e){if(!$C(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function bg(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");jc(t.outputLen),jc(t.blockLen)}function aa(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function m2(t,e){Ph(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const al=BigInt(2**32-1),Wb=BigInt(32);function xC(t,e=!1){return e?{h:Number(t&al),l:Number(t>>Wb&al)}:{h:Number(t>>Wb&al)|0,l:Number(t&al)|0}}function PC(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=xC(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const NC=(t,e,r)=>t<<r|e>>>32-r,OC=(t,e,r)=>e<<r|t>>>32-r,TC=(t,e,r)=>e<<r-32|t>>>64-r,DC=(t,e,r)=>t<<r-32|e>>>64-r,uo=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function RC(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Hd(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Qi(t,e){return t<<32-e|t>>>e}const Gb=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function MC(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Yb(t){for(let e=0;e<t.length;e++)t[e]=MC(t[e])}function kC(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function ca(t){return typeof t=="string"&&(t=kC(t)),Ph(t),t}let mg=class{clone(){return this._cloneInto()}};function y2(t){const e=i=>t().update(ca(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function $u(t=32){if(uo&&typeof uo.getRandomValues=="function")return uo.getRandomValues(new Uint8Array(t));if(uo&&typeof uo.randomBytes=="function")return uo.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const w2=[],v2=[],_2=[],UC=BigInt(0),Za=BigInt(1),LC=BigInt(2),FC=BigInt(7),jC=BigInt(256),qC=BigInt(113);for(let t=0,e=Za,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],w2.push(2*(5*i+r)),v2.push((t+1)*(t+2)/2%64);let s=UC;for(let n=0;n<7;n++)e=(e<<Za^(e>>FC)*qC)%jC,e&LC&&(s^=Za<<(Za<<BigInt(n))-Za);_2.push(s)}const[BC,zC]=PC(_2,!0),Jb=(t,e,r)=>r>32?TC(t,e,r):NC(t,e,r),Qb=(t,e,r)=>r>32?DC(t,e,r):OC(t,e,r);function HC(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=Jb(c,l,1)^r[a],f=Qb(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=v2[o],u=Jb(s,n,a),c=Qb(s,n,a),l=w2[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=BC[i],t[1]^=zC[i]}r.fill(0)}let VC=class E2 extends mg{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,jc(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=RC(this.state)}keccak(){Gb||Yb(this.state32),HC(this.state32,this.rounds),Gb||Yb(this.state32),this.posOut=0,this.pos=0}update(e){aa(this);const{blockLen:r,state:i}=this;e=ca(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){aa(this,!1),Ph(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return jc(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(m2(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new E2(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const KC=(t,e,r)=>y2(()=>new VC(e,t,r)),WC=KC(1,136,256/8),GC="https://rpc.walletconnect.org/v1";function I2(t){const e=`Ethereum Signed Message:
|
|
4
4
|
${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(WC(r)).toString("hex")}async function YC(t,e,r,i,s,n){switch(r.t){case"eip191":return await JC(t,e,r.s);case"eip1271":return await QC(t,e,r.s,i,s,n);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function JC(t,e,r){return(await zA({hash:I2(e),signature:r})).toLowerCase()===t.toLowerCase()}async function QC(t,e,r,i,s,n){const o=ra(i);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const a="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",l=r.substring(2),h=I2(e).substring(2),f=a+h+u+c+l,m=await fetch(`${n||GC}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:XC(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:g}=await m.json();return g?g.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function XC(){return Date.now()+Math.floor(Math.random()*1e3)}var ZC=Object.defineProperty,e$=Object.defineProperties,t$=Object.getOwnPropertyDescriptors,Xb=Object.getOwnPropertySymbols,r$=Object.prototype.hasOwnProperty,i$=Object.prototype.propertyIsEnumerable,Zb=(t,e,r)=>e in t?ZC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s$=(t,e)=>{for(var r in e||(e={}))r$.call(e,r)&&Zb(t,r,e[r]);if(Xb)for(var r of Xb(e))i$.call(e,r)&&Zb(t,r,e[r]);return t},n$=(t,e)=>e$(t,t$(e));const o$="did:pkh:",yg=t=>t?.split(":"),a$=t=>{const e=t&&yg(t);if(e)return t.includes(o$)?e[3]:e[1]},Zf=t=>{const e=t&&yg(t);if(e)return e[2]+":"+e[3]},nh=t=>{const e=t&&yg(t);if(e)return e.pop()};async function em(t){const{cacao:e,projectId:r}=t,{s:i,p:s}=e,n=A2(s,s.iss),o=nh(s.iss);return await YC(o,n,i,Zf(s.iss),r)}const A2=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=nh(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=t.statement||void 0;const n=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${a$(e)}`,u=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,l=t.exp?`Expiration Time: ${t.exp}`:void 0,h=t.nbf?`Not Before: ${t.nbf}`:void 0,f=t.requestId?`Request ID: ${t.requestId}`:void 0,m=t.resources?`Resources:${t.resources.map(y=>`
|
|
5
5
|
- ${y}`).join("")}`:void 0,g=Ll(t.resources);if(g){const y=qc(g);s=b$(s,y)}return[r,i,"",s,"",n,o,a,u,c,l,h,f,m].filter(y=>y!=null).join(`
|
|
6
6
|
`)};function c$(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function u$(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Un(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const i=t.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(s=>{const n=i[s];if(!Array.isArray(n))throw new Error(`Ability limits ${s} must be an array of objects, found: ${n}`);if(!n.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);n.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${o}`)})})})}function l$(t,e,r,i={}){return r?.sort((s,n)=>s.localeCompare(n)),{att:{[t]:h$(e,r,i)}}}function h$(t,e,r={}){e=e?.sort((s,n)=>s.localeCompare(n));const i=e.map(s=>({[`${t}/${s}`]:[r]}));return Object.assign({},...i)}function S2(t){return Un(t),`urn:recap:${c$(t).replace(/=/g,"")}`}function qc(t){const e=u$(t.replace("urn:recap:",""));return Un(e),e}function d$(t,e,r){const i=l$(t,e,r);return S2(i)}function f$(t){return t&&t.includes("urn:recap:")}function p$(t,e){const r=qc(t),i=qc(e),s=g$(r,i);return S2(s)}function g$(t,e){Un(t),Un(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((s,n)=>s.localeCompare(n)),i={att:{}};return r.forEach(s=>{var n,o;Object.keys(((n=t.att)==null?void 0:n[s])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[s])||{})).sort((a,u)=>a.localeCompare(u)).forEach(a=>{var u,c;i.att[s]=n$(s$({},i.att[s]),{[a]:((u=t.att[s])==null?void 0:u[a])||((c=e.att[s])==null?void 0:c[a])})})}),i}function b$(t="",e){Un(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let s=0;Object.keys(e.att).forEach(a=>{const u=Object.keys(e.att[a]).map(h=>({ability:h.split("/")[0],action:h.split("/")[1]}));u.sort((h,f)=>h.action.localeCompare(f.action));const c={};u.forEach(h=>{c[h.ability]||(c[h.ability]=[]),c[h.ability].push(h.action)});const l=Object.keys(c).map(h=>(s++,`(${s}) '${h}': '${c[h].join("', '")}' for '${a}'.`));i.push(l.join(", ").replace(".,","."))});const n=i.join(" "),o=`${r}${n}`;return`${t?t+" ":""}${o}`}function tm(t){var e;const r=qc(t);Un(r);const i=(e=r.att)==null?void 0:e.eip155;return i?Object.keys(i).map(s=>s.split("/")[1]):[]}function rm(t){const e=qc(t);Un(e);const r=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(s=>{var n;(n=s?.[0])!=null&&n.chains&&r.push(s[0].chains)})}),[...new Set(r.flat())]}function Ll(t){if(!t)return;const e=t?.[t.length-1];return f$(e)?e:void 0}function Vd(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function C2(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ai(t,...e){if(!C2(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function im(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function m$(t,e){ai(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function sm(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}const sn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),y$=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),w$=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!w$)throw new Error("Non little-endian hardware is not supported");function v$(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function ep(t){if(typeof t=="string")t=v$(t);else if(C2(t))t=tp(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function _$(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function E$(t,e){if(t.length!==e.length)return!1;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return r===0}const I$=(t,e)=>{function r(i,...s){if(ai(i),t.nonceLength!==void 0){const c=s[0];if(!c)throw new Error("nonce / iv required");t.varSizeNonce?ai(c):ai(c,t.nonceLength)}const n=t.tagLength;n&&s[1]!==void 0&&ai(s[1]);const o=e(i,...s),a=(c,l)=>{if(l!==void 0){if(c!==2)throw new Error("cipher output not supported");ai(l)}};let u=!1;return{encrypt(c,l){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,ai(c),a(o.encrypt.length,l),o.encrypt(c,l)},decrypt(c,l){if(ai(c),n&&c.length<n)throw new Error("invalid ciphertext length: smaller than tagLength="+n);return a(o.decrypt.length,l),o.decrypt(c,l)}}}return Object.assign(r,t),r};function nm(t,e,r=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!A$(e))throw new Error("invalid output, must be aligned");return e}function om(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n);t.setUint32(e+4,o,i),t.setUint32(e+0,a,i)}function A$(t){return t.byteOffset%4===0}function tp(t){return Uint8Array.from(t)}function ua(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const $2=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),S$=$2("expand 16-byte k"),C$=$2("expand 32-byte k"),$$=sn(S$),x$=sn(C$);function Ce(t,e){return t<<e|t>>>32-e}function rp(t){return t.byteOffset%4===0}const cl=64,P$=16,x2=2**32-1,am=new Uint32Array;function N$(t,e,r,i,s,n,o,a){const u=s.length,c=new Uint8Array(cl),l=sn(c),h=rp(s)&&rp(n),f=h?sn(s):am,m=h?sn(n):am;for(let g=0;g<u;o++){if(t(e,r,i,l,o,a),o>=x2)throw new Error("arx: counter overflow");const y=Math.min(cl,u-g);if(h&&y===cl){const C=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let S=0,A;S<P$;S++)A=C+S,m[A]=f[A]^l[S];g+=cl;continue}for(let C=0,S;C<y;C++)S=g+C,n[S]=s[S]^c[C];g+=y}}function O$(t,e){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:n,rounds:o}=_$({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return Vd(s),Vd(o),sm(n),sm(r),(a,u,c,l,h=0)=>{ai(a),ai(u),ai(c);const f=c.length;if(l===void 0&&(l=new Uint8Array(f)),ai(l),Vd(h),h<0||h>=x2)throw new Error("arx: counter overflow");if(l.length<f)throw new Error(`arx: output (${l.length}) is shorter than data (${f})`);const m=[];let g=a.length,y,C;if(g===32)m.push(y=tp(a)),C=x$;else if(g===16&&r)y=new Uint8Array(32),y.set(a),y.set(a,16),C=$$,m.push(y);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);rp(u)||m.push(u=tp(u));const S=sn(y);if(i){if(u.length!==24)throw new Error("arx: extended nonce must be 24 bytes");i(C,S,sn(u.subarray(0,16)),S),u=u.subarray(16)}const A=16-s;if(A!==u.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const O=new Uint8Array(12);O.set(u,n?0:12-u.length),u=O,m.push(u)}const D=sn(u);return N$(t,C,S,D,c,l,h,o),ua(...m),l}}const mr=(t,e)=>t[e++]&255|(t[e++]&255)<<8;let T$=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=ep(e),ai(e,32);const r=mr(e,0),i=mr(e,2),s=mr(e,4),n=mr(e,6),o=mr(e,8),a=mr(e,10),u=mr(e,12),c=mr(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|i<<3)&8191,this.r[2]=(i>>>10|s<<6)&7939,this.r[3]=(s>>>7|n<<9)&8191,this.r[4]=(n>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|u<<5)&8065,this.r[8]=(u>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let l=0;l<8;l++)this.pad[l]=mr(e,16+2*l)}process(e,r,i=!1){const s=i?0:2048,{h:n,r:o}=this,a=o[0],u=o[1],c=o[2],l=o[3],h=o[4],f=o[5],m=o[6],g=o[7],y=o[8],C=o[9],S=mr(e,r+0),A=mr(e,r+2),D=mr(e,r+4),O=mr(e,r+6),T=mr(e,r+8),x=mr(e,r+10),M=mr(e,r+12),U=mr(e,r+14);let R=n[0]+(S&8191),L=n[1]+((S>>>13|A<<3)&8191),$=n[2]+((A>>>10|D<<6)&8191),d=n[3]+((D>>>7|O<<9)&8191),b=n[4]+((O>>>4|T<<12)&8191),_=n[5]+(T>>>1&8191),w=n[6]+((T>>>14|x<<2)&8191),v=n[7]+((x>>>11|M<<5)&8191),I=n[8]+((M>>>8|U<<8)&8191),P=n[9]+(U>>>5|s),E=0,p=E+R*a+L*(5*C)+$*(5*y)+d*(5*g)+b*(5*m);E=p>>>13,p&=8191,p+=_*(5*f)+w*(5*h)+v*(5*l)+I*(5*c)+P*(5*u),E+=p>>>13,p&=8191;let N=E+R*u+L*a+$*(5*C)+d*(5*y)+b*(5*g);E=N>>>13,N&=8191,N+=_*(5*m)+w*(5*f)+v*(5*h)+I*(5*l)+P*(5*c),E+=N>>>13,N&=8191;let q=E+R*c+L*u+$*a+d*(5*C)+b*(5*y);E=q>>>13,q&=8191,q+=_*(5*g)+w*(5*m)+v*(5*f)+I*(5*h)+P*(5*l),E+=q>>>13,q&=8191;let H=E+R*l+L*c+$*u+d*a+b*(5*C);E=H>>>13,H&=8191,H+=_*(5*y)+w*(5*g)+v*(5*m)+I*(5*f)+P*(5*h),E+=H>>>13,H&=8191;let z=E+R*h+L*l+$*c+d*u+b*a;E=z>>>13,z&=8191,z+=_*(5*C)+w*(5*y)+v*(5*g)+I*(5*m)+P*(5*f),E+=z>>>13,z&=8191;let V=E+R*f+L*h+$*l+d*c+b*u;E=V>>>13,V&=8191,V+=_*a+w*(5*C)+v*(5*y)+I*(5*g)+P*(5*m),E+=V>>>13,V&=8191;let Y=E+R*m+L*f+$*h+d*l+b*c;E=Y>>>13,Y&=8191,Y+=_*u+w*a+v*(5*C)+I*(5*y)+P*(5*g),E+=Y>>>13,Y&=8191;let te=E+R*g+L*m+$*f+d*h+b*l;E=te>>>13,te&=8191,te+=_*c+w*u+v*a+I*(5*C)+P*(5*y),E+=te>>>13,te&=8191;let ie=E+R*y+L*g+$*m+d*f+b*h;E=ie>>>13,ie&=8191,ie+=_*l+w*c+v*u+I*a+P*(5*C),E+=ie>>>13,ie&=8191;let Z=E+R*C+L*y+$*g+d*m+b*f;E=Z>>>13,Z&=8191,Z+=_*h+w*l+v*c+I*u+P*a,E+=Z>>>13,Z&=8191,E=(E<<2)+E|0,E=E+p|0,p=E&8191,E=E>>>13,N+=E,n[0]=p,n[1]=N,n[2]=q,n[3]=H,n[4]=z,n[5]=V,n[6]=Y,n[7]=te,n[8]=ie,n[9]=Z}finalize(){const{h:e,pad:r}=this,i=new Uint16Array(10);let s=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=s,s=e[a]>>>13,e[a]&=8191;e[0]+=s*5,s=e[0]>>>13,e[0]&=8191,e[1]+=s,s=e[1]>>>13,e[1]&=8191,e[2]+=s,i[0]=e[0]+5,s=i[0]>>>13,i[0]&=8191;for(let a=1;a<10;a++)i[a]=e[a]+s,s=i[a]>>>13,i[a]&=8191;i[9]-=8192;let n=(s^1)-1;for(let a=0;a<10;a++)i[a]&=n;n=~n;for(let a=0;a<10;a++)e[a]=e[a]&n|i[a];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 o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535;ua(i)}update(e){im(this);const{buffer:r,blockLen:i}=this;e=ep(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(i-this.pos,s-n);if(o===i){for(;i<=s-n;n+=i)this.process(e,n);continue}r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===i&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){ua(this.h,this.r,this.buffer,this.pad)}digestInto(e){im(this),m$(e,this),this.finished=!0;const{buffer:r,h:i}=this;let{pos:s}=this;if(s){for(r[s++]=1;s<16;s++)r[s]=0;this.process(r,0,!0)}this.finalize();let n=0;for(let o=0;o<8;o++)e[n++]=i[o]>>>0,e[n++]=i[o]>>>8;return e}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}};function D$(t){const e=(i,s)=>t(s).update(ep(i)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=i=>t(i),e}const R$=D$(t=>new T$(t));function M$(t,e,r,i,s,n=20){let o=t[0],a=t[1],u=t[2],c=t[3],l=e[0],h=e[1],f=e[2],m=e[3],g=e[4],y=e[5],C=e[6],S=e[7],A=s,D=r[0],O=r[1],T=r[2],x=o,M=a,U=u,R=c,L=l,$=h,d=f,b=m,_=g,w=y,v=C,I=S,P=A,E=D,p=O,N=T;for(let H=0;H<n;H+=2)x=x+L|0,P=Ce(P^x,16),_=_+P|0,L=Ce(L^_,12),x=x+L|0,P=Ce(P^x,8),_=_+P|0,L=Ce(L^_,7),M=M+$|0,E=Ce(E^M,16),w=w+E|0,$=Ce($^w,12),M=M+$|0,E=Ce(E^M,8),w=w+E|0,$=Ce($^w,7),U=U+d|0,p=Ce(p^U,16),v=v+p|0,d=Ce(d^v,12),U=U+d|0,p=Ce(p^U,8),v=v+p|0,d=Ce(d^v,7),R=R+b|0,N=Ce(N^R,16),I=I+N|0,b=Ce(b^I,12),R=R+b|0,N=Ce(N^R,8),I=I+N|0,b=Ce(b^I,7),x=x+$|0,N=Ce(N^x,16),v=v+N|0,$=Ce($^v,12),x=x+$|0,N=Ce(N^x,8),v=v+N|0,$=Ce($^v,7),M=M+d|0,P=Ce(P^M,16),I=I+P|0,d=Ce(d^I,12),M=M+d|0,P=Ce(P^M,8),I=I+P|0,d=Ce(d^I,7),U=U+b|0,E=Ce(E^U,16),_=_+E|0,b=Ce(b^_,12),U=U+b|0,E=Ce(E^U,8),_=_+E|0,b=Ce(b^_,7),R=R+L|0,p=Ce(p^R,16),w=w+p|0,L=Ce(L^w,12),R=R+L|0,p=Ce(p^R,8),w=w+p|0,L=Ce(L^w,7);let q=0;i[q++]=o+x|0,i[q++]=a+M|0,i[q++]=u+U|0,i[q++]=c+R|0,i[q++]=l+L|0,i[q++]=h+$|0,i[q++]=f+d|0,i[q++]=m+b|0,i[q++]=g+_|0,i[q++]=y+w|0,i[q++]=C+v|0,i[q++]=S+I|0,i[q++]=A+P|0,i[q++]=D+E|0,i[q++]=O+p|0,i[q++]=T+N|0}const k$=O$(M$,{counterRight:!1,counterLength:4,allowShortKeys:!1}),U$=new Uint8Array(16),cm=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(U$.subarray(r))},L$=new Uint8Array(32);function um(t,e,r,i,s){const n=t(e,r,L$),o=R$.create(n);s&&cm(o,s),cm(o,i);const a=new Uint8Array(16),u=y$(a);om(u,0,BigInt(s?s.length:0),!0),om(u,8,BigInt(i.length),!0),o.update(a);const c=o.digest();return ua(n,a),c}const F$=t=>(e,r,i)=>({encrypt(s,n){const o=s.length;n=nm(o+16,n,!1),n.set(s);const a=n.subarray(0,-16);t(e,r,a,a,1);const u=um(t,e,r,a,i);return n.set(u,o),ua(u),n},decrypt(s,n){n=nm(s.length-16,n,!1);const o=s.subarray(0,-16),a=s.subarray(-16),u=um(t,e,r,o,i);if(!E$(a,u))throw new Error("invalid tag");return n.set(s.subarray(0,-16)),t(e,r,n,n,1),ua(u),n}}),P2=I$({blockSize:64,nonceLength:12,tagLength:16},F$(k$));let N2=class extends mg{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,bg(e);const i=ca(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,n=new Uint8Array(s);n.set(i.length>s?e.create().update(i).digest():i);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=e.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),n.fill(0)}update(e){return aa(this),this.iHash.update(e),this}digestInto(e){aa(this),Ph(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:i,finished:s,destroyed:n,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const wg=(t,e,r)=>new N2(t,e).update(r).digest();wg.create=(t,e)=>new N2(t,e);function j$(t,e,r){return bg(t),r===void 0&&(r=new Uint8Array(t.outputLen)),wg(t,ca(r),ca(e))}const Kd=new Uint8Array([0]),lm=new Uint8Array;function q$(t,e,r,i=32){if(bg(t),jc(i),i>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/t.outputLen);r===void 0&&(r=lm);const n=new Uint8Array(s*t.outputLen),o=wg.create(t,e),a=o._cloneInto(),u=new Uint8Array(o.outputLen);for(let c=0;c<s;c++)Kd[0]=c+1,a.update(c===0?lm:u).update(r).update(Kd).digestInto(u),n.set(u,t.outputLen*c),o._cloneInto(a);return o.destroy(),a.destroy(),u.fill(0),Kd.fill(0),n.slice(0,i)}const B$=(t,e,r,i,s)=>q$(t,j$(t,e,r),i,s);function z$(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n),u=i?4:0,c=i?0:4;t.setUint32(e+u,o,i),t.setUint32(e+c,a,i)}function H$(t,e,r){return t&e^~t&r}function V$(t,e,r){return t&e^t&r^e&r}let K$=class extends mg{constructor(e,r,i,s){super(),this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Hd(this.buffer)}update(e){aa(this);const{view:r,buffer:i,blockLen:s}=this;e=ca(e);const n=e.length;for(let o=0;o<n;){const a=Math.min(s-this.pos,n-o);if(a===s){const u=Hd(e);for(;s<=n-o;o+=s)this.process(u,o);continue}i.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){aa(this),m2(e,this),this.finished=!0;const{buffer:r,view:i,blockLen:s,isLE:n}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(i,0),o=0);for(let h=o;h<s;h++)r[h]=0;z$(i,s-8,BigInt(this.length*8),n),this.process(i,0);const a=Hd(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<c;h++)a.setUint32(4*h,l[h],n)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:i,length:s,finished:n,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=n,e.destroyed=o,s%r&&e.buffer.set(i),e}};const W$=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),js=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qs=new Uint32Array(64);let G$=class extends K${constructor(){super(64,32,8,!1),this.A=js[0]|0,this.B=js[1]|0,this.C=js[2]|0,this.D=js[3]|0,this.E=js[4]|0,this.F=js[5]|0,this.G=js[6]|0,this.H=js[7]|0}get(){const{A:e,B:r,C:i,D:s,E:n,F:o,G:a,H:u}=this;return[e,r,i,s,n,o,a,u]}set(e,r,i,s,n,o,a,u){this.A=e|0,this.B=r|0,this.C=i|0,this.D=s|0,this.E=n|0,this.F=o|0,this.G=a|0,this.H=u|0}process(e,r){for(let h=0;h<16;h++,r+=4)qs[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){const f=qs[h-15],m=qs[h-2],g=Qi(f,7)^Qi(f,18)^f>>>3,y=Qi(m,17)^Qi(m,19)^m>>>10;qs[h]=y+qs[h-7]+g+qs[h-16]|0}let{A:i,B:s,C:n,D:o,E:a,F:u,G:c,H:l}=this;for(let h=0;h<64;h++){const f=Qi(a,6)^Qi(a,11)^Qi(a,25),m=l+f+H$(a,u,c)+W$[h]+qs[h]|0,g=(Qi(i,2)^Qi(i,13)^Qi(i,22))+V$(i,s,n)|0;l=c,c=u,u=a,a=o+m|0,o=n,n=s,s=i,i=m+g|0}i=i+this.A|0,s=s+this.B|0,n=n+this.C|0,o=o+this.D|0,a=a+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(i,s,n,o,a,u,c,l)}roundClean(){qs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Nh=y2(()=>new G$);const O2=BigInt(0);function vg(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function T2(t){if(!vg(t))throw new Error("Uint8Array expected")}const Y$=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function J$(t){T2(t);let e="";for(let r=0;r<t.length;r++)e+=Y$[t[r]];return e}function Q$(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?O2:BigInt("0x"+t)}const ys={_0:48,_9:57,A:65,F:70,a:97,f:102};function hm(t){if(t>=ys._0&&t<=ys._9)return t-ys._0;if(t>=ys.A&&t<=ys.F)return t-(ys.A-10);if(t>=ys.a&&t<=ys.f)return t-(ys.a-10)}function D2(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(r);for(let s=0,n=0;s<r;s++,n+=2){const o=hm(t.charCodeAt(n)),a=hm(t.charCodeAt(n+1));if(o===void 0||a===void 0){const u=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+n)}i[s]=o*16+a}return i}function dm(t){return T2(t),Q$(J$(Uint8Array.from(t).reverse()))}function X$(t,e){return D2(t.toString(16).padStart(e*2,"0"))}function Z$(t,e){return X$(t,e).reverse()}function fm(t,e,r){let i;if(typeof e=="string")try{i=D2(e)}catch(n){throw new Error(t+" must be hex string or Uint8Array, cause: "+n)}else if(vg(e))i=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=i.length;if(typeof r=="number"&&s!==r)throw new Error(t+" of length "+r+" expected, got "+s);return i}const Wd=t=>typeof t=="bigint"&&O2<=t;function ex(t,e,r){return Wd(t)&&Wd(e)&&Wd(r)&&e<=t&&t<r}function pm(t,e,r,i){if(!ex(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}const tx={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||vg(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function rx(t,e,r={}){const i=(s,n,o)=>{const a=tx[n];if(typeof a!="function")throw new Error("invalid validator function");const u=t[s];if(!(o&&u===void 0)&&!a(u,t))throw new Error("param "+String(s)+" is invalid. Expected "+n+", got "+u)};for(const[s,n]of Object.entries(e))i(s,n,!1);for(const[s,n]of Object.entries(r))i(s,n,!0);return t}const Qo=BigInt(0),ul=BigInt(1);function R2(t,e){const r=t%e;return r>=Qo?r:e+r}function ix(t,e,r){if(e<Qo)throw new Error("invalid exponent, negatives unsupported");if(r<=Qo)throw new Error("invalid modulus");if(r===ul)return Qo;let i=ul;for(;e>Qo;)e&ul&&(i=i*t%r),t=t*t%r,e>>=ul;return i}function qi(t,e,r){let i=t;for(;e-- >Qo;)i*=i,i%=r;return i}BigInt(0),BigInt(1),BigInt(0),BigInt(1),BigInt(2),BigInt(8);const lo=BigInt(0),Gd=BigInt(1);function sx(t){return rx(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function nx(t){const e=sx(t),{P:r}=e,i=A=>R2(A,r),s=e.montgomeryBits,n=Math.ceil(s/8),o=e.nByteLength,a=e.adjustScalarBytes||(A=>A),u=e.powPminus2||(A=>ix(A,r-BigInt(2),r));function c(A,D,O){const T=i(A*(D-O));return D=i(D-T),O=i(O+T),[D,O]}const l=(e.a-BigInt(2))/BigInt(4);function h(A,D){pm("u",A,lo,r),pm("scalar",D,lo,r);const O=D,T=A;let x=Gd,M=lo,U=A,R=Gd,L=lo,$;for(let b=BigInt(s-1);b>=lo;b--){const _=O>>b&Gd;L^=_,$=c(L,x,U),x=$[0],U=$[1],$=c(L,M,R),M=$[0],R=$[1],L=_;const w=x+M,v=i(w*w),I=x-M,P=i(I*I),E=v-P,p=U+R,N=U-R,q=i(N*w),H=i(p*I),z=q+H,V=q-H;U=i(z*z),R=i(T*i(V*V)),x=i(v*P),M=i(E*(v+i(l*E)))}$=c(L,x,U),x=$[0],U=$[1],$=c(L,M,R),M=$[0],R=$[1];const d=u(M);return i(x*d)}function f(A){return Z$(i(A),n)}function m(A){const D=fm("u coordinate",A,n);return o===32&&(D[31]&=127),dm(D)}function g(A){const D=fm("scalar",A),O=D.length;if(O!==n&&O!==o){let T=""+n+" or "+o;throw new Error("invalid scalar, expected "+T+" bytes, got "+O)}return dm(a(D))}function y(A,D){const O=m(D),T=g(A),x=h(O,T);if(x===lo)throw new Error("invalid private or public key received");return f(x)}const C=f(e.Gu);function S(A){return y(A,C)}return{scalarMult:y,scalarMultBase:S,getSharedSecret:(A,D)=>y(A,D),getPublicKey:A=>S(A),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:C}}const ip=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");BigInt(0);const ox=BigInt(1),gm=BigInt(2),ax=BigInt(3),cx=BigInt(5);BigInt(8);function ux(t){const e=BigInt(10),r=BigInt(20),i=BigInt(40),s=BigInt(80),n=ip,o=t*t%n*t%n,a=qi(o,gm,n)*o%n,u=qi(a,ox,n)*t%n,c=qi(u,cx,n)*u%n,l=qi(c,e,n)*c%n,h=qi(l,r,n)*l%n,f=qi(h,i,n)*h%n,m=qi(f,s,n)*f%n,g=qi(m,s,n)*f%n,y=qi(g,e,n)*c%n;return{pow_p_5_8:qi(y,gm,n)*t%n,b2:o}}function lx(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const sp=nx({P:ip,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{const e=ip,{pow_p_5_8:r,b2:i}=ux(t);return R2(qi(r,ax,e)*i,e)},adjustScalarBytes:lx,randomBytes:$u}),M2="base10",Dr="base16",Zs="base64pad",ec="base64url",xu="utf8",k2=0,xs=1,Pu=2,hx=0,bm=1,$c=12,_g=32;function dx(){const t=sp.utils.randomPrivateKey(),e=sp.getPublicKey(t);return{privateKey:Fe(t,Dr),publicKey:Fe(e,Dr)}}function np(){const t=$u(_g);return Fe(t,Dr)}function fx(t,e){const r=sp.getSharedSecret(_t(t,Dr),_t(e,Dr)),i=B$(Nh,r,void 0,void 0,_g);return Fe(i,Dr)}function Fl(t){const e=Nh(_t(t,Dr));return Fe(e,Dr)}function $s(t){const e=Nh(_t(t,xu));return Fe(e,Dr)}function U2(t){return _t(`${t}`,M2)}function Ln(t){return Number(Fe(t,M2))}function px(t){const e=U2(typeof t.type<"u"?t.type:k2);if(Ln(e)===xs&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?_t(t.senderPublicKey,Dr):void 0,i=typeof t.iv<"u"?_t(t.iv,Dr):$u($c),s=_t(t.symKey,Dr),n=P2(s,i).encrypt(_t(t.message,xu));return L2({type:e,sealed:n,iv:i,senderPublicKey:r,encoding:t.encoding})}function gx(t){const e=_t(t.symKey,Dr),{sealed:r,iv:i}=Bc(t),s=P2(e,i).decrypt(r);if(s===null)throw new Error("Failed to decrypt");return Fe(s,xu)}function bx(t,e){const r=U2(Pu),i=$u($c),s=_t(t,xu);return L2({type:r,sealed:s,iv:i,encoding:e})}function mx(t,e){const{sealed:r}=Bc({encoded:t,encoding:e});return Fe(r,xu)}function L2(t){const{encoding:e=Zs}=t;if(Ln(t.type)===Pu)return Fe(ta([t.type,t.sealed]),e);if(Ln(t.type)===xs){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Fe(ta([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Fe(ta([t.type,t.iv,t.sealed]),e)}function Bc(t){const{encoded:e,encoding:r=Zs}=t,i=_t(e,r),s=i.slice(hx,bm),n=bm;if(Ln(s)===xs){const c=n+_g,l=c+$c,h=i.slice(n,c),f=i.slice(c,l),m=i.slice(l);return{type:s,sealed:m,iv:f,senderPublicKey:h}}if(Ln(s)===Pu){const c=i.slice(n),l=$u($c);return{type:s,sealed:c,iv:l}}const o=n+$c,a=i.slice(n,o),u=i.slice(o);return{type:s,sealed:u,iv:a}}function yx(t,e){const r=Bc({encoded:t,encoding:e?.encoding});return F2({type:Ln(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Fe(r.senderPublicKey,Dr):void 0,receiverPublicKey:e?.receiverPublicKey})}function F2(t){const e=t?.type||k2;if(e===xs){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function mm(t){return t.type===xs&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function ym(t){return t.type===Pu}function wx(t){return new o2.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function vx(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function _x(t){return Buffer.from(vx(t),"base64")}function Ex(t,e){const[r,i,s]=t.split("."),n=_x(s);if(n.length!==64)throw new Error("Invalid signature length");const o=n.slice(0,32).toString("hex"),a=n.slice(32,64).toString("hex"),u=`${r}.${i}`,c=Nh(u),l=wx(e),h=Fe(c,Dr);if(!l.verify(h,{r:o,s:a}))throw new Error("Invalid signature");return oa(t).payload}const Ix="irn";function oh(t){return t?.relay||{protocol:Ix}}function wc(t){const e=a2[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}function Ax(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach(s=>{if(s.startsWith(i)){const n=s.replace(i,""),o=t[s];r[n]=o}}),r}function wm(t){if(!t.includes("wc:")){const c=b2(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,i=t.substring(0,e),s=t.substring(e+1,r).split("@"),n=typeof r<"u"?t.substring(r):"",o=new URLSearchParams(n),a={};o.forEach((c,l)=>{a[l]=c});const u=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:i,topic:Sx(s[0]),version:parseInt(s[1],10),symKey:a.symKey,relay:Ax(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function Sx(t){return t.startsWith("//")?t.substring(2):t}function Cx(t,e="-"){const r="relay",i={};return Object.keys(t).forEach(s=>{const n=s,o=r+e+n;t[n]&&(i[o]=t[n])}),i}function vm(t){const e=new URLSearchParams,r=Cx(t.relay);Object.keys(r).sort().forEach(s=>{e.set(s,r[s])}),e.set("symKey",t.symKey),t.expiryTimestamp&&e.set("expiryTimestamp",t.expiryTimestamp.toString()),t.methods&&e.set("methods",t.methods.join(","));const i=e.toString();return`${t.protocol}:${t.topic}@${t.version}?${i}`}function ll(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Ia(t){const e=[];return t.forEach(r=>{const[i,s]=r.split(":");e.push(`${i}:${s}`)}),e}function $x(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ia(r.accounts))}),e}function xx(t,e){const r=[];return Object.values(t).forEach(i=>{Ia(i.accounts).includes(e)&&r.push(...i.methods)}),r}function Px(t,e){const r=[];return Object.values(t).forEach(i=>{Ia(i.accounts).includes(e)&&r.push(...i.events)}),r}function Eg(t){return t.includes(":")}function vc(t){return Eg(t)?t.split(":")[0]:t}function Nx(t){const e={};return t?.forEach(r=>{var i;const[s,n]=r.split(":");e[s]||(e[s]={accounts:[],chains:[],events:[],methods:[]}),e[s].accounts.push(r),(i=e[s].chains)==null||i.push(`${s}:${n}`)}),e}function _m(t,e){e=e.map(i=>i.replace("did:pkh:",""));const r=Nx(e);for(const[i,s]of Object.entries(r))s.methods?s.methods=Ul(s.methods,t):s.methods=t,s.events=["chainChanged","accountsChanged"];return r}const Ox={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}},Tx={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 Q(t,e){const{message:r,code:i}=Tx[t];return{message:e?`${r} ${e}`:r,code:i}}function Qe(t,e){const{message:r,code:i}=Ox[t];return{message:e?`${r} ${e}`:r,code:i}}function Fn(t,e){return!!Array.isArray(t)}function zc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ur(t){return typeof t>"u"}function Kt(t,e){return e&&Ur(t)?!0:typeof t=="string"&&!!t.trim().length}function Ig(t,e){return e&&Ur(t)?!0:typeof t=="number"&&!isNaN(t)}function Dx(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),s=Object.keys(r);let n=!0;return On(s,i)?(i.forEach(o=>{const{accounts:a,methods:u,events:c}=t.namespaces[o],l=Ia(a),h=r[o];(!On(u2(o,h),l)||!On(h.methods,u)||!On(h.events,c))&&(n=!1)}),n):!1}function ah(t){return Kt(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Rx(t){if(Kt(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ah(r)}}return!1}function Mx(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(Kt(t,!1)){if(e(t))return!0;const r=b2(t);return e(r)}}catch{}return!1}function kx(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Ux(t){return t?.topic}function Lx(t,e){let r=null;return Kt(t?.publicKey,!1)||(r=Q("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Em(t){let e=!0;return Fn(t)?t.length&&(e=t.every(r=>Kt(r,!1))):e=!1,e}function Fx(t,e,r){let i=null;return Fn(e)&&e.length?e.forEach(s=>{i||ah(s)||(i=Qe("UNSUPPORTED_CHAINS",`${r}, chain ${s} should be a string and conform to "namespace:chainId" format`))}):ah(t)||(i=Qe("UNSUPPORTED_CHAINS",`${r}, 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"] }`)),i}function jx(t,e,r){let i=null;return Object.entries(t).forEach(([s,n])=>{if(i)return;const o=Fx(s,u2(s,n),`${e} ${r}`);o&&(i=o)}),i}function qx(t,e){let r=null;return Fn(t)?t.forEach(i=>{r||Rx(i)||(r=Qe("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):r=Qe("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Bx(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const s=qx(i?.accounts,`${e} namespace`);s&&(r=s)}),r}function zx(t,e){let r=null;return Em(t?.methods)?Em(t?.events)||(r=Qe("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Qe("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function j2(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const s=zx(i,`${e}, namespace`);s&&(r=s)}),r}function Hx(t,e,r){let i=null;if(t&&zc(t)){const s=j2(t,e);s&&(i=s);const n=jx(t,e,r);n&&(i=n)}else i=Q("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function Yd(t,e){let r=null;if(t&&zc(t)){const i=j2(t,e);i&&(r=i);const s=Bx(t,e);s&&(r=s)}else r=Q("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function q2(t){return Kt(t.protocol,!0)}function Vx(t,e){let r=!1;return t?t&&Fn(t)&&t.length&&t.forEach(i=>{r=q2(i)}):r=!0,r}function Kx(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Wx(t){return!(!t||typeof t!="object"||!t.code||!Ig(t.code,!1)||!t.message||!Kt(t.message,!1))}function Gx(t){return!(Ur(t)||!Kt(t.method,!1))}function Yx(t){return!(Ur(t)||Ur(t.result)&&Ur(t.error)||!Ig(t.id,!1)||!Kt(t.jsonrpc,!1))}function Jx(t){return!(Ur(t)||!Kt(t.name,!1))}function Im(t,e){return!(!ah(e)||!$x(t).includes(e))}function Qx(t,e,r){return Kt(r,!1)?xx(t,e).includes(r):!1}function Xx(t,e,r){return Kt(r,!1)?Px(t,e).includes(r):!1}function Am(t,e,r){let i=null;const s=Zx(t),n=e9(e),o=Object.keys(s),a=Object.keys(n),u=Sm(Object.keys(t)),c=Sm(Object.keys(e)),l=u.filter(h=>!c.includes(h));return l.length&&(i=Q("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
@@ -14,7 +14,7 @@ ${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(WC(r)).toStr
|
|
|
14
14
|
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=z3}walk(e){return H3(this,e)}};function H3(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?H3(t.cause,e):e?null:t}let V3=class extends fs{constructor({size:e,targetSize:r,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};function Ng(t,{dir:e,size:r=32}={}){return typeof t=="string"?$j(t,{dir:e,size:r}):xj(t,{dir:e,size:r})}function $j(t,{dir:e,size:r=32}={}){if(r===null)return t;const i=t.replace("0x","");if(i.length>r*2)throw new V3({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function xj(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new V3({size:t.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const n=e==="right";i[n?s:r-s-1]=t[n?s:t.length-s-1]}return i}let Pj=class extends fs{constructor({max:e,min:r,signed:i,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Nj=class extends fs{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function K3(t,{size:e}){if(Yy(t)>e)throw new Nj({givenSize:Yy(t),maxSize:e})}const Oj=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Jy(t,e={}){return typeof t=="number"||typeof t=="bigint"?Dj(t,e):typeof t=="string"?Mj(t,e):typeof t=="boolean"?Tj(t,e):W3(t,e)}function Tj(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(K3(r,{size:e.size}),Ng(r,{size:e.size})):r}function W3(t,e={}){let r="";for(let s=0;s<t.length;s++)r+=Oj[t[s]];const i=`0x${r}`;return typeof e.size=="number"?(K3(i,{size:e.size}),Ng(i,{dir:"right",size:e.size})):i}function Dj(t,e={}){const{signed:r,size:i}=e,s=BigInt(t);let n;i?r?n=(1n<<BigInt(i)*8n-1n)-1n:n=2n**(BigInt(i)*8n)-1n:typeof t=="number"&&(n=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof n=="bigint"&&r?-n-1n:0;if(n&&s>n||s<o){const u=typeof t=="bigint"?"n":"";throw new Pj({max:n?`${n}${u}`:void 0,min:`${o}${u}`,signed:r,size:i,value:`${t}${u}`})}const a=`0x${(r&&s<0?(1n<<BigInt(i*8))+BigInt(s):s).toString(16)}`;return i?Ng(a,{size:i}):a}const Rj=new TextEncoder;function Mj(t,e={}){const r=Rj.encode(t);return W3(r,e)}let kj=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,r)),r}set(e,r){if(super.has(e)&&super.delete(e),super.set(e,r),this.maxSize&&this.size>this.maxSize){const i=super.keys().next().value;i!==void 0&&super.delete(i)}return this}};const Mn=(t,e,r)=>JSON.stringify(t,(i,s)=>typeof s=="bigint"?s.toString():s,r);function Uj(t,e){let r=t.toString();const i=r.startsWith("-");i&&(r=r.slice(1)),r=r.padStart(e,"0");let[s,n]=[r.slice(0,r.length-e),r.slice(r.length-e)];return n=n.replace(/(0+)$/,""),`${i?"-":""}${s||"0"}${n?`.${n}`:""}`}const Og=t=>{try{const e=new URL(t);return!e.username&&!e.password?t:(e.username="",e.password="",e.toString())}catch{return t}};class Tc extends fs{constructor({body:e,cause:r,details:i,headers:s,status:n,url:o}){super("HTTP request failed.",{cause:r,details:i,metaMessages:[n&&`Status: ${n}`,`URL: ${Og(o)}`,e&&`Request body: ${Mn(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=s,this.status=n,this.url=o}}class G3 extends fs{constructor({body:e,error:r,url:i}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${Og(i)}`,`Request body: ${Mn(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=i}}class Qy extends fs{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Og(r)}`,`Request body: ${Mn(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}const Lj=-1;class Xr extends fs{constructor(e,{code:r,docsPath:i,metaMessages:s,name:n,shortMessage:o}){super(o,{cause:e,docsPath:i,metaMessages:s||e?.metaMessages,name:n||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n||e.name,this.code=e instanceof G3?e.code:r??Lj}}class Zr extends Xr{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class Kc extends Xr{constructor(e){super(e,{code:Kc.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Kc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Wc extends Xr{constructor(e){super(e,{code:Wc.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Wc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Gc extends Xr{constructor(e,{method:r}={}){super(e,{code:Gc.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(Gc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Yc extends Xr{constructor(e){super(e,{code:Yc.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
15
15
|
`)})}}Object.defineProperty(Yc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class la extends Xr{constructor(e){super(e,{code:la.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(la,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Jc extends Xr{constructor(e){super(e,{code:Jc.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
16
16
|
`)})}}Object.defineProperty(Jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Qc extends Xr{constructor(e){super(e,{code:Qc.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Qc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Xc extends Xr{constructor(e){super(e,{code:Xc.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Xc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ha extends Xr{constructor(e){super(e,{code:ha.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(ha,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Tn extends Xr{constructor(e,{method:r}={}){super(e,{code:Tn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Tn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class da extends Xr{constructor(e){super(e,{code:da.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(da,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Zc extends Xr{constructor(e){super(e,{code:Zc.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class kn extends Zr{constructor(e){super(e,{code:kn.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(kn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class eu extends Zr{constructor(e){super(e,{code:eu.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class tu extends Zr{constructor(e,{method:r}={}){super(e,{code:tu.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(tu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ru extends Zr{constructor(e){super(e,{code:ru.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ru,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class iu extends Zr{constructor(e){super(e,{code:iu.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class su extends Zr{constructor(e){super(e,{code:su.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class nu extends Zr{constructor(e){super(e,{code:nu.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(nu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class ou extends Zr{constructor(e){super(e,{code:ou.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class au extends Zr{constructor(e){super(e,{code:au.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class cu extends Zr{constructor(e){super(e,{code:cu.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(cu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class uu extends Zr{constructor(e){super(e,{code:uu.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(uu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class lu extends Zr{constructor(e){super(e,{code:lu.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(lu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class hu extends Zr{constructor(e){super(e,{code:hu.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(hu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class fa extends Zr{constructor(e){super(e,{code:fa.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(fa,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Fj extends Xr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}class Tg extends fs{constructor({cause:e,message:r}={}){const i=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${i?`with reason: ${i}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Tg,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Tg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});function jj(){let t=()=>{},e=()=>{};return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}const gf=new Map;function qj({fn:t,id:e,shouldSplitBatch:r,wait:i=0,sort:s}){const n=async()=>{const l=u();o();const h=l.map(({args:f})=>f);h.length!==0&&t(h).then(f=>{s&&Array.isArray(f)&&f.sort(s);for(let m=0;m<l.length;m++){const{resolve:g}=l[m];g?.([f[m],f])}}).catch(f=>{for(let m=0;m<l.length;m++){const{reject:g}=l[m];g?.(f)}})},o=()=>gf.delete(e),a=()=>u().map(({args:l})=>l),u=()=>gf.get(e)||[],c=l=>gf.set(e,[...u(),l]);return{flush:o,async schedule(l){const{promise:h,resolve:f,reject:m}=jj();return r?.([...a(),l])&&n(),u().length>0?(c({args:l,resolve:f,reject:m}),h):(c({args:l,resolve:f,reject:m}),setTimeout(n,i),h)}}}async function Y3(t){return new Promise(e=>setTimeout(e,t))}function Bj(t,{delay:e=100,retryCount:r=2,shouldRetry:i=()=>!0}={}){return new Promise((s,n)=>{const o=async({count:a=0}={})=>{const u=async({error:c})=>{const l=typeof e=="function"?e({count:a,error:c}):e;l&&await Y3(l),o({count:a+1})};try{const c=await t();s(c)}catch(c){if(a<r&&await i({count:a,error:c}))return u({error:c});n(c)}};o()})}const Cp=256;let yl=Cp,wl;function zj(t=11){if(!wl||yl+t>Cp*2){wl="",yl=0;for(let e=0;e<Cp;e++)wl+=(256+Math.random()*256|0).toString(16).substring(1)}return wl.substring(yl,yl+++t)}const vl=new kj(8192);function Hj(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(vl.get(r))return vl.get(r);const i=t().finally(()=>vl.delete(r));return vl.set(r,i),i}function Vj(t,e={}){return async(r,i={})=>{const{dedupe:s=!1,methods:n,retryDelay:o=150,retryCount:a=3,uid:u}={...e,...i},{method:c}=r;if(n?.exclude?.includes(c))throw new Tn(new Error("method not supported"),{method:c});if(n?.include&&!n.include.includes(c))throw new Tn(new Error("method not supported"),{method:c});const l=s?Wj(`${u}.${Mn(r)}`):void 0;return Hj(()=>Bj(async()=>{try{return await t(r)}catch(h){const f=h;switch(f.code){case Kc.code:throw new Kc(f);case Wc.code:throw new Wc(f);case Gc.code:throw new Gc(f,{method:r.method});case Yc.code:throw new Yc(f);case la.code:throw new la(f);case Jc.code:throw new Jc(f);case Qc.code:throw new Qc(f);case Xc.code:throw new Xc(f);case ha.code:throw new ha(f);case Tn.code:throw new Tn(f,{method:r.method});case da.code:throw new da(f);case Zc.code:throw new Zc(f);case kn.code:throw new kn(f);case eu.code:throw new eu(f);case tu.code:throw new tu(f);case ru.code:throw new ru(f);case iu.code:throw new iu(f);case su.code:throw new su(f);case nu.code:throw new nu(f);case ou.code:throw new ou(f);case au.code:throw new au(f);case cu.code:throw new cu(f);case uu.code:throw new uu(f);case lu.code:throw new lu(f);case hu.code:throw new hu(f);case 5e3:throw new kn(f);case fa.code:throw new fa(f);default:throw h instanceof fs?h:new Fj(f)}}},{delay:({count:h,error:f})=>{if(f&&f instanceof Tc){const m=f?.headers?.get("Retry-After");if(m?.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<h)*o},retryCount:a,shouldRetry:({error:h})=>Kj(h)}),{enabled:s,id:l})}}function Kj(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===da.code||t.code===la.code||t.code===429:t instanceof Tc&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function Wj(t,e=0){let r=3735928559^e,i=1103547991^e;for(let s=0;s<t.length;s++){const n=t.charCodeAt(s);r=Math.imul(r^n,2654435761),i=Math.imul(i^n,1597334677)}return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(i^i>>>16,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(r^r>>>16,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(36)}function Gj(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:i}){return new Promise((s,n)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{i&&a.abort()},r)),s(await t({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&n(e),n(a)}finally{clearTimeout(o)}})()})}function Yj(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Xy=Yj();function Jj(t,e={}){const{url:r,headers:i}=Qj(t);return{async request(s){const{body:n,fetchFn:o=e.fetchFn??fetch,onRequest:a=e.onRequest,onResponse:u=e.onResponse,timeout:c=e.timeout??1e4}=s,l={...e.fetchOptions??{},...s.fetchOptions??{}},{headers:h,method:f,signal:m}=l;try{const g=await Gj(async({signal:C})=>{const S={...l,body:Array.isArray(n)?Mn(n.map(T=>({jsonrpc:"2.0",id:T.id??Xy.take(),...T}))):Mn({jsonrpc:"2.0",id:n.id??Xy.take(),...n}),headers:{...i,"Content-Type":"application/json",...h},method:f||"POST",signal:m||(c>0?C:null)},A=new Request(r,S),D=await a?.(A,S)??{...S,url:r};return await o(D.url??r,D)},{errorInstance:new Qy({body:n,url:r}),timeout:c,signal:!0});u&&await u(g);let y;if(g.headers.get("Content-Type")?.startsWith("application/json"))y=await g.json();else{y=await g.text();try{y=JSON.parse(y||"{}")}catch(C){if(g.ok)throw C;y={error:y}}}if(!g.ok){if(typeof y.error?.code=="number"&&typeof y.error?.message=="string")return y;throw new Tc({body:n,details:Mn(y.error)||g.statusText,headers:g.headers,status:g.status,url:r})}return y}catch(g){throw g instanceof Tc||g instanceof Qy?g:new Tc({body:n,cause:g,url:r})}}}}function Qj(t){try{const e=new URL(t),r=(()=>{if(e.username){const i=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;return e.username="",e.password="",{url:e.toString(),headers:{Authorization:`Basic ${btoa(i)}`}}}})();return{url:e.toString(),...r}}catch{return{url:t}}}function J3({key:t,methods:e,name:r,request:i,retryCount:s=3,retryDelay:n=150,timeout:o,type:a},u){const c=zj();return{config:{key:t,methods:e,name:r,request:i,retryCount:s,retryDelay:n,timeout:o,type:a},request:Vj(i,{methods:e,retryCount:s,retryDelay:n,uid:c}),value:u}}function Zy(t,e={}){const{key:r="fallback",name:i="Fallback",rank:s=!1,shouldThrow:n=Xj,retryCount:o,retryDelay:a}=e;return(({chain:u,pollingInterval:c=4e3,timeout:l,...h})=>{let f=t,m=()=>{};const g=J3({key:r,name:i,async request({method:y,params:C}){let S;const A=async(D=0)=>{const O=f[D]({...h,chain:u,retryCount:0,timeout:l});try{const T=await O.request({method:y,params:C});return m({method:y,params:C,response:T,transport:O,status:"success"}),T}catch(T){if(m({error:T,method:y,params:C,transport:O,status:"error"}),n(T)||D===f.length-1||(S??=f.slice(D+1).some(x=>{const{include:M,exclude:U}=x({chain:u}).config.methods||{};return M?M.includes(y):U?!U.includes(y):!0}),!S))throw T;return A(D+1)}};return A()},retryCount:o,retryDelay:a,type:"fallback"},{onResponse:y=>m=y,transports:f.map(y=>y({chain:u,retryCount:0}))});if(s){const y=typeof s=="object"?s:{};Zj({chain:u,interval:y.interval??c,onTransports:C=>f=C,ping:y.ping,sampleCount:y.sampleCount,timeout:y.timeout,transports:f,weights:y.weights})}return g})}function Xj(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===ha.code||t.code===kn.code||t.code===fa.code||Tg.nodeMessage.test(t.message)||t.code===5e3))}function Zj({chain:t,interval:e=4e3,onTransports:r,ping:i,sampleCount:s=10,timeout:n=1e3,transports:o,weights:a={}}){const{stability:u=.7,latency:c=.3}=a,l=[],h=async()=>{const f=await Promise.all(o.map(async y=>{const C=y({chain:t,retryCount:0,timeout:n}),S=Date.now();let A,D;try{await(i?i({transport:C}):C.request({method:"net_listening"})),D=1}catch{D=0}finally{A=Date.now()}return{latency:A-S,success:D}}));l.push(f),l.length>s&&l.shift();const m=Math.max(...l.map(y=>Math.max(...y.map(({latency:C})=>C)))),g=o.map((y,C)=>{const S=l.map(x=>x[C].latency),D=1-S.reduce((x,M)=>x+M,0)/S.length/m,O=l.map(x=>x[C].success),T=O.reduce((x,M)=>x+M,0)/O.length;return T===0?[0,C]:[c*D+u*T,C]}).sort((y,C)=>C[0]-y[0]);r(g.map(([,y])=>o[y])),await Y3(e),h()};h()}class eq extends fs{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function bf(t,e={}){const{batch:r,fetchFn:i,fetchOptions:s,key:n="http",methods:o,name:a="HTTP JSON-RPC",onFetchRequest:u,onFetchResponse:c,retryDelay:l,raw:h}=e;return({chain:f,retryCount:m,timeout:g})=>{const{batchSize:y=1e3,wait:C=0}=typeof r=="object"?r:{},S=e.retryCount??m,A=g??e.timeout??1e4,D=t||f?.rpcUrls.default.http[0];if(!D)throw new eq;const O=Jj(D,{fetchFn:i,fetchOptions:s,onRequest:u,onResponse:c,timeout:A});return J3({key:n,methods:o,name:a,async request({method:T,params:x}){const M={method:T,params:x},{schedule:U}=qj({id:D,wait:C,shouldSplitBatch(d){return d.length>y},fn:d=>O.request({body:d}),sort:(d,b)=>d.id-b.id}),R=async d=>r?U(d):[await O.request({body:d})],[{error:L,result:$}]=await R(M);if(h)return{error:L,result:$};if(L)throw new G3({body:M,error:L,url:D});return $},retryCount:S,retryDelay:l,timeout:A,type:"http"},{fetchOptions:s,url:D})}}const mf={createBalance(t,e){const r={name:t.metadata.name||"",symbol:t.metadata.symbol||"",decimals:t.metadata.decimals||0,value:t.metadata.value||0,price:t.metadata.price||0,iconUrl:t.metadata.iconUrl||""};return{name:r.name,symbol:r.symbol,chainId:e,address:t.address==="native"?void 0:this.convertAddressToCAIP10Address(t.address,e),value:r.value,price:r.price,quantity:{decimals:r.decimals.toString(),numeric:this.convertHexToBalance({hex:t.balance,decimals:r.decimals})},iconUrl:r.iconUrl}},convertHexToBalance({hex:t,decimals:e}){return Uj(BigInt(t),e)},convertAddressToCAIP10Address(t,e){return`${e}:${t}`},createCAIP2ChainId(t,e){return`${e}:${parseInt(t,16)}`},getChainIdHexFromCAIP2ChainId(t){const e=t.split(":");if(e.length<2||!e[1])return"0x0";const r=e[1],i=parseInt(r,10);return isNaN(i)?"0x0":`0x${i.toString(16)}`},isWalletGetAssetsResponse(t){return typeof t!="object"||t===null?!1:Object.values(t).every(e=>Array.isArray(e)&&e.every(r=>this.isValidAsset(r)))},isValidAsset(t){return typeof t=="object"&&t!==null&&typeof t.address=="string"&&typeof t.balance=="string"&&(t.type==="ERC20"||t.type==="NATIVE")&&typeof t.metadata=="object"&&t.metadata!==null&&typeof t.metadata.name=="string"&&typeof t.metadata.symbol=="string"&&typeof t.metadata.decimals=="number"&&typeof t.metadata.price=="number"&&typeof t.metadata.iconUrl=="string"}},ew={async getMyTokensWithBalance(t){const e=oe.state.address,r=F.state.activeCaipNetwork;if(!e||!r)return[];if(r.chainNamespace==="eip155"){const s=await this.getEIP155Balances(e,r);if(s)return this.filterLowQualityTokens(s)}const i=await ue.getBalance(e,r.caipNetworkId,t);return this.filterLowQualityTokens(i.balances)},async getEIP155Balances(t,e){try{const r=mf.getChainIdHexFromCAIP2ChainId(e.caipNetworkId);if(!(await ut.getCapabilities(t))?.[r]?.assetDiscovery?.supported)return null;const s=await ut.walletGetAssets({account:t,chainFilter:[r]});return mf.isWalletGetAssetsResponse(s)?(s[r]||[]).map(o=>mf.createBalance(o,e.caipNetworkId)):null}catch{return null}},filterLowQualityTokens(t){return t.filter(e=>e.quantity.decimals!=="0")},mapBalancesToSwapTokens(t){return t?.map(e=>({...e,address:e?.address?e.address:F.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1}))||[]}},Ae=Tt({tokenBalances:[],loading:!1}),tw={state:Ae,subscribe(t){return Fr(Ae,()=>t(Ae))},subscribeKey(t,e){return gi(Ae,t,e)},setToken(t){t&&(Ae.token=qn(t))},setTokenAmount(t){Ae.sendTokenAmount=t},setReceiverAddress(t){Ae.receiverAddress=t},setReceiverProfileImageUrl(t){Ae.receiverProfileImageUrl=t},setReceiverProfileName(t){Ae.receiverProfileName=t},setGasPrice(t){Ae.gasPrice=t},setGasPriceInUsd(t){Ae.gasPriceInUSD=t},setNetworkBalanceInUsd(t){Ae.networkBalanceInUSD=t},setLoading(t){Ae.loading=t},sendToken(){switch(F.state.activeCaipNetwork?.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw new Error("Unsupported chain")}},sendEvmToken(){this.state.token?.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(lt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:F.state.activeCaipNetwork?.caipNetworkId||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&this.state.token?.quantity.decimals&&(lt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol,amount:this.state.sendTokenAmount,network:F.state.activeCaipNetwork?.caipNetworkId||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async fetchTokenBalance(t){Ae.loading=!0;const e=F.state.activeCaipNetwork?.caipNetworkId,r=F.state.activeCaipNetwork?.chainNamespace,i=F.state.activeCaipAddress,s=i?pe.getPlainAddress(i):void 0;if(Ae.lastRetry&&!pe.isAllowedRetry(Ae.lastRetry,30*Jr.ONE_SEC_MS))return Ae.loading=!1,[];try{if(s&&e&&r){const n=await ew.getMyTokensWithBalance();return Ae.tokenBalances=n,Ae.lastRetry=void 0,n}}catch(n){Ae.lastRetry=Date.now(),t?.(n),Ir.showError("Token Balance Unavailable")}finally{Ae.loading=!1}return[]},fetchNetworkBalance(){if(Ae.tokenBalances.length===0)return;const t=ew.mapBalancesToSwapTokens(Ae.tokenBalances);if(!t)return;const e=t.find(r=>r.address===F.getActiveNetworkTokenAddress());e&&(Ae.networkBalanceInUSD=e?bl.multiply(e.quantity.numeric,e.price).toString():"0")},isInsufficientNetworkTokenForGas(t,e){const r=e||"0";return bl.bigNumber(t).eq(0)?!0:bl.bigNumber(bl.bigNumber(r)).gt(t)},hasInsufficientGasFunds(){let t=!0;return oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT?t=!1:Ae.networkBalanceInUSD&&(t=this.isInsufficientNetworkTokenForGas(Ae.networkBalanceInUSD,Ae.gasPriceInUSD)),t},async sendNativeToken(t){He.pushTransactionStack({view:"Account",goBack:!1});const e=t.receiverAddress,r=oe.state.address,i=ut.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),s="0x";try{await ut.sendTransaction({chainNamespace:"eip155",to:e,address:r,data:s,value:i??BigInt(0),gasPrice:t.gasPrice}),Ir.showSuccess("Transaction started"),lt.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol||"",amount:t.sendTokenAmount,network:F.state.activeCaipNetwork?.caipNetworkId||""}}),this.resetSend()}catch(n){console.error("SendController:sendERC20Token - failed to send native token",n);const o=n instanceof Error?n.message:"Unknown error";lt.sendEvent({type:"track",event:"SEND_ERROR",properties:{message:o,isSmartAccount:oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol||"",amount:t.sendTokenAmount,network:F.state.activeCaipNetwork?.caipNetworkId||""}}),Ir.showError("Something went wrong")}},async sendERC20Token(t){He.pushTransactionStack({view:"Account",goBack:!1});const e=ut.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));try{if(oe.state.address&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress){const r=pe.getPlainAddress(t.tokenAddress);await ut.writeContract({fromAddress:oe.state.address,tokenAddress:r,args:[t.receiverAddress,e??BigInt(0)],method:"transfer",abi:jF.getERC20Abi(r),chainNamespace:"eip155"}),Ir.showSuccess("Transaction started"),this.resetSend()}}catch(r){console.error("SendController:sendERC20Token - failed to send erc20 token",r);const i=r instanceof Error?r.message:"Unknown error";lt.sendEvent({type:"track",event:"SEND_ERROR",properties:{message:i,isSmartAccount:oe.state.preferredAccountType===Ys.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol||"",amount:t.sendTokenAmount,network:F.state.activeCaipNetwork?.caipNetworkId||""}}),Ir.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){Ir.showError("Please enter a valid amount and receiver address");return}He.pushTransactionStack({view:"Account",goBack:!1}),ut.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),oe.fetchTokenBalance()}).catch(t=>{Ir.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",t)})},resetSend(){Ae.token=void 0,Ae.sendTokenAmount=void 0,Ae.receiverAddress=void 0,Ae.receiverProfileImageUrl=void 0,Ae.receiverProfileName=void 0,Ae.loading=!1,Ae.tokenBalances=[]}},yf={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[],user:void 0},_l={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},ee=Tt({chains:KF(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0},isSwitchingNamespace:!1}),F={state:ee,subscribe(t){return Fr(ee,()=>{t(ee)})},subscribeKey(t,e){return gi(ee,t,e)},subscribeChainProp(t,e,r){let i;return Fr(ee.chains,()=>{const s=r||ee.activeChain;if(s){const n=ee.chains.get(s)?.[t];i!==n&&(i=n,e(n))}})},initialize(t,e,r){const{chainId:i,namespace:s}=se.getActiveNetworkProps(),n=e?.find(c=>c.id.toString()===i?.toString()),a=t.find(c=>c?.namespace===s)||t?.[0],u=new Set([...e?.map(c=>c.chainNamespace)??[]]);(t?.length===0||!a)&&(ee.noAdapters=!0),ee.noAdapters||(ee.activeChain=a?.namespace,ee.activeCaipNetwork=n,this.setChainNetworkData(a?.namespace,{caipNetwork:n}),ee.activeChain&&Ps.set({activeChain:a?.namespace})),u.forEach(c=>{const l=e?.filter(h=>h.chainNamespace===c);F.state.chains.set(c,{namespace:c,networkState:Tt({..._l,caipNetwork:l?.[0]}),accountState:Tt(yf),caipNetworks:l??[],...r}),this.setRequestedCaipNetworks(l??[],c)})},removeAdapter(t){if(ee.activeChain===t){const e=Array.from(ee.chains.entries()).find(([r])=>r!==t);if(e){const r=e[1]?.caipNetworks?.[0];r&&this.setActiveCaipNetwork(r)}}ee.chains.delete(t)},addAdapter(t,{networkControllerClient:e,connectionControllerClient:r},i){ee.chains.set(t.namespace,{namespace:t.namespace,networkState:{..._l,caipNetwork:i[0]},accountState:yf,caipNetworks:i,connectionControllerClient:r,networkControllerClient:e}),this.setRequestedCaipNetworks(i?.filter(s=>s.chainNamespace===t.namespace)??[],t.namespace)},addNetwork(t){const e=ee.chains.get(t.chainNamespace);if(e){const r=[...e.caipNetworks||[]];e.caipNetworks?.find(i=>i.id===t.id)||r.push(t),ee.chains.set(t.chainNamespace,{...e,caipNetworks:r}),this.setRequestedCaipNetworks(r,t.chainNamespace)}},removeNetwork(t,e){const r=ee.chains.get(t);if(r){const i=ee.activeCaipNetwork?.id===e,s=[...r.caipNetworks?.filter(n=>n.id!==e)||[]];i&&r?.caipNetworks?.[0]&&this.setActiveCaipNetwork(r.caipNetworks[0]),ee.chains.set(t,{...r,caipNetworks:s}),this.setRequestedCaipNetworks(s||[],t)}},setAdapterNetworkState(t,e){const r=ee.chains.get(t);r&&(r.networkState={...r.networkState||_l,...e},ee.chains.set(t,r))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const i=ee.chains.get(t);if(i){const s={...i.accountState||yf,...e};ee.chains.set(t,{...i,accountState:s}),(ee.chains.size===1||ee.activeChain===t)&&(e.caipAddress&&(ee.activeCaipAddress=e.caipAddress),oe.replaceState(s))}},setChainNetworkData(t,e){if(!t)return;const r=ee.chains.get(t);if(r){const i={...r.networkState||_l,...e};ee.chains.set(t,{...r,networkState:i})}},setAccountProp(t,e,r,i=!0){this.setChainAccountData(r,{[t]:e},i),t==="status"&&e==="disconnected"&&r&&fe.removeConnectorId(r)},setActiveNamespace(t){ee.activeChain=t;const e=t?ee.chains.get(t):void 0,r=e?.networkState?.caipNetwork;r?.id&&t&&(ee.activeCaipAddress=e?.accountState?.caipAddress,ee.activeCaipNetwork=r,this.setChainNetworkData(t,{caipNetwork:r}),se.setActiveCaipNetworkId(r?.caipNetworkId),Ps.set({activeChain:t,selectedNetworkId:r?.caipNetworkId}))},setActiveCaipNetwork(t){if(!t)return;ee.activeChain!==t.chainNamespace&&this.setIsSwitchingNamespace(!0);const e=ee.chains.get(t.chainNamespace);ee.activeChain=t.chainNamespace,ee.activeCaipNetwork=t,this.setChainNetworkData(t.chainNamespace,{caipNetwork:t}),e?.accountState?.address?ee.activeCaipAddress=`${t.chainNamespace}:${t.id}:${e?.accountState?.address}`:ee.activeCaipAddress=void 0,this.setAccountProp("caipAddress",ee.activeCaipAddress,t.chainNamespace),e&&oe.replaceState(e.accountState),tw.resetSend(),Ps.set({activeChain:ee.activeChain,selectedNetworkId:ee.activeCaipNetwork?.caipNetworkId}),se.setActiveCaipNetworkId(t.caipNetworkId),!this.checkIfSupportedNetwork(t.chainNamespace)&&J.state.enableNetworkSwitch&&!J.state.allowUnsupportedChain&&!ut.state.wcBasic&&this.showUnsupportedChainUI()},addCaipNetwork(t){if(!t)return;const e=ee.chains.get(t.chainNamespace);e&&e?.caipNetworks?.push(t)},async switchActiveNamespace(t){if(!t)return;const e=t!==F.state.activeChain,r=F.getNetworkData(t)?.caipNetwork,i=F.getCaipNetworkByNamespace(t,r?.id);e&&i&&await F.switchActiveNetwork(i)},async switchActiveNetwork(t){!F.state.chains.get(F.state.activeChain)?.caipNetworks?.some(s=>s.id===ee.activeCaipNetwork?.id)&&He.goBack();const i=this.getNetworkControllerClient(t.chainNamespace);i&&(await i.switchCaipNetwork(t),lt.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.caipNetworkId}}))},getNetworkControllerClient(t){const e=t||ee.activeChain,r=ee.chains.get(e);if(!r)throw new Error("Chain adapter not found");if(!r.networkControllerClient)throw new Error("NetworkController client not set");return r.networkControllerClient},getConnectionControllerClient(t){const e=t||ee.activeChain;if(!e)throw new Error("Chain is required to get connection controller client");const r=ee.chains.get(e);if(!r?.connectionControllerClient)throw new Error("ConnectionController client not set");return r.connectionControllerClient},getAccountProp(t,e){let r=ee.activeChain;if(e&&(r=e),!r)return;const i=ee.chains.get(r)?.accountState;if(i)return i[t]},getNetworkProp(t,e){const r=ee.chains.get(e)?.networkState;if(r)return r[t]},getRequestedCaipNetworks(t){const e=ee.chains.get(t),{approvedCaipNetworkIds:r=[],requestedCaipNetworks:i=[]}=e?.networkState||{};return pe.sortRequestedNetworks(r,i)},getAllRequestedCaipNetworks(){const t=[];return ee.chains.forEach(e=>{const r=this.getRequestedCaipNetworks(e.namespace);t.push(...r)}),t},setRequestedCaipNetworks(t,e){this.setAdapterNetworkState(e,{requestedCaipNetworks:t})},getAllApprovedCaipNetworkIds(){const t=[];return ee.chains.forEach(e=>{const r=this.getApprovedCaipNetworkIds(e.namespace);t.push(...r)}),t},getActiveCaipNetwork(){return ee.activeCaipNetwork},getActiveCaipAddress(){return ee.activeCaipAddress},getApprovedCaipNetworkIds(t){return ee.chains.get(t)?.networkState?.approvedCaipNetworkIds||[]},async setApprovedCaipNetworksData(t){const r=await this.getNetworkControllerClient()?.getApprovedCaipNetworksData();this.setAdapterNetworkState(t,{approvedCaipNetworkIds:r?.approvedCaipNetworkIds,supportsAllNetworks:r?.supportsAllNetworks})},checkIfSupportedNetwork(t,e){const r=e||ee.activeCaipNetwork,i=this.getRequestedCaipNetworks(t);return i.length?i?.some(s=>s.id===r?.id):!0},checkIfSupportedChainId(t){return ee.activeChain?this.getRequestedCaipNetworks(ee.activeChain)?.some(r=>r.id===t):!0},setSmartAccountEnabledNetworks(t,e){this.setAdapterNetworkState(e,{smartAccountEnabledNetworks:t})},checkIfSmartAccountEnabled(){const t=L3.caipNetworkIdToNumber(ee.activeCaipNetwork?.caipNetworkId),e=ee.activeChain;return!e||!t?!1:!!this.getNetworkProp("smartAccountEnabledNetworks",e)?.includes(Number(t))},getActiveNetworkTokenAddress(){const t=ee.activeCaipNetwork?.chainNamespace||"eip155",e=ee.activeCaipNetwork?.id||1,r=Jr.NATIVE_TOKEN_ADDRESS[t];return`${t}:${e}:${r}`},showUnsupportedChainUI(){Qt.open({view:"UnsupportedChain"})},checkIfNamesSupported(){const t=ee.activeCaipNetwork;return!!(t?.chainNamespace&&Jr.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(t.chainNamespace))},resetNetwork(t){this.setAdapterNetworkState(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},resetAccount(t){const e=t;if(!e)throw new Error("Chain is required to set account prop");ee.activeCaipAddress=void 0,this.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,allAccounts:[],user:void 0,status:"disconnected"}),fe.removeConnectorId(e)},async disconnect(t){const e=rj(t);try{tw.resetSend();const r=await Promise.allSettled(e.map(async([s,n])=>{try{const{caipAddress:o}=this.getAccountData(s)||{};o&&n.connectionControllerClient?.disconnect&&await n.connectionControllerClient.disconnect(s),this.resetAccount(s),this.resetNetwork(s)}catch(o){throw new Error(`Failed to disconnect chain ${s}: ${o.message}`)}}));ut.resetWcConnection();const i=r.filter(s=>s.status==="rejected");if(i.length>0)throw new Error(i.map(s=>s.reason.message).join(", "));se.deleteConnectedSocialProvider(),t?fe.removeConnectorId(t):fe.resetConnectorIds(),lt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:t||"all"}})}catch(r){console.error(r.message||"Failed to disconnect chains"),lt.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:r.message||"Failed to disconnect chains"}})}},setIsSwitchingNamespace(t){ee.isSwitchingNamespace=t},getFirstCaipNetworkSupportsAuthConnector(){const t=[];let e;if(ee.chains.forEach(r=>{ne.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(i=>i===r.namespace)&&r.namespace&&t.push(r.namespace)}),t.length>0){const r=t[0];return e=r?ee.chains.get(r)?.caipNetworks?.[0]:void 0,e}},getAccountData(t){return t?F.state.chains.get(t)?.accountState:oe.state},getNetworkData(t){const e=t||ee.activeChain;if(e)return F.state.chains.get(e)?.networkState},getCaipNetworkByNamespace(t,e){if(!t)return;const r=F.state.chains.get(t),i=r?.caipNetworks?.find(s=>s.id===e);return i||r?.networkState?.caipNetwork||r?.caipNetworks?.[0]},getRequestedCaipNetworkIds(){const t=fe.state.filterByNamespace;return(t?[ee.chains.get(t)]:Array.from(ee.chains.values())).flatMap(r=>r?.caipNetworks||[]).map(r=>r.caipNetworkId)}},tq={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},Q3=pe.getBlockchainApiUrl(),ii=Tt({clientId:null,api:new jh({baseUrl:Q3,clientId:null}),supportedChains:{http:[],ws:[]}}),ue={state:ii,async get(t){const{st:e,sv:r}=ue.getSdkProperties(),i=J.state.projectId,s={...t.params||{},st:e,sv:r,projectId:i};return ii.api.get({...t,params:s})},getSdkProperties(){const{sdkType:t,sdkVersion:e}=J.state;return{st:t||"unknown",sv:e||"unknown"}},async isNetworkSupported(t){if(!t)return!1;try{ii.supportedChains.http.length||await ue.getSupportedNetworks()}catch{return!1}return ii.supportedChains.http.includes(t)},async getSupportedNetworks(){const t=await ue.get({path:"v1/supported-chains"});return ii.supportedChains=t,t},async fetchIdentity({address:t,caipNetworkId:e}){if(!await ue.isNetworkSupported(e))return{avatar:"",name:""};const i=se.getIdentityFromCacheForAddress(t);if(i)return i;const s=await ue.get({path:`/v1/identity/${t}`,params:{sender:F.state.activeCaipAddress?pe.getPlainAddress(F.state.activeCaipAddress):void 0}});return se.updateIdentityCache({address:t,identity:s,timestamp:Date.now()}),s},async fetchTransactions({account:t,cursor:e,onramp:r,signal:i,cache:s,chainId:n}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:`/v1/account/${t}/history`,params:{cursor:e,onramp:r,chainId:n},signal:i,cache:s}):{data:[],next:void 0}},async fetchSwapQuote({amount:t,userAddress:e,from:r,to:i,gasPrice:s}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:t,userAddress:e,from:r,to:i,gasPrice:s}}):{quotes:[]}},async fetchSwapTokens({chainId:t}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:"/v1/convert/tokens",params:{chainId:t}}):{tokens:[]}},async fetchTokenPrice({addresses:t}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ii.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:t,projectId:J.state.projectId},headers:{"Content-Type":"application/json"}}):{fungibles:[]}},async fetchSwapAllowance({tokenAddress:t,userAddress:e}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:"/v1/convert/allowance",params:{tokenAddress:t,userAddress:e},headers:{"Content-Type":"application/json"}}):{allowance:"0"}},async fetchGasPrice({chainId:t}){const{st:e,sv:r}=ue.getSdkProperties();if(!await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Gas Price");return ue.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:t,st:e,sv:r}})},async generateSwapCalldata({amount:t,from:e,to:r,userAddress:i,disableEstimate:s}){if(!await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Swaps");return ii.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Jr.CONVERT_SLIPPAGE_TOLERANCE},projectId:J.state.projectId,from:e,to:r,userAddress:i,disableEstimate:s}})},async generateApproveCalldata({from:t,to:e,userAddress:r}){const{st:i,sv:s}=ue.getSdkProperties();if(!await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Swaps");return ue.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"},params:{userAddress:r,from:t,to:e,st:i,sv:s}})},async getBalance(t,e,r){const{st:i,sv:s}=ue.getSdkProperties();if(!await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId))return Ir.showError("Token Balance Unavailable"),{balances:[]};const o=`${e}:${t}`,a=se.getBalanceCacheForCaipAddress(o);if(a)return a;const u=await ue.get({path:`/v1/account/${t}/balance`,params:{currency:"usd",chainId:e,forceUpdate:r,st:i,sv:s}});return se.updateBalanceCache({caipAddress:o,balance:u,timestamp:Date.now()}),u},async lookupEnsName(t){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:`/v1/profile/account/${t}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]}},async reverseLookupEnsName({address:t}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:`/v1/profile/reverse/${t}`,params:{sender:oe.state.address,apiVersion:"2"}}):[]},async getEnsNameSuggestions(t){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:`/v1/profile/suggestions/${t}`,params:{zone:"reown.id"}}):{suggestions:[]}},async registerEnsName({coinType:t,address:e,message:r,signature:i}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ii.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:i},headers:{"Content-Type":"application/json"}}):{success:!1}},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:i,paymentAmount:s}){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?(await ii.api.post({path:"/v1/generators/onrampurl",params:{projectId:J.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:i,presetFiatAmount:s}})).url:""},async getOnrampOptions(){if(!await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await ue.get({path:"/v1/onramp/options"})}catch{return tq}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:i}){try{return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?await ii.api.post({path:"/v1/onramp/quote",params:{projectId:J.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:i}}):null}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},async getSmartSessions(t){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ue.get({path:`/v1/sessions/${t}`}):[]},async revokeSmartSession(t,e,r){return await ue.isNetworkSupported(F.state.activeCaipNetwork?.caipNetworkId)?ii.api.post({path:`/v1/sessions/${t}/revoke`,params:{projectId:J.state.projectId},body:{pci:e,signature:r}}):{success:!1}},setClientId(t){ii.clientId=t,ii.api=new jh({baseUrl:Q3,clientId:t})}},ts=Tt({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),oe={state:ts,replaceState(t){t&&Object.assign(ts,qn(t))},subscribe(t){return F.subscribeChainProp("accountState",e=>{if(e)return t(e)})},subscribeKey(t,e,r){let i;return F.subscribeChainProp("accountState",s=>{if(s){const n=s[t];i!==n&&(i=n,e(n))}},r)},setStatus(t,e){F.setAccountProp("status",t,e)},getCaipAddress(t){return F.getAccountProp("caipAddress",t)},setCaipAddress(t,e){const r=t?pe.getPlainAddress(t):void 0;e===F.state.activeChain&&(F.state.activeCaipAddress=t),F.setAccountProp("caipAddress",t,e),F.setAccountProp("address",r,e)},setBalance(t,e,r){F.setAccountProp("balance",t,r),F.setAccountProp("balanceSymbol",e,r)},setProfileName(t,e){F.setAccountProp("profileName",t,e)},setProfileImage(t,e){F.setAccountProp("profileImage",t,e)},setUser(t,e){F.setAccountProp("user",t,e)},setAddressExplorerUrl(t,e){F.setAccountProp("addressExplorerUrl",t,e)},setSmartAccountDeployed(t,e){F.setAccountProp("smartAccountDeployed",t,e)},setCurrentTab(t){F.setAccountProp("currentTab",t,F.state.activeChain)},setTokenBalance(t,e){t&&F.setAccountProp("tokenBalance",t,e)},setShouldUpdateToAddress(t,e){F.setAccountProp("shouldUpdateToAddress",t,e)},setAllAccounts(t,e){F.setAccountProp("allAccounts",t,e)},addAddressLabel(t,e,r){const i=F.getAccountProp("addressLabels",r)||new Map;i.set(t,e),F.setAccountProp("addressLabels",i,r)},removeAddressLabel(t,e){const r=F.getAccountProp("addressLabels",e)||new Map;r.delete(t),F.setAccountProp("addressLabels",r,e)},setConnectedWalletInfo(t,e){F.setAccountProp("connectedWalletInfo",t,e,!1)},setPreferredAccountType(t,e){F.setAccountProp("preferredAccountType",t,e)},setSocialProvider(t,e){t&&F.setAccountProp("socialProvider",t,e)},setSocialWindow(t,e){F.setAccountProp("socialWindow",t?qn(t):void 0,e)},setFarcasterUrl(t,e){F.setAccountProp("farcasterUrl",t,e)},async fetchTokenBalance(t){ts.balanceLoading=!0;const e=F.state.activeCaipNetwork?.caipNetworkId,r=F.state.activeCaipNetwork?.chainNamespace,i=F.state.activeCaipAddress,s=i?pe.getPlainAddress(i):void 0;if(ts.lastRetry&&!pe.isAllowedRetry(ts.lastRetry,30*Jr.ONE_SEC_MS))return ts.balanceLoading=!1,[];try{if(s&&e&&r){const o=(await ue.getBalance(s,e)).balances.filter(a=>a.quantity.decimals!=="0");return this.setTokenBalance(o,r),ts.lastRetry=void 0,ts.balanceLoading=!1,o}}catch(n){ts.lastRetry=Date.now(),t?.(n),Ir.showError("Token Balance Unavailable")}finally{ts.balanceLoading=!1}return[]},resetAccount(t){F.resetAccount(t)}},zr=Tt({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),Qt={state:zr,subscribe(t){return Fr(zr,()=>t(zr))},subscribeKey(t,e){return gi(zr,t,e)},async open(t){const e=oe.state.status==="connected";ut.state.wcBasic?be.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1}):await be.prefetch({fetchConnectorImages:!e,fetchFeaturedWallets:!e,fetchRecommendedWallets:!e}),t?.namespace?(await F.switchActiveNamespace(t.namespace),Qt.setLoading(!0,t.namespace)):Qt.setLoading(!0),fe.setFilterByNamespace(t?.namespace);const r=F.getAccountData(t?.namespace)?.caipAddress;F.state.noAdapters&&!r?pe.isMobile()?He.reset("AllWallets"):He.reset("ConnectingWalletConnectBasic"):t?.view?He.reset(t.view):r?He.reset("Account"):He.reset("Connect"),zr.open=!0,Ps.set({open:!0}),lt.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!r}})},close(){const t=J.state.enableEmbedded,e=!!F.state.activeCaipAddress;zr.open&<.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:e}}),zr.open=!1,Qt.clearLoading(),t?e?He.replace("Account"):He.push("Connect"):Ps.set({open:!1}),ut.resetUri()},setLoading(t,e){e&&zr.loadingNamespaceMap.set(e,t),zr.loading=t,Ps.set({loading:t})},clearLoading(){zr.loadingNamespaceMap.clear(),zr.loading=!1},shake(){zr.shake||(zr.shake=!0,setTimeout(()=>{zr.shake=!1},500))}},rw=2147483648,rq={convertEVMChainIdToCoinType(t){if(t>=rw)throw new Error("Invalid chainId");return(rw|t)>>>0}},_i=Tt({suggestions:[],loading:!1}),X3={state:_i,subscribe(t){return Fr(_i,()=>t(_i))},subscribeKey(t,e){return gi(_i,t,e)},async resolveName(t){try{return await ue.lookupEnsName(t)}catch(e){const r=e;throw new Error(r?.reasons?.[0]?.description||"Error resolving name")}},async isNameRegistered(t){try{return await ue.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{_i.loading=!0,_i.suggestions=[];const e=await ue.getEnsNameSuggestions(t);return _i.suggestions=e.suggestions.map(r=>({...r,name:r.name}))||[],_i.suggestions}catch(e){const r=this.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{_i.loading=!1}},async getNamesForAddress(t){try{if(!F.state.activeCaipNetwork)return[];const r=se.getEnsFromCacheForAddress(t);if(r)return r;const i=await ue.reverseLookupEnsName({address:t});return se.updateEnsCache({address:t,ens:i,timestamp:Date.now()}),i}catch(e){const r=this.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){const e=F.state.activeCaipNetwork;if(!e)throw new Error("Network not found");const r=oe.state.address,i=fe.getAuthConnector();if(!r||!i)throw new Error("Address or auth connector not found");_i.loading=!0;try{const s=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now()/1e3)});He.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){_i.loading=!1}});const n=await ut.signMessage(s),o=e.id;if(!o)throw new Error("Network not found");const a=rq.convertEVMChainIdToCoinType(Number(o));await ue.registerEnsName({coinType:a,address:r,signature:n,message:s}),oe.setProfileName(t,e.chainNamespace),He.replace("RegisterAccountNameSuccess")}catch(s){const n=this.parseEnsApiError(s,`Error registering name ${t}`);throw He.replace("RegisterAccountName"),new Error(n)}finally{_i.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){return t?.reasons?.[0]?.description||e}};function du(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function iw(t){return du(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const Z3="2.23.2";let wf={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${Z3}`};class Bn extends Error{constructor(e,r={}){const i=r.cause instanceof Bn?r.cause.details:r.cause?.message?r.cause.message:r.details,s=r.cause instanceof Bn&&r.cause.docsPath||r.docsPath,n=wf.getDocsUrl?.({...r,docsPath:s}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...n?[`Docs: ${n}`]:[],...i?[`Details: ${i}`]:[],...wf.version?[`Version: ${wf.version}`]:[]].join(`
|
|
17
|
-
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=Z3}walk(e){return e_(this,e)}}function e_(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?e_(t.cause,e):e?null:t}class t_ extends Bn{constructor({size:e,targetSize:r,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}function $a(t,{dir:e,size:r=32}={}){return typeof t=="string"?iq(t,{dir:e,size:r}):sq(t,{dir:e,size:r})}function iq(t,{dir:e,size:r=32}={}){if(r===null)return t;const i=t.replace("0x","");if(i.length>r*2)throw new t_({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function sq(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new t_({size:t.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const n=e==="right";i[n?s:r-s-1]=t[n?s:t.length-s-1]}return i}class nq extends Bn{constructor({max:e,min:r,signed:i,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class oq extends Bn{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function xa(t,{size:e}){if(iw(t)>e)throw new oq({givenSize:iw(t),maxSize:e})}function $p(t,e={}){const{signed:r}=e;e.size&&xa(t,{size:e.size});const i=BigInt(t);if(!r)return i;const s=(t.length-2)/2,n=(1n<<BigInt(s)*8n-1n)-1n;return i<=n?i:i-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function aq(t,e={}){return Number($p(t,e))}const cq=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function xp(t,e={}){return typeof t=="number"||typeof t=="bigint"?i_(t,e):typeof t=="string"?hq(t,e):typeof t=="boolean"?uq(t,e):r_(t,e)}function uq(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{size:e.size})):r}function r_(t,e={}){let r="";for(let s=0;s<t.length;s++)r+=cq[t[s]];const i=`0x${r}`;return typeof e.size=="number"?(xa(i,{size:e.size}),$a(i,{dir:"right",size:e.size})):i}function i_(t,e={}){const{signed:r,size:i}=e,s=BigInt(t);let n;i?r?n=(1n<<BigInt(i)*8n-1n)-1n:n=2n**(BigInt(i)*8n)-1n:typeof t=="number"&&(n=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof n=="bigint"&&r?-n-1n:0;if(n&&s>n||s<o){const u=typeof t=="bigint"?"n":"";throw new nq({max:n?`${n}${u}`:void 0,min:`${o}${u}`,signed:r,size:i,value:`${t}${u}`})}const a=`0x${(r&&s<0?(1n<<BigInt(i*8))+BigInt(s):s).toString(16)}`;return i?$a(a,{size:i}):a}const lq=new TextEncoder;function hq(t,e={}){const r=lq.encode(t);return r_(r,e)}const dq=new TextEncoder;function fq(t,e={}){return typeof t=="number"||typeof t=="bigint"?gq(t,e):typeof t=="boolean"?pq(t,e):du(t)?s_(t,e):n_(t,e)}function pq(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{size:e.size})):r}const Is={zero:48,nine:57,A:65,F:70,a:97,f:102};function sw(t){if(t>=Is.zero&&t<=Is.nine)return t-Is.zero;if(t>=Is.A&&t<=Is.F)return t-(Is.A-10);if(t>=Is.a&&t<=Is.f)return t-(Is.a-10)}function s_(t,e={}){let r=t;e.size&&(xa(r,{size:e.size}),r=$a(r,{dir:"right",size:e.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,n=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const u=sw(i.charCodeAt(a++)),c=sw(i.charCodeAt(a++));if(u===void 0||c===void 0)throw new Bn(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);n[o]=u*16+c}return n}function gq(t,e){const r=i_(t,e);return s_(r)}function n_(t,e={}){const r=dq.encode(t);return typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{dir:"right",size:e.size})):r}function lh(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function bq(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function qh(t,...e){if(!bq(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function uZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");lh(t.outputLen),lh(t.blockLen)}function nw(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function mq(t,e){qh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const El=BigInt(2**32-1),ow=BigInt(32);function yq(t,e=!1){return e?{h:Number(t&El),l:Number(t>>ow&El)}:{h:Number(t>>ow&El)|0,l:Number(t&El)|0}}function wq(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=yq(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const vq=(t,e,r)=>t<<r|e>>>32-r,_q=(t,e,r)=>e<<r|t>>>32-r,Eq=(t,e,r)=>e<<r-32|t>>>64-r,Iq=(t,e,r)=>t<<r-32|e>>>64-r,Co=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Aq(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function lZ(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function hZ(t,e){return t<<32-e|t>>>e}const aw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Sq(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function cw(t){for(let e=0;e<t.length;e++)t[e]=Sq(t[e])}function Cq(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function o_(t){return typeof t=="string"&&(t=Cq(t)),qh(t),t}function dZ(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];qh(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}class $q{clone(){return this._cloneInto()}}function xq(t){const e=i=>t().update(o_(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function fZ(t=32){if(Co&&typeof Co.getRandomValues=="function")return Co.getRandomValues(new Uint8Array(t));if(Co&&typeof Co.randomBytes=="function")return Co.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const a_=[],c_=[],u_=[],Pq=BigInt(0),lc=BigInt(1),Nq=BigInt(2),Oq=BigInt(7),Tq=BigInt(256),Dq=BigInt(113);for(let t=0,e=lc,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],a_.push(2*(5*i+r)),c_.push((t+1)*(t+2)/2%64);let s=Pq;for(let n=0;n<7;n++)e=(e<<lc^(e>>Oq)*Dq)%Tq,e&Nq&&(s^=lc<<(lc<<BigInt(n))-lc);u_.push(s)}const[Rq,Mq]=wq(u_,!0),uw=(t,e,r)=>r>32?Eq(t,e,r):vq(t,e,r),lw=(t,e,r)=>r>32?Iq(t,e,r):_q(t,e,r);function kq(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=uw(c,l,1)^r[a],f=lw(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=c_[o],u=uw(s,n,a),c=lw(s,n,a),l=a_[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Rq[i],t[1]^=Mq[i]}r.fill(0)}class Dg extends $q{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,lh(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Aq(this.state)}keccak(){aw||cw(this.state32),kq(this.state32,this.rounds),aw||cw(this.state32),this.posOut=0,this.pos=0}update(e){nw(this);const{blockLen:r,state:i}=this;e=o_(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){nw(this,!1),qh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return lh(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(mq(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new Dg(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Uq=(t,e,r)=>xq(()=>new Dg(e,t,r)),Lq=Uq(1,136,256/8);function l_(t,e){const r=e||"hex",i=Lq(du(t,{strict:!1})?fq(t):t);return r==="bytes"?i:xp(i)}class Fq extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}const vf=new Fq(8192);function jq(t,e){if(vf.has(`${t}.${e}`))return vf.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),i=l_(n_(r),"bytes"),s=r.split("");for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(i[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const n=`0x${s.join("")}`;return vf.set(`${t}.${e}`,n),n}function qq(t){const e=l_(`0x${t.substring(4)}`).substring(26);return jq(`0x${e}`)}async function Bq({hash:t,signature:e}){const r=du(t)?t:xp(t),{secp256k1:i}=await Jl(async()=>{const{secp256k1:o}=await import("./secp256k1-C2CXj9YW.js");return{secp256k1:o}},__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10]));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:l,v:h,yParity:f}=e,m=Number(f??h),g=hw(m);return new i.Signature($p(c),$p(l)).addRecoveryBit(g)}const o=du(e)?e:xp(e),a=aq(`0x${o.slice(130)}`),u=hw(a);return i.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(u)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function hw(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function zq({hash:t,signature:e}){return qq(await Bq({hash:t,signature:e}))}var Hq={};const Vq=":";function ia(t){const[e,r]=t.split(Vq);return{namespace:e,reference:r}}function h_(t,e){return t.includes(":")?[t]:e.chains||[]}const Kq="ReactNative",hi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Wq="js";function hh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function hn(){return!Qr.getDocument()&&!!Qr.getNavigator()&&navigator.product===Kq}function Gq(){return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function Yq(){return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Du(){return!hh()&&!!Qr.getNavigator()&&!!Qr.getDocument()}function Ru(){return hn()?hi.reactNative:hh()?hi.node:Du()?hi.browser:hi.unknown}function dw(){var t;try{return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Jq(t,e){const r=new URLSearchParams(t);for(const i of Object.keys(e).sort())if(e.hasOwnProperty(i)){const s=e[i];s!==void 0&&r.set(i,s)}return r.toString()}function d_(){return M1.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function Qq(){if(Ru()===hi.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=D1();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Xq(){var t;const e=Ru();return e===hi.browser?[e,((t=Qr.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function f_(t,e,r){const i=Qq(),s=Xq();return[[t,e].join("-"),[Wq,r].join("-"),i,s].join("/")}function Zq({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:s,projectId:n,useOnCloseEvent:o,bundleId:a,packageName:u}){const c=r.split("?"),l=f_(t,e,i),h={auth:s,ua:l,projectId:n,useOnCloseEvent:o,packageName:u||void 0,bundleId:a||void 0},f=Jq(c[1]||"",h);return c[0]+"?"+f}function Dn(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Pp(t){return Object.fromEntries(t.entries())}function Np(t){return new Map(Object.entries(t))}function Cn(t=B.FIVE_MINUTES,e){const r=B.toMiliseconds(t||B.FIVE_MINUTES);let i,s,n,o;return{resolve:a=>{n&&i&&(clearTimeout(n),i(a),o=Promise.resolve(a))},reject:a=>{n&&s&&(clearTimeout(n),s(a))},done:()=>new Promise((a,u)=>{if(o)return a(o);n=setTimeout(()=>{const c=new Error(e);o=Promise.reject(c),u(c)},r),i=a,s=u})}}function tn(t,e,r){return new Promise(async(i,s)=>{const n=setTimeout(()=>s(new Error(r)),e);try{const o=await t;i(o)}catch(o){s(o)}clearTimeout(n)})}function p_(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function eB(t){return p_("topic",t)}function tB(t){return p_("id",t)}function g_(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function er(t,e){return B.fromMiliseconds(Date.now()+B.toMiliseconds(t))}function Js(t){return Date.now()>=B.toMiliseconds(t)}function Le(t,e){return`${t}${e?`:${e}`:""}`}function Bl(t=[],e=[]){return[...new Set([...t,...e])]}async function rB({id:t,topic:e,wcDeepLink:r}){var i;try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r,n=s?.href;if(typeof n!="string")return;const o=iB(n,t,e),a=Ru();if(a===hi.browser){if(!((i=Qr.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}sB(o)}else a===hi.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(s){console.error(s)}}function iB(t,e,r){const i=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let s=`${t}`;if(t.startsWith("https://t.me")){const n=t.includes("?")?"&startapp=":"?startapp=";s=`${s}${n}${cB(i,!0)}`}else s=`${s}/wc?${i}`;return s}function sB(t){let e="_self";aB()?e="_top":(oB()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function nB(t,e){let r="";try{if(Du()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(i){console.error(i)}return r}function fw(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function pw(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Rg(){return typeof process<"u"&&Hq.IS_VITEST==="true"}function oB(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function aB(){try{return window.self!==window.top}catch{return!1}}function cB(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function b_(t){return Buffer.from(t,"base64").toString("utf-8")}function uB(t){return new Promise(e=>setTimeout(e,t))}function fu(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function lB(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Bh(t,...e){if(!lB(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Mg(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");fu(t.outputLen),fu(t.blockLen)}function pa(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function m_(t,e){Bh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Il=BigInt(2**32-1),gw=BigInt(32);function hB(t,e=!1){return e?{h:Number(t&Il),l:Number(t>>gw&Il)}:{h:Number(t>>gw&Il)|0,l:Number(t&Il)|0}}function dB(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=hB(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const fB=(t,e,r)=>t<<r|e>>>32-r,pB=(t,e,r)=>e<<r|t>>>32-r,gB=(t,e,r)=>e<<r-32|t>>>64-r,bB=(t,e,r)=>t<<r-32|e>>>64-r,$o=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function mB(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function _f(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function rs(t,e){return t<<32-e|t>>>e}const bw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function yB(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function mw(t){for(let e=0;e<t.length;e++)t[e]=yB(t[e])}function wB(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function ga(t){return typeof t=="string"&&(t=wB(t)),Bh(t),t}let kg=class{clone(){return this._cloneInto()}};function y_(t){const e=i=>t().update(ga(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Mu(t=32){if($o&&typeof $o.getRandomValues=="function")return $o.getRandomValues(new Uint8Array(t));if($o&&typeof $o.randomBytes=="function")return $o.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const w_=[],v_=[],__=[],vB=BigInt(0),hc=BigInt(1),_B=BigInt(2),EB=BigInt(7),IB=BigInt(256),AB=BigInt(113);for(let t=0,e=hc,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],w_.push(2*(5*i+r)),v_.push((t+1)*(t+2)/2%64);let s=vB;for(let n=0;n<7;n++)e=(e<<hc^(e>>EB)*AB)%IB,e&_B&&(s^=hc<<(hc<<BigInt(n))-hc);__.push(s)}const[SB,CB]=dB(__,!0),yw=(t,e,r)=>r>32?gB(t,e,r):fB(t,e,r),ww=(t,e,r)=>r>32?bB(t,e,r):pB(t,e,r);function $B(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=yw(c,l,1)^r[a],f=ww(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=v_[o],u=yw(s,n,a),c=ww(s,n,a),l=w_[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=SB[i],t[1]^=CB[i]}r.fill(0)}let xB=class E_ extends kg{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,fu(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=mB(this.state)}keccak(){bw||mw(this.state32),$B(this.state32,this.rounds),bw||mw(this.state32),this.posOut=0,this.pos=0}update(e){pa(this);const{blockLen:r,state:i}=this;e=ga(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){pa(this,!1),Bh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return fu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(m_(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new E_(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const PB=(t,e,r)=>y_(()=>new xB(e,t,r)),NB=PB(1,136,256/8),OB="https://rpc.walletconnect.org/v1";function I_(t){const e=`Ethereum Signed Message:
|
|
17
|
+
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=Z3}walk(e){return e_(this,e)}}function e_(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?e_(t.cause,e):e?null:t}class t_ extends Bn{constructor({size:e,targetSize:r,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}function $a(t,{dir:e,size:r=32}={}){return typeof t=="string"?iq(t,{dir:e,size:r}):sq(t,{dir:e,size:r})}function iq(t,{dir:e,size:r=32}={}){if(r===null)return t;const i=t.replace("0x","");if(i.length>r*2)throw new t_({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function sq(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new t_({size:t.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const n=e==="right";i[n?s:r-s-1]=t[n?s:t.length-s-1]}return i}class nq extends Bn{constructor({max:e,min:r,signed:i,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class oq extends Bn{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function xa(t,{size:e}){if(iw(t)>e)throw new oq({givenSize:iw(t),maxSize:e})}function $p(t,e={}){const{signed:r}=e;e.size&&xa(t,{size:e.size});const i=BigInt(t);if(!r)return i;const s=(t.length-2)/2,n=(1n<<BigInt(s)*8n-1n)-1n;return i<=n?i:i-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function aq(t,e={}){return Number($p(t,e))}const cq=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function xp(t,e={}){return typeof t=="number"||typeof t=="bigint"?i_(t,e):typeof t=="string"?hq(t,e):typeof t=="boolean"?uq(t,e):r_(t,e)}function uq(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{size:e.size})):r}function r_(t,e={}){let r="";for(let s=0;s<t.length;s++)r+=cq[t[s]];const i=`0x${r}`;return typeof e.size=="number"?(xa(i,{size:e.size}),$a(i,{dir:"right",size:e.size})):i}function i_(t,e={}){const{signed:r,size:i}=e,s=BigInt(t);let n;i?r?n=(1n<<BigInt(i)*8n-1n)-1n:n=2n**(BigInt(i)*8n)-1n:typeof t=="number"&&(n=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof n=="bigint"&&r?-n-1n:0;if(n&&s>n||s<o){const u=typeof t=="bigint"?"n":"";throw new nq({max:n?`${n}${u}`:void 0,min:`${o}${u}`,signed:r,size:i,value:`${t}${u}`})}const a=`0x${(r&&s<0?(1n<<BigInt(i*8))+BigInt(s):s).toString(16)}`;return i?$a(a,{size:i}):a}const lq=new TextEncoder;function hq(t,e={}){const r=lq.encode(t);return r_(r,e)}const dq=new TextEncoder;function fq(t,e={}){return typeof t=="number"||typeof t=="bigint"?gq(t,e):typeof t=="boolean"?pq(t,e):du(t)?s_(t,e):n_(t,e)}function pq(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{size:e.size})):r}const Is={zero:48,nine:57,A:65,F:70,a:97,f:102};function sw(t){if(t>=Is.zero&&t<=Is.nine)return t-Is.zero;if(t>=Is.A&&t<=Is.F)return t-(Is.A-10);if(t>=Is.a&&t<=Is.f)return t-(Is.a-10)}function s_(t,e={}){let r=t;e.size&&(xa(r,{size:e.size}),r=$a(r,{dir:"right",size:e.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,n=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const u=sw(i.charCodeAt(a++)),c=sw(i.charCodeAt(a++));if(u===void 0||c===void 0)throw new Bn(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);n[o]=u*16+c}return n}function gq(t,e){const r=i_(t,e);return s_(r)}function n_(t,e={}){const r=dq.encode(t);return typeof e.size=="number"?(xa(r,{size:e.size}),$a(r,{dir:"right",size:e.size})):r}function lh(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function bq(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function qh(t,...e){if(!bq(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function uZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");lh(t.outputLen),lh(t.blockLen)}function nw(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function mq(t,e){qh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const El=BigInt(2**32-1),ow=BigInt(32);function yq(t,e=!1){return e?{h:Number(t&El),l:Number(t>>ow&El)}:{h:Number(t>>ow&El)|0,l:Number(t&El)|0}}function wq(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=yq(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const vq=(t,e,r)=>t<<r|e>>>32-r,_q=(t,e,r)=>e<<r|t>>>32-r,Eq=(t,e,r)=>e<<r-32|t>>>64-r,Iq=(t,e,r)=>t<<r-32|e>>>64-r,Co=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Aq(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function lZ(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function hZ(t,e){return t<<32-e|t>>>e}const aw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Sq(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function cw(t){for(let e=0;e<t.length;e++)t[e]=Sq(t[e])}function Cq(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function o_(t){return typeof t=="string"&&(t=Cq(t)),qh(t),t}function dZ(...t){let e=0;for(let i=0;i<t.length;i++){const s=t[i];qh(s),e+=s.length}const r=new Uint8Array(e);for(let i=0,s=0;i<t.length;i++){const n=t[i];r.set(n,s),s+=n.length}return r}class $q{clone(){return this._cloneInto()}}function xq(t){const e=i=>t().update(o_(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function fZ(t=32){if(Co&&typeof Co.getRandomValues=="function")return Co.getRandomValues(new Uint8Array(t));if(Co&&typeof Co.randomBytes=="function")return Co.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const a_=[],c_=[],u_=[],Pq=BigInt(0),lc=BigInt(1),Nq=BigInt(2),Oq=BigInt(7),Tq=BigInt(256),Dq=BigInt(113);for(let t=0,e=lc,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],a_.push(2*(5*i+r)),c_.push((t+1)*(t+2)/2%64);let s=Pq;for(let n=0;n<7;n++)e=(e<<lc^(e>>Oq)*Dq)%Tq,e&Nq&&(s^=lc<<(lc<<BigInt(n))-lc);u_.push(s)}const[Rq,Mq]=wq(u_,!0),uw=(t,e,r)=>r>32?Eq(t,e,r):vq(t,e,r),lw=(t,e,r)=>r>32?Iq(t,e,r):_q(t,e,r);function kq(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=uw(c,l,1)^r[a],f=lw(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=c_[o],u=uw(s,n,a),c=lw(s,n,a),l=a_[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Rq[i],t[1]^=Mq[i]}r.fill(0)}class Dg extends $q{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,lh(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Aq(this.state)}keccak(){aw||cw(this.state32),kq(this.state32,this.rounds),aw||cw(this.state32),this.posOut=0,this.pos=0}update(e){nw(this);const{blockLen:r,state:i}=this;e=o_(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){nw(this,!1),qh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return lh(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(mq(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new Dg(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Uq=(t,e,r)=>xq(()=>new Dg(e,t,r)),Lq=Uq(1,136,256/8);function l_(t,e){const r=e||"hex",i=Lq(du(t,{strict:!1})?fq(t):t);return r==="bytes"?i:xp(i)}class Fq extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}const vf=new Fq(8192);function jq(t,e){if(vf.has(`${t}.${e}`))return vf.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),i=l_(n_(r),"bytes"),s=r.split("");for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(i[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const n=`0x${s.join("")}`;return vf.set(`${t}.${e}`,n),n}function qq(t){const e=l_(`0x${t.substring(4)}`).substring(26);return jq(`0x${e}`)}async function Bq({hash:t,signature:e}){const r=du(t)?t:xp(t),{secp256k1:i}=await Jl(async()=>{const{secp256k1:o}=await import("./secp256k1-UQxLo_3_.js");return{secp256k1:o}},__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10]));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:l,v:h,yParity:f}=e,m=Number(f??h),g=hw(m);return new i.Signature($p(c),$p(l)).addRecoveryBit(g)}const o=du(e)?e:xp(e),a=aq(`0x${o.slice(130)}`),u=hw(a);return i.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(u)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function hw(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function zq({hash:t,signature:e}){return qq(await Bq({hash:t,signature:e}))}var Hq={};const Vq=":";function ia(t){const[e,r]=t.split(Vq);return{namespace:e,reference:r}}function h_(t,e){return t.includes(":")?[t]:e.chains||[]}const Kq="ReactNative",hi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Wq="js";function hh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function hn(){return!Qr.getDocument()&&!!Qr.getNavigator()&&navigator.product===Kq}function Gq(){return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function Yq(){return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Du(){return!hh()&&!!Qr.getNavigator()&&!!Qr.getDocument()}function Ru(){return hn()?hi.reactNative:hh()?hi.node:Du()?hi.browser:hi.unknown}function dw(){var t;try{return hn()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Jq(t,e){const r=new URLSearchParams(t);for(const i of Object.keys(e).sort())if(e.hasOwnProperty(i)){const s=e[i];s!==void 0&&r.set(i,s)}return r.toString()}function d_(){return M1.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function Qq(){if(Ru()===hi.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=D1();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Xq(){var t;const e=Ru();return e===hi.browser?[e,((t=Qr.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function f_(t,e,r){const i=Qq(),s=Xq();return[[t,e].join("-"),[Wq,r].join("-"),i,s].join("/")}function Zq({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:s,projectId:n,useOnCloseEvent:o,bundleId:a,packageName:u}){const c=r.split("?"),l=f_(t,e,i),h={auth:s,ua:l,projectId:n,useOnCloseEvent:o,packageName:u||void 0,bundleId:a||void 0},f=Jq(c[1]||"",h);return c[0]+"?"+f}function Dn(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Pp(t){return Object.fromEntries(t.entries())}function Np(t){return new Map(Object.entries(t))}function Cn(t=B.FIVE_MINUTES,e){const r=B.toMiliseconds(t||B.FIVE_MINUTES);let i,s,n,o;return{resolve:a=>{n&&i&&(clearTimeout(n),i(a),o=Promise.resolve(a))},reject:a=>{n&&s&&(clearTimeout(n),s(a))},done:()=>new Promise((a,u)=>{if(o)return a(o);n=setTimeout(()=>{const c=new Error(e);o=Promise.reject(c),u(c)},r),i=a,s=u})}}function tn(t,e,r){return new Promise(async(i,s)=>{const n=setTimeout(()=>s(new Error(r)),e);try{const o=await t;i(o)}catch(o){s(o)}clearTimeout(n)})}function p_(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function eB(t){return p_("topic",t)}function tB(t){return p_("id",t)}function g_(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function er(t,e){return B.fromMiliseconds(Date.now()+B.toMiliseconds(t))}function Js(t){return Date.now()>=B.toMiliseconds(t)}function Le(t,e){return`${t}${e?`:${e}`:""}`}function Bl(t=[],e=[]){return[...new Set([...t,...e])]}async function rB({id:t,topic:e,wcDeepLink:r}){var i;try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r,n=s?.href;if(typeof n!="string")return;const o=iB(n,t,e),a=Ru();if(a===hi.browser){if(!((i=Qr.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}sB(o)}else a===hi.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(s){console.error(s)}}function iB(t,e,r){const i=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let s=`${t}`;if(t.startsWith("https://t.me")){const n=t.includes("?")?"&startapp=":"?startapp=";s=`${s}${n}${cB(i,!0)}`}else s=`${s}/wc?${i}`;return s}function sB(t){let e="_self";aB()?e="_top":(oB()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function nB(t,e){let r="";try{if(Du()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(i){console.error(i)}return r}function fw(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function pw(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Rg(){return typeof process<"u"&&Hq.IS_VITEST==="true"}function oB(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function aB(){try{return window.self!==window.top}catch{return!1}}function cB(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function b_(t){return Buffer.from(t,"base64").toString("utf-8")}function uB(t){return new Promise(e=>setTimeout(e,t))}function fu(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function lB(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Bh(t,...e){if(!lB(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Mg(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");fu(t.outputLen),fu(t.blockLen)}function pa(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function m_(t,e){Bh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Il=BigInt(2**32-1),gw=BigInt(32);function hB(t,e=!1){return e?{h:Number(t&Il),l:Number(t>>gw&Il)}:{h:Number(t>>gw&Il)|0,l:Number(t&Il)|0}}function dB(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:n,l:o}=hB(t[s],e);[r[s],i[s]]=[n,o]}return[r,i]}const fB=(t,e,r)=>t<<r|e>>>32-r,pB=(t,e,r)=>e<<r|t>>>32-r,gB=(t,e,r)=>e<<r-32|t>>>64-r,bB=(t,e,r)=>t<<r-32|e>>>64-r,$o=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function mB(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function _f(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function rs(t,e){return t<<32-e|t>>>e}const bw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function yB(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function mw(t){for(let e=0;e<t.length;e++)t[e]=yB(t[e])}function wB(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function ga(t){return typeof t=="string"&&(t=wB(t)),Bh(t),t}let kg=class{clone(){return this._cloneInto()}};function y_(t){const e=i=>t().update(ga(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Mu(t=32){if($o&&typeof $o.getRandomValues=="function")return $o.getRandomValues(new Uint8Array(t));if($o&&typeof $o.randomBytes=="function")return $o.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const w_=[],v_=[],__=[],vB=BigInt(0),hc=BigInt(1),_B=BigInt(2),EB=BigInt(7),IB=BigInt(256),AB=BigInt(113);for(let t=0,e=hc,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],w_.push(2*(5*i+r)),v_.push((t+1)*(t+2)/2%64);let s=vB;for(let n=0;n<7;n++)e=(e<<hc^(e>>EB)*AB)%IB,e&_B&&(s^=hc<<(hc<<BigInt(n))-hc);__.push(s)}const[SB,CB]=dB(__,!0),yw=(t,e,r)=>r>32?gB(t,e,r):fB(t,e,r),ww=(t,e,r)=>r>32?bB(t,e,r):pB(t,e,r);function $B(t,e=24){const r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,c=r[u],l=r[u+1],h=yw(c,l,1)^r[a],f=ww(c,l,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=h,t[o+m+1]^=f}let s=t[2],n=t[3];for(let o=0;o<24;o++){const a=v_[o],u=yw(s,n,a),c=ww(s,n,a),l=w_[o];s=t[l],n=t[l+1],t[l]=u,t[l+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=SB[i],t[1]^=CB[i]}r.fill(0)}let xB=class E_ extends kg{constructor(e,r,i,s=!1,n=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=s,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,fu(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=mB(this.state)}keccak(){bw||mw(this.state32),$B(this.state32,this.rounds),bw||mw(this.state32),this.posOut=0,this.pos=0}update(e){pa(this);const{blockLen:r,state:i}=this;e=ga(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(r-this.pos,s-n);for(let a=0;a<o;a++)i[this.pos++]^=e[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:i,blockLen:s}=this;e[i]^=r,(r&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){pa(this,!1),Bh(e),this.finish();const r=this.state,{blockLen:i}=this;for(let s=0,n=e.length;s<n;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,n-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return fu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(m_(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:i,outputLen:s,rounds:n,enableXOF:o}=this;return e||(e=new E_(r,i,s,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const PB=(t,e,r)=>y_(()=>new xB(e,t,r)),NB=PB(1,136,256/8),OB="https://rpc.walletconnect.org/v1";function I_(t){const e=`Ethereum Signed Message:
|
|
18
18
|
${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(NB(r)).toString("hex")}async function TB(t,e,r,i,s,n){switch(r.t){case"eip191":return await DB(t,e,r.s);case"eip1271":return await RB(t,e,r.s,i,s,n);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function DB(t,e,r){return(await zq({hash:I_(e),signature:r})).toLowerCase()===t.toLowerCase()}async function RB(t,e,r,i,s,n){const o=ia(i);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const a="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",l=r.substring(2),h=I_(e).substring(2),f=a+h+u+c+l,m=await fetch(`${n||OB}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:MB(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:g}=await m.json();return g?g.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function MB(){return Date.now()+Math.floor(Math.random()*1e3)}function kB(t){const e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);const i=r[0];if(i===0)throw new Error("No signatures found");const s=1+i*64;if(r.length<s)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const n=Buffer.from(t,"base64").slice(1,65);return Nc.encode(n)}var UB=Object.defineProperty,LB=Object.defineProperties,FB=Object.getOwnPropertyDescriptors,vw=Object.getOwnPropertySymbols,jB=Object.prototype.hasOwnProperty,qB=Object.prototype.propertyIsEnumerable,_w=(t,e,r)=>e in t?UB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BB=(t,e)=>{for(var r in e||(e={}))jB.call(e,r)&&_w(t,r,e[r]);if(vw)for(var r of vw(e))qB.call(e,r)&&_w(t,r,e[r]);return t},zB=(t,e)=>LB(t,FB(e));const HB="did:pkh:",Ug=t=>t?.split(":"),VB=t=>{const e=t&&Ug(t);if(e)return t.includes(HB)?e[3]:e[1]},Op=t=>{const e=t&&Ug(t);if(e)return e[2]+":"+e[3]},dh=t=>{const e=t&&Ug(t);if(e)return e.pop()};async function Ew(t){const{cacao:e,projectId:r}=t,{s:i,p:s}=e,n=A_(s,s.iss),o=dh(s.iss);return await TB(o,n,i,Op(s.iss),r)}const A_=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=dh(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=t.statement||void 0;const n=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${VB(e)}`,u=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,l=t.exp?`Expiration Time: ${t.exp}`:void 0,h=t.nbf?`Not Before: ${t.nbf}`:void 0,f=t.requestId?`Request ID: ${t.requestId}`:void 0,m=t.resources?`Resources:${t.resources.map(y=>`
|
|
19
19
|
- ${y}`).join("")}`:void 0,g=zl(t.resources);if(g){const y=pu(g);s=ez(s,y)}return[r,i,"",s,"",n,o,a,u,c,l,h,f,m].filter(y=>y!=null).join(`
|
|
20
20
|
`)};function KB(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function WB(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function zn(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const i=t.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(s=>{const n=i[s];if(!Array.isArray(n))throw new Error(`Ability limits ${s} must be an array of objects, found: ${n}`);if(!n.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);n.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${o}`)})})})}function GB(t,e,r,i={}){return r?.sort((s,n)=>s.localeCompare(n)),{att:{[t]:YB(e,r,i)}}}function YB(t,e,r={}){e=e?.sort((s,n)=>s.localeCompare(n));const i=e.map(s=>({[`${t}/${s}`]:[r]}));return Object.assign({},...i)}function S_(t){return zn(t),`urn:recap:${KB(t).replace(/=/g,"")}`}function pu(t){const e=WB(t.replace("urn:recap:",""));return zn(e),e}function JB(t,e,r){const i=GB(t,e,r);return S_(i)}function QB(t){return t&&t.includes("urn:recap:")}function XB(t,e){const r=pu(t),i=pu(e),s=ZB(r,i);return S_(s)}function ZB(t,e){zn(t),zn(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((s,n)=>s.localeCompare(n)),i={att:{}};return r.forEach(s=>{var n,o;Object.keys(((n=t.att)==null?void 0:n[s])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[s])||{})).sort((a,u)=>a.localeCompare(u)).forEach(a=>{var u,c;i.att[s]=zB(BB({},i.att[s]),{[a]:((u=t.att[s])==null?void 0:u[a])||((c=e.att[s])==null?void 0:c[a])})})}),i}function ez(t="",e){zn(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let s=0;Object.keys(e.att).forEach(a=>{const u=Object.keys(e.att[a]).map(h=>({ability:h.split("/")[0],action:h.split("/")[1]}));u.sort((h,f)=>h.action.localeCompare(f.action));const c={};u.forEach(h=>{c[h.ability]||(c[h.ability]=[]),c[h.ability].push(h.action)});const l=Object.keys(c).map(h=>(s++,`(${s}) '${h}': '${c[h].join("', '")}' for '${a}'.`));i.push(l.join(", ").replace(".,","."))});const n=i.join(" "),o=`${r}${n}`;return`${t?t+" ":""}${o}`}function Iw(t){var e;const r=pu(t);zn(r);const i=(e=r.att)==null?void 0:e.eip155;return i?Object.keys(i).map(s=>s.split("/")[1]):[]}function Aw(t){const e=pu(t);zn(e);const r=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(s=>{var n;(n=s?.[0])!=null&&n.chains&&r.push(s[0].chains)})}),[...new Set(r.flat())]}function zl(t){if(!t)return;const e=t?.[t.length-1];return QB(e)?e:void 0}function Ef(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function C_(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ci(t,...e){if(!C_(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Sw(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function tz(t,e){ci(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Cw(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}const nn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),rz=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),iz=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!iz)throw new Error("Non little-endian hardware is not supported");function sz(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Tp(t){if(typeof t=="string")t=sz(t);else if(C_(t))t=Dp(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function nz(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function oz(t,e){if(t.length!==e.length)return!1;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return r===0}const az=(t,e)=>{function r(i,...s){if(ci(i),t.nonceLength!==void 0){const c=s[0];if(!c)throw new Error("nonce / iv required");t.varSizeNonce?ci(c):ci(c,t.nonceLength)}const n=t.tagLength;n&&s[1]!==void 0&&ci(s[1]);const o=e(i,...s),a=(c,l)=>{if(l!==void 0){if(c!==2)throw new Error("cipher output not supported");ci(l)}};let u=!1;return{encrypt(c,l){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,ci(c),a(o.encrypt.length,l),o.encrypt(c,l)},decrypt(c,l){if(ci(c),n&&c.length<n)throw new Error("invalid ciphertext length: smaller than tagLength="+n);return a(o.decrypt.length,l),o.decrypt(c,l)}}}return Object.assign(r,t),r};function $w(t,e,r=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!cz(e))throw new Error("invalid output, must be aligned");return e}function xw(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n);t.setUint32(e+4,o,i),t.setUint32(e+0,a,i)}function cz(t){return t.byteOffset%4===0}function Dp(t){return Uint8Array.from(t)}function ba(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const $_=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),uz=$_("expand 16-byte k"),lz=$_("expand 32-byte k"),hz=nn(uz),dz=nn(lz);function xe(t,e){return t<<e|t>>>32-e}function Rp(t){return t.byteOffset%4===0}const Al=64,fz=16,x_=2**32-1,Pw=new Uint32Array;function pz(t,e,r,i,s,n,o,a){const u=s.length,c=new Uint8Array(Al),l=nn(c),h=Rp(s)&&Rp(n),f=h?nn(s):Pw,m=h?nn(n):Pw;for(let g=0;g<u;o++){if(t(e,r,i,l,o,a),o>=x_)throw new Error("arx: counter overflow");const y=Math.min(Al,u-g);if(h&&y===Al){const C=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let S=0,A;S<fz;S++)A=C+S,m[A]=f[A]^l[S];g+=Al;continue}for(let C=0,S;C<y;C++)S=g+C,n[S]=s[S]^c[C];g+=y}}function gz(t,e){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:n,rounds:o}=nz({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return Ef(s),Ef(o),Cw(n),Cw(r),(a,u,c,l,h=0)=>{ci(a),ci(u),ci(c);const f=c.length;if(l===void 0&&(l=new Uint8Array(f)),ci(l),Ef(h),h<0||h>=x_)throw new Error("arx: counter overflow");if(l.length<f)throw new Error(`arx: output (${l.length}) is shorter than data (${f})`);const m=[];let g=a.length,y,C;if(g===32)m.push(y=Dp(a)),C=dz;else if(g===16&&r)y=new Uint8Array(32),y.set(a),y.set(a,16),C=hz,m.push(y);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);Rp(u)||m.push(u=Dp(u));const S=nn(y);if(i){if(u.length!==24)throw new Error("arx: extended nonce must be 24 bytes");i(C,S,nn(u.subarray(0,16)),S),u=u.subarray(16)}const A=16-s;if(A!==u.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const O=new Uint8Array(12);O.set(u,n?0:12-u.length),u=O,m.push(u)}const D=nn(u);return pz(t,C,S,D,c,l,h,o),ba(...m),l}}const vr=(t,e)=>t[e++]&255|(t[e++]&255)<<8;let bz=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=Tp(e),ci(e,32);const r=vr(e,0),i=vr(e,2),s=vr(e,4),n=vr(e,6),o=vr(e,8),a=vr(e,10),u=vr(e,12),c=vr(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|i<<3)&8191,this.r[2]=(i>>>10|s<<6)&7939,this.r[3]=(s>>>7|n<<9)&8191,this.r[4]=(n>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|u<<5)&8065,this.r[8]=(u>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let l=0;l<8;l++)this.pad[l]=vr(e,16+2*l)}process(e,r,i=!1){const s=i?0:2048,{h:n,r:o}=this,a=o[0],u=o[1],c=o[2],l=o[3],h=o[4],f=o[5],m=o[6],g=o[7],y=o[8],C=o[9],S=vr(e,r+0),A=vr(e,r+2),D=vr(e,r+4),O=vr(e,r+6),T=vr(e,r+8),x=vr(e,r+10),M=vr(e,r+12),U=vr(e,r+14);let R=n[0]+(S&8191),L=n[1]+((S>>>13|A<<3)&8191),$=n[2]+((A>>>10|D<<6)&8191),d=n[3]+((D>>>7|O<<9)&8191),b=n[4]+((O>>>4|T<<12)&8191),_=n[5]+(T>>>1&8191),w=n[6]+((T>>>14|x<<2)&8191),v=n[7]+((x>>>11|M<<5)&8191),I=n[8]+((M>>>8|U<<8)&8191),P=n[9]+(U>>>5|s),E=0,p=E+R*a+L*(5*C)+$*(5*y)+d*(5*g)+b*(5*m);E=p>>>13,p&=8191,p+=_*(5*f)+w*(5*h)+v*(5*l)+I*(5*c)+P*(5*u),E+=p>>>13,p&=8191;let N=E+R*u+L*a+$*(5*C)+d*(5*y)+b*(5*g);E=N>>>13,N&=8191,N+=_*(5*m)+w*(5*f)+v*(5*h)+I*(5*l)+P*(5*c),E+=N>>>13,N&=8191;let q=E+R*c+L*u+$*a+d*(5*C)+b*(5*y);E=q>>>13,q&=8191,q+=_*(5*g)+w*(5*m)+v*(5*f)+I*(5*h)+P*(5*l),E+=q>>>13,q&=8191;let H=E+R*l+L*c+$*u+d*a+b*(5*C);E=H>>>13,H&=8191,H+=_*(5*y)+w*(5*g)+v*(5*m)+I*(5*f)+P*(5*h),E+=H>>>13,H&=8191;let z=E+R*h+L*l+$*c+d*u+b*a;E=z>>>13,z&=8191,z+=_*(5*C)+w*(5*y)+v*(5*g)+I*(5*m)+P*(5*f),E+=z>>>13,z&=8191;let V=E+R*f+L*h+$*l+d*c+b*u;E=V>>>13,V&=8191,V+=_*a+w*(5*C)+v*(5*y)+I*(5*g)+P*(5*m),E+=V>>>13,V&=8191;let Y=E+R*m+L*f+$*h+d*l+b*c;E=Y>>>13,Y&=8191,Y+=_*u+w*a+v*(5*C)+I*(5*y)+P*(5*g),E+=Y>>>13,Y&=8191;let te=E+R*g+L*m+$*f+d*h+b*l;E=te>>>13,te&=8191,te+=_*c+w*u+v*a+I*(5*C)+P*(5*y),E+=te>>>13,te&=8191;let ie=E+R*y+L*g+$*m+d*f+b*h;E=ie>>>13,ie&=8191,ie+=_*l+w*c+v*u+I*a+P*(5*C),E+=ie>>>13,ie&=8191;let Z=E+R*C+L*y+$*g+d*m+b*f;E=Z>>>13,Z&=8191,Z+=_*h+w*l+v*c+I*u+P*a,E+=Z>>>13,Z&=8191,E=(E<<2)+E|0,E=E+p|0,p=E&8191,E=E>>>13,N+=E,n[0]=p,n[1]=N,n[2]=q,n[3]=H,n[4]=z,n[5]=V,n[6]=Y,n[7]=te,n[8]=ie,n[9]=Z}finalize(){const{h:e,pad:r}=this,i=new Uint16Array(10);let s=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=s,s=e[a]>>>13,e[a]&=8191;e[0]+=s*5,s=e[0]>>>13,e[0]&=8191,e[1]+=s,s=e[1]>>>13,e[1]&=8191,e[2]+=s,i[0]=e[0]+5,s=i[0]>>>13,i[0]&=8191;for(let a=1;a<10;a++)i[a]=e[a]+s,s=i[a]>>>13,i[a]&=8191;i[9]-=8192;let n=(s^1)-1;for(let a=0;a<10;a++)i[a]&=n;n=~n;for(let a=0;a<10;a++)e[a]=e[a]&n|i[a];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 o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535;ba(i)}update(e){Sw(this);const{buffer:r,blockLen:i}=this;e=Tp(e);const s=e.length;for(let n=0;n<s;){const o=Math.min(i-this.pos,s-n);if(o===i){for(;i<=s-n;n+=i)this.process(e,n);continue}r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===i&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){ba(this.h,this.r,this.buffer,this.pad)}digestInto(e){Sw(this),tz(e,this),this.finished=!0;const{buffer:r,h:i}=this;let{pos:s}=this;if(s){for(r[s++]=1;s<16;s++)r[s]=0;this.process(r,0,!0)}this.finalize();let n=0;for(let o=0;o<8;o++)e[n++]=i[o]>>>0,e[n++]=i[o]>>>8;return e}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}};function mz(t){const e=(i,s)=>t(s).update(Tp(i)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=i=>t(i),e}const yz=mz(t=>new bz(t));function wz(t,e,r,i,s,n=20){let o=t[0],a=t[1],u=t[2],c=t[3],l=e[0],h=e[1],f=e[2],m=e[3],g=e[4],y=e[5],C=e[6],S=e[7],A=s,D=r[0],O=r[1],T=r[2],x=o,M=a,U=u,R=c,L=l,$=h,d=f,b=m,_=g,w=y,v=C,I=S,P=A,E=D,p=O,N=T;for(let H=0;H<n;H+=2)x=x+L|0,P=xe(P^x,16),_=_+P|0,L=xe(L^_,12),x=x+L|0,P=xe(P^x,8),_=_+P|0,L=xe(L^_,7),M=M+$|0,E=xe(E^M,16),w=w+E|0,$=xe($^w,12),M=M+$|0,E=xe(E^M,8),w=w+E|0,$=xe($^w,7),U=U+d|0,p=xe(p^U,16),v=v+p|0,d=xe(d^v,12),U=U+d|0,p=xe(p^U,8),v=v+p|0,d=xe(d^v,7),R=R+b|0,N=xe(N^R,16),I=I+N|0,b=xe(b^I,12),R=R+b|0,N=xe(N^R,8),I=I+N|0,b=xe(b^I,7),x=x+$|0,N=xe(N^x,16),v=v+N|0,$=xe($^v,12),x=x+$|0,N=xe(N^x,8),v=v+N|0,$=xe($^v,7),M=M+d|0,P=xe(P^M,16),I=I+P|0,d=xe(d^I,12),M=M+d|0,P=xe(P^M,8),I=I+P|0,d=xe(d^I,7),U=U+b|0,E=xe(E^U,16),_=_+E|0,b=xe(b^_,12),U=U+b|0,E=xe(E^U,8),_=_+E|0,b=xe(b^_,7),R=R+L|0,p=xe(p^R,16),w=w+p|0,L=xe(L^w,12),R=R+L|0,p=xe(p^R,8),w=w+p|0,L=xe(L^w,7);let q=0;i[q++]=o+x|0,i[q++]=a+M|0,i[q++]=u+U|0,i[q++]=c+R|0,i[q++]=l+L|0,i[q++]=h+$|0,i[q++]=f+d|0,i[q++]=m+b|0,i[q++]=g+_|0,i[q++]=y+w|0,i[q++]=C+v|0,i[q++]=S+I|0,i[q++]=A+P|0,i[q++]=D+E|0,i[q++]=O+p|0,i[q++]=T+N|0}const vz=gz(wz,{counterRight:!1,counterLength:4,allowShortKeys:!1}),_z=new Uint8Array(16),Nw=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(_z.subarray(r))},Ez=new Uint8Array(32);function Ow(t,e,r,i,s){const n=t(e,r,Ez),o=yz.create(n);s&&Nw(o,s),Nw(o,i);const a=new Uint8Array(16),u=rz(a);xw(u,0,BigInt(s?s.length:0),!0),xw(u,8,BigInt(i.length),!0),o.update(a);const c=o.digest();return ba(n,a),c}const Iz=t=>(e,r,i)=>({encrypt(s,n){const o=s.length;n=$w(o+16,n,!1),n.set(s);const a=n.subarray(0,-16);t(e,r,a,a,1);const u=Ow(t,e,r,a,i);return n.set(u,o),ba(u),n},decrypt(s,n){n=$w(s.length-16,n,!1);const o=s.subarray(0,-16),a=s.subarray(-16),u=Ow(t,e,r,o,i);if(!oz(a,u))throw new Error("invalid tag");return n.set(s.subarray(0,-16)),t(e,r,n,n,1),ba(u),n}}),P_=az({blockSize:64,nonceLength:12,tagLength:16},Iz(vz));let N_=class extends kg{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Mg(e);const i=ga(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,n=new Uint8Array(s);n.set(i.length>s?e.create().update(i).digest():i);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=e.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),n.fill(0)}update(e){return pa(this),this.iHash.update(e),this}digestInto(e){pa(this),Bh(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:i,finished:s,destroyed:n,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Lg=(t,e,r)=>new N_(t,e).update(r).digest();Lg.create=(t,e)=>new N_(t,e);function Az(t,e,r){return Mg(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Lg(t,ga(r),ga(e))}const If=new Uint8Array([0]),Tw=new Uint8Array;function Sz(t,e,r,i=32){if(Mg(t),fu(i),i>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/t.outputLen);r===void 0&&(r=Tw);const n=new Uint8Array(s*t.outputLen),o=Lg.create(t,e),a=o._cloneInto(),u=new Uint8Array(o.outputLen);for(let c=0;c<s;c++)If[0]=c+1,a.update(c===0?Tw:u).update(r).update(If).digestInto(u),n.set(u,t.outputLen*c),o._cloneInto(a);return o.destroy(),a.destroy(),u.fill(0),If.fill(0),n.slice(0,i)}const Cz=(t,e,r,i,s)=>Sz(t,Az(t,e,r),i,s);function $z(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);const s=BigInt(32),n=BigInt(4294967295),o=Number(r>>s&n),a=Number(r&n),u=i?4:0,c=i?0:4;t.setUint32(e+u,o,i),t.setUint32(e+c,a,i)}function xz(t,e,r){return t&e^~t&r}function Pz(t,e,r){return t&e^t&r^e&r}class Nz extends kg{constructor(e,r,i,s){super(),this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_f(this.buffer)}update(e){pa(this);const{view:r,buffer:i,blockLen:s}=this;e=ga(e);const n=e.length;for(let o=0;o<n;){const a=Math.min(s-this.pos,n-o);if(a===s){const u=_f(e);for(;s<=n-o;o+=s)this.process(u,o);continue}i.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){pa(this),m_(e,this),this.finished=!0;const{buffer:r,view:i,blockLen:s,isLE:n}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(i,0),o=0);for(let h=o;h<s;h++)r[h]=0;$z(i,s-8,BigInt(this.length*8),n),this.process(i,0);const a=_f(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<c;h++)a.setUint32(4*h,l[h],n)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:i,length:s,finished:n,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=n,e.destroyed=o,s%r&&e.buffer.set(i),e}}const Oz=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Hs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Vs=new Uint32Array(64);let Tz=class extends Nz{constructor(){super(64,32,8,!1),this.A=Hs[0]|0,this.B=Hs[1]|0,this.C=Hs[2]|0,this.D=Hs[3]|0,this.E=Hs[4]|0,this.F=Hs[5]|0,this.G=Hs[6]|0,this.H=Hs[7]|0}get(){const{A:e,B:r,C:i,D:s,E:n,F:o,G:a,H:u}=this;return[e,r,i,s,n,o,a,u]}set(e,r,i,s,n,o,a,u){this.A=e|0,this.B=r|0,this.C=i|0,this.D=s|0,this.E=n|0,this.F=o|0,this.G=a|0,this.H=u|0}process(e,r){for(let h=0;h<16;h++,r+=4)Vs[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){const f=Vs[h-15],m=Vs[h-2],g=rs(f,7)^rs(f,18)^f>>>3,y=rs(m,17)^rs(m,19)^m>>>10;Vs[h]=y+Vs[h-7]+g+Vs[h-16]|0}let{A:i,B:s,C:n,D:o,E:a,F:u,G:c,H:l}=this;for(let h=0;h<64;h++){const f=rs(a,6)^rs(a,11)^rs(a,25),m=l+f+xz(a,u,c)+Oz[h]+Vs[h]|0,g=(rs(i,2)^rs(i,13)^rs(i,22))+Pz(i,s,n)|0;l=c,c=u,u=a,a=o+m|0,o=n,n=s,s=i,i=m+g|0}i=i+this.A|0,s=s+this.B|0,n=n+this.C|0,o=o+this.D|0,a=a+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(i,s,n,o,a,u,c,l)}roundClean(){Vs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const zh=y_(()=>new Tz);const O_=BigInt(0);function Fg(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function T_(t){if(!Fg(t))throw new Error("Uint8Array expected")}const Dz=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Rz(t){T_(t);let e="";for(let r=0;r<t.length;r++)e+=Dz[t[r]];return e}function Mz(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?O_:BigInt("0x"+t)}const As={_0:48,_9:57,A:65,F:70,a:97,f:102};function Dw(t){if(t>=As._0&&t<=As._9)return t-As._0;if(t>=As.A&&t<=As.F)return t-(As.A-10);if(t>=As.a&&t<=As.f)return t-(As.a-10)}function D_(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(r);for(let s=0,n=0;s<r;s++,n+=2){const o=Dw(t.charCodeAt(n)),a=Dw(t.charCodeAt(n+1));if(o===void 0||a===void 0){const u=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+n)}i[s]=o*16+a}return i}function Rw(t){return T_(t),Mz(Rz(Uint8Array.from(t).reverse()))}function kz(t,e){return D_(t.toString(16).padStart(e*2,"0"))}function Uz(t,e){return kz(t,e).reverse()}function Mw(t,e,r){let i;if(typeof e=="string")try{i=D_(e)}catch(n){throw new Error(t+" must be hex string or Uint8Array, cause: "+n)}else if(Fg(e))i=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=i.length;if(typeof r=="number"&&s!==r)throw new Error(t+" of length "+r+" expected, got "+s);return i}const Af=t=>typeof t=="bigint"&&O_<=t;function Lz(t,e,r){return Af(t)&&Af(e)&&Af(r)&&e<=t&&t<r}function kw(t,e,r,i){if(!Lz(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}const Fz={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Fg(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function jz(t,e,r={}){const i=(s,n,o)=>{const a=Fz[n];if(typeof a!="function")throw new Error("invalid validator function");const u=t[s];if(!(o&&u===void 0)&&!a(u,t))throw new Error("param "+String(s)+" is invalid. Expected "+n+", got "+u)};for(const[s,n]of Object.entries(e))i(s,n,!1);for(const[s,n]of Object.entries(r))i(s,n,!0);return t}const Xo=BigInt(0),Sl=BigInt(1);function R_(t,e){const r=t%e;return r>=Xo?r:e+r}function qz(t,e,r){if(e<Xo)throw new Error("invalid exponent, negatives unsupported");if(r<=Xo)throw new Error("invalid modulus");if(r===Sl)return Xo;let i=Sl;for(;e>Xo;)e&Sl&&(i=i*t%r),t=t*t%r,e>>=Sl;return i}function Bi(t,e,r){let i=t;for(;e-- >Xo;)i*=i,i%=r;return i}BigInt(0),BigInt(1),BigInt(0),BigInt(1),BigInt(2),BigInt(8);const xo=BigInt(0),Sf=BigInt(1);function Bz(t){return jz(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function zz(t){const e=Bz(t),{P:r}=e,i=A=>R_(A,r),s=e.montgomeryBits,n=Math.ceil(s/8),o=e.nByteLength,a=e.adjustScalarBytes||(A=>A),u=e.powPminus2||(A=>qz(A,r-BigInt(2),r));function c(A,D,O){const T=i(A*(D-O));return D=i(D-T),O=i(O+T),[D,O]}const l=(e.a-BigInt(2))/BigInt(4);function h(A,D){kw("u",A,xo,r),kw("scalar",D,xo,r);const O=D,T=A;let x=Sf,M=xo,U=A,R=Sf,L=xo,$;for(let b=BigInt(s-1);b>=xo;b--){const _=O>>b&Sf;L^=_,$=c(L,x,U),x=$[0],U=$[1],$=c(L,M,R),M=$[0],R=$[1],L=_;const w=x+M,v=i(w*w),I=x-M,P=i(I*I),E=v-P,p=U+R,N=U-R,q=i(N*w),H=i(p*I),z=q+H,V=q-H;U=i(z*z),R=i(T*i(V*V)),x=i(v*P),M=i(E*(v+i(l*E)))}$=c(L,x,U),x=$[0],U=$[1],$=c(L,M,R),M=$[0],R=$[1];const d=u(M);return i(x*d)}function f(A){return Uz(i(A),n)}function m(A){const D=Mw("u coordinate",A,n);return o===32&&(D[31]&=127),Rw(D)}function g(A){const D=Mw("scalar",A),O=D.length;if(O!==n&&O!==o){let T=""+n+" or "+o;throw new Error("invalid scalar, expected "+T+" bytes, got "+O)}return Rw(a(D))}function y(A,D){const O=m(D),T=g(A),x=h(O,T);if(x===xo)throw new Error("invalid private or public key received");return f(x)}const C=f(e.Gu);function S(A){return y(A,C)}return{scalarMult:y,scalarMultBase:S,getSharedSecret:(A,D)=>y(A,D),getPublicKey:A=>S(A),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:C}}const Mp=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");BigInt(0);const Hz=BigInt(1),Uw=BigInt(2),Vz=BigInt(3),Kz=BigInt(5);BigInt(8);function Wz(t){const e=BigInt(10),r=BigInt(20),i=BigInt(40),s=BigInt(80),n=Mp,o=t*t%n*t%n,a=Bi(o,Uw,n)*o%n,u=Bi(a,Hz,n)*t%n,c=Bi(u,Kz,n)*u%n,l=Bi(c,e,n)*c%n,h=Bi(l,r,n)*l%n,f=Bi(h,i,n)*h%n,m=Bi(f,s,n)*f%n,g=Bi(m,s,n)*f%n,y=Bi(g,e,n)*c%n;return{pow_p_5_8:Bi(y,Uw,n)*t%n,b2:o}}function Gz(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const kp=zz({P:Mp,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{const e=Mp,{pow_p_5_8:r,b2:i}=Wz(t);return R_(Bi(r,Vz,e)*i,e)},adjustScalarBytes:Gz,randomBytes:Mu}),M_="base10",Rr="base16",rn="base64pad",dc="base64url",ku="utf8",k_=0,Ns=1,Uu=2,Yz=0,Lw=1,Dc=12,jg=32;function Jz(){const t=kp.utils.randomPrivateKey(),e=kp.getPublicKey(t);return{privateKey:Fe(t,Rr),publicKey:Fe(e,Rr)}}function Up(){const t=Mu(jg);return Fe(t,Rr)}function Qz(t,e){const r=kp.getSharedSecret(_t(t,Rr),_t(e,Rr)),i=Cz(zh,r,void 0,void 0,jg);return Fe(i,Rr)}function Hl(t){const e=zh(_t(t,Rr));return Fe(e,Rr)}function as(t){const e=zh(_t(t,ku));return Fe(e,Rr)}function U_(t){return _t(`${t}`,M_)}function Hn(t){return Number(Fe(t,M_))}function Xz(t){const e=U_(typeof t.type<"u"?t.type:k_);if(Hn(e)===Ns&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?_t(t.senderPublicKey,Rr):void 0,i=typeof t.iv<"u"?_t(t.iv,Rr):Mu(Dc),s=_t(t.symKey,Rr),n=P_(s,i).encrypt(_t(t.message,ku));return L_({type:e,sealed:n,iv:i,senderPublicKey:r,encoding:t.encoding})}function Zz(t){const e=_t(t.symKey,Rr),{sealed:r,iv:i}=gu(t),s=P_(e,i).decrypt(r);if(s===null)throw new Error("Failed to decrypt");return Fe(s,ku)}function eH(t,e){const r=U_(Uu),i=Mu(Dc),s=_t(t,ku);return L_({type:r,sealed:s,iv:i,encoding:e})}function tH(t,e){const{sealed:r}=gu({encoded:t,encoding:e});return Fe(r,ku)}function L_(t){const{encoding:e=rn}=t;if(Hn(t.type)===Uu)return Fe(ta([t.type,t.sealed]),e);if(Hn(t.type)===Ns){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Fe(ta([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Fe(ta([t.type,t.iv,t.sealed]),e)}function gu(t){const{encoded:e,encoding:r=rn}=t,i=_t(e,r),s=i.slice(Yz,Lw),n=Lw;if(Hn(s)===Ns){const c=n+jg,l=c+Dc,h=i.slice(n,c),f=i.slice(c,l),m=i.slice(l);return{type:s,sealed:m,iv:f,senderPublicKey:h}}if(Hn(s)===Uu){const c=i.slice(n),l=Mu(Dc);return{type:s,sealed:c,iv:l}}const o=n+Dc,a=i.slice(n,o),u=i.slice(o);return{type:s,sealed:u,iv:a}}function rH(t,e){const r=gu({encoded:t,encoding:e?.encoding});return F_({type:Hn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Fe(r.senderPublicKey,Rr):void 0,receiverPublicKey:e?.receiverPublicKey})}function F_(t){const e=t?.type||k_;if(e===Ns){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function Fw(t){return t.type===Ns&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function jw(t){return t.type===Uu}function iH(t){return new o2.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function sH(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function nH(t){return Buffer.from(sH(t),"base64")}function oH(t,e){const[r,i,s]=t.split("."),n=nH(s);if(n.length!==64)throw new Error("Invalid signature length");const o=n.slice(0,32).toString("hex"),a=n.slice(32,64).toString("hex"),u=`${r}.${i}`,c=zh(u),l=iH(e),h=Fe(c,Rr);if(!l.verify(h,{r:o,s:a}))throw new Error("Invalid signature");return oa(t).payload}const aH="irn";function fh(t){return t?.relay||{protocol:aH}}function Ac(t){const e=a2[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}function cH(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach(s=>{if(s.startsWith(i)){const n=s.replace(i,""),o=t[s];r[n]=o}}),r}function qw(t){if(!t.includes("wc:")){const c=b_(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,i=t.substring(0,e),s=t.substring(e+1,r).split("@"),n=typeof r<"u"?t.substring(r):"",o=new URLSearchParams(n),a={};o.forEach((c,l)=>{a[l]=c});const u=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:i,topic:uH(s[0]),version:parseInt(s[1],10),symKey:a.symKey,relay:cH(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function uH(t){return t.startsWith("//")?t.substring(2):t}function lH(t,e="-"){const r="relay",i={};return Object.keys(t).forEach(s=>{const n=s,o=r+e+n;t[n]&&(i[o]=t[n])}),i}function Bw(t){const e=new URLSearchParams,r=lH(t.relay);Object.keys(r).sort().forEach(s=>{e.set(s,r[s])}),e.set("symKey",t.symKey),t.expiryTimestamp&&e.set("expiryTimestamp",t.expiryTimestamp.toString()),t.methods&&e.set("methods",t.methods.join(","));const i=e.toString();return`${t.protocol}:${t.topic}@${t.version}?${i}`}function Cl(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Pa(t){const e=[];return t.forEach(r=>{const[i,s]=r.split(":");e.push(`${i}:${s}`)}),e}function hH(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Pa(r.accounts))}),e}function dH(t,e){const r=[];return Object.values(t).forEach(i=>{Pa(i.accounts).includes(e)&&r.push(...i.methods)}),r}function fH(t,e){const r=[];return Object.values(t).forEach(i=>{Pa(i.accounts).includes(e)&&r.push(...i.events)}),r}function qg(t){return t.includes(":")}function Sc(t){return qg(t)?t.split(":")[0]:t}function pH(t){const e={};return t?.forEach(r=>{var i;const[s,n]=r.split(":");e[s]||(e[s]={accounts:[],chains:[],events:[],methods:[]}),e[s].accounts.push(r),(i=e[s].chains)==null||i.push(`${s}:${n}`)}),e}function zw(t,e){e=e.map(i=>i.replace("did:pkh:",""));const r=pH(e);for(const[i,s]of Object.entries(r))s.methods?s.methods=Bl(s.methods,t):s.methods=t,s.events=["chainChanged","accountsChanged"];return r}const gH={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}},bH={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 X(t,e){const{message:r,code:i}=bH[t];return{message:e?`${r} ${e}`:r,code:i}}function Xe(t,e){const{message:r,code:i}=gH[t];return{message:e?`${r} ${e}`:r,code:i}}function Vn(t,e){return!!Array.isArray(t)}function bu(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ar(t){return typeof t>"u"}function Jt(t,e){return e&&Ar(t)?!0:typeof t=="string"&&!!t.trim().length}function Bg(t,e){return e&&Ar(t)?!0:typeof t=="number"&&!isNaN(t)}function mH(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),s=Object.keys(r);let n=!0;return Dn(s,i)?(i.forEach(o=>{const{accounts:a,methods:u,events:c}=t.namespaces[o],l=Pa(a),h=r[o];(!Dn(h_(o,h),l)||!Dn(h.methods,u)||!Dn(h.events,c))&&(n=!1)}),n):!1}function ph(t){return Jt(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function yH(t){if(Jt(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ph(r)}}return!1}function wH(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(Jt(t,!1)){if(e(t))return!0;const r=b_(t);return e(r)}}catch{}return!1}function vH(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function _H(t){return t?.topic}function EH(t,e){let r=null;return Jt(t?.publicKey,!1)||(r=X("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Hw(t){let e=!0;return Vn(t)?t.length&&(e=t.every(r=>Jt(r,!1))):e=!1,e}function IH(t,e,r){let i=null;return Vn(e)&&e.length?e.forEach(s=>{i||ph(s)||(i=Xe("UNSUPPORTED_CHAINS",`${r}, chain ${s} should be a string and conform to "namespace:chainId" format`))}):ph(t)||(i=Xe("UNSUPPORTED_CHAINS",`${r}, 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"] }`)),i}function AH(t,e,r){let i=null;return Object.entries(t).forEach(([s,n])=>{if(i)return;const o=IH(s,h_(s,n),`${e} ${r}`);o&&(i=o)}),i}function SH(t,e){let r=null;return Vn(t)?t.forEach(i=>{r||yH(i)||(r=Xe("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):r=Xe("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function CH(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const s=SH(i?.accounts,`${e} namespace`);s&&(r=s)}),r}function $H(t,e){let r=null;return Hw(t?.methods)?Hw(t?.events)||(r=Xe("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Xe("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function j_(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const s=$H(i,`${e}, namespace`);s&&(r=s)}),r}function xH(t,e,r){let i=null;if(t&&bu(t)){const s=j_(t,e);s&&(i=s);const n=AH(t,e,r);n&&(i=n)}else i=X("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function Cf(t,e){let r=null;if(t&&bu(t)){const i=j_(t,e);i&&(r=i);const s=CH(t,e);s&&(r=s)}else r=X("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function q_(t){return Jt(t.protocol,!0)}function PH(t,e){let r=!1;return t?t&&Vn(t)&&t.length&&t.forEach(i=>{r=q_(i)}):r=!0,r}function NH(t){return typeof t=="number"}function Gr(t){return typeof t<"u"&&typeof t!==null}function OH(t){return!(!t||typeof t!="object"||!t.code||!Bg(t.code,!1)||!t.message||!Jt(t.message,!1))}function TH(t){return!(Ar(t)||!Jt(t.method,!1))}function DH(t){return!(Ar(t)||Ar(t.result)&&Ar(t.error)||!Bg(t.id,!1)||!Jt(t.jsonrpc,!1))}function RH(t){return!(Ar(t)||!Jt(t.name,!1))}function Vw(t,e){return!(!ph(e)||!hH(t).includes(e))}function MH(t,e,r){return Jt(r,!1)?dH(t,e).includes(r):!1}function kH(t,e,r){return Jt(r,!1)?fH(t,e).includes(r):!1}function Kw(t,e,r){let i=null;const s=UH(t),n=LH(e),o=Object.keys(s),a=Object.keys(n),u=Ww(Object.keys(t)),c=Ww(Object.keys(e)),l=u.filter(h=>!c.includes(h));return l.length&&(i=X("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
@@ -901,4 +901,4 @@ ${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(NB(r)).toStr
|
|
|
901
901
|
.wui-color-fg-350 {
|
|
902
902
|
background-color: var(--wui-color-fg-350);
|
|
903
903
|
}
|
|
904
|
-
`,Tl={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603};function ju(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const tg=ju({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}),rg=ju({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"}),tQ=ju({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"});ju({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}});ju({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});const rQ={solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"]},$E={getMethodsByChainNamespace(t){return rQ[t]||[]},createDefaultNamespace(t){return{methods:this.getMethodsByChainNamespace(t),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(t,e){if(!e)return{...t};const r={...t},i=new Set;if(e.methods&&Object.keys(e.methods).forEach(s=>i.add(s)),e.chains&&Object.keys(e.chains).forEach(s=>i.add(s)),e.events&&Object.keys(e.events).forEach(s=>i.add(s)),e.rpcMap&&Object.keys(e.rpcMap).forEach(s=>{const[n]=s.split(":");n&&i.add(n)}),i.forEach(s=>{r[s]||(r[s]=this.createDefaultNamespace(s))}),e.methods&&Object.entries(e.methods).forEach(([s,n])=>{r[s]&&(r[s].methods=n)}),e.chains&&Object.entries(e.chains).forEach(([s,n])=>{r[s]&&(r[s].chains=n)}),e.events&&Object.entries(e.events).forEach(([s,n])=>{r[s]&&(r[s].events=n)}),e.rpcMap){const s=new Set;Object.entries(e.rpcMap).forEach(([n,o])=>{const[a,u]=n.split(":");!a||!u||!r[a]||(r[a].rpcMap||(r[a].rpcMap={}),s.has(a)||(r[a].rpcMap={},s.add(a)),r[a].rpcMap[u]=o)})}return r},createNamespaces(t,e){const r=t.reduce((i,s)=>{const{id:n,chainNamespace:o,rpcUrls:a}=s,u=a.default.http[0];i[o]||(i[o]=this.createDefaultNamespace(o));const c=`${o}:${n}`,l=i[o];switch(l.chains.push(c),c){case tg.caipNetworkId:l.chains.push(tg.deprecatedCaipNetworkId);break;case rg.caipNetworkId:l.chains.push(rg.deprecatedCaipNetworkId);break}return l?.rpcMap&&u&&(l.rpcMap[n]=u),i},{});return this.applyNamespaceOverrides(r,e)},resolveReownName:async t=>{const e=await X3.resolveName(t);return(Object.values(e?.addresses)||[])[0]?.address||!1},getChainsFromNamespaces(t={}){return Object.values(t).flatMap(e=>{const r=e.chains||[],i=e.accounts.map(s=>{const[n,o]=s.split(":");return`${n}:${o}`});return Array.from(new Set([...r,...i]))})},isSessionEventData(t){return typeof t=="object"&&t!==null&&"id"in t&&"topic"in t&&"params"in t&&typeof t.params=="object"&&t.params!==null&&"chainId"in t.params&&"event"in t.params&&typeof t.params.event=="object"&&t.params.event!==null}};class xE{constructor({provider:e,caipNetworks:r,namespace:i}){this.id=ne.CONNECTOR_ID.WALLET_CONNECT,this.name=gh.ConnectorNamesMap[ne.CONNECTOR_ID.WALLET_CONNECT],this.type="WALLET_CONNECT",this.imageId=gh.ConnectorImageIds[ne.CONNECTOR_ID.WALLET_CONNECT],this.caipNetworks=r,this.provider=e,this.chain=i}get chains(){return this.caipNetworks}async connectWalletConnect(){if(!await this.authenticate()){const r=J.state.universalProviderConfigOverride,i=$E.createNamespaces(this.caipNetworks,r);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){const e=this.chains.map(r=>r.caipNetworkId);return Oc.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:iQ})}}const iQ=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"];class sQ{constructor(e){this.availableConnectors=[],this.eventListeners=new Map,e&&this.construct(e)}construct(e){this.caipNetworks=e.networks,this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get networks(){return this.caipNetworks||[]}setAuthProvider(e){this.addConnector({id:ne.CONNECTOR_ID.AUTH,type:"AUTH",name:ne.CONNECTOR_NAMES.AUTH,provider:e,imageId:gh.ConnectorImageIds[ne.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}addConnector(...e){const r=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(i=>r.has(i.id)?!1:(r.add(i.id),!0)),this.emit("connectors",this.availableConnectors)}setStatus(e,r){oe.setStatus(e,r)}on(e,r){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(r)}off(e,r){const i=this.eventListeners.get(e);i&&i.delete(r)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,r){const i=this.eventListeners.get(e);i&&i.forEach(s=>s(r))}async connectWalletConnect(e){return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}async switchNetwork(e){const{caipNetwork:r,providerType:i}=e;if(!e.provider)return;const s="provider"in e.provider?e.provider.provider:e.provider;if(i==="WALLET_CONNECT"){s.setDefaultChain(r.caipNetworkId);return}if(s&&i==="AUTH"){const n=s;await n.switchNetwork(r.caipNetworkId);const o=await n.getUser({chainId:r.caipNetworkId,preferredAccountType:J.state.defaultAccountTypes[r.chainNamespace]});this.emit("switchNetwork",o)}}getWalletConnectConnector(){const e=this.connectors.find(r=>r instanceof xE);if(!e)throw new Error("WalletConnectConnector not found");return e}}class nQ extends sQ{setUniversalProvider(e){this.addConnector(new xE({provider:e,caipNetworks:this.caipNetworks||[],namespace:this.namespace}))}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect()}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}}async getAccounts({namespace:e}){const i=this.provider?.session?.namespaces?.[e]?.accounts?.map(s=>{const[,,n]=s.split(":");return n}).filter((s,n,o)=>o.indexOf(s)===n)||[];return Promise.resolve({accounts:i.map(s=>pe.createAccount(e,s,e==="bip122"?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){if(!(e.caipNetwork&&Jr.BALANCE_SUPPORTED_CHAINS.includes(e.caipNetwork?.chainNamespace))||e.caipNetwork?.testnet)return{balance:"0.00",symbol:e.caipNetwork?.nativeCurrency.symbol||""};if(oe.state.balanceLoading&&e.chainId===F.state.activeCaipNetwork?.id)return{balance:oe.state.balance||"0.00",symbol:oe.state.balanceSymbol||""};const s=(await oe.fetchTokenBalance()).find(n=>n.chainId===`${e.caipNetwork?.chainNamespace}:${e.chainId}`&&n.symbol===e.caipNetwork?.nativeCurrency.symbol);return{balance:s?.quantity.numeric||"0.00",symbol:s?.symbol||e.caipNetwork?.nativeCurrency.symbol||""}}async signMessage(e){const{provider:r,message:i,address:s}=e;if(!r)throw new Error("UniversalAdapter:signMessage - provider is undefined");let n="";return F.state.activeCaipNetwork?.chainNamespace===ne.CHAIN.SOLANA?n=(await r.request({method:"solana_signMessage",params:{message:Nc.encode(new TextEncoder().encode(i)),pubkey:s}},F.state.activeCaipNetwork?.caipNetworkId)).signature:n=await r.request({method:"personal_sign",params:[i,s]},F.state.activeCaipNetwork?.caipNetworkId),{signature:n}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async getProfile(){return Promise.resolve({profileImage:"",profileName:""})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}async getEnsAddress(){return Promise.resolve({address:!1})}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){const{caipNetwork:r}=e,i=this.getWalletConnectConnector();if(r.chainNamespace===ne.CHAIN.EVM)try{await i.provider?.request({method:"wallet_switchEthereumChain",params:[{chainId:Jy(r.id)}]})}catch(s){if(s.code===Tl.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Tl.ERROR_INVALID_CHAIN_ID||s.code===Tl.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Tl.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await i.provider?.request({method:"wallet_addEthereumChain",params:[{chainId:Jy(r.id),rpcUrls:[r?.rpcUrls.chainDefault?.http],chainName:r.name,nativeCurrency:r.nativeCurrency,blockExplorerUrls:[r.blockExplorers?.default.url]}]})}catch{throw new Error("Chain is not supported")}}i.provider.setDefaultChain(r.caipNetworkId)}getWalletConnectProvider(){return this.connectors.find(i=>i.type==="WALLET_CONNECT")?.provider}}class oQ{constructor(e){this.hasSwitchedToPreferredAccountTypeOnConnect=!1,this.chainNamespaces=[],this.reportedAlertErrors={},this.getCaipNetwork=r=>{if(r){const i=F.getNetworkData(r)?.caipNetwork;return i||F.getRequestedCaipNetworks(r).filter(s=>s.chainNamespace===r)?.[0]}return F.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{const r=this.getCaipNetwork();if(r)return r.id},this.getCaipNetworks=r=>F.getRequestedCaipNetworks(r),this.getActiveChainNamespace=()=>F.state.activeChain,this.setRequestedCaipNetworks=(r,i)=>{F.setRequestedCaipNetworks(r,i)},this.getApprovedCaipNetworkIds=()=>F.getAllApprovedCaipNetworkIds(),this.getCaipAddress=r=>F.state.activeChain===r||!r?F.state.activeCaipAddress:F.getAccountProp("caipAddress",r),this.setClientId=r=>{ue.setClientId(r)},this.getProvider=r=>Ot.getProvider(r),this.getProviderType=r=>Ot.getProviderId(r),this.getPreferredAccountType=()=>oe.state.preferredAccountType,this.setCaipAddress=(r,i)=>{oe.setCaipAddress(r,i)},this.setBalance=(r,i,s)=>{oe.setBalance(r,i,s)},this.setProfileName=(r,i)=>{oe.setProfileName(r,i)},this.setProfileImage=(r,i)=>{oe.setProfileImage(r,i)},this.setUser=(r,i)=>{oe.setUser(r,i),J.state.enableEmbedded&&Qt.close()},this.resetAccount=r=>{oe.resetAccount(r)},this.setCaipNetwork=r=>{F.setActiveCaipNetwork(r)},this.setCaipNetworkOfNamespace=(r,i)=>{F.setChainNetworkData(i,{caipNetwork:r})},this.setAllAccounts=(r,i)=>{oe.setAllAccounts(r,i),J.setHasMultipleAddresses(r?.length>1)},this.setStatus=(r,i)=>{oe.setStatus(r,i),fe.isConnected()?se.setConnectionStatus("connected"):se.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=r=>F.getAccountProp("address",r),this.setConnectors=r=>{const i=[...fe.getConnectors(),...r];fe.setConnectors(i)},this.fetchIdentity=r=>ue.fetchIdentity(r),this.getReownName=r=>X3.getNamesForAddress(r),this.getConnectors=()=>fe.getConnectors(),this.getConnectorImage=r=>q3.getConnectorImage(r),this.setConnectedWalletInfo=(r,i)=>{const s=Ot.getProviderId(i),n=r?{...r,type:s}:void 0;oe.setConnectedWalletInfo(n,i)},this.getIsConnectedState=()=>!!F.state.activeCaipAddress,this.addAddressLabel=(r,i,s)=>{oe.addAddressLabel(r,i,s)},this.removeAddressLabel=(r,i)=>{oe.removeAddressLabel(r,i)},this.getAddress=r=>F.state.activeChain===r||!r?oe.state.address:F.getAccountProp("address",r),this.setApprovedCaipNetworksData=r=>F.setApprovedCaipNetworksData(r),this.resetNetwork=r=>{F.resetNetwork(r)},this.addConnector=r=>{fe.addConnector(r)},this.resetWcConnection=()=>{ut.resetWcConnection()},this.setAddressExplorerUrl=(r,i)=>{oe.setAddressExplorerUrl(r,i)},this.setSmartAccountDeployed=(r,i)=>{oe.setSmartAccountDeployed(r,i)},this.setSmartAccountEnabledNetworks=(r,i)=>{F.setSmartAccountEnabledNetworks(r,i)},this.setPreferredAccountType=(r,i)=>{oe.setPreferredAccountType(r,i)},this.setEIP6963Enabled=r=>{J.setEIP6963Enabled(r)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=[...new Set(this.caipNetworks?.map(r=>r.chainNamespace))],this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.initialize(e),this.sendInitializeEvent(e)}async initialize(e){this.initControllers(e),await this.initChainAdapters(),await this.injectModalUi(),await this.syncExistingConnection(),Ps.set({initialized:!0})}sendInitializeEvent(e){const{...r}=e;delete r.adapters,lt.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:e.networks.map(i=>i.id),siweConfig:{options:e.siweConfig?.options||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initializeThemeController(e){e.themeMode&&kr.setThemeMode(e.themeMode),e.themeVariables&&kr.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient||!this.networkControllerClient)throw new Error("ConnectionControllerClient and NetworkControllerClient must be set");F.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient});const r=this.getDefaultNetwork();r&&F.setActiveCaipNetwork(r)}initializeConnectionController(e){ut.setWcBasic(e.basic??!1)}initializeConnectorController(){fe.initialize(this.chainNamespaces)}initializeOptionsController(e){J.setDebug(e.debug!==!1),J.setEnableWalletConnect(e.enableWalletConnect!==!1),J.setEnableWalletGuide(e.enableWalletGuide!==!1),J.setEnableWallets(e.enableWallets!==!1),J.setEIP6963Enabled(e.enableEIP6963!==!1),J.setEnableNetworkSwitch(e.enableNetworkSwitch!==!1),J.setEnableAuthLogger(e.enableAuthLogger!==!1),J.setCustomRpcUrls(e.customRpcUrls),J.setSdkVersion(e.sdkVersion),J.setProjectId(e.projectId),J.setEnableEmbedded(e.enableEmbedded),J.setAllWallets(e.allWallets),J.setIncludeWalletIds(e.includeWalletIds),J.setExcludeWalletIds(e.excludeWalletIds),J.setFeaturedWalletIds(e.featuredWalletIds),J.setTokens(e.tokens),J.setTermsConditionsUrl(e.termsConditionsUrl),J.setPrivacyPolicyUrl(e.privacyPolicyUrl),J.setCustomWallets(e.customWallets),J.setFeatures(e.features),J.setAllowUnsupportedChain(e.allowUnsupportedChain),J.setDefaultAccountTypes(e.defaultAccountTypes),J.setUniversalProviderConfigOverride(e.universalProviderConfigOverride);const r=this.getDefaultMetaData();if(!e.metadata&&r&&(e.metadata=r),J.setMetadata(e.metadata),J.setDisableAppend(e.disableAppend),J.setEnableEmbedded(e.enableEmbedded),J.setSIWX(e.siwx),!e.projectId){ql.open(Ol.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(e.adapters?.find(s=>s.namespace===ne.CHAIN.EVM)&&e.siweConfig){if(e.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");J.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){return typeof window<"u"&&typeof document<"u"?{name:document.getElementsByTagName("title")?.[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(e){const r=this.getActiveChainNamespace();if(r){const i=Yo.getUnsupportedNetwork(`${r}:${e}`);F.setActiveCaipNetwork(i)}}getDefaultNetwork(){return Yo.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,r){return Yo.extendCaipNetwork(e,{customNetworkImageUrls:r.chainImages,projectId:r.projectId})}extendCaipNetworks(e){return Yo.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){const r=e.networks.find(s=>s.id===e.defaultNetwork?.id);return r?Yo.extendCaipNetwork(r,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{const e=F.state.activeChain,r=this.getAdapter(e),i=this.getCaipNetwork(e)?.id;if(!r)throw new Error("Adapter not found");const s=await r.connectWalletConnect(i);this.close(),this.setClientId(s?.clientId||null),se.setConnectedNamespaces([...F.state.chains.keys()]),this.chainNamespaces.forEach(n=>{fe.setConnectorId(Ks.CONNECTOR_TYPE_WALLET_CONNECT,n)}),await this.syncWalletConnectAccount()},connectExternal:async({id:e,info:r,type:i,provider:s,chain:n,caipNetwork:o})=>{const a=F.state.activeChain,u=n||a,c=this.getAdapter(u);if(n&&n!==a&&!o){const m=this.caipNetworks?.find(g=>g.chainNamespace===n);m&&this.setCaipNetwork(m)}if(!c)throw new Error("Adapter not found");const l=this.getCaipNetwork(u),h=await c.connect({id:e,info:r,type:i,provider:s,chainId:o?.id||l?.id,rpcUrl:o?.rpcUrls?.default?.http?.[0]||l?.rpcUrls?.default?.http?.[0]});if(!h)return;se.addConnectedNamespace(u),this.syncProvider({...h,chainNamespace:u}),await this.syncAccount({...h,chainNamespace:u});const{accounts:f}=await c.getAccounts({namespace:u,id:e});this.setAllAccounts(f,u)},reconnectExternal:async({id:e,info:r,type:i,provider:s})=>{const n=F.state.activeChain,o=this.getAdapter(n);o?.reconnect&&(await o?.reconnect({id:e,info:r,type:i,provider:s,chainId:this.getCaipNetwork()?.id}),se.addConnectedNamespace(n))},disconnect:async e=>{const r=e||F.state.activeChain,i=this.getAdapter(r),s=Ot.getProvider(r),n=Ot.getProviderId(r);await i?.disconnect({provider:s,providerType:n}),se.removeConnectedNamespace(r),Ot.resetChain(r),this.setUser(void 0,r),this.setStatus("disconnected",r),this.hasSwitchedToPreferredAccountTypeOnConnect=!1},checkInstalled:e=>e?e.some(r=>!!window.ethereum?.[String(r)]):!!window.ethereum,signMessage:async e=>(await this.getAdapter(F.state.activeChain)?.signMessage({message:e,address:oe.state.address,provider:Ot.getProvider(F.state.activeChain)}))?.signature||"",sendTransaction:async e=>{if(e.chainNamespace===ne.CHAIN.EVM){const r=this.getAdapter(F.state.activeChain),i=Ot.getProvider(F.state.activeChain);return(await r?.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:i}))?.hash||""}return""},estimateGas:async e=>{if(e.chainNamespace===ne.CHAIN.EVM){const r=this.getAdapter(F.state.activeChain),i=Ot.getProvider(F.state.activeChain),s=this.getCaipNetwork();if(!s)throw new Error("CaipNetwork is undefined");return(await r?.estimateGas({...e,provider:i,caipNetwork:s}))?.gas||0n}return 0n},getEnsAvatar:async()=>(await this.getAdapter(F.state.activeChain)?.getProfile({address:oe.state.address,chainId:Number(this.getCaipNetwork()?.id)}))?.profileImage||!1,getEnsAddress:async e=>{const r=this.getAdapter(F.state.activeChain),i=this.getCaipNetwork();return i&&(await r?.getEnsAddress({name:e,caipNetwork:i}))?.address||!1},writeContract:async e=>{const r=this.getAdapter(F.state.activeChain),i=this.getCaipNetwork(),s=this.getCaipAddress(),n=Ot.getProvider(F.state.activeChain);if(!i||!s)throw new Error("CaipNetwork or CaipAddress is undefined");return(await r?.writeContract({...e,caipNetwork:i,provider:n,caipAddress:s}))?.hash},parseUnits:(e,r)=>this.getAdapter(F.state.activeChain)?.parseUnits({value:e,decimals:r})??0n,formatUnits:(e,r)=>this.getAdapter(F.state.activeChain)?.formatUnits({value:e,decimals:r})??"0",getCapabilities:async e=>await this.getAdapter(F.state.activeChain)?.getCapabilities(e),grantPermissions:async e=>await this.getAdapter(F.state.activeChain)?.grantPermissions(e),revokePermissions:async e=>{const r=this.getAdapter(F.state.activeChain);return r?.revokePermissions?await r.revokePermissions(e):"0x"},walletGetAssets:async e=>await this.getAdapter(F.state.activeChain)?.walletGetAssets(e)??{}},this.networkControllerClient={switchCaipNetwork:async e=>await this.switchCaipNetwork(e),getApprovedCaipNetworksData:async()=>this.getApprovedCaipNetworksData()},ut.setClient(this.connectionControllerClient)}getApprovedCaipNetworksData(){if(Ot.getProviderId(F.state.activeChain)===Ks.CONNECTOR_TYPE_WALLET_CONNECT){const r=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(r)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){if(!e)return;const r=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){const s=Ot.getProvider(r),n=Ot.getProviderId(r);if(e.chainNamespace===F.state.activeChain)await this.getAdapter(r)?.switchNetwork({caipNetwork:e,provider:s,providerType:n});else if(this.setCaipNetwork(e),n===Ks.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{const o=this.getAddressByChainNamespace(r);o&&this.syncAccount({address:o,chainId:e.id,chainNamespace:r})}}else this.setCaipNetwork(e)}getChainsFromNamespaces(e={}){return Object.values(e).flatMap(r=>{const i=r.chains||[],s=r.accounts.map(n=>{const{chainId:o,chainNamespace:a}=Bs.parseCaipAddress(n);return`${a}:${o}`});return Array.from(new Set([...i,...s]))})}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((r,i)=>{const s=e?.find(n=>n.namespace===i);return s?(r[i]=s,r[i].namespace=i,r[i].construct({namespace:i,projectId:this.options?.projectId,networks:this.caipNetworks})):r[i]=new nQ({namespace:i,networks:this.caipNetworks}),r},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e),this.chainAdapters?.[e].syncConnectors(this.options,this),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)}))}onConnectors(e){this.getAdapter(e)?.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){const r=this.getAdapter(e);if(!r)return;const i=se.getConnectionStatus();i==="connected"?this.setStatus("connecting",e):i==="disconnected"?(se.clearAddressCache(),this.setStatus(i,e)):this.setStatus(i,e),r.on("switchNetwork",({address:s,chainId:n})=>{const o=this.caipNetworks?.find(c=>c.id===n||c.caipNetworkId===n),a=F.state.activeChain===e,u=F.getAccountProp("address",e);if(o){const c=a&&s?s:u;c&&this.syncAccount({address:c,chainId:n,chainNamespace:e})}else this.setUnsupportedNetwork(n)}),r.on("disconnect",this.disconnect.bind(this,e)),r.on("pendingTransactions",()=>{const s=oe.state.address,n=F.state.activeCaipNetwork;!s||!n?.id||this.updateNativeBalance(s,n.id,n.chainNamespace)}),r.on("accountChanged",({address:s,chainId:n})=>{const o=F.state.activeChain===e;o&&n?this.syncAccount({address:s,chainId:n,chainNamespace:e}):o&&F.state.activeCaipNetwork?.id?this.syncAccount({address:s,chainId:F.state.activeCaipNetwork?.id,chainNamespace:e}):this.syncAccountInfo(s,n,e)})}async createUniversalProviderForAdapter(e){await this.getUniversalProvider(),this.universalProvider&&this.chainAdapters?.[e]?.setUniversalProvider?.(this.universalProvider)}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async syncNamespaceConnection(e){try{const r=fe.getConnectorId(e);switch(this.setStatus("connecting",e),r){case ne.CONNECTOR_ID.WALLET_CONNECT:await this.syncWalletConnectAccount();break;case ne.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(r){console.warn("AppKit couldn't sync existing connection",r),this.setStatus("disconnected",e)}}async syncAdapterConnection(e){const r=this.getAdapter(e),i=fe.getConnectorId(e),s=this.getCaipNetwork(e),n=fe.getConnectors(e).find(o=>o.id===i);try{if(!r||!n)throw new Error(`Adapter or connector not found for namespace ${e}`);if(!s?.id)throw new Error("CaipNetwork not found");const o=await r?.syncConnection({namespace:e,id:n.id,chainId:s.id,rpcUrl:s?.rpcUrls?.default?.http?.[0]});if(o){const a=await r?.getAccounts({namespace:e,id:n.id});a&&a.accounts.length>0?this.setAllAccounts(a.accounts,e):this.setAllAccounts([pe.createAccount(e,o.address,"eoa")],e),this.syncProvider({...o,chainNamespace:e}),await this.syncAccount({...o,chainNamespace:e}),this.setStatus("connected",e)}else this.setStatus("disconnected",e)}catch{this.setStatus("disconnected",e)}}async syncWalletConnectAccount(){const e=this.chainNamespaces.map(async r=>{const i=this.getAdapter(r),s=this.universalProvider?.session?.namespaces?.[r]?.accounts||[],n=F.state.activeCaipNetwork?.id,o=s.find(a=>{const{chainId:u}=Bs.parseCaipAddress(a);return u===n?.toString()})||s[0];if(o){const a=Bs.validateCaipAddress(o),{chainId:u,address:c}=Bs.parseCaipAddress(a);if(Ot.setProviderId(r,Ks.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&F.state.activeCaipNetwork&&i?.namespace!==ne.CHAIN.EVM){const l=i?.getWalletConnectProvider({caipNetworks:this.caipNetworks,provider:this.universalProvider,activeCaipNetwork:F.state.activeCaipNetwork});Ot.setProvider(r,l)}else Ot.setProvider(r,this.universalProvider);fe.setConnectorId(ne.CONNECTOR_ID.WALLET_CONNECT,r),se.addConnectedNamespace(r),this.syncWalletConnectAccounts(r),await this.syncAccount({address:c,chainId:u,chainNamespace:r})}else this.setStatus("disconnected",r);await F.setApprovedCaipNetworksData(r)});await Promise.all(e)}syncWalletConnectAccounts(e){const r=this.universalProvider?.session?.namespaces?.[e]?.accounts?.map(i=>{const{address:s}=Bs.parseCaipAddress(i);return s}).filter((i,s,n)=>n.indexOf(i)===s);r&&this.setAllAccounts(r.map(i=>pe.createAccount(e,i,e==="bip122"?"payment":"eoa")),e)}syncProvider({type:e,provider:r,id:i,chainNamespace:s}){Ot.setProviderId(s,e),Ot.setProvider(s,r),fe.setConnectorId(i,s)}async syncAccount(e){const r=e.chainNamespace===F.state.activeChain,i=F.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:s,chainId:n,chainNamespace:o}=e,{chainId:a}=se.getActiveNetworkProps(),u=n||a,c=F.state.activeCaipNetwork?.name===ne.UNSUPPORTED_NETWORK_NAME,l=F.getNetworkProp("supportsAllNetworks",o);if(this.setStatus("connected",o),!(c&&!l)&&u){let h=this.caipNetworks?.find(g=>g.id.toString()===u.toString()),f=this.caipNetworks?.find(g=>g.chainNamespace===o);if(!l&&!h&&!f){const g=this.getApprovedCaipNetworkIds()||[],y=g.find(S=>Bs.parseCaipNetworkId(S)?.chainId===u.toString()),C=g.find(S=>Bs.parseCaipNetworkId(S)?.chainNamespace===o);h=this.caipNetworks?.find(S=>S.caipNetworkId===y),f=this.caipNetworks?.find(S=>S.caipNetworkId===C||"deprecatedCaipNetworkId"in S&&S.deprecatedCaipNetworkId===C)}const m=h||f;m?.chainNamespace===F.state.activeChain?J.state.enableNetworkSwitch&&!J.state.allowUnsupportedChain&&F.state.activeCaipNetwork?.name===ne.UNSUPPORTED_NETWORK_NAME?F.showUnsupportedChainUI():this.setCaipNetwork(m):r||i&&this.setCaipNetworkOfNamespace(i,o),this.syncConnectedWalletInfo(o),yE.isLowerCaseMatch(s,oe.state.address)||this.syncAccountInfo(s,m?.id,o),r?await this.syncBalance({address:s,chainId:m?.id,chainNamespace:o}):await this.syncBalance({address:s,chainId:i?.id,chainNamespace:o})}}async syncAccountInfo(e,r,i){const s=this.getCaipAddress(i),n=r||s?.split(":")[1];if(!n)return;const o=`${i}:${n}:${e}`;this.setCaipAddress(o,i),await this.syncIdentity({address:e,chainId:n,chainNamespace:i})}async syncReownName(e,r){try{const i=await this.getReownName(e);if(i[0]){const s=i[0];this.setProfileName(s.name,r)}else this.setProfileName(null,r)}catch{this.setProfileName(null,r)}}syncConnectedWalletInfo(e){const r=fe.getConnectorId(e),i=Ot.getProviderId(e);if(i===Ks.CONNECTOR_TYPE_ANNOUNCED||i===Ks.CONNECTOR_TYPE_INJECTED){if(r){const s=this.getConnectors().find(n=>n.id===r);if(s){const{info:n,name:o,imageUrl:a}=s,u=a||this.getConnectorImage(s);this.setConnectedWalletInfo({name:o,icon:u,...n},e)}}}else if(i===Ks.CONNECTOR_TYPE_WALLET_CONNECT){const s=Ot.getProvider(e);s?.session&&this.setConnectedWalletInfo({...s.session.peer.metadata,name:s.session.peer.metadata.name,icon:s.session.peer.metadata.icons?.[0]},e)}else if(r)if(r===ne.CONNECTOR_ID.COINBASE){const s=this.getConnectors().find(n=>n.id===ne.CONNECTOR_ID.COINBASE);this.setConnectedWalletInfo({name:"Coinbase Wallet",icon:this.getConnectorImage(s)},e)}else this.setConnectedWalletInfo({name:r},e)}async syncBalance(e){!L3.getNetworksByNamespace(this.caipNetworks,e.chainNamespace).find(i=>i.id.toString()===e.chainId?.toString())||!e.chainId||await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async updateNativeBalance(e,r,i){const s=this.getAdapter(i);if(s){const n=await s.getBalance({address:e,chainId:r,caipNetwork:this.getCaipNetwork(i),tokens:this.options.tokens});this.setBalance(n.balance,n.symbol,i)}}async initializeUniversalAdapter(){const e=NJ.createLogger((i,...s)=>{i&&this.handleAlertError(i),console.error(...s)}),r={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]},logger:e};J.setManualWCControl(!!this.options?.manualWCControl),this.universalProvider=this.options.universalProvider??await xJ.init(r),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&(this.universalProvider.on("display_uri",e=>{ut.setUri(e)}),this.universalProvider.on("connect",ut.finalizeWcConnection),this.universalProvider.on("disconnect",()=>{this.chainNamespaces.forEach(e=>{this.resetAccount(e)}),ut.resetWcConnection()}),this.universalProvider.on("chainChanged",e=>{const r=this.caipNetworks?.find(s=>s.id==e),i=this.getCaipNetwork();if(!r){this.setUnsupportedNetwork(e);return}i?.id!==r?.id&&this.setCaipNetwork(r)}),this.universalProvider.on("session_event",e=>{if($E.isSessionEventData(e)){const{name:r,data:i}=e.params.event;r==="accountsChanged"&&Array.isArray(i)&&pe.isCaipAddress(i[0])&&this.syncAccount(Bs.parseCaipAddress(i[0]))}}))}createUniversalProvider(){return!this.universalProviderInitPromise&&pe.isClient()&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){lt.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}handleAlertError(e){const r=Object.entries(Ol.UniversalProviderErrors).find(([,{message:a}])=>e.message.includes(a)),[i,s]=r??[],{message:n,alertErrorKey:o}=s??{};if(i&&n&&!this.reportedAlertErrors[i]){const a=Ol.ALERT_ERRORS[o];a&&(ql.open(a,"error"),this.reportedAlertErrors[i]=!0)}}getAdapter(e){if(e)return this.chainAdapters?.[e]}createAdapter(e){if(!e)return;const r=e.namespace;if(!r)return;this.createClients();const i=e;i.namespace=r,i.construct({namespace:r,projectId:this.options?.projectId,networks:this.caipNetworks}),this.chainNamespaces.includes(r)||this.chainNamespaces.push(r),this.chainAdapters&&(this.chainAdapters[r]=i)}async open(e){await this.injectModalUi(),e?.uri&&ut.setUri(e.uri),await Qt.open(e)}async close(){await this.injectModalUi(),Qt.close()}setLoading(e,r){Qt.setLoading(e,r)}async disconnect(e){await ut.disconnect(e)}getError(){return""}getChainId(){return F.state.activeCaipNetwork?.id}async switchNetwork(e){const r=this.caipNetworks?.find(i=>i.id===e.id);if(!r){ql.open(Ol.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await F.switchActiveNetwork(r)}getWalletProvider(){return F.state.activeChain?Ot.state.providers[F.state.activeChain]:null}getWalletProviderType(){return Ot.getProviderId(F.state.activeChain)}subscribeProviders(e){return Ot.subscribeProviders(e)}getThemeMode(){return kr.state.themeMode}getThemeVariables(){return kr.state.themeVariables}setThemeMode(e){kr.setThemeMode(e),CE(kr.state.themeMode)}setTermsConditionsUrl(e){J.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){J.setPrivacyPolicyUrl(e)}setThemeVariables(e){kr.setThemeVariables(e),eQ(kr.state.themeVariables)}subscribeTheme(e){return kr.subscribe(e)}getWalletInfo(){return oe.state.connectedWalletInfo}getAccount(e){const r=fe.getAuthConnector(e),i=F.getAccountData(e);if(i)return{allAccounts:i.allAccounts,caipAddress:i.caipAddress,address:pe.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:r?{user:i.user,authProvider:i.socialProvider||"email",accountType:i.preferredAccountType,isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,r){const i=()=>{const s=this.getAccount(r);s&&e(s)};r?F.subscribeChainProp("accountState",i,r):F.subscribe(i),fe.subscribe(i)}subscribeNetwork(e){return F.subscribe(({activeCaipNetwork:r})=>{e({caipNetwork:r,chainId:r?.id,caipNetworkId:r?.caipNetworkId})})}subscribeWalletInfo(e){return oe.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){oe.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){F.subscribeKey("activeCaipNetwork",e)}getState(){return Ps.state}subscribeState(e){return Ps.subscribe(e)}showErrorMessage(e){Ir.showError(e)}showSuccessMessage(e){Ir.showSuccess(e)}getEvent(){return{...lt.state}}subscribeEvents(e){return lt.subscribe(e)}replace(e){He.replace(e)}redirect(e){He.push(e)}popTransactionStack(e){He.popTransactionStack(e)}isOpen(){return Qt.state.open}isTransactionStackEmpty(){return He.state.transactionStack.length===0}isTransactionShouldReplaceView(){return He.state.transactionStack[He.state.transactionStack.length-1]?.replace}static getInstance(){return this.instance}updateFeatures(e){J.setFeatures(e)}updateOptions(e){const i={...J.state||{},...e};J.setOptions(i)}setConnectMethodsOrder(e){J.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){J.setWalletFeaturesOrder(e)}setCollapseWallets(e){J.setCollapseWallets(e)}setSocialsOrder(e){J.setSocialsOrder(e)}getConnectMethodsOrder(){return Zp.getConnectOrderMethod(J.state.features,fe.getConnectors())}removeAdapter(e){const r=this.getIsConnectedState(),i=this.getAdapter(e);if(!i||!this.chainAdapters||r)return;const s=this.caipNetworks?.filter(n=>n.chainNamespace!==e);F.removeAdapter(e),fe.removeAdapter(e),this.chainNamespaces=this.chainNamespaces.filter(n=>n!==e),this.caipNetworks=s,i.removeAllEventListeners(),Reflect.deleteProperty(this.chainAdapters,e)}addAdapter(e,r){const i=e.namespace;if(!this.connectionControllerClient||!this.networkControllerClient||!this.chainAdapters||!i)return;const s=this.extendCaipNetworks({...this.options,networks:r});this.caipNetworks=[...this.caipNetworks||[],...s],this.createAdapter(e),this.initChainAdapter(i),F.addAdapter(e,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient},s)}addNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);const i=this.extendCaipNetwork(r,this.options);F.addNetwork(i),this.caipNetworks&&!this.caipNetworks?.find(s=>s.id===i.id)&&this.caipNetworks.push(i)}removeNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);if(!this.caipNetworks?.find(n=>n.id===r))throw new Error(`Network with ID ${r} not found`);if(!this.caipNetworks)return;const s=this.caipNetworks.filter(n=>n.chainNamespace===e&&n.id!==r);if(!s?.length)throw new Error("Cannot remove last network for a namespace");F.removeNetwork(e,r),this.caipNetworks=[...s]}}let Kv=!1;class aQ extends oQ{async open(e){fe.isConnected()||await super.open(e)}async close(){await super.close(),this.options.manualWCControl&&ut.finalizeWcConnection()}async syncIdentity(e){return Promise.resolve()}async syncBalance(e){return Promise.resolve()}async injectModalUi(){if(!Kv&&pe.isClient()){if(await Jl(()=>import("./basic-CH4UgvMg.js"),__vite__mapDeps([12,13,3,4,5,2,6,7,1,8,9,10])),await Jl(()=>import("./w3m-modal-1D4qbzJa.js"),__vite__mapDeps([14,13,3,4,5,2,6,7,1,8,9,10])),!document.querySelector("w3m-modal")){const r=document.createElement("w3m-modal");!J.state.disableAppend&&!J.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",r)}Kv=!0}}}const cQ="1.7.2";function uQ(t){return new aQ({...t,basic:!0,sdkVersion:`html-core-${cQ}`})}class ea extends Error{constructor(){super(),Object.setPrototypeOf(this,ea.prototype)}}class Wv extends Error{constructor(e){super(`WalletConnect Adapter - Method ${e} is not supported by the wallet`),this.name="WalletConnectFeatureNotSupportedError"}}function lQ(t){let e=[t];return t===tr.Mainnet||t===tr.Deprecated_Mainnet?(e=[tr.Mainnet,tr.Deprecated_Mainnet],t===tr.Deprecated_Mainnet&&console.warn(yh.mainnet)):(t===tr.Deprecated_Devnet||t===tr.Devnet)&&(e=[tr.Devnet,tr.Deprecated_Devnet],console.warn(yh.devnet)),e}const yh={mainnet:`You are using a deprecated chain ID for Solana Mainnet, please use ${tr.Mainnet} instead.`,devnet:`You are using a deprecated chain ID for Solana Devnet, please use ${tr.Devnet} instead.`,wallet:"The connected wallet is using a deprecated chain ID for Solana. Please, contact them to upgrade. You can learn more at https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip10.md#chain-ids"};function Gv(t,e){const r=t.namespaces.solana?.accounts.map(i=>`solana:${i.split(":")[1]}`);if(e===tr.Mainnet)return r?.find(i=>i===tr.Mainnet)?tr.Mainnet:(console.warn(yh.wallet),tr.Deprecated_Mainnet);if(e===tr.Devnet)return r?.find(i=>i===tr.Devnet)?tr.Devnet:(console.warn(yh.wallet),tr.Deprecated_Devnet);throw Error("WalletConnect Solana Adapter: Unable to get a default chain from the session.")}function hQ(t){return{optionalNamespaces:{solana:{chains:lQ(t),methods:[$i.signTransaction,$i.signMessage],events:[]}}}}class Qg extends Error{constructor(){super("QR Code Modal was closed by user"),Object.setPrototypeOf(this,Qg.prototype),this.name="QRCodeModalError"}}class dQ{_UniversalProvider;_session;_modal;_projectId;_network;_ConnectQueueResolver;constructor(e){if(this.initClient(e.options),this._network=e.network,!e.options.projectId)throw Error("WalletConnect Adapter: Project ID is undefined");this._projectId=e.options.projectId}async connect(){if(this._UniversalProvider||await new Promise(s=>{this._ConnectQueueResolver=s}),!this._UniversalProvider)throw new Error("WalletConnect Adapter - Universal Provider was undefined while calling 'connect()'");if(this._UniversalProvider.session){this._session=this._UniversalProvider.session;const s=Gv(this._session,this._network);return this._network=s,this._UniversalProvider.setDefaultChain(s),{publicKey:this.publicKey}}await this.initModal();const e=hQ(this._network);this._modal?.open();const r=new AbortController,i=r.signal;this._modal?.subscribeState(s=>{s.open||r.abort(new Qg)});try{const s=await Promise.race([this._UniversalProvider?.connect(e),new Promise((o,a)=>{i.addEventListener("abort",()=>{a(i.reason)})})]);if(this._modal?.close(),this._session=s,!s)throw new r4;const n=Gv(s,this._network);return this._network=n,this._UniversalProvider?.setDefaultChain(n),{publicKey:this.publicKey}}catch(s){throw this._modal?.close(),s}}async disconnect(){if(this._UniversalProvider?.session){if(await this.initModal(),!this._modal)throw Error("WalletConnect Adapter -Modal is undefined: unable to disconnect");await this.client.disconnect(),this._session=void 0}else throw new ea}get client(){if(this._UniversalProvider)return this._UniversalProvider;throw new ea}get session(){if(!this._session)throw new ea;return this._session}get publicKey(){if(this._UniversalProvider?.session&&this._session){const{address:e}=cC(this._session?.namespaces.solana?.accounts[0]??"");return new ZE(e)}throw new ea}async signTransaction(e){this.checkIfWalletSupportsMethod($i.signTransaction);const r=c0(e),i=r?{}:e,{signature:s,transaction:n}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signTransaction,params:{...i,transaction:this.serialize(e)}}});return n?this.deserialize(n,r):(e.addSignature(this.publicKey,Buffer.from(Nc.decode(s))),e)}async signMessage(e){this.checkIfWalletSupportsMethod($i.signMessage);const{signature:r}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signMessage,params:{pubkey:this.publicKey.toString(),message:Nc.encode(e)}}});return Nc.decode(r)}async signAndSendTransaction(e){this.checkIfWalletSupportsMethod($i.signAndSendTransaction);const{signature:r}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signAndSendTransaction,params:{transaction:this.serialize(e)}}});return r}async signAllTransactions(e){try{this.checkIfWalletSupportsMethod($i.signAllTransactions);const r=e.map(s=>this.serialize(s)),{transactions:i}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signAllTransactions,params:{transactions:r}}});return e.map((s,n)=>c0(s)?this.deserialize(i[n]??"",!0):this.deserialize(i[n]??""))}catch(r){if(r instanceof Wv){const i=e.map(n=>this.signTransaction(n));return await Promise.all(i)}throw r}}async initClient(e){const r=await xF.init(e);this._UniversalProvider=r,this._ConnectQueueResolver&&this._ConnectQueueResolver(!0)}async initModal(){if(!this._modal){if(!this._UniversalProvider)throw new Error("WalletConnect Adapter - cannot init modal when Universal Provider is undefined");this._modal=uQ({projectId:this._projectId,universalProvider:this._UniversalProvider,networks:[tg,rg,tQ],manualWCControl:!0})}}serialize(e){return Buffer.from(e.serialize({verifySignatures:!1})).toString("base64")}deserialize(e,r=!1){return r?e4.deserialize(Buffer.from(e,"base64")):t4.from(Buffer.from(e,"base64"))}checkIfWalletSupportsMethod(e){if(!this.session.namespaces.solana?.methods.includes(e))throw new Wv(e)}}const PE="WalletConnect";class fQ extends i4{name=PE;url="https://walletconnect.org";icon="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4NSIgdmlld0JveD0iMCAwIDMwMCAxODUiIHdpZHRoPSIzMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTYxLjQzODU0MjkgMzYuMjU2MjYxMmM0OC45MTEyMjQxLTQ3Ljg4ODE2NjMgMTI4LjIxMTk4NzEtNDcuODg4MTY2MyAxNzcuMTIzMjA5MSAwbDUuODg2NTQ1IDUuNzYzNDE3NGMyLjQ0NTU2MSAyLjM5NDQwODEgMi40NDU1NjEgNi4yNzY1MTEyIDAgOC42NzA5MjA0bC0yMC4xMzY2OTUgMTkuNzE1NTAzYy0xLjIyMjc4MSAxLjE5NzIwNTEtMy4yMDUzIDEuMTk3MjA1MS00LjQyODA4MSAwbC04LjEwMDU4NC03LjkzMTE0NzljLTM0LjEyMTY5Mi0zMy40MDc5ODE3LTg5LjQ0Mzg4Ni0zMy40MDc5ODE3LTEyMy41NjU1Nzg4IDBsLTguNjc1MDU2MiA4LjQ5MzYwNTFjLTEuMjIyNzgxNiAxLjE5NzIwNDEtMy4yMDUzMDEgMS4xOTcyMDQxLTQuNDI4MDgwNiAwbC0yMC4xMzY2OTQ5LTE5LjcxNTUwMzFjLTIuNDQ1NTYxMi0yLjM5NDQwOTItMi40NDU1NjEyLTYuMjc2NTEyMiAwLTguNjcwOTIwNHptMjE4Ljc2Nzc5NjEgNDAuNzczNzQ0OSAxNy45MjE2OTcgMTcuNTQ2ODk3YzIuNDQ1NTQ5IDIuMzk0Mzk2OSAyLjQ0NTU2MyA2LjI3NjQ3NjkuMDAwMDMxIDguNjcwODg5OWwtODAuODEwMTcxIDc5LjEyMTEzNGMtMi40NDU1NDQgMi4zOTQ0MjYtNi40MTA1ODIgMi4zOTQ0NTMtOC44NTYxNi4wMDAwNjItLjAwMDAxLS4wMDAwMS0uMDAwMDIyLS4wMDAwMjItLjAwMDAzMi0uMDAwMDMybC01Ny4zNTQxNDMtNTYuMTU0NTcyYy0uNjExMzktLjU5ODYwMi0xLjYwMjY1LS41OTg2MDItMi4yMTQwNCAwLS4wMDAwMDQuMDAwMDA0LS4wMDAwMDcuMDAwMDA4LS4wMDAwMTEuMDAwMDExbC01Ny4zNTI5MjEyIDU2LjE1NDUzMWMtMi40NDU1MzY4IDIuMzk0NDMyLTYuNDEwNTc1NSAyLjM5NDQ3Mi04Ljg1NjE2MTIuMDAwMDg3LS4wMDAwMTQzLS4wMDAwMTQtLjAwMDAyOTYtLjAwMDAyOC0uMDAwMDQ0OS0uMDAwMDQ0bC04MC44MTI0MTk0My03OS4xMjIxODVjLTIuNDQ1NTYwMjEtMi4zOTQ0MDgtMi40NDU1NjAyMS02LjI3NjUxMTUgMC04LjY3MDkxOTdsMTcuOTIxNzI5NjMtMTcuNTQ2ODY3M2MyLjQ0NTU2MDItMi4zOTQ0MDgyIDYuNDEwNTk4OS0yLjM5NDQwODIgOC44NTYxNjAyIDBsNTcuMzU0OTc3NSA1Ni4xNTUzNTdjLjYxMTM5MDguNTk4NjAyIDEuNjAyNjQ5LjU5ODYwMiAyLjIxNDAzOTggMCAuMDAwMDA5Mi0uMDAwMDA5LjAwMDAxNzQtLjAwMDAxNy4wMDAwMjY1LS4wMDAwMjRsNTcuMzUyMTAzMS01Ni4xNTUzMzNjMi40NDU1MDUtMi4zOTQ0NjMzIDYuNDEwNTQ0LTIuMzk0NTUzMSA4Ljg1NjE2MS0uMDAwMi4wMDAwMzQuMDAwMDMzNi4wMDAwNjguMDAwMDY3My4wMDAxMDEuMDAwMTAxbDU3LjM1NDkwMiA1Ni4xNTU0MzJjLjYxMTM5LjU5ODYwMSAxLjYwMjY1LjU5ODYwMSAyLjIxNDA0IDBsNTcuMzUzOTc1LTU2LjE1NDMyNDljMi40NDU1NjEtMi4zOTQ0MDkyIDYuNDEwNTk5LTIuMzk0NDA5MiA4Ljg1NjE2IDB6IiBmaWxsPSIjM2I5OWZjIi8+PC9zdmc+";supportedTransactionVersions=new Set(["legacy",0]);_publicKey;_connecting;_wallet;_config;_readyState;_onDisconnect;constructor(e){super(),this._publicKey=null,this._connecting=!1,this._config=e,this._wallet=null,this._readyState=typeof window>"u"?Yh.Unsupported:Yh.Loadable,this._onDisconnect=this.disconnect.bind(this)}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==Yh.Loadable)throw new s4;this._connecting=!0,this._wallet=new dQ({network:this._config.network===c4.Mainnet?Ql.Mainnet:Ql.Devnet,options:this._config.options});const{publicKey:e}=await this._wallet.connect();this._publicKey=e,this.emit("connect",e),this._wallet.client.on("session_delete",this._onDisconnect)}catch(e){throw e.constructor.name==="QRCodeModalError"||e instanceof Error&&e.name==="QRCodeModalError"?new n4:(this._connecting=!1,e)}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.client.off("session_delete",this._onDisconnect),this._publicKey=null;try{e.client.session&&await e.disconnect()}catch(r){console.error("WalletConnectWalletAdapter: disconnect error",r),this.emit("error",new o4(r?.message,r))}}this.emit("disconnect")}async signTransaction(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signTransaction(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signMessage(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signMessage(e)}catch(i){throw new a4(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signAndSendTransaction(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signAndSendTransaction(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signAllTransactions(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signAllTransactions(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}}const $Z=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectWalletAdapter:fQ,WalletConnectWalletName:PE},Symbol.toStringTag,{value:"Module"}));export{pr as $,AZ as A,Yl as B,_Z as C,ql as D,SZ as E,CZ as F,F as G,CA as H,q3 as I,zi as J,DJ as K,ut as L,lt as M,Qt as N,J as O,fe as P,oe as Q,He as R,Oc as S,Ir as T,be as U,kr as V,IZ as W,pe as X,ne as Y,vE as Z,eg as _,rb as a,ma as a0,Wl as a1,se as a2,Zp as a3,Jr as a4,$Z as a5,bA as b,XQ as c,$A as d,QQ as e,Sh as f,rX as g,eX as h,$q as i,lZ as j,nw as k,o_ as l,mq as m,xq as n,hZ as o,uZ as p,qh as q,ZQ as r,fZ as s,z1 as t,dZ as u,gi as v,EZ as w,Fr as x,Tt as y,sa as z};
|
|
904
|
+
`,Tl={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603};function ju(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const tg=ju({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}),rg=ju({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"}),tQ=ju({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"});ju({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}});ju({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});const rQ={solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"]},$E={getMethodsByChainNamespace(t){return rQ[t]||[]},createDefaultNamespace(t){return{methods:this.getMethodsByChainNamespace(t),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(t,e){if(!e)return{...t};const r={...t},i=new Set;if(e.methods&&Object.keys(e.methods).forEach(s=>i.add(s)),e.chains&&Object.keys(e.chains).forEach(s=>i.add(s)),e.events&&Object.keys(e.events).forEach(s=>i.add(s)),e.rpcMap&&Object.keys(e.rpcMap).forEach(s=>{const[n]=s.split(":");n&&i.add(n)}),i.forEach(s=>{r[s]||(r[s]=this.createDefaultNamespace(s))}),e.methods&&Object.entries(e.methods).forEach(([s,n])=>{r[s]&&(r[s].methods=n)}),e.chains&&Object.entries(e.chains).forEach(([s,n])=>{r[s]&&(r[s].chains=n)}),e.events&&Object.entries(e.events).forEach(([s,n])=>{r[s]&&(r[s].events=n)}),e.rpcMap){const s=new Set;Object.entries(e.rpcMap).forEach(([n,o])=>{const[a,u]=n.split(":");!a||!u||!r[a]||(r[a].rpcMap||(r[a].rpcMap={}),s.has(a)||(r[a].rpcMap={},s.add(a)),r[a].rpcMap[u]=o)})}return r},createNamespaces(t,e){const r=t.reduce((i,s)=>{const{id:n,chainNamespace:o,rpcUrls:a}=s,u=a.default.http[0];i[o]||(i[o]=this.createDefaultNamespace(o));const c=`${o}:${n}`,l=i[o];switch(l.chains.push(c),c){case tg.caipNetworkId:l.chains.push(tg.deprecatedCaipNetworkId);break;case rg.caipNetworkId:l.chains.push(rg.deprecatedCaipNetworkId);break}return l?.rpcMap&&u&&(l.rpcMap[n]=u),i},{});return this.applyNamespaceOverrides(r,e)},resolveReownName:async t=>{const e=await X3.resolveName(t);return(Object.values(e?.addresses)||[])[0]?.address||!1},getChainsFromNamespaces(t={}){return Object.values(t).flatMap(e=>{const r=e.chains||[],i=e.accounts.map(s=>{const[n,o]=s.split(":");return`${n}:${o}`});return Array.from(new Set([...r,...i]))})},isSessionEventData(t){return typeof t=="object"&&t!==null&&"id"in t&&"topic"in t&&"params"in t&&typeof t.params=="object"&&t.params!==null&&"chainId"in t.params&&"event"in t.params&&typeof t.params.event=="object"&&t.params.event!==null}};class xE{constructor({provider:e,caipNetworks:r,namespace:i}){this.id=ne.CONNECTOR_ID.WALLET_CONNECT,this.name=gh.ConnectorNamesMap[ne.CONNECTOR_ID.WALLET_CONNECT],this.type="WALLET_CONNECT",this.imageId=gh.ConnectorImageIds[ne.CONNECTOR_ID.WALLET_CONNECT],this.caipNetworks=r,this.provider=e,this.chain=i}get chains(){return this.caipNetworks}async connectWalletConnect(){if(!await this.authenticate()){const r=J.state.universalProviderConfigOverride,i=$E.createNamespaces(this.caipNetworks,r);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){const e=this.chains.map(r=>r.caipNetworkId);return Oc.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:iQ})}}const iQ=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"];class sQ{constructor(e){this.availableConnectors=[],this.eventListeners=new Map,e&&this.construct(e)}construct(e){this.caipNetworks=e.networks,this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get networks(){return this.caipNetworks||[]}setAuthProvider(e){this.addConnector({id:ne.CONNECTOR_ID.AUTH,type:"AUTH",name:ne.CONNECTOR_NAMES.AUTH,provider:e,imageId:gh.ConnectorImageIds[ne.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}addConnector(...e){const r=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(i=>r.has(i.id)?!1:(r.add(i.id),!0)),this.emit("connectors",this.availableConnectors)}setStatus(e,r){oe.setStatus(e,r)}on(e,r){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(r)}off(e,r){const i=this.eventListeners.get(e);i&&i.delete(r)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,r){const i=this.eventListeners.get(e);i&&i.forEach(s=>s(r))}async connectWalletConnect(e){return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}async switchNetwork(e){const{caipNetwork:r,providerType:i}=e;if(!e.provider)return;const s="provider"in e.provider?e.provider.provider:e.provider;if(i==="WALLET_CONNECT"){s.setDefaultChain(r.caipNetworkId);return}if(s&&i==="AUTH"){const n=s;await n.switchNetwork(r.caipNetworkId);const o=await n.getUser({chainId:r.caipNetworkId,preferredAccountType:J.state.defaultAccountTypes[r.chainNamespace]});this.emit("switchNetwork",o)}}getWalletConnectConnector(){const e=this.connectors.find(r=>r instanceof xE);if(!e)throw new Error("WalletConnectConnector not found");return e}}class nQ extends sQ{setUniversalProvider(e){this.addConnector(new xE({provider:e,caipNetworks:this.caipNetworks||[],namespace:this.namespace}))}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect()}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}}async getAccounts({namespace:e}){const i=this.provider?.session?.namespaces?.[e]?.accounts?.map(s=>{const[,,n]=s.split(":");return n}).filter((s,n,o)=>o.indexOf(s)===n)||[];return Promise.resolve({accounts:i.map(s=>pe.createAccount(e,s,e==="bip122"?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){if(!(e.caipNetwork&&Jr.BALANCE_SUPPORTED_CHAINS.includes(e.caipNetwork?.chainNamespace))||e.caipNetwork?.testnet)return{balance:"0.00",symbol:e.caipNetwork?.nativeCurrency.symbol||""};if(oe.state.balanceLoading&&e.chainId===F.state.activeCaipNetwork?.id)return{balance:oe.state.balance||"0.00",symbol:oe.state.balanceSymbol||""};const s=(await oe.fetchTokenBalance()).find(n=>n.chainId===`${e.caipNetwork?.chainNamespace}:${e.chainId}`&&n.symbol===e.caipNetwork?.nativeCurrency.symbol);return{balance:s?.quantity.numeric||"0.00",symbol:s?.symbol||e.caipNetwork?.nativeCurrency.symbol||""}}async signMessage(e){const{provider:r,message:i,address:s}=e;if(!r)throw new Error("UniversalAdapter:signMessage - provider is undefined");let n="";return F.state.activeCaipNetwork?.chainNamespace===ne.CHAIN.SOLANA?n=(await r.request({method:"solana_signMessage",params:{message:Nc.encode(new TextEncoder().encode(i)),pubkey:s}},F.state.activeCaipNetwork?.caipNetworkId)).signature:n=await r.request({method:"personal_sign",params:[i,s]},F.state.activeCaipNetwork?.caipNetworkId),{signature:n}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async getProfile(){return Promise.resolve({profileImage:"",profileName:""})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}async getEnsAddress(){return Promise.resolve({address:!1})}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){const{caipNetwork:r}=e,i=this.getWalletConnectConnector();if(r.chainNamespace===ne.CHAIN.EVM)try{await i.provider?.request({method:"wallet_switchEthereumChain",params:[{chainId:Jy(r.id)}]})}catch(s){if(s.code===Tl.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Tl.ERROR_INVALID_CHAIN_ID||s.code===Tl.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Tl.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await i.provider?.request({method:"wallet_addEthereumChain",params:[{chainId:Jy(r.id),rpcUrls:[r?.rpcUrls.chainDefault?.http],chainName:r.name,nativeCurrency:r.nativeCurrency,blockExplorerUrls:[r.blockExplorers?.default.url]}]})}catch{throw new Error("Chain is not supported")}}i.provider.setDefaultChain(r.caipNetworkId)}getWalletConnectProvider(){return this.connectors.find(i=>i.type==="WALLET_CONNECT")?.provider}}class oQ{constructor(e){this.hasSwitchedToPreferredAccountTypeOnConnect=!1,this.chainNamespaces=[],this.reportedAlertErrors={},this.getCaipNetwork=r=>{if(r){const i=F.getNetworkData(r)?.caipNetwork;return i||F.getRequestedCaipNetworks(r).filter(s=>s.chainNamespace===r)?.[0]}return F.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{const r=this.getCaipNetwork();if(r)return r.id},this.getCaipNetworks=r=>F.getRequestedCaipNetworks(r),this.getActiveChainNamespace=()=>F.state.activeChain,this.setRequestedCaipNetworks=(r,i)=>{F.setRequestedCaipNetworks(r,i)},this.getApprovedCaipNetworkIds=()=>F.getAllApprovedCaipNetworkIds(),this.getCaipAddress=r=>F.state.activeChain===r||!r?F.state.activeCaipAddress:F.getAccountProp("caipAddress",r),this.setClientId=r=>{ue.setClientId(r)},this.getProvider=r=>Ot.getProvider(r),this.getProviderType=r=>Ot.getProviderId(r),this.getPreferredAccountType=()=>oe.state.preferredAccountType,this.setCaipAddress=(r,i)=>{oe.setCaipAddress(r,i)},this.setBalance=(r,i,s)=>{oe.setBalance(r,i,s)},this.setProfileName=(r,i)=>{oe.setProfileName(r,i)},this.setProfileImage=(r,i)=>{oe.setProfileImage(r,i)},this.setUser=(r,i)=>{oe.setUser(r,i),J.state.enableEmbedded&&Qt.close()},this.resetAccount=r=>{oe.resetAccount(r)},this.setCaipNetwork=r=>{F.setActiveCaipNetwork(r)},this.setCaipNetworkOfNamespace=(r,i)=>{F.setChainNetworkData(i,{caipNetwork:r})},this.setAllAccounts=(r,i)=>{oe.setAllAccounts(r,i),J.setHasMultipleAddresses(r?.length>1)},this.setStatus=(r,i)=>{oe.setStatus(r,i),fe.isConnected()?se.setConnectionStatus("connected"):se.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=r=>F.getAccountProp("address",r),this.setConnectors=r=>{const i=[...fe.getConnectors(),...r];fe.setConnectors(i)},this.fetchIdentity=r=>ue.fetchIdentity(r),this.getReownName=r=>X3.getNamesForAddress(r),this.getConnectors=()=>fe.getConnectors(),this.getConnectorImage=r=>q3.getConnectorImage(r),this.setConnectedWalletInfo=(r,i)=>{const s=Ot.getProviderId(i),n=r?{...r,type:s}:void 0;oe.setConnectedWalletInfo(n,i)},this.getIsConnectedState=()=>!!F.state.activeCaipAddress,this.addAddressLabel=(r,i,s)=>{oe.addAddressLabel(r,i,s)},this.removeAddressLabel=(r,i)=>{oe.removeAddressLabel(r,i)},this.getAddress=r=>F.state.activeChain===r||!r?oe.state.address:F.getAccountProp("address",r),this.setApprovedCaipNetworksData=r=>F.setApprovedCaipNetworksData(r),this.resetNetwork=r=>{F.resetNetwork(r)},this.addConnector=r=>{fe.addConnector(r)},this.resetWcConnection=()=>{ut.resetWcConnection()},this.setAddressExplorerUrl=(r,i)=>{oe.setAddressExplorerUrl(r,i)},this.setSmartAccountDeployed=(r,i)=>{oe.setSmartAccountDeployed(r,i)},this.setSmartAccountEnabledNetworks=(r,i)=>{F.setSmartAccountEnabledNetworks(r,i)},this.setPreferredAccountType=(r,i)=>{oe.setPreferredAccountType(r,i)},this.setEIP6963Enabled=r=>{J.setEIP6963Enabled(r)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=[...new Set(this.caipNetworks?.map(r=>r.chainNamespace))],this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.initialize(e),this.sendInitializeEvent(e)}async initialize(e){this.initControllers(e),await this.initChainAdapters(),await this.injectModalUi(),await this.syncExistingConnection(),Ps.set({initialized:!0})}sendInitializeEvent(e){const{...r}=e;delete r.adapters,lt.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:e.networks.map(i=>i.id),siweConfig:{options:e.siweConfig?.options||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initializeThemeController(e){e.themeMode&&kr.setThemeMode(e.themeMode),e.themeVariables&&kr.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient||!this.networkControllerClient)throw new Error("ConnectionControllerClient and NetworkControllerClient must be set");F.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient});const r=this.getDefaultNetwork();r&&F.setActiveCaipNetwork(r)}initializeConnectionController(e){ut.setWcBasic(e.basic??!1)}initializeConnectorController(){fe.initialize(this.chainNamespaces)}initializeOptionsController(e){J.setDebug(e.debug!==!1),J.setEnableWalletConnect(e.enableWalletConnect!==!1),J.setEnableWalletGuide(e.enableWalletGuide!==!1),J.setEnableWallets(e.enableWallets!==!1),J.setEIP6963Enabled(e.enableEIP6963!==!1),J.setEnableNetworkSwitch(e.enableNetworkSwitch!==!1),J.setEnableAuthLogger(e.enableAuthLogger!==!1),J.setCustomRpcUrls(e.customRpcUrls),J.setSdkVersion(e.sdkVersion),J.setProjectId(e.projectId),J.setEnableEmbedded(e.enableEmbedded),J.setAllWallets(e.allWallets),J.setIncludeWalletIds(e.includeWalletIds),J.setExcludeWalletIds(e.excludeWalletIds),J.setFeaturedWalletIds(e.featuredWalletIds),J.setTokens(e.tokens),J.setTermsConditionsUrl(e.termsConditionsUrl),J.setPrivacyPolicyUrl(e.privacyPolicyUrl),J.setCustomWallets(e.customWallets),J.setFeatures(e.features),J.setAllowUnsupportedChain(e.allowUnsupportedChain),J.setDefaultAccountTypes(e.defaultAccountTypes),J.setUniversalProviderConfigOverride(e.universalProviderConfigOverride);const r=this.getDefaultMetaData();if(!e.metadata&&r&&(e.metadata=r),J.setMetadata(e.metadata),J.setDisableAppend(e.disableAppend),J.setEnableEmbedded(e.enableEmbedded),J.setSIWX(e.siwx),!e.projectId){ql.open(Ol.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(e.adapters?.find(s=>s.namespace===ne.CHAIN.EVM)&&e.siweConfig){if(e.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");J.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){return typeof window<"u"&&typeof document<"u"?{name:document.getElementsByTagName("title")?.[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(e){const r=this.getActiveChainNamespace();if(r){const i=Yo.getUnsupportedNetwork(`${r}:${e}`);F.setActiveCaipNetwork(i)}}getDefaultNetwork(){return Yo.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,r){return Yo.extendCaipNetwork(e,{customNetworkImageUrls:r.chainImages,projectId:r.projectId})}extendCaipNetworks(e){return Yo.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){const r=e.networks.find(s=>s.id===e.defaultNetwork?.id);return r?Yo.extendCaipNetwork(r,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{const e=F.state.activeChain,r=this.getAdapter(e),i=this.getCaipNetwork(e)?.id;if(!r)throw new Error("Adapter not found");const s=await r.connectWalletConnect(i);this.close(),this.setClientId(s?.clientId||null),se.setConnectedNamespaces([...F.state.chains.keys()]),this.chainNamespaces.forEach(n=>{fe.setConnectorId(Ks.CONNECTOR_TYPE_WALLET_CONNECT,n)}),await this.syncWalletConnectAccount()},connectExternal:async({id:e,info:r,type:i,provider:s,chain:n,caipNetwork:o})=>{const a=F.state.activeChain,u=n||a,c=this.getAdapter(u);if(n&&n!==a&&!o){const m=this.caipNetworks?.find(g=>g.chainNamespace===n);m&&this.setCaipNetwork(m)}if(!c)throw new Error("Adapter not found");const l=this.getCaipNetwork(u),h=await c.connect({id:e,info:r,type:i,provider:s,chainId:o?.id||l?.id,rpcUrl:o?.rpcUrls?.default?.http?.[0]||l?.rpcUrls?.default?.http?.[0]});if(!h)return;se.addConnectedNamespace(u),this.syncProvider({...h,chainNamespace:u}),await this.syncAccount({...h,chainNamespace:u});const{accounts:f}=await c.getAccounts({namespace:u,id:e});this.setAllAccounts(f,u)},reconnectExternal:async({id:e,info:r,type:i,provider:s})=>{const n=F.state.activeChain,o=this.getAdapter(n);o?.reconnect&&(await o?.reconnect({id:e,info:r,type:i,provider:s,chainId:this.getCaipNetwork()?.id}),se.addConnectedNamespace(n))},disconnect:async e=>{const r=e||F.state.activeChain,i=this.getAdapter(r),s=Ot.getProvider(r),n=Ot.getProviderId(r);await i?.disconnect({provider:s,providerType:n}),se.removeConnectedNamespace(r),Ot.resetChain(r),this.setUser(void 0,r),this.setStatus("disconnected",r),this.hasSwitchedToPreferredAccountTypeOnConnect=!1},checkInstalled:e=>e?e.some(r=>!!window.ethereum?.[String(r)]):!!window.ethereum,signMessage:async e=>(await this.getAdapter(F.state.activeChain)?.signMessage({message:e,address:oe.state.address,provider:Ot.getProvider(F.state.activeChain)}))?.signature||"",sendTransaction:async e=>{if(e.chainNamespace===ne.CHAIN.EVM){const r=this.getAdapter(F.state.activeChain),i=Ot.getProvider(F.state.activeChain);return(await r?.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:i}))?.hash||""}return""},estimateGas:async e=>{if(e.chainNamespace===ne.CHAIN.EVM){const r=this.getAdapter(F.state.activeChain),i=Ot.getProvider(F.state.activeChain),s=this.getCaipNetwork();if(!s)throw new Error("CaipNetwork is undefined");return(await r?.estimateGas({...e,provider:i,caipNetwork:s}))?.gas||0n}return 0n},getEnsAvatar:async()=>(await this.getAdapter(F.state.activeChain)?.getProfile({address:oe.state.address,chainId:Number(this.getCaipNetwork()?.id)}))?.profileImage||!1,getEnsAddress:async e=>{const r=this.getAdapter(F.state.activeChain),i=this.getCaipNetwork();return i&&(await r?.getEnsAddress({name:e,caipNetwork:i}))?.address||!1},writeContract:async e=>{const r=this.getAdapter(F.state.activeChain),i=this.getCaipNetwork(),s=this.getCaipAddress(),n=Ot.getProvider(F.state.activeChain);if(!i||!s)throw new Error("CaipNetwork or CaipAddress is undefined");return(await r?.writeContract({...e,caipNetwork:i,provider:n,caipAddress:s}))?.hash},parseUnits:(e,r)=>this.getAdapter(F.state.activeChain)?.parseUnits({value:e,decimals:r})??0n,formatUnits:(e,r)=>this.getAdapter(F.state.activeChain)?.formatUnits({value:e,decimals:r})??"0",getCapabilities:async e=>await this.getAdapter(F.state.activeChain)?.getCapabilities(e),grantPermissions:async e=>await this.getAdapter(F.state.activeChain)?.grantPermissions(e),revokePermissions:async e=>{const r=this.getAdapter(F.state.activeChain);return r?.revokePermissions?await r.revokePermissions(e):"0x"},walletGetAssets:async e=>await this.getAdapter(F.state.activeChain)?.walletGetAssets(e)??{}},this.networkControllerClient={switchCaipNetwork:async e=>await this.switchCaipNetwork(e),getApprovedCaipNetworksData:async()=>this.getApprovedCaipNetworksData()},ut.setClient(this.connectionControllerClient)}getApprovedCaipNetworksData(){if(Ot.getProviderId(F.state.activeChain)===Ks.CONNECTOR_TYPE_WALLET_CONNECT){const r=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(r)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){if(!e)return;const r=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){const s=Ot.getProvider(r),n=Ot.getProviderId(r);if(e.chainNamespace===F.state.activeChain)await this.getAdapter(r)?.switchNetwork({caipNetwork:e,provider:s,providerType:n});else if(this.setCaipNetwork(e),n===Ks.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{const o=this.getAddressByChainNamespace(r);o&&this.syncAccount({address:o,chainId:e.id,chainNamespace:r})}}else this.setCaipNetwork(e)}getChainsFromNamespaces(e={}){return Object.values(e).flatMap(r=>{const i=r.chains||[],s=r.accounts.map(n=>{const{chainId:o,chainNamespace:a}=Bs.parseCaipAddress(n);return`${a}:${o}`});return Array.from(new Set([...i,...s]))})}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((r,i)=>{const s=e?.find(n=>n.namespace===i);return s?(r[i]=s,r[i].namespace=i,r[i].construct({namespace:i,projectId:this.options?.projectId,networks:this.caipNetworks})):r[i]=new nQ({namespace:i,networks:this.caipNetworks}),r},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e),this.chainAdapters?.[e].syncConnectors(this.options,this),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)}))}onConnectors(e){this.getAdapter(e)?.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){const r=this.getAdapter(e);if(!r)return;const i=se.getConnectionStatus();i==="connected"?this.setStatus("connecting",e):i==="disconnected"?(se.clearAddressCache(),this.setStatus(i,e)):this.setStatus(i,e),r.on("switchNetwork",({address:s,chainId:n})=>{const o=this.caipNetworks?.find(c=>c.id===n||c.caipNetworkId===n),a=F.state.activeChain===e,u=F.getAccountProp("address",e);if(o){const c=a&&s?s:u;c&&this.syncAccount({address:c,chainId:n,chainNamespace:e})}else this.setUnsupportedNetwork(n)}),r.on("disconnect",this.disconnect.bind(this,e)),r.on("pendingTransactions",()=>{const s=oe.state.address,n=F.state.activeCaipNetwork;!s||!n?.id||this.updateNativeBalance(s,n.id,n.chainNamespace)}),r.on("accountChanged",({address:s,chainId:n})=>{const o=F.state.activeChain===e;o&&n?this.syncAccount({address:s,chainId:n,chainNamespace:e}):o&&F.state.activeCaipNetwork?.id?this.syncAccount({address:s,chainId:F.state.activeCaipNetwork?.id,chainNamespace:e}):this.syncAccountInfo(s,n,e)})}async createUniversalProviderForAdapter(e){await this.getUniversalProvider(),this.universalProvider&&this.chainAdapters?.[e]?.setUniversalProvider?.(this.universalProvider)}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async syncNamespaceConnection(e){try{const r=fe.getConnectorId(e);switch(this.setStatus("connecting",e),r){case ne.CONNECTOR_ID.WALLET_CONNECT:await this.syncWalletConnectAccount();break;case ne.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(r){console.warn("AppKit couldn't sync existing connection",r),this.setStatus("disconnected",e)}}async syncAdapterConnection(e){const r=this.getAdapter(e),i=fe.getConnectorId(e),s=this.getCaipNetwork(e),n=fe.getConnectors(e).find(o=>o.id===i);try{if(!r||!n)throw new Error(`Adapter or connector not found for namespace ${e}`);if(!s?.id)throw new Error("CaipNetwork not found");const o=await r?.syncConnection({namespace:e,id:n.id,chainId:s.id,rpcUrl:s?.rpcUrls?.default?.http?.[0]});if(o){const a=await r?.getAccounts({namespace:e,id:n.id});a&&a.accounts.length>0?this.setAllAccounts(a.accounts,e):this.setAllAccounts([pe.createAccount(e,o.address,"eoa")],e),this.syncProvider({...o,chainNamespace:e}),await this.syncAccount({...o,chainNamespace:e}),this.setStatus("connected",e)}else this.setStatus("disconnected",e)}catch{this.setStatus("disconnected",e)}}async syncWalletConnectAccount(){const e=this.chainNamespaces.map(async r=>{const i=this.getAdapter(r),s=this.universalProvider?.session?.namespaces?.[r]?.accounts||[],n=F.state.activeCaipNetwork?.id,o=s.find(a=>{const{chainId:u}=Bs.parseCaipAddress(a);return u===n?.toString()})||s[0];if(o){const a=Bs.validateCaipAddress(o),{chainId:u,address:c}=Bs.parseCaipAddress(a);if(Ot.setProviderId(r,Ks.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&F.state.activeCaipNetwork&&i?.namespace!==ne.CHAIN.EVM){const l=i?.getWalletConnectProvider({caipNetworks:this.caipNetworks,provider:this.universalProvider,activeCaipNetwork:F.state.activeCaipNetwork});Ot.setProvider(r,l)}else Ot.setProvider(r,this.universalProvider);fe.setConnectorId(ne.CONNECTOR_ID.WALLET_CONNECT,r),se.addConnectedNamespace(r),this.syncWalletConnectAccounts(r),await this.syncAccount({address:c,chainId:u,chainNamespace:r})}else this.setStatus("disconnected",r);await F.setApprovedCaipNetworksData(r)});await Promise.all(e)}syncWalletConnectAccounts(e){const r=this.universalProvider?.session?.namespaces?.[e]?.accounts?.map(i=>{const{address:s}=Bs.parseCaipAddress(i);return s}).filter((i,s,n)=>n.indexOf(i)===s);r&&this.setAllAccounts(r.map(i=>pe.createAccount(e,i,e==="bip122"?"payment":"eoa")),e)}syncProvider({type:e,provider:r,id:i,chainNamespace:s}){Ot.setProviderId(s,e),Ot.setProvider(s,r),fe.setConnectorId(i,s)}async syncAccount(e){const r=e.chainNamespace===F.state.activeChain,i=F.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:s,chainId:n,chainNamespace:o}=e,{chainId:a}=se.getActiveNetworkProps(),u=n||a,c=F.state.activeCaipNetwork?.name===ne.UNSUPPORTED_NETWORK_NAME,l=F.getNetworkProp("supportsAllNetworks",o);if(this.setStatus("connected",o),!(c&&!l)&&u){let h=this.caipNetworks?.find(g=>g.id.toString()===u.toString()),f=this.caipNetworks?.find(g=>g.chainNamespace===o);if(!l&&!h&&!f){const g=this.getApprovedCaipNetworkIds()||[],y=g.find(S=>Bs.parseCaipNetworkId(S)?.chainId===u.toString()),C=g.find(S=>Bs.parseCaipNetworkId(S)?.chainNamespace===o);h=this.caipNetworks?.find(S=>S.caipNetworkId===y),f=this.caipNetworks?.find(S=>S.caipNetworkId===C||"deprecatedCaipNetworkId"in S&&S.deprecatedCaipNetworkId===C)}const m=h||f;m?.chainNamespace===F.state.activeChain?J.state.enableNetworkSwitch&&!J.state.allowUnsupportedChain&&F.state.activeCaipNetwork?.name===ne.UNSUPPORTED_NETWORK_NAME?F.showUnsupportedChainUI():this.setCaipNetwork(m):r||i&&this.setCaipNetworkOfNamespace(i,o),this.syncConnectedWalletInfo(o),yE.isLowerCaseMatch(s,oe.state.address)||this.syncAccountInfo(s,m?.id,o),r?await this.syncBalance({address:s,chainId:m?.id,chainNamespace:o}):await this.syncBalance({address:s,chainId:i?.id,chainNamespace:o})}}async syncAccountInfo(e,r,i){const s=this.getCaipAddress(i),n=r||s?.split(":")[1];if(!n)return;const o=`${i}:${n}:${e}`;this.setCaipAddress(o,i),await this.syncIdentity({address:e,chainId:n,chainNamespace:i})}async syncReownName(e,r){try{const i=await this.getReownName(e);if(i[0]){const s=i[0];this.setProfileName(s.name,r)}else this.setProfileName(null,r)}catch{this.setProfileName(null,r)}}syncConnectedWalletInfo(e){const r=fe.getConnectorId(e),i=Ot.getProviderId(e);if(i===Ks.CONNECTOR_TYPE_ANNOUNCED||i===Ks.CONNECTOR_TYPE_INJECTED){if(r){const s=this.getConnectors().find(n=>n.id===r);if(s){const{info:n,name:o,imageUrl:a}=s,u=a||this.getConnectorImage(s);this.setConnectedWalletInfo({name:o,icon:u,...n},e)}}}else if(i===Ks.CONNECTOR_TYPE_WALLET_CONNECT){const s=Ot.getProvider(e);s?.session&&this.setConnectedWalletInfo({...s.session.peer.metadata,name:s.session.peer.metadata.name,icon:s.session.peer.metadata.icons?.[0]},e)}else if(r)if(r===ne.CONNECTOR_ID.COINBASE){const s=this.getConnectors().find(n=>n.id===ne.CONNECTOR_ID.COINBASE);this.setConnectedWalletInfo({name:"Coinbase Wallet",icon:this.getConnectorImage(s)},e)}else this.setConnectedWalletInfo({name:r},e)}async syncBalance(e){!L3.getNetworksByNamespace(this.caipNetworks,e.chainNamespace).find(i=>i.id.toString()===e.chainId?.toString())||!e.chainId||await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async updateNativeBalance(e,r,i){const s=this.getAdapter(i);if(s){const n=await s.getBalance({address:e,chainId:r,caipNetwork:this.getCaipNetwork(i),tokens:this.options.tokens});this.setBalance(n.balance,n.symbol,i)}}async initializeUniversalAdapter(){const e=NJ.createLogger((i,...s)=>{i&&this.handleAlertError(i),console.error(...s)}),r={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]},logger:e};J.setManualWCControl(!!this.options?.manualWCControl),this.universalProvider=this.options.universalProvider??await xJ.init(r),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&(this.universalProvider.on("display_uri",e=>{ut.setUri(e)}),this.universalProvider.on("connect",ut.finalizeWcConnection),this.universalProvider.on("disconnect",()=>{this.chainNamespaces.forEach(e=>{this.resetAccount(e)}),ut.resetWcConnection()}),this.universalProvider.on("chainChanged",e=>{const r=this.caipNetworks?.find(s=>s.id==e),i=this.getCaipNetwork();if(!r){this.setUnsupportedNetwork(e);return}i?.id!==r?.id&&this.setCaipNetwork(r)}),this.universalProvider.on("session_event",e=>{if($E.isSessionEventData(e)){const{name:r,data:i}=e.params.event;r==="accountsChanged"&&Array.isArray(i)&&pe.isCaipAddress(i[0])&&this.syncAccount(Bs.parseCaipAddress(i[0]))}}))}createUniversalProvider(){return!this.universalProviderInitPromise&&pe.isClient()&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){lt.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}handleAlertError(e){const r=Object.entries(Ol.UniversalProviderErrors).find(([,{message:a}])=>e.message.includes(a)),[i,s]=r??[],{message:n,alertErrorKey:o}=s??{};if(i&&n&&!this.reportedAlertErrors[i]){const a=Ol.ALERT_ERRORS[o];a&&(ql.open(a,"error"),this.reportedAlertErrors[i]=!0)}}getAdapter(e){if(e)return this.chainAdapters?.[e]}createAdapter(e){if(!e)return;const r=e.namespace;if(!r)return;this.createClients();const i=e;i.namespace=r,i.construct({namespace:r,projectId:this.options?.projectId,networks:this.caipNetworks}),this.chainNamespaces.includes(r)||this.chainNamespaces.push(r),this.chainAdapters&&(this.chainAdapters[r]=i)}async open(e){await this.injectModalUi(),e?.uri&&ut.setUri(e.uri),await Qt.open(e)}async close(){await this.injectModalUi(),Qt.close()}setLoading(e,r){Qt.setLoading(e,r)}async disconnect(e){await ut.disconnect(e)}getError(){return""}getChainId(){return F.state.activeCaipNetwork?.id}async switchNetwork(e){const r=this.caipNetworks?.find(i=>i.id===e.id);if(!r){ql.open(Ol.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await F.switchActiveNetwork(r)}getWalletProvider(){return F.state.activeChain?Ot.state.providers[F.state.activeChain]:null}getWalletProviderType(){return Ot.getProviderId(F.state.activeChain)}subscribeProviders(e){return Ot.subscribeProviders(e)}getThemeMode(){return kr.state.themeMode}getThemeVariables(){return kr.state.themeVariables}setThemeMode(e){kr.setThemeMode(e),CE(kr.state.themeMode)}setTermsConditionsUrl(e){J.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){J.setPrivacyPolicyUrl(e)}setThemeVariables(e){kr.setThemeVariables(e),eQ(kr.state.themeVariables)}subscribeTheme(e){return kr.subscribe(e)}getWalletInfo(){return oe.state.connectedWalletInfo}getAccount(e){const r=fe.getAuthConnector(e),i=F.getAccountData(e);if(i)return{allAccounts:i.allAccounts,caipAddress:i.caipAddress,address:pe.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:r?{user:i.user,authProvider:i.socialProvider||"email",accountType:i.preferredAccountType,isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,r){const i=()=>{const s=this.getAccount(r);s&&e(s)};r?F.subscribeChainProp("accountState",i,r):F.subscribe(i),fe.subscribe(i)}subscribeNetwork(e){return F.subscribe(({activeCaipNetwork:r})=>{e({caipNetwork:r,chainId:r?.id,caipNetworkId:r?.caipNetworkId})})}subscribeWalletInfo(e){return oe.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){oe.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){F.subscribeKey("activeCaipNetwork",e)}getState(){return Ps.state}subscribeState(e){return Ps.subscribe(e)}showErrorMessage(e){Ir.showError(e)}showSuccessMessage(e){Ir.showSuccess(e)}getEvent(){return{...lt.state}}subscribeEvents(e){return lt.subscribe(e)}replace(e){He.replace(e)}redirect(e){He.push(e)}popTransactionStack(e){He.popTransactionStack(e)}isOpen(){return Qt.state.open}isTransactionStackEmpty(){return He.state.transactionStack.length===0}isTransactionShouldReplaceView(){return He.state.transactionStack[He.state.transactionStack.length-1]?.replace}static getInstance(){return this.instance}updateFeatures(e){J.setFeatures(e)}updateOptions(e){const i={...J.state||{},...e};J.setOptions(i)}setConnectMethodsOrder(e){J.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){J.setWalletFeaturesOrder(e)}setCollapseWallets(e){J.setCollapseWallets(e)}setSocialsOrder(e){J.setSocialsOrder(e)}getConnectMethodsOrder(){return Zp.getConnectOrderMethod(J.state.features,fe.getConnectors())}removeAdapter(e){const r=this.getIsConnectedState(),i=this.getAdapter(e);if(!i||!this.chainAdapters||r)return;const s=this.caipNetworks?.filter(n=>n.chainNamespace!==e);F.removeAdapter(e),fe.removeAdapter(e),this.chainNamespaces=this.chainNamespaces.filter(n=>n!==e),this.caipNetworks=s,i.removeAllEventListeners(),Reflect.deleteProperty(this.chainAdapters,e)}addAdapter(e,r){const i=e.namespace;if(!this.connectionControllerClient||!this.networkControllerClient||!this.chainAdapters||!i)return;const s=this.extendCaipNetworks({...this.options,networks:r});this.caipNetworks=[...this.caipNetworks||[],...s],this.createAdapter(e),this.initChainAdapter(i),F.addAdapter(e,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient},s)}addNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);const i=this.extendCaipNetwork(r,this.options);F.addNetwork(i),this.caipNetworks&&!this.caipNetworks?.find(s=>s.id===i.id)&&this.caipNetworks.push(i)}removeNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);if(!this.caipNetworks?.find(n=>n.id===r))throw new Error(`Network with ID ${r} not found`);if(!this.caipNetworks)return;const s=this.caipNetworks.filter(n=>n.chainNamespace===e&&n.id!==r);if(!s?.length)throw new Error("Cannot remove last network for a namespace");F.removeNetwork(e,r),this.caipNetworks=[...s]}}let Kv=!1;class aQ extends oQ{async open(e){fe.isConnected()||await super.open(e)}async close(){await super.close(),this.options.manualWCControl&&ut.finalizeWcConnection()}async syncIdentity(e){return Promise.resolve()}async syncBalance(e){return Promise.resolve()}async injectModalUi(){if(!Kv&&pe.isClient()){if(await Jl(()=>import("./basic-LOPbFEDH.js"),__vite__mapDeps([12,13,3,4,5,2,6,7,1,8,9,10])),await Jl(()=>import("./w3m-modal-CjCjnI4-.js"),__vite__mapDeps([14,13,3,4,5,2,6,7,1,8,9,10])),!document.querySelector("w3m-modal")){const r=document.createElement("w3m-modal");!J.state.disableAppend&&!J.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",r)}Kv=!0}}}const cQ="1.7.2";function uQ(t){return new aQ({...t,basic:!0,sdkVersion:`html-core-${cQ}`})}class ea extends Error{constructor(){super(),Object.setPrototypeOf(this,ea.prototype)}}class Wv extends Error{constructor(e){super(`WalletConnect Adapter - Method ${e} is not supported by the wallet`),this.name="WalletConnectFeatureNotSupportedError"}}function lQ(t){let e=[t];return t===tr.Mainnet||t===tr.Deprecated_Mainnet?(e=[tr.Mainnet,tr.Deprecated_Mainnet],t===tr.Deprecated_Mainnet&&console.warn(yh.mainnet)):(t===tr.Deprecated_Devnet||t===tr.Devnet)&&(e=[tr.Devnet,tr.Deprecated_Devnet],console.warn(yh.devnet)),e}const yh={mainnet:`You are using a deprecated chain ID for Solana Mainnet, please use ${tr.Mainnet} instead.`,devnet:`You are using a deprecated chain ID for Solana Devnet, please use ${tr.Devnet} instead.`,wallet:"The connected wallet is using a deprecated chain ID for Solana. Please, contact them to upgrade. You can learn more at https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip10.md#chain-ids"};function Gv(t,e){const r=t.namespaces.solana?.accounts.map(i=>`solana:${i.split(":")[1]}`);if(e===tr.Mainnet)return r?.find(i=>i===tr.Mainnet)?tr.Mainnet:(console.warn(yh.wallet),tr.Deprecated_Mainnet);if(e===tr.Devnet)return r?.find(i=>i===tr.Devnet)?tr.Devnet:(console.warn(yh.wallet),tr.Deprecated_Devnet);throw Error("WalletConnect Solana Adapter: Unable to get a default chain from the session.")}function hQ(t){return{optionalNamespaces:{solana:{chains:lQ(t),methods:[$i.signTransaction,$i.signMessage],events:[]}}}}class Qg extends Error{constructor(){super("QR Code Modal was closed by user"),Object.setPrototypeOf(this,Qg.prototype),this.name="QRCodeModalError"}}class dQ{_UniversalProvider;_session;_modal;_projectId;_network;_ConnectQueueResolver;constructor(e){if(this.initClient(e.options),this._network=e.network,!e.options.projectId)throw Error("WalletConnect Adapter: Project ID is undefined");this._projectId=e.options.projectId}async connect(){if(this._UniversalProvider||await new Promise(s=>{this._ConnectQueueResolver=s}),!this._UniversalProvider)throw new Error("WalletConnect Adapter - Universal Provider was undefined while calling 'connect()'");if(this._UniversalProvider.session){this._session=this._UniversalProvider.session;const s=Gv(this._session,this._network);return this._network=s,this._UniversalProvider.setDefaultChain(s),{publicKey:this.publicKey}}await this.initModal();const e=hQ(this._network);this._modal?.open();const r=new AbortController,i=r.signal;this._modal?.subscribeState(s=>{s.open||r.abort(new Qg)});try{const s=await Promise.race([this._UniversalProvider?.connect(e),new Promise((o,a)=>{i.addEventListener("abort",()=>{a(i.reason)})})]);if(this._modal?.close(),this._session=s,!s)throw new r4;const n=Gv(s,this._network);return this._network=n,this._UniversalProvider?.setDefaultChain(n),{publicKey:this.publicKey}}catch(s){throw this._modal?.close(),s}}async disconnect(){if(this._UniversalProvider?.session){if(await this.initModal(),!this._modal)throw Error("WalletConnect Adapter -Modal is undefined: unable to disconnect");await this.client.disconnect(),this._session=void 0}else throw new ea}get client(){if(this._UniversalProvider)return this._UniversalProvider;throw new ea}get session(){if(!this._session)throw new ea;return this._session}get publicKey(){if(this._UniversalProvider?.session&&this._session){const{address:e}=cC(this._session?.namespaces.solana?.accounts[0]??"");return new ZE(e)}throw new ea}async signTransaction(e){this.checkIfWalletSupportsMethod($i.signTransaction);const r=c0(e),i=r?{}:e,{signature:s,transaction:n}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signTransaction,params:{...i,transaction:this.serialize(e)}}});return n?this.deserialize(n,r):(e.addSignature(this.publicKey,Buffer.from(Nc.decode(s))),e)}async signMessage(e){this.checkIfWalletSupportsMethod($i.signMessage);const{signature:r}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signMessage,params:{pubkey:this.publicKey.toString(),message:Nc.encode(e)}}});return Nc.decode(r)}async signAndSendTransaction(e){this.checkIfWalletSupportsMethod($i.signAndSendTransaction);const{signature:r}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signAndSendTransaction,params:{transaction:this.serialize(e)}}});return r}async signAllTransactions(e){try{this.checkIfWalletSupportsMethod($i.signAllTransactions);const r=e.map(s=>this.serialize(s)),{transactions:i}=await this.client.client.request({chainId:this._network,topic:this.session.topic,request:{method:$i.signAllTransactions,params:{transactions:r}}});return e.map((s,n)=>c0(s)?this.deserialize(i[n]??"",!0):this.deserialize(i[n]??""))}catch(r){if(r instanceof Wv){const i=e.map(n=>this.signTransaction(n));return await Promise.all(i)}throw r}}async initClient(e){const r=await xF.init(e);this._UniversalProvider=r,this._ConnectQueueResolver&&this._ConnectQueueResolver(!0)}async initModal(){if(!this._modal){if(!this._UniversalProvider)throw new Error("WalletConnect Adapter - cannot init modal when Universal Provider is undefined");this._modal=uQ({projectId:this._projectId,universalProvider:this._UniversalProvider,networks:[tg,rg,tQ],manualWCControl:!0})}}serialize(e){return Buffer.from(e.serialize({verifySignatures:!1})).toString("base64")}deserialize(e,r=!1){return r?e4.deserialize(Buffer.from(e,"base64")):t4.from(Buffer.from(e,"base64"))}checkIfWalletSupportsMethod(e){if(!this.session.namespaces.solana?.methods.includes(e))throw new Wv(e)}}const PE="WalletConnect";class fQ extends i4{name=PE;url="https://walletconnect.org";icon="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4NSIgdmlld0JveD0iMCAwIDMwMCAxODUiIHdpZHRoPSIzMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTYxLjQzODU0MjkgMzYuMjU2MjYxMmM0OC45MTEyMjQxLTQ3Ljg4ODE2NjMgMTI4LjIxMTk4NzEtNDcuODg4MTY2MyAxNzcuMTIzMjA5MSAwbDUuODg2NTQ1IDUuNzYzNDE3NGMyLjQ0NTU2MSAyLjM5NDQwODEgMi40NDU1NjEgNi4yNzY1MTEyIDAgOC42NzA5MjA0bC0yMC4xMzY2OTUgMTkuNzE1NTAzYy0xLjIyMjc4MSAxLjE5NzIwNTEtMy4yMDUzIDEuMTk3MjA1MS00LjQyODA4MSAwbC04LjEwMDU4NC03LjkzMTE0NzljLTM0LjEyMTY5Mi0zMy40MDc5ODE3LTg5LjQ0Mzg4Ni0zMy40MDc5ODE3LTEyMy41NjU1Nzg4IDBsLTguNjc1MDU2MiA4LjQ5MzYwNTFjLTEuMjIyNzgxNiAxLjE5NzIwNDEtMy4yMDUzMDEgMS4xOTcyMDQxLTQuNDI4MDgwNiAwbC0yMC4xMzY2OTQ5LTE5LjcxNTUwMzFjLTIuNDQ1NTYxMi0yLjM5NDQwOTItMi40NDU1NjEyLTYuMjc2NTEyMiAwLTguNjcwOTIwNHptMjE4Ljc2Nzc5NjEgNDAuNzczNzQ0OSAxNy45MjE2OTcgMTcuNTQ2ODk3YzIuNDQ1NTQ5IDIuMzk0Mzk2OSAyLjQ0NTU2MyA2LjI3NjQ3NjkuMDAwMDMxIDguNjcwODg5OWwtODAuODEwMTcxIDc5LjEyMTEzNGMtMi40NDU1NDQgMi4zOTQ0MjYtNi40MTA1ODIgMi4zOTQ0NTMtOC44NTYxNi4wMDAwNjItLjAwMDAxLS4wMDAwMS0uMDAwMDIyLS4wMDAwMjItLjAwMDAzMi0uMDAwMDMybC01Ny4zNTQxNDMtNTYuMTU0NTcyYy0uNjExMzktLjU5ODYwMi0xLjYwMjY1LS41OTg2MDItMi4yMTQwNCAwLS4wMDAwMDQuMDAwMDA0LS4wMDAwMDcuMDAwMDA4LS4wMDAwMTEuMDAwMDExbC01Ny4zNTI5MjEyIDU2LjE1NDUzMWMtMi40NDU1MzY4IDIuMzk0NDMyLTYuNDEwNTc1NSAyLjM5NDQ3Mi04Ljg1NjE2MTIuMDAwMDg3LS4wMDAwMTQzLS4wMDAwMTQtLjAwMDAyOTYtLjAwMDAyOC0uMDAwMDQ0OS0uMDAwMDQ0bC04MC44MTI0MTk0My03OS4xMjIxODVjLTIuNDQ1NTYwMjEtMi4zOTQ0MDgtMi40NDU1NjAyMS02LjI3NjUxMTUgMC04LjY3MDkxOTdsMTcuOTIxNzI5NjMtMTcuNTQ2ODY3M2MyLjQ0NTU2MDItMi4zOTQ0MDgyIDYuNDEwNTk4OS0yLjM5NDQwODIgOC44NTYxNjAyIDBsNTcuMzU0OTc3NSA1Ni4xNTUzNTdjLjYxMTM5MDguNTk4NjAyIDEuNjAyNjQ5LjU5ODYwMiAyLjIxNDAzOTggMCAuMDAwMDA5Mi0uMDAwMDA5LjAwMDAxNzQtLjAwMDAxNy4wMDAwMjY1LS4wMDAwMjRsNTcuMzUyMTAzMS01Ni4xNTUzMzNjMi40NDU1MDUtMi4zOTQ0NjMzIDYuNDEwNTQ0LTIuMzk0NTUzMSA4Ljg1NjE2MS0uMDAwMi4wMDAwMzQuMDAwMDMzNi4wMDAwNjguMDAwMDY3My4wMDAxMDEuMDAwMTAxbDU3LjM1NDkwMiA1Ni4xNTU0MzJjLjYxMTM5LjU5ODYwMSAxLjYwMjY1LjU5ODYwMSAyLjIxNDA0IDBsNTcuMzUzOTc1LTU2LjE1NDMyNDljMi40NDU1NjEtMi4zOTQ0MDkyIDYuNDEwNTk5LTIuMzk0NDA5MiA4Ljg1NjE2IDB6IiBmaWxsPSIjM2I5OWZjIi8+PC9zdmc+";supportedTransactionVersions=new Set(["legacy",0]);_publicKey;_connecting;_wallet;_config;_readyState;_onDisconnect;constructor(e){super(),this._publicKey=null,this._connecting=!1,this._config=e,this._wallet=null,this._readyState=typeof window>"u"?Yh.Unsupported:Yh.Loadable,this._onDisconnect=this.disconnect.bind(this)}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==Yh.Loadable)throw new s4;this._connecting=!0,this._wallet=new dQ({network:this._config.network===c4.Mainnet?Ql.Mainnet:Ql.Devnet,options:this._config.options});const{publicKey:e}=await this._wallet.connect();this._publicKey=e,this.emit("connect",e),this._wallet.client.on("session_delete",this._onDisconnect)}catch(e){throw e.constructor.name==="QRCodeModalError"||e instanceof Error&&e.name==="QRCodeModalError"?new n4:(this._connecting=!1,e)}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.client.off("session_delete",this._onDisconnect),this._publicKey=null;try{e.client.session&&await e.disconnect()}catch(r){console.error("WalletConnectWalletAdapter: disconnect error",r),this.emit("error",new o4(r?.message,r))}}this.emit("disconnect")}async signTransaction(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signTransaction(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signMessage(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signMessage(e)}catch(i){throw new a4(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signAndSendTransaction(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signAndSendTransaction(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}async signAllTransactions(e){try{const r=this._wallet;if(!r)throw new Qu;try{return await r.signAllTransactions(e)}catch(i){throw new Jh(i?.message,i)}}catch(r){throw this.emit("error",r),r}}}const $Z=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectWalletAdapter:fQ,WalletConnectWalletName:PE},Symbol.toStringTag,{value:"Module"}));export{pr as $,AZ as A,Yl as B,_Z as C,ql as D,SZ as E,CZ as F,F as G,CA as H,q3 as I,zi as J,DJ as K,ut as L,lt as M,Qt as N,J as O,fe as P,oe as Q,He as R,Oc as S,Ir as T,be as U,kr as V,IZ as W,pe as X,ne as Y,vE as Z,eg as _,rb as a,ma as a0,Wl as a1,se as a2,Zp as a3,Jr as a4,$Z as a5,bA as b,XQ as c,$A as d,QQ as e,Sh as f,rX as g,eX as h,$q as i,lZ as j,nw as k,o_ as l,mq as m,xq as n,hZ as o,uZ as p,qh as q,ZQ as r,fZ as s,z1 as t,dZ as u,gi as v,EZ as w,Fr as x,Tt as y,sa as z};
|