@dcl/shop 1.14.1-35732774937.commit-d3acaab → 1.15.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/_assets/{Activity-BZTNf3ED.js → Activity-BBgqwdRc.js} +6 -6
- package/_assets/{AnimatedBackground-DNRoFPGp.js → AnimatedBackground-CAe8erqx.js} +2 -2
- package/_assets/{Assets-DtiZKwuT.js → Assets-BVr6Ienp.js} +13 -13
- package/_assets/{Cart-l6NqHo0s.js → Cart-uMh-LLkS.js} +6 -6
- package/_assets/{Collection-Bt6A0KQ6.js → Collection-C6wH7PGc.js} +9 -9
- package/_assets/{CollectionCarousel-D77ErPU2.js → CollectionCarousel-DLu1yG2d.js} +7 -7
- package/_assets/{Confetti-RxABTwh2.js → Confetti-CUYY8WKL.js} +4 -4
- package/_assets/{ConstantsUtil-BE1palmA.js → ConstantsUtil-Du7Rw-I9.js} +2 -2
- package/_assets/{ContentClient-B-9RcYaE.js → ContentClient-CQ0rZRJX.js} +2 -2
- package/_assets/{Creator-CereCprD.js → Creator-DiqRz4sK.js} +2 -2
- package/_assets/{CreditPackPicker-0WOrhrpS.js → CreditPackPicker-CZe0q7lQ.js} +7 -7
- package/_assets/{DeploymentBuilder-Ce32CCQF.js → DeploymentBuilder-B8n1ixz5.js} +2 -2
- package/_assets/{EmotePlaybackBar-0NCN1NCU.js → EmotePlaybackBar-Dh9mWTmr.js} +4 -4
- package/_assets/{ErrorNotice-Cy86Y-Xz.js → ErrorNotice-BZweT4nq.js} +2 -2
- package/_assets/Event-BhrUy_li.js +72 -0
- package/_assets/{ExchangeController-C0AZT23t.js → ExchangeController-B8eGX00R.js} +2 -2
- package/_assets/{Faq-DepI4S0n.js → Faq-BRUGz0o1.js} +2 -2
- package/_assets/{Filters-D5CUPglE.js → Filters-CWaA5jz_.js} +9 -9
- package/_assets/{GetCredits-4uW6NXh_.js → GetCredits-91FKPj2S.js} +5 -5
- package/_assets/{Grow-BF6Dfobl.js → Grow-BtoTVtjh.js} +2 -2
- package/_assets/{HelpersUtil-Cm_oBcwa.js → HelpersUtil-DtSGcn50.js} +2 -2
- package/_assets/{ItemDetail-Co-8bNBU.js → ItemDetail-CPUr9pIj.js} +36 -36
- package/_assets/{LoadMore-B1h9Iiw8.js → LoadMore-VpUeZFim.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-BIM5H81_.js → ManaPricingBanner.styles-CAt88qh9.js} +6 -6
- package/_assets/{MyAssets-Ausqi6ZK.js → MyAssets-BUFp0lDY.js} +6 -6
- package/_assets/{MyFavorites-mo7wjv-d.js → MyFavorites-BJRUv9oZ.js} +2 -2
- package/_assets/{MyStore-CmWYy0qd.js → MyStore-CEJ3my3_.js} +10 -10
- package/_assets/{NetworkUtil--zruk36r.js → NetworkUtil-Ciq8Tbsc.js} +2 -2
- package/_assets/{NotFound-xsSZvF06.js → NotFound-DmCwRSbf.js} +2 -2
- package/_assets/{NotificationsBell-Br1kFnCO.js → NotificationsBell-DbHW9KbV.js} +2 -2
- package/_assets/{OutfitDetail-tsulPy0c.js → OutfitDetail-BdCmpPcB.js} +2 -2
- package/_assets/{OutfitPreview-BXtUfdS-.js → OutfitPreview-ziiAIMxw.js} +3 -3
- package/_assets/{OutfitStudio-Dec9gxoZ.js → OutfitStudio-i641piGk.js} +11 -11
- package/_assets/{PaymentMethodStep-ClTG31Bm.js → PaymentMethodStep-DLWg_1Mg.js} +5 -5
- package/_assets/{SaleCountdown-UAlrMSbY.js → SaleCountdown-D_0C1G0b.js} +2 -2
- package/_assets/{Spinner-BFANB0CL.js → Spinner-k8dLtOrJ.js} +2 -2
- package/_assets/{StoreSettings-B8w_IYAP.js → StoreSettings-DiqvHUbK.js} +5 -5
- package/_assets/{Success-Om4EVqe8.js → Success-yvCjE3be.js} +2 -2
- package/_assets/{SwapController-ZTw9N09i.js → SwapController-L-o_4Zfy.js} +2 -2
- package/_assets/{Tooltip-3YnG1Umc.js → Tooltip-BEJkU8QC.js} +2 -2
- package/_assets/{TradeService-DsJF_Ykz.js → TradeService-DVeKA0A9.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-C9yMX-9L.js → W3MFrameProviderSingleton-BxpE6Qai.js} +4 -4
- package/_assets/{WebCryptoP256-DyFevMsm.js → WebCryptoP256-DKkCHgRo.js} +2 -2
- package/_assets/{basic-QP6P-QFr.js → basic-DHFzByJo.js} +2 -2
- package/_assets/{biconomy-Cl4k6pus.js → biconomy-DCsUE-Aa.js} +2 -2
- package/_assets/{browseLayout.styles-CtEXdyi5.js → browseLayout.styles-fXEIBUq8.js} +2 -2
- package/_assets/{browser-DgDyU9Dd.js → browser-gYEIuxiW.js} +2 -2
- package/_assets/{browser-ponyfill-BoW4KA9T.js → browser-ponyfill-5UyluzqP.js} +2 -2
- package/_assets/{browser-C3Fk6SGT.js → browser-zYx7iqzr.js} +2 -2
- package/_assets/{buy-gasless-B_R3acE2.js → buy-gasless-BheWI81y.js} +2 -2
- package/_assets/{buy-BWL_MsWZ.js → buy-zKbAn0Jr.js} +2 -2
- package/_assets/{ccip-CEBv1Njx.js → ccip-DAEHnzsX.js} +2 -2
- package/_assets/{ccip-CGRe8tZG.js → ccip-DvIRUO6I.js} +2 -2
- package/_assets/{chains-C63N96dR.js → chains-lku0nIXt.js} +2 -2
- package/_assets/collectionPage.styles-B8UMV0wt.js +41 -0
- package/_assets/{common-BHGUItcH.js → common-C03gEIWz.js} +2 -2
- package/_assets/{controller-dcPPx0Ve.js → controller-CoiO-8ak.js} +3 -3
- package/_assets/{core-2kgw2Lk6.js → core-BOjd_Eve.js} +5 -5
- package/_assets/{createSvgIcon-e9fnpKTy.js → createSvgIcon-BiXHCpBo.js} +6 -6
- package/_assets/{crumbs.styles-FoTSTGkC.js → crumbs.styles-Bq-08Eo1.js} +2 -2
- package/_assets/{custom-CEirqsrc.js → custom-D9bjz_2p.js} +2 -2
- package/_assets/{data-capture-Bp0k2Qg7.js → data-capture-CGASy8JJ.js} +2 -2
- package/_assets/{dcl-schemas-BrVwEqiU.js → dcl-schemas-COntwfiV.js} +2 -2
- package/_assets/{decimals-UDFlnnNN.js → decimals-BpivF8HU.js} +2 -2
- package/_assets/{decimals-Ds-cKzq0.js → decimals-C39Js9A5.js} +2 -2
- package/_assets/{detectExtension-CPLy90w2.js → detectExtension-CYK2hYlo.js} +2 -2
- package/_assets/{disposePreview-TOHrr3Cv.js → disposePreview-C9RvsbNf.js} +2 -2
- package/_assets/{email-C8BApZt1.js → email-B7Hqc3Al.js} +2 -2
- package/_assets/{embedded-wallet-D6ovY2Wr.js → embedded-wallet-DQ3g7rbj.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-23GGtyp0.js → emotion-styled.browser.esm-orHSWwQS.js} +2 -2
- package/_assets/{engine-C_hk_rjg.js → engine-BVrA-eDe.js} +2 -2
- package/_assets/{errors-DLcrG7wZ.js → errors-DxKvZXrL.js} +2 -2
- package/_assets/{estimate-l1-fee-8JBCStoR.js → estimate-l1-fee-CI9CaMqP.js} +2 -2
- package/_assets/{eth_estimateGas-D5LOgdsb.js → eth_estimateGas-grjD8ZC6.js} +2 -2
- package/_assets/{eth_getStorageAt-Cgm8eZeC.js → eth_getStorageAt-Di8D3-FZ.js} +2 -2
- package/_assets/{eth_getTransactionCount-DT1wQUYG.js → eth_getTransactionCount-dmwPv1uL.js} +2 -2
- package/_assets/{ethereum-B6_NCD8u.js → ethereum-BXBXB0WJ.js} +2 -2
- package/_assets/{ethers-DCYs0L1t.js → ethers-BIoA35Pn.js} +2 -2
- package/_assets/{events-Ch5mkuEv.js → events-DNWUGNd7.js} +2 -2
- package/_assets/{execute-DaSSKs0J.js → execute-BRAlOglu.js} +3 -3
- package/_assets/{extractIPFS-D_yHf9NQ.js → extractIPFS-B6dS8Wbs.js} +2 -2
- package/_assets/{features-Ct4xvFci.js → features-YldM2Blt.js} +2 -2
- package/_assets/{fetchTokenMetadata-C5CN7SwU.js → fetchTokenMetadata-BTPEU-3q.js} +3 -3
- package/_assets/{field.styles-D3oougzk.js → field.styles-7aAfESFo.js} +2 -2
- package/_assets/{fortmatic-CErSY4Uv.js → fortmatic-Du20O965.js} +2 -2
- package/_assets/{get-bytecode-OECsahsT.js → get-bytecode-Dmk-6Mk4.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-CqmMi93Y.js → get-ecosystem-wallet-info-IK9mOCLo.js} +2 -2
- package/_assets/{getBalance-Dk_y5JwY.js → getBalance-ktnD9Moc.js} +3 -3
- package/_assets/{getInstalledModules-BylSc8z2.js → getInstalledModules-jTPTLnb8.js} +2 -2
- package/_assets/{getNFT-CuRxwrU7.js → getNFT-CwzF6z_7.js} +2 -2
- package/_assets/{getNFT-Dp_tiNuN.js → getNFT-DbXgJ4kx.js} +3 -3
- package/_assets/{grid.styles-B48spjFg.js → grid.styles-Reh_Sfmk.js} +2 -2
- package/_assets/{hashTypedData-dqSfQDie.js → hashTypedData-B5WTbVYh.js} +2 -2
- package/_assets/{hashTypedData-lGvaI2cA.js → hashTypedData-B72YO7bf.js} +2 -2
- package/_assets/{import-D_YdksPc.js → import-CJWafgcM.js} +2 -2
- package/_assets/{in-app-DU1izobx.js → in-app-reC7MW7U.js} +2 -2
- package/_assets/{in-app-wallet-calls-DiaCxPlO.js → in-app-wallet-calls-YVgiy_Z_.js} +2 -2
- package/_assets/{index-8oCEOyw8.js → index-1tydFwH5.js} +4 -4
- package/_assets/{index-BU6ORwL6.js → index-2QUWziXM.js} +2 -2
- package/_assets/{index-CWqd1Q-2.js → index-7WKP3ObD.js} +2 -2
- package/_assets/{index-CBinTZ0C.js → index-B-cCk8d1.js} +2 -2
- package/_assets/{index-DviRrMz0.js → index-B0NLjhmz.js} +2 -2
- package/_assets/{index-D5Dn5XcC.js → index-B18ZHjoG.js} +2 -2
- package/_assets/{index-CKqGOSZn.js → index-B3PqY8NV.js} +2 -2
- package/_assets/{index-CDILsv8-.js → index-B5Il9w_t.js} +2 -2
- package/_assets/{index-CNpOtENF.js → index-B610oYVJ.js} +2 -2
- package/_assets/{index-g7FUnJSt.js → index-B7A8C7MY.js} +2 -2
- package/_assets/{index-BFDlm927.js → index-B7Z8xaGK.js} +2 -2
- package/_assets/{index-D4oDLJRO.js → index-BQBSlmH-.js} +2 -2
- package/_assets/{index-qDty1LWz.js → index-BVGDgDVf.js} +2 -2
- package/_assets/{index-CR-T5X-D.js → index-BWz0ngpy.js} +2 -2
- package/_assets/{index-B7d2X751.js → index-BXCm1lR6.js} +2 -2
- package/_assets/{index-Ftq_Qf7i.js → index-BYiScitc.js} +2 -2
- package/_assets/{index-CHdO5uMl.js → index-BZcBt3X8.js} +2 -2
- package/_assets/{index-BkdttjkH.js → index-Ba4Qb-tQ.js} +2 -2
- package/_assets/{index-CoDvZdaf.js → index-Butijfje.js} +2 -2
- package/_assets/{index-xbkHs3zO.js → index-C-w85US7.js} +2 -2
- package/_assets/{index-BLD4vnX6.js → index-CA7DDOOl.js} +3 -3
- package/_assets/{index-Bgm4jxY7.js → index-CBv79d7E.js} +2 -2
- package/_assets/{index-BLdvJib1.js → index-CJ1iqO8A.js} +2 -2
- package/_assets/{index-9tO9OUL8.js → index-CLFGNSZ-.js} +2 -2
- package/_assets/{index-PkbXbgtC.js → index-COT5Frck.js} +2 -2
- package/_assets/index-COio6Ejd.js +4310 -0
- package/_assets/{index-y6pnI6yF.js → index-CQ_hwt2w.js} +2 -2
- package/_assets/{index-Bm5Ji_b0.js → index-CYwEY6Wy.js} +2 -2
- package/_assets/{index-QqOA5noN.js → index-CZiKz5pK.js} +2 -2
- package/_assets/{index-Iw0YFMKl.js → index-C_gzza3J.js} +2 -2
- package/_assets/{index-321qoCaJ.js → index-CcdPYHZS.js} +3 -3
- package/_assets/{index-BSWBAMJf.js → index-Cd_cQb_5.js} +4 -4
- package/_assets/{index-XHl9TuTe.js → index-ClePbRUv.js} +3 -3
- package/_assets/{index-i_5nPW9n.js → index-CnNEDEKF.js} +2 -2
- package/_assets/{index-CoWn_g-I.js → index-CnZUnVbC.js} +2 -2
- package/_assets/{index-z3v0I-ct.js → index-Csltect9.js} +2 -2
- package/_assets/{index-Q-4A0N-Q.js → index-Cvfa-O4J.js} +2 -2
- package/_assets/{index-DSOAGIi2.js → index-CyJXEo_c.js} +2 -2
- package/_assets/{index-CISfbcGB.js → index-D-gigTjB.js} +2 -2
- package/_assets/{index-B74ZvCCg.js → index-D1h1jMQm.js} +2 -2
- package/_assets/{index-DPROz7TD.js → index-D2gmXgfJ.js} +2 -2
- package/_assets/{index-Dilxq7oL.js → index-D48CxYHB.js} +2 -2
- package/_assets/{index-B1Lhr0k2.js → index-D4EeOyaA.js} +2 -2
- package/_assets/{index-B-uF7wnK.js → index-D71yoQwh.js} +4 -4
- package/_assets/{index-BjCx26RW.js → index-D8OXtAip.js} +2 -2
- package/_assets/{index-X7xVeMYf.js → index-DA4F0G5P.js} +2 -2
- package/_assets/{index-ChWki13j.js → index-DAFOiLHS.js} +3 -3
- package/_assets/{index-ivtc1-Fk.js → index-DAh-ftDy.js} +6 -6
- package/_assets/{index-mrYOkuEY.js → index-DDjkaD8J.js} +2 -2
- package/_assets/{index-ChMvb_7n.js → index-DHvU-KWh.js} +2 -2
- package/_assets/{index-TZtT5-BX.js → index-DJIQTk8q.js} +2 -2
- package/_assets/{index-B_ay8jUy.js → index-DKiO6CtY.js} +6 -6
- package/_assets/{index-Dc_G5PEm.js → index-DSwXuC0D.js} +2 -2
- package/_assets/{index-pgYwCuWG.js → index-DURI-gf8.js} +4 -4
- package/_assets/index-DVuzXPDM.css +1 -0
- package/_assets/{index-CDLP4B0L.js → index-DW-Melj-.js} +2 -2
- package/_assets/{index-CyqRAr8s.js → index-DcTChipn.js} +3 -3
- package/_assets/{index-CI34Z_Me.js → index-DcpPAZS7.js} +2 -2
- package/_assets/{index-BFEMM3r4.js → index-DdpXntwz.js} +2 -2
- package/_assets/{index-Bwnkxm_G.js → index-DkEEbiDR.js} +2 -2
- package/_assets/{index-BjR4exTy.js → index-DrLA_VU_.js} +2 -2
- package/_assets/{index-DTL7FTYv.js → index-DtTYXgF3.js} +2 -2
- package/_assets/{index-HyKwngHl.js → index-GQaePZB9.js} +2 -2
- package/_assets/{index-BK_57ve_.js → index-YHzCYJkG.js} +2 -2
- package/_assets/{index-D-Xi6X4E.js → index-Ys04Xign.js} +2 -2
- package/_assets/{index-DkxhLfIJ.js → index-jyj9sHwU.js} +2 -2
- package/_assets/{index-BNpv0X7m.js → index-nBFm5kuI.js} +2 -2
- package/_assets/{index-k1I1IsHl.js → index-uYTIcGSZ.js} +2 -2
- package/_assets/{index.es-CnHlKMhK.js → index.es-BXEjCl7y.js} +2 -2
- package/_assets/{index.es-Cd9yo4Tm.js → index.es-BZK_Cifn.js} +5 -5
- package/_assets/{index.es-CYcra466.js → index.es-Bn4oTPjZ.js} +2 -2
- package/_assets/{index.es-ywQflMXQ.js → index.es-CU-vsJdv.js} +2 -2
- package/_assets/items-empty-DGRxHTWy.js +2 -0
- package/_assets/{jump-B8xqzDZo.js → jump-DWbTrGpm.js} +2 -2
- package/_assets/{linkAccount-BykZ_J6_.js → linkAccount-CMtMM4t3.js} +2 -2
- package/_assets/loader-logo-CeNjVZuG.js +2 -0
- package/_assets/{localBatchGatewayRequest-BMZWtkh-.js → localBatchGatewayRequest-8oF0MPC1.js} +2 -2
- package/_assets/{modal.styles-Ah3BFwcL.js → modal.styles-hpuefgX4.js} +2 -2
- package/_assets/{native-Dp-2t67a.js → native-CPeL4rJZ.js} +2 -2
- package/_assets/{networks-9u6DsbLw.js → networks-BhouyyPS.js} +2 -2
- package/_assets/{onramp-DbbdvE9l.js → onramp-BvIHLQAv.js} +2 -2
- package/_assets/{openzeppelin-D69GD3Fm.js → openzeppelin-OZNoWqYj.js} +2 -2
- package/_assets/{ownerOf-B2KKjyzm.js → ownerOf-bCzxqzq0.js} +2 -2
- package/_assets/{parseNft-B4me14YE.js → parseNft-pxEjnpjF.js} +3 -3
- package/_assets/{parseSignature-CxQObnnK.js → parseSignature-BAJHdtSB.js} +4 -4
- package/_assets/{parseSignature-cCpQ1EW_.js → parseSignature-CpDiAFfJ.js} +2 -2
- package/_assets/{passkeys-xdBGznn1.js → passkeys-iblxlDv1.js} +2 -2
- package/_assets/{pay-with-exchange-BDhbjftO.js → pay-with-exchange-CLgZOiU6.js} +2 -2
- package/_assets/{prepare-contract-call-CITzhkar.js → prepare-contract-call-CoHsXlvg.js} +2 -2
- package/_assets/{qr-overlay-BZbZx8jf.js → qr-overlay-B_NIDLKC.js} +4 -4
- package/_assets/{react-ChceODIJ.js → react-BmPeg6sG.js} +2 -2
- package/_assets/{receive-DhIBZE4X.js → receive-DszbAWAn.js} +2 -2
- package/_assets/{resolveImplementation-C1gKzDiQ.js → resolveImplementation-32KPFc_U.js} +2 -2
- package/_assets/{resume-buy-C5UXHP38.js → resume-buy-D2TWyIFl.js} +2 -2
- package/_assets/{resume-name-DQBwW7EF.js → resume-name-B-MASXQk.js} +2 -2
- package/_assets/{rpc-DNG3H7ru.js → rpc-CHnWH0rF.js} +2 -2
- package/_assets/{sales-empty-CgfqOXUC.js → sales-empty-UircscXh.js} +2 -2
- package/_assets/{search-empty-CfGYFUfS.js → search-empty-CPirv6rw.js} +2 -2
- package/_assets/{secp256k1-B9h6m4IX.js → secp256k1-BUEs1rcj.js} +2 -2
- package/_assets/{secp256k1-AJ3c8h0I.js → secp256k1-Bb0zIfEz.js} +2 -2
- package/_assets/{secp256k1-CXECCrXG.js → secp256k1-D1DTa_mW.js} +2 -2
- package/_assets/{send-rDZTy53I.js → send-C8TzZsHF.js} +2 -2
- package/_assets/{send-batch-transaction-BXWSdFaa.js → send-batch-transaction-CcXPrdOH.js} +2 -2
- package/_assets/{send-eip712-transaction-BQGBgvcc.js → send-eip712-transaction-ouILrTb6.js} +3 -3
- package/_assets/{send-gasless-transaction-BeHePqFn.js → send-gasless-transaction-rKjG34Kj.js} +3 -3
- package/_assets/{send-transaction-Bhl38AZl.js → send-transaction-BbLs2Ynf.js} +3 -3
- package/_assets/{sendMetaTransaction-du2nxyMF.js → sendMetaTransaction-Dy6lp92T.js} +2 -2
- package/_assets/{sendRawTransaction--ZySriEz.js → sendRawTransaction-BY7CWiPp.js} +4 -4
- package/_assets/{sentry-DoDOB8I2.js → sentry-CfKEockx.js} +3 -3
- package/_assets/{serializeTransaction-BlKQ-BiD.js → serializeTransaction-DOIuoefa.js} +2 -2
- package/_assets/{session-proposal-tk_yO7ie.js → session-proposal-BR55dEaA.js} +2 -2
- package/_assets/{session-request-UyTvi1pP.js → session-request-C_hO74mD.js} +3 -3
- package/_assets/{sha256-D8fGQSFL.js → sha256-BJjUSCTX.js} +2 -2
- package/_assets/sha3-B3El3U9k.js +2 -0
- package/_assets/signin-empty-XsT9jLzt.js +2 -0
- package/_assets/{signing-D1A3ZrfL.js → signing-D66RpSSx.js} +4 -4
- package/_assets/{skeleton.styles-DFjpg3_l.js → skeleton.styles-B3BxeSy_.js} +2 -2
- package/_assets/{socials-5DQ9SrVR.js → socials-fdANcU4O.js} +2 -2
- package/_assets/{styled-CjIb5Zdy.js → styled-ihfZhc5C.js} +3 -3
- package/_assets/{swaps-Bztb-KRF.js → swaps-DZV3-WZp.js} +2 -2
- package/_assets/{thirdweb-CZL68BtG.js → thirdweb-dhrmjSPt.js} +4 -4
- package/_assets/{to-serializable-transaction-Cax3D0Ed.js → to-serializable-transaction-BxxEhlQY.js} +3 -3
- package/_assets/{totalSupply-Bfu1b9j-.js → totalSupply-B2nCZvgY.js} +2 -2
- package/_assets/{trade-encoding-7vKZ_RAW.js → trade-encoding-D0iBabuM.js} +2 -2
- package/_assets/{transaction-DT055YfQ.js → transaction-CJXWN8an.js} +2 -2
- package/_assets/{transactionReceipt-DUUD2Qe3.js → transactionReceipt-CpzMTSMZ.js} +2 -2
- package/_assets/{transactions-BAaPWgMx.js → transactions-CKkVNjQ4.js} +2 -2
- package/_assets/{useCreatorSales-Buish4Uu.js → useCreatorSales-Ze3V5ohC.js} +2 -2
- package/_assets/{useInfiniteGrid-CkEaLdl7.js → useInfiniteGrid-D8vhQEzx.js} +2 -2
- package/_assets/{useStore-BIMM-6gW.js → useStore-DdvCUhO-.js} +3 -3
- package/_assets/{useTheme-CseBhYMJ.js → useTheme-QKnvhO7_.js} +2 -2
- package/_assets/{utils-Cn2V-3Ut.js → utils-5qk7WI4m.js} +2 -2
- package/_assets/{verifyHash-yrhfOghy.js → verifyHash-Dm5TFWpr.js} +2 -2
- package/_assets/{w3m-modal-zmzVtMYW.js → w3m-modal-B5R3n_ak.js} +2 -2
- package/_assets/{w3m-modal-DA-0hW7m.js → w3m-modal-CEqDQIHN.js} +2 -2
- package/_assets/{wait-for-tx-receipt-DLebyGh2.js → wait-for-tx-receipt-CUblm3Uy.js} +2 -2
- package/_assets/{wallets-Dtvi0tKv.js → wallets-BT0Osdwo.js} +6 -6
- package/_assets/{web-connector-CvqIuRHL.js → web-connector-BzJlWUBl.js} +4 -4
- package/_assets/{writeContract-C_pXtfiq.js → writeContract-CH8f16EO.js} +2 -2
- package/_assets/{zora-sepolia-BYPjA30G.js → zora-sepolia-BfgSfWmM.js} +2 -2
- package/_assets/{zoraTestnet-CTpQFpZ6.js → zoraTestnet-CiGZFo3e.js} +2 -2
- package/index.html +12 -11
- package/package.json +2 -2
- package/_assets/Event-BneJnOKG.js +0 -72
- package/_assets/cart-checkout-BVJkagSM.js +0 -2
- package/_assets/collectionPage.styles-CJfCc8Bm.js +0 -41
- package/_assets/index-C7QbaZbm.css +0 -1
- package/_assets/index-DRRXfH5T.js +0 -4427
- package/_assets/items-empty-BBmu43Y2.js +0 -2
- package/_assets/sha3-Q9wbGaop.js +0 -2
- package/_assets/signin-empty-DpDwh-SV.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{f as Ht,c as lr,g as Vu}from"./react-ChceODIJ.js";import{B as K}from"./dcl-schemas-BrVwEqiU.js";import{g as dr,c as fs,d as Ut}from"./ethers-DCYs0L1t.js";import{r as zu}from"./index-k1I1IsHl.js";import{e as Ju,b as su,c as Gu,d as qs}from"./index-DPROz7TD.js";import{p as Zu,a as Ku,b as Qu}from"./hooks.module-54Oj1-WJ.js";import{p as re}from"./sentry-DoDOB8I2.js";import{r as hr}from"./events-Ch5mkuEv.js";import{r as Yu}from"./browser-DgDyU9Dd.js";import{t as Xu}from"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3305bf2c-1232-404e-b043-4ea3950a1a80",e._sentryDebugIdIdentifier="sentry-dbid-3305bf2c-1232-404e-b043-4ea3950a1a80")}catch{}})();function el(e,r){for(var t=0;t<r.length;t++){const n=r[t];if(typeof n!="string"&&!Array.isArray(n)){for(const l in n)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(n,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>n[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var wn={},ot={},at={},js;function tl(){if(js)return at;js=1,Object.defineProperty(at,"__esModule",{value:!0}),at.walletLogo=void 0;const e=(r,t)=>{let n;switch(r){case"standard":return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};return at.walletLogo=e,at}var ct={},Fs;function rl(){return Fs||(Fs=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LINK_API_URL=void 0,ct.LINK_API_URL="https://www.walletlink.org"),ct}var W={},_n={},Ae={},$s;function fr(){return $s||($s=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.errorValues=Ae.standardErrorCodes=void 0,Ae.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},Ae.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}),Ae}var ut={},vn={},Hs;function gs(){return Hs||(Hs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=fr(),t="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(u,i=t){if(u&&Number.isInteger(u)){const g=u.toString();if(f(r.errorValues,g))return r.errorValues[g].message;if(c(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=n;function l(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(r.errorValues[i]||c(u))}e.isValidCode=l;function o(u){var i;if(typeof u=="number")return u;if(a(u))return(i=u.code)!==null&&i!==void 0?i:u.errorCode}e.getErrorCode=o;function a(u){return typeof u=="object"&&u!==null&&(typeof u.code=="number"||typeof u.errorCode=="number")}function d(u,{shouldIncludeStack:i=!1}={}){const g={};if(u&&typeof u=="object"&&!Array.isArray(u)&&f(u,"code")&&l(u.code)){const m=u;g.code=m.code,m.message&&typeof m.message=="string"?(g.message=m.message,f(m,"data")&&(g.data=m.data)):(g.message=n(g.code),g.data={originalError:p(u)})}else g.code=r.standardErrorCodes.rpc.internal,g.message=s(u,"message")?u.message:t,g.data={originalError:p(u)};return i&&(g.stack=s(u,"stack")?u.stack:void 0),g}e.serialize=d;function c(u){return u>=-32099&&u<=-32e3}function p(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function f(u,i){return Object.prototype.hasOwnProperty.call(u,i)}function s(u,i){return typeof u=="object"&&u!==null&&i in u&&typeof u[i]=="string"}})(vn)),vn}var Us;function nl(){if(Us)return ut;Us=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.standardErrors=void 0;const e=fr(),r=gs();ut.standardErrors={rpc:{parse:c=>t(e.standardErrorCodes.rpc.parse,c),invalidRequest:c=>t(e.standardErrorCodes.rpc.invalidRequest,c),invalidParams:c=>t(e.standardErrorCodes.rpc.invalidParams,c),methodNotFound:c=>t(e.standardErrorCodes.rpc.methodNotFound,c),internal:c=>t(e.standardErrorCodes.rpc.internal,c),server:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:p}=c;if(!Number.isInteger(p)||p>-32005||p<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(p,c)},invalidInput:c=>t(e.standardErrorCodes.rpc.invalidInput,c),resourceNotFound:c=>t(e.standardErrorCodes.rpc.resourceNotFound,c),resourceUnavailable:c=>t(e.standardErrorCodes.rpc.resourceUnavailable,c),transactionRejected:c=>t(e.standardErrorCodes.rpc.transactionRejected,c),methodNotSupported:c=>t(e.standardErrorCodes.rpc.methodNotSupported,c),limitExceeded:c=>t(e.standardErrorCodes.rpc.limitExceeded,c)},provider:{userRejectedRequest:c=>n(e.standardErrorCodes.provider.userRejectedRequest,c),unauthorized:c=>n(e.standardErrorCodes.provider.unauthorized,c),unsupportedMethod:c=>n(e.standardErrorCodes.provider.unsupportedMethod,c),disconnected:c=>n(e.standardErrorCodes.provider.disconnected,c),chainDisconnected:c=>n(e.standardErrorCodes.provider.chainDisconnected,c),unsupportedChain:c=>n(e.standardErrorCodes.provider.unsupportedChain,c),custom:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:p,message:f,data:s}=c;if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string');return new a(p,f,s)}}};function t(c,p){const[f,s]=l(p);return new o(c,f||(0,r.getMessageFromCode)(c),s)}function n(c,p){const[f,s]=l(p);return new a(c,f||(0,r.getMessageFromCode)(c),s)}function l(c){if(c){if(typeof c=="string")return[c];if(typeof c=="object"&&!Array.isArray(c)){const{message:p,data:f}=c;if(p&&typeof p!="string")throw new Error("Must specify string message.");return[p||void 0,f]}}return[]}class o extends Error{constructor(p,f,s){if(!Number.isInteger(p))throw new Error('"code" must be an integer.');if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string.');super(f),this.code=p,s!==void 0&&(this.data=s)}}class a extends o{constructor(p,f,s){if(!d(p))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(p,f,s)}}function d(c){return Number.isInteger(c)&&c>=1e3&&c<=4999}return ut}var lt={},dt={},Ws;function ps(){if(Ws)return dt;Ws=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.isErrorResponse=void 0;function e(r){return r.errorMessage!==void 0}return dt.isErrorResponse=e,dt}var ht={},Vs;function ms(){return Vs||(Vs=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LIB_VERSION=void 0,ht.LIB_VERSION="3.9.3"),ht}var zs;function il(){if(zs)return lt;zs=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.serializeError=void 0;const e=ps(),r=ms(),t=fr(),n=gs();function l(d,c){const p=(0,n.serialize)(o(d),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",r.LIB_VERSION),f.searchParams.set("code",p.code.toString());const s=a(p.data,c);return s&&f.searchParams.set("method",s),f.searchParams.set("message",p.message),Object.assign(Object.assign({},p),{docUrl:f.href})}lt.serializeError=l;function o(d){return typeof d=="string"?{message:d,code:t.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(d)?Object.assign(Object.assign({},d),{message:d.errorMessage,code:d.errorCode,data:{method:d.method}}):d}function a(d,c){const p=d==null?void 0:d.method;if(p)return p;if(c!==void 0){if(typeof c=="string")return c;if(Array.isArray(c)){if(c.length>0)return c[0].method}else return c.method}}return lt}var Js;function gr(){return Js||(Js=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const r=fr();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return r.standardErrorCodes}});const t=nl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}});const n=il();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const l=gs();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return l.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return l.getMessageFromCode}})})(_n)),_n}var oe={},Gs;function pr(){if(Gs)return oe;Gs=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.ProviderType=oe.RegExpString=oe.IntNumber=oe.BigIntString=oe.AddressString=oe.HexString=oe.OpaqueType=void 0;function e(){return n=>n}oe.OpaqueType=e,oe.HexString=e(),oe.AddressString=e(),oe.BigIntString=e();function r(n){return Math.floor(n)}oe.IntNumber=r,oe.RegExpString=e();var t;return(function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""})(t||(oe.ProviderType=t={})),oe}var Zs;function Re(){if(Zs)return W;Zs=1;var e=W&&W.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(W,"__esModule",{value:!0}),W.isMobileWeb=W.getLocation=W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const r=e(dr()),t=gr(),n=pr(),l=/^[0-9]*$/,o=/^[a-f0-9]*$/;function a(M){return d(crypto.getRandomValues(new Uint8Array(M)))}W.randomBytesHex=a;function d(M){return[...M].map(L=>L.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=d;function c(M){return new Uint8Array(M.match(/.{1,2}/g).map(L=>parseInt(L,16)))}W.hexStringToUint8Array=c;function p(M,L=!1){const T=M.toString("hex");return(0,n.HexString)(L?`0x${T}`:T)}W.hexStringFromBuffer=p;function f(M){return(0,n.BigIntString)(M.toString(10))}W.bigIntStringFromBN=f;function s(M){return(0,n.IntNumber)(new r.default(w(M,!1),16).toNumber())}W.intNumberFromHexString=s;function u(M){return(0,n.HexString)(`0x${new r.default(M).toString(16)}`)}W.hexStringFromIntNumber=u;function i(M){return M.startsWith("0x")||M.startsWith("0X")}W.has0xPrefix=i;function g(M){return i(M)?M.slice(2):M}W.strip0x=g;function m(M){return i(M)?`0x${M.slice(2)}`:`0x${M}`}W.prepend0x=m;function b(M){if(typeof M!="string")return!1;const L=g(M).toLowerCase();return o.test(L)}W.isHexString=b;function h(M,L=!1){if(typeof M=="string"){const T=g(M).toLowerCase();if(o.test(T))return(0,n.HexString)(L?`0x${T}`:T)}throw t.standardErrors.rpc.invalidParams(`"${String(M)}" is not a hexadecimal string`)}W.ensureHexString=h;function w(M,L=!1){let T=h(M,!1);return T.length%2===1&&(T=(0,n.HexString)(`0${T}`)),L?(0,n.HexString)(`0x${T}`):T}W.ensureEvenLengthHexString=w;function y(M){if(typeof M=="string"){const L=g(M).toLowerCase();if(b(L)&&L.length===40)return(0,n.AddressString)(m(L))}throw t.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(M)}`)}W.ensureAddressString=y;function _(M){if(K.isBuffer(M))return M;if(typeof M=="string"){if(b(M)){const L=w(M,!1);return K.from(L,"hex")}return K.from(M,"utf8")}throw t.standardErrors.rpc.invalidParams(`Not binary data: ${String(M)}`)}W.ensureBuffer=_;function v(M){if(typeof M=="number"&&Number.isInteger(M))return(0,n.IntNumber)(M);if(typeof M=="string"){if(l.test(M))return(0,n.IntNumber)(Number(M));if(b(M))return(0,n.IntNumber)(new r.default(w(M,!1),16).toNumber())}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureIntNumber=v;function k(M){if(M instanceof RegExp)return(0,n.RegExpString)(M.toString());throw t.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(M)}`)}W.ensureRegExpString=k;function S(M){if(M!==null&&(r.default.isBN(M)||P(M)))return new r.default(M.toString(10),10);if(typeof M=="number")return new r.default(v(M));if(typeof M=="string"){if(l.test(M))return new r.default(M,10);if(b(M))return new r.default(w(M,!1),16)}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureBN=S;function I(M){if(typeof M=="string")return JSON.parse(M);if(typeof M=="object")return M;throw t.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(M)}`)}W.ensureParsedJSONObject=I;function P(M){if(M==null||typeof M.constructor!="function")return!1;const{constructor:L}=M;return typeof L.config=="function"&&typeof L.EUCLID=="number"}W.isBigNumber=P;function D(M,L){return Array.from({length:L-M},(T,x)=>M+x)}W.range=D;function $(){const M=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:L,host:T}=document.location,x=M?M.getAttribute("href"):null;return!x||x.startsWith("javascript:")||x.startsWith("vbscript:")?null:x.startsWith("http://")||x.startsWith("https://")||x.startsWith("data:")?x:x.startsWith("//")?L+x:`${L}//${T}${x}`}W.getFavicon=$;function z(M,L,T,x,B,V){const q=x?"parent-id":"id",F=new URLSearchParams({[q]:M,secret:L,server:T,v:B,chainId:V.toString()}).toString();return`${T}/#/link?${F}`}W.createQrUrl=z;function X(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=X;function Y(){try{return X()&&window.top?window.top.location:window.location}catch{return window.location}}W.getLocation=Y;function J(){var M;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((M=window==null?void 0:window.navigator)===null||M===void 0?void 0:M.userAgent)}return W.isMobileWeb=J,W}var ft={},Ks;function sl(){if(Ks)return ft;Ks=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.ScopedLocalStorage=void 0;let e=class{constructor(t){this.scope=t}setItem(t,n){localStorage.setItem(this.scopedKey(t),n)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),n=[];for(let l=0;l<localStorage.length;l++){const o=localStorage.key(l);typeof o=="string"&&o.startsWith(t)&&n.push(o)}n.forEach(l=>localStorage.removeItem(l))}scopedKey(t){return`${this.scope}:${t}`}};return ft.ScopedLocalStorage=e,ft}var Me={},gt={},pt={},mt={},Qs;function bs(){return Qs||(Qs=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EVENTS=void 0,mt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}),mt}var de={},Ys;function ys(){if(Ys)return de;Ys=1,Object.defineProperty(de,"__esModule",{value:!0}),de.RelayAbstract=de.APP_VERSION_KEY=de.LOCAL_STORAGE_ADDRESSES_KEY=de.WALLET_USER_NAME_KEY=void 0;const e=gr();de.WALLET_USER_NAME_KEY="walletUsername",de.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",de.APP_VERSION_KEY="AppVersion";let r=class{async makeEthereumJSONRPCRequest(n,l){if(!l)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(l,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json"}}).then(o=>o.json()).then(o=>{if(!o)throw e.standardErrors.rpc.parse({});const a=o,{error:d}=a;if(d)throw(0,e.serializeError)(d,n.method);return a})}};return de.RelayAbstract=r,de}var bt={},Xs;function ws(){if(Xs)return bt;Xs=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.Session=void 0;const e=Ju(),r=Re(),t="session:id",n="session:secret",l="session:linked";let o=class ou{constructor(d,c,p,f){this._storage=d,this._id=c||(0,r.randomBytesHex)(16),this._secret=p||(0,r.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!f}static load(d){const c=d.getItem(t),p=d.getItem(l),f=d.getItem(n);return c&&f?new ou(d,c,f,p==="1"):null}static hash(d){return new e.sha256().update(d).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(d){this._linked=d,this.persistLinked()}save(){return this._storage.setItem(t,this._id),this._storage.setItem(n,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(l,this._linked?"1":"0")}};return bt.Session=o,bt}var yt={},wt={},eo;function ol(){if(eo)return wt;eo=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.Cipher=void 0;const e=Re();let r=class{constructor(n){this.secret=n}async encrypt(n){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");const o=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),d=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:o},a,d.encode(n)),p=16,f=c.slice(c.byteLength-p),s=c.slice(0,c.byteLength-p),u=new Uint8Array(f),i=new Uint8Array(s),g=new Uint8Array([...o,...u,...i]);return(0,e.uint8ArrayToHex)(g)}async decrypt(n){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");return new Promise((o,a)=>{(async function(){const d=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,e.hexStringToUint8Array)(n),p=c.slice(0,12),f=c.slice(12,28),s=c.slice(28),u=new Uint8Array([...s,...f]),i={name:"AES-GCM",iv:new Uint8Array(p)};try{const g=await window.crypto.subtle.decrypt(i,d,u),m=new TextDecoder;o(m.decode(g))}catch(g){a(g)}})()})}};return wt.Cipher=r,wt}var _t={},to;function al(){if(to)return _t;to=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.WalletLinkHTTP=void 0;let e=class{constructor(t,n,l){this.linkAPIUrl=t,this.sessionId=n;const o=`${n}:${l}`;this.auth=`Basic ${btoa(o)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var t;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:l,error:o}=await n.json();if(o)throw new Error(`Check unseen events failed: ${o}`);const a=(t=l==null?void 0:l.filter(d=>d.event==="Web3Response").map(d=>({type:"Event",sessionId:this.sessionId,eventId:d.id,event:d.event,data:d.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${n.status}`)}};return _t.WalletLinkHTTP=e,_t}var Le={},ro;function cl(){if(ro)return Le;ro=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.WalletLinkWebSocket=Le.ConnectionState=void 0;var e;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(e||(Le.ConnectionState=e={}));let r=class{setConnectionStateListener(n){this.connectionStateListener=n}setIncomingDataListener(n){this.incomingDataListener=n}constructor(n,l=WebSocket){this.WebSocketClass=l,this.webSocket=null,this.pendingData=[],this.url=n.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((n,l)=>{var o;let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(d){l(d);return}(o=this.connectionStateListener)===null||o===void 0||o.call(this,e.CONNECTING),a.onclose=d=>{var c;this.clearWebSocket(),l(new Error(`websocket error ${d.code}: ${d.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,e.DISCONNECTED)},a.onopen=d=>{var c;n(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},a.onmessage=d=>{var c,p;if(d.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(d.data);(p=this.incomingDataListener)===null||p===void 0||p.call(this,f)}catch{}}})}disconnect(){var n;const{webSocket:l}=this;if(l){this.clearWebSocket(),(n=this.connectionStateListener)===null||n===void 0||n.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{l.close()}catch{}}}sendData(n){const{webSocket:l}=this;if(!l){this.pendingData.push(n),this.connect();return}l.send(n)}clearWebSocket(){const{webSocket:n}=this;n&&(this.webSocket=null,n.onclose=null,n.onerror=null,n.onmessage=null,n.onopen=null)}};return Le.WalletLinkWebSocket=r,Le}var no;function ul(){if(no)return yt;no=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.WalletLinkConnection=void 0;const e=pr(),r=ol(),t=bs(),n=ys(),l=ws(),o=al(),a=cl(),d=1e4,c=6e4;let p=class{constructor({session:s,linkAPIUrl:u,listener:i,diagnostic:g,WebSocketClass:m=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=h=>{if(!h)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",y=>h.JsonRpcUrl&&this.handleChainUpdated(y,h.JsonRpcUrl)]]).forEach((y,_)=>{const v=h[_];v!==void 0&&y(v)})},this.handleDestroyed=h=>{var w,y;h==="1"&&((w=this.listener)===null||w===void 0||w.resetAndReload(),(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:l.Session.hash(this.session.id)}))},this.handleAccountUpdated=async h=>{var w,y;try{const _=await this.cipher.decrypt(h);(w=this.listener)===null||w===void 0||w.accountUpdated(_)}catch{(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(h,w)=>{var y,_;try{const v=await this.cipher.decrypt(w);(y=this.listener)===null||y===void 0||y.metadataUpdated(h,v)}catch{(_=this.diagnostic)===null||_===void 0||_.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:h})}},this.handleWalletUsernameUpdated=async h=>{this.handleMetadataUpdated(n.WALLET_USER_NAME_KEY,h)},this.handleAppVersionUpdated=async h=>{this.handleMetadataUpdated(n.APP_VERSION_KEY,h)},this.handleChainUpdated=async(h,w)=>{var y,_;try{const v=await this.cipher.decrypt(h),k=await this.cipher.decrypt(w);(y=this.listener)===null||y===void 0||y.chainUpdated(v,k)}catch{(_=this.diagnostic)===null||_===void 0||_.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new r.Cipher(s.secret),this.diagnostic=g,this.listener=i;const b=new a.WalletLinkWebSocket(`${u}/rpc`,m);b.setConnectionStateListener(async h=>{var w;(w=this.diagnostic)===null||w===void 0||w.log(t.EVENTS.CONNECTED_STATE_CHANGE,{state:h,sessionIdHash:l.Session.hash(s.id)});let y=!1;switch(h){case a.ConnectionState.DISCONNECTED:if(!this.destroyed){const _=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||b.connect().catch(()=>{_()})};_()}break;case a.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),y=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},d),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case a.ConnectionState.CONNECTING:break}this.connected!==y&&(this.connected=y)}),b.setIncomingDataListener(h=>{var w,y,_;switch(h.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=h.type==="IsLinkedOK"?h.linked:void 0;(w=this.diagnostic)===null||w===void 0||w.log(t.EVENTS.LINKED,{sessionIdHash:l.Session.hash(s.id),linked:v,type:h.type,onlineGuests:h.onlineGuests}),this.linked=v||h.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:l.Session.hash(s.id),metadata_keys:h&&h.metadata?Object.keys(h.metadata):void 0}),this.handleSessionMetadataUpdated(h.metadata);break}case"Event":{this.handleIncomingEvent(h);break}}h.id!==void 0&&((_=this.requestResolutions.get(h.id))===null||_===void 0||_(h))}),this.ws=b,this.http=new o.WalletLinkHTTP(u,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.STARTED_CONNECTING,{sessionIdHash:l.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.DISCONNECTED,{sessionIdHash:l.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var u,i;this._connected=s,s&&((u=this.onceConnected)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(u=>{this.connected?s().then(u):this.onceConnected=()=>{s().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var u,i;this._linked=s,s&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(u=>{this.linked?s().then(u):this.onceLinked=()=>{s().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(s){var u,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const g=await this.cipher.decrypt(s.data),m=JSON.parse(g);if(m.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(m)}catch{(i=this.diagnostic)===null||i===void 0||i.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(u=>this.handleIncomingEvent(u))}async setSessionMetadata(s,u){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:u}};return this.setOnceConnected(async()=>{const g=await this.makeRequest(i);if(g.type==="Fail")throw new Error(g.error||"failed to set session metadata")})}async publishEvent(s,u,i=!1){const g=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:g,callWebhook:i};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>d*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,u=c){const i=s.id;this.sendData(s);let g;return Promise.race([new Promise((m,b)=>{g=window.setTimeout(()=>{b(new Error(`request ${i} timed out`))},u)}),new Promise(m=>{this.requestResolutions.set(i,b=>{clearTimeout(g),m(b),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(s);if(u.type==="Fail")throw new Error(u.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return yt.WalletLinkConnection=p,yt}var vt={},Te={},Qt={},io;function ll(){return io||(io=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'),Qt}var so;function au(){if(so)return Te;so=1;var e=Te&&Te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.injectCssReset=void 0;const r=e(ll());function t(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(n)}return Te.injectCssReset=t,Te}var Et={};const ce=Ht(Zu);var Ne={};const Wt=Ht(Ku),mr=Ht(Qu);var ve={},Rt={},oo;function dl(){if(oo)return Rt;oo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CloseIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}return Rt.CloseIcon=r,Rt}var St={},ao;function hl(){if(ao)return St;ao=1,Object.defineProperty(St,"__esModule",{value:!0}),St.CoinbaseWalletRound=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,e.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}return St.CoinbaseWalletRound=r,St}var kt={},co;function fl(){if(co)return kt;co=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.QRCodeIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return kt.QRCodeIcon=r,kt}var Pe={},En,uo;function gl(){if(uo)return En;uo=1;function e(i){this.mode=t.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var g=0,m=this.data.length;g<m;g++){var b=[],h=this.data.charCodeAt(g);h>65536?(b[0]=240|(h&1835008)>>>18,b[1]=128|(h&258048)>>>12,b[2]=128|(h&4032)>>>6,b[3]=128|h&63):h>2048?(b[0]=224|(h&61440)>>>12,b[1]=128|(h&4032)>>>6,b[2]=128|h&63):h>128?(b[0]=192|(h&1984)>>>6,b[1]=128|h&63):b[0]=h,this.parsedData.push(b)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var g=0,m=this.parsedData.length;g<m;g++)i.put(this.parsedData[g],8)}};function r(i,g){this.typeNumber=i,this.errorCorrectLevel=g,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}r.prototype={addData:function(i){var g=new e(i);this.dataList.push(g),this.dataCache=null},isDark:function(i,g){if(i<0||this.moduleCount<=i||g<0||this.moduleCount<=g)throw new Error(i+","+g);return this.modules[i][g]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,g){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,g),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,g)},setupPositionProbePattern:function(i,g){for(var m=-1;m<=7;m++)if(!(i+m<=-1||this.moduleCount<=i+m))for(var b=-1;b<=7;b++)g+b<=-1||this.moduleCount<=g+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[i+m][g+b]=!0:this.modules[i+m][g+b]=!1)},getBestMaskPattern:function(){for(var i=0,g=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=o.getLostPoint(this);(m==0||i>b)&&(i=b,g=m)}return g},createMovieClip:function(i,g,m){var b=i.createEmptyMovieClip(g,m),h=1;this.make();for(var w=0;w<this.modules.length;w++)for(var y=w*h,_=0;_<this.modules[w].length;_++){var v=_*h,k=this.modules[w][_];k&&(b.beginFill(0,100),b.moveTo(v,y),b.lineTo(v+h,y),b.lineTo(v+h,y+h),b.lineTo(v,y+h),b.endFill())}return b},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var g=8;g<this.moduleCount-8;g++)this.modules[6][g]==null&&(this.modules[6][g]=g%2==0)},setupPositionAdjustPattern:function(){for(var i=o.getPatternPosition(this.typeNumber),g=0;g<i.length;g++)for(var m=0;m<i.length;m++){var b=i[g],h=i[m];if(this.modules[b][h]==null)for(var w=-2;w<=2;w++)for(var y=-2;y<=2;y++)w==-2||w==2||y==-2||y==2||w==0&&y==0?this.modules[b+w][h+y]=!0:this.modules[b+w][h+y]=!1}},setupTypeNumber:function(i){for(var g=o.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!i&&(g>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!i&&(g>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(i,g){for(var m=this.errorCorrectLevel<<3|g,b=o.getBCHTypeInfo(m),h=0;h<15;h++){var w=!i&&(b>>h&1)==1;h<6?this.modules[h][8]=w:h<8?this.modules[h+1][8]=w:this.modules[this.moduleCount-15+h][8]=w}for(var h=0;h<15;h++){var w=!i&&(b>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=w:h<9?this.modules[8][15-h-1+1]=w:this.modules[8][15-h-1]=w}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,g){for(var m=-1,b=this.moduleCount-1,h=7,w=0,y=this.moduleCount-1;y>0;y-=2)for(y==6&&y--;;){for(var _=0;_<2;_++)if(this.modules[b][y-_]==null){var v=!1;w<i.length&&(v=(i[w]>>>h&1)==1);var k=o.getMask(g,b,y-_);k&&(v=!v),this.modules[b][y-_]=v,h--,h==-1&&(w++,h=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(i,g,m){for(var b=p.getRSBlocks(i,g),h=new f,w=0;w<m.length;w++){var y=m[w];h.put(y.mode,4),h.put(y.getLength(),o.getLengthInBits(y.mode,i)),y.write(h)}for(var _=0,w=0;w<b.length;w++)_+=b[w].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(r.PAD0,8),h.getLengthInBits()>=_*8));)h.put(r.PAD1,8);return r.createBytes(h,b)},r.createBytes=function(i,g){for(var m=0,b=0,h=0,w=new Array(g.length),y=new Array(g.length),_=0;_<g.length;_++){var v=g[_].dataCount,k=g[_].totalCount-v;b=Math.max(b,v),h=Math.max(h,k),w[_]=new Array(v);for(var S=0;S<w[_].length;S++)w[_][S]=255&i.buffer[S+m];m+=v;var I=o.getErrorCorrectPolynomial(k),P=new c(w[_],I.getLength()-1),D=P.mod(I);y[_]=new Array(I.getLength()-1);for(var S=0;S<y[_].length;S++){var $=S+D.getLength()-y[_].length;y[_][S]=$>=0?D.get($):0}}for(var z=0,S=0;S<g.length;S++)z+=g[S].totalCount;for(var X=new Array(z),Y=0,S=0;S<b;S++)for(var _=0;_<g.length;_++)S<w[_].length&&(X[Y++]=w[_][S]);for(var S=0;S<h;S++)for(var _=0;_<g.length;_++)S<y[_].length&&(X[Y++]=y[_][S]);return X};for(var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){for(var g=i<<10;o.getBCHDigit(g)-o.getBCHDigit(o.G15)>=0;)g^=o.G15<<o.getBCHDigit(g)-o.getBCHDigit(o.G15);return(i<<10|g)^o.G15_MASK},getBCHTypeNumber:function(i){for(var g=i<<12;o.getBCHDigit(g)-o.getBCHDigit(o.G18)>=0;)g^=o.G18<<o.getBCHDigit(g)-o.getBCHDigit(o.G18);return i<<12|g},getBCHDigit:function(i){for(var g=0;i!=0;)g++,i>>>=1;return g},getPatternPosition:function(i){return o.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,g,m){switch(i){case l.PATTERN000:return(g+m)%2==0;case l.PATTERN001:return g%2==0;case l.PATTERN010:return m%3==0;case l.PATTERN011:return(g+m)%3==0;case l.PATTERN100:return(Math.floor(g/2)+Math.floor(m/3))%2==0;case l.PATTERN101:return g*m%2+g*m%3==0;case l.PATTERN110:return(g*m%2+g*m%3)%2==0;case l.PATTERN111:return(g*m%3+(g+m)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var g=new c([1],0),m=0;m<i;m++)g=g.multiply(new c([1,a.gexp(m)],0));return g},getLengthInBits:function(i,g){if(1<=g&&g<10)switch(i){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(g<27)switch(i){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(g<41)switch(i){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+g)},getLostPoint:function(i){for(var g=i.getModuleCount(),m=0,b=0;b<g;b++)for(var h=0;h<g;h++){for(var w=0,y=i.isDark(b,h),_=-1;_<=1;_++)if(!(b+_<0||g<=b+_))for(var v=-1;v<=1;v++)h+v<0||g<=h+v||_==0&&v==0||y==i.isDark(b+_,h+v)&&w++;w>5&&(m+=3+w-5)}for(var b=0;b<g-1;b++)for(var h=0;h<g-1;h++){var k=0;i.isDark(b,h)&&k++,i.isDark(b+1,h)&&k++,i.isDark(b,h+1)&&k++,i.isDark(b+1,h+1)&&k++,(k==0||k==4)&&(m+=3)}for(var b=0;b<g;b++)for(var h=0;h<g-6;h++)i.isDark(b,h)&&!i.isDark(b,h+1)&&i.isDark(b,h+2)&&i.isDark(b,h+3)&&i.isDark(b,h+4)&&!i.isDark(b,h+5)&&i.isDark(b,h+6)&&(m+=40);for(var h=0;h<g;h++)for(var b=0;b<g-6;b++)i.isDark(b,h)&&!i.isDark(b+1,h)&&i.isDark(b+2,h)&&i.isDark(b+3,h)&&i.isDark(b+4,h)&&!i.isDark(b+5,h)&&i.isDark(b+6,h)&&(m+=40);for(var S=0,h=0;h<g;h++)for(var b=0;b<g;b++)i.isDark(b,h)&&S++;var I=Math.abs(100*S/g/g-50)/5;return m+=I*10,m}},a={glog:function(i){if(i<1)throw new Error("glog("+i+")");return a.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return a.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},d=0;d<8;d++)a.EXP_TABLE[d]=1<<d;for(var d=8;d<256;d++)a.EXP_TABLE[d]=a.EXP_TABLE[d-4]^a.EXP_TABLE[d-5]^a.EXP_TABLE[d-6]^a.EXP_TABLE[d-8];for(var d=0;d<255;d++)a.LOG_TABLE[a.EXP_TABLE[d]]=d;function c(i,g){if(i.length==null)throw new Error(i.length+"/"+g);for(var m=0;m<i.length&&i[m]==0;)m++;this.num=new Array(i.length-m+g);for(var b=0;b<i.length-m;b++)this.num[b]=i[b+m]}c.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var g=new Array(this.getLength()+i.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<i.getLength();b++)g[m+b]^=a.gexp(a.glog(this.get(m))+a.glog(i.get(b)));return new c(g,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var g=a.glog(this.get(0))-a.glog(i.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<i.getLength();b++)m[b]^=a.gexp(a.glog(i.get(b))+g);return new c(m,0).mod(i)}};function p(i,g){this.totalCount=i,this.dataCount=g}p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],p.getRSBlocks=function(i,g){var m=p.getRsBlockTable(i,g);if(m==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+g);for(var b=m.length/3,h=[],w=0;w<b;w++)for(var y=m[w*3+0],_=m[w*3+1],v=m[w*3+2],k=0;k<y;k++)h.push(new p(_,v));return h},p.getRsBlockTable=function(i,g){switch(g){case n.L:return p.RS_BLOCK_TABLE[(i-1)*4+0];case n.M:return p.RS_BLOCK_TABLE[(i-1)*4+1];case n.Q:return p.RS_BLOCK_TABLE[(i-1)*4+2];case n.H:return p.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function f(){this.buffer=[],this.length=0}f.prototype={get:function(i){var g=Math.floor(i/8);return(this.buffer[g]>>>7-i%8&1)==1},put:function(i,g){for(var m=0;m<g;m++)this.putBit((i>>>g-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var g=Math.floor(this.length/8);this.buffer.length<=g&&this.buffer.push(0),i&&(this.buffer[g]|=128>>>this.length%8),this.length++}};var s=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function u(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var g in i)this.options[g]=i[g];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function m(v){switch(v){case"L":return n.L;case"M":return n.M;case"Q":return n.Q;case"H":return n.H;default:throw new Error("Unknwon error correction level: "+v)}}function b(v,k){for(var S=h(v),I=1,P=0,D=0,$=s.length;D<=$;D++){var z=s[D];if(!z)throw new Error("Content too long: expected "+P+" but got "+S);switch(k){case"L":P=z[0];break;case"M":P=z[1];break;case"Q":P=z[2];break;case"H":P=z[3];break;default:throw new Error("Unknwon error correction level: "+k)}if(S<=P)break;I++}if(I>s.length)throw new Error("Content too long");return I}function h(v){var k=encodeURI(v).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return k.length+(k.length!=v?3:0)}var w=this.options.content,y=b(w,this.options.ecl),_=m(this.options.ecl);this.qrcode=new r(y,_),this.qrcode.addData(w),this.qrcode.make()}return u.prototype.svg=function(i){var g=this.options||{},m=this.qrcode.modules;typeof i>"u"&&(i={container:g.container||"svg"});for(var b=typeof g.pretty<"u"?!!g.pretty:!0,h=b?" ":"",w=b?`\r
|
|
1
|
+
import{f as Ht,c as lr,g as Vu}from"./react-BmPeg6sG.js";import{B as K}from"./dcl-schemas-COntwfiV.js";import{g as dr,c as fs,d as Ut}from"./ethers-BIoA35Pn.js";import{r as zu}from"./index-uYTIcGSZ.js";import{e as Ju,b as su,c as Gu,d as qs}from"./index-D2gmXgfJ.js";import{p as Zu,a as Ku,b as Qu}from"./hooks.module-54Oj1-WJ.js";import{p as re}from"./sentry-CfKEockx.js";import{r as hr}from"./events-DNWUGNd7.js";import{r as Yu}from"./browser-gYEIuxiW.js";import{t as Xu}from"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3305bf2c-1232-404e-b043-4ea3950a1a80",e._sentryDebugIdIdentifier="sentry-dbid-3305bf2c-1232-404e-b043-4ea3950a1a80")}catch{}})();function el(e,r){for(var t=0;t<r.length;t++){const n=r[t];if(typeof n!="string"&&!Array.isArray(n)){for(const l in n)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(n,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>n[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var wn={},ot={},at={},js;function tl(){if(js)return at;js=1,Object.defineProperty(at,"__esModule",{value:!0}),at.walletLogo=void 0;const e=(r,t)=>{let n;switch(r){case"standard":return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};return at.walletLogo=e,at}var ct={},Fs;function rl(){return Fs||(Fs=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LINK_API_URL=void 0,ct.LINK_API_URL="https://www.walletlink.org"),ct}var W={},_n={},Ae={},$s;function fr(){return $s||($s=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.errorValues=Ae.standardErrorCodes=void 0,Ae.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},Ae.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}),Ae}var ut={},vn={},Hs;function gs(){return Hs||(Hs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=fr(),t="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(u,i=t){if(u&&Number.isInteger(u)){const g=u.toString();if(f(r.errorValues,g))return r.errorValues[g].message;if(c(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=n;function l(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(r.errorValues[i]||c(u))}e.isValidCode=l;function o(u){var i;if(typeof u=="number")return u;if(a(u))return(i=u.code)!==null&&i!==void 0?i:u.errorCode}e.getErrorCode=o;function a(u){return typeof u=="object"&&u!==null&&(typeof u.code=="number"||typeof u.errorCode=="number")}function d(u,{shouldIncludeStack:i=!1}={}){const g={};if(u&&typeof u=="object"&&!Array.isArray(u)&&f(u,"code")&&l(u.code)){const m=u;g.code=m.code,m.message&&typeof m.message=="string"?(g.message=m.message,f(m,"data")&&(g.data=m.data)):(g.message=n(g.code),g.data={originalError:p(u)})}else g.code=r.standardErrorCodes.rpc.internal,g.message=s(u,"message")?u.message:t,g.data={originalError:p(u)};return i&&(g.stack=s(u,"stack")?u.stack:void 0),g}e.serialize=d;function c(u){return u>=-32099&&u<=-32e3}function p(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function f(u,i){return Object.prototype.hasOwnProperty.call(u,i)}function s(u,i){return typeof u=="object"&&u!==null&&i in u&&typeof u[i]=="string"}})(vn)),vn}var Us;function nl(){if(Us)return ut;Us=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.standardErrors=void 0;const e=fr(),r=gs();ut.standardErrors={rpc:{parse:c=>t(e.standardErrorCodes.rpc.parse,c),invalidRequest:c=>t(e.standardErrorCodes.rpc.invalidRequest,c),invalidParams:c=>t(e.standardErrorCodes.rpc.invalidParams,c),methodNotFound:c=>t(e.standardErrorCodes.rpc.methodNotFound,c),internal:c=>t(e.standardErrorCodes.rpc.internal,c),server:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:p}=c;if(!Number.isInteger(p)||p>-32005||p<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(p,c)},invalidInput:c=>t(e.standardErrorCodes.rpc.invalidInput,c),resourceNotFound:c=>t(e.standardErrorCodes.rpc.resourceNotFound,c),resourceUnavailable:c=>t(e.standardErrorCodes.rpc.resourceUnavailable,c),transactionRejected:c=>t(e.standardErrorCodes.rpc.transactionRejected,c),methodNotSupported:c=>t(e.standardErrorCodes.rpc.methodNotSupported,c),limitExceeded:c=>t(e.standardErrorCodes.rpc.limitExceeded,c)},provider:{userRejectedRequest:c=>n(e.standardErrorCodes.provider.userRejectedRequest,c),unauthorized:c=>n(e.standardErrorCodes.provider.unauthorized,c),unsupportedMethod:c=>n(e.standardErrorCodes.provider.unsupportedMethod,c),disconnected:c=>n(e.standardErrorCodes.provider.disconnected,c),chainDisconnected:c=>n(e.standardErrorCodes.provider.chainDisconnected,c),unsupportedChain:c=>n(e.standardErrorCodes.provider.unsupportedChain,c),custom:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:p,message:f,data:s}=c;if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string');return new a(p,f,s)}}};function t(c,p){const[f,s]=l(p);return new o(c,f||(0,r.getMessageFromCode)(c),s)}function n(c,p){const[f,s]=l(p);return new a(c,f||(0,r.getMessageFromCode)(c),s)}function l(c){if(c){if(typeof c=="string")return[c];if(typeof c=="object"&&!Array.isArray(c)){const{message:p,data:f}=c;if(p&&typeof p!="string")throw new Error("Must specify string message.");return[p||void 0,f]}}return[]}class o extends Error{constructor(p,f,s){if(!Number.isInteger(p))throw new Error('"code" must be an integer.');if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string.');super(f),this.code=p,s!==void 0&&(this.data=s)}}class a extends o{constructor(p,f,s){if(!d(p))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(p,f,s)}}function d(c){return Number.isInteger(c)&&c>=1e3&&c<=4999}return ut}var lt={},dt={},Ws;function ps(){if(Ws)return dt;Ws=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.isErrorResponse=void 0;function e(r){return r.errorMessage!==void 0}return dt.isErrorResponse=e,dt}var ht={},Vs;function ms(){return Vs||(Vs=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LIB_VERSION=void 0,ht.LIB_VERSION="3.9.3"),ht}var zs;function il(){if(zs)return lt;zs=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.serializeError=void 0;const e=ps(),r=ms(),t=fr(),n=gs();function l(d,c){const p=(0,n.serialize)(o(d),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",r.LIB_VERSION),f.searchParams.set("code",p.code.toString());const s=a(p.data,c);return s&&f.searchParams.set("method",s),f.searchParams.set("message",p.message),Object.assign(Object.assign({},p),{docUrl:f.href})}lt.serializeError=l;function o(d){return typeof d=="string"?{message:d,code:t.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(d)?Object.assign(Object.assign({},d),{message:d.errorMessage,code:d.errorCode,data:{method:d.method}}):d}function a(d,c){const p=d==null?void 0:d.method;if(p)return p;if(c!==void 0){if(typeof c=="string")return c;if(Array.isArray(c)){if(c.length>0)return c[0].method}else return c.method}}return lt}var Js;function gr(){return Js||(Js=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const r=fr();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return r.standardErrorCodes}});const t=nl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}});const n=il();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const l=gs();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return l.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return l.getMessageFromCode}})})(_n)),_n}var oe={},Gs;function pr(){if(Gs)return oe;Gs=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.ProviderType=oe.RegExpString=oe.IntNumber=oe.BigIntString=oe.AddressString=oe.HexString=oe.OpaqueType=void 0;function e(){return n=>n}oe.OpaqueType=e,oe.HexString=e(),oe.AddressString=e(),oe.BigIntString=e();function r(n){return Math.floor(n)}oe.IntNumber=r,oe.RegExpString=e();var t;return(function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""})(t||(oe.ProviderType=t={})),oe}var Zs;function Re(){if(Zs)return W;Zs=1;var e=W&&W.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(W,"__esModule",{value:!0}),W.isMobileWeb=W.getLocation=W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const r=e(dr()),t=gr(),n=pr(),l=/^[0-9]*$/,o=/^[a-f0-9]*$/;function a(M){return d(crypto.getRandomValues(new Uint8Array(M)))}W.randomBytesHex=a;function d(M){return[...M].map(L=>L.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=d;function c(M){return new Uint8Array(M.match(/.{1,2}/g).map(L=>parseInt(L,16)))}W.hexStringToUint8Array=c;function p(M,L=!1){const T=M.toString("hex");return(0,n.HexString)(L?`0x${T}`:T)}W.hexStringFromBuffer=p;function f(M){return(0,n.BigIntString)(M.toString(10))}W.bigIntStringFromBN=f;function s(M){return(0,n.IntNumber)(new r.default(w(M,!1),16).toNumber())}W.intNumberFromHexString=s;function u(M){return(0,n.HexString)(`0x${new r.default(M).toString(16)}`)}W.hexStringFromIntNumber=u;function i(M){return M.startsWith("0x")||M.startsWith("0X")}W.has0xPrefix=i;function g(M){return i(M)?M.slice(2):M}W.strip0x=g;function m(M){return i(M)?`0x${M.slice(2)}`:`0x${M}`}W.prepend0x=m;function b(M){if(typeof M!="string")return!1;const L=g(M).toLowerCase();return o.test(L)}W.isHexString=b;function h(M,L=!1){if(typeof M=="string"){const T=g(M).toLowerCase();if(o.test(T))return(0,n.HexString)(L?`0x${T}`:T)}throw t.standardErrors.rpc.invalidParams(`"${String(M)}" is not a hexadecimal string`)}W.ensureHexString=h;function w(M,L=!1){let T=h(M,!1);return T.length%2===1&&(T=(0,n.HexString)(`0${T}`)),L?(0,n.HexString)(`0x${T}`):T}W.ensureEvenLengthHexString=w;function y(M){if(typeof M=="string"){const L=g(M).toLowerCase();if(b(L)&&L.length===40)return(0,n.AddressString)(m(L))}throw t.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(M)}`)}W.ensureAddressString=y;function _(M){if(K.isBuffer(M))return M;if(typeof M=="string"){if(b(M)){const L=w(M,!1);return K.from(L,"hex")}return K.from(M,"utf8")}throw t.standardErrors.rpc.invalidParams(`Not binary data: ${String(M)}`)}W.ensureBuffer=_;function v(M){if(typeof M=="number"&&Number.isInteger(M))return(0,n.IntNumber)(M);if(typeof M=="string"){if(l.test(M))return(0,n.IntNumber)(Number(M));if(b(M))return(0,n.IntNumber)(new r.default(w(M,!1),16).toNumber())}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureIntNumber=v;function k(M){if(M instanceof RegExp)return(0,n.RegExpString)(M.toString());throw t.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(M)}`)}W.ensureRegExpString=k;function S(M){if(M!==null&&(r.default.isBN(M)||P(M)))return new r.default(M.toString(10),10);if(typeof M=="number")return new r.default(v(M));if(typeof M=="string"){if(l.test(M))return new r.default(M,10);if(b(M))return new r.default(w(M,!1),16)}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureBN=S;function I(M){if(typeof M=="string")return JSON.parse(M);if(typeof M=="object")return M;throw t.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(M)}`)}W.ensureParsedJSONObject=I;function P(M){if(M==null||typeof M.constructor!="function")return!1;const{constructor:L}=M;return typeof L.config=="function"&&typeof L.EUCLID=="number"}W.isBigNumber=P;function D(M,L){return Array.from({length:L-M},(T,x)=>M+x)}W.range=D;function $(){const M=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:L,host:T}=document.location,x=M?M.getAttribute("href"):null;return!x||x.startsWith("javascript:")||x.startsWith("vbscript:")?null:x.startsWith("http://")||x.startsWith("https://")||x.startsWith("data:")?x:x.startsWith("//")?L+x:`${L}//${T}${x}`}W.getFavicon=$;function z(M,L,T,x,B,V){const q=x?"parent-id":"id",F=new URLSearchParams({[q]:M,secret:L,server:T,v:B,chainId:V.toString()}).toString();return`${T}/#/link?${F}`}W.createQrUrl=z;function X(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=X;function Y(){try{return X()&&window.top?window.top.location:window.location}catch{return window.location}}W.getLocation=Y;function J(){var M;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((M=window==null?void 0:window.navigator)===null||M===void 0?void 0:M.userAgent)}return W.isMobileWeb=J,W}var ft={},Ks;function sl(){if(Ks)return ft;Ks=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.ScopedLocalStorage=void 0;let e=class{constructor(t){this.scope=t}setItem(t,n){localStorage.setItem(this.scopedKey(t),n)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),n=[];for(let l=0;l<localStorage.length;l++){const o=localStorage.key(l);typeof o=="string"&&o.startsWith(t)&&n.push(o)}n.forEach(l=>localStorage.removeItem(l))}scopedKey(t){return`${this.scope}:${t}`}};return ft.ScopedLocalStorage=e,ft}var Me={},gt={},pt={},mt={},Qs;function bs(){return Qs||(Qs=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EVENTS=void 0,mt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}),mt}var de={},Ys;function ys(){if(Ys)return de;Ys=1,Object.defineProperty(de,"__esModule",{value:!0}),de.RelayAbstract=de.APP_VERSION_KEY=de.LOCAL_STORAGE_ADDRESSES_KEY=de.WALLET_USER_NAME_KEY=void 0;const e=gr();de.WALLET_USER_NAME_KEY="walletUsername",de.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",de.APP_VERSION_KEY="AppVersion";let r=class{async makeEthereumJSONRPCRequest(n,l){if(!l)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(l,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json"}}).then(o=>o.json()).then(o=>{if(!o)throw e.standardErrors.rpc.parse({});const a=o,{error:d}=a;if(d)throw(0,e.serializeError)(d,n.method);return a})}};return de.RelayAbstract=r,de}var bt={},Xs;function ws(){if(Xs)return bt;Xs=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.Session=void 0;const e=Ju(),r=Re(),t="session:id",n="session:secret",l="session:linked";let o=class ou{constructor(d,c,p,f){this._storage=d,this._id=c||(0,r.randomBytesHex)(16),this._secret=p||(0,r.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!f}static load(d){const c=d.getItem(t),p=d.getItem(l),f=d.getItem(n);return c&&f?new ou(d,c,f,p==="1"):null}static hash(d){return new e.sha256().update(d).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(d){this._linked=d,this.persistLinked()}save(){return this._storage.setItem(t,this._id),this._storage.setItem(n,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(l,this._linked?"1":"0")}};return bt.Session=o,bt}var yt={},wt={},eo;function ol(){if(eo)return wt;eo=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.Cipher=void 0;const e=Re();let r=class{constructor(n){this.secret=n}async encrypt(n){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");const o=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),d=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:o},a,d.encode(n)),p=16,f=c.slice(c.byteLength-p),s=c.slice(0,c.byteLength-p),u=new Uint8Array(f),i=new Uint8Array(s),g=new Uint8Array([...o,...u,...i]);return(0,e.uint8ArrayToHex)(g)}async decrypt(n){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");return new Promise((o,a)=>{(async function(){const d=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,e.hexStringToUint8Array)(n),p=c.slice(0,12),f=c.slice(12,28),s=c.slice(28),u=new Uint8Array([...s,...f]),i={name:"AES-GCM",iv:new Uint8Array(p)};try{const g=await window.crypto.subtle.decrypt(i,d,u),m=new TextDecoder;o(m.decode(g))}catch(g){a(g)}})()})}};return wt.Cipher=r,wt}var _t={},to;function al(){if(to)return _t;to=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.WalletLinkHTTP=void 0;let e=class{constructor(t,n,l){this.linkAPIUrl=t,this.sessionId=n;const o=`${n}:${l}`;this.auth=`Basic ${btoa(o)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var t;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:l,error:o}=await n.json();if(o)throw new Error(`Check unseen events failed: ${o}`);const a=(t=l==null?void 0:l.filter(d=>d.event==="Web3Response").map(d=>({type:"Event",sessionId:this.sessionId,eventId:d.id,event:d.event,data:d.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${n.status}`)}};return _t.WalletLinkHTTP=e,_t}var Le={},ro;function cl(){if(ro)return Le;ro=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.WalletLinkWebSocket=Le.ConnectionState=void 0;var e;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(e||(Le.ConnectionState=e={}));let r=class{setConnectionStateListener(n){this.connectionStateListener=n}setIncomingDataListener(n){this.incomingDataListener=n}constructor(n,l=WebSocket){this.WebSocketClass=l,this.webSocket=null,this.pendingData=[],this.url=n.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((n,l)=>{var o;let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(d){l(d);return}(o=this.connectionStateListener)===null||o===void 0||o.call(this,e.CONNECTING),a.onclose=d=>{var c;this.clearWebSocket(),l(new Error(`websocket error ${d.code}: ${d.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,e.DISCONNECTED)},a.onopen=d=>{var c;n(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},a.onmessage=d=>{var c,p;if(d.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(d.data);(p=this.incomingDataListener)===null||p===void 0||p.call(this,f)}catch{}}})}disconnect(){var n;const{webSocket:l}=this;if(l){this.clearWebSocket(),(n=this.connectionStateListener)===null||n===void 0||n.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{l.close()}catch{}}}sendData(n){const{webSocket:l}=this;if(!l){this.pendingData.push(n),this.connect();return}l.send(n)}clearWebSocket(){const{webSocket:n}=this;n&&(this.webSocket=null,n.onclose=null,n.onerror=null,n.onmessage=null,n.onopen=null)}};return Le.WalletLinkWebSocket=r,Le}var no;function ul(){if(no)return yt;no=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.WalletLinkConnection=void 0;const e=pr(),r=ol(),t=bs(),n=ys(),l=ws(),o=al(),a=cl(),d=1e4,c=6e4;let p=class{constructor({session:s,linkAPIUrl:u,listener:i,diagnostic:g,WebSocketClass:m=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=h=>{if(!h)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",y=>h.JsonRpcUrl&&this.handleChainUpdated(y,h.JsonRpcUrl)]]).forEach((y,_)=>{const v=h[_];v!==void 0&&y(v)})},this.handleDestroyed=h=>{var w,y;h==="1"&&((w=this.listener)===null||w===void 0||w.resetAndReload(),(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:l.Session.hash(this.session.id)}))},this.handleAccountUpdated=async h=>{var w,y;try{const _=await this.cipher.decrypt(h);(w=this.listener)===null||w===void 0||w.accountUpdated(_)}catch{(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(h,w)=>{var y,_;try{const v=await this.cipher.decrypt(w);(y=this.listener)===null||y===void 0||y.metadataUpdated(h,v)}catch{(_=this.diagnostic)===null||_===void 0||_.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:h})}},this.handleWalletUsernameUpdated=async h=>{this.handleMetadataUpdated(n.WALLET_USER_NAME_KEY,h)},this.handleAppVersionUpdated=async h=>{this.handleMetadataUpdated(n.APP_VERSION_KEY,h)},this.handleChainUpdated=async(h,w)=>{var y,_;try{const v=await this.cipher.decrypt(h),k=await this.cipher.decrypt(w);(y=this.listener)===null||y===void 0||y.chainUpdated(v,k)}catch{(_=this.diagnostic)===null||_===void 0||_.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new r.Cipher(s.secret),this.diagnostic=g,this.listener=i;const b=new a.WalletLinkWebSocket(`${u}/rpc`,m);b.setConnectionStateListener(async h=>{var w;(w=this.diagnostic)===null||w===void 0||w.log(t.EVENTS.CONNECTED_STATE_CHANGE,{state:h,sessionIdHash:l.Session.hash(s.id)});let y=!1;switch(h){case a.ConnectionState.DISCONNECTED:if(!this.destroyed){const _=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||b.connect().catch(()=>{_()})};_()}break;case a.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),y=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},d),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case a.ConnectionState.CONNECTING:break}this.connected!==y&&(this.connected=y)}),b.setIncomingDataListener(h=>{var w,y,_;switch(h.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=h.type==="IsLinkedOK"?h.linked:void 0;(w=this.diagnostic)===null||w===void 0||w.log(t.EVENTS.LINKED,{sessionIdHash:l.Session.hash(s.id),linked:v,type:h.type,onlineGuests:h.onlineGuests}),this.linked=v||h.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(y=this.diagnostic)===null||y===void 0||y.log(t.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:l.Session.hash(s.id),metadata_keys:h&&h.metadata?Object.keys(h.metadata):void 0}),this.handleSessionMetadataUpdated(h.metadata);break}case"Event":{this.handleIncomingEvent(h);break}}h.id!==void 0&&((_=this.requestResolutions.get(h.id))===null||_===void 0||_(h))}),this.ws=b,this.http=new o.WalletLinkHTTP(u,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.STARTED_CONNECTING,{sessionIdHash:l.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.DISCONNECTED,{sessionIdHash:l.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var u,i;this._connected=s,s&&((u=this.onceConnected)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(u=>{this.connected?s().then(u):this.onceConnected=()=>{s().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var u,i;this._linked=s,s&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(u=>{this.linked?s().then(u):this.onceLinked=()=>{s().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(s){var u,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const g=await this.cipher.decrypt(s.data),m=JSON.parse(g);if(m.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(m)}catch{(i=this.diagnostic)===null||i===void 0||i.log(t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(u=>this.handleIncomingEvent(u))}async setSessionMetadata(s,u){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:u}};return this.setOnceConnected(async()=>{const g=await this.makeRequest(i);if(g.type==="Fail")throw new Error(g.error||"failed to set session metadata")})}async publishEvent(s,u,i=!1){const g=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:g,callWebhook:i};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>d*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,u=c){const i=s.id;this.sendData(s);let g;return Promise.race([new Promise((m,b)=>{g=window.setTimeout(()=>{b(new Error(`request ${i} timed out`))},u)}),new Promise(m=>{this.requestResolutions.set(i,b=>{clearTimeout(g),m(b),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(s);if(u.type==="Fail")throw new Error(u.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return yt.WalletLinkConnection=p,yt}var vt={},Te={},Qt={},io;function ll(){return io||(io=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'),Qt}var so;function au(){if(so)return Te;so=1;var e=Te&&Te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.injectCssReset=void 0;const r=e(ll());function t(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(n)}return Te.injectCssReset=t,Te}var Et={};const ce=Ht(Zu);var Ne={};const Wt=Ht(Ku),mr=Ht(Qu);var ve={},Rt={},oo;function dl(){if(oo)return Rt;oo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CloseIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}return Rt.CloseIcon=r,Rt}var St={},ao;function hl(){if(ao)return St;ao=1,Object.defineProperty(St,"__esModule",{value:!0}),St.CoinbaseWalletRound=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,e.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}return St.CoinbaseWalletRound=r,St}var kt={},co;function fl(){if(co)return kt;co=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.QRCodeIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return kt.QRCodeIcon=r,kt}var Pe={},En,uo;function gl(){if(uo)return En;uo=1;function e(i){this.mode=t.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var g=0,m=this.data.length;g<m;g++){var b=[],h=this.data.charCodeAt(g);h>65536?(b[0]=240|(h&1835008)>>>18,b[1]=128|(h&258048)>>>12,b[2]=128|(h&4032)>>>6,b[3]=128|h&63):h>2048?(b[0]=224|(h&61440)>>>12,b[1]=128|(h&4032)>>>6,b[2]=128|h&63):h>128?(b[0]=192|(h&1984)>>>6,b[1]=128|h&63):b[0]=h,this.parsedData.push(b)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var g=0,m=this.parsedData.length;g<m;g++)i.put(this.parsedData[g],8)}};function r(i,g){this.typeNumber=i,this.errorCorrectLevel=g,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}r.prototype={addData:function(i){var g=new e(i);this.dataList.push(g),this.dataCache=null},isDark:function(i,g){if(i<0||this.moduleCount<=i||g<0||this.moduleCount<=g)throw new Error(i+","+g);return this.modules[i][g]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,g){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,g),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,g)},setupPositionProbePattern:function(i,g){for(var m=-1;m<=7;m++)if(!(i+m<=-1||this.moduleCount<=i+m))for(var b=-1;b<=7;b++)g+b<=-1||this.moduleCount<=g+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[i+m][g+b]=!0:this.modules[i+m][g+b]=!1)},getBestMaskPattern:function(){for(var i=0,g=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=o.getLostPoint(this);(m==0||i>b)&&(i=b,g=m)}return g},createMovieClip:function(i,g,m){var b=i.createEmptyMovieClip(g,m),h=1;this.make();for(var w=0;w<this.modules.length;w++)for(var y=w*h,_=0;_<this.modules[w].length;_++){var v=_*h,k=this.modules[w][_];k&&(b.beginFill(0,100),b.moveTo(v,y),b.lineTo(v+h,y),b.lineTo(v+h,y+h),b.lineTo(v,y+h),b.endFill())}return b},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var g=8;g<this.moduleCount-8;g++)this.modules[6][g]==null&&(this.modules[6][g]=g%2==0)},setupPositionAdjustPattern:function(){for(var i=o.getPatternPosition(this.typeNumber),g=0;g<i.length;g++)for(var m=0;m<i.length;m++){var b=i[g],h=i[m];if(this.modules[b][h]==null)for(var w=-2;w<=2;w++)for(var y=-2;y<=2;y++)w==-2||w==2||y==-2||y==2||w==0&&y==0?this.modules[b+w][h+y]=!0:this.modules[b+w][h+y]=!1}},setupTypeNumber:function(i){for(var g=o.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!i&&(g>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!i&&(g>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(i,g){for(var m=this.errorCorrectLevel<<3|g,b=o.getBCHTypeInfo(m),h=0;h<15;h++){var w=!i&&(b>>h&1)==1;h<6?this.modules[h][8]=w:h<8?this.modules[h+1][8]=w:this.modules[this.moduleCount-15+h][8]=w}for(var h=0;h<15;h++){var w=!i&&(b>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=w:h<9?this.modules[8][15-h-1+1]=w:this.modules[8][15-h-1]=w}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,g){for(var m=-1,b=this.moduleCount-1,h=7,w=0,y=this.moduleCount-1;y>0;y-=2)for(y==6&&y--;;){for(var _=0;_<2;_++)if(this.modules[b][y-_]==null){var v=!1;w<i.length&&(v=(i[w]>>>h&1)==1);var k=o.getMask(g,b,y-_);k&&(v=!v),this.modules[b][y-_]=v,h--,h==-1&&(w++,h=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(i,g,m){for(var b=p.getRSBlocks(i,g),h=new f,w=0;w<m.length;w++){var y=m[w];h.put(y.mode,4),h.put(y.getLength(),o.getLengthInBits(y.mode,i)),y.write(h)}for(var _=0,w=0;w<b.length;w++)_+=b[w].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(r.PAD0,8),h.getLengthInBits()>=_*8));)h.put(r.PAD1,8);return r.createBytes(h,b)},r.createBytes=function(i,g){for(var m=0,b=0,h=0,w=new Array(g.length),y=new Array(g.length),_=0;_<g.length;_++){var v=g[_].dataCount,k=g[_].totalCount-v;b=Math.max(b,v),h=Math.max(h,k),w[_]=new Array(v);for(var S=0;S<w[_].length;S++)w[_][S]=255&i.buffer[S+m];m+=v;var I=o.getErrorCorrectPolynomial(k),P=new c(w[_],I.getLength()-1),D=P.mod(I);y[_]=new Array(I.getLength()-1);for(var S=0;S<y[_].length;S++){var $=S+D.getLength()-y[_].length;y[_][S]=$>=0?D.get($):0}}for(var z=0,S=0;S<g.length;S++)z+=g[S].totalCount;for(var X=new Array(z),Y=0,S=0;S<b;S++)for(var _=0;_<g.length;_++)S<w[_].length&&(X[Y++]=w[_][S]);for(var S=0;S<h;S++)for(var _=0;_<g.length;_++)S<y[_].length&&(X[Y++]=y[_][S]);return X};for(var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){for(var g=i<<10;o.getBCHDigit(g)-o.getBCHDigit(o.G15)>=0;)g^=o.G15<<o.getBCHDigit(g)-o.getBCHDigit(o.G15);return(i<<10|g)^o.G15_MASK},getBCHTypeNumber:function(i){for(var g=i<<12;o.getBCHDigit(g)-o.getBCHDigit(o.G18)>=0;)g^=o.G18<<o.getBCHDigit(g)-o.getBCHDigit(o.G18);return i<<12|g},getBCHDigit:function(i){for(var g=0;i!=0;)g++,i>>>=1;return g},getPatternPosition:function(i){return o.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,g,m){switch(i){case l.PATTERN000:return(g+m)%2==0;case l.PATTERN001:return g%2==0;case l.PATTERN010:return m%3==0;case l.PATTERN011:return(g+m)%3==0;case l.PATTERN100:return(Math.floor(g/2)+Math.floor(m/3))%2==0;case l.PATTERN101:return g*m%2+g*m%3==0;case l.PATTERN110:return(g*m%2+g*m%3)%2==0;case l.PATTERN111:return(g*m%3+(g+m)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var g=new c([1],0),m=0;m<i;m++)g=g.multiply(new c([1,a.gexp(m)],0));return g},getLengthInBits:function(i,g){if(1<=g&&g<10)switch(i){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(g<27)switch(i){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(g<41)switch(i){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+g)},getLostPoint:function(i){for(var g=i.getModuleCount(),m=0,b=0;b<g;b++)for(var h=0;h<g;h++){for(var w=0,y=i.isDark(b,h),_=-1;_<=1;_++)if(!(b+_<0||g<=b+_))for(var v=-1;v<=1;v++)h+v<0||g<=h+v||_==0&&v==0||y==i.isDark(b+_,h+v)&&w++;w>5&&(m+=3+w-5)}for(var b=0;b<g-1;b++)for(var h=0;h<g-1;h++){var k=0;i.isDark(b,h)&&k++,i.isDark(b+1,h)&&k++,i.isDark(b,h+1)&&k++,i.isDark(b+1,h+1)&&k++,(k==0||k==4)&&(m+=3)}for(var b=0;b<g;b++)for(var h=0;h<g-6;h++)i.isDark(b,h)&&!i.isDark(b,h+1)&&i.isDark(b,h+2)&&i.isDark(b,h+3)&&i.isDark(b,h+4)&&!i.isDark(b,h+5)&&i.isDark(b,h+6)&&(m+=40);for(var h=0;h<g;h++)for(var b=0;b<g-6;b++)i.isDark(b,h)&&!i.isDark(b+1,h)&&i.isDark(b+2,h)&&i.isDark(b+3,h)&&i.isDark(b+4,h)&&!i.isDark(b+5,h)&&i.isDark(b+6,h)&&(m+=40);for(var S=0,h=0;h<g;h++)for(var b=0;b<g;b++)i.isDark(b,h)&&S++;var I=Math.abs(100*S/g/g-50)/5;return m+=I*10,m}},a={glog:function(i){if(i<1)throw new Error("glog("+i+")");return a.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return a.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},d=0;d<8;d++)a.EXP_TABLE[d]=1<<d;for(var d=8;d<256;d++)a.EXP_TABLE[d]=a.EXP_TABLE[d-4]^a.EXP_TABLE[d-5]^a.EXP_TABLE[d-6]^a.EXP_TABLE[d-8];for(var d=0;d<255;d++)a.LOG_TABLE[a.EXP_TABLE[d]]=d;function c(i,g){if(i.length==null)throw new Error(i.length+"/"+g);for(var m=0;m<i.length&&i[m]==0;)m++;this.num=new Array(i.length-m+g);for(var b=0;b<i.length-m;b++)this.num[b]=i[b+m]}c.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var g=new Array(this.getLength()+i.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<i.getLength();b++)g[m+b]^=a.gexp(a.glog(this.get(m))+a.glog(i.get(b)));return new c(g,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var g=a.glog(this.get(0))-a.glog(i.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<i.getLength();b++)m[b]^=a.gexp(a.glog(i.get(b))+g);return new c(m,0).mod(i)}};function p(i,g){this.totalCount=i,this.dataCount=g}p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],p.getRSBlocks=function(i,g){var m=p.getRsBlockTable(i,g);if(m==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+g);for(var b=m.length/3,h=[],w=0;w<b;w++)for(var y=m[w*3+0],_=m[w*3+1],v=m[w*3+2],k=0;k<y;k++)h.push(new p(_,v));return h},p.getRsBlockTable=function(i,g){switch(g){case n.L:return p.RS_BLOCK_TABLE[(i-1)*4+0];case n.M:return p.RS_BLOCK_TABLE[(i-1)*4+1];case n.Q:return p.RS_BLOCK_TABLE[(i-1)*4+2];case n.H:return p.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function f(){this.buffer=[],this.length=0}f.prototype={get:function(i){var g=Math.floor(i/8);return(this.buffer[g]>>>7-i%8&1)==1},put:function(i,g){for(var m=0;m<g;m++)this.putBit((i>>>g-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var g=Math.floor(this.length/8);this.buffer.length<=g&&this.buffer.push(0),i&&(this.buffer[g]|=128>>>this.length%8),this.length++}};var s=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function u(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var g in i)this.options[g]=i[g];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function m(v){switch(v){case"L":return n.L;case"M":return n.M;case"Q":return n.Q;case"H":return n.H;default:throw new Error("Unknwon error correction level: "+v)}}function b(v,k){for(var S=h(v),I=1,P=0,D=0,$=s.length;D<=$;D++){var z=s[D];if(!z)throw new Error("Content too long: expected "+P+" but got "+S);switch(k){case"L":P=z[0];break;case"M":P=z[1];break;case"Q":P=z[2];break;case"H":P=z[3];break;default:throw new Error("Unknwon error correction level: "+k)}if(S<=P)break;I++}if(I>s.length)throw new Error("Content too long");return I}function h(v){var k=encodeURI(v).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return k.length+(k.length!=v?3:0)}var w=this.options.content,y=b(w,this.options.ecl),_=m(this.options.ecl);this.qrcode=new r(y,_),this.qrcode.addData(w),this.qrcode.make()}return u.prototype.svg=function(i){var g=this.options||{},m=this.qrcode.modules;typeof i>"u"&&(i={container:g.container||"svg"});for(var b=typeof g.pretty<"u"?!!g.pretty:!0,h=b?" ":"",w=b?`\r
|
|
2
2
|
`:"",y=g.width,_=g.height,v=m.length,k=y/(v+2*g.padding),S=_/(v+2*g.padding),I=typeof g.join<"u"?!!g.join:!1,P=typeof g.swap<"u"?!!g.swap:!1,D=typeof g.xmlDeclaration<"u"?!!g.xmlDeclaration:!0,$=typeof g.predefined<"u"?!!g.predefined:!1,z=$?h+'<defs><path id="qrmodule" d="M0 0 h'+S+" v"+k+' H0 z" style="fill:'+g.color+';shape-rendering:crispEdges;" /></defs>'+w:"",X=h+'<rect x="0" y="0" width="'+y+'" height="'+_+'" style="fill:'+g.background+';shape-rendering:crispEdges;"/>'+w,Y="",J="",M=0;M<v;M++)for(var L=0;L<v;L++){var T=m[L][M];if(T){var x=L*k+g.padding*k,B=M*S+g.padding*S;if(P){var V=x;x=B,B=V}if(I){var q=k+x,F=S+B;x=Number.isInteger(x)?Number(x):x.toFixed(2),B=Number.isInteger(B)?Number(B):B.toFixed(2),q=Number.isInteger(q)?Number(q):q.toFixed(2),F=Number.isInteger(F)?Number(F):F.toFixed(2),J+="M"+x+","+B+" V"+F+" H"+q+" V"+B+" H"+x+" Z "}else $?Y+=h+'<use x="'+x.toString()+'" y="'+B.toString()+'" href="#qrmodule" />'+w:Y+=h+'<rect x="'+x.toString()+'" y="'+B.toString()+'" width="'+k+'" height="'+S+'" style="fill:'+g.color+';shape-rendering:crispEdges;"/>'+w}}I&&(Y=h+'<path x="0" y="0" style="fill:'+g.color+';shape-rendering:crispEdges;" d="'+J+'" />');let G="";if(this.options.image!==void 0&&this.options.image.svg){const C=y*this.options.image.width/100,A=_*this.options.image.height/100,N=y/2-C/2,U=_/2-A/2;G+=`<svg x="${N}" y="${U}" width="${C}" height="${A}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,G+=this.options.image.svg+w,G+="</svg>"}var H="";switch(i.container){case"svg":D&&(H+='<?xml version="1.0" standalone="yes"?>'+w),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+y+'" height="'+_+'">'+w,H+=z+X+Y,H+=G,H+="</svg>";break;case"svg-viewbox":D&&(H+='<?xml version="1.0" standalone="yes"?>'+w),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+y+" "+_+'">'+w,H+=z+X+Y,H+=G,H+="</svg>";break;case"g":H+='<g width="'+y+'" height="'+_+'">'+w,H+=z+X+Y,H+=G,H+="</g>";break;default:H+=(z+X+Y+G).replace(/^\s+/,"");break}return H},En=u,En}var lo;function pl(){if(lo)return Pe;lo=1;var e=Pe&&Pe.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.QRCode=void 0;const r=ce,t=mr,n=e(gl()),l=o=>{const[a,d]=(0,t.useState)("");return(0,t.useEffect)(()=>{var c,p;const f=new n.default({content:o.content,background:o.bgColor||"#ffffff",color:o.fgColor||"#000000",container:"svg",ecl:"M",width:(c=o.width)!==null&&c!==void 0?c:256,height:(p=o.height)!==null&&p!==void 0?p:256,padding:0,image:o.image}),s=K.from(f.svg(),"utf8").toString("base64");d(`data:image/svg+xml;base64,${s}`)},[o.bgColor,o.content,o.fgColor,o.height,o.image,o.width]),a?(0,r.h)("img",{src:a,alt:"QR Code"}):null};return Pe.QRCode=l,Pe}var Oe={},Yt={},ho;function ml(){return ho||(ho=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"),Yt}var fo;function bl(){if(fo)return Oe;fo=1;var e=Oe&&Oe.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.Spinner=void 0;const r=ce,t=e(ml()),n=l=>{var o;const a=(o=l.size)!==null&&o!==void 0?o:64,d=l.color||"#000";return(0,r.h)("div",{class:"-cbwsdk-spinner"},(0,r.h)("style",null,t.default),(0,r.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:a,height:a}},(0,r.h)("circle",{style:{cx:50,cy:50,r:45,stroke:d}})))};return Oe.Spinner=n,Oe}var Xt={},go;function yl(){return go||(go=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"),Xt}var po;function wl(){if(po)return ve;po=1;var e=ve&&ve.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.CoinbaseWalletSteps=ve.ConnectContent=void 0;const r=e(Wt),t=ce,n=Re(),l=ms(),o=dl(),a=hl(),d=fl(),c=pl(),p=bl(),f=e(yl()),s={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:m},u=b=>b==="light"?"#FFFFFF":"#0A0B0D";function i(b){const{theme:h}=b,w=(0,n.createQrUrl)(b.sessionId,b.sessionSecret,b.linkAPIUrl,b.isParentConnection,b.version,b.chainId),y=s.steps;return(0,t.h)("div",{"data-testid":"connect-content",className:(0,r.default)("-cbwsdk-connect-content",h)},(0,t.h)("style",null,f.default),(0,t.h)("div",{className:"-cbwsdk-connect-content-header"},(0,t.h)("h2",{className:(0,r.default)("-cbwsdk-connect-content-heading",h)},"Scan to connect with our mobile app"),b.onCancel&&(0,t.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:b.onCancel},(0,t.h)(o.CloseIcon,{fill:h==="light"?"#0A0B0D":"#FFFFFF"}))),(0,t.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,t.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,t.h)(g,{title:s.title,description:s.description,theme:h})),(0,t.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,t.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,t.h)(c.QRCode,{content:w,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,t.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:l.LIB_VERSION}),(0,t.h)("input",{type:"hidden",value:w})),(0,t.h)(y,{theme:h}),!b.isConnected&&(0,t.h)("div",{"data-testid":"connecting-spinner",className:(0,r.default)("-cbwsdk-connect-content-qr-connecting",h)},(0,t.h)(p.Spinner,{size:36,color:h==="dark"?"#FFF":"#000"}),(0,t.h)("p",null,"Connecting...")))))}ve.ConnectContent=i;function g({title:b,description:h,theme:w}){return(0,t.h)("div",{className:(0,r.default)("-cbwsdk-connect-item",w)},(0,t.h)("div",null,(0,t.h)(a.CoinbaseWalletRound,null)),(0,t.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,t.h)("h3",{className:"-cbwsdk-connect-item-title"},b),(0,t.h)("p",{className:"-cbwsdk-connect-item-description"},h)))}function m({theme:b}){return(0,t.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,t.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",b)},(0,t.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,t.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",b)},(0,t.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,t.h)("span",null,"Tap ",(0,t.h)("strong",null,"Scan")," "),(0,t.h)("span",{className:(0,r.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",b)},(0,t.h)(d.QRCodeIcon,{fill:u(b)})))))}return ve.CoinbaseWalletSteps=m,ve}var xe={},Ct={},mo;function _l(){if(mo)return Ct;mo=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.ArrowLeftIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}return Ct.ArrowLeftIcon=r,Ct}var It={},bo;function vl(){if(bo)return It;bo=1,Object.defineProperty(It,"__esModule",{value:!0}),It.LaptopIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}return It.LaptopIcon=r,It}var At={},yo;function El(){if(yo)return At;yo=1,Object.defineProperty(At,"__esModule",{value:!0}),At.SafeIcon=void 0;const e=ce;function r(t){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}return At.SafeIcon=r,At}var er={},wo;function Rl(){return wo||(wo=1,Object.defineProperty(er,"__esModule",{value:!0}),er.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"),er}var _o;function Sl(){if(_o)return xe;_o=1;var e=xe&&xe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.TryExtensionContent=void 0;const r=e(Wt),t=ce,n=mr,l=_l(),o=vl(),a=El(),d=e(Rl());function c({theme:p}){const[f,s]=(0,n.useState)(!1),u=(0,n.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,n.useCallback)(()=>{f?window.location.reload():(u(),s(!0))},[u,f]);return(0,t.h)("div",{class:(0,r.default)("-cbwsdk-try-extension",p)},(0,t.h)("style",null,d.default),(0,t.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,t.h)("h3",{class:(0,r.default)("-cbwsdk-try-extension-heading",p)},"Or try the Coinbase Wallet browser extension"),(0,t.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,t.h)("button",{class:(0,r.default)("-cbwsdk-try-extension-cta",p),onClick:i},f?"Refresh":"Install"),(0,t.h)("div",null,!f&&(0,t.h)(l.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:p==="light"?"#0052FF":"#588AF5"})))),(0,t.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,t.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,t.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,t.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,t.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",p)},(0,t.h)(o.LaptopIcon,{fill:p==="light"?"#0A0B0D":"#FFFFFF"}))),(0,t.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",p)},"Connect with dapps with just one click on your desktop browser")),(0,t.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,t.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,t.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",p)},(0,t.h)(a.SafeIcon,{fill:p==="light"?"#0A0B0D":"#FFFFFF"}))),(0,t.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",p)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return xe.TryExtensionContent=c,xe}var tr={},vo;function kl(){return vo||(vo=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"),tr}var Eo;function Cl(){if(Eo)return Ne;Eo=1;var e=Ne&&Ne.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.ConnectDialog=void 0;const r=e(Wt),t=ce,n=mr,l=wl(),o=Sl(),a=e(kl()),d=c=>{const{isOpen:p,darkMode:f}=c,[s,u]=(0,n.useState)(!p),[i,g]=(0,n.useState)(!p);(0,n.useEffect)(()=>{const b=[window.setTimeout(()=>{g(!p)},10)];return p?u(!1):b.push(window.setTimeout(()=>{u(!0)},360)),()=>{b.forEach(window.clearTimeout)}},[p]);const m=f?"dark":"light";return(0,t.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-container",s&&"-cbwsdk-connect-dialog-container-hidden")},(0,t.h)("style",null,a.default),(0,t.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-backdrop",m,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,t.h)("div",{class:"-cbwsdk-connect-dialog"},(0,t.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},c.connectDisabled?null:(0,t.h)(l.ConnectContent,{theme:m,version:c.version,sessionId:c.sessionId,sessionSecret:c.sessionSecret,linkAPIUrl:c.linkAPIUrl,isConnected:c.isConnected,isParentConnection:c.isParentConnection,chainId:c.chainId,onCancel:c.onCancel}),(0,t.h)(o.TryExtensionContent,{theme:m}))))};return Ne.ConnectDialog=d,Ne}var Ro;function Il(){if(Ro)return Et;Ro=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.LinkFlow=void 0;const e=ce,r=Cl();let t=class{constructor(l){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=l.darkMode,this.version=l.version,this.sessionId=l.sessionId,this.sessionSecret=l.sessionSecret,this.linkAPIUrl=l.linkAPIUrl,this.isParentConnection=l.isParentConnection}attach(l){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",l.appendChild(this.root),this.render()}setConnected(l){this.connected!==l&&(this.connected=l,this.render())}setChainId(l){this.chainId!==l&&(this.chainId=l,this.render())}detach(){var l;this.root&&((0,e.render)(null,this.root),(l=this.root.parentElement)===null||l===void 0||l.removeChild(this.root))}setConnectDisabled(l){this.connectDisabled=l}open(l){this.isOpen=!0,this.onCancel=l.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(r.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}};return Et.LinkFlow=t,Et}var Mt={},rr={},So;function Al(){return So||(So=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),rr}var ko;function cu(){return ko||(ko=1,(function(e){var r=Mt&&Mt.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const t=r(Wt),n=ce,l=mr,o=r(Al()),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",d="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(u){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=u.darkMode}attach(u){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",u.appendChild(this.root),this.render()}presentItem(u){const i=this.nextItemKey++;return this.items.set(i,u),this.render(),()=>{this.items.delete(i),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([u,i])=>(0,n.h)(e.SnackbarInstance,Object.assign({},i,{key:u}))))),this.root)}}e.Snackbar=c;const p=s=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,o.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},s.children));e.SnackbarContainer=p;const f=({autoExpand:s,message:u,menuItems:i})=>{const[g,m]=(0,l.useState)(!0),[b,h]=(0,l.useState)(s??!1);(0,l.useEffect)(()=>{const y=[window.setTimeout(()=>{m(!1)},1),window.setTimeout(()=>{h(!0)},1e4)];return()=>{y.forEach(window.clearTimeout)}});const w=()=>{h(!b)};return(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",g&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:w},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},u),(0,n.h)("div",{class:"-gear-container"},!b&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:d,class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((y,_)=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:y.onClick,key:_},(0,n.h)("svg",{width:y.svgWidth,height:y.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":y.defaultFillRule,"clip-rule":y.defaultClipRule,d:y.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},y.info)))))};e.SnackbarInstance=f})(Mt)),Mt}var Co;function uu(){if(Co)return vt;Co=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.WalletLinkRelayUI=void 0;const e=au(),r=Il(),t=cu();let n=class{constructor(o){this.standalone=null,this.attached=!1,this.snackbar=new t.Snackbar({darkMode:o.darkMode}),this.linkFlow=new r.LinkFlow({darkMode:o.darkMode,version:o.version,sessionId:o.session.id,sessionSecret:o.session.secret,linkAPIUrl:o.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const o=document.documentElement,a=document.createElement("div");a.className="-cbwsdk-css-reset",o.appendChild(a),this.linkFlow.attach(a),this.snackbar.attach(a),this.attached=!0,(0,e.injectCssReset)()}setConnected(o){this.linkFlow.setConnected(o)}setChainId(o){this.linkFlow.setChainId(o)}setConnectDisabled(o){this.linkFlow.setConnectDisabled(o)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(o){this.linkFlow.open({onCancel:o.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(o){let a;return o.isUnlinkedErrorState?a={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:o.onResetConnection}]}:a={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:o.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:o.onResetConnection}]},this.snackbar.presentItem(a)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(o){this.standalone=o}isStandalone(){var o;return(o=this.standalone)!==null&&o!==void 0?o:!1}};return vt.WalletLinkRelayUI=n,vt}var Io;function lu(){if(Io)return pt;Io=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.WalletLinkRelay=void 0;const e=gr(),r=pr(),t=Re(),n=bs(),l=ys(),o=ws(),a=ul(),d=ps(),c=uu();let p=class Ge extends l.RelayAbstract{constructor(s){var u;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=b=>{var h;this.isLinked=b;const w=this.storage.getItem(l.LOCAL_STORAGE_ADDRESSES_KEY);if(b&&(this.session.linked=b),this.isUnlinkedErrorState=!1,w){const y=w.split(" "),_=this.storage.getItem("IsStandaloneSigning")==="true";if(y[0]!==""&&!b&&this.session.linked&&!_){this.isUnlinkedErrorState=!0;const v=this.getSessionIdHash();(h=this.diagnostic)===null||h===void 0||h.log(n.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:v})}}},this.metadataUpdated=(b,h)=>{this.storage.setItem(b,h)},this.chainUpdated=(b,h)=>{this.chainCallbackParams.chainId===b&&this.chainCallbackParams.jsonRpcUrl===h||(this.chainCallbackParams={chainId:b,jsonRpcUrl:h},this.chainCallback&&this.chainCallback(b,h))},this.accountUpdated=b=>{this.accountsCallback&&this.accountsCallback([b]),Ge.accountRequestCallbackIds.size>0&&(Array.from(Ge.accountRequestCallbackIds.values()).forEach(h=>{const w={type:"WEB3_RESPONSE",id:h,response:{method:"requestEthereumAccounts",result:[b]}};this.invokeCallback(Object.assign(Object.assign({},w),{id:h}))}),Ge.accountRequestCallbackIds.clear())},this.connectedUpdated=b=>{this.ui.setConnected(b)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=s.linkAPIUrl,this.storage=s.storage,this.options=s;const{session:i,ui:g,connection:m}=this.subscribe();this._session=i,this.connection=m,this.relayEventManager=s.relayEventManager,this.diagnostic=s.diagnosticLogger,this._reloadOnDisconnect=(u=s.reloadOnDisconnect)!==null&&u!==void 0?u:!0,this.ui=g}subscribe(){const s=o.Session.load(this.storage)||new o.Session(this.storage).save(),{linkAPIUrl:u,diagnostic:i}=this,g=new a.WalletLinkConnection({session:s,linkAPIUrl:u,diagnostic:i,listener:this}),{version:m,darkMode:b}=this.options,h=this.options.uiConstructor({linkAPIUrl:u,version:m,darkMode:b,session:s});return g.connect(),{session:s,ui:h,connection:g}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(s=>setTimeout(()=>s(null),1e3))]).then(()=>{var s,u;const i=this.ui.isStandalone();(s=this.diagnostic)===null||s===void 0||s.log(n.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const g=o.Session.load(this.storage);if((g==null?void 0:g.id)===this._session.id?this.storage.clear():g&&((u=this.diagnostic)===null||u===void 0||u.log(n.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o.Session.hash(g.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:m,ui:b,connection:h}=this.subscribe();this._session=m,this.connection=h,this.ui=b,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(s=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(n.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${s}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(s,u){this.appName=s,this.appLogoUrl=u}getStorageItem(s){return this.storage.getItem(s)}get session(){return this._session}setStorageItem(s,u){this.storage.setItem(s,u)}signEthereumMessage(s,u,i,g){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,t.hexStringFromBuffer)(s,!0),address:u,addPrefix:i,typedDataJson:g||null}})}ethereumAddressFromSignedMessage(s,u,i){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,t.hexStringFromBuffer)(s,!0),signature:(0,t.hexStringFromBuffer)(u,!0),addPrefix:i}})}signEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,t.bigIntStringFromBN)(s.weiValue),data:(0,t.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,t.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.gasPriceInWei?(0,t.bigIntStringFromBN)(s.gasPriceInWei):null,maxPriorityFeePerGas:s.gasPriceInWei?(0,t.bigIntStringFromBN)(s.gasPriceInWei):null,gasLimit:s.gasLimit?(0,t.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,t.bigIntStringFromBN)(s.weiValue),data:(0,t.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,t.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.maxFeePerGas?(0,t.bigIntStringFromBN)(s.maxFeePerGas):null,maxPriorityFeePerGas:s.maxPriorityFeePerGas?(0,t.bigIntStringFromBN)(s.maxPriorityFeePerGas):null,gasLimit:s.gasLimit?(0,t.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!0}})}submitEthereumTransaction(s,u){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,t.hexStringFromBuffer)(s,!0),chainId:u}})}scanQRCode(s){return this.sendRequest({method:"scanQRCode",params:{regExp:s}})}getQRCodeUrl(){return(0,t.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(s,u){return this.sendRequest({method:"generic",params:{action:u,data:s}})}sendGenericMessage(s){return this.sendRequest(s)}sendRequest(s){let u=null;const i=(0,t.randomBytesHex)(8),g=b=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,b),u==null||u()};return{promise:new Promise((b,h)=>{this.ui.isStandalone()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(i,w=>{if(u==null||u(),(0,d.isErrorResponse)(w))return h(new Error(w.errorMessage));b(w)}),this.ui.isStandalone()?this.sendRequestStandalone(i,s):this.publishWeb3RequestEvent(i,s)}),cancel:g}}setConnectDisabled(s){this.ui.setConnectDisabled(s)}setAccountsCallback(s){this.accountsCallback=s}setChainCallback(s){this.chainCallback=s}setDappDefaultChainCallback(s){this.dappDefaultChain=s,this.ui instanceof c.WalletLinkRelayUI&&this.ui.setChainId(s)}publishWeb3RequestEvent(s,u){var i;const g={type:"WEB3_REQUEST",id:s,request:u},m=o.Session.load(this.storage);(i=this.diagnostic)===null||i===void 0||i.log(n.EVENTS.WEB3_REQUEST,{eventId:g.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?o.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",g,!0).then(b=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(n.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:g.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?o.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()})}).catch(b=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g.id,response:{method:u.method,errorMessage:b.message}})})}publishWeb3RequestCanceledEvent(s){const u={type:"WEB3_REQUEST_CANCELED",id:s};this.publishEvent("Web3RequestCanceled",u,!1).then()}publishEvent(s,u,i){return this.connection.publishEvent(s,u,i)}handleWeb3ResponseMessage(s){var u;const{response:i}=s;if((u=this.diagnostic)===null||u===void 0||u.log(n.EVENTS.WEB3_RESPONSE,{eventId:s.id,method:`relay::${i.method}`,sessionIdHash:this.getSessionIdHash()}),i.method==="requestEthereumAccounts"){Ge.accountRequestCallbackIds.forEach(g=>this.invokeCallback(Object.assign(Object.assign({},s),{id:g}))),Ge.accountRequestCallbackIds.clear();return}this.invokeCallback(s)}handleErrorResponse(s,u,i,g){var m;const b=(m=i==null?void 0:i.message)!==null&&m!==void 0?m:(0,e.getMessageFromCode)(g);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:u,errorMessage:b,errorCode:g}})}invokeCallback(s){const u=this.relayEventManager.callbacks.get(s.id);u&&(u(s.response),this.relayEventManager.callbacks.delete(s.id))}requestEthereumAccounts(){const s={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},u=(0,t.randomBytesHex)(8),i=m=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,m)};return{promise:new Promise((m,b)=>{if(this.relayEventManager.callbacks.set(u,h=>{if(this.ui.hideRequestEthereumAccounts(),(0,d.isErrorResponse)(h))return b(new Error(h.errorMessage));m(h)}),this.ui.inlineAccountsResponse()){const h=w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:w}})};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:h})}else{const h=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(h)})}Ge.accountRequestCallbackIds.add(u),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,s)}),cancel:i}}selectProvider(s){const u={method:"selectProvider"},i=(0,t.randomBytesHex)(8),g=b=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,u.method,b)},m=new Promise((b,h)=>{this.relayEventManager.callbacks.set(i,_=>{if((0,d.isErrorResponse)(_))return h(new Error(_.errorMessage));b(_)});const w=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:r.ProviderType.Unselected}})},y=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:_}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:y,onCancel:w,providerOptions:s})});return{cancel:g,promise:m}}watchAsset(s,u,i,g,m,b){const h={method:"watchAsset",params:{type:s,options:{address:u,symbol:i,decimals:g,image:m},chainId:b}};let w=null;const y=(0,t.randomBytesHex)(8),_=k=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,h.method,k),w==null||w()};this.ui.inlineWatchAsset()||(w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload}));const v=new Promise((k,S)=>{this.relayEventManager.callbacks.set(y,D=>{if(w==null||w(),(0,d.isErrorResponse)(D))return S(new Error(D.errorMessage));k(D)});const I=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:y,response:{method:"watchAsset",result:!1}})},P=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:y,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:I,type:s,address:u,symbol:i,decimals:g,image:m,chainId:b}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,h)});return{cancel:_,promise:v}}addEthereumChain(s,u,i,g,m,b){const h={method:"addEthereumChain",params:{chainId:s,rpcUrls:u,blockExplorerUrls:g,chainName:m,iconUrls:i,nativeCurrency:b}};let w=null;const y=(0,t.randomBytesHex)(8),_=k=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,h.method,k),w==null||w()};return this.ui.inlineAddEthereumChain(s)||(w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload})),{promise:new Promise((k,S)=>{this.relayEventManager.callbacks.set(y,D=>{if(w==null||w(),(0,d.isErrorResponse)(D))return S(new Error(D.errorMessage));k(D)});const I=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:y,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},P=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:y,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:D}}})};this.ui.inlineAddEthereumChain(s)&&this.ui.addEthereumChain({onCancel:I,onApprove:P,chainId:h.params.chainId,rpcUrls:h.params.rpcUrls,blockExplorerUrls:h.params.blockExplorerUrls,chainName:h.params.chainName,iconUrls:h.params.iconUrls,nativeCurrency:h.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(s)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,h)}),cancel:_}}switchEthereumChain(s,u){const i={method:"switchEthereumChain",params:Object.assign({chainId:s},{address:u})},g=(0,t.randomBytesHex)(8),m=h=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,i.method,h)};return{promise:new Promise((h,w)=>{this.relayEventManager.callbacks.set(g,v=>{if((0,d.isErrorResponse)(v)&&v.errorCode)return w(e.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,d.isErrorResponse)(v))return w(new Error(v.errorMessage));h(v)});const y=v=>{var k;if(v){const S=(k=(0,e.getErrorCode)(v))!==null&&k!==void 0?k:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(g,"switchEthereumChain",v instanceof Error?v:e.standardErrors.provider.unsupportedChain(s),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},_=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:v}}})};this.ui.switchEthereumChain({onCancel:y,onApprove:_,chainId:i.params.chainId,address:i.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,i)}),cancel:m}}inlineAddEthereumChain(s){return this.ui.inlineAddEthereumChain(s)}getSessionIdHash(){return o.Session.hash(this._session.id)}sendRequestStandalone(s,u){const i=m=>{this.handleErrorResponse(s,u.method,m)},g=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:m})};switch(u.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:u,onSuccess:g,onCancel:i});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:u,onSuccess:g,onCancel:i});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:u,onSuccess:g,onCancel:i});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:u,onSuccess:g});break;default:i();break}}};return pt.WalletLinkRelay=p,p.accountRequestCallbackIds=new Set,pt}var Lt={},Be={},De={},Ao;function Ml(){return Ao||(Ao=1,(function(e){var r=De&&De.__createBinding||(Object.create?(function(n,l,o,a){a===void 0&&(a=o);var d=Object.getOwnPropertyDescriptor(l,o);(!d||("get"in d?!l.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return l[o]}}),Object.defineProperty(n,a,d)}):(function(n,l,o,a){a===void 0&&(a=o),n[a]=l[o]})),t=De&&De.__exportStar||function(n,l){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(l,o)&&r(l,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),t(cu(),e)})(De)),De}var nr={},Mo;function Ll(){return Mo||(Mo=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),nr}var Lo;function Tl(){if(Lo)return Be;Lo=1;var e=Be&&Be.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.RedirectDialog=void 0;const r=e(Wt),t=ce,n=au(),l=Ml(),o=e(Ll());let a=class{constructor(){this.root=null}attach(){const p=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",p.appendChild(this.root),(0,n.injectCssReset)()}present(p){this.render(p)}clear(){this.render(null)}render(p){this.root&&((0,t.render)(null,this.root),p&&(0,t.render)((0,t.h)(d,Object.assign({},p,{onDismiss:()=>{this.clear()}})),this.root))}};Be.RedirectDialog=a;const d=({title:c,buttonText:p,darkMode:f,onButtonClick:s,onDismiss:u})=>{const i=f?"dark":"light";return(0,t.h)(l.SnackbarContainer,{darkMode:f},(0,t.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,t.h)("style",null,o.default),(0,t.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:u}),(0,t.h)("div",{class:(0,r.default)("-cbwsdk-redirect-dialog-box",i)},(0,t.h)("p",null,c),(0,t.h)("button",{onClick:s},p))))};return Be}var To;function du(){if(To)return Lt;To=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.MobileRelayUI=void 0;const e=Tl();let r=class{constructor(n){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.RedirectDialog,this.darkMode=n.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(n){}redirectToCoinbaseWallet(n){const l=new URL("https://go.cb-w.com/walletlink");l.searchParams.append("redirect_url",window.location.href),n&&l.searchParams.append("wl_url",n);const o=document.createElement("a");o.target="cbw-opener",o.href=l.href,o.rel="noreferrer noopener",o.click()}openCoinbaseWalletDeeplink(n){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(n)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(n)},99)}showConnecting(n){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}};return Lt.MobileRelayUI=r,Lt}var No;function hu(){if(No)return gt;No=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.MobileRelay=void 0;const e=Re(),r=lu(),t=du();let n=class extends r.WalletLinkRelay{constructor(o){var a;super(o),this._enableMobileWalletLink=(a=o.enableMobileWalletLink)!==null&&a!==void 0?a:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const o=(0,e.getLocation)();o.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(o.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(o,a){if(super.publishWeb3RequestEvent(o,a),!(this._enableMobileWalletLink&&this.ui instanceof t.MobileRelayUI))return;let d=!1;switch(a.method){case"requestEthereumAccounts":case"connectAndSignIn":d=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:d=!0,this.ui.openCoinbaseWalletDeeplink();break}d&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(o){super.handleWeb3ResponseMessage(o)}connectAndSignIn(o){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:o.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:o.statement,resources:o.resources}})}};return gt.MobileRelay=n,gt}var ir={exports:{}},Rn,Po;function fu(){return Po||(Po=1,Rn=hr().EventEmitter),Rn}var Sn,Oo;function Nl(){if(Oo)return Sn;Oo=1;function e(g,m){var b=Object.keys(g);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(g);m&&(h=h.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),b.push.apply(b,h)}return b}function r(g){for(var m=1;m<arguments.length;m++){var b=arguments[m]!=null?arguments[m]:{};m%2?e(Object(b),!0).forEach(function(h){t(g,h,b[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(h){Object.defineProperty(g,h,Object.getOwnPropertyDescriptor(b,h))})}return g}function t(g,m,b){return m=a(m),m in g?Object.defineProperty(g,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):g[m]=b,g}function n(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function l(g,m){for(var b=0;b<m.length;b++){var h=m[b];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,a(h.key),h)}}function o(g,m,b){return m&&l(g.prototype,m),Object.defineProperty(g,"prototype",{writable:!1}),g}function a(g){var m=d(g,"string");return typeof m=="symbol"?m:String(m)}function d(g,m){if(typeof g!="object"||g===null)return g;var b=g[Symbol.toPrimitive];if(b!==void 0){var h=b.call(g,m);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}var c=fs(),p=c.Buffer,f=su(),s=f.inspect,u=s&&s.custom||"inspect";function i(g,m,b){p.prototype.copy.call(g,m,b)}return Sn=(function(){function g(){n(this,g),this.head=null,this.tail=null,this.length=0}return o(g,[{key:"push",value:function(b){var h={data:b,next:null};this.length>0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(b){var h={data:b,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var h=this.head,w=""+h.data;h=h.next;)w+=b+h.data;return w}},{key:"concat",value:function(b){if(this.length===0)return p.alloc(0);for(var h=p.allocUnsafe(b>>>0),w=this.head,y=0;w;)i(w.data,h,y),y+=w.data.length,w=w.next;return h}},{key:"consume",value:function(b,h){var w;return b<this.head.data.length?(w=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?w=this.shift():w=h?this._getString(b):this._getBuffer(b),w}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var h=this.head,w=1,y=h.data;for(b-=y.length;h=h.next;){var _=h.data,v=b>_.length?_.length:b;if(v===_.length?y+=_:y+=_.slice(0,b),b-=v,b===0){v===_.length?(++w,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=_.slice(v));break}++w}return this.length-=w,y}},{key:"_getBuffer",value:function(b){var h=p.allocUnsafe(b),w=this.head,y=1;for(w.data.copy(h),b-=w.data.length;w=w.next;){var _=w.data,v=b>_.length?_.length:b;if(_.copy(h,h.length-b,0,v),b-=v,b===0){v===_.length?(++y,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=_.slice(v));break}++y}return this.length-=y,h}},{key:u,value:function(b,h){return s(this,r(r({},h),{},{depth:0,customInspect:!1}))}}]),g})(),Sn}var kn,xo;function gu(){if(xo)return kn;xo=1;function e(a,d){var c=this,p=this._readableState&&this._readableState.destroyed,f=this._writableState&&this._writableState.destroyed;return p||f?(d?d(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,re.nextTick(l,this,a)):re.nextTick(l,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(s){!d&&s?c._writableState?c._writableState.errorEmitted?re.nextTick(t,c):(c._writableState.errorEmitted=!0,re.nextTick(r,c,s)):re.nextTick(r,c,s):d?(re.nextTick(t,c),d(s)):re.nextTick(t,c)}),this)}function r(a,d){l(a,d),t(a)}function t(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function l(a,d){a.emit("error",d)}function o(a,d){var c=a._readableState,p=a._writableState;c&&c.autoDestroy||p&&p.autoDestroy?a.destroy(d):a.emit("error",d)}return kn={destroy:e,undestroy:n,errorOrDestroy:o},kn}var Cn={},Bo;function rt(){if(Bo)return Cn;Bo=1;function e(d,c){d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.__proto__=c}var r={};function t(d,c,p){p||(p=Error);function f(u,i,g){return typeof c=="string"?c:c(u,i,g)}var s=(function(u){e(i,u);function i(g,m,b){return u.call(this,f(g,m,b))||this}return i})(p);s.prototype.name=p.name,s.prototype.code=d,r[d]=s}function n(d,c){if(Array.isArray(d)){var p=d.length;return d=d.map(function(f){return String(f)}),p>2?"one of ".concat(c," ").concat(d.slice(0,p-1).join(", "),", or ")+d[p-1]:p===2?"one of ".concat(c," ").concat(d[0]," or ").concat(d[1]):"of ".concat(c," ").concat(d[0])}else return"of ".concat(c," ").concat(String(d))}function l(d,c,p){return d.substr(0,c.length)===c}function o(d,c,p){return(p===void 0||p>d.length)&&(p=d.length),d.substring(p-c.length,p)===c}function a(d,c,p){return typeof p!="number"&&(p=0),p+c.length>d.length?!1:d.indexOf(c,p)!==-1}return t("ERR_INVALID_OPT_VALUE",function(d,c){return'The value "'+c+'" is invalid for option "'+d+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(d,c,p){var f;typeof c=="string"&&l(c,"not ")?(f="must not be",c=c.replace(/^not /,"")):f="must be";var s;if(o(d," argument"))s="The ".concat(d," ").concat(f," ").concat(n(c,"type"));else{var u=a(d,".")?"property":"argument";s='The "'.concat(d,'" ').concat(u," ").concat(f," ").concat(n(c,"type"))}return s+=". Received type ".concat(typeof p),s},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(d){return"The "+d+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(d){return"Cannot call "+d+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(d){return"Unknown encoding: "+d},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Cn.codes=r,Cn}var In,Do;function pu(){if(Do)return In;Do=1;var e=rt().codes.ERR_INVALID_OPT_VALUE;function r(n,l,o){return n.highWaterMark!=null?n.highWaterMark:l?n[o]:null}function t(n,l,o,a){var d=r(l,a,o);if(d!=null){if(!(isFinite(d)&&Math.floor(d)===d)||d<0){var c=a?o:"highWaterMark";throw new e(c,d)}return Math.floor(d)}return n.objectMode?16:16*1024}return In={getHighWaterMark:t},In}var An,qo;function mu(){if(qo)return An;qo=1,An=I;function e(C){var A=this;this.next=null,this.entry=null,this.finish=function(){H(A,C)}}var r;I.WritableState=k;var t={deprecate:Gu()},n=fu(),l=fs().Buffer,o=(typeof lr<"u"?lr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(C){return l.from(C)}function d(C){return l.isBuffer(C)||C instanceof o}var c=gu(),p=pu(),f=p.getHighWaterMark,s=rt().codes,u=s.ERR_INVALID_ARG_TYPE,i=s.ERR_METHOD_NOT_IMPLEMENTED,g=s.ERR_MULTIPLE_CALLBACK,m=s.ERR_STREAM_CANNOT_PIPE,b=s.ERR_STREAM_DESTROYED,h=s.ERR_STREAM_NULL_VALUES,w=s.ERR_STREAM_WRITE_AFTER_END,y=s.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;Ut()(I,n);function v(){}function k(C,A,N){r=r||tt(),C=C||{},typeof N!="boolean"&&(N=A instanceof r),this.objectMode=!!C.objectMode,N&&(this.objectMode=this.objectMode||!!C.writableObjectMode),this.highWaterMark=f(this,C,"writableHighWaterMark",N),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=C.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=C.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){M(A,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}k.prototype.getBuffer=function(){for(var A=this.bufferedRequest,N=[];A;)N.push(A),A=A.next;return N},(function(){try{Object.defineProperty(k.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(A){return S.call(this,A)?!0:this!==I?!1:A&&A._writableState instanceof k}})):S=function(A){return A instanceof this};function I(C){r=r||tt();var A=this instanceof r;if(!A&&!S.call(I,this))return new I(C);this._writableState=new k(C,this,A),this.writable=!0,C&&(typeof C.write=="function"&&(this._write=C.write),typeof C.writev=="function"&&(this._writev=C.writev),typeof C.destroy=="function"&&(this._destroy=C.destroy),typeof C.final=="function"&&(this._final=C.final)),n.call(this)}I.prototype.pipe=function(){_(this,new m)};function P(C,A){var N=new w;_(C,N),re.nextTick(A,N)}function D(C,A,N,U){var Q;return N===null?Q=new h:typeof N!="string"&&!A.objectMode&&(Q=new u("chunk",["string","Buffer"],N)),Q?(_(C,Q),re.nextTick(U,Q),!1):!0}I.prototype.write=function(C,A,N){var U=this._writableState,Q=!1,E=!U.objectMode&&d(C);return E&&!l.isBuffer(C)&&(C=a(C)),typeof A=="function"&&(N=A,A=null),E?A="buffer":A||(A=U.defaultEncoding),typeof N!="function"&&(N=v),U.ending?P(this,N):(E||D(this,U,C,N))&&(U.pendingcb++,Q=z(this,U,E,C,A,N)),Q},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var C=this._writableState;C.corked&&(C.corked--,!C.writing&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&x(this,C))},I.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new y(A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $(C,A,N){return!C.objectMode&&C.decodeStrings!==!1&&typeof A=="string"&&(A=l.from(A,N)),A}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(C,A,N,U,Q,E){if(!N){var R=$(A,U,Q);U!==R&&(N=!0,Q="buffer",U=R)}var O=A.objectMode?1:U.length;A.length+=O;var j=A.length<A.highWaterMark;if(j||(A.needDrain=!0),A.writing||A.corked){var ne=A.lastBufferedRequest;A.lastBufferedRequest={chunk:U,encoding:Q,isBuf:N,callback:E,next:null},ne?ne.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else X(C,A,!1,O,U,Q,E);return j}function X(C,A,N,U,Q,E,R){A.writelen=U,A.writecb=R,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new b("write")):N?C._writev(Q,A.onwrite):C._write(Q,E,A.onwrite),A.sync=!1}function Y(C,A,N,U,Q){--A.pendingcb,N?(re.nextTick(Q,U),re.nextTick(F,C,A),C._writableState.errorEmitted=!0,_(C,U)):(Q(U),C._writableState.errorEmitted=!0,_(C,U),F(C,A))}function J(C){C.writing=!1,C.writecb=null,C.length-=C.writelen,C.writelen=0}function M(C,A){var N=C._writableState,U=N.sync,Q=N.writecb;if(typeof Q!="function")throw new g;if(J(N),A)Y(C,N,U,A,Q);else{var E=B(N)||C.destroyed;!E&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&x(C,N),U?re.nextTick(L,C,N,E,Q):L(C,N,E,Q)}}function L(C,A,N,U){N||T(C,A),A.pendingcb--,U(),F(C,A)}function T(C,A){A.length===0&&A.needDrain&&(A.needDrain=!1,C.emit("drain"))}function x(C,A){A.bufferProcessing=!0;var N=A.bufferedRequest;if(C._writev&&N&&N.next){var U=A.bufferedRequestCount,Q=new Array(U),E=A.corkedRequestsFree;E.entry=N;for(var R=0,O=!0;N;)Q[R]=N,N.isBuf||(O=!1),N=N.next,R+=1;Q.allBuffers=O,X(C,A,!0,A.length,Q,"",E.finish),A.pendingcb++,A.lastBufferedRequest=null,E.next?(A.corkedRequestsFree=E.next,E.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;N;){var j=N.chunk,ne=N.encoding,Z=N.callback,te=A.objectMode?1:j.length;if(X(C,A,!1,te,j,ne,Z),N=N.next,A.bufferedRequestCount--,A.writing)break}N===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=N,A.bufferProcessing=!1}I.prototype._write=function(C,A,N){N(new i("_write()"))},I.prototype._writev=null,I.prototype.end=function(C,A,N){var U=this._writableState;return typeof C=="function"?(N=C,C=null,A=null):typeof A=="function"&&(N=A,A=null),C!=null&&this.write(C,A),U.corked&&(U.corked=1,this.uncork()),U.ending||G(this,U,N),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function B(C){return C.ending&&C.length===0&&C.bufferedRequest===null&&!C.finished&&!C.writing}function V(C,A){C._final(function(N){A.pendingcb--,N&&_(C,N),A.prefinished=!0,C.emit("prefinish"),F(C,A)})}function q(C,A){!A.prefinished&&!A.finalCalled&&(typeof C._final=="function"&&!A.destroyed?(A.pendingcb++,A.finalCalled=!0,re.nextTick(V,C,A)):(A.prefinished=!0,C.emit("prefinish")))}function F(C,A){var N=B(A);if(N&&(q(C,A),A.pendingcb===0&&(A.finished=!0,C.emit("finish"),A.autoDestroy))){var U=C._readableState;(!U||U.autoDestroy&&U.endEmitted)&&C.destroy()}return N}function G(C,A,N){A.ending=!0,F(C,A),N&&(A.finished?re.nextTick(N):C.once("finish",N)),A.ended=!0,C.writable=!1}function H(C,A,N){var U=C.entry;for(C.entry=null;U;){var Q=U.callback;A.pendingcb--,Q(N),U=U.next}A.corkedRequestsFree.next=C}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(A){this._writableState&&(this._writableState.destroyed=A)}}),I.prototype.destroy=c.destroy,I.prototype._undestroy=c.undestroy,I.prototype._destroy=function(C,A){A(C)},An}var Mn,jo;function tt(){if(jo)return Mn;jo=1;var e=Object.keys||function(p){var f=[];for(var s in p)f.push(s);return f};Mn=a;var r=bu(),t=mu();Ut()(a,r);for(var n=e(t.prototype),l=0;l<n.length;l++){var o=n[l];a.prototype[o]||(a.prototype[o]=t.prototype[o])}function a(p){if(!(this instanceof a))return new a(p);r.call(this,p),t.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",d)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function d(){this._writableState.ended||re.nextTick(c,this)}function c(p){p.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),Mn}var Ln,Fo;function _s(){if(Fo)return Ln;Fo=1;var e=rt().codes.ERR_STREAM_PREMATURE_CLOSE;function r(o){var a=!1;return function(){if(!a){a=!0;for(var d=arguments.length,c=new Array(d),p=0;p<d;p++)c[p]=arguments[p];o.apply(this,c)}}}function t(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function l(o,a,d){if(typeof a=="function")return l(o,null,a);a||(a={}),d=r(d||t);var c=a.readable||a.readable!==!1&&o.readable,p=a.writable||a.writable!==!1&&o.writable,f=function(){o.writable||u()},s=o._writableState&&o._writableState.finished,u=function(){p=!1,s=!0,c||d.call(o)},i=o._readableState&&o._readableState.endEmitted,g=function(){c=!1,i=!0,p||d.call(o)},m=function(y){d.call(o,y)},b=function(){var y;if(c&&!i)return(!o._readableState||!o._readableState.ended)&&(y=new e),d.call(o,y);if(p&&!s)return(!o._writableState||!o._writableState.ended)&&(y=new e),d.call(o,y)},h=function(){o.req.on("finish",u)};return n(o)?(o.on("complete",u),o.on("abort",b),o.req?h():o.on("request",h)):p&&!o._writableState&&(o.on("end",f),o.on("close",f)),o.on("end",g),o.on("finish",u),a.error!==!1&&o.on("error",m),o.on("close",b),function(){o.removeListener("complete",u),o.removeListener("abort",b),o.removeListener("request",h),o.req&&o.req.removeListener("finish",u),o.removeListener("end",f),o.removeListener("close",f),o.removeListener("finish",u),o.removeListener("end",g),o.removeListener("error",m),o.removeListener("close",b)}}return Ln=l,Ln}var Tn,$o;function Pl(){if($o)return Tn;$o=1;var e;function r(y,_,v){return _=t(_),_ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}function t(y){var _=n(y,"string");return typeof _=="symbol"?_:String(_)}function n(y,_){if(typeof y!="object"||y===null)return y;var v=y[Symbol.toPrimitive];if(v!==void 0){var k=v.call(y,_);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(y)}var l=_s(),o=Symbol("lastResolve"),a=Symbol("lastReject"),d=Symbol("error"),c=Symbol("ended"),p=Symbol("lastPromise"),f=Symbol("handlePromise"),s=Symbol("stream");function u(y,_){return{value:y,done:_}}function i(y){var _=y[o];if(_!==null){var v=y[s].read();v!==null&&(y[p]=null,y[o]=null,y[a]=null,_(u(v,!1)))}}function g(y){re.nextTick(i,y)}function m(y,_){return function(v,k){y.then(function(){if(_[c]){v(u(void 0,!0));return}_[f](v,k)},k)}}var b=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((e={get stream(){return this[s]},next:function(){var _=this,v=this[d];if(v!==null)return Promise.reject(v);if(this[c])return Promise.resolve(u(void 0,!0));if(this[s].destroyed)return new Promise(function(P,D){re.nextTick(function(){_[d]?D(_[d]):P(u(void 0,!0))})});var k=this[p],S;if(k)S=new Promise(m(k,this));else{var I=this[s].read();if(I!==null)return Promise.resolve(u(I,!1));S=new Promise(this[f])}return this[p]=S,S}},r(e,Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var _=this;return new Promise(function(v,k){_[s].destroy(null,function(S){if(S){k(S);return}v(u(void 0,!0))})})}),e),b),w=function(_){var v,k=Object.create(h,(v={},r(v,s,{value:_,writable:!0}),r(v,o,{value:null,writable:!0}),r(v,a,{value:null,writable:!0}),r(v,d,{value:null,writable:!0}),r(v,c,{value:_._readableState.endEmitted,writable:!0}),r(v,f,{value:function(I,P){var D=k[s].read();D?(k[p]=null,k[o]=null,k[a]=null,I(u(D,!1))):(k[o]=I,k[a]=P)},writable:!0}),v));return k[p]=null,l(_,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=k[a];I!==null&&(k[p]=null,k[o]=null,k[a]=null,I(S)),k[d]=S;return}var P=k[o];P!==null&&(k[p]=null,k[o]=null,k[a]=null,P(u(void 0,!0))),k[c]=!0}),_.on("readable",g.bind(null,k)),k};return Tn=w,Tn}var Nn,Ho;function Ol(){return Ho||(Ho=1,Nn=function(){throw new Error("Readable.from is not available in the browser")}),Nn}var Pn,Uo;function bu(){if(Uo)return Pn;Uo=1,Pn=P;var e;P.ReadableState=I,hr().EventEmitter;var r=function(R,O){return R.listeners(O).length},t=fu(),n=fs().Buffer,l=(typeof lr<"u"?lr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(E){return n.from(E)}function a(E){return n.isBuffer(E)||E instanceof l}var d=su(),c;d&&d.debuglog?c=d.debuglog("stream"):c=function(){};var p=Nl(),f=gu(),s=pu(),u=s.getHighWaterMark,i=rt().codes,g=i.ERR_INVALID_ARG_TYPE,m=i.ERR_STREAM_PUSH_AFTER_EOF,b=i.ERR_METHOD_NOT_IMPLEMENTED,h=i.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,w,y,_;Ut()(P,t);var v=f.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(E,R,O){if(typeof E.prependListener=="function")return E.prependListener(R,O);!E._events||!E._events[R]?E.on(R,O):Array.isArray(E._events[R])?E._events[R].unshift(O):E._events[R]=[O,E._events[R]]}function I(E,R,O){e=e||tt(),E=E||{},typeof O!="boolean"&&(O=R instanceof e),this.objectMode=!!E.objectMode,O&&(this.objectMode=this.objectMode||!!E.readableObjectMode),this.highWaterMark=u(this,E,"readableHighWaterMark",O),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=E.emitClose!==!1,this.autoDestroy=!!E.autoDestroy,this.destroyed=!1,this.defaultEncoding=E.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,E.encoding&&(w||(w=qs().StringDecoder),this.decoder=new w(E.encoding),this.encoding=E.encoding)}function P(E){if(e=e||tt(),!(this instanceof P))return new P(E);var R=this instanceof e;this._readableState=new I(E,this,R),this.readable=!0,E&&(typeof E.read=="function"&&(this._read=E.read),typeof E.destroy=="function"&&(this._destroy=E.destroy)),t.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),P.prototype.destroy=f.destroy,P.prototype._undestroy=f.undestroy,P.prototype._destroy=function(E,R){R(E)},P.prototype.push=function(E,R){var O=this._readableState,j;return O.objectMode?j=!0:typeof E=="string"&&(R=R||O.defaultEncoding,R!==O.encoding&&(E=n.from(E,R),R=""),j=!0),D(this,E,R,!1,j)},P.prototype.unshift=function(E){return D(this,E,null,!0,!1)};function D(E,R,O,j,ne){c("readableAddChunk",R);var Z=E._readableState;if(R===null)Z.reading=!1,M(E,Z);else{var te;if(ne||(te=z(Z,R)),te)v(E,te);else if(Z.objectMode||R&&R.length>0)if(typeof R!="string"&&!Z.objectMode&&Object.getPrototypeOf(R)!==n.prototype&&(R=o(R)),j)Z.endEmitted?v(E,new h):$(E,Z,R,!0);else if(Z.ended)v(E,new m);else{if(Z.destroyed)return!1;Z.reading=!1,Z.decoder&&!O?(R=Z.decoder.write(R),Z.objectMode||R.length!==0?$(E,Z,R,!1):x(E,Z)):$(E,Z,R,!1)}else j||(Z.reading=!1,x(E,Z))}return!Z.ended&&(Z.length<Z.highWaterMark||Z.length===0)}function $(E,R,O,j){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,E.emit("data",O)):(R.length+=R.objectMode?1:O.length,j?R.buffer.unshift(O):R.buffer.push(O),R.needReadable&&L(E)),x(E,R)}function z(E,R){var O;return!a(R)&&typeof R!="string"&&R!==void 0&&!E.objectMode&&(O=new g("chunk",["string","Buffer","Uint8Array"],R)),O}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(E){w||(w=qs().StringDecoder);var R=new w(E);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var O=this._readableState.buffer.head,j="";O!==null;)j+=R.write(O.data),O=O.next;return this._readableState.buffer.clear(),j!==""&&this._readableState.buffer.push(j),this._readableState.length=j.length,this};var X=1073741824;function Y(E){return E>=X?E=X:(E--,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E++),E}function J(E,R){return E<=0||R.length===0&&R.ended?0:R.objectMode?1:E!==E?R.flowing&&R.length?R.buffer.head.data.length:R.length:(E>R.highWaterMark&&(R.highWaterMark=Y(E)),E<=R.length?E:R.ended?R.length:(R.needReadable=!0,0))}P.prototype.read=function(E){c("read",E),E=parseInt(E,10);var R=this._readableState,O=E;if(E!==0&&(R.emittedReadable=!1),E===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return c("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?N(this):L(this),null;if(E=J(E,R),E===0&&R.ended)return R.length===0&&N(this),null;var j=R.needReadable;c("need readable",j),(R.length===0||R.length-E<R.highWaterMark)&&(j=!0,c("length less than watermark",j)),R.ended||R.reading?(j=!1,c("reading or ended",j)):j&&(c("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(E=J(O,R)));var ne;return E>0?ne=A(E,R):ne=null,ne===null?(R.needReadable=R.length<=R.highWaterMark,E=0):(R.length-=E,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),O!==E&&R.ended&&N(this)),ne!==null&&this.emit("data",ne),ne};function M(E,R){if(c("onEofChunk"),!R.ended){if(R.decoder){var O=R.decoder.end();O&&O.length&&(R.buffer.push(O),R.length+=R.objectMode?1:O.length)}R.ended=!0,R.sync?L(E):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,T(E)))}}function L(E){var R=E._readableState;c("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(c("emitReadable",R.flowing),R.emittedReadable=!0,re.nextTick(T,E))}function T(E){var R=E._readableState;c("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(E.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,C(E)}function x(E,R){R.readingMore||(R.readingMore=!0,re.nextTick(B,E,R))}function B(E,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var O=R.length;if(c("maybeReadMore read 0"),E.read(0),O===R.length)break}R.readingMore=!1}P.prototype._read=function(E){v(this,new b("_read()"))},P.prototype.pipe=function(E,R){var O=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=E;break;case 1:j.pipes=[j.pipes,E];break;default:j.pipes.push(E);break}j.pipesCount+=1,c("pipe count=%d opts=%j",j.pipesCount,R);var ne=(!R||R.end!==!1)&&E!==re.stdout&&E!==re.stderr,Z=ne?ye:Se;j.endEmitted?re.nextTick(Z):O.once("end",Z),E.on("unpipe",te);function te(we,_e){c("onunpipe"),we===O&&_e&&_e.hasUnpiped===!1&&(_e.hasUnpiped=!0,Kt())}function ye(){c("onend"),E.end()}var Ie=V(O);E.on("drain",Ie);var it=!1;function Kt(){c("cleanup"),E.removeListener("close",Xe),E.removeListener("finish",et),E.removeListener("drain",Ie),E.removeListener("error",Ye),E.removeListener("unpipe",te),O.removeListener("end",ye),O.removeListener("end",Se),O.removeListener("data",st),it=!0,j.awaitDrain&&(!E._writableState||E._writableState.needDrain)&&Ie()}O.on("data",st);function st(we){c("ondata");var _e=E.write(we);c("dest.write",_e),_e===!1&&((j.pipesCount===1&&j.pipes===E||j.pipesCount>1&&Q(j.pipes,E)!==-1)&&!it&&(c("false write response, pause",j.awaitDrain),j.awaitDrain++),O.pause())}function Ye(we){c("onerror",we),Se(),E.removeListener("error",Ye),r(E,"error")===0&&v(E,we)}S(E,"error",Ye);function Xe(){E.removeListener("finish",et),Se()}E.once("close",Xe);function et(){c("onfinish"),E.removeListener("close",Xe),Se()}E.once("finish",et);function Se(){c("unpipe"),O.unpipe(E)}return E.emit("pipe",O),j.flowing||(c("pipe resume"),O.resume()),E};function V(E){return function(){var O=E._readableState;c("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,O.awaitDrain===0&&r(E,"data")&&(O.flowing=!0,C(E))}}P.prototype.unpipe=function(E){var R=this._readableState,O={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return E&&E!==R.pipes?this:(E||(E=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,E&&E.emit("unpipe",this,O),this);if(!E){var j=R.pipes,ne=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var Z=0;Z<ne;Z++)j[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var te=Q(R.pipes,E);return te===-1?this:(R.pipes.splice(te,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),E.emit("unpipe",this,O),this)},P.prototype.on=function(E,R){var O=t.prototype.on.call(this,E,R),j=this._readableState;return E==="data"?(j.readableListening=this.listenerCount("readable")>0,j.flowing!==!1&&this.resume()):E==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,c("on readable",j.length,j.reading),j.length?L(this):j.reading||re.nextTick(F,this)),O},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(E,R){var O=t.prototype.removeListener.call(this,E,R);return E==="readable"&&re.nextTick(q,this),O},P.prototype.removeAllListeners=function(E){var R=t.prototype.removeAllListeners.apply(this,arguments);return(E==="readable"||E===void 0)&&re.nextTick(q,this),R};function q(E){var R=E._readableState;R.readableListening=E.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:E.listenerCount("data")>0&&E.resume()}function F(E){c("readable nexttick read 0"),E.read(0)}P.prototype.resume=function(){var E=this._readableState;return E.flowing||(c("resume"),E.flowing=!E.readableListening,G(this,E)),E.paused=!1,this};function G(E,R){R.resumeScheduled||(R.resumeScheduled=!0,re.nextTick(H,E,R))}function H(E,R){c("resume",R.reading),R.reading||E.read(0),R.resumeScheduled=!1,E.emit("resume"),C(E),R.flowing&&!R.reading&&E.read(0)}P.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function C(E){var R=E._readableState;for(c("flow",R.flowing);R.flowing&&E.read()!==null;);}P.prototype.wrap=function(E){var R=this,O=this._readableState,j=!1;E.on("end",function(){if(c("wrapped end"),O.decoder&&!O.ended){var te=O.decoder.end();te&&te.length&&R.push(te)}R.push(null)}),E.on("data",function(te){if(c("wrapped data"),O.decoder&&(te=O.decoder.write(te)),!(O.objectMode&&te==null)&&!(!O.objectMode&&(!te||!te.length))){var ye=R.push(te);ye||(j=!0,E.pause())}});for(var ne in E)this[ne]===void 0&&typeof E[ne]=="function"&&(this[ne]=(function(ye){return function(){return E[ye].apply(E,arguments)}})(ne));for(var Z=0;Z<k.length;Z++)E.on(k[Z],this.emit.bind(this,k[Z]));return this._read=function(te){c("wrapped _read",te),j&&(j=!1,E.resume())},this},typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=Pl()),y(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}}),P._fromList=A,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function A(E,R){if(R.length===0)return null;var O;return R.objectMode?O=R.buffer.shift():!E||E>=R.length?(R.decoder?O=R.buffer.join(""):R.buffer.length===1?O=R.buffer.first():O=R.buffer.concat(R.length),R.buffer.clear()):O=R.buffer.consume(E,R.decoder),O}function N(E){var R=E._readableState;c("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,re.nextTick(U,R,E))}function U(E,R){if(c("endReadableNT",E.endEmitted,E.length),!E.endEmitted&&E.length===0&&(E.endEmitted=!0,R.readable=!1,R.emit("end"),E.autoDestroy)){var O=R._writableState;(!O||O.autoDestroy&&O.finished)&&R.destroy()}}typeof Symbol=="function"&&(P.from=function(E,R){return _===void 0&&(_=Ol()),_(P,E,R)});function Q(E,R){for(var O=0,j=E.length;O<j;O++)if(E[O]===R)return O;return-1}return Pn}var On,Wo;function yu(){if(Wo)return On;Wo=1,On=d;var e=rt().codes,r=e.ERR_METHOD_NOT_IMPLEMENTED,t=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,l=e.ERR_TRANSFORM_WITH_LENGTH_0,o=tt();Ut()(d,o);function a(f,s){var u=this._transformState;u.transforming=!1;var i=u.writecb;if(i===null)return this.emit("error",new t);u.writechunk=null,u.writecb=null,s!=null&&this.push(s),i(f);var g=this._readableState;g.reading=!1,(g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}function d(f){if(!(this instanceof d))return new d(f);o.call(this,f),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",c)}function c(){var f=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,u){p(f,s,u)}):p(this,null,null)}d.prototype.push=function(f,s){return this._transformState.needTransform=!1,o.prototype.push.call(this,f,s)},d.prototype._transform=function(f,s,u){u(new r("_transform()"))},d.prototype._write=function(f,s,u){var i=this._transformState;if(i.writecb=u,i.writechunk=f,i.writeencoding=s,!i.transforming){var g=this._readableState;(i.needTransform||g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}},d.prototype._read=function(f){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},d.prototype._destroy=function(f,s){o.prototype._destroy.call(this,f,function(u){s(u)})};function p(f,s,u){if(s)return f.emit("error",s);if(u!=null&&f.push(u),f._writableState.length)throw new l;if(f._transformState.transforming)throw new n;return f.push(null)}return On}var xn,Vo;function xl(){if(Vo)return xn;Vo=1,xn=r;var e=yu();Ut()(r,e);function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return r.prototype._transform=function(t,n,l){l(null,t)},xn}var Bn,zo;function Bl(){if(zo)return Bn;zo=1;var e;function r(u){var i=!1;return function(){i||(i=!0,u.apply(void 0,arguments))}}var t=rt().codes,n=t.ERR_MISSING_ARGS,l=t.ERR_STREAM_DESTROYED;function o(u){if(u)throw u}function a(u){return u.setHeader&&typeof u.abort=="function"}function d(u,i,g,m){m=r(m);var b=!1;u.on("close",function(){b=!0}),e===void 0&&(e=_s()),e(u,{readable:i,writable:g},function(w){if(w)return m(w);b=!0,m()});var h=!1;return function(w){if(!b&&!h){if(h=!0,a(u))return u.abort();if(typeof u.destroy=="function")return u.destroy();m(w||new l("pipe"))}}}function c(u){u()}function p(u,i){return u.pipe(i)}function f(u){return!u.length||typeof u[u.length-1]!="function"?o:u.pop()}function s(){for(var u=arguments.length,i=new Array(u),g=0;g<u;g++)i[g]=arguments[g];var m=f(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new n("streams");var b,h=i.map(function(w,y){var _=y<i.length-1,v=y>0;return d(w,_,v,function(k){b||(b=k),k&&h.forEach(c),!_&&(h.forEach(c),m(b))})});return i.reduce(p)}return Bn=s,Bn}var Jo;function wu(){return Jo||(Jo=1,(function(e,r){r=e.exports=bu(),r.Stream=r,r.Readable=r,r.Writable=mu(),r.Duplex=tt(),r.Transform=yu(),r.PassThrough=xl(),r.finished=_s(),r.pipeline=Bl()})(ir,ir.exports)),ir.exports}var Dn,Go;function Dl(){if(Go)return Dn;Go=1;const{Transform:e}=wu();return Dn=r=>class _u extends e{constructor(n,l,o,a,d){super(d),this._rate=n,this._capacity=l,this._delimitedSuffix=o,this._hashBitLength=a,this._options=d,this._state=new r,this._state.initialize(n,l),this._finalized=!1}_transform(n,l,o){let a=null;try{this.update(n,l)}catch(d){a=d}o(a)}_flush(n){let l=null;try{this.push(this.digest())}catch(o){l=o}n(l)}update(n,l){if(!K.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return K.isBuffer(n)||(n=K.from(n,l)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let l=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(l=l.toString(n)),this._resetState(),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new _u(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}},Dn}var qn,Zo;function ql(){if(Zo)return qn;Zo=1;const{Transform:e}=wu();return qn=r=>class vu extends e{constructor(n,l,o,a){super(a),this._rate=n,this._capacity=l,this._delimitedSuffix=o,this._options=a,this._state=new r,this._state.initialize(n,l),this._finalized=!1}_transform(n,l,o){let a=null;try{this.update(n,l)}catch(d){a=d}o(a)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,l){if(!K.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return K.isBuffer(n)||(n=K.from(n,l)),this._state.absorb(n),this}squeeze(n,l){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let o=this._state.squeeze(n);return l!==void 0&&(o=o.toString(l)),o}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new vu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}},qn}var jn,Ko;function jl(){if(Ko)return jn;Ko=1;const e=Dl(),r=ql();return jn=function(t){const n=e(t),l=r(t);return function(o,a){switch(typeof o=="string"?o.toLowerCase():o){case"keccak224":return new n(1152,448,null,224,a);case"keccak256":return new n(1088,512,null,256,a);case"keccak384":return new n(832,768,null,384,a);case"keccak512":return new n(576,1024,null,512,a);case"sha3-224":return new n(1152,448,6,224,a);case"sha3-256":return new n(1088,512,6,256,a);case"sha3-384":return new n(832,768,6,384,a);case"sha3-512":return new n(576,1024,6,512,a);case"shake128":return new l(1344,256,31,a);case"shake256":return new l(1088,512,31,a);default:throw new Error("Invald algorithm: "+o)}}},jn}var Fn={},Qo;function Fl(){if(Qo)return Fn;Qo=1;const e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];return Fn.p1600=function(r){for(let t=0;t<24;++t){const n=r[0]^r[10]^r[20]^r[30]^r[40],l=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],a=r[3]^r[13]^r[23]^r[33]^r[43],d=r[4]^r[14]^r[24]^r[34]^r[44],c=r[5]^r[15]^r[25]^r[35]^r[45],p=r[6]^r[16]^r[26]^r[36]^r[46],f=r[7]^r[17]^r[27]^r[37]^r[47],s=r[8]^r[18]^r[28]^r[38]^r[48],u=r[9]^r[19]^r[29]^r[39]^r[49];let i=s^(o<<1|a>>>31),g=u^(a<<1|o>>>31);const m=r[0]^i,b=r[1]^g,h=r[10]^i,w=r[11]^g,y=r[20]^i,_=r[21]^g,v=r[30]^i,k=r[31]^g,S=r[40]^i,I=r[41]^g;i=n^(d<<1|c>>>31),g=l^(c<<1|d>>>31);const P=r[2]^i,D=r[3]^g,$=r[12]^i,z=r[13]^g,X=r[22]^i,Y=r[23]^g,J=r[32]^i,M=r[33]^g,L=r[42]^i,T=r[43]^g;i=o^(p<<1|f>>>31),g=a^(f<<1|p>>>31);const x=r[4]^i,B=r[5]^g,V=r[14]^i,q=r[15]^g,F=r[24]^i,G=r[25]^g,H=r[34]^i,C=r[35]^g,A=r[44]^i,N=r[45]^g;i=d^(s<<1|u>>>31),g=c^(u<<1|s>>>31);const U=r[6]^i,Q=r[7]^g,E=r[16]^i,R=r[17]^g,O=r[26]^i,j=r[27]^g,ne=r[36]^i,Z=r[37]^g,te=r[46]^i,ye=r[47]^g;i=p^(n<<1|l>>>31),g=f^(l<<1|n>>>31);const Ie=r[8]^i,it=r[9]^g,Kt=r[18]^i,st=r[19]^g,Ye=r[28]^i,Xe=r[29]^g,et=r[38]^i,Se=r[39]^g,we=r[48]^i,_e=r[49]^g,Er=m,Rr=b,Sr=w<<4|h>>>28,kr=h<<4|w>>>28,Cr=y<<3|_>>>29,Ir=_<<3|y>>>29,Ar=k<<9|v>>>23,Mr=v<<9|k>>>23,Lr=S<<18|I>>>14,Tr=I<<18|S>>>14,Nr=P<<1|D>>>31,Pr=D<<1|P>>>31,Or=z<<12|$>>>20,xr=$<<12|z>>>20,Br=X<<10|Y>>>22,Dr=Y<<10|X>>>22,qr=M<<13|J>>>19,jr=J<<13|M>>>19,Fr=L<<2|T>>>30,$r=T<<2|L>>>30,Hr=B<<30|x>>>2,Ur=x<<30|B>>>2,Wr=V<<6|q>>>26,Vr=q<<6|V>>>26,zr=G<<11|F>>>21,Jr=F<<11|G>>>21,Gr=H<<15|C>>>17,Zr=C<<15|H>>>17,Kr=N<<29|A>>>3,Qr=A<<29|N>>>3,Yr=U<<28|Q>>>4,Xr=Q<<28|U>>>4,en=R<<23|E>>>9,tn=E<<23|R>>>9,rn=O<<25|j>>>7,nn=j<<25|O>>>7,sn=ne<<21|Z>>>11,on=Z<<21|ne>>>11,an=ye<<24|te>>>8,cn=te<<24|ye>>>8,un=Ie<<27|it>>>5,ln=it<<27|Ie>>>5,dn=Kt<<20|st>>>12,hn=st<<20|Kt>>>12,fn=Xe<<7|Ye>>>25,gn=Ye<<7|Xe>>>25,pn=et<<8|Se>>>24,mn=Se<<8|et>>>24,bn=we<<14|_e>>>18,yn=_e<<14|we>>>18;r[0]=Er^~Or&zr,r[1]=Rr^~xr&Jr,r[10]=Yr^~dn&Cr,r[11]=Xr^~hn&Ir,r[20]=Nr^~Wr&rn,r[21]=Pr^~Vr&nn,r[30]=un^~Sr&Br,r[31]=ln^~kr&Dr,r[40]=Hr^~en&fn,r[41]=Ur^~tn&gn,r[2]=Or^~zr&sn,r[3]=xr^~Jr&on,r[12]=dn^~Cr&qr,r[13]=hn^~Ir&jr,r[22]=Wr^~rn&pn,r[23]=Vr^~nn&mn,r[32]=Sr^~Br&Gr,r[33]=kr^~Dr&Zr,r[42]=en^~fn&Ar,r[43]=tn^~gn&Mr,r[4]=zr^~sn&bn,r[5]=Jr^~on&yn,r[14]=Cr^~qr&Kr,r[15]=Ir^~jr&Qr,r[24]=rn^~pn&Lr,r[25]=nn^~mn&Tr,r[34]=Br^~Gr&an,r[35]=Dr^~Zr&cn,r[44]=fn^~Ar&Fr,r[45]=gn^~Mr&$r,r[6]=sn^~bn&Er,r[7]=on^~yn&Rr,r[16]=qr^~Kr&Yr,r[17]=jr^~Qr&Xr,r[26]=pn^~Lr&Nr,r[27]=mn^~Tr&Pr,r[36]=Gr^~an&un,r[37]=Zr^~cn&ln,r[46]=Ar^~Fr&Hr,r[47]=Mr^~$r&Ur,r[8]=bn^~Er&Or,r[9]=yn^~Rr&xr,r[18]=Kr^~Yr&dn,r[19]=Qr^~Xr&hn,r[28]=Lr^~Nr&Wr,r[29]=Tr^~Pr&Vr,r[38]=an^~un&Sr,r[39]=cn^~ln&kr,r[48]=Fr^~Hr&en,r[49]=$r^~Ur&tn,r[0]^=e[t*2],r[1]^=e[t*2+1]}},Fn}var $n,Yo;function $l(){if(Yo)return $n;Yo=1;const e=Fl();function r(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}return r.prototype.initialize=function(t,n){for(let l=0;l<50;++l)this.state[l]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},r.prototype.absorb=function(t){for(let n=0;n<t.length;++n)this.state[~~(this.count/4)]^=t[n]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},r.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),(t&128)!==0&&this.count===this.blockSize-1&&e.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e.p1600(this.state),this.count=0,this.squeezing=!0},r.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const n=K.alloc(t);for(let l=0;l<t;++l)n[l]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return n},r.prototype.copy=function(t){for(let n=0;n<50;++n)t.state[n]=this.state[n];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},$n=r,$n}var Hn,Xo;function Hl(){return Xo||(Xo=1,Hn=jl()($l())),Hn}var Un,ea;function Eu(){if(ea)return Un;ea=1;const e=Hl(),r=dr();function t(s){return K.allocUnsafe(s).fill(0)}function n(s,u,i){const g=t(u);return s=o(s),i?s.length<u?(s.copy(g),g):s.slice(0,u):s.length<u?(s.copy(g,u-s.length),g):s.slice(-u)}function l(s,u){return n(s,u,!0)}function o(s){if(!K.isBuffer(s))if(Array.isArray(s))s=K.from(s);else if(typeof s=="string")p(s)?s=K.from(c(f(s)),"hex"):s=K.from(s);else if(typeof s=="number")s=intToBuffer(s);else if(s==null)s=K.allocUnsafe(0);else if(r.isBN(s))s=s.toArrayLike(K);else if(s.toArray)s=K.from(s.toArray());else throw new Error("invalid type");return s}function a(s){return s=o(s),"0x"+s.toString("hex")}function d(s,u){return s=o(s),u||(u=256),e("keccak"+u).update(s).digest()}function c(s){return s.length%2?"0"+s:s}function p(s){return typeof s=="string"&&s.match(/^0x[0-9A-Fa-f]*$/)}function f(s){return typeof s=="string"&&s.startsWith("0x")?s.slice(2):s}return Un={zeros:t,setLength:n,setLengthRight:l,isHexString:p,stripHexPrefix:f,toBuffer:o,bufferToHex:a,keccak:d},Un}var Wn,ta;function Ul(){if(ta)return Wn;ta=1;const e=Eu(),r=dr();function t(i){return i.startsWith("int[")?"int256"+i.slice(3):i==="int"?"int256":i.startsWith("uint[")?"uint256"+i.slice(4):i==="uint"?"uint256":i.startsWith("fixed[")?"fixed128x128"+i.slice(5):i==="fixed"?"fixed128x128":i.startsWith("ufixed[")?"ufixed128x128"+i.slice(6):i==="ufixed"?"ufixed128x128":i}function n(i){return parseInt(/^\D+(\d+)$/.exec(i)[1],10)}function l(i){var g=/^\D+(\d+)x(\d+)$/.exec(i);return[parseInt(g[1],10),parseInt(g[2],10)]}function o(i){var g=i.match(/(.*)\[(.*?)\]$/);return g?g[2]===""?"dynamic":parseInt(g[2],10):null}function a(i){var g=typeof i;if(g==="string")return e.isHexString(i)?new r(e.stripHexPrefix(i),16):new r(i,10);if(g==="number")return new r(i);if(i.toArray)return i;throw new Error("Argument is not a number")}function d(i,g){var m,b,h,w;if(i==="address")return d("uint160",a(g));if(i==="bool")return d("uint8",g?1:0);if(i==="string")return d("bytes",new K(g,"utf8"));if(p(i)){if(typeof g.length>"u")throw new Error("Not an array?");if(m=o(i),m!=="dynamic"&&m!==0&&g.length>m)throw new Error("Elements exceed array size: "+m);h=[],i=i.slice(0,i.lastIndexOf("[")),typeof g=="string"&&(g=JSON.parse(g));for(w in g)h.push(d(i,g[w]));if(m==="dynamic"){var y=d("uint256",g.length);h.unshift(y)}return K.concat(h)}else{if(i==="bytes")return g=new K(g),h=K.concat([d("uint256",g.length),g]),g.length%32!==0&&(h=K.concat([h,e.zeros(32-g.length%32)])),h;if(i.startsWith("bytes")){if(m=n(i),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return e.setLengthRight(g,32)}else if(i.startsWith("uint")){if(m=n(i),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=a(g),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());if(b<0)throw new Error("Supplied uint is negative");return b.toArrayLike(K,"be",32)}else if(i.startsWith("int")){if(m=n(i),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=a(g),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());return b.toTwos(256).toArrayLike(K,"be",32)}else if(i.startsWith("ufixed")){if(m=l(i),b=a(g),b<0)throw new Error("Supplied ufixed is negative");return d("uint256",b.mul(new r(2).pow(new r(m[1]))))}else if(i.startsWith("fixed"))return m=l(i),d("int256",a(g).mul(new r(2).pow(new r(m[1]))))}throw new Error("Unsupported or invalid type: "+i)}function c(i){return i==="string"||i==="bytes"||o(i)==="dynamic"}function p(i){return i.lastIndexOf("]")===i.length-1}function f(i,g){var m=[],b=[],h=32*i.length;for(var w in i){var y=t(i[w]),_=g[w],v=d(y,_);c(y)?(m.push(d("uint256",h)),b.push(v),h+=v.length):m.push(v)}return K.concat(m.concat(b))}function s(i,g){if(i.length!==g.length)throw new Error("Number of types are not matching the values");for(var m,b,h=[],w=0;w<i.length;w++){var y=t(i[w]),_=g[w];if(y==="bytes")h.push(_);else if(y==="string")h.push(new K(_,"utf8"));else if(y==="bool")h.push(new K(_?"01":"00","hex"));else if(y==="address")h.push(e.setLength(_,20));else if(y.startsWith("bytes")){if(m=n(y),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);h.push(e.setLengthRight(_,m))}else if(y.startsWith("uint")){if(m=n(y),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=a(_),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());h.push(b.toArrayLike(K,"be",m/8))}else if(y.startsWith("int")){if(m=n(y),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=a(_),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());h.push(b.toTwos(m).toArrayLike(K,"be",m/8))}else throw new Error("Unsupported or invalid type: "+y)}return K.concat(h)}function u(i,g){return e.keccak(s(i,g))}return Wn={rawEncode:f,solidityPack:s,soliditySHA3:u},Wn}var Vn,ra;function Wl(){if(ra)return Vn;ra=1;const e=Eu(),r=Ul(),t={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},n={encodeData(o,a,d,c=!0){const p=["bytes32"],f=[this.hashType(o,d)];if(c){const s=(u,i,g)=>{if(d[i]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(i,g,d,c))];if(g===void 0)throw new Error(`missing value for field ${u} of type ${i}`);if(i==="bytes")return["bytes32",e.keccak(g)];if(i==="string")return typeof g=="string"&&(g=K.from(g,"utf8")),["bytes32",e.keccak(g)];if(i.lastIndexOf("]")===i.length-1){const m=i.slice(0,i.lastIndexOf("[")),b=g.map(h=>s(u,m,h));return["bytes32",e.keccak(r.rawEncode(b.map(([h])=>h),b.map(([,h])=>h)))]}return[i,g]};for(const u of d[o]){const[i,g]=s(u.name,u.type,a[u.name]);p.push(i),f.push(g)}}else for(const s of d[o]){let u=a[s.name];if(u!==void 0)if(s.type==="bytes")p.push("bytes32"),u=e.keccak(u),f.push(u);else if(s.type==="string")p.push("bytes32"),typeof u=="string"&&(u=K.from(u,"utf8")),u=e.keccak(u),f.push(u);else if(d[s.type]!==void 0)p.push("bytes32"),u=e.keccak(this.encodeData(s.type,u,d,c)),f.push(u);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");p.push(s.type),f.push(u)}}return r.rawEncode(p,f)},encodeType(o,a){let d="",c=this.findTypeDependencies(o,a).filter(p=>p!==o);c=[o].concat(c.sort());for(const p of c){if(!a[p])throw new Error("No type definition specified: "+p);d+=p+"("+a[p].map(({name:s,type:u})=>u+" "+s).join(",")+")"}return d},findTypeDependencies(o,a,d=[]){if(o=o.match(/^\w*/)[0],d.includes(o)||a[o]===void 0)return d;d.push(o);for(const c of a[o])for(const p of this.findTypeDependencies(c.type,a,d))!d.includes(p)&&d.push(p);return d},hashStruct(o,a,d,c=!0){return e.keccak(this.encodeData(o,a,d,c))},hashType(o,a){return e.keccak(this.encodeType(o,a))},sanitizeData(o){const a={};for(const d in t.properties)o[d]&&(a[d]=o[d]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(o,a=!0){const d=this.sanitizeData(o),c=[K.from("1901","hex")];return c.push(this.hashStruct("EIP712Domain",d.domain,d.types,a)),d.primaryType!=="EIP712Domain"&&c.push(this.hashStruct(d.primaryType,d.message,d.types,a)),e.keccak(K.concat(c))}};Vn={TYPED_MESSAGE_SCHEMA:t,TypedDataUtils:n,hashForSignTypedDataLegacy:function(o){return l(o.data)},hashForSignTypedData_v3:function(o){return n.hash(o.data,!1)},hashForSignTypedData_v4:function(o){return n.hash(o.data)}};function l(o){const a=new Error("Expect argument to be non-empty array");if(typeof o!="object"||!o.length)throw a;const d=o.map(function(f){return f.type==="bytes"?e.toBuffer(f.value):f.value}),c=o.map(function(f){return f.type}),p=o.map(function(f){if(!f.name)throw a;return f.type+" "+f.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(new Array(o.length).fill("string"),p),r.soliditySHA3(c,d)])}return Vn}var qe={},na;function Vl(){if(na)return qe;na=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.filterFromParam=qe.FilterPolyfill=void 0;const e=pr(),r=Re(),t=300*1e3,n={jsonrpc:"2.0",id:0};let l=class{constructor(u){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=u}async newFilter(u){const i=o(u),g=this.makeFilterId(),m=await this.setInitialCursorPosition(g,i.fromBlock);return console.info(`Installing new log filter(${g}):`,i,"initial cursor position:",m),this.logFilters.set(g,i),this.setFilterTimeout(g),(0,r.hexStringFromIntNumber)(g)}async newBlockFilter(){const u=this.makeFilterId(),i=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,i),this.blockFilters.add(u),this.setFilterTimeout(u),(0,r.hexStringFromIntNumber)(u)}async newPendingTransactionFilter(){const u=this.makeFilterId(),i=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,i),this.pendingTransactionFilters.add(u),this.setFilterTimeout(u),(0,r.hexStringFromIntNumber)(u)}uninstallFilter(u){const i=(0,r.intNumberFromHexString)(u);return console.info(`Uninstalling filter (${i})`),this.deleteFilter(i),!0}getFilterChanges(u){const i=(0,r.intNumberFromHexString)(u);return this.timeouts.has(i)&&this.setFilterTimeout(i),this.logFilters.has(i)?this.getLogFilterChanges(i):this.blockFilters.has(i)?this.getBlockFilterChanges(i):this.pendingTransactionFilters.has(i)?this.getPendingTransactionFilterChanges(i):Promise.resolve(p())}async getFilterLogs(u){const i=(0,r.intNumberFromHexString)(u),g=this.logFilters.get(i);return g?this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[a(g)]})):p()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(u){return new Promise((i,g)=>{this.provider.sendAsync(u,(m,b)=>{if(m)return g(m);if(Array.isArray(b)||b==null)return g(new Error(`unexpected response received: ${JSON.stringify(b)}`));i(b)})})}deleteFilter(u){console.info(`Deleting filter (${u})`),this.logFilters.delete(u),this.blockFilters.delete(u),this.pendingTransactionFilters.delete(u),this.cursors.delete(u),this.timeouts.delete(u)}async getLogFilterChanges(u){const i=this.logFilters.get(u),g=this.cursors.get(u);if(!g||!i)return p();const m=await this.getCurrentBlockHeight(),b=i.toBlock==="latest"?m:i.toBlock;if(g>m||g>Number(i.toBlock))return f();console.info(`Fetching logs from ${g} to ${b} for filter ${u}`);const h=await this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[a(Object.assign(Object.assign({},i),{fromBlock:g,toBlock:b}))]}));if(Array.isArray(h.result)){const w=h.result.map(_=>(0,r.intNumberFromHexString)(_.blockNumber||"0x0")),y=Math.max(...w);if(y&&y>g){const _=(0,e.IntNumber)(y+1);console.info(`Moving cursor position for filter (${u}) from ${g} to ${_}`),this.cursors.set(u,_)}}return h}async getBlockFilterChanges(u){const i=this.cursors.get(u);if(!i)return p();const g=await this.getCurrentBlockHeight();if(i>g)return f();console.info(`Fetching blocks from ${i} to ${g} for filter (${u})`);const m=(await Promise.all((0,r.range)(i,g+1).map(h=>this.getBlockHashByNumber((0,e.IntNumber)(h))))).filter(h=>!!h),b=(0,e.IntNumber)(i+m.length);return console.info(`Moving cursor position for filter (${u}) from ${i} to ${b}`),this.cursors.set(u,b),Object.assign(Object.assign({},n),{result:m})}async getPendingTransactionFilterChanges(u){return Promise.resolve(f())}async setInitialCursorPosition(u,i){const g=await this.getCurrentBlockHeight(),m=typeof i=="number"&&i>g?i:g;return this.cursors.set(u,m),m}setFilterTimeout(u){const i=this.timeouts.get(u);i&&window.clearTimeout(i);const g=window.setTimeout(()=>{console.info(`Filter (${u}) timed out`),this.deleteFilter(u)},t);this.timeouts.set(u,g)}async getCurrentBlockHeight(){const u=new Date;if(u.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=u;const i=await this._getCurrentBlockHeight();this.currentBlockHeight=i,this.resolvers.forEach(g=>g(i)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(i=>this.resolvers.push(i))}async _getCurrentBlockHeight(){const{result:u}=await this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_blockNumber",params:[]}));return(0,r.intNumberFromHexString)((0,r.ensureHexString)(u))}async getBlockHashByNumber(u){const i=await this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getBlockByNumber",params:[(0,r.hexStringFromIntNumber)(u),!1]}));return i.result&&typeof i.result.hash=="string"?(0,r.ensureHexString)(i.result.hash):null}};qe.FilterPolyfill=l;function o(s){return{fromBlock:d(s.fromBlock),toBlock:d(s.toBlock),addresses:s.address===void 0?null:Array.isArray(s.address)?s.address:[s.address],topics:s.topics||[]}}qe.filterFromParam=o;function a(s){const u={fromBlock:c(s.fromBlock),toBlock:c(s.toBlock),topics:s.topics};return s.addresses!==null&&(u.address=s.addresses),u}function d(s){if(s===void 0||s==="latest"||s==="pending")return"latest";if(s==="earliest")return(0,e.IntNumber)(0);if((0,r.isHexString)(s))return(0,r.intNumberFromHexString)(s);throw new Error(`Invalid block option: ${String(s)}`)}function c(s){return s==="latest"?s:(0,r.hexStringFromIntNumber)(s)}function p(){return Object.assign(Object.assign({},n),{error:{code:-32e3,message:"filter not found"}})}function f(){return Object.assign(Object.assign({},n),{result:[]})}return qe}var Tt={},je={},Fe={},zn,ia;function vs(){if(ia)return zn;ia=1,zn=e;function e(r){r=r||{};var t=r.max||Number.MAX_SAFE_INTEGER,n=typeof r.start<"u"?r.start:Math.floor(Math.random()*t);return function(){return n=n%t,n++}}return zn}var Jn,sa;function zl(){if(sa)return Jn;sa=1;const e=(r,t)=>function(){const n=t.promiseModule,l=new Array(arguments.length);for(let o=0;o<arguments.length;o++)l[o]=arguments[o];return new n((o,a)=>{t.errorFirst?l.push(function(d,c){if(t.multiArgs){const p=new Array(arguments.length-1);for(let f=1;f<arguments.length;f++)p[f-1]=arguments[f];d?(p.unshift(d),a(p)):o(p)}else d?a(d):o(c)}):l.push(function(d){if(t.multiArgs){const c=new Array(arguments.length-1);for(let p=0;p<arguments.length;p++)c[p]=arguments[p];o(c)}else o(d)}),r.apply(this,l)})};return Jn=(r,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=o=>{const a=d=>typeof d=="string"?o===d:d.test(o);return t.include?t.include.some(a):!t.exclude.some(a)};let l;typeof r=="function"?l=function(){return t.excludeMain?r.apply(this,arguments):e(r,t).apply(this,arguments)}:l=Object.create(Object.getPrototypeOf(r));for(const o in r){const a=r[o];l[o]=typeof a=="function"&&n(o)?e(a,t):a}return l},Jn}var $e={},sr={},oa;function Es(){if(oa)return sr;oa=1,Object.defineProperty(sr,"__esModule",{value:!0});const e=hr();function r(l,o,a){try{Reflect.apply(l,o,a)}catch(d){setTimeout(()=>{throw d})}}function t(l){const o=l.length,a=new Array(o);for(let d=0;d<o;d+=1)a[d]=l[d];return a}class n extends e.EventEmitter{emit(o,...a){let d=o==="error";const c=this._events;if(c!==void 0)d=d&&c.error===void 0;else if(!d)return!1;if(d){let f;if(a.length>0&&([f]=a),f instanceof Error)throw f;const s=new Error(`Unhandled error.${f?` (${f.message})`:""}`);throw s.context=f,s}const p=c[o];if(p===void 0)return!1;if(typeof p=="function")r(p,this,a);else{const f=p.length,s=t(p);for(let u=0;u<f;u+=1)r(s[u],this,a)}return!0}}return sr.default=n,sr}var aa;function Ru(){if(aa)return $e;aa=1;var e=$e&&$e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty($e,"__esModule",{value:!0}),$e.BaseBlockTracker=void 0;const r=e(Es()),t=1e3,n=(d,c)=>d+c,l=["sync","latest"];let o=class extends r.default{constructor(c){super(),this._blockResetDuration=c.blockResetDuration||20*t,this._usePastBlocks=c.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(p=>this.once("latest",p))}removeAllListeners(c){return c?super.removeAllListeners(c):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(c){l.includes(c)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return l.map(c=>this.listenerCount(c)).reduce(n)}_shouldUseNewBlock(c){const p=this._currentBlock;if(!p)return!0;const f=a(c),s=a(p);return this._usePastBlocks&&f<s||f>s}_newPotentialLatest(c){this._shouldUseNewBlock(c)&&this._setCurrentBlock(c)}_setCurrentBlock(c){const p=this._currentBlock;this._currentBlock=c,this.emit("latest",c),this.emit("sync",{oldBlock:p,newBlock:c})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};$e.BaseBlockTracker=o;function a(d){return Number.parseInt(d,16)}return $e}var Gn={},He={},he={};class Su extends TypeError{constructor(r,t){let n;const{message:l,explanation:o,...a}=r,{path:d}=r,c=d.length===0?l:`At path: ${d.join(".")} -- ${l}`;super(o??c),o!=null&&(this.cause=c),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[r,...t()])}}function Jl(e){return le(e)&&typeof e[Symbol.iterator]=="function"}function le(e){return typeof e=="object"&&e!=null}function ca(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function se(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Gl(e){const{done:r,value:t}=e.next();return r?void 0:t}function Zl(e,r,t,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:l,branch:o}=r,{type:a}=t,{refinement:d,message:c=`Expected a value of type \`${a}\`${d?` with refinement \`${d}\``:""}, but received: \`${se(n)}\``}=e;return{value:n,type:a,refinement:d,key:l[l.length-1],path:l,branch:o,...e,message:c}}function*ds(e,r,t,n){Jl(e)||(e=[e]);for(const l of e){const o=Zl(l,r,t,n);o&&(yield o)}}function*Rs(e,r,t={}){const{path:n=[],branch:l=[e],coerce:o=!1,mask:a=!1}=t,d={path:n,branch:l};if(o&&(e=r.coercer(e,d),a&&r.type!=="type"&&le(r.schema)&&le(e)&&!Array.isArray(e)))for(const p in e)r.schema[p]===void 0&&delete e[p];let c="valid";for(const p of r.validator(e,d))p.explanation=t.message,c="not_valid",yield[p,void 0];for(let[p,f,s]of r.entries(e,d)){const u=Rs(f,s,{path:p===void 0?n:[...n,p],branch:p===void 0?l:[...l,f],coerce:o,mask:a,message:t.message});for(const i of u)i[0]?(c=i[0].refinement!=null?"not_refined":"not_valid",yield[i[0],void 0]):o&&(f=i[1],p===void 0?e=f:e instanceof Map?e.set(p,f):e instanceof Set?e.add(f):le(e)&&(f!==void 0||p in e)&&(e[p]=f))}if(c!=="not_valid")for(const p of r.refiner(e,d))p.explanation=t.message,c="not_refined",yield[p,void 0];c==="valid"&&(yield[void 0,e])}class ie{constructor(r){const{type:t,schema:n,validator:l,refiner:o,coercer:a=c=>c,entries:d=function*(){}}=r;this.type=t,this.schema=n,this.entries=d,this.coercer=a,l?this.validator=(c,p)=>{const f=l(c,p);return ds(f,p,this,c)}:this.validator=()=>[],o?this.refiner=(c,p)=>{const f=o(c,p);return ds(f,p,this,c)}:this.refiner=()=>[]}assert(r,t){return ku(r,this,t)}create(r,t){return Cu(r,this,t)}is(r){return Ss(r,this)}mask(r,t){return Iu(r,this,t)}validate(r,t={}){return nt(r,this,t)}}function ku(e,r,t){const n=nt(e,r,{message:t});if(n[0])throw n[0]}function Cu(e,r,t){const n=nt(e,r,{coerce:!0,message:t});if(n[0])throw n[0];return n[1]}function Iu(e,r,t){const n=nt(e,r,{coerce:!0,mask:!0,message:t});if(n[0])throw n[0];return n[1]}function Ss(e,r){return!nt(e,r)[0]}function nt(e,r,t={}){const n=Rs(e,r,t),l=Gl(n);return l[0]?[new Su(l[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,l[1]]}function Kl(...e){const r=e[0].type==="type",t=e.map(l=>l.schema),n=Object.assign({},...t);return r?zt(n):Vt(n)}function ue(e,r){return new ie({type:e,schema:null,validator:r})}function Ql(e,r){return new ie({...e,refiner:(t,n)=>t===void 0||e.refiner(t,n),validator(t,n){return t===void 0?!0:(r(t,n),e.validator(t,n))}})}function Yl(e){return new ie({type:"dynamic",schema:null,*entries(r,t){yield*e(r,t).entries(r,t)},validator(r,t){return e(r,t).validator(r,t)},coercer(r,t){return e(r,t).coercer(r,t)},refiner(r,t){return e(r,t).refiner(r,t)}})}function Xl(e){let r;return new ie({type:"lazy",schema:null,*entries(t,n){r??(r=e()),yield*r.entries(t,n)},validator(t,n){return r??(r=e()),r.validator(t,n)},coercer(t,n){return r??(r=e()),r.coercer(t,n)},refiner(t,n){return r??(r=e()),r.refiner(t,n)}})}function ed(e,r){const{schema:t}=e,n={...t};for(const l of r)delete n[l];switch(e.type){case"type":return zt(n);default:return Vt(n)}}function td(e){const r=e instanceof ie,t=r?{...e.schema}:{...e};for(const n in t)t[n]=Au(t[n]);return r&&e.type==="type"?zt(t):Vt(t)}function rd(e,r){const{schema:t}=e,n={};for(const l of r)n[l]=t[l];switch(e.type){case"type":return zt(n);default:return Vt(n)}}function nd(e,r){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ue(e,r)}function id(){return ue("any",()=>!0)}function sd(e){return new ie({type:"array",schema:e,*entries(r){if(e&&Array.isArray(r))for(const[t,n]of r.entries())yield[t,n,e]},coercer(r){return Array.isArray(r)?r.slice():r},validator(r){return Array.isArray(r)||`Expected an array value, but received: ${se(r)}`}})}function od(){return ue("bigint",e=>typeof e=="bigint")}function ad(){return ue("boolean",e=>typeof e=="boolean")}function cd(){return ue("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${se(e)}`)}function ud(e){const r={},t=e.map(n=>se(n)).join();for(const n of e)r[n]=n;return new ie({type:"enums",schema:r,validator(n){return e.includes(n)||`Expected one of \`${t}\`, but received: ${se(n)}`}})}function ld(){return ue("func",e=>typeof e=="function"||`Expected a function, but received: ${se(e)}`)}function dd(e){return ue("instance",r=>r instanceof e||`Expected a \`${e.name}\` instance, but received: ${se(r)}`)}function hd(){return ue("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${se(e)}`)}function fd(e){return new ie({type:"intersection",schema:null,*entries(r,t){for(const n of e)yield*n.entries(r,t)},*validator(r,t){for(const n of e)yield*n.validator(r,t)},*refiner(r,t){for(const n of e)yield*n.refiner(r,t)}})}function gd(e){const r=se(e),t=typeof e;return new ie({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${r}\`, but received: ${se(n)}`}})}function pd(e,r){return new ie({type:"map",schema:null,*entries(t){if(e&&r&&t instanceof Map)for(const[n,l]of t.entries())yield[n,n,e],yield[n,l,r]},coercer(t){return t instanceof Map?new Map(t):t},validator(t){return t instanceof Map||`Expected a \`Map\` object, but received: ${se(t)}`}})}function ks(){return ue("never",()=>!1)}function md(e){return new ie({...e,validator:(r,t)=>r===null||e.validator(r,t),refiner:(r,t)=>r===null||e.refiner(r,t)})}function bd(){return ue("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${se(e)}`)}function Vt(e){const r=e?Object.keys(e):[],t=ks();return new ie({type:"object",schema:e||null,*entries(n){if(e&&le(n)){const l=new Set(Object.keys(n));for(const o of r)l.delete(o),yield[o,n[o],e[o]];for(const o of l)yield[o,n[o],t]}},validator(n){return le(n)||`Expected an object, but received: ${se(n)}`},coercer(n){return le(n)?{...n}:n}})}function Au(e){return new ie({...e,validator:(r,t)=>r===void 0||e.validator(r,t),refiner:(r,t)=>r===void 0||e.refiner(r,t)})}function yd(e,r){return new ie({type:"record",schema:null,*entries(t){if(le(t))for(const n in t){const l=t[n];yield[n,n,e],yield[n,l,r]}},validator(t){return le(t)||`Expected an object, but received: ${se(t)}`}})}function wd(){return ue("regexp",e=>e instanceof RegExp)}function _d(e){return new ie({type:"set",schema:null,*entries(r){if(e&&r instanceof Set)for(const t of r)yield[t,t,e]},coercer(r){return r instanceof Set?new Set(r):r},validator(r){return r instanceof Set||`Expected a \`Set\` object, but received: ${se(r)}`}})}function Mu(){return ue("string",e=>typeof e=="string"||`Expected a string, but received: ${se(e)}`)}function vd(e){const r=ks();return new ie({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const n=Math.max(e.length,t.length);for(let l=0;l<n;l++)yield[l,t[l],e[l]||r]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${se(t)}`}})}function zt(e){const r=Object.keys(e);return new ie({type:"type",schema:e,*entries(t){if(le(t))for(const n of r)yield[n,t[n],e[n]]},validator(t){return le(t)||`Expected an object, but received: ${se(t)}`},coercer(t){return le(t)?{...t}:t}})}function Ed(e){const r=e.map(t=>t.type).join(" | ");return new ie({type:"union",schema:null,coercer(t){for(const n of e){const[l,o]=n.validate(t,{coerce:!0});if(!l)return o}return t},validator(t,n){const l=[];for(const o of e){const[...a]=Rs(t,o,n),[d]=a;if(d[0])for(const[c]of a)c&&l.push(c);else return[]}return[`Expected the value to satisfy a union of \`${r}\`, but received: ${se(t)}`,...l]}})}function Lu(){return ue("unknown",()=>!0)}function Cs(e,r,t){return new ie({...e,coercer:(n,l)=>Ss(n,r)?e.coercer(t(n,l),l):e.coercer(n,l)})}function Rd(e,r,t={}){return Cs(e,Lu(),n=>{const l=typeof r=="function"?r():r;if(n===void 0)return l;if(!t.strict&&ca(n)&&ca(l)){const o={...n};let a=!1;for(const d in l)o[d]===void 0&&(o[d]=l[d],a=!0);if(a)return o}return n})}function Sd(e){return Cs(e,Mu(),r=>r.trim())}function kd(e){return Ze(e,"empty",r=>{const t=Tu(r);return t===0||`Expected an empty ${e.type} but received one with a size of \`${t}\``})}function Tu(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Cd(e,r,t={}){const{exclusive:n}=t;return Ze(e,"max",l=>n?l<r:l<=r||`Expected a ${e.type} less than ${n?"":"or equal to "}${r} but received \`${l}\``)}function Id(e,r,t={}){const{exclusive:n}=t;return Ze(e,"min",l=>n?l>r:l>=r||`Expected a ${e.type} greater than ${n?"":"or equal to "}${r} but received \`${l}\``)}function Ad(e){return Ze(e,"nonempty",r=>Tu(r)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Md(e,r){return Ze(e,"pattern",t=>r.test(t)||`Expected a ${e.type} matching \`/${r.source}/\` but received "${t}"`)}function Ld(e,r,t=r){const n=`Expected a ${e.type}`,l=r===t?`of \`${r}\``:`between \`${r}\` and \`${t}\``;return Ze(e,"size",o=>{if(typeof o=="number"||o instanceof Date)return r<=o&&o<=t||`${n} ${l} but received \`${o}\``;if(o instanceof Map||o instanceof Set){const{size:a}=o;return r<=a&&a<=t||`${n} with a size ${l} but received one with a size of \`${a}\``}else{const{length:a}=o;return r<=a&&a<=t||`${n} with a length ${l} but received one with a length of \`${a}\``}})}function Ze(e,r,t){return new ie({...e,*refiner(n,l){yield*e.refiner(n,l);const o=t(n,l),a=ds(o,l,e,n);for(const d of a)yield{...d,refinement:r}}})}const Td=Object.freeze(Object.defineProperty({__proto__:null,Struct:ie,StructError:Su,any:id,array:sd,assert:ku,assign:Kl,bigint:od,boolean:ad,coerce:Cs,create:Cu,date:cd,defaulted:Rd,define:ue,deprecated:Ql,dynamic:Yl,empty:kd,enums:ud,func:ld,instance:dd,integer:hd,intersection:fd,is:Ss,lazy:Xl,literal:gd,map:pd,mask:Iu,max:Cd,min:Id,never:ks,nonempty:Ad,nullable:md,number:bd,object:Vt,omit:ed,optional:Au,partial:td,pattern:Md,pick:rd,record:yd,refine:Ze,regexp:wd,set:_d,size:Ld,string:Mu,struct:nd,trimmed:Sd,tuple:vd,type:zt,union:Ed,unknown:Lu,validate:nt},Symbol.toStringTag,{value:"Module"})),Ke=Ht(Td);var ua;function Ce(){if(ua)return he;ua=1,Object.defineProperty(he,"__esModule",{value:!0}),he.assertExhaustive=he.assertStruct=he.assert=he.AssertionError=void 0;const e=Ke;function r(p){return typeof p=="object"&&p!==null&&"message"in p}function t(p){var f,s;return typeof((s=(f=p==null?void 0:p.prototype)===null||f===void 0?void 0:f.constructor)===null||s===void 0?void 0:s.name)=="string"}function n(p){const f=r(p)?p.message:String(p);return f.endsWith(".")?f.slice(0,-1):f}function l(p,f){return t(p)?new p({message:f}):p({message:f})}class o extends Error{constructor(f){super(f.message),this.code="ERR_ASSERTION"}}he.AssertionError=o;function a(p,f="Assertion failed.",s=o){if(!p)throw f instanceof Error?f:l(s,f)}he.assert=a;function d(p,f,s="Assertion failed",u=o){try{(0,e.assert)(p,f)}catch(i){throw l(u,`${s}: ${n(i)}.`)}}he.assertStruct=d;function c(p){throw new Error("Invalid branch reached. Should be detected during compilation.")}return he.assertExhaustive=c,he}var Nt={},la;function Nu(){if(la)return Nt;la=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.base64=void 0;const e=Ke,r=Ce(),t=(n,l={})=>{var o,a;const d=(o=l.paddingRequired)!==null&&o!==void 0?o:!1,c=(a=l.characterSet)!==null&&a!==void 0?a:"base64";let p;c==="base64"?p=String.raw`[A-Za-z0-9+\/]`:((0,r.assert)(c==="base64url"),p=String.raw`[-_A-Za-z0-9]`);let f;return d?f=new RegExp(`^(?:${p}{4})*(?:${p}{3}=|${p}{2}==)?$`,"u"):f=new RegExp(`^(?:${p}{4})*(?:${p}{2,3}|${p}{3}=|${p}{2}==)?$`,"u"),(0,e.pattern)(n,f)};return Nt.base64=t,Nt}var ee={},Zn={},da;function br(){return da||(da=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const r=Ke,t=Ce();e.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/iu);function n(p){return(0,r.is)(p,e.HexStruct)}e.isHexString=n;function l(p){return(0,r.is)(p,e.StrictHexStruct)}e.isStrictHexString=l;function o(p){(0,t.assert)(n(p),"Value must be a hexadecimal string.")}e.assertIsHexString=o;function a(p){(0,t.assert)(l(p),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function d(p){return p.startsWith("0x")?p:p.startsWith("0X")?`0x${p.substring(2)}`:`0x${p}`}e.add0x=d;function c(p){return p.startsWith("0x")||p.startsWith("0X")?p.substring(2):p}e.remove0x=c})(Zn)),Zn}var ha;function Pu(){if(ha)return ee;ha=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.createDataView=ee.concatBytes=ee.valueToBytes=ee.stringToBytes=ee.numberToBytes=ee.signedBigIntToBytes=ee.bigIntToBytes=ee.hexToBytes=ee.bytesToString=ee.bytesToNumber=ee.bytesToSignedBigInt=ee.bytesToBigInt=ee.bytesToHex=ee.assertIsBytes=ee.isBytes=void 0;const e=Ce(),r=br(),t=48,n=58,l=87;function o(){const S=[];return()=>{if(S.length===0)for(let I=0;I<256;I++)S.push(I.toString(16).padStart(2,"0"));return S}}const a=o();function d(S){return S instanceof Uint8Array}ee.isBytes=d;function c(S){(0,e.assert)(d(S),"Value must be a Uint8Array.")}ee.assertIsBytes=c;function p(S){if(c(S),S.length===0)return"0x";const I=a(),P=new Array(S.length);for(let D=0;D<S.length;D++)P[D]=I[S[D]];return(0,r.add0x)(P.join(""))}ee.bytesToHex=p;function f(S){c(S);const I=p(S);return BigInt(I)}ee.bytesToBigInt=f;function s(S){c(S);let I=BigInt(0);for(const P of S)I=(I<<BigInt(8))+BigInt(P);return BigInt.asIntN(S.length*8,I)}ee.bytesToSignedBigInt=s;function u(S){c(S);const I=f(S);return(0,e.assert)(I<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(I)}ee.bytesToNumber=u;function i(S){return c(S),new TextDecoder().decode(S)}ee.bytesToString=i;function g(S){var I;if(((I=S==null?void 0:S.toLowerCase)===null||I===void 0?void 0:I.call(S))==="0x")return new Uint8Array;(0,r.assertIsHexString)(S);const P=(0,r.remove0x)(S).toLowerCase(),D=P.length%2===0?P:`0${P}`,$=new Uint8Array(D.length/2);for(let z=0;z<$.length;z++){const X=D.charCodeAt(z*2),Y=D.charCodeAt(z*2+1),J=X-(X<n?t:l),M=Y-(Y<n?t:l);$[z]=J*16+M}return $}ee.hexToBytes=g;function m(S){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(S>=BigInt(0),"Value must be a non-negative bigint.");const I=S.toString(16);return g(I)}ee.bigIntToBytes=m;function b(S,I){(0,e.assert)(I>0);const P=S>>BigInt(31);return!((~S&P)+(S&~P)>>BigInt(I*8+-1))}function h(S,I){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(typeof I=="number","Byte length must be a number."),(0,e.assert)(I>0,"Byte length must be greater than 0."),(0,e.assert)(b(S,I),"Byte length is too small to represent the given value.");let P=S;const D=new Uint8Array(I);for(let $=0;$<D.length;$++)D[$]=Number(BigInt.asUintN(8,P)),P>>=BigInt(8);return D.reverse()}ee.signedBigIntToBytes=h;function w(S){(0,e.assert)(typeof S=="number","Value must be a number."),(0,e.assert)(S>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(S),"Value is not a safe integer. Use `bigIntToBytes` instead.");const I=S.toString(16);return g(I)}ee.numberToBytes=w;function y(S){return(0,e.assert)(typeof S=="string","Value must be a string."),new TextEncoder().encode(S)}ee.stringToBytes=y;function _(S){if(typeof S=="bigint")return m(S);if(typeof S=="number")return w(S);if(typeof S=="string")return S.startsWith("0x")?g(S):y(S);if(d(S))return S;throw new TypeError(`Unsupported value type: "${typeof S}".`)}ee.valueToBytes=_;function v(S){const I=new Array(S.length);let P=0;for(let $=0;$<S.length;$++){const z=_(S[$]);I[$]=z,P+=z.length}const D=new Uint8Array(P);for(let $=0,z=0;$<I.length;$++)D.set(I[$],z),z+=I[$].length;return D}ee.concatBytes=v;function k(S){if(typeof K<"u"&&S instanceof K){const I=S.buffer.slice(S.byteOffset,S.byteOffset+S.byteLength);return new DataView(I)}return new DataView(S.buffer,S.byteOffset,S.byteLength)}return ee.createDataView=k,ee}var Pt={},fa;function Nd(){if(fa)return Pt;fa=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.ChecksumStruct=void 0;const e=Ke,r=Nu();return Pt.ChecksumStruct=(0,e.size)((0,r.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Pt}var fe={},ga;function Pd(){if(ga)return fe;ga=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.createHex=fe.createBytes=fe.createBigInt=fe.createNumber=void 0;const e=Ke,r=Ce(),t=Pu(),n=br(),l=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),n.StrictHexStruct]),o=(0,e.coerce)((0,e.number)(),l,Number),a=(0,e.coerce)((0,e.bigint)(),l,BigInt);(0,e.union)([n.StrictHexStruct,(0,e.instance)(Uint8Array)]);const d=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([n.StrictHexStruct]),t.hexToBytes),c=(0,e.coerce)(n.StrictHexStruct,(0,e.instance)(Uint8Array),t.bytesToHex);function p(i){try{const g=(0,e.create)(i,o);return(0,r.assert)(Number.isFinite(g),`Expected a number-like value, got "${i}".`),g}catch(g){throw g instanceof e.StructError?new Error(`Expected a number-like value, got "${i}".`):g}}fe.createNumber=p;function f(i){try{return(0,e.create)(i,a)}catch(g){throw g instanceof e.StructError?new Error(`Expected a number-like value, got "${String(g.value)}".`):g}}fe.createBigInt=f;function s(i){if(typeof i=="string"&&i.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(i,d)}catch(g){throw g instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(g.value)}".`):g}}fe.createBytes=s;function u(i){if(i instanceof Uint8Array&&i.length===0||typeof i=="string"&&i.toLowerCase()==="0x")return"0x";try{return(0,e.create)(i,c)}catch(g){throw g instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(g.value)}".`):g}}return fe.createHex=u,fe}var ge={},pa;function Od(){if(pa)return ge;pa=1;var e=ge&&ge.__classPrivateFieldSet||function(a,d,c,p,f){if(p==="m")throw new TypeError("Private method is not writable");if(p==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof d=="function"?a!==d||!f:!d.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p==="a"?f.call(a,c):f?f.value=c:d.set(a,c),c},r=ge&&ge.__classPrivateFieldGet||function(a,d,c,p){if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a getter");if(typeof d=="function"?a!==d||!p:!d.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?p:c==="a"?p.call(a):p?p.value:d.get(a)},t,n;Object.defineProperty(ge,"__esModule",{value:!0}),ge.FrozenSet=ge.FrozenMap=void 0;class l{constructor(d){t.set(this,void 0),e(this,t,new Map(d),"f"),Object.freeze(this)}get size(){return r(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return r(this,t,"f")[Symbol.iterator]()}entries(){return r(this,t,"f").entries()}forEach(d,c){return r(this,t,"f").forEach((p,f,s)=>d.call(c,p,f,this))}get(d){return r(this,t,"f").get(d)}has(d){return r(this,t,"f").has(d)}keys(){return r(this,t,"f").keys()}values(){return r(this,t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([d,c])=>`${String(d)} => ${String(c)}`).join(", ")} `:""}}`}}ge.FrozenMap=l;class o{constructor(d){n.set(this,void 0),e(this,n,new Set(d),"f"),Object.freeze(this)}get size(){return r(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return r(this,n,"f")[Symbol.iterator]()}entries(){return r(this,n,"f").entries()}forEach(d,c){return r(this,n,"f").forEach((p,f,s)=>d.call(c,p,f,this))}has(d){return r(this,n,"f").has(d)}keys(){return r(this,n,"f").keys()}values(){return r(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(d=>String(d)).join(", ")} `:""}}`}}return ge.FrozenSet=o,Object.freeze(l),Object.freeze(l.prototype),Object.freeze(o),Object.freeze(o.prototype),ge}var Kn={},ma;function xd(){return ma||(ma=1,Object.defineProperty(Kn,"__esModule",{value:!0})),Kn}var Qn={},ba;function Bd(){return ba||(ba=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const r=Ke,t=Ce(),n=()=>(0,r.define)("finite number",v=>(0,r.is)(v,(0,r.number)())&&Number.isFinite(v));e.UnsafeJsonStruct=(0,r.union)([(0,r.literal)(null),(0,r.boolean)(),n(),(0,r.string)(),(0,r.array)((0,r.lazy)(()=>e.UnsafeJsonStruct)),(0,r.record)((0,r.string)(),(0,r.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,r.define)("Json",(v,k)=>{function S(I,P){const $=[...P.validator(I,k)];return $.length>0?$:!0}try{const I=S(v,e.UnsafeJsonStruct);return I!==!0?I:S(JSON.parse(JSON.stringify(v)),e.UnsafeJsonStruct)}catch(I){return I instanceof RangeError?"Circular reference detected":!1}});function l(v){return(0,r.is)(v,e.JsonStruct)}e.isValidJson=l;function o(v){(0,t.assertStruct)(v,e.JsonStruct,"Invalid JSON value");const k=JSON.stringify(v);return new TextEncoder().encode(k).byteLength}e.getJsonSize=o,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,r.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),e.JsonRpcErrorStruct=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(e.JsonStruct),stack:(0,r.optional)((0,r.string)())}),e.JsonRpcParamsStruct=(0,r.optional)((0,r.union)([(0,r.record)((0,r.string)(),e.JsonStruct),(0,r.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,r.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,r.omit)(e.JsonRpcRequestStruct,["id"]);function a(v){return(0,r.is)(v,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function d(v,k){(0,t.assertStruct)(v,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",k)}e.assertIsJsonRpcNotification=d;function c(v){return(0,r.is)(v,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function p(v,k){(0,t.assertStruct)(v,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",k)}e.assertIsJsonRpcRequest=p,e.PendingJsonRpcResponseStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,r.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function f(v){return(0,r.is)(v,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function s(v,k){(0,t.assertStruct)(v,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",k)}e.assertIsPendingJsonRpcResponse=s;function u(v){return(0,r.is)(v,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=u;function i(v,k){(0,t.assertStruct)(v,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",k)}e.assertIsJsonRpcResponse=i;function g(v){return(0,r.is)(v,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=g;function m(v,k){(0,t.assertStruct)(v,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",k)}e.assertIsJsonRpcSuccess=m;function b(v){return(0,r.is)(v,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=b;function h(v,k){(0,t.assertStruct)(v,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",k)}e.assertIsJsonRpcFailure=h;function w(v){return(0,r.is)(v,e.JsonRpcErrorStruct)}e.isJsonRpcError=w;function y(v,k){(0,t.assertStruct)(v,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",k)}e.assertIsJsonRpcError=y;function _(v){const{permitEmptyString:k,permitFractions:S,permitNull:I}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},v);return D=>!!(typeof D=="number"&&(S||Number.isInteger(D))||typeof D=="string"&&(k||D.length>0)||I&&D===null)}e.getJsonRpcIdValidator=_})(Qn)),Qn}var Yn={},ya;function Dd(){return ya||(ya=1,Object.defineProperty(Yn,"__esModule",{value:!0})),Yn}var Ee={},wa;function qd(){if(wa)return Ee;wa=1;var e=Ee&&Ee.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.createModuleLogger=Ee.createProjectLogger=void 0;const t=(0,e(Yu()).default)("metamask");function n(o){return t.extend(o)}Ee.createProjectLogger=n;function l(o,a){return o.extend(a)}return Ee.createModuleLogger=l,Ee}var Xn={},_a;function jd(){return _a||(_a=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function r(p){return Array.isArray(p)&&p.length>0}e.isNonEmptyArray=r;function t(p){return p==null}e.isNullOrUndefined=t;function n(p){return!!p&&typeof p=="object"&&!Array.isArray(p)}e.isObject=n;const l=(p,f)=>Object.hasOwnProperty.call(p,f);e.hasProperty=l,(function(p){p[p.Null=4]="Null",p[p.Comma=1]="Comma",p[p.Wrapper=1]="Wrapper",p[p.True=4]="True",p[p.False=5]="False",p[p.Quote=1]="Quote",p[p.Colon=1]="Colon",p[p.Date=24]="Date"})(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function o(p){if(typeof p!="object"||p===null)return!1;try{let f=p;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(p)===f}catch{return!1}}e.isPlainObject=o;function a(p){return p.charCodeAt(0)<=127}e.isASCII=a;function d(p){var f;return p.split("").reduce((u,i)=>a(i)?u+1:u+2,0)+((f=p.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=d;function c(p){return p.toString().length}e.calculateNumberSize=c})(Xn)),Xn}var pe={},va;function Fd(){if(va)return pe;va=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.hexToBigInt=pe.hexToNumber=pe.bigIntToHex=pe.numberToHex=void 0;const e=Ce(),r=br(),t=a=>((0,e.assert)(typeof a=="number","Value must be a number."),(0,e.assert)(a>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,r.add0x)(a.toString(16)));pe.numberToHex=t;const n=a=>((0,e.assert)(typeof a=="bigint","Value must be a bigint."),(0,e.assert)(a>=0,"Value must be a non-negative bigint."),(0,r.add0x)(a.toString(16)));pe.bigIntToHex=n;const l=a=>{(0,r.assertIsHexString)(a);const d=parseInt(a,16);return(0,e.assert)(Number.isSafeInteger(d),"Value is not a safe integer. Use `hexToBigInt` instead."),d};pe.hexToNumber=l;const o=a=>((0,r.assertIsHexString)(a),BigInt((0,r.add0x)(a)));return pe.hexToBigInt=o,pe}var ei={},Ea;function $d(){return Ea||(Ea=1,Object.defineProperty(ei,"__esModule",{value:!0})),ei}var ti={},Ra;function Hd(){return Ra||(Ra=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(function(o){o[o.Millisecond=1]="Millisecond",o[o.Second=1e3]="Second",o[o.Minute=6e4]="Minute",o[o.Hour=36e5]="Hour",o[o.Day=864e5]="Day",o[o.Week=6048e5]="Week",o[o.Year=31536e6]="Year"})(e.Duration||(e.Duration={}));const r=o=>Number.isInteger(o)&&o>=0,t=(o,a)=>{if(!r(o))throw new Error(`"${a}" must be a non-negative integer. Received: "${o}".`)};function n(o,a){return t(o,"count"),o*a}e.inMilliseconds=n;function l(o){return t(o,"timestamp"),Date.now()-o}e.timeSince=l})(ti)),ti}var ri={},Sa;function Ud(){return Sa||(Sa=1,Object.defineProperty(ri,"__esModule",{value:!0})),ri}var ni={},or={exports:{}},ii,ka;function Jt(){if(ka)return ii;ka=1;const e="2.0.0",r=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,l=r-6;return ii={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:l,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ii}var si,Ca;function yr(){if(Ca)return si;Ca=1;var e={};return si=typeof re=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},si}var Ia;function Gt(){return Ia||(Ia=1,(function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:l}=Jt(),o=yr();r=e.exports={};const a=r.re=[],d=r.safeRe=[],c=r.src=[],p=r.safeSrc=[],f=r.t={};let s=0;const u="[a-zA-Z0-9-]",i=[["\\s",1],["\\d",l],[u,n]],g=b=>{for(const[h,w]of i)b=b.split(`${h}*`).join(`${h}{0,${w}}`).split(`${h}+`).join(`${h}{1,${w}}`);return b},m=(b,h,w)=>{const y=g(h),_=s++;o(b,_,h),f[b]=_,c[_]=h,p[_]=y,a[_]=new RegExp(h,w?"g":void 0),d[_]=new RegExp(y,w?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),m("MAINVERSION",`(${c[f.NUMERICIDENTIFIER]})\\.(${c[f.NUMERICIDENTIFIER]})\\.(${c[f.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[f.NUMERICIDENTIFIERLOOSE]})\\.(${c[f.NUMERICIDENTIFIERLOOSE]})\\.(${c[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[f.NONNUMERICIDENTIFIER]}|${c[f.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[f.NONNUMERICIDENTIFIER]}|${c[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[f.PRERELEASEIDENTIFIER]}(?:\\.${c[f.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[f.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${u}+`),m("BUILD",`(?:\\+(${c[f.BUILDIDENTIFIER]}(?:\\.${c[f.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[f.MAINVERSION]}${c[f.PRERELEASE]}?${c[f.BUILD]}?`),m("FULL",`^${c[f.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[f.MAINVERSIONLOOSE]}${c[f.PRERELEASELOOSE]}?${c[f.BUILD]}?`),m("LOOSE",`^${c[f.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[f.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[f.XRANGEIDENTIFIER]})(?:\\.(${c[f.XRANGEIDENTIFIER]})(?:\\.(${c[f.XRANGEIDENTIFIER]})(?:${c[f.PRERELEASE]})?${c[f.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[f.XRANGEIDENTIFIERLOOSE]})(?:${c[f.PRERELEASELOOSE]})?${c[f.BUILD]}?)?)?`),m("XRANGE",`^${c[f.GTLT]}\\s*${c[f.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[f.GTLT]}\\s*${c[f.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),m("COERCE",`${c[f.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[f.COERCEPLAIN]+`(?:${c[f.PRERELEASE]})?(?:${c[f.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[f.COERCE],!0),m("COERCERTLFULL",c[f.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[f.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",m("TILDE",`^${c[f.LONETILDE]}${c[f.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[f.LONETILDE]}${c[f.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[f.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",m("CARET",`^${c[f.LONECARET]}${c[f.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[f.LONECARET]}${c[f.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[f.GTLT]}\\s*(${c[f.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[f.GTLT]}\\s*(${c[f.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[f.GTLT]}\\s*(${c[f.LOOSEPLAIN]}|${c[f.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[f.XRANGEPLAIN]})\\s+-\\s+(${c[f.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[f.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(or,or.exports)),or.exports}var oi,Aa;function Is(){if(Aa)return oi;Aa=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return oi=n=>n?typeof n!="object"?e:n:r,oi}var ai,Ma;function Ou(){if(Ma)return ai;Ma=1;const e=/^[0-9]+$/,r=(n,l)=>{if(typeof n=="number"&&typeof l=="number")return n===l?0:n<l?-1:1;const o=e.test(n),a=e.test(l);return o&&a&&(n=+n,l=+l),n===l?0:o&&!a?-1:a&&!o?1:n<l?-1:1};return ai={compareIdentifiers:r,rcompareIdentifiers:(n,l)=>r(l,n)},ai}var ci,La;function ae(){if(La)return ci;La=1;const e=yr(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:t}=Jt(),{safeRe:n,t:l}=Gt(),o=Is(),{compareIdentifiers:a}=Ou(),d=(p,f)=>{const s=f.split(".");if(s.length>p.length)return!1;for(let u=0;u<s.length;u++)if(a(p[u],s[u])!==0)return!1;return!0};class c{constructor(f,s){if(s=o(s),f instanceof c){if(f.loose===!!s.loose&&f.includePrerelease===!!s.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",f,s),this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease;const u=f.trim().match(s.loose?n[l.LOOSE]:n[l.FULL]);if(!u)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const g=+i;if(g>=0&&g<t)return g}return i}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(e("SemVer.compare",this.version,this.options,f),!(f instanceof c)){if(typeof f=="string"&&f===this.version)return 0;f=new c(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof c||(f=new c(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof c||(f=new c(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let s=0;do{const u=this.prerelease[s],i=f.prerelease[s];if(e("prerelease compare",s,u,i),u===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(u===void 0)return-1;if(u===i)continue;return a(u,i)}while(++s)}compareBuild(f){f instanceof c||(f=new c(f,this.options));let s=0;do{const u=this.build[s],i=f.build[s];if(e("build compare",s,u,i),u===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(u===void 0)return-1;if(u===i)continue;return a(u,i)}while(++s)}inc(f,s,u){if(f.startsWith("pre")){if(!s&&u===!1)throw new Error("invalid increment argument: identifier is empty");if(s){const i=`-${s}`.match(this.options.loose?n[l.PRERELEASELOOSE]:n[l.PRERELEASE]);if(!i||i[1]!==s)throw new Error(`invalid identifier: ${s}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",s,u);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",s,u);break;case"prepatch":this.prerelease.length=0,this.inc("patch",s,u),this.inc("pre",s,u);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",s,u),this.inc("pre",s,u);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(u)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(s===this.prerelease.join(".")&&u===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(s){let g=[s,i];if(u===!1&&(g=[s]),d(this.prerelease,s)){const m=this.prerelease[s.split(".").length];isNaN(m)&&(this.prerelease=g)}else this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ci=c,ci}var ui,Ta;function Qe(){if(Ta)return ui;Ta=1;const e=ae();return ui=(t,n,l=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(o){if(!l)return null;throw o}},ui}var li,Na;function Wd(){if(Na)return li;Na=1;const e=Qe();return li=(t,n)=>{const l=e(t,n);return l?l.version:null},li}var di,Pa;function Vd(){if(Pa)return di;Pa=1;const e=Qe();return di=(t,n)=>{const l=e(t.trim().replace(/^[=v]+/,""),n);return l?l.version:null},di}var hi,Oa;function zd(){if(Oa)return hi;Oa=1;const e=ae();return hi=(t,n,l,o,a)=>{typeof l=="string"&&(a=o,o=l,l=void 0);try{return new e(t instanceof e?t.version:t,l).inc(n,o,a).version}catch{return null}},hi}var fi,xa;function Jd(){if(xa)return fi;xa=1;const e=Qe();return fi=(t,n)=>{const l=e(t,null,!0),o=e(n,null,!0),a=l.compare(o);if(a===0)return null;const d=a>0,c=d?l:o,p=d?o:l,f=!!c.prerelease.length;if(!!p.prerelease.length&&!f){if(!p.patch&&!p.minor)return"major";if(p.compareMain(c)===0)return p.minor&&!p.patch?"minor":"patch"}const u=f?"pre":"";return l.major!==o.major?u+"major":l.minor!==o.minor?u+"minor":l.patch!==o.patch?u+"patch":"prerelease"},fi}var gi,Ba;function Gd(){if(Ba)return gi;Ba=1;const e=ae();return gi=(t,n)=>new e(t,n).major,gi}var pi,Da;function Zd(){if(Da)return pi;Da=1;const e=ae();return pi=(t,n)=>new e(t,n).minor,pi}var mi,qa;function Kd(){if(qa)return mi;qa=1;const e=ae();return mi=(t,n)=>new e(t,n).patch,mi}var bi,ja;function Qd(){if(ja)return bi;ja=1;const e=Qe();return bi=(t,n)=>{const l=e(t,n);return l&&l.prerelease.length?l.prerelease:null},bi}var yi,Fa;function me(){if(Fa)return yi;Fa=1;const e=ae();return yi=(t,n,l)=>new e(t,l).compare(new e(n,l)),yi}var wi,$a;function Yd(){if($a)return wi;$a=1;const e=me();return wi=(t,n,l)=>e(n,t,l),wi}var _i,Ha;function Xd(){if(Ha)return _i;Ha=1;const e=me();return _i=(t,n)=>e(t,n,!0),_i}var vi,Ua;function As(){if(Ua)return vi;Ua=1;const e=ae();return vi=(t,n,l)=>{const o=new e(t,l),a=new e(n,l);return o.compare(a)||o.compareBuild(a)},vi}var Ei,Wa;function eh(){if(Wa)return Ei;Wa=1;const e=As();return Ei=(t,n)=>t.sort((l,o)=>e(l,o,n)),Ei}var Ri,Va;function th(){if(Va)return Ri;Va=1;const e=As();return Ri=(t,n)=>t.sort((l,o)=>e(o,l,n)),Ri}var Si,za;function wr(){if(za)return Si;za=1;const e=me();return Si=(t,n,l)=>e(t,n,l)>0,Si}var ki,Ja;function Ms(){if(Ja)return ki;Ja=1;const e=me();return ki=(t,n,l)=>e(t,n,l)<0,ki}var Ci,Ga;function xu(){if(Ga)return Ci;Ga=1;const e=me();return Ci=(t,n,l)=>e(t,n,l)===0,Ci}var Ii,Za;function Bu(){if(Za)return Ii;Za=1;const e=me();return Ii=(t,n,l)=>e(t,n,l)!==0,Ii}var Ai,Ka;function Ls(){if(Ka)return Ai;Ka=1;const e=me();return Ai=(t,n,l)=>e(t,n,l)>=0,Ai}var Mi,Qa;function Ts(){if(Qa)return Mi;Qa=1;const e=me();return Mi=(t,n,l)=>e(t,n,l)<=0,Mi}var Li,Ya;function Du(){if(Ya)return Li;Ya=1;const e=xu(),r=Bu(),t=wr(),n=Ls(),l=Ms(),o=Ts();return Li=(d,c,p,f)=>{switch(c){case"===":return typeof d=="object"&&(d=d.version),typeof p=="object"&&(p=p.version),d===p;case"!==":return typeof d=="object"&&(d=d.version),typeof p=="object"&&(p=p.version),d!==p;case"":case"=":case"==":return e(d,p,f);case"!=":return r(d,p,f);case">":return t(d,p,f);case">=":return n(d,p,f);case"<":return l(d,p,f);case"<=":return o(d,p,f);default:throw new TypeError(`Invalid operator: ${c}`)}},Li}var Ti,Xa;function rh(){if(Xa)return Ti;Xa=1;const e=ae(),r=Qe(),{safeRe:t,t:n}=Gt();return Ti=(o,a)=>{if(o instanceof e)return o;if(typeof o=="number"&&(o=String(o)),typeof o!="string")return null;a=a||{};let d=null;if(!a.rtl)d=o.match(a.includePrerelease?t[n.COERCEFULL]:t[n.COERCE]);else{const i=a.includePrerelease?t[n.COERCERTLFULL]:t[n.COERCERTL];let g;for(;(g=i.exec(o))&&(!d||d.index+d[0].length!==o.length);)(!d||g.index+g[0].length!==d.index+d[0].length)&&(d=g),i.lastIndex=g.index+g[1].length+g[2].length;i.lastIndex=-1}if(d===null)return null;const c=d[2],p=d[3]||"0",f=d[4]||"0",s=a.includePrerelease&&d[5]?`-${d[5]}`:"",u=a.includePrerelease&&d[6]?`+${d[6]}`:"";return r(`${c}.${p}.${f}${s}${u}`,a)},Ti}var Ni,ec;function nh(){if(ec)return Ni;ec=1;const e=Qe(),r=Jt(),t=ae(),n=(d,c,p)=>{if(!r.RELEASE_TYPES.includes(c))return null;const f=l(d,p);return f&&o(f,c)},l=(d,c)=>{const p=d instanceof t?d.version:d;return e(p,c)},o=(d,c)=>{if(a(c))return d.version;switch(d.prerelease=[],c){case"major":d.minor=0,d.patch=0;break;case"minor":d.patch=0;break}return d.format()},a=d=>d.startsWith("pre");return Ni=n,Ni}var Pi,tc;function ih(){if(tc)return Pi;tc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(t,n)}return this}}return Pi=e,Pi}var Oi,rc;function be(){if(rc)return Oi;rc=1;const e=/\s+/g;class r{constructor(T,x){if(x=l(x),T instanceof r)return T.loose===!!x.loose&&T.includePrerelease===!!x.includePrerelease?T:new r(T.raw,x);if(T instanceof o)return this.raw=T.value,this.set=[[T]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=T.trim().replace(e," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(V=>!h(V[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&w(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let T=0;T<this.set.length;T++){T>0&&(this.formatted+="||");const x=this.set[T];for(let B=0;B<x.length;B++)B>0&&(this.formatted+=" "),this.formatted+=x[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(T){T=T.replace(b,"");const B=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+T,V=n.get(B);if(V)return V;const q=this.options.loose,F=q?c[f.HYPHENRANGELOOSE]:c[f.HYPHENRANGE];T=T.replace(F,J(this.options.includePrerelease)),a("hyphen replace",T),T=T.replace(c[f.COMPARATORTRIM],s),a("comparator trim",T),T=T.replace(c[f.TILDETRIM],u),a("tilde trim",T),T=T.replace(c[f.CARETTRIM],i),a("caret trim",T);let G=T.split(" ").map(N=>_(N,this.options)).join(" ").split(/\s+/).map(N=>Y(N,this.options));q&&(G=G.filter(N=>(a("loose invalid filter",N,this.options),!!N.match(c[f.COMPARATORLOOSE])))),a("range list",G);const H=new Map,C=G.map(N=>new o(N,this.options));for(const N of C){if(h(N))return[N];H.set(N.value,N)}H.size>1&&H.has("")&&H.delete("");const A=[...H.values()];return n.set(B,A),A}intersects(T,x){if(!(T instanceof r))throw new TypeError("a Range is required");return this.set.some(B=>y(B,x)&&T.set.some(V=>y(V,x)&&B.every(q=>V.every(F=>q.intersects(F,x)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new d(T,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(M(this.set[x],T,this.options))return!0;return!1}}Oi=r;const t=ih(),n=new t,l=Is(),o=_r(),a=yr(),d=ae(),{safeRe:c,src:p,t:f,comparatorTrimReplace:s,tildeTrimReplace:u,caretTrimReplace:i}=Gt(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:m}=Jt(),b=new RegExp(p[f.BUILD],"g"),h=L=>L.value==="<0.0.0-0",w=L=>L.value==="",y=(L,T)=>{let x=!0;const B=L.slice();let V=B.pop();for(;x&&B.length;)x=B.every(q=>V.intersects(q,T)),V=B.pop();return x},_=(L,T)=>(L=L.replace(c[f.BUILD],""),a("comp",L,T),L=P(L,T),a("caret",L),L=S(L,T),a("tildes",L),L=$(L,T),a("xrange",L),L=X(L,T),a("stars",L),L),v=L=>!L||L.toLowerCase()==="x"||L==="*",k=(L,T,x)=>v(L)&&!v(T)||v(T)&&x&&!v(x),S=(L,T)=>L.trim().split(/\s+/).map(x=>I(x,T)).join(" "),I=(L,T)=>{const x=T.loose?c[f.TILDELOOSE]:c[f.TILDE],B=T.includePrerelease?"-0":"";return L.replace(x,(V,q,F,G,H)=>{a("tilde",L,V,q,F,G,H);let C;return v(q)?C="":v(F)?C=`>=${q}.0.0${B} <${+q+1}.0.0-0`:v(G)?C=`>=${q}.${F}.0${B} <${q}.${+F+1}.0-0`:H?(a("replaceTilde pr",H),C=`>=${q}.${F}.${G}-${H} <${q}.${+F+1}.0-0`):C=`>=${q}.${F}.${G} <${q}.${+F+1}.0-0`,a("tilde return",C),C})},P=(L,T)=>L.trim().split(/\s+/).map(x=>D(x,T)).join(" "),D=(L,T)=>{a("caret",L,T);const x=T.loose?c[f.CARETLOOSE]:c[f.CARET],B=T.includePrerelease?"-0":"";return L.replace(x,(V,q,F,G,H)=>{a("caret",L,V,q,F,G,H);let C;return v(q)?C="":v(F)?C=`>=${q}.0.0${B} <${+q+1}.0.0-0`:v(G)?q==="0"?C=`>=${q}.${F}.0${B} <${q}.${+F+1}.0-0`:C=`>=${q}.${F}.0${B} <${+q+1}.0.0-0`:H?(a("replaceCaret pr",H),q==="0"?F==="0"?C=`>=${q}.${F}.${G}-${H} <${q}.${F}.${+G+1}-0`:C=`>=${q}.${F}.${G}-${H} <${q}.${+F+1}.0-0`:C=`>=${q}.${F}.${G}-${H} <${+q+1}.0.0-0`):(a("no pr"),q==="0"?F==="0"?C=`>=${q}.${F}.${G} <${q}.${F}.${+G+1}-0`:C=`>=${q}.${F}.${G} <${q}.${+F+1}.0-0`:C=`>=${q}.${F}.${G} <${+q+1}.0.0-0`),a("caret return",C),C})},$=(L,T)=>(a("replaceXRanges",L,T),L.split(/\s+/).map(x=>z(x,T)).join(" ")),z=(L,T)=>{L=L.trim();const x=T.loose?c[f.XRANGELOOSE]:c[f.XRANGE];return L.replace(x,(B,V,q,F,G,H)=>{if(a("xRange",L,B,V,q,F,G,H),k(q,F,G))return L;const C=v(q),A=C||v(F),N=A||v(G),U=N;return V==="="&&U&&(V=""),H=T.includePrerelease?"-0":"",C?V===">"||V==="<"?B="<0.0.0-0":B="*":V&&U?(A&&(F=0),G=0,V===">"?(V=">=",A?(q=+q+1,F=0,G=0):(F=+F+1,G=0)):V==="<="&&(V="<",A?q=+q+1:F=+F+1),V==="<"&&(H="-0"),B=`${V+q}.${F}.${G}${H}`):A?B=`>=${q}.0.0${H} <${+q+1}.0.0-0`:N&&(B=`>=${q}.${F}.0${H} <${q}.${+F+1}.0-0`),a("xRange return",B),B})},X=(L,T)=>(a("replaceStars",L,T),L.trim().replace(c[f.STAR],"")),Y=(L,T)=>(a("replaceGTE0",L,T),L.trim().replace(c[T.includePrerelease?f.GTE0PRE:f.GTE0],"")),J=L=>(T,x,B,V,q,F,G,H,C,A,N,U)=>(v(B)?x="":v(V)?x=`>=${B}.0.0${L?"-0":""}`:v(q)?x=`>=${B}.${V}.0${L?"-0":""}`:F?x=`>=${x}`:x=`>=${x}${L?"-0":""}`,v(C)?H="":v(A)?H=`<${+C+1}.0.0-0`:v(N)?H=`<${C}.${+A+1}.0-0`:U?H=`<=${C}.${A}.${N}-${U}`:L?H=`<${C}.${A}.${+N+1}-0`:H=`<=${H}`,`${x} ${H}`.trim()),M=(L,T,x)=>{for(let B=0;B<L.length;B++)if(!L[B].test(T))return!1;if(T.prerelease.length&&!x.includePrerelease){for(let B=0;B<L.length;B++)if(a(L[B].semver),L[B].semver!==o.ANY&&L[B].semver.prerelease.length>0){const V=L[B].semver;if(V.major===T.major&&V.minor===T.minor&&V.patch===T.patch)return!0}return!1}return!0};return Oi}var xi,nc;function _r(){if(nc)return xi;nc=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(f,s){if(s=t(s),f instanceof r){if(f.loose===!!s.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,s),this.options=s,this.loose=!!s.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const s=this.options.loose?n[l.COMPARATORLOOSE]:n[l.COMPARATOR],u=f.match(s);if(!u)throw new TypeError(`Invalid comparator: ${f}`);this.operator=u[1]!==void 0?u[1]:"",this.operator==="="&&(this.operator=""),u[2]?this.semver=new d(u[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(a("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new d(f,this.options)}catch{return!1}return o(f,this.operator,this.semver,this.options)}intersects(f,s){if(!(f instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(f.value,s).test(this.value):f.operator===""?f.value===""?!0:new c(this.value,s).test(f.semver):(s=t(s),s.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!s.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||o(this.semver,"<",f.semver,s)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||o(this.semver,">",f.semver,s)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}xi=r;const t=Is(),{safeRe:n,t:l}=Gt(),o=Du(),a=yr(),d=ae(),c=be();return xi}var Bi,ic;function vr(){if(ic)return Bi;ic=1;const e=be();return Bi=(t,n,l)=>{try{n=new e(n,l)}catch{return!1}return n.test(t)},Bi}var Di,sc;function sh(){if(sc)return Di;sc=1;const e=be();return Di=(t,n)=>new e(t,n).set.map(l=>l.map(o=>o.value).join(" ").trim().split(" ")),Di}var qi,oc;function oh(){if(oc)return qi;oc=1;const e=ae(),r=be();return qi=(n,l,o)=>{let a=null,d=null,c=null;try{c=new r(l,o)}catch{return null}return n.forEach(p=>{c.test(p)&&(!a||d.compare(p)===-1)&&(a=p,d=new e(a,o))}),a},qi}var ji,ac;function ah(){if(ac)return ji;ac=1;const e=ae(),r=be();return ji=(n,l,o)=>{let a=null,d=null,c=null;try{c=new r(l,o)}catch{return null}return n.forEach(p=>{c.test(p)&&(!a||d.compare(p)===1)&&(a=p,d=new e(a,o))}),a},ji}var Fi,cc;function ch(){if(cc)return Fi;cc=1;const e=ae(),r=be(),t=wr();return Fi=(l,o)=>{l=new r(l,o);let a=new e("0.0.0");if(l.test(a)||(a=new e("0.0.0-0"),l.test(a)))return a;a=null;for(let d=0;d<l.set.length;++d){const c=l.set[d];let p=null;c.forEach(f=>{const s=new e(f.semver.version);switch(f.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!p||t(s,p))&&(p=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),p&&(!a||t(a,p))&&(a=p)}return a&&l.test(a)?a:null},Fi}var $i,uc;function uh(){if(uc)return $i;uc=1;const e=be();return $i=(t,n)=>{try{return new e(t,n).range||"*"}catch{return null}},$i}var Hi,lc;function Ns(){if(lc)return Hi;lc=1;const e=ae(),r=_r(),{ANY:t}=r,n=be(),l=vr(),o=wr(),a=Ms(),d=Ts(),c=Ls();return Hi=(f,s,u,i)=>{f=new e(f,i),s=new n(s,i);let g,m,b,h,w;switch(u){case">":g=o,m=d,b=a,h=">",w=">=";break;case"<":g=a,m=c,b=o,h="<",w="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(l(f,s,i))return!1;for(let y=0;y<s.set.length;++y){const _=s.set[y];let v=null,k=null;if(_.forEach(S=>{S.semver===t&&(S=new r(">=0.0.0")),v=v||S,k=k||S,g(S.semver,v.semver,i)?v=S:b(S.semver,k.semver,i)&&(k=S)}),v.operator===h||v.operator===w||(!k.operator||k.operator===h)&&m(f,k.semver))return!1;if(k.operator===w&&b(f,k.semver))return!1}return!0},Hi}var Ui,dc;function lh(){if(dc)return Ui;dc=1;const e=Ns();return Ui=(t,n,l)=>e(t,n,">",l),Ui}var Wi,hc;function dh(){if(hc)return Wi;hc=1;const e=Ns();return Wi=(t,n,l)=>e(t,n,"<",l),Wi}var Vi,fc;function hh(){if(fc)return Vi;fc=1;const e=be();return Vi=(t,n,l)=>(t=new e(t,l),n=new e(n,l),t.intersects(n,l)),Vi}var zi,gc;function fh(){if(gc)return zi;gc=1;const e=vr(),r=me();return zi=(t,n,l)=>{const o=[];let a=null,d=null;const c=t.sort((u,i)=>r(u,i,l));for(const u of c)e(u,n,l)?(d=u,a||(a=u)):(d&&o.push([a,d]),d=null,a=null);a&&o.push([a,null]);const p=[];for(const[u,i]of o)u===i?p.push(u):!i&&u===c[0]?p.push("*"):i?u===c[0]?p.push(`<=${i}`):p.push(`${u} - ${i}`):p.push(`>=${u}`);const f=p.join(" || "),s=typeof n.raw=="string"?n.raw:String(n);return f.length<s.length?f:n},zi}var Ji,pc;function gh(){if(pc)return Ji;pc=1;const e=be(),r=_r(),{ANY:t}=r,n=vr(),l=me(),o=(s,u,i={})=>{if(s===u)return!0;s=new e(s,i),u=new e(u,i);let g=!1;e:for(const m of s.set){for(const b of u.set){const h=c(m,b,i);if(g=g||h!==null,h)continue e}if(g)return!1}return!0},a=[new r(">=0.0.0-0")],d=[new r(">=0.0.0")],c=(s,u,i)=>{if(s===u)return!0;if(s.length===1&&s[0].semver===t){if(u.length===1&&u[0].semver===t)return!0;i.includePrerelease?s=a:s=d}if(u.length===1&&u[0].semver===t){if(i.includePrerelease)return!0;u=d}const g=new Set;let m,b;for(const I of s)I.operator===">"||I.operator===">="?m=p(m,I,i):I.operator==="<"||I.operator==="<="?b=f(b,I,i):g.add(I.semver);if(g.size>1)return null;let h;if(m&&b){if(h=l(m.semver,b.semver,i),h>0)return null;if(h===0&&(m.operator!==">="||b.operator!=="<="))return null}for(const I of g){if(m&&!n(I,String(m),i)||b&&!n(I,String(b),i))return null;for(const P of u)if(!n(I,String(P),i))return!1;return!0}let w,y,_,v,k=b&&!i.includePrerelease&&b.semver.prerelease.length?b.semver:!1,S=m&&!i.includePrerelease&&m.semver.prerelease.length?m.semver:!1;k&&k.prerelease.length===1&&b.operator==="<"&&k.prerelease[0]===0&&(k=!1);for(const I of u){if(v=v||I.operator===">"||I.operator===">=",_=_||I.operator==="<"||I.operator==="<=",m){if(S&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===S.major&&I.semver.minor===S.minor&&I.semver.patch===S.patch&&(S=!1),I.operator===">"||I.operator===">="){if(w=p(m,I,i),w===I&&w!==m)return!1}else if(m.operator===">="&&!I.test(m.semver))return!1}if(b){if(k&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===k.major&&I.semver.minor===k.minor&&I.semver.patch===k.patch&&(k=!1),I.operator==="<"||I.operator==="<="){if(y=f(b,I,i),y===I&&y!==b)return!1}else if(b.operator==="<="&&!I.test(b.semver))return!1}if(!I.operator&&(b||m)&&h!==0)return!1}return!(m&&_&&!b&&h!==0||b&&v&&!m&&h!==0||S||k)},p=(s,u,i)=>{if(!s)return u;const g=l(s.semver,u.semver,i);return g>0?s:g<0||u.operator===">"&&s.operator===">="?u:s},f=(s,u,i)=>{if(!s)return u;const g=l(s.semver,u.semver,i);return g<0?s:g>0||u.operator==="<"&&s.operator==="<="?u:s};return Ji=o,Ji}var Gi,mc;function ph(){if(mc)return Gi;mc=1;const e=Gt(),r=Jt(),t=ae(),n=Ou(),l=Qe(),o=Wd(),a=Vd(),d=zd(),c=Jd(),p=Gd(),f=Zd(),s=Kd(),u=Qd(),i=me(),g=Yd(),m=Xd(),b=As(),h=eh(),w=th(),y=wr(),_=Ms(),v=xu(),k=Bu(),S=Ls(),I=Ts(),P=Du(),D=rh(),$=nh(),z=_r(),X=be(),Y=vr(),J=sh(),M=oh(),L=ah(),T=ch(),x=uh(),B=Ns(),V=lh(),q=dh(),F=hh(),G=fh(),H=gh();return Gi={parse:l,valid:o,clean:a,inc:d,diff:c,major:p,minor:f,patch:s,prerelease:u,compare:i,rcompare:g,compareLoose:m,compareBuild:b,sort:h,rsort:w,gt:y,lt:_,eq:v,neq:k,gte:S,lte:I,cmp:P,coerce:D,truncate:$,Comparator:z,Range:X,satisfies:Y,toComparators:J,maxSatisfying:M,minSatisfying:L,minVersion:T,validRange:x,outside:B,gtr:V,ltr:q,intersects:F,simplifyRange:G,subset:H,SemVer:t,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Gi}var bc;function mh(){return bc||(bc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const r=ph(),t=Ke,n=Ce();e.VersionStruct=(0,t.refine)((0,t.string)(),"Version",s=>(0,r.valid)(s)===null?`Expected SemVer version, got "${s}"`:!0),e.VersionRangeStruct=(0,t.refine)((0,t.string)(),"Version range",s=>(0,r.validRange)(s)===null?`Expected SemVer range, got "${s}"`:!0);function l(s){return(0,t.is)(s,e.VersionStruct)}e.isValidSemVerVersion=l;function o(s){return(0,t.is)(s,e.VersionRangeStruct)}e.isValidSemVerRange=o;function a(s){(0,n.assertStruct)(s,e.VersionStruct)}e.assertIsSemVerVersion=a;function d(s){(0,n.assertStruct)(s,e.VersionRangeStruct)}e.assertIsSemVerRange=d;function c(s,u){return(0,r.gt)(s,u)}e.gtVersion=c;function p(s,u){return(0,r.gtr)(s,u)}e.gtRange=p;function f(s,u){return(0,r.satisfies)(s,u,{includePrerelease:!0})}e.satisfiesVersionRange=f})(ni)),ni}var yc;function bh(){return yc||(yc=1,(function(e){var r=He&&He.__createBinding||(Object.create?(function(n,l,o,a){a===void 0&&(a=o);var d=Object.getOwnPropertyDescriptor(l,o);(!d||("get"in d?!l.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return l[o]}}),Object.defineProperty(n,a,d)}):(function(n,l,o,a){a===void 0&&(a=o),n[a]=l[o]})),t=He&&He.__exportStar||function(n,l){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(l,o)&&r(l,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),t(Ce(),e),t(Nu(),e),t(Pu(),e),t(Nd(),e),t(Pd(),e),t(Od(),e),t(xd(),e),t(br(),e),t(Bd(),e),t(Dd(),e),t(qd(),e),t(jd(),e),t(Fd(),e),t($d(),e),t(Hd(),e),t(Ud(),e),t(mh(),e)})(He)),He}var wc;function yh(){return wc||(wc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const r=bh();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return r.createModuleLogger}}),e.projectLogger=(0,r.createProjectLogger)("eth-block-tracker")})(Gn)),Gn}var _c;function wh(){if(_c)return Fe;_c=1;var e=Fe&&Fe.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.PollingBlockTracker=void 0;const r=e(vs()),t=e(zl()),n=Ru(),l=yh(),o=(0,l.createModuleLogger)(l.projectLogger,"polling-block-tracker"),a=(0,r.default)(),d=1e3;let c=class extends n.BaseBlockTracker{constructor(s={}){var u;if(!s.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},s),{blockResetDuration:(u=s.blockResetDuration)!==null&&u!==void 0?u:s.pollingInterval})),this._provider=s.provider,this._pollingInterval=s.pollingInterval||20*d,this._retryTimeout=s.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=s.keepEventLoopActive===void 0?!0:s.keepEventLoopActive,this._setSkipCacheFlag=s.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var s;this._isRunning;)try{await this._updateLatestBlock();const u=p(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await u}catch(u){const i=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
3
|
${(s=u.stack)!==null&&s!==void 0?s:u}`);try{this.emit("error",i)}catch{console.error(i)}const g=p(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await g}}async _updateLatestBlock(){const s=await this._fetchLatestBlock();this._newPotentialLatest(s)}async _fetchLatestBlock(){const s={jsonrpc:"2.0",id:a(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(s.skipCache=!0),o("Making request",s);const u=await(0,t.default)(i=>this._provider.sendAsync(s,i))();if(o("Got response",u),u.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
4
|
${u.error.message}`);return u.result}};Fe.PollingBlockTracker=c;function p(f,s){return new Promise(u=>{const i=setTimeout(u,f);i.unref&&s&&i.unref()})}return Fe}var Ue={},vc;function _h(){if(vc)return Ue;vc=1;var e=Ue&&Ue.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SubscribeBlockTracker=void 0;const r=e(vs()),t=Ru(),n=(0,r.default)();let l=class extends t.BaseBlockTracker{constructor(a={}){if(!a.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(a),this._provider=a.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const a=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(a)}catch(a){this.emit("error",a)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(a){this.emit("error",a)}}_call(a,...d){return new Promise((c,p)=>{this._provider.sendAsync({id:n(),method:a,params:d,jsonrpc:"2.0"},(f,s)=>{f?p(f):c(s.result)})})}_handleSubData(a,d){var c;d.method==="eth_subscription"&&((c=d.params)===null||c===void 0?void 0:c.subscription)===this._subscriptionId&&this._newPotentialLatest(d.params.result.number)}};return Ue.SubscribeBlockTracker=l,Ue}var Ec;function vh(){return Ec||(Ec=1,(function(e){var r=je&&je.__createBinding||(Object.create?(function(n,l,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return l[o]}})}):(function(n,l,o,a){a===void 0&&(a=o),n[a]=l[o]})),t=je&&je.__exportStar||function(n,l){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(l,o)&&r(l,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),t(wh(),e),t(_h(),e)})(je)),je}var We={},Ot={},xt={},Rc;function qu(){if(Rc)return xt;Rc=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.getUniqueId=void 0;const e=4294967295;let r=Math.floor(Math.random()*e);function t(){return r=(r+1)%e,r}return xt.getUniqueId=t,xt}var Sc;function Eh(){if(Sc)return Ot;Sc=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.createIdRemapMiddleware=void 0;const e=qu();function r(){return(t,n,l,o)=>{const a=t.id,d=e.getUniqueId();t.id=d,n.id=d,l(c=>{t.id=a,n.id=a,c()})}}return Ot.createIdRemapMiddleware=r,Ot}var Bt={},kc;function Rh(){if(kc)return Bt;kc=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createAsyncMiddleware=void 0;function e(r){return async(t,n,l,o)=>{let a;const d=new Promise(s=>{a=s});let c=null,p=!1;const f=async()=>{p=!0,l(s=>{c=s,a()}),await d};try{await r(t,n,f),p?(await d,c(null)):o(null)}catch(s){c?c(s):o(s)}}}return Bt.createAsyncMiddleware=e,Bt}var Dt={},Cc;function Sh(){if(Cc)return Dt;Cc=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.createScaffoldMiddleware=void 0;function e(r){return(t,n,l,o)=>{const a=r[t.method];return a===void 0?l():typeof a=="function"?a(t,n,l,o):(n.result=a,o())}}return Dt.createScaffoldMiddleware=e,Dt}var Ve={},ar={},Ic;function kh(){if(Ic)return ar;Ic=1,Object.defineProperty(ar,"__esModule",{value:!0});const e=hr();function r(l,o,a){try{Reflect.apply(l,o,a)}catch(d){setTimeout(()=>{throw d})}}function t(l){const o=l.length,a=new Array(o);for(let d=0;d<o;d+=1)a[d]=l[d];return a}class n extends e.EventEmitter{emit(o,...a){let d=o==="error";const c=this._events;if(c!==void 0)d=d&&c.error===void 0;else if(!d)return!1;if(d){let f;if(a.length>0&&([f]=a),f instanceof Error)throw f;const s=new Error(`Unhandled error.${f?` (${f.message})`:""}`);throw s.context=f,s}const p=c[o];if(p===void 0)return!1;if(typeof p=="function")r(p,this,a);else{const f=p.length,s=t(p);for(let u=0;u<f;u+=1)r(s[u],this,a)}return!0}}return ar.default=n,ar}var Zi={},ze={},Ki,Ac;function Ch(){if(Ac)return Ki;Ac=1,Ki=o,o.default=o,o.stable=p,o.stableStringify=p;var e="[...]",r="[Circular]",t=[],n=[];function l(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(u,i,g,m){typeof m>"u"&&(m=l()),d(u,"",0,[],void 0,0,m);var b;try{n.length===0?b=JSON.stringify(u,i,g):b=JSON.stringify(u,s(i),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var h=t.pop();h.length===4?Object.defineProperty(h[0],h[1],h[3]):h[0][h[1]]=h[2]}}return b}function a(u,i,g,m){var b=Object.getOwnPropertyDescriptor(m,g);b.get!==void 0?b.configurable?(Object.defineProperty(m,g,{value:u}),t.push([m,g,i,b])):n.push([i,g,u]):(m[g]=u,t.push([m,g,i]))}function d(u,i,g,m,b,h,w){h+=1;var y;if(typeof u=="object"&&u!==null){for(y=0;y<m.length;y++)if(m[y]===u){a(r,u,i,b);return}if(typeof w.depthLimit<"u"&&h>w.depthLimit){a(e,u,i,b);return}if(typeof w.edgesLimit<"u"&&g+1>w.edgesLimit){a(e,u,i,b);return}if(m.push(u),Array.isArray(u))for(y=0;y<u.length;y++)d(u[y],y,y,m,u,h,w);else{var _=Object.keys(u);for(y=0;y<_.length;y++){var v=_[y];d(u[v],v,y,m,u,h,w)}}m.pop()}}function c(u,i){return u<i?-1:u>i?1:0}function p(u,i,g,m){typeof m>"u"&&(m=l());var b=f(u,"",0,[],void 0,0,m)||u,h;try{n.length===0?h=JSON.stringify(b,i,g):h=JSON.stringify(b,s(i),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var w=t.pop();w.length===4?Object.defineProperty(w[0],w[1],w[3]):w[0][w[1]]=w[2]}}return h}function f(u,i,g,m,b,h,w){h+=1;var y;if(typeof u=="object"&&u!==null){for(y=0;y<m.length;y++)if(m[y]===u){a(r,u,i,b);return}try{if(typeof u.toJSON=="function")return}catch{return}if(typeof w.depthLimit<"u"&&h>w.depthLimit){a(e,u,i,b);return}if(typeof w.edgesLimit<"u"&&g+1>w.edgesLimit){a(e,u,i,b);return}if(m.push(u),Array.isArray(u))for(y=0;y<u.length;y++)f(u[y],y,y,m,u,h,w);else{var _={},v=Object.keys(u).sort(c);for(y=0;y<v.length;y++){var k=v[y];f(u[k],k,y,m,u,h,w),_[k]=u[k]}if(typeof b<"u")t.push([b,i,u]),b[i]=_;else return _}m.pop()}}function s(u){return u=typeof u<"u"?u:function(i,g){return g},function(i,g){if(n.length>0)for(var m=0;m<n.length;m++){var b=n[m];if(b[1]===i&&b[0]===g){g=b[2],n.splice(m,1);break}}return u.call(this,i,g)}}return Ki}var Mc;function Ps(){if(Mc)return ze;Mc=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.EthereumProviderError=ze.EthereumRpcError=void 0;const e=Ch();class r extends Error{constructor(a,d,c){if(!Number.isInteger(a))throw new Error('"code" must be an integer.');if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string.');super(d),this.code=a,c!==void 0&&(this.data=c)}serialize(){const a={code:this.code,message:this.message};return this.data!==void 0&&(a.data=this.data),this.stack&&(a.stack=this.stack),a}toString(){return e.default(this.serialize(),l,2)}}ze.EthereumRpcError=r;class t extends r{constructor(a,d,c){if(!n(a))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(a,d,c)}}ze.EthereumProviderError=t;function n(o){return Number.isInteger(o)&&o>=1e3&&o<=4999}function l(o,a){if(a!=="[Circular]")return a}return ze}var Qi={},Je={},Lc;function Os(){return Lc||(Lc=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.errorValues=Je.errorCodes=void 0,Je.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},Je.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}),Je}var Tc;function ju(){return Tc||(Tc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=Os(),t=Ps(),n=r.errorCodes.rpc.internal,l="Unspecified error message. This is a bug, please report it.",o={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(u,i=l){if(Number.isInteger(u)){const g=u.toString();if(s(r.errorValues,g))return r.errorValues[g].message;if(p(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=a;function d(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(r.errorValues[i]||p(u))}e.isValidCode=d;function c(u,{fallbackError:i=o,shouldIncludeStack:g=!1}={}){var m,b;if(!i||!Number.isInteger(i.code)||typeof i.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(u instanceof t.EthereumRpcError)return u.serialize();const h={};if(u&&typeof u=="object"&&!Array.isArray(u)&&s(u,"code")&&d(u.code)){const y=u;h.code=y.code,y.message&&typeof y.message=="string"?(h.message=y.message,s(y,"data")&&(h.data=y.data)):(h.message=a(h.code),h.data={originalError:f(u)})}else{h.code=i.code;const y=(m=u)===null||m===void 0?void 0:m.message;h.message=y&&typeof y=="string"?y:i.message,h.data={originalError:f(u)}}const w=(b=u)===null||b===void 0?void 0:b.stack;return g&&u&&w&&typeof w=="string"&&(h.stack=w),h}e.serializeError=c;function p(u){return u>=-32099&&u<=-32e3}function f(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function s(u,i){return Object.prototype.hasOwnProperty.call(u,i)}})(Qi)),Qi}var qt={},Nc;function Ih(){if(Nc)return qt;Nc=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.ethErrors=void 0;const e=Ps(),r=ju(),t=Os();qt.ethErrors={rpc:{parse:a=>n(t.errorCodes.rpc.parse,a),invalidRequest:a=>n(t.errorCodes.rpc.invalidRequest,a),invalidParams:a=>n(t.errorCodes.rpc.invalidParams,a),methodNotFound:a=>n(t.errorCodes.rpc.methodNotFound,a),internal:a=>n(t.errorCodes.rpc.internal,a),server:a=>{if(!a||typeof a!="object"||Array.isArray(a))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:d}=a;if(!Number.isInteger(d)||d>-32005||d<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(d,a)},invalidInput:a=>n(t.errorCodes.rpc.invalidInput,a),resourceNotFound:a=>n(t.errorCodes.rpc.resourceNotFound,a),resourceUnavailable:a=>n(t.errorCodes.rpc.resourceUnavailable,a),transactionRejected:a=>n(t.errorCodes.rpc.transactionRejected,a),methodNotSupported:a=>n(t.errorCodes.rpc.methodNotSupported,a),limitExceeded:a=>n(t.errorCodes.rpc.limitExceeded,a)},provider:{userRejectedRequest:a=>l(t.errorCodes.provider.userRejectedRequest,a),unauthorized:a=>l(t.errorCodes.provider.unauthorized,a),unsupportedMethod:a=>l(t.errorCodes.provider.unsupportedMethod,a),disconnected:a=>l(t.errorCodes.provider.disconnected,a),chainDisconnected:a=>l(t.errorCodes.provider.chainDisconnected,a),custom:a=>{if(!a||typeof a!="object"||Array.isArray(a))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:d,message:c,data:p}=a;if(!c||typeof c!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(d,c,p)}}};function n(a,d){const[c,p]=o(d);return new e.EthereumRpcError(a,c||r.getMessageFromCode(a),p)}function l(a,d){const[c,p]=o(d);return new e.EthereumProviderError(a,c||r.getMessageFromCode(a),p)}function o(a){if(a){if(typeof a=="string")return[a];if(typeof a=="object"&&!Array.isArray(a)){const{message:d,data:c}=a;if(d&&typeof d!="string")throw new Error("Must specify string message.");return[d||void 0,c]}}return[]}return qt}var Pc;function Ah(){return Pc||(Pc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const r=Ps();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const t=ju();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=Ih();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const l=Os();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return l.errorCodes}})})(Zi)),Zi}var Oc;function Fu(){if(Oc)return Ve;Oc=1;var e=Ve&&Ve.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.JsonRpcEngine=void 0;const r=e(kh()),t=Ah();let n=class ke extends r.default{constructor(){super(),this._middleware=[]}push(a){this._middleware.push(a)}handle(a,d){if(d&&typeof d!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(a)?d?this._handleBatch(a,d):this._handleBatch(a):d?this._handle(a,d):this._promiseHandle(a)}asMiddleware(){return async(a,d,c,p)=>{try{const[f,s,u]=await ke._runAllMiddleware(a,d,this._middleware);return s?(await ke._runReturnHandlers(u),p(f)):c(async i=>{try{await ke._runReturnHandlers(u)}catch(g){return i(g)}return i()})}catch(f){return p(f)}}}async _handleBatch(a,d){try{const c=await Promise.all(a.map(this._promiseHandle.bind(this)));return d?d(null,c):c}catch(c){if(d)return d(c);throw c}}_promiseHandle(a){return new Promise(d=>{this._handle(a,(c,p)=>{d(p)})})}async _handle(a,d){if(!a||Array.isArray(a)||typeof a!="object"){const s=new t.EthereumRpcError(t.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof a}`,{request:a});return d(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof a.method!="string"){const s=new t.EthereumRpcError(t.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof a.method}`,{request:a});return d(s,{id:a.id,jsonrpc:"2.0",error:s})}const c=Object.assign({},a),p={id:c.id,jsonrpc:c.jsonrpc};let f=null;try{await this._processRequest(c,p)}catch(s){f=s}return f&&(delete p.result,p.error||(p.error=t.serializeError(f))),d(f,p)}async _processRequest(a,d){const[c,p,f]=await ke._runAllMiddleware(a,d,this._middleware);if(ke._checkForCompletion(a,d,p),await ke._runReturnHandlers(f),c)throw c}static async _runAllMiddleware(a,d,c){const p=[];let f=null,s=!1;for(const u of c)if([f,s]=await ke._runMiddleware(a,d,u,p),s)break;return[f,s,p.reverse()]}static _runMiddleware(a,d,c,p){return new Promise(f=>{const s=i=>{const g=i||d.error;g&&(d.error=t.serializeError(g)),f([g,!0])},u=i=>{d.error?s(d.error):(i&&(typeof i!="function"&&s(new t.EthereumRpcError(t.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof i}" for request:
|
|
5
5
|
${l(a)}`,{request:a})),p.push(i)),f([null,!1]))};try{c(a,d,u,s)}catch(i){s(i)}})}static async _runReturnHandlers(a){for(const d of a)await new Promise((c,p)=>{d(f=>f?p(f):c())})}static _checkForCompletion(a,d,c){if(!("result"in d)&&!("error"in d))throw new t.EthereumRpcError(t.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
6
6
|
${l(a)}`,{request:a});if(!c)throw new t.EthereumRpcError(t.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
7
7
|
${l(a)}`,{request:a})}};Ve.JsonRpcEngine=n;function l(o){return JSON.stringify(o,null,2)}return Ve}var jt={},xc;function Mh(){if(xc)return jt;xc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.mergeMiddleware=void 0;const e=Fu();function r(t){const n=new e.JsonRpcEngine;return t.forEach(l=>n.push(l)),n.asMiddleware()}return jt.mergeMiddleware=r,jt}var Bc;function $u(){return Bc||(Bc=1,(function(e){var r=We&&We.__createBinding||(Object.create?(function(n,l,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return l[o]}})}):(function(n,l,o,a){a===void 0&&(a=o),n[a]=l[o]})),t=We&&We.__exportStar||function(n,l){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(l,o)&&r(l,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),t(Eh(),e),t(Rh(),e),t(Sh(),e),t(qu(),e),t(Fu(),e),t(Mh(),e)})(We)),We}var Yi={},cr={};const xs=Ht(Xu);var ur={},Dc;function Hu(){if(Dc)return ur;Dc=1,Object.defineProperty(ur,"__esModule",{value:!0});var e=xs,r=(function(){function t(n){if(this._maxConcurrency=n,this._queue=[],n<=0)throw new Error("semaphore must be initialized to a positive value");this._value=n}return t.prototype.acquire=function(){var n=this,l=this.isLocked(),o=new Promise(function(a){return n._queue.push(a)});return l||this._dispatch(),o},t.prototype.runExclusive=function(n){return e.__awaiter(this,void 0,void 0,function(){var l,o,a;return e.__generator(this,function(d){switch(d.label){case 0:return[4,this.acquire()];case 1:l=d.sent(),o=l[0],a=l[1],d.label=2;case 2:return d.trys.push([2,,4,5]),[4,n(o)];case 3:return[2,d.sent()];case 4:return a(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var n=this._currentReleaser;this._currentReleaser=void 0,n()}},t.prototype._dispatch=function(){var n=this,l=this._queue.shift();if(l){var o=!1;this._currentReleaser=function(){o||(o=!0,n._value++,n._dispatch())},l([this._value--,this._currentReleaser])}},t})();return ur.default=r,ur}var qc;function Lh(){if(qc)return cr;qc=1,Object.defineProperty(cr,"__esModule",{value:!0});var e=xs,r=Hu(),t=(function(){function n(){this._semaphore=new r.default(1)}return n.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){var l,o;return e.__generator(this,function(a){switch(a.label){case 0:return[4,this._semaphore.acquire()];case 1:return l=a.sent(),o=l[1],[2,o]}})})},n.prototype.runExclusive=function(l){return this._semaphore.runExclusive(function(){return l()})},n.prototype.isLocked=function(){return this._semaphore.isLocked()},n.prototype.release=function(){this._semaphore.release()},n})();return cr.default=t,cr}var Ft={},jc;function Th(){if(jc)return Ft;jc=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.withTimeout=void 0;var e=xs;function r(t,n,l){var o=this;return l===void 0&&(l=new Error("timeout")),{acquire:function(){return new Promise(function(a,d){return e.__awaiter(o,void 0,void 0,function(){var c,p,f;return e.__generator(this,function(s){switch(s.label){case 0:return c=!1,setTimeout(function(){c=!0,d(l)},n),[4,t.acquire()];case 1:return p=s.sent(),c?(f=Array.isArray(p)?p[1]:p,f()):a(p),[2]}})})})},runExclusive:function(a){return e.__awaiter(this,void 0,void 0,function(){var d,c;return e.__generator(this,function(p){switch(p.label){case 0:d=function(){},p.label=1;case 1:return p.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=p.sent(),Array.isArray(c)?(d=c[1],[4,a(c[0])]):[3,4];case 3:return[2,p.sent()];case 4:return d=c,[4,a()];case 5:return[2,p.sent()];case 6:return[3,8];case 7:return d(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}return Ft.withTimeout=r,Ft}var Fc;function Nh(){return Fc||(Fc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var r=Lh();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return r.default}});var t=Hu();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return t.default}});var n=Th();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Yi)),Yi}var Xi,$c;function Ph(){if($c)return Xi;$c=1,Xi=r;var e=Object.prototype.hasOwnProperty;function r(){for(var t={},n=0;n<arguments.length;n++){var l=arguments[n];for(var o in l)e.call(l,o)&&(t[o]=l[o])}return t}return Xi}var es,Hc;function Oh(){if(Hc)return es;Hc=1;const e=Ph(),r=vs()();es=t;function t(a){const d=this;d.currentProvider=a}t.prototype.getBalance=l(2,"eth_getBalance"),t.prototype.getCode=l(2,"eth_getCode"),t.prototype.getTransactionCount=l(2,"eth_getTransactionCount"),t.prototype.getStorageAt=l(3,"eth_getStorageAt"),t.prototype.call=l(2,"eth_call"),t.prototype.protocolVersion=n("eth_protocolVersion"),t.prototype.syncing=n("eth_syncing"),t.prototype.coinbase=n("eth_coinbase"),t.prototype.mining=n("eth_mining"),t.prototype.hashrate=n("eth_hashrate"),t.prototype.gasPrice=n("eth_gasPrice"),t.prototype.accounts=n("eth_accounts"),t.prototype.blockNumber=n("eth_blockNumber"),t.prototype.getBlockTransactionCountByHash=n("eth_getBlockTransactionCountByHash"),t.prototype.getBlockTransactionCountByNumber=n("eth_getBlockTransactionCountByNumber"),t.prototype.getUncleCountByBlockHash=n("eth_getUncleCountByBlockHash"),t.prototype.getUncleCountByBlockNumber=n("eth_getUncleCountByBlockNumber"),t.prototype.sign=n("eth_sign"),t.prototype.sendTransaction=n("eth_sendTransaction"),t.prototype.sendRawTransaction=n("eth_sendRawTransaction"),t.prototype.estimateGas=n("eth_estimateGas"),t.prototype.getBlockByHash=n("eth_getBlockByHash"),t.prototype.getBlockByNumber=n("eth_getBlockByNumber"),t.prototype.getTransactionByHash=n("eth_getTransactionByHash"),t.prototype.getTransactionByBlockHashAndIndex=n("eth_getTransactionByBlockHashAndIndex"),t.prototype.getTransactionByBlockNumberAndIndex=n("eth_getTransactionByBlockNumberAndIndex"),t.prototype.getTransactionReceipt=n("eth_getTransactionReceipt"),t.prototype.getUncleByBlockHashAndIndex=n("eth_getUncleByBlockHashAndIndex"),t.prototype.getUncleByBlockNumberAndIndex=n("eth_getUncleByBlockNumberAndIndex"),t.prototype.getCompilers=n("eth_getCompilers"),t.prototype.compileLLL=n("eth_compileLLL"),t.prototype.compileSolidity=n("eth_compileSolidity"),t.prototype.compileSerpent=n("eth_compileSerpent"),t.prototype.newFilter=n("eth_newFilter"),t.prototype.newBlockFilter=n("eth_newBlockFilter"),t.prototype.newPendingTransactionFilter=n("eth_newPendingTransactionFilter"),t.prototype.uninstallFilter=n("eth_uninstallFilter"),t.prototype.getFilterChanges=n("eth_getFilterChanges"),t.prototype.getFilterLogs=n("eth_getFilterLogs"),t.prototype.getLogs=n("eth_getLogs"),t.prototype.getWork=n("eth_getWork"),t.prototype.submitWork=n("eth_submitWork"),t.prototype.submitHashrate=n("eth_submitHashrate"),t.prototype.sendAsync=function(a,d){this.currentProvider.sendAsync(o(a),function(p,f){if(!p&&f.error&&(p=new Error("EthQuery - RPC Error - "+f.error.message)),p)return d(p);d(null,f.result)})};function n(a){return function(){const d=this;var c=[].slice.call(arguments),p=c.pop();d.sendAsync({method:a,params:c},p)}}function l(a,d){return function(){const c=this;var p=[].slice.call(arguments),f=p.pop();p.length<a&&p.push("latest"),c.sendAsync({method:d,params:p},f)}}function o(a){return e({id:r(),jsonrpc:"2.0",params:[]},a)}return es}var ts,Uc;function xh(){if(Uc)return ts;Uc=1;const e=(t,n,l,o)=>function(...a){const d=n.promiseModule;return new d((c,p)=>{n.multiArgs?a.push((...s)=>{n.errorFirst?s[0]?p(s):(s.shift(),c(s)):c(s)}):n.errorFirst?a.push((s,u)=>{s?p(s):c(u)}):a.push(c),Reflect.apply(t,this===l?o:this,a)})},r=new WeakMap;return ts=(t,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};const l=typeof t;if(!(t!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":l}\``);const o=(c,p)=>{let f=r.get(c);if(f||(f={},r.set(c,f)),p in f)return f[p];const s=b=>typeof b=="string"||typeof p=="symbol"?p===b:b.test(p),u=Reflect.getOwnPropertyDescriptor(c,p),i=u===void 0||u.writable||u.configurable,m=(n.include?n.include.some(s):!n.exclude.some(s))&&i;return f[p]=m,m},a=new WeakMap,d=new Proxy(t,{apply(c,p,f){const s=a.get(c);if(s)return Reflect.apply(s,p,f);const u=n.excludeMain?c:e(c,n,d,c);return a.set(c,u),Reflect.apply(u,p,f)},get(c,p){const f=c[p];if(!o(c,p)||f===Function.prototype[p])return f;const s=a.get(f);if(s)return s;if(typeof f=="function"){const u=e(f,n,d,c);return a.set(f,u),u}return f}});return d},ts}var rs,Wc;function Bs(){if(Wc)return rs;Wc=1;const e=Es().default;class r extends e{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(n){this.updates=this.updates.concat(n),n.forEach(l=>this.emit("update",l))}addInitialResults(n){}getChangesAndClear(){const n=this.updates;return this.updates=[],n}}return rs=r,rs}var ns,Vc;function Bh(){if(Vc)return ns;Vc=1;const e=Bs();class r extends e{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(n){this.allResults=this.allResults.concat(n),super.addResults(n)}addInitialResults(n){this.allResults=this.allResults.concat(n),super.addInitialResults(n)}getAllResults(){return this.allResults}}return ns=r,ns}var is,zc;function Zt(){if(zc)return is;zc=1,is={minBlockRef:e,maxBlockRef:r,sortBlockRefs:t,bnToHex:n,blockRefIsNumber:l,hexToInt:o,incrementHexInt:a,intToHex:d,unsafeRandomBytes:c};function e(...f){return t(f)[0]}function r(...f){const s=t(f);return s[s.length-1]}function t(f){return f.sort((s,u)=>s==="latest"||u==="earliest"?1:u==="latest"||s==="earliest"?-1:o(s)-o(u))}function n(f){return"0x"+f.toString(16)}function l(f){return f&&!["earliest","latest","pending"].includes(f)}function o(f){return f==null?f:Number.parseInt(f,16)}function a(f){if(f==null)return f;const s=o(f);return d(s+1)}function d(f){if(f==null)return f;let s=f.toString(16);return s.length%2&&(s="0"+s),"0x"+s}function c(f){let s="0x";for(let u=0;u<f;u++)s+=p(),s+=p();return s}function p(){return Math.floor(Math.random()*16).toString(16)}return is}var ss,Jc;function Dh(){if(Jc)return ss;Jc=1;const e=Oh(),r=xh(),t=Bh(),{bnToHex:n,hexToInt:l,incrementHexInt:o,minBlockRef:a,blockRefIsNumber:d}=Zt();class c extends t{constructor({provider:f,params:s}){super(),this.type="log",this.ethQuery=new e(f),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},s),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(u=>u.toLowerCase()))}async initialize({currentBlock:f}){let s=this.params.fromBlock;["latest","pending"].includes(s)&&(s=f),s==="earliest"&&(s="0x0"),this.params.fromBlock=s;const u=a(this.params.toBlock,f),i=Object.assign({},this.params,{toBlock:u}),g=await this._fetchLogs(i);this.addInitialResults(g)}async update({oldBlock:f,newBlock:s}){const u=s;let i;f?i=o(f):i=s;const g=Object.assign({},this.params,{fromBlock:i,toBlock:u}),b=(await this._fetchLogs(g)).filter(h=>this.matchLog(h));this.addResults(b)}async _fetchLogs(f){return await r(u=>this.ethQuery.getLogs(f,u))()}matchLog(f){if(l(this.params.fromBlock)>=l(f.blockNumber)||d(this.params.toBlock)&&l(this.params.toBlock)<=l(f.blockNumber))return!1;const s=f.address&&f.address.toLowerCase();return this.params.address&&s&&!this.params.address.includes(s)?!1:this.params.topics.every((i,g)=>{let m=f.topics[g];if(!m)return!1;m=m.toLowerCase();let b=Array.isArray(i)?i:[i];return b.includes(null)?!0:(b=b.map(y=>y.toLowerCase()),b.includes(m))})}}return ss=c,ss}var os,Gc;function Ds(){if(Gc)return os;Gc=1,os=e;async function e({provider:o,fromBlock:a,toBlock:d}){a||(a=d);const c=r(a),f=r(d)-c+1,s=Array(f).fill().map((i,g)=>c+g).map(t);let u=await Promise.all(s.map(i=>l(o,"eth_getBlockByNumber",[i,!1])));return u=u.filter(i=>i!==null),u}function r(o){return o==null?o:Number.parseInt(o,16)}function t(o){return o==null?o:"0x"+o.toString(16)}function n(o,a){return new Promise((d,c)=>{o.sendAsync(a,(p,f)=>{p?c(p):f.error?c(f.error):f.result?d(f.result):c(new Error("Result was empty"))})})}async function l(o,a,d){for(let c=0;c<3;c++)try{return await n(o,{id:1,jsonrpc:"2.0",method:a,params:d})}catch(p){console.error(`provider.sendAsync failed: ${p.stack||p.message||p}`)}return null}return os}var as,Zc;function qh(){if(Zc)return as;Zc=1;const e=Bs(),r=Ds(),{incrementHexInt:t}=Zt();class n extends e{constructor({provider:o,params:a}){super(),this.type="block",this.provider=o}async update({oldBlock:o,newBlock:a}){const d=a,c=t(o),f=(await r({provider:this.provider,fromBlock:c,toBlock:d})).map(s=>s.hash);this.addResults(f)}}return as=n,as}var cs,Kc;function jh(){if(Kc)return cs;Kc=1;const e=Bs(),r=Ds(),{incrementHexInt:t}=Zt();class n extends e{constructor({provider:o}){super(),this.type="tx",this.provider=o}async update({oldBlock:o}){const a=o,d=t(o),c=await r({provider:this.provider,fromBlock:d,toBlock:a}),p=[];for(const f of c)p.push(...f.transactions);this.addResults(p)}}return cs=n,cs}var us,Qc;function Fh(){if(Qc)return us;Qc=1;const e=Nh().Mutex,{createAsyncMiddleware:r,createScaffoldMiddleware:t}=$u(),n=Dh(),l=qh(),o=jh(),{intToHex:a,hexToInt:d}=Zt();us=c;function c({blockTracker:i,provider:g}){let m=0,b={};const h=new e,w=s({mutex:h}),y=t({eth_newFilter:w(p(v)),eth_newBlockFilter:w(p(k)),eth_newPendingTransactionFilter:w(p(S)),eth_uninstallFilter:w(f(D)),eth_getFilterChanges:w(f(I)),eth_getFilterLogs:w(f(P))}),_=async({oldBlock:J,newBlock:M})=>{if(b.length===0)return;const L=await h.acquire();try{await Promise.all(u(b).map(async T=>{try{await T.update({oldBlock:J,newBlock:M})}catch(x){console.error(x)}}))}catch(T){console.error(T)}L()};return y.newLogFilter=v,y.newBlockFilter=k,y.newPendingTransactionFilter=S,y.uninstallFilter=D,y.getFilterChanges=I,y.getFilterLogs=P,y.destroy=()=>{X()},y;async function v(J){const M=new n({provider:g,params:J});return await $(M),M}async function k(){const J=new l({provider:g});return await $(J),J}async function S(){const J=new o({provider:g});return await $(J),J}async function I(J){const M=d(J),L=b[M];if(!L)throw new Error(`No filter for index "${M}"`);return L.getChangesAndClear()}async function P(J){const M=d(J),L=b[M];if(!L)throw new Error(`No filter for index "${M}"`);let T=[];return L.type==="log"&&(T=L.getAllResults()),T}async function D(J){const M=d(J),T=!!b[M];return T&&await z(M),T}async function $(J){const M=u(b).length,L=await i.getLatestBlock();await J.initialize({currentBlock:L}),m++,b[m]=J,J.id=m,J.idHex=a(m);const T=u(b).length;return Y({prevFilterCount:M,newFilterCount:T}),m}async function z(J){const M=u(b).length;delete b[J];const L=u(b).length;Y({prevFilterCount:M,newFilterCount:L})}async function X(){const J=u(b).length;b={},Y({prevFilterCount:J,newFilterCount:0})}function Y({prevFilterCount:J,newFilterCount:M}){if(J===0&&M>0){i.on("sync",_);return}if(J>0&&M===0){i.removeListener("sync",_);return}}}function p(i){return f(async(...g)=>{const m=await i(...g);return a(m.id)})}function f(i){return r(async(g,m)=>{const b=await i.apply(null,g.params);m.result=b})}function s({mutex:i}){return g=>async(m,b,h,w)=>{(await i.acquire())(),g(m,b,h,w)}}function u(i,g){const m=[];for(let b in i)m.push(i[b]);return m}return us}var ls,Yc;function $h(){if(Yc)return ls;Yc=1;const e=Es().default,{createAsyncMiddleware:r,createScaffoldMiddleware:t}=$u(),n=Fh(),{unsafeRandomBytes:l,incrementHexInt:o}=Zt(),a=Ds();ls=d;function d({blockTracker:p,provider:f}){const s={},u=n({blockTracker:p,provider:f});let i=!1;const g=new e,m=t({eth_subscribe:r(b),eth_unsubscribe:r(h)});return m.destroy=y,{events:g,middleware:m};async function b(_,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=_.params[0],S=l(16);let I;switch(k){case"newHeads":I=P({subId:S});break;case"logs":const $=_.params[1],z=await u.newLogFilter($);I=D({subId:S,filter:z});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${k}"`)}s[S]=I,v.result=S;return;function P({subId:$}){const z={type:k,destroy:async()=>{p.removeListener("sync",z.update)},update:async({oldBlock:X,newBlock:Y})=>{const J=Y,M=o(X);(await a({provider:f,fromBlock:M,toBlock:J})).map(c).filter(x=>x!==null).forEach(x=>{w($,x)})}};return p.on("sync",z.update),z}function D({subId:$,filter:z}){return z.on("update",Y=>w($,Y)),{type:k,destroy:async()=>await u.uninstallFilter(z.idHex)}}}async function h(_,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=_.params[0],S=s[k];if(!S){v.result=!1;return}delete s[k],await S.destroy(),v.result=!0}function w(_,v){g.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:_,result:v}})}function y(){g.removeAllListeners();for(const _ in s)s[_].destroy(),delete s[_];i=!0}}function c(p){return p==null?null:{hash:p.hash,parentHash:p.parentHash,sha3Uncles:p.sha3Uncles,miner:p.miner,stateRoot:p.stateRoot,transactionsRoot:p.transactionsRoot,receiptsRoot:p.receiptsRoot,logsBloom:p.logsBloom,difficulty:p.difficulty,number:p.number,gasLimit:p.gasLimit,gasUsed:p.gasUsed,nonce:p.nonce,mixHash:p.mixHash,timestamp:p.timestamp,extraData:p.extraData}}return ls}var Xc;function Hh(){if(Xc)return Tt;Xc=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.SubscriptionManager=void 0;const e=vh(),r=$h(),t=()=>{};let n=class{constructor(o){const a=new e.PollingBlockTracker({provider:o,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:d,middleware:c}=r({blockTracker:a,provider:o});this.events=d,this.subscriptionMiddleware=c}async handleRequest(o){const a={};return await this.subscriptionMiddleware(o,a,t,t),a}destroy(){this.subscriptionMiddleware.destroy()}};return Tt.SubscriptionManager=n,Tt}var eu;function hs(){if(eu)return Me;eu=1;var e=Me&&Me.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(Me,"__esModule",{value:!0}),Me.CoinbaseWalletProvider=void 0;const r=e(dr()),t=zu(),n=gr(),l=Re(),o=hu(),a=ys(),d=ws(),c=ps(),p=e(Wl()),f=bs(),s=Vl(),u=Hh(),i="DefaultChainId",g="DefaultJsonRpcUrl";let m=class extends t.EventEmitter{constructor(h){var w,y;super(),this._filterPolyfill=new s.FilterPolyfill(this),this._subscriptionManager=new u.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=h.chainId,this._jsonRpcUrlFromOpts=h.jsonRpcUrl,this._overrideIsMetaMask=h.overrideIsMetaMask,this._relayProvider=h.relayProvider,this._storage=h.storage,this._relayEventManager=h.relayEventManager,this.diagnostic=h.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(w=h.overrideIsCoinbaseWallet)!==null&&w!==void 0?w:!0,this.isCoinbaseBrowser=(y=h.overrideIsCoinbaseBrowser)!==null&&y!==void 0?y:!1,this.qrUrl=h.qrUrl;const _=this.getChainId(),v=(0,l.prepend0x)(_.toString(16));this.emit("connect",{chainIdStr:v});const k=this._storage.getItem(a.LOCAL_STORAGE_ADDRESSES_KEY);if(k){const S=k.split(" ");S[0]!==""&&(this._addresses=S.map(I=>(0,l.ensureAddressString)(I)),this.emit("accountsChanged",S))}this._subscriptionManager.events.on("notification",S=>{this.emit("message",{type:S.method,data:S.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",S=>{var I;if(!(S.origin!==location.origin||S.source!==window)&&S.data.type==="walletLinkMessage"&&S.data.data.action==="dappChainSwitched"){const P=S.data.data.chainId,D=(I=S.data.data.jsonRpcUrl)!==null&&I!==void 0?I:this.jsonRpcUrl;this.updateProviderInfo(D,Number(P))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,l.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var h;return(h=this._storage.getItem(g))!==null&&h!==void 0?h:this._jsonRpcUrlFromOpts}set jsonRpcUrl(h){this._storage.setItem(g,h)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(h,w){this.isCoinbaseBrowser||(this._chainIdFromOpts=w,this._jsonRpcUrlFromOpts=h),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(h,w){this.jsonRpcUrl=h;const y=this.getChainId();this._storage.setItem(i,w.toString(10)),((0,l.ensureIntNumber)(w)!==y||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(h,w,y,_,v,k){const I=await(await this.initializeRelay()).watchAsset(h,w,y,_,v,k==null?void 0:k.toString()).promise;return(0,c.isErrorResponse)(I)?!1:!!I.result}async addEthereumChain(h,w,y,_,v,k){var S,I;if((0,l.ensureIntNumber)(h)===this.getChainId())return!1;const P=await this.initializeRelay(),D=P.inlineAddEthereumChain(h.toString());!this._isAuthorized()&&!D&&await P.requestEthereumAccounts().promise;const $=await P.addEthereumChain(h.toString(),w,v,y,_,k).promise;return(0,c.isErrorResponse)($)?!1:(((S=$.result)===null||S===void 0?void 0:S.isApproved)===!0&&this.updateProviderInfo(w[0],h),((I=$.result)===null||I===void 0?void 0:I.isApproved)===!0)}async switchEthereumChain(h){const y=await(await this.initializeRelay()).switchEthereumChain(h.toString(10),this.selectedAddress||void 0).promise;if((0,c.isErrorResponse)(y)){if(!y.errorCode)return;throw y.errorCode===n.standardErrorCodes.provider.unsupportedChain?n.standardErrors.provider.unsupportedChain():n.standardErrors.provider.custom({message:y.errorMessage,code:y.errorCode})}const _=y.result;_.isApproved&&_.rpcUrl.length>0&&this.updateProviderInfo(_.rpcUrl,h)}setAppInfo(h,w){this.initializeRelay().then(y=>y.setAppInfo(h,w))}async enable(){var h;return(h=this.diagnostic)===null||h===void 0||h.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(h,w){try{const y=this._send(h,w);if(y instanceof Promise)return y.catch(_=>{throw(0,n.serializeError)(_,h)})}catch(y){throw(0,n.serializeError)(y,h)}}_send(h,w){if(typeof h=="string"){const _=h,v=Array.isArray(w)?w:w!==void 0?[w]:[],k={jsonrpc:"2.0",id:0,method:_,params:v};return this._sendRequestAsync(k).then(S=>S.result)}if(typeof w=="function"){const _=h,v=w;return this._sendAsync(_,v)}if(Array.isArray(h))return h.map(v=>this._sendRequest(v));const y=h;return this._sendRequest(y)}async sendAsync(h,w){try{return this._sendAsync(h,w).catch(y=>{throw(0,n.serializeError)(y,h)})}catch(y){return Promise.reject((0,n.serializeError)(y,h))}}async _sendAsync(h,w){if(typeof w!="function")throw new Error("callback is required");if(Array.isArray(h)){const _=w;this._sendMultipleRequestsAsync(h).then(v=>_(null,v)).catch(v=>_(v,null));return}const y=w;return this._sendRequestAsync(h).then(_=>y(null,_)).catch(_=>y(_,null))}async request(h){try{return this._request(h).catch(w=>{throw(0,n.serializeError)(w,h.method)})}catch(w){return Promise.reject((0,n.serializeError)(w,h.method))}}async _request(h){if(!h||typeof h!="object"||Array.isArray(h))throw n.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:h});const{method:w,params:y}=h;if(typeof w!="string"||w.length===0)throw n.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:h});if(y!==void 0&&!Array.isArray(y)&&(typeof y!="object"||y===null))throw n.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:h});const _=y===void 0?[]:y,v=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:w,params:_,jsonrpc:"2.0",id:v})).result}async scanQRCode(h){const y=await(await this.initializeRelay()).scanQRCode((0,l.ensureRegExpString)(h)).promise;if((0,c.isErrorResponse)(y))throw(0,n.serializeError)(y.errorMessage,"scanQRCode");if(typeof y.result!="string")throw(0,n.serializeError)("result was not a string","scanQRCode");return y.result}async genericRequest(h,w){const _=await(await this.initializeRelay()).genericRequest(h,w).promise;if((0,c.isErrorResponse)(_))throw(0,n.serializeError)(_.errorMessage,"generic");if(typeof _.result!="string")throw(0,n.serializeError)("result was not a string","generic");return _.result}async connectAndSignIn(h){var w;(w=this.diagnostic)===null||w===void 0||w.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0});let y;try{const v=await this.initializeRelay();if(!(v instanceof o.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(y=await v.connectAndSignIn(h).promise,(0,c.isErrorResponse)(y))throw new Error(y.errorMessage)}catch(v){throw typeof v.message=="string"&&v.message.match(/(denied|rejected)/i)?n.standardErrors.provider.userRejectedRequest("User denied account authorization"):v}if(!y.result)throw new Error("accounts received is empty");const{accounts:_}=y.result;return this._setAddresses(_),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),y.result}async selectProvider(h){const y=await(await this.initializeRelay()).selectProvider(h).promise;if((0,c.isErrorResponse)(y))throw(0,n.serializeError)(y.errorMessage,"selectProvider");if(typeof y.result!="string")throw(0,n.serializeError)("result was not a string","selectProvider");return y.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(h){const w={jsonrpc:"2.0",id:h.id},{method:y}=h;if(w.result=this._handleSynchronousMethods(h),w.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${y} synchronously without a callback. Please provide a callback parameter to call ${y} asynchronously.`);return w}_setAddresses(h,w){if(!Array.isArray(h))throw new Error("addresses is not an array");const y=h.map(_=>(0,l.ensureAddressString)(_));JSON.stringify(y)!==JSON.stringify(this._addresses)&&(this._addresses=y,this.emit("accountsChanged",this._addresses),this._storage.setItem(a.LOCAL_STORAGE_ADDRESSES_KEY,y.join(" ")))}_sendRequestAsync(h){return new Promise((w,y)=>{try{const _=this._handleSynchronousMethods(h);if(_!==void 0)return w({jsonrpc:"2.0",id:h.id,result:_});const v=this._handleAsynchronousFilterMethods(h);if(v!==void 0){v.then(S=>w(Object.assign(Object.assign({},S),{id:h.id}))).catch(S=>y(S));return}const k=this._handleSubscriptionMethods(h);if(k!==void 0){k.then(S=>w({jsonrpc:"2.0",id:h.id,result:S.result})).catch(S=>y(S));return}}catch(_){return y(_)}this._handleAsynchronousMethods(h).then(_=>_&&w(Object.assign(Object.assign({},_),{id:h.id}))).catch(_=>y(_))})}_sendMultipleRequestsAsync(h){return Promise.all(h.map(w=>this._sendRequestAsync(w)))}_handleSynchronousMethods(h){const{method:w}=h,y=h.params||[];switch(w){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(y);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(h){const{method:w}=h,y=h.params||[];switch(w){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(y);case"eth_ecRecover":return this._eth_ecRecover(y);case"personal_sign":return this._personal_sign(y);case"personal_ecRecover":return this._personal_ecRecover(y);case"eth_signTransaction":return this._eth_signTransaction(y);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(y);case"eth_sendTransaction":return this._eth_sendTransaction(y);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(y);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(y);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(y);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(y);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(y);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(y);case"wallet_watchAsset":return this._wallet_watchAsset(y)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(h,this.jsonRpcUrl).catch(v=>{var k;throw(v.code===n.standardErrorCodes.rpc.methodNotFound||v.code===n.standardErrorCodes.rpc.methodNotSupported)&&((k=this.diagnostic)===null||k===void 0||k.log(f.EVENTS.METHOD_NOT_IMPLEMENTED,{method:h.method,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0})),v})}_handleAsynchronousFilterMethods(h){const{method:w}=h,y=h.params||[];switch(w){case"eth_newFilter":return this._eth_newFilter(y);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(y);case"eth_getFilterLogs":return this._eth_getFilterLogs(y)}}_handleSubscriptionMethods(h){switch(h.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(h)}}_isKnownAddress(h){try{const w=(0,l.ensureAddressString)(h);return this._addresses.map(_=>(0,l.ensureAddressString)(_)).includes(w)}catch{}return!1}_ensureKnownAddress(h){var w;if(!this._isKnownAddress(h))throw(w=this.diagnostic)===null||w===void 0||w.log(f.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(h){const w=h.from?(0,l.ensureAddressString)(h.from):this.selectedAddress;if(!w)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(w);const y=h.to?(0,l.ensureAddressString)(h.to):null,_=h.value!=null?(0,l.ensureBN)(h.value):new r.default(0),v=h.data?(0,l.ensureBuffer)(h.data):K.alloc(0),k=h.nonce!=null?(0,l.ensureIntNumber)(h.nonce):null,S=h.gasPrice!=null?(0,l.ensureBN)(h.gasPrice):null,I=h.maxFeePerGas!=null?(0,l.ensureBN)(h.maxFeePerGas):null,P=h.maxPriorityFeePerGas!=null?(0,l.ensureBN)(h.maxPriorityFeePerGas):null,D=h.gas!=null?(0,l.ensureBN)(h.gas):null,$=h.chainId?(0,l.ensureIntNumber)(h.chainId):this.getChainId();return{fromAddress:w,toAddress:y,weiValue:_,data:v,nonce:k,gasPriceInWei:S,maxFeePerGas:I,maxPriorityFeePerGas:P,gasLimit:D,chainId:$}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw n.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw n.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(h,w,y,_){this._ensureKnownAddress(w);try{const k=await(await this.initializeRelay()).signEthereumMessage(h,w,y,_).promise;if((0,c.isErrorResponse)(k))throw new Error(k.errorMessage);return{jsonrpc:"2.0",id:0,result:k.result}}catch(v){throw typeof v.message=="string"&&v.message.match(/(denied|rejected)/i)?n.standardErrors.provider.userRejectedRequest("User denied message signature"):v}}async _ethereumAddressFromSignedMessage(h,w,y){const v=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(h,w,y).promise;if((0,c.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,l.hexStringFromIntNumber)(this.getChainId())}getChainId(){const h=this._storage.getItem(i);if(!h)return(0,l.ensureIntNumber)(this._chainIdFromOpts);const w=parseInt(h,10);return(0,l.ensureIntNumber)(w)}async _eth_requestAccounts(){var h;if((h=this.diagnostic)===null||h===void 0||h.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let w;try{if(w=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,c.isErrorResponse)(w))throw new Error(w.errorMessage)}catch(y){throw typeof y.message=="string"&&y.message.match(/(denied|rejected)/i)?n.standardErrors.provider.userRejectedRequest("User denied account authorization"):y}if(!w.result)throw new Error("accounts received is empty");return this._setAddresses(w.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(h){this._requireAuthorization();const w=(0,l.ensureAddressString)(h[0]),y=(0,l.ensureBuffer)(h[1]);return this._signEthereumMessage(y,w,!1)}_eth_ecRecover(h){const w=(0,l.ensureBuffer)(h[0]),y=(0,l.ensureBuffer)(h[1]);return this._ethereumAddressFromSignedMessage(w,y,!1)}_personal_sign(h){this._requireAuthorization();const w=(0,l.ensureBuffer)(h[0]),y=(0,l.ensureAddressString)(h[1]);return this._signEthereumMessage(w,y,!0)}_personal_ecRecover(h){const w=(0,l.ensureBuffer)(h[0]),y=(0,l.ensureBuffer)(h[1]);return this._ethereumAddressFromSignedMessage(w,y,!0)}async _eth_signTransaction(h){this._requireAuthorization();const w=this._prepareTransactionParams(h[0]||{});try{const _=await(await this.initializeRelay()).signEthereumTransaction(w).promise;if((0,c.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}catch(y){throw typeof y.message=="string"&&y.message.match(/(denied|rejected)/i)?n.standardErrors.provider.userRejectedRequest("User denied transaction signature"):y}}async _eth_sendRawTransaction(h){const w=(0,l.ensureBuffer)(h[0]),_=await(await this.initializeRelay()).submitEthereumTransaction(w,this.getChainId()).promise;if((0,c.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}async _eth_sendTransaction(h){this._requireAuthorization();const w=this._prepareTransactionParams(h[0]||{});try{const _=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(w).promise;if((0,c.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}catch(y){throw typeof y.message=="string"&&y.message.match(/(denied|rejected)/i)?n.standardErrors.provider.userRejectedRequest("User denied transaction signature"):y}}async _eth_signTypedData_v1(h){this._requireAuthorization();const w=(0,l.ensureParsedJSONObject)(h[0]),y=(0,l.ensureAddressString)(h[1]);this._ensureKnownAddress(y);const _=p.default.hashForSignTypedDataLegacy({data:w}),v=JSON.stringify(w,null,2);return this._signEthereumMessage(_,y,!1,v)}async _eth_signTypedData_v3(h){this._requireAuthorization();const w=(0,l.ensureAddressString)(h[0]),y=(0,l.ensureParsedJSONObject)(h[1]);this._ensureKnownAddress(w);const _=p.default.hashForSignTypedData_v3({data:y}),v=JSON.stringify(y,null,2);return this._signEthereumMessage(_,w,!1,v)}async _eth_signTypedData_v4(h){this._requireAuthorization();const w=(0,l.ensureAddressString)(h[0]),y=(0,l.ensureParsedJSONObject)(h[1]);this._ensureKnownAddress(w);const _=p.default.hashForSignTypedData_v4({data:y}),v=JSON.stringify(y,null,2);return this._signEthereumMessage(_,w,!1,v)}async _cbwallet_arbitrary(h){const w=h[0],y=h[1];if(typeof y!="string")throw new Error("parameter must be a string");if(typeof w!="object"||w===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(w,y)}}async _wallet_addEthereumChain(h){var w,y,_,v;const k=h[0];if(((w=k.rpcUrls)===null||w===void 0?void 0:w.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!k.chainName||k.chainName.trim()==="")throw n.standardErrors.rpc.invalidParams("chainName is a required field");if(!k.nativeCurrency)throw n.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const S=parseInt(k.chainId,16);return await this.addEthereumChain(S,(y=k.rpcUrls)!==null&&y!==void 0?y:[],(_=k.blockExplorerUrls)!==null&&_!==void 0?_:[],k.chainName,(v=k.iconUrls)!==null&&v!==void 0?v:[],k.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(h){const w=h[0];return await this.switchEthereumChain(parseInt(w.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(h){const w=Array.isArray(h)?h[0]:h;if(!w.type)throw n.standardErrors.rpc.invalidParams("Type is required");if((w==null?void 0:w.type)!=="ERC20")throw n.standardErrors.rpc.invalidParams(`Asset of type '${w.type}' is not supported`);if(!(w!=null&&w.options))throw n.standardErrors.rpc.invalidParams("Options are required");if(!(w!=null&&w.options.address))throw n.standardErrors.rpc.invalidParams("Address is required");const y=this.getChainId(),{address:_,symbol:v,image:k,decimals:S}=w.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(w.type,_,v,S,k,y)}}_eth_uninstallFilter(h){const w=(0,l.ensureHexString)(h[0]);return this._filterPolyfill.uninstallFilter(w)}async _eth_newFilter(h){const w=h[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(w)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(h){const w=(0,l.ensureHexString)(h[0]);return this._filterPolyfill.getFilterChanges(w)}_eth_getFilterLogs(h){const w=(0,l.ensureHexString)(h[0]);return this._filterPolyfill.getFilterLogs(w)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(h=>(h.setAccountsCallback((w,y)=>this._setAddresses(w,y)),h.setChainCallback((w,y)=>{this.updateProviderInfo(y,parseInt(w,10))}),h.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=h,h))}};return Me.CoinbaseWalletProvider=m,Me}var $t={},tu;function Uh(){if(tu)return $t;tu=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.RelayEventManager=void 0;const e=Re();let r=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const n=this._nextRequestId,l=(0,e.prepend0x)(n.toString(16));return this.callbacks.get(l)&&this.callbacks.delete(l),n}};return $t.RelayEventManager=r,$t}var ru;function nu(){if(ru)return ot;ru=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.CoinbaseWalletSDK=void 0;const e=tl(),r=rl(),t=Re(),n=sl(),l=hs(),o=hu(),a=du(),d=Uh(),c=uu(),p=lu(),f=ms();let s=class Uu{constructor(i){var g,m,b;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const h=i.linkAPIUrl||r.LINK_API_URL;typeof i.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=i.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(g=i.overrideIsCoinbaseWallet)!==null&&g!==void 0?g:!0,this._overrideIsCoinbaseBrowser=(m=i.overrideIsCoinbaseBrowser)!==null&&m!==void 0?m:!1,this._diagnosticLogger=i.diagnosticLogger,this._reloadOnDisconnect=(b=i.reloadOnDisconnect)!==null&&b!==void 0?b:!0;const w=new URL(h),y=`${w.protocol}//${w.host}`;if(this._storage=new n.ScopedLocalStorage(`-walletlink:${y}`),this._storage.setItem("version",Uu.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new d.RelayEventManager;const _=(0,t.isMobileWeb)(),v=i.uiConstructor||(S=>_?new a.MobileRelayUI(S):new c.WalletLinkRelayUI(S)),k={linkAPIUrl:h,version:f.LIB_VERSION,darkMode:!!i.darkMode,headlessMode:!!i.headlessMode,uiConstructor:v,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:i.enableMobileWalletLink};this._relay=_?new o.MobileRelay(k):new p.WalletLinkRelay(k),this.setAppInfo(i.appName,i.appLogoUrl),!i.headlessMode&&this._relay.attachUI()}makeWeb3Provider(i="",g=1){const m=this.walletExtension;if(m)return this.isCipherProvider(m)||m.setProviderInfo(i,g),this._reloadOnDisconnect===!1&&typeof m.disableReloadOnDisconnect=="function"&&m.disableReloadOnDisconnect(),m;const b=this.coinbaseBrowser;if(b)return b;const h=this._relay;if(!h||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return i||h.setConnectDisabled(!0),new l.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(h),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:i,chainId:g,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(i,g){var m;this._appName=i||"DApp",this._appLogoUrl=g||(0,t.getFavicon)();const b=this.walletExtension;b?this.isCipherProvider(b)||b.setAppInfo(this._appName,this._appLogoUrl):(m=this._relay)===null||m===void 0||m.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var i;const g=this===null||this===void 0?void 0:this.walletExtension;g?g.close():(i=this._relay)===null||i===void 0||i.resetAndReload()}getQrUrl(){var i,g;return(g=(i=this._relay)===null||i===void 0?void 0:i.getQRCodeUrl())!==null&&g!==void 0?g:null}getCoinbaseWalletLogo(i,g=240){return(0,e.walletLogo)(i,g)}get walletExtension(){var i;return(i=window.coinbaseWalletExtension)!==null&&i!==void 0?i:window.walletLinkExtension}get coinbaseBrowser(){var i,g;try{const m=(i=window.ethereum)!==null&&i!==void 0?i:(g=window.top)===null||g===void 0?void 0:g.ethereum;return m&&"isCoinbaseBrowser"in m&&m.isCoinbaseBrowser?m:void 0}catch{return}}isCipherProvider(i){return typeof i.isCipher=="boolean"&&i.isCipher}};return ot.CoinbaseWalletSDK=s,s.VERSION=f.LIB_VERSION,ot}var iu;function Wh(){return iu||(iu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const r=nu(),t=hs();var n=nu();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var l=hs();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return l.CoinbaseWalletProvider}}),e.default=r.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=t.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=t.CoinbaseWalletProvider)})(wn)),wn}var Wu=Wh();const Vh=Vu(Wu),vf=el({__proto__:null,default:Vh},[Wu]);export{vf as i};
|
|
8
|
-
//# sourceMappingURL=index-
|
|
8
|
+
//# sourceMappingURL=index-CyJXEo_c.js.map
|