@dcl/landing-site 0.5.1-24686484792.commit-e56f2bf → 0.5.1-24692282370.commit-1a6e5c1
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/{AnimatedBackground-BbbuCmrW.js → AnimatedBackground-DVpktqVp.js} +2 -2
- package/assets/{AnimatedBackground-BbbuCmrW.js.map → AnimatedBackground-DVpktqVp.js.map} +1 -1
- package/assets/{AnimatedSection-CcAt5h6R.js → AnimatedSection-BLhE6NJp.js} +1 -1
- package/assets/{AnimatedSection-CcAt5h6R.js.map → AnimatedSection-BLhE6NJp.js.map} +1 -1
- package/assets/{ArrowBackIosNew-lqzUFZQL.js → ArrowBackIosNew-CCkNG9yi.js} +1 -1
- package/assets/{ArrowBackIosNew-lqzUFZQL.js.map → ArrowBackIosNew-CCkNG9yi.js.map} +1 -1
- package/assets/{AuthorPage-4inFQH2X.js → AuthorPage-D8_PRDI7.js} +1 -1
- package/assets/{AuthorPage-4inFQH2X.js.map → AuthorPage-D8_PRDI7.js.map} +1 -1
- package/assets/{Badges-DPcq_7dC.js → Badges-CoaVGqwO.js} +1 -1
- package/assets/{Badges-DPcq_7dC.js.map → Badges-CoaVGqwO.js.map} +1 -1
- package/assets/{BlogLayout-Bl9FID_L.js → BlogLayout-D9XGGawk.js} +1 -1
- package/assets/{BlogLayout-Bl9FID_L.js.map → BlogLayout-D9XGGawk.js.map} +1 -1
- package/assets/{BlogPage-4c8ZFzdw.js → BlogPage-CXKxWbag.js} +1 -1
- package/assets/{BlogPage-4c8ZFzdw.js.map → BlogPage-CXKxWbag.js.map} +1 -1
- package/assets/{CTAButton-D8_9d6Wu.js → CTAButton-BurlKFHL.js} +1 -1
- package/assets/{CTAButton-D8_9d6Wu.js.map → CTAButton-BurlKFHL.js.map} +1 -1
- package/assets/{CardContent-BQ0iSa2p.js → CardContent-BiDO6--E.js} +1 -1
- package/assets/{CardContent-BQ0iSa2p.js.map → CardContent-BiDO6--E.js.map} +1 -1
- package/assets/{CardMedia-B6PneSTk.js → CardMedia-P7V4G8Ao.js} +1 -1
- package/assets/{CardMedia-B6PneSTk.js.map → CardMedia-P7V4G8Ao.js.map} +1 -1
- package/assets/{Carousel-DJd7E-wq.js → Carousel-BR4vMJGd.js} +1 -1
- package/assets/{Carousel-DJd7E-wq.js.map → Carousel-BR4vMJGd.js.map} +1 -1
- package/assets/{CategoryPage-DNQI3nXz.js → CategoryPage-BPCoXot3.js} +1 -1
- package/assets/{CategoryPage-DNQI3nXz.js.map → CategoryPage-BPCoXot3.js.map} +1 -1
- package/assets/{CircleAndArrow-DIeWRbH9.js → CircleAndArrow-BuEJmlbN.js} +1 -1
- package/assets/{CircleAndArrow-DIeWRbH9.js.map → CircleAndArrow-BuEJmlbN.js.map} +1 -1
- package/assets/{CircularProgress-AsNM1BvH.js → CircularProgress-pomnkuJx.js} +1 -1
- package/assets/{CircularProgress-AsNM1BvH.js.map → CircularProgress-pomnkuJx.js.map} +1 -1
- package/assets/{ContentCopy-CDhBZqHF.js → ContentCopy-Dmqt7VDt.js} +1 -1
- package/assets/{ContentCopy-CDhBZqHF.js.map → ContentCopy-Dmqt7VDt.js.map} +1 -1
- package/assets/{CreateEventPage-NcQUT47j.js → CreateEventPage-Yf9dwFyI.js} +1 -1
- package/assets/CreateEventPage-Yf9dwFyI.js.map +1 -0
- package/assets/{CreatorHubDownload-y9x_B8ll.js → CreatorHubDownload-BmRXscv9.js} +1 -1
- package/assets/{CreatorHubDownload-y9x_B8ll.js.map → CreatorHubDownload-BmRXscv9.js.map} +1 -1
- package/assets/{CreatorHubDownloadSuccess-BP7MSbSp.js → CreatorHubDownloadSuccess-DUNF3ob1.js} +1 -1
- package/assets/{CreatorHubDownloadSuccess-BP7MSbSp.js.map → CreatorHubDownloadSuccess-DUNF3ob1.js.map} +1 -1
- package/assets/{DappsShell-HNAsXcn5.js → DappsShell-C8t4K0gM.js} +1 -1
- package/assets/{DappsShell-HNAsXcn5.js.map → DappsShell-C8t4K0gM.js.map} +1 -1
- package/assets/{DownloadSuccessLayout-COBp7A1N.js → DownloadSuccessLayout-BtszP84v.js} +1 -1
- package/assets/{DownloadSuccessLayout-COBp7A1N.js.map → DownloadSuccessLayout-BtszP84v.js.map} +1 -1
- package/assets/{Grow-eKASrvPe.js → Grow-BOVsEgO5.js} +1 -1
- package/assets/{Grow-eKASrvPe.js.map → Grow-BOVsEgO5.js.map} +1 -1
- package/assets/HomePage-Cuim8IQO.js +3 -0
- package/assets/HomePage-Cuim8IQO.js.map +1 -0
- package/assets/{InviteFaqs-BkOvxqyN.js → InviteFaqs-Dednx3YH.js} +1 -1
- package/assets/{InviteFaqs-BkOvxqyN.js.map → InviteFaqs-Dednx3YH.js.map} +1 -1
- package/assets/{InvitePage-D5lELZNP.js → InvitePage-Dh4saTGB.js} +2 -2
- package/assets/{InvitePage-D5lELZNP.js.map → InvitePage-Dh4saTGB.js.map} +1 -1
- package/assets/{JumpInIcon-bPOWl5ae.js → JumpInIcon-DubYMzvy.js} +1 -1
- package/assets/{JumpInIcon-bPOWl5ae.js.map → JumpInIcon-DubYMzvy.js.map} +1 -1
- package/assets/{LegalPageLayout-DeH35WpT.js → LegalPageLayout-hVF919wE.js} +1 -1
- package/assets/{LegalPageLayout-DeH35WpT.js.map → LegalPageLayout-hVF919wE.js.map} +1 -1
- package/assets/{Link-C3GGl2C6.js → Link-CUGXIwgr.js} +1 -1
- package/assets/{Link-C3GGl2C6.js.map → Link-CUGXIwgr.js.map} +1 -1
- package/assets/{MenuItem-B0piwgTa.js → MenuItem-DuGK0OxB.js} +1 -1
- package/assets/{MenuItem-B0piwgTa.js.map → MenuItem-DuGK0OxB.js.map} +1 -1
- package/assets/{Paper-BfSYUoim.js → Paper-eMTGRWtM.js} +1 -1
- package/assets/{Paper-BfSYUoim.js.map → Paper-eMTGRWtM.js.map} +1 -1
- package/assets/{PostCard-Zsk0_WYz.js → PostCard-kjSmPWWO.js} +1 -1
- package/assets/{PostCard-Zsk0_WYz.js.map → PostCard-kjSmPWWO.js.map} +1 -1
- package/assets/{PostPage-FBb63V37.js → PostPage-BlhpX6oD.js} +1 -1
- package/assets/{PostPage-FBb63V37.js.map → PostPage-BlhpX6oD.js.map} +1 -1
- package/assets/{PostPage.styled-B7Xofl3c.js → PostPage.styled-Po3WWoh-.js} +3 -3
- package/assets/{PostPage.styled-B7Xofl3c.js.map → PostPage.styled-Po3WWoh-.js.map} +1 -1
- package/assets/{PreviewPage-Dla6vQZW.js → PreviewPage-n3uTSCXI.js} +1 -1
- package/assets/{PreviewPage-Dla6vQZW.js.map → PreviewPage-n3uTSCXI.js.map} +1 -1
- package/assets/{SEO-CGGKu_zm.js → SEO-DwbA3w8I.js} +1 -1
- package/assets/{SEO-CGGKu_zm.js.map → SEO-DwbA3w8I.js.map} +1 -1
- package/assets/{SearchPage-ByMcz1c8.js → SearchPage-DI4jZ-5r.js} +1 -1
- package/assets/{SearchPage-ByMcz1c8.js.map → SearchPage-DI4jZ-5r.js.map} +1 -1
- package/assets/{SignInRedirect-Bxl1dwag.js → SignInRedirect-B5d-ThV0.js} +1 -1
- package/assets/{SignInRedirect-Bxl1dwag.js.map → SignInRedirect-B5d-ThV0.js.map} +1 -1
- package/assets/{SignInRedirect-BNwfxyGB.js → SignInRedirect-BG6hu62E.js} +1 -1
- package/assets/{SignInRedirect-BNwfxyGB.js.map → SignInRedirect-BG6hu62E.js.map} +1 -1
- package/assets/{Skeleton-BP1Os8gY.js → Skeleton-L6NTNEwq.js} +1 -1
- package/assets/{Skeleton-BP1Os8gY.js.map → Skeleton-L6NTNEwq.js.map} +1 -1
- package/assets/{TwitterEmbed-BbSYYog-.js → TwitterEmbed-NxuXdAtw.js} +1 -1
- package/assets/{TwitterEmbed-BbSYYog-.js.map → TwitterEmbed-NxuXdAtw.js.map} +1 -1
- package/assets/{Video--A0fBGqz.js → Video-DfjlIy5m.js} +1 -1
- package/assets/{Video--A0fBGqz.js.map → Video-DfjlIy5m.js.map} +1 -1
- package/assets/WearablePreview-DMBKL_Ll.js +4 -0
- package/assets/{WearablePreview-KunRQByO.js.map → WearablePreview-DMBKL_Ll.js.map} +1 -1
- package/assets/{auto-track-DJw7KsLA.js → auto-track-CGclljni.js} +1 -1
- package/assets/{auto-track-DJw7KsLA.js.map → auto-track-CGclljni.js.map} +1 -1
- package/assets/{ccip-EHA4QwVS.js → ccip-DAt5iVuT.js} +1 -1
- package/assets/{ccip-EHA4QwVS.js.map → ccip-DAt5iVuT.js.map} +1 -1
- package/assets/{createSvgIcon-CnAtXIjx.js → createSvgIcon-BhhLusxy.js} +1 -1
- package/assets/{createSvgIcon-CnAtXIjx.js.map → createSvgIcon-BhhLusxy.js.map} +1 -1
- package/assets/{download-Csh0UAX4.js → download-CvDMtlSB.js} +2 -2
- package/assets/{download-Csh0UAX4.js.map → download-CvDMtlSB.js.map} +1 -1
- package/assets/{downloadWithIdentity-imzC-1Iy.js → downloadWithIdentity-DCM4BBHV.js} +1 -1
- package/assets/{downloadWithIdentity-imzC-1Iy.js.map → downloadWithIdentity-DCM4BBHV.js.map} +1 -1
- package/assets/{events.client-BypQp_hx.js → events.client-PE8SGazl.js} +1 -1
- package/assets/events.client-PE8SGazl.js.map +1 -0
- package/assets/host_avatar-Gho9W3pF.webp +0 -0
- package/assets/host_scene-BStngEfA.webp +0 -0
- package/assets/{index-CqU_IKja.js → index-4jeILFtC.js} +1 -1
- package/assets/{index-CqU_IKja.js.map → index-4jeILFtC.js.map} +1 -1
- package/assets/{index-BzmWmDt2.js → index-B3vFLEhz.js} +1 -1
- package/assets/{index-BzmWmDt2.js.map → index-B3vFLEhz.js.map} +1 -1
- package/assets/{index-FcfsIuei.js → index-B4891LJN.js} +1 -1
- package/assets/{index-FcfsIuei.js.map → index-B4891LJN.js.map} +1 -1
- package/assets/{index-Hs2OtJ7_.js → index-B9yrTavV.js} +1 -1
- package/assets/{index-Hs2OtJ7_.js.map → index-B9yrTavV.js.map} +1 -1
- package/assets/{index-CJ9b6HdV.js → index-BLHhkq_E.js} +1 -1
- package/assets/{index-CJ9b6HdV.js.map → index-BLHhkq_E.js.map} +1 -1
- package/assets/{index-DV8UooZK.js → index-BMXADetK.js} +1 -1
- package/assets/{index-DV8UooZK.js.map → index-BMXADetK.js.map} +1 -1
- package/assets/{index-iTL2dY0l.js → index-BkJ8YBkm.js} +1 -1
- package/assets/{index-iTL2dY0l.js.map → index-BkJ8YBkm.js.map} +1 -1
- package/assets/{index-DwKCx_Fj.js → index-BlsbAsbV.js} +17 -17
- package/assets/{index-DwKCx_Fj.js.map → index-BlsbAsbV.js.map} +1 -1
- package/assets/{index-DUmIu2EK.js → index-BoINd_2w.js} +29 -29
- package/assets/{index-DUmIu2EK.js.map → index-BoINd_2w.js.map} +1 -1
- package/assets/{index-BtL1Whr6.js → index-C6X9yhDI.js} +1 -1
- package/assets/{index-BtL1Whr6.js.map → index-C6X9yhDI.js.map} +1 -1
- package/assets/{index-KkMZZ6nz.js → index-C6gBuUpB.js} +1 -1
- package/assets/{index-KkMZZ6nz.js.map → index-C6gBuUpB.js.map} +1 -1
- package/assets/{index-CfKiEnnb.js → index-CFdZJosQ.js} +1 -1
- package/assets/{index-CfKiEnnb.js.map → index-CFdZJosQ.js.map} +1 -1
- package/assets/{index-BKY10VNY.js → index-COhuG0UZ.js} +1 -1
- package/assets/{index-BKY10VNY.js.map → index-COhuG0UZ.js.map} +1 -1
- package/assets/{index-BVu5N7d0.js → index-CXg_mAxU.js} +1 -1
- package/assets/{index-BVu5N7d0.js.map → index-CXg_mAxU.js.map} +1 -1
- package/assets/{index-DW87VeBc.js → index-C_GsQ0sm.js} +1 -1
- package/assets/{index-DW87VeBc.js.map → index-C_GsQ0sm.js.map} +1 -1
- package/assets/{index-pguZ7Pr7.js → index-CaK85mwB.js} +2 -2
- package/assets/{index-pguZ7Pr7.js.map → index-CaK85mwB.js.map} +1 -1
- package/assets/{index-B-PLjKpI.js → index-CwtsGcw-.js} +1 -1
- package/assets/{index-B-PLjKpI.js.map → index-CwtsGcw-.js.map} +1 -1
- package/assets/index-D1E7QSbi.js +1 -0
- package/assets/index-D1E7QSbi.js.map +1 -0
- package/assets/{index-CC8b5SLA.js → index-DCRycbXf.js} +1 -1
- package/assets/{index-CC8b5SLA.js.map → index-DCRycbXf.js.map} +1 -1
- package/assets/{index-XwRFjo-F.js → index-DCk4IgWe.js} +3 -3
- package/assets/{index-XwRFjo-F.js.map → index-DCk4IgWe.js.map} +1 -1
- package/assets/{index-CsY_wahP.js → index-DNB0OcQp.js} +1 -1
- package/assets/{index-CsY_wahP.js.map → index-DNB0OcQp.js.map} +1 -1
- package/assets/{index-DJdpP3iF.js → index-DYASHZBv.js} +1 -1
- package/assets/{index-DJdpP3iF.js.map → index-DYASHZBv.js.map} +1 -1
- package/assets/{index-CXMTgMUj.js → index-DgH2pgVp.js} +1 -1
- package/assets/{index-CXMTgMUj.js.map → index-DgH2pgVp.js.map} +1 -1
- package/assets/{index-DIU7xr_7.js → index-DjSZxWiq.js} +1 -1
- package/assets/{index-DIU7xr_7.js.map → index-DjSZxWiq.js.map} +1 -1
- package/assets/{index-fmnLygLZ.js → index-DuA-Kgw5.js} +1 -1
- package/assets/{index-fmnLygLZ.js.map → index-DuA-Kgw5.js.map} +1 -1
- package/assets/{index-Bd63106P.js → index-DvGiXclv.js} +1 -1
- package/assets/{index-Bd63106P.js.map → index-DvGiXclv.js.map} +1 -1
- package/assets/{index-Bfn0rTR9.js → index-IqQ1Xbmj.js} +1 -1
- package/assets/{index-Bfn0rTR9.js.map → index-IqQ1Xbmj.js.map} +1 -1
- package/assets/{index-BO6ciUn8.js → index-Oddt0EKb.js} +1 -1
- package/assets/{index-BO6ciUn8.js.map → index-Oddt0EKb.js.map} +1 -1
- package/assets/{index-Bq7PojkE.js → index-_IheZrQS.js} +1 -1
- package/assets/{index-Bq7PojkE.js.map → index-_IheZrQS.js.map} +1 -1
- package/assets/{index-Dx9lzInm.js → index-behXzsxg.js} +1 -1
- package/assets/{index-Dx9lzInm.js.map → index-behXzsxg.js.map} +1 -1
- package/assets/{index-0VgKmd34.js → index-xHmg3xmQ.js} +1 -1
- package/assets/{index-0VgKmd34.js.map → index-xHmg3xmQ.js.map} +1 -1
- package/assets/{index-BaEE4ZXP.js → index-z5rocGN5.js} +1 -1
- package/assets/{index-BaEE4ZXP.js.map → index-z5rocGN5.js.map} +1 -1
- package/assets/{profile.client-BtZZbgxj.js → profile.client-S1Y6pP0E.js} +1 -1
- package/assets/{profile.client-BtZZbgxj.js.map → profile.client-S1Y6pP0E.js.map} +1 -1
- package/assets/{shared.styled-D8qloAmp.js → shared.styled-BEvUV04u.js} +1 -1
- package/assets/{shared.styled-D8qloAmp.js.map → shared.styled-BEvUV04u.js.map} +1 -1
- package/assets/{store-OyTPwmKI.js → store-BtCGqC_U.js} +1 -1
- package/assets/{store-OyTPwmKI.js.map → store-BtCGqC_U.js.map} +1 -1
- package/assets/{url-BHzlJYXC.js → url-DZWf7pg7.js} +1 -1
- package/assets/{url-BHzlJYXC.js.map → url-DZWf7pg7.js.map} +1 -1
- package/assets/{useAuthIdentity-D2zQ3q5X.js → useAuthIdentity-C7IfvUJD.js} +1 -1
- package/assets/{useAuthIdentity-D2zQ3q5X.js.map → useAuthIdentity-C7IfvUJD.js.map} +1 -1
- package/assets/{useCreatorHubDownload-Dp_zMaiv.js → useCreatorHubDownload-Ci_tHGLN.js} +1 -1
- package/assets/{useCreatorHubDownload-Dp_zMaiv.js.map → useCreatorHubDownload-Ci_tHGLN.js.map} +1 -1
- package/assets/{useInfiniteBlogPosts-B9Mv_Fup.js → useInfiniteBlogPosts-q1OZMXQO.js} +1 -1
- package/assets/{useInfiniteBlogPosts-B9Mv_Fup.js.map → useInfiniteBlogPosts-q1OZMXQO.js.map} +1 -1
- package/assets/{useSlot-DM_UQPu8.js → useSlot-BXUbg59Y.js} +1 -1
- package/assets/{useSlot-DM_UQPu8.js.map → useSlot-BXUbg59Y.js.map} +1 -1
- package/assets/{utils-CJGePSnj.js → utils-BmJLp6Wz.js} +1 -1
- package/assets/{utils-CJGePSnj.js.map → utils-BmJLp6Wz.js.map} +1 -1
- package/index.html +15 -15
- package/package.json +3 -3
- package/assets/CreateEventPage-NcQUT47j.js.map +0 -1
- package/assets/HomePage-CZwkfB5G.js +0 -3
- package/assets/HomePage-CZwkfB5G.js.map +0 -1
- package/assets/WearablePreview-KunRQByO.js +0 -4
- package/assets/events.client-BypQp_hx.js.map +0 -1
- package/assets/index-C1apFG92.js +0 -1
- package/assets/index-C1apFG92.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-
|
|
2
|
-
import{aF as f0,b2 as l0,ar as Ea,g as d0,o as dr,ab as Aa,ac as us,j as b,s as R,aJ as ee,z as Z,I as hr,w as h0,b3 as Pa,ad as p0,U as b0,P as Mo,u as g0,N as m0,r as y0,V as w0}from"./index-
|
|
3
|
-
`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function tt(e,t){return e.exec(t)?.groups}const ka=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$a=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Ba=/^\(.+?\).*?$/,Uo=/^tuple(?<array>(\[(\d*)\])*)$/;function hs(e){let t=e.type;if(Uo.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const o=e.components[s];t+=hs(o),s<n-1&&(t+=", ")}const r=tt(Uo,e.type);return t+=`)${r?.array||""}`,hs({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Nt(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=hs(s),r!==n-1&&(t+=", ")}return t}function Qn(e){return e.type==="function"?`function ${e.name}(${Nt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Nt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Nt(e.inputs)})`:e.type==="error"?`error ${e.name}(${Nt(e.inputs)})`:e.type==="constructor"?`constructor(${Nt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ca=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function O0(e){return Ca.test(e)}function F0(e){return tt(Ca,e)}const Sa=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function R0(e){return Sa.test(e)}function L0(e){return tt(Sa,e)}const Ta=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function M0(e){return Ta.test(e)}function z0(e){return tt(Ta,e)}const Na=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function pr(e){return Na.test(e)}function U0(e){return tt(Na,e)}const ja=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function _0(e){return ja.test(e)}function H0(e){return tt(ja,e)}const Oa=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function D0(e){return Oa.test(e)}function G0(e){return tt(Oa,e)}const V0=/^receive\(\) external payable$/;function q0(e){return V0.test(e)}const _o=new Set(["memory","indexed","storage","calldata"]),W0=new Set(["indexed"]),ps=new Set(["calldata","memory","storage"]);class Z0 extends le{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class K0 extends le{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Y0 extends le{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class J0 extends le{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class X0 extends le{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Q0 extends le{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class ef extends le{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class tf extends le{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class nf extends le{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Gt extends le{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class rf extends le{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class sf extends le{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class of extends le{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class af extends le{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function cf(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let o="";for(const i of s[1])o+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${s[0]}{${o}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const Lr=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function bs(e,t={}){if(M0(e))return uf(e,t);if(R0(e))return ff(e,t);if(O0(e))return lf(e,t);if(_0(e))return df(e,t);if(D0(e))return hf(e);if(q0(e))return{type:"receive",stateMutability:"payable"};throw new rf({signature:e})}function uf(e,t={}){const n=z0(e);if(!n)throw new Gt({signature:e,type:"function"});const r=he(n.parameters),s=[],o=r.length;for(let a=0;a<o;a++)s.push(Xe(r[a],{modifiers:ps,structs:t,type:"function"}));const i=[];if(n.returns){const a=he(n.returns),c=a.length;for(let u=0;u<c;u++)i.push(Xe(a[u],{modifiers:ps,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:i}}function ff(e,t={}){const n=L0(e);if(!n)throw new Gt({signature:e,type:"event"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{modifiers:W0,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function lf(e,t={}){const n=F0(e);if(!n)throw new Gt({signature:e,type:"error"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function df(e,t={}){const n=H0(e);if(!n)throw new Gt({signature:e,type:"constructor"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function hf(e){const t=G0(e);if(!t)throw new Gt({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const pf=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,bf=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,gf=/^u?int$/;function Xe(e,t){const n=cf(e,t?.type,t?.structs);if(Lr.has(n))return Lr.get(n);const r=Ba.test(e),s=tt(r?bf:pf,e);if(!s)throw new X0({param:e});if(s.name&&yf(s.name))throw new Q0({param:e,name:s.name});const o=s.name?{name:s.name}:{},i=s.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{};let c,u={};if(r){c="tuple";const l=he(s.type),d=[],h=l.length;for(let g=0;g<h;g++)d.push(Xe(l[g],{structs:a}));u={components:d}}else if(s.type in a)c="tuple",u={components:a[s.type]};else if(gf.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,t?.type!=="struct"&&!Fa(c))throw new Y0({type:c});if(s.modifier){if(!t?.modifiers?.has?.(s.modifier))throw new ef({param:e,type:t?.type,modifier:s.modifier});if(ps.has(s.modifier)&&!wf(c,!!s.array))throw new tf({param:e,type:t?.type,modifier:s.modifier})}const f={type:`${c}${s.array??""}`,...o,...i,...u};return Lr.set(n,f),f}function he(e,t=[],n="",r=0){const s=e.trim().length;for(let o=0;o<s;o++){const i=e[o],a=e.slice(o+1);switch(i){case",":return r===0?he(a,[...t,n.trim()]):he(a,t,`${n}${i}`,r);case"(":return he(a,t,`${n}${i}`,r+1);case")":return he(a,t,`${n}${i}`,r-1);default:return he(a,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new af({current:n,depth:r});return t.push(n.trim()),t}function Fa(e){return e==="address"||e==="bool"||e==="function"||e==="string"||ka.test(e)||$a.test(e)}const mf=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function yf(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||ka.test(e)||$a.test(e)||mf.test(e)}function wf(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Ks(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!pr(a))continue;const c=U0(a);if(!c)throw new Gt({signature:a,type:"struct"});const u=c.properties.split(";"),f=[],l=u.length;for(let d=0;d<l;d++){const g=u[d].trim();if(!g)continue;const p=Xe(g,{type:"struct"});f.push(p)}if(!f.length)throw new sf({signature:a});t[c.name]=f}const r={},s=Object.entries(t),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];r[a]=Ra(c,t)}return r}const xf=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Ra(e=[],t={},n=new Set){const r=[],s=e.length;for(let o=0;o<s;o++){const i=e[o];if(Ba.test(i.type))r.push(i);else{const c=tt(xf,i.type);if(!c?.type)throw new nf({abiParameter:i});const{array:u,type:f}=c;if(f in t){if(n.has(f))throw new of({type:f});r.push({...i,type:`tuple${u??""}`,components:Ra(t[f],t,new Set([...n,f]))})}else if(Fa(f))r.push(i);else throw new K0({type:f})}}return r}function La(e){const t=Ks(e),n=[],r=e.length;for(let s=0;s<r;s++){const o=e[s];pr(o)||n.push(bs(o,t))}return n}function Ho(e){let t;if(typeof e=="string")t=bs(e);else{const n=Ks(e),r=e.length;for(let s=0;s<r;s++){const o=e[s];if(!pr(o)){t=bs(o,n);break}}}if(!t)throw new Z0({signature:e});return t}function Do(e){const t=[];if(typeof e=="string"){const n=he(e),r=n.length;for(let s=0;s<r;s++)t.push(Xe(n[s],{modifiers:_o}))}else{const n=Ks(e),r=e.length;for(let s=0;s<r;s++){const o=e[s];if(pr(o))continue;const i=he(o),a=i.length;for(let c=0;c<a;c++)t.push(Xe(i[c],{modifiers:_o,structs:n}))}}if(t.length===0)throw new J0({params:e});return t}function U(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:o=>t(e,o)}function Ae(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Of(e.type);return`${e.name}(${br(e.inputs,{includeName:t})})`}function br(e,{includeName:t=!1}={}){return e?e.map(n=>vf(n,{includeName:t})).join(t?", ":","):""}function vf(e,{includeName:t}){return e.type.startsWith("tuple")?`(${br(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Oe(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function K(e){return Oe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Ma="2.44.2";let Mr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Ma}`},B=class gs extends Error{constructor(t,n={}){const r=n.cause instanceof gs?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof gs&&n.cause.docsPath||n.docsPath,o=Mr.getDocsUrl?.({...n,docsPath:s}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...Mr.version?[`Version: ${Mr.version}`]:[]].join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DAt5iVuT.js","assets/index-BoINd_2w.js","assets/vendor-router-D_36sTKu.js","assets/vendor-sentry-BSvWNK4f.js","assets/vendor-crypto-uuuQA3i5.js","assets/vendor-schemas-DJzTSxpO.js","assets/vendor-ua-D7qqAxdq.js","assets/vendor-intl-D2lXWsDp.js","assets/profile.client-S1Y6pP0E.js","assets/useAuthIdentity-C7IfvUJD.js","assets/utils-BmJLp6Wz.js","assets/validation-CGrp9n3C.js","assets/index-xmbjtUW7.js","assets/index-C3SWQl_p.js","assets/index-z5rocGN5.js","assets/Link-CUGXIwgr.js","assets/ContentCopy-Dmqt7VDt.js","assets/Grow-BOVsEgO5.js","assets/index-DvGiXclv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as f0,b2 as l0,ar as Ea,g as d0,o as dr,ab as Aa,ac as us,j as b,s as R,aJ as ee,z as Z,I as hr,w as h0,b3 as Pa,ad as p0,U as b0,P as Mo,u as g0,N as m0,r as y0,V as w0}from"./index-BoINd_2w.js";import{r as j,u as x0,O as v0}from"./vendor-router-D_36sTKu.js";import"./vendor-ua-D7qqAxdq.js";import{u as E0}from"./profile.client-S1Y6pP0E.js";import{u as A0}from"./useAuthIdentity-C7IfvUJD.js";const P0=50,I0=e=>({...e,timestamp:Number(e.timestamp)}),k0=(e,t)=>{const n=e,{url:r,limit:s=P0}=t,o=f0.signedFetchFactory();return{getNotifications:async()=>{const c=new URLSearchParams;c.append("limit",String(s));const u=`${r}/notifications?${c.toString()}`,f=await o(u,{identity:n,headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Failed to fetch notifications: ${f.status}`);return((await f.json()).notifications??[]).map(I0)},markNotificationsAsRead:async c=>{const u=`${r}/notifications/read`,f=await o(u,{method:"PUT",identity:n,body:JSON.stringify({notificationIds:c}),headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Failed to mark notifications as read: ${f.status}`)}}},$0=(e,t)=>{try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},Ia=(e,t)=>{try{localStorage.setItem(e,JSON.stringify(t))}catch{}},B0=6e4,fs="dcl_notifications_onboarding",C0=()=>{const e=$0(fs,null);return e===null?(Ia(fs,!0),!0):e},zo=()=>{Ia(fs,!1)},S0=e=>{const{identity:t,isNotificationsEnabled:n,notificationsUrl:r,availableNotificationTypes:s,queryIntervalMs:o=B0,initialActiveTab:i=l0.NEWEST,onError:a,renderProfile:c}=e,[u,f]=j.useState({isLoading:!1,notifications:[]}),[l,d]=j.useState(()=>({activeTab:i,isOnboarding:C0(),isOpen:!1})),[h,g]=j.useState(null),p=j.useRef([]),w=j.useRef(null);j.useEffect(()=>{p.current=u.notifications},[u.notifications]),j.useEffect(()=>{w.current=h},[h]);const A=j.useMemo(()=>s?new Set(s):null,[s]),$=j.useCallback(x=>Promise.resolve().then(()=>x.getNotifications()).then(I=>{const T=A?I.filter(k=>A.has(k.type)):I,E=T.some(k=>k.read);f(k=>({...k,isLoading:!1,notifications:T})),E&&(zo(),d(k=>k.isOnboarding?{...k,isOnboarding:!1}:k))}).catch(I=>{const T=I instanceof Error?I:new Error("Unknown error");console.error("Error fetching notifications:",T),a&&a(T),f(E=>({...E,isLoading:!1}))}),[A,a]);j.useEffect(()=>{if(!t){g(null);return}if(!r){const k=new Error("notificationsUrl is required");console.error("Notifications URL missing:",k),a&&a(k),g(null);return}const x=k0(t,{url:r});if(g(x),!n)return;let I=!1;f(k=>({...k,isLoading:!0}));const T=()=>{I||$(x)};T();const E=setInterval(T,o);return()=>{I=!0,clearInterval(E)}},[t,n,r,a,$,o]),j.useEffect(()=>{if(!!l.isOpen)return;const I=p.current,T=w.current;if(!T)return;const E=I.filter(N=>!N.read).map(N=>N.id);if(E.length===0)return;let k=!1;return Promise.resolve().then(()=>T.markNotificationsAsRead(E)).then(()=>{k||f(N=>({...N,notifications:N.notifications.map(F=>({...F,read:E.includes(F.id)?!0:F.read}))}))}).catch(N=>{if(k)return;const F=N instanceof Error?N:new Error("Unknown error");console.error("Error marking notifications as read:",F),a&&a(F)}),()=>{k=!0}},[l.isOpen,a]);const v=j.useCallback(()=>{zo(),d(x=>({...x,isOnboarding:!1}))},[]),m=j.useCallback(()=>{d(x=>({...x,isOpen:!x.isOpen}))},[]),y=j.useCallback(x=>{d(I=>({...I,activeTab:x}))},[]),P=j.useCallback(x=>c?c(x):null,[c]);return{notifications:u.notifications,isLoading:u.isLoading,isModalOpen:l.isOpen,modalActiveTab:l.activeTab,isNotificationsOnboarding:l.isOnboarding,handleOnBegin:v,handleNotificationsOpen:m,handleOnChangeModalTab:y,handleRenderProfile:P}},T0=e=>{const{page:t}=Ea();j.useEffect(()=>{t(e)},[t,e])};var ls;(function(e){e.NEWEST="newest",e.READ="read"})(ls||(ls={}));function N0(e){const{identity:t,isConnected:n,locale:r="en"}=e,s=!!(t&&n),[o,i]=j.useState(!0),a=d0("NOTIFICATIONS_API_URL")??"https://notifications.decentraland.org";j.useEffect(()=>{s||i(!0)},[s]);const c=j.useCallback(()=>{s&&i(m=>m&&!1)},[s]),{notifications:u,isLoading:f,isModalOpen:l,isNotificationsOnboarding:d,modalActiveTab:h,handleNotificationsOpen:g,handleOnBegin:p,handleOnChangeModalTab:w}=S0({identity:t??void 0,isNotificationsEnabled:s&&o,initialActiveTab:ls.NEWEST,notificationsUrl:a,onError:c}),A=j.useCallback(()=>{o||i(!0),g()},[g,o]),$=j.useCallback((m,y)=>{w(y)},[w]);return{notificationProps:j.useMemo(()=>{if(s)return{locale:r,isLoading:f,isOnboarding:d,isOpen:l,items:u,activeTab:h,onClick:A,onClose:A,onBegin:p,onChangeTab:$}},[s,r,f,d,l,u,h,A,p,$])}}const O0="1.2.3";let le=class ds extends Error{constructor(t,n={}){const r=n.cause instanceof ds?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof ds&&n.cause.docsPath||n.docsPath,o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${O0}`].join(`
|
|
3
|
+
`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function tt(e,t){return e.exec(t)?.groups}const ka=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$a=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Ba=/^\(.+?\).*?$/,Uo=/^tuple(?<array>(\[(\d*)\])*)$/;function hs(e){let t=e.type;if(Uo.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const o=e.components[s];t+=hs(o),s<n-1&&(t+=", ")}const r=tt(Uo,e.type);return t+=`)${r?.array||""}`,hs({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Nt(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=hs(s),r!==n-1&&(t+=", ")}return t}function Qn(e){return e.type==="function"?`function ${e.name}(${Nt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Nt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Nt(e.inputs)})`:e.type==="error"?`error ${e.name}(${Nt(e.inputs)})`:e.type==="constructor"?`constructor(${Nt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ca=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function j0(e){return Ca.test(e)}function F0(e){return tt(Ca,e)}const Sa=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function R0(e){return Sa.test(e)}function L0(e){return tt(Sa,e)}const Ta=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function M0(e){return Ta.test(e)}function z0(e){return tt(Ta,e)}const Na=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function pr(e){return Na.test(e)}function U0(e){return tt(Na,e)}const Oa=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function _0(e){return Oa.test(e)}function H0(e){return tt(Oa,e)}const ja=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function D0(e){return ja.test(e)}function G0(e){return tt(ja,e)}const V0=/^receive\(\) external payable$/;function q0(e){return V0.test(e)}const _o=new Set(["memory","indexed","storage","calldata"]),W0=new Set(["indexed"]),ps=new Set(["calldata","memory","storage"]);class Z0 extends le{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class K0 extends le{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Y0 extends le{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class J0 extends le{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class X0 extends le{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Q0 extends le{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class ef extends le{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class tf extends le{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class nf extends le{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Gt extends le{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class rf extends le{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class sf extends le{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class of extends le{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class af extends le{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function cf(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let o="";for(const i of s[1])o+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${s[0]}{${o}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const Lr=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function bs(e,t={}){if(M0(e))return uf(e,t);if(R0(e))return ff(e,t);if(j0(e))return lf(e,t);if(_0(e))return df(e,t);if(D0(e))return hf(e);if(q0(e))return{type:"receive",stateMutability:"payable"};throw new rf({signature:e})}function uf(e,t={}){const n=z0(e);if(!n)throw new Gt({signature:e,type:"function"});const r=he(n.parameters),s=[],o=r.length;for(let a=0;a<o;a++)s.push(Xe(r[a],{modifiers:ps,structs:t,type:"function"}));const i=[];if(n.returns){const a=he(n.returns),c=a.length;for(let u=0;u<c;u++)i.push(Xe(a[u],{modifiers:ps,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:i}}function ff(e,t={}){const n=L0(e);if(!n)throw new Gt({signature:e,type:"event"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{modifiers:W0,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function lf(e,t={}){const n=F0(e);if(!n)throw new Gt({signature:e,type:"error"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function df(e,t={}){const n=H0(e);if(!n)throw new Gt({signature:e,type:"constructor"});const r=he(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Xe(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function hf(e){const t=G0(e);if(!t)throw new Gt({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const pf=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,bf=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,gf=/^u?int$/;function Xe(e,t){const n=cf(e,t?.type,t?.structs);if(Lr.has(n))return Lr.get(n);const r=Ba.test(e),s=tt(r?bf:pf,e);if(!s)throw new X0({param:e});if(s.name&&yf(s.name))throw new Q0({param:e,name:s.name});const o=s.name?{name:s.name}:{},i=s.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{};let c,u={};if(r){c="tuple";const l=he(s.type),d=[],h=l.length;for(let g=0;g<h;g++)d.push(Xe(l[g],{structs:a}));u={components:d}}else if(s.type in a)c="tuple",u={components:a[s.type]};else if(gf.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,t?.type!=="struct"&&!Fa(c))throw new Y0({type:c});if(s.modifier){if(!t?.modifiers?.has?.(s.modifier))throw new ef({param:e,type:t?.type,modifier:s.modifier});if(ps.has(s.modifier)&&!wf(c,!!s.array))throw new tf({param:e,type:t?.type,modifier:s.modifier})}const f={type:`${c}${s.array??""}`,...o,...i,...u};return Lr.set(n,f),f}function he(e,t=[],n="",r=0){const s=e.trim().length;for(let o=0;o<s;o++){const i=e[o],a=e.slice(o+1);switch(i){case",":return r===0?he(a,[...t,n.trim()]):he(a,t,`${n}${i}`,r);case"(":return he(a,t,`${n}${i}`,r+1);case")":return he(a,t,`${n}${i}`,r-1);default:return he(a,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new af({current:n,depth:r});return t.push(n.trim()),t}function Fa(e){return e==="address"||e==="bool"||e==="function"||e==="string"||ka.test(e)||$a.test(e)}const mf=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function yf(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||ka.test(e)||$a.test(e)||mf.test(e)}function wf(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Ks(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!pr(a))continue;const c=U0(a);if(!c)throw new Gt({signature:a,type:"struct"});const u=c.properties.split(";"),f=[],l=u.length;for(let d=0;d<l;d++){const g=u[d].trim();if(!g)continue;const p=Xe(g,{type:"struct"});f.push(p)}if(!f.length)throw new sf({signature:a});t[c.name]=f}const r={},s=Object.entries(t),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];r[a]=Ra(c,t)}return r}const xf=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Ra(e=[],t={},n=new Set){const r=[],s=e.length;for(let o=0;o<s;o++){const i=e[o];if(Ba.test(i.type))r.push(i);else{const c=tt(xf,i.type);if(!c?.type)throw new nf({abiParameter:i});const{array:u,type:f}=c;if(f in t){if(n.has(f))throw new of({type:f});r.push({...i,type:`tuple${u??""}`,components:Ra(t[f],t,new Set([...n,f]))})}else if(Fa(f))r.push(i);else throw new K0({type:f})}}return r}function La(e){const t=Ks(e),n=[],r=e.length;for(let s=0;s<r;s++){const o=e[s];pr(o)||n.push(bs(o,t))}return n}function Ho(e){let t;if(typeof e=="string")t=bs(e);else{const n=Ks(e),r=e.length;for(let s=0;s<r;s++){const o=e[s];if(!pr(o)){t=bs(o,n);break}}}if(!t)throw new Z0({signature:e});return t}function Do(e){const t=[];if(typeof e=="string"){const n=he(e),r=n.length;for(let s=0;s<r;s++)t.push(Xe(n[s],{modifiers:_o}))}else{const n=Ks(e),r=e.length;for(let s=0;s<r;s++){const o=e[s];if(pr(o))continue;const i=he(o),a=i.length;for(let c=0;c<a;c++)t.push(Xe(i[c],{modifiers:_o,structs:n}))}}if(t.length===0)throw new J0({params:e});return t}function U(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:o=>t(e,o)}function Ae(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new jf(e.type);return`${e.name}(${br(e.inputs,{includeName:t})})`}function br(e,{includeName:t=!1}={}){return e?e.map(n=>vf(n,{includeName:t})).join(t?", ":","):""}function vf(e,{includeName:t}){return e.type.startsWith("tuple")?`(${br(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function je(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function K(e){return je(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Ma="2.44.2";let Mr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Ma}`},B=class gs extends Error{constructor(t,n={}){const r=n.cause instanceof gs?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof gs&&n.cause.docsPath||n.docsPath,o=Mr.getDocsUrl?.({...n,docsPath:s}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...Mr.version?[`Version: ${Mr.version}`]:[]].join(`
|
|
4
4
|
`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Ma}walk(t){return za(this,t)}};function za(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?za(e.cause,t):t?null:e}class Ef extends B{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
5
5
|
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Go extends B{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
6
6
|
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class Ua extends B{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
@@ -17,10 +17,10 @@ import{aF as f0,b2 as l0,ar as Ea,g as d0,o as dr,ab as Aa,ac as us,j as b,s as
|
|
|
17
17
|
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class Sf extends B{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Ae(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Ae(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let Tf=class extends B{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class er extends B{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(`
|
|
18
18
|
`),{metaMessages:[`Params: (${br(r,{includeName:!0})})`,`Data: ${n} (${s} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class Ys extends B{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${Ae(t,{includeName:!0})}".`].join(`
|
|
19
19
|
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Nf extends B{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
20
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class
|
|
20
|
+
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Of extends B{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
21
21
|
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let Da=class extends B{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
22
|
-
`),{name:"InvalidArrayError"})}};class
|
|
23
|
-
`),{name:"InvalidDefinitionTypeError"})}}class Ff extends B{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let Ga=class extends B{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},Va=class extends B{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Wo extends B{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function Vt(e,{dir:t,size:n=32}={}){return typeof e=="string"?ct(e,{dir:t,size:n}):Rf(e,{dir:t,size:n})}function ct(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Va({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Rf(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Va({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const o=t==="right";r[o?s:n-s-1]=e[o?s:e.length-s-1]}return r}let Js=class extends B{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number "${o}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Lf=class extends B{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Mf extends B{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let zf=class extends B{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function gt(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function $e(e,{size:t}){if(K(e)>t)throw new zf({givenSize:K(e),maxSize:t})}function Fe(e,t={}){const{signed:n}=t;t.size&&$e(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<BigInt(s)*8n-1n)-1n;return r<=o?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function Uf(e,t={}){let n=e;if(t.size&&($e(n,{size:t.size}),n=gt(n)),gt(n)==="0x00")return!1;if(gt(n)==="0x01")return!0;throw new Mf(n)}function Qe(e,t={}){const n=Fe(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Js({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const _f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e,t={}){return typeof e=="number"||typeof e=="bigint"?_(e,t):typeof e=="string"?en(e,t):typeof e=="boolean"?qa(e,t):X(e,t)}function qa(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{size:t.size})):n}function X(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=_f[e[s]];const r=`0x${n}`;return typeof t.size=="number"?($e(r,{size:t.size}),Vt(r,{dir:"right",size:t.size})):r}function _(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<i){const c=typeof e=="bigint"?"n":"";throw new Js({max:o?`${o}${c}`:void 0,min:`${i}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Vt(a,{size:r}):a}const Hf=new TextEncoder;function en(e,t={}){const n=Hf.encode(e);return X(n,t)}const Df=new TextEncoder;function qt(e,t={}){return typeof e=="number"||typeof e=="bigint"?Vf(e,t):typeof e=="boolean"?Gf(e,t):Oe(e)?Re(e,t):mt(e,t)}function Gf(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{size:t.size})):n}const Ve={zero:48,nine:57,A:65,F:70,a:97,f:102};function Zo(e){if(e>=Ve.zero&&e<=Ve.nine)return e-Ve.zero;if(e>=Ve.A&&e<=Ve.F)return e-(Ve.A-10);if(e>=Ve.a&&e<=Ve.f)return e-(Ve.a-10)}function Re(e,t={}){let n=e;t.size&&($e(n,{size:t.size}),n=Vt(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let i=0,a=0;i<s;i++){const c=Zo(r.charCodeAt(a++)),u=Zo(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new B(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);o[i]=c*16+u}return o}function Vf(e,t){const n=_(e,t);return Re(n)}function mt(e,t={}){const n=Df.encode(e);return typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{dir:"right",size:t.size})):n}const Gn=BigInt(2**32-1),Ko=BigInt(32);function qf(e,t=!1){return t?{h:Number(e&Gn),l:Number(e>>Ko&Gn)}:{h:Number(e>>Ko&Gn)|0,l:Number(e&Gn)|0}}function Wf(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:i,l:a}=qf(e[o],t);[r[o],s[o]]=[i,a]}return[r,s]}const Zf=(e,t,n)=>e<<n|t>>>32-n,Kf=(e,t,n)=>t<<n|e>>>32-n,Yf=(e,t,n)=>t<<n-32|e>>>64-n,Jf=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Yo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function tn(e,...t){if(!Xf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function tr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wa(e,t){tn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Qf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function nn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function zr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Se(e,t){return e<<32-t|e>>>t}const el=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function tl(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function nl(e){for(let t=0;t<e.length;t++)e[t]=tl(e[t]);return e}const Jo=el?e=>e:nl;function rl(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Xs(e){return typeof e=="string"&&(e=rl(e)),tn(e),e}let Za=class{};function Ka(e){const t=r=>e().update(Xs(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const sl=BigInt(0),Yt=BigInt(1),ol=BigInt(2),il=BigInt(7),al=BigInt(256),cl=BigInt(113),Ya=[],Ja=[],Xa=[];for(let e=0,t=Yt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ya.push(2*(5*r+n)),Ja.push((e+1)*(e+2)/2%64);let s=sl;for(let o=0;o<7;o++)t=(t<<Yt^(t>>il)*cl)%al,t&ol&&(s^=Yt<<(Yt<<BigInt(o))-Yt);Xa.push(s)}const Qa=Wf(Xa,!0),ul=Qa[0],fl=Qa[1],Xo=(e,t,n)=>n>32?Yf(e,t,n):Zf(e,t,n),Qo=(e,t,n)=>n>32?Jf(e,t,n):Kf(e,t,n);function ll(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],f=n[c+1],l=Xo(u,f,1)^n[a],d=Qo(u,f,1)^n[a+1];for(let h=0;h<50;h+=10)e[i+h]^=l,e[i+h+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=Ja[i],c=Xo(s,o,a),u=Qo(s,o,a),f=Ya[i];s=e[f],o=e[f+1],e[f]=c,e[f+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=ul[r],e[1]^=fl[r]}nn(n)}let dl=class ec extends Za{constructor(t,n,r,s=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,Yo(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Qf(this.state)}clone(){return this._cloneInto()}keccak(){Jo(this.state32),ll(this.state32,this.rounds),Jo(this.state32),this.posOut=0,this.pos=0}update(t){tr(this),t=Xs(t),tn(t);const{blockLen:n,state:r}=this,s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let a=0;a<i;a++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){tr(this,!1),tn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Yo(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Wa(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,nn(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new ec(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}};const hl=(e,t,n)=>Ka(()=>new dl(t,e,n)),pl=hl(1,136,256/8);function te(e,t){const n=t||"hex",r=pl(Oe(e,{strict:!1})?qt(e):e);return n==="bytes"?r:ut(r)}const bl=e=>te(qt(e));function gl(e){return bl(e)}function ml(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){o=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!o)throw new B("Unable to normalize signature.");return s}const yl=e=>{const t=typeof e=="string"?e:Qn(e);return ml(t)};function tc(e){return gl(yl(e))}const gr=tc;let ft=class extends B{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},mr=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const Ur=new mr(8192);function yr(e,t){if(Ur.has(`${e}.${t}`))return Ur.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=te(mt(n),"bytes"),s=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&s[i]&&(s[i]=s[i].toUpperCase()),(r[i>>1]&15)>=8&&s[i+1]&&(s[i+1]=s[i+1].toUpperCase());const o=`0x${s.join("")}`;return Ur.set(`${e}.${t}`,o),o}function nc(e,t){if(!xe(e,{strict:!1}))throw new ft({address:e});return yr(e,t)}const wl=/^0x[a-fA-F0-9]{40}$/,_r=new mr(8192);function xe(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(_r.has(r))return _r.get(r);const s=wl.test(e)?e.toLowerCase()===e?!0:n?yr(e)===e:!0:!1;return _r.set(r,s),s}function Le(e){return typeof e[0]=="string"?Wt(e):xl(e)}function xl(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Wt(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function _t(e,t,n,{strict:r}={}){return Oe(e,{strict:!1})?vl(e,t,n,{strict:r}):oc(e,t,n,{strict:r})}function rc(e,t){if(typeof t=="number"&&t>0&&t>K(e)-1)throw new Ga({offset:t,position:"start",size:K(e)})}function sc(e,t,n){if(typeof t=="number"&&typeof n=="number"&&K(e)!==n-t)throw new Ga({offset:n,position:"end",size:K(e)})}function oc(e,t,n,{strict:r}={}){rc(e,t);const s=e.slice(t,n);return r&&sc(s,t,n),s}function vl(e,t,n,{strict:r}={}){rc(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&sc(s,t,n),s}const El=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ic=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function At(e,t){if(e.length!==t.length)throw new If({expectedLength:e.length,givenLength:t.length});const n=Al({params:e,values:t}),r=eo(n);return r.length===0?"0x":r}function Al({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Qs({param:e[r],value:t[r]}));return n}function Qs({param:e,value:t}){const n=to(e.type);if(n){const[r,s]=n;return Il(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Sl(t,{param:e});if(e.type==="address")return Pl(t);if(e.type==="bool")return $l(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=ic.exec(e.type)??[];return Bl(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return kl(t,{param:e});if(e.type==="string")return Cl(t);throw new Nf(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function eo(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?t+=32:t+=K(a)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push(_(t+s,{size:32})),r.push(a),s+=K(a)):n.push(a)}return Le([...n,...r])}function Pl(e){if(!xe(e))throw new ft({address:e});return{dynamic:!1,encoded:ct(e.toLowerCase())}}function Il(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Da(e);if(!r&&e.length!==t)throw new Af({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const o=[];for(let i=0;i<e.length;i++){const a=Qs({param:n,value:e[i]});a.dynamic&&(s=!0),o.push(a)}if(r||s){const i=eo(o);if(r){const a=_(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?Le([a,i]):a}}if(s)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Le(o.map(({encoded:i})=>i))}}function kl(e,{param:t}){const[,n]=t.type.split("bytes"),r=K(e);if(!n){let s=e;return r%32!==0&&(s=ct(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Le([ct(_(r,{size:32})),s])}}if(r!==Number.parseInt(n,10))throw new Pf({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:ct(e,{dir:"right"})}}function $l(e){if(typeof e!="boolean")throw new B(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ct(qa(e))}}function Bl(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Js({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:_(e,{size:32,signed:t})}}function Cl(e){const t=en(e),n=Math.ceil(K(t)/32),r=[];for(let s=0;s<n;s++)r.push(ct(_t(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Le([ct(_(K(t),{size:32})),...r])}}function Sl(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],i=Array.isArray(e)?s:o.name,a=Qs({param:o,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?eo(r):Le(r.map(({encoded:s})=>s))}}function to(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Sn=e=>_t(tc(e),0,4);function Pt(e){const{abi:t,args:n=[],name:r}=e,s=Oe(r,{strict:!1}),o=t.filter(a=>s?a.type==="function"?Sn(a)===r:a.type==="event"?gr(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let i;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,f)=>{const l="inputs"in a&&a.inputs[f];return l?ms(u,l):!1})){if(i&&"inputs"in i&&i.inputs){const u=ac(a.inputs,i.inputs,n);if(u)throw new Sf({abiItem:a,type:u[0]},{abiItem:i,type:u[1]})}i=a}}return i||o[0]}function ms(e,t){const n=typeof e,r=t.type;switch(r){case"address":return xe(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>n==="object"&&ms(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>ms(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ac(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return ac(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?xe(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?xe(n[r],{strict:!1}):!1)return i}}const ei="/docs/contract/encodeEventTopics";function Tn(e){const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const c=Pt({abi:t,name:n});if(!c)throw new qo(n,{docsPath:ei});s=c}if(s.type!=="event")throw new qo(void 0,{docsPath:ei});const o=Ae(s),i=gr(o);let a=[];if(r&&"inputs"in s){const c=s.inputs?.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?c?.map(f=>r[f.name])??[]:[];u.length>0&&(a=c?.map((f,l)=>Array.isArray(u[l])?u[l].map((d,h)=>ti({param:f,value:u[l][h]})):typeof u[l]<"u"&&u[l]!==null?ti({param:f,value:u[l]}):null)??[])}return[i,...a]}function ti({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return te(qt(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Ff(e.type);return At([e],[t])}function wr(e,{method:t}){const n={};return e.transport.type==="fallback"&&e.transport.onResponse?.(({method:r,response:s,status:o,transport:i})=>{o==="success"&&t===r&&(n[s]=i.request)}),r=>n[r]||e.request}async function cc(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:i,strict:a,toBlock:c}=t,u=wr(e,{method:"eth_newFilter"}),f=o?Tn({abi:r,args:s,eventName:o}):void 0,l=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?_(i):i,toBlock:typeof c=="bigint"?_(c):c,topics:f}]});return{abi:r,args:s,eventName:o,id:l,request:u(l),strict:!!a,type:"event"}}function pe(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const ni="/docs/contract/encodeFunctionData";function Tl(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=Pt({abi:t,args:n,name:r});if(!o)throw new Ut(r,{docsPath:ni});s=o}if(s.type!=="function")throw new Ut(void 0,{docsPath:ni});return{abi:[s],functionName:Sn(Ae(s))}}function Be(e){const{args:t}=e,{abi:n,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Tl(e),s=n[0],o=r,i="inputs"in s&&s.inputs?At(s.inputs,t??[]):void 0;return Wt([o,i??"0x"])}const Nl={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},uc={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},jl={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let ri=class extends B{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},fc=class extends B{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},Ol=class extends B{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const Fl={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Ol({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new fc({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ri({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ri({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function no(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Fl);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Rl(e,t={}){typeof t.size<"u"&&$e(e,{size:t.size});const n=X(e,t);return Fe(n,t)}function Ll(e,t={}){let n=e;if(typeof t.size<"u"&&($e(n,{size:t.size}),n=gt(n)),n.length>1||n[0]>1)throw new Lf(n);return!!n[0]}function Ye(e,t={}){typeof t.size<"u"&&$e(e,{size:t.size});const n=X(e,t);return Qe(n,t)}function Ml(e,t={}){let n=e;return typeof t.size<"u"&&($e(n,{size:t.size}),n=gt(n,{dir:"right"})),new TextDecoder().decode(n)}function Nn(e,t){const n=typeof t=="string"?Re(t):t,r=no(n);if(K(n)===0&&e.length>0)throw new Cn;if(K(t)&&K(t)<32)throw new Ua({data:typeof t=="string"?t:X(t),params:e,size:K(t)});let s=0;const o=[];for(let i=0;i<e.length;++i){const a=e[i];r.setPosition(s);const[c,u]=Rt(r,a,{staticPosition:0});s+=u,o.push(c)}return o}function Rt(e,t,{staticPosition:n}){const r=to(t.type);if(r){const[s,o]=r;return Ul(e,{...t,type:o},{length:s,staticPosition:n})}if(t.type==="tuple")return Gl(e,t,{staticPosition:n});if(t.type==="address")return zl(e);if(t.type==="bool")return _l(e);if(t.type.startsWith("bytes"))return Hl(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Dl(e,t);if(t.type==="string")return Vl(e,{staticPosition:n});throw new jf(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const si=32,ys=32;function zl(e){const t=e.readBytes(32);return[yr(X(oc(t,-20))),32]}function Ul(e,t,{length:n,staticPosition:r}){if(!n){const i=Ye(e.readBytes(ys)),a=r+i,c=a+si;e.setPosition(a);const u=Ye(e.readBytes(si)),f=rn(t);let l=0;const d=[];for(let h=0;h<u;++h){e.setPosition(c+(f?h*32:l));const[g,p]=Rt(e,t,{staticPosition:c});l+=p,d.push(g)}return e.setPosition(r+32),[d,32]}if(rn(t)){const i=Ye(e.readBytes(ys)),a=r+i,c=[];for(let u=0;u<n;++u){e.setPosition(a+u*32);const[f]=Rt(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let s=0;const o=[];for(let i=0;i<n;++i){const[a,c]=Rt(e,t,{staticPosition:r+s});s+=c,o.push(a)}return[o,s]}function _l(e){return[Ll(e.readBytes(32),{size:32}),32]}function Hl(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=Ye(e.readBytes(32));e.setPosition(n+i);const a=Ye(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[X(c),32]}return[X(e.readBytes(Number.parseInt(s,10),32)),32]}function Dl(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?Rl(s,{signed:n}):Ye(s,{signed:n}),32]}function Gl(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),s=r?[]:{};let o=0;if(rn(t)){const i=Ye(e.readBytes(ys)),a=n+i;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(a+o);const[f,l]=Rt(e,u,{staticPosition:a});o+=l,s[r?c:u?.name]=f}return e.setPosition(n+32),[s,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[c,u]=Rt(e,a,{staticPosition:n});s[r?i:a?.name]=c,o+=u}return[s,o]}function Vl(e,{staticPosition:t}){const n=Ye(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Ye(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=Ml(gt(o));return e.setPosition(t+32),[i,32]}function rn(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(rn);const n=to(e.type);return!!(n&&rn({...e,type:n[1]}))}function ql(e){const{abi:t,data:n}=e,r=_t(n,0,4);if(r==="0x")throw new Cn;const o=[...t||[],uc,jl].find(i=>i.type==="error"&&r===Sn(Ae(i)));if(!o)throw new _a(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Nn(o.inputs,_t(n,4)):void 0,errorName:o.name}}const ne=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n);function lc({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,o)=>`${r&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?ne(t[o]):t[o]}`).join(", ")})`}const Wl={gwei:9,wei:18},Zl={ether:-9,wei:9};function dc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${o?`.${o}`:""}`}function sn(e,t="wei"){return dc(e,Wl[t])}function fe(e,t="wei"){return dc(e,Zl[t])}class Kl extends B{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Yl extends B{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function oi(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
22
|
+
`),{name:"InvalidArrayError"})}};class jf extends B{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
23
|
+
`),{name:"InvalidDefinitionTypeError"})}}class Ff extends B{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let Ga=class extends B{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},Va=class extends B{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Wo extends B{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function Vt(e,{dir:t,size:n=32}={}){return typeof e=="string"?ct(e,{dir:t,size:n}):Rf(e,{dir:t,size:n})}function ct(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Va({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Rf(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Va({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const o=t==="right";r[o?s:n-s-1]=e[o?s:e.length-s-1]}return r}let Js=class extends B{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number "${o}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Lf=class extends B{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Mf extends B{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let zf=class extends B{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function gt(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function $e(e,{size:t}){if(K(e)>t)throw new zf({givenSize:K(e),maxSize:t})}function Fe(e,t={}){const{signed:n}=t;t.size&&$e(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<BigInt(s)*8n-1n)-1n;return r<=o?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function Uf(e,t={}){let n=e;if(t.size&&($e(n,{size:t.size}),n=gt(n)),gt(n)==="0x00")return!1;if(gt(n)==="0x01")return!0;throw new Mf(n)}function Qe(e,t={}){const n=Fe(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Js({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const _f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e,t={}){return typeof e=="number"||typeof e=="bigint"?_(e,t):typeof e=="string"?en(e,t):typeof e=="boolean"?qa(e,t):X(e,t)}function qa(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{size:t.size})):n}function X(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=_f[e[s]];const r=`0x${n}`;return typeof t.size=="number"?($e(r,{size:t.size}),Vt(r,{dir:"right",size:t.size})):r}function _(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<i){const c=typeof e=="bigint"?"n":"";throw new Js({max:o?`${o}${c}`:void 0,min:`${i}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Vt(a,{size:r}):a}const Hf=new TextEncoder;function en(e,t={}){const n=Hf.encode(e);return X(n,t)}const Df=new TextEncoder;function qt(e,t={}){return typeof e=="number"||typeof e=="bigint"?Vf(e,t):typeof e=="boolean"?Gf(e,t):je(e)?Re(e,t):mt(e,t)}function Gf(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{size:t.size})):n}const Ve={zero:48,nine:57,A:65,F:70,a:97,f:102};function Zo(e){if(e>=Ve.zero&&e<=Ve.nine)return e-Ve.zero;if(e>=Ve.A&&e<=Ve.F)return e-(Ve.A-10);if(e>=Ve.a&&e<=Ve.f)return e-(Ve.a-10)}function Re(e,t={}){let n=e;t.size&&($e(n,{size:t.size}),n=Vt(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let i=0,a=0;i<s;i++){const c=Zo(r.charCodeAt(a++)),u=Zo(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new B(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);o[i]=c*16+u}return o}function Vf(e,t){const n=_(e,t);return Re(n)}function mt(e,t={}){const n=Df.encode(e);return typeof t.size=="number"?($e(n,{size:t.size}),Vt(n,{dir:"right",size:t.size})):n}const Gn=BigInt(2**32-1),Ko=BigInt(32);function qf(e,t=!1){return t?{h:Number(e&Gn),l:Number(e>>Ko&Gn)}:{h:Number(e>>Ko&Gn)|0,l:Number(e&Gn)|0}}function Wf(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:i,l:a}=qf(e[o],t);[r[o],s[o]]=[i,a]}return[r,s]}const Zf=(e,t,n)=>e<<n|t>>>32-n,Kf=(e,t,n)=>t<<n|e>>>32-n,Yf=(e,t,n)=>t<<n-32|e>>>64-n,Jf=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Yo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function tn(e,...t){if(!Xf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function tr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wa(e,t){tn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Qf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function nn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function zr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Se(e,t){return e<<32-t|e>>>t}const el=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function tl(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function nl(e){for(let t=0;t<e.length;t++)e[t]=tl(e[t]);return e}const Jo=el?e=>e:nl;function rl(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Xs(e){return typeof e=="string"&&(e=rl(e)),tn(e),e}let Za=class{};function Ka(e){const t=r=>e().update(Xs(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const sl=BigInt(0),Yt=BigInt(1),ol=BigInt(2),il=BigInt(7),al=BigInt(256),cl=BigInt(113),Ya=[],Ja=[],Xa=[];for(let e=0,t=Yt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ya.push(2*(5*r+n)),Ja.push((e+1)*(e+2)/2%64);let s=sl;for(let o=0;o<7;o++)t=(t<<Yt^(t>>il)*cl)%al,t&ol&&(s^=Yt<<(Yt<<BigInt(o))-Yt);Xa.push(s)}const Qa=Wf(Xa,!0),ul=Qa[0],fl=Qa[1],Xo=(e,t,n)=>n>32?Yf(e,t,n):Zf(e,t,n),Qo=(e,t,n)=>n>32?Jf(e,t,n):Kf(e,t,n);function ll(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],f=n[c+1],l=Xo(u,f,1)^n[a],d=Qo(u,f,1)^n[a+1];for(let h=0;h<50;h+=10)e[i+h]^=l,e[i+h+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=Ja[i],c=Xo(s,o,a),u=Qo(s,o,a),f=Ya[i];s=e[f],o=e[f+1],e[f]=c,e[f+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=ul[r],e[1]^=fl[r]}nn(n)}let dl=class ec extends Za{constructor(t,n,r,s=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,Yo(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Qf(this.state)}clone(){return this._cloneInto()}keccak(){Jo(this.state32),ll(this.state32,this.rounds),Jo(this.state32),this.posOut=0,this.pos=0}update(t){tr(this),t=Xs(t),tn(t);const{blockLen:n,state:r}=this,s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let a=0;a<i;a++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){tr(this,!1),tn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Yo(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Wa(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,nn(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new ec(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}};const hl=(e,t,n)=>Ka(()=>new dl(t,e,n)),pl=hl(1,136,256/8);function te(e,t){const n=t||"hex",r=pl(je(e,{strict:!1})?qt(e):e);return n==="bytes"?r:ut(r)}const bl=e=>te(qt(e));function gl(e){return bl(e)}function ml(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){o=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!o)throw new B("Unable to normalize signature.");return s}const yl=e=>{const t=typeof e=="string"?e:Qn(e);return ml(t)};function tc(e){return gl(yl(e))}const gr=tc;let ft=class extends B{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},mr=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const Ur=new mr(8192);function yr(e,t){if(Ur.has(`${e}.${t}`))return Ur.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=te(mt(n),"bytes"),s=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&s[i]&&(s[i]=s[i].toUpperCase()),(r[i>>1]&15)>=8&&s[i+1]&&(s[i+1]=s[i+1].toUpperCase());const o=`0x${s.join("")}`;return Ur.set(`${e}.${t}`,o),o}function nc(e,t){if(!xe(e,{strict:!1}))throw new ft({address:e});return yr(e,t)}const wl=/^0x[a-fA-F0-9]{40}$/,_r=new mr(8192);function xe(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(_r.has(r))return _r.get(r);const s=wl.test(e)?e.toLowerCase()===e?!0:n?yr(e)===e:!0:!1;return _r.set(r,s),s}function Le(e){return typeof e[0]=="string"?Wt(e):xl(e)}function xl(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Wt(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function _t(e,t,n,{strict:r}={}){return je(e,{strict:!1})?vl(e,t,n,{strict:r}):oc(e,t,n,{strict:r})}function rc(e,t){if(typeof t=="number"&&t>0&&t>K(e)-1)throw new Ga({offset:t,position:"start",size:K(e)})}function sc(e,t,n){if(typeof t=="number"&&typeof n=="number"&&K(e)!==n-t)throw new Ga({offset:n,position:"end",size:K(e)})}function oc(e,t,n,{strict:r}={}){rc(e,t);const s=e.slice(t,n);return r&&sc(s,t,n),s}function vl(e,t,n,{strict:r}={}){rc(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&sc(s,t,n),s}const El=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ic=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function At(e,t){if(e.length!==t.length)throw new If({expectedLength:e.length,givenLength:t.length});const n=Al({params:e,values:t}),r=eo(n);return r.length===0?"0x":r}function Al({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Qs({param:e[r],value:t[r]}));return n}function Qs({param:e,value:t}){const n=to(e.type);if(n){const[r,s]=n;return Il(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Sl(t,{param:e});if(e.type==="address")return Pl(t);if(e.type==="bool")return $l(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=ic.exec(e.type)??[];return Bl(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return kl(t,{param:e});if(e.type==="string")return Cl(t);throw new Nf(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function eo(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?t+=32:t+=K(a)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push(_(t+s,{size:32})),r.push(a),s+=K(a)):n.push(a)}return Le([...n,...r])}function Pl(e){if(!xe(e))throw new ft({address:e});return{dynamic:!1,encoded:ct(e.toLowerCase())}}function Il(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Da(e);if(!r&&e.length!==t)throw new Af({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const o=[];for(let i=0;i<e.length;i++){const a=Qs({param:n,value:e[i]});a.dynamic&&(s=!0),o.push(a)}if(r||s){const i=eo(o);if(r){const a=_(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?Le([a,i]):a}}if(s)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Le(o.map(({encoded:i})=>i))}}function kl(e,{param:t}){const[,n]=t.type.split("bytes"),r=K(e);if(!n){let s=e;return r%32!==0&&(s=ct(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Le([ct(_(r,{size:32})),s])}}if(r!==Number.parseInt(n,10))throw new Pf({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:ct(e,{dir:"right"})}}function $l(e){if(typeof e!="boolean")throw new B(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ct(qa(e))}}function Bl(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Js({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:_(e,{size:32,signed:t})}}function Cl(e){const t=en(e),n=Math.ceil(K(t)/32),r=[];for(let s=0;s<n;s++)r.push(ct(_t(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Le([ct(_(K(t),{size:32})),...r])}}function Sl(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],i=Array.isArray(e)?s:o.name,a=Qs({param:o,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?eo(r):Le(r.map(({encoded:s})=>s))}}function to(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Sn=e=>_t(tc(e),0,4);function Pt(e){const{abi:t,args:n=[],name:r}=e,s=je(r,{strict:!1}),o=t.filter(a=>s?a.type==="function"?Sn(a)===r:a.type==="event"?gr(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let i;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,f)=>{const l="inputs"in a&&a.inputs[f];return l?ms(u,l):!1})){if(i&&"inputs"in i&&i.inputs){const u=ac(a.inputs,i.inputs,n);if(u)throw new Sf({abiItem:a,type:u[0]},{abiItem:i,type:u[1]})}i=a}}return i||o[0]}function ms(e,t){const n=typeof e,r=t.type;switch(r){case"address":return xe(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>n==="object"&&ms(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>ms(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ac(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return ac(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?xe(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?xe(n[r],{strict:!1}):!1)return i}}const ei="/docs/contract/encodeEventTopics";function Tn(e){const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const c=Pt({abi:t,name:n});if(!c)throw new qo(n,{docsPath:ei});s=c}if(s.type!=="event")throw new qo(void 0,{docsPath:ei});const o=Ae(s),i=gr(o);let a=[];if(r&&"inputs"in s){const c=s.inputs?.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?c?.map(f=>r[f.name])??[]:[];u.length>0&&(a=c?.map((f,l)=>Array.isArray(u[l])?u[l].map((d,h)=>ti({param:f,value:u[l][h]})):typeof u[l]<"u"&&u[l]!==null?ti({param:f,value:u[l]}):null)??[])}return[i,...a]}function ti({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return te(qt(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Ff(e.type);return At([e],[t])}function wr(e,{method:t}){const n={};return e.transport.type==="fallback"&&e.transport.onResponse?.(({method:r,response:s,status:o,transport:i})=>{o==="success"&&t===r&&(n[s]=i.request)}),r=>n[r]||e.request}async function cc(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:i,strict:a,toBlock:c}=t,u=wr(e,{method:"eth_newFilter"}),f=o?Tn({abi:r,args:s,eventName:o}):void 0,l=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?_(i):i,toBlock:typeof c=="bigint"?_(c):c,topics:f}]});return{abi:r,args:s,eventName:o,id:l,request:u(l),strict:!!a,type:"event"}}function pe(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const ni="/docs/contract/encodeFunctionData";function Tl(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=Pt({abi:t,args:n,name:r});if(!o)throw new Ut(r,{docsPath:ni});s=o}if(s.type!=="function")throw new Ut(void 0,{docsPath:ni});return{abi:[s],functionName:Sn(Ae(s))}}function Be(e){const{args:t}=e,{abi:n,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Tl(e),s=n[0],o=r,i="inputs"in s&&s.inputs?At(s.inputs,t??[]):void 0;return Wt([o,i??"0x"])}const Nl={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},uc={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Ol={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let ri=class extends B{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},fc=class extends B{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},jl=class extends B{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const Fl={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new jl({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new fc({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ri({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ri({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function no(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Fl);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Rl(e,t={}){typeof t.size<"u"&&$e(e,{size:t.size});const n=X(e,t);return Fe(n,t)}function Ll(e,t={}){let n=e;if(typeof t.size<"u"&&($e(n,{size:t.size}),n=gt(n)),n.length>1||n[0]>1)throw new Lf(n);return!!n[0]}function Ye(e,t={}){typeof t.size<"u"&&$e(e,{size:t.size});const n=X(e,t);return Qe(n,t)}function Ml(e,t={}){let n=e;return typeof t.size<"u"&&($e(n,{size:t.size}),n=gt(n,{dir:"right"})),new TextDecoder().decode(n)}function Nn(e,t){const n=typeof t=="string"?Re(t):t,r=no(n);if(K(n)===0&&e.length>0)throw new Cn;if(K(t)&&K(t)<32)throw new Ua({data:typeof t=="string"?t:X(t),params:e,size:K(t)});let s=0;const o=[];for(let i=0;i<e.length;++i){const a=e[i];r.setPosition(s);const[c,u]=Rt(r,a,{staticPosition:0});s+=u,o.push(c)}return o}function Rt(e,t,{staticPosition:n}){const r=to(t.type);if(r){const[s,o]=r;return Ul(e,{...t,type:o},{length:s,staticPosition:n})}if(t.type==="tuple")return Gl(e,t,{staticPosition:n});if(t.type==="address")return zl(e);if(t.type==="bool")return _l(e);if(t.type.startsWith("bytes"))return Hl(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Dl(e,t);if(t.type==="string")return Vl(e,{staticPosition:n});throw new Of(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const si=32,ys=32;function zl(e){const t=e.readBytes(32);return[yr(X(oc(t,-20))),32]}function Ul(e,t,{length:n,staticPosition:r}){if(!n){const i=Ye(e.readBytes(ys)),a=r+i,c=a+si;e.setPosition(a);const u=Ye(e.readBytes(si)),f=rn(t);let l=0;const d=[];for(let h=0;h<u;++h){e.setPosition(c+(f?h*32:l));const[g,p]=Rt(e,t,{staticPosition:c});l+=p,d.push(g)}return e.setPosition(r+32),[d,32]}if(rn(t)){const i=Ye(e.readBytes(ys)),a=r+i,c=[];for(let u=0;u<n;++u){e.setPosition(a+u*32);const[f]=Rt(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let s=0;const o=[];for(let i=0;i<n;++i){const[a,c]=Rt(e,t,{staticPosition:r+s});s+=c,o.push(a)}return[o,s]}function _l(e){return[Ll(e.readBytes(32),{size:32}),32]}function Hl(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=Ye(e.readBytes(32));e.setPosition(n+i);const a=Ye(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[X(c),32]}return[X(e.readBytes(Number.parseInt(s,10),32)),32]}function Dl(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?Rl(s,{signed:n}):Ye(s,{signed:n}),32]}function Gl(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),s=r?[]:{};let o=0;if(rn(t)){const i=Ye(e.readBytes(ys)),a=n+i;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(a+o);const[f,l]=Rt(e,u,{staticPosition:a});o+=l,s[r?c:u?.name]=f}return e.setPosition(n+32),[s,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[c,u]=Rt(e,a,{staticPosition:n});s[r?i:a?.name]=c,o+=u}return[s,o]}function Vl(e,{staticPosition:t}){const n=Ye(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Ye(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=Ml(gt(o));return e.setPosition(t+32),[i,32]}function rn(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(rn);const n=to(e.type);return!!(n&&rn({...e,type:n[1]}))}function ql(e){const{abi:t,data:n}=e,r=_t(n,0,4);if(r==="0x")throw new Cn;const o=[...t||[],uc,Ol].find(i=>i.type==="error"&&r===Sn(Ae(i)));if(!o)throw new _a(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Nn(o.inputs,_t(n,4)):void 0,errorName:o.name}}const ne=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n);function lc({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,o)=>`${r&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?ne(t[o]):t[o]}`).join(", ")})`}const Wl={gwei:9,wei:18},Zl={ether:-9,wei:9};function dc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${o?`.${o}`:""}`}function sn(e,t="wei"){return dc(e,Wl[t])}function fe(e,t="wei"){return dc(e,Zl[t])}class Kl extends B{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Yl extends B{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function oi(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
24
24
|
`,"")}function Jl(e){return e.reduce((t,{address:n,...r})=>{let s=`${t} ${n}:
|
|
25
25
|
`;return r.nonce&&(s+=` nonce: ${r.nonce}
|
|
26
26
|
`),r.balance&&(s+=` balance: ${r.balance}
|
|
@@ -28,19 +28,19 @@ import{aF as f0,b2 as l0,ar as Ea,g as d0,o as dr,ab as Aa,ac as us,j as b,s as
|
|
|
28
28
|
`),r.state&&(s+=` state:
|
|
29
29
|
`,s+=oi(r.state)),r.stateDiff&&(s+=` stateDiff:
|
|
30
30
|
`,s+=oi(r.stateDiff)),s},` State Override:
|
|
31
|
-
`).slice(0,-1)}function
|
|
32
|
-
`)}class Xl extends B{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",
|
|
33
|
-
${Jl(h)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class gc extends B{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:o,functionName:i,sender:a}){const c=Pt({abi:n,args:r,name:i}),u=c?lc({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?Ae(c,{includeName:!0}):void 0,l=
|
|
31
|
+
`).slice(0,-1)}function On(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
|
|
32
|
+
`)}class Xl extends B{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",On(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class Ql extends B{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){const h=On({chain:s&&`${s?.name} (id: ${s?.id})`,from:n?.address,to:l,value:typeof d<"u"&&`${sn(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${fe(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${fe(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${fe(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class hc extends B{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o}){let i="Transaction";r&&o!==void 0&&(i=`Transaction at block time "${r}" at index "${o}"`),t&&o!==void 0&&(i=`Transaction at block hash "${t}" at index "${o}"`),n&&o!==void 0&&(i=`Transaction at block number "${n}" at index "${o}"`),s&&(i=`Transaction with hash "${s}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class pc extends B{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class ed extends B{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class td extends B{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const nd=e=>e,ro=e=>e;class bc extends B{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d,stateOverride:h}){const g=n?pe(n):void 0;let p=On({from:g?.address,to:l,value:typeof d<"u"&&`${sn(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${fe(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${fe(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${fe(u)} gwei`,nonce:f});h&&(p+=`
|
|
33
|
+
${Jl(h)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class gc extends B{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:o,functionName:i,sender:a}){const c=Pt({abi:n,args:r,name:i}),u=c?lc({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?Ae(c,{includeName:!0}):void 0,l=On({address:s&&nd(s),function:f,args:u&&u!=="()"&&`${[...Array(i?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=i,this.sender=a}}class ws extends B{constructor({abi:t,data:n,functionName:r,message:s}){let o,i,a,c;if(n&&n!=="0x")try{i=ql({abi:t,data:n});const{abiItem:f,errorName:l,args:d}=i;if(l==="Error")c=d[0];else if(l==="Panic"){const[h]=d;c=Nl[h]}else{const h=f?Ae(f,{includeName:!0}):void 0,g=f&&d?lc({abiItem:f,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",g&&g!=="()"?` ${[...Array(l?.length??0).keys()].map(()=>" ").join("")}${g}`:""]}}catch(f){o=f}else s&&(c=s);let u;o instanceof _a&&(u=o.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
|
|
34
34
|
`):`The contract function "${r}" reverted.`,{cause:o,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=c,this.signature=u}}class rd extends B{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class sd extends B{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class xr extends B{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class Qt extends B{constructor({body:t,cause:n,details:r,headers:s,status:o,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[o&&`Status: ${o}`,`URL: ${ro(i)}`,t&&`Request body: ${ne(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=o,this.url=i}}class so extends B{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ro(r)}`,`Request body: ${ne(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class ii extends B{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ro(n)}`,`Request body: ${ne(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const od=-1;class de extends B{constructor(t,{code:n,docsPath:r,metaMessages:s,name:o,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:s||t?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||t.name,this.code=t instanceof so?t.code:n??od}}class ge extends de{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class on extends de{constructor(t){super(t,{code:on.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(on,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class an extends de{constructor(t){super(t,{code:an.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(an,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class cn extends de{constructor(t,{method:n}={}){super(t,{code:cn.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(cn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class un extends de{constructor(t){super(t,{code:un.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
35
35
|
`)})}}Object.defineProperty(un,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class wt extends de{constructor(t){super(t,{code:wt.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class lt extends de{constructor(t){super(t,{code:lt.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
36
|
-
`)})}}Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class fn extends de{constructor(t){super(t,{code:fn.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ln extends de{constructor(t){super(t,{code:ln.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ln,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class dn extends de{constructor(t){super(t,{code:dn.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(dn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class pt extends de{constructor(t,{method:n}={}){super(t,{code:pt.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Ht extends de{constructor(t){super(t,{code:Ht.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class hn extends de{constructor(t){super(t,{code:hn.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Lt extends ge{constructor(t){super(t,{code:Lt.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class pn extends ge{constructor(t){super(t,{code:pn.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(pn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class bn extends ge{constructor(t,{method:n}={}){super(t,{code:bn.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(bn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class gn extends ge{constructor(t){super(t,{code:gn.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class mn extends ge{constructor(t){super(t,{code:mn.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(mn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class yn extends ge{constructor(t){super(t,{code:yn.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wn extends ge{constructor(t){super(t,{code:wn.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(wn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class xn extends ge{constructor(t){super(t,{code:xn.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class vn extends ge{constructor(t){super(t,{code:vn.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class En extends ge{constructor(t){super(t,{code:En.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(En,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class An extends ge{constructor(t){super(t,{code:An.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(An,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Pn extends ge{constructor(t){super(t,{code:Pn.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Pn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class In extends ge{constructor(t){super(t,{code:In.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(In,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class id extends de{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const ad=3;function Dt(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const a=e instanceof xr?e:e instanceof B?e.walk(g=>"data"in g)||e.walk():{},{code:c,data:u,details:f,message:l,shortMessage:d}=a,h=e instanceof Cn?new rd({functionName:o}):[ad,wt.code].includes(c)&&(u||f||l||d)||c===lt.code&&f==="execution reverted"&&u?new ws({abi:t,data:typeof u=="object"?u.data:u,functionName:o,message:a instanceof so?f:d??l}):e;return new gc(h,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}function cd(e){const t=te(`0x${e.substring(4)}`).substring(26);return yr(`0x${t}`)}async function ud({hash:e,signature:t}){const n=Oe(e)?e:ut(e),{secp256k1:r}=await dr(async()=>{const{secp256k1:i}=await Promise.resolve().then(()=>Ib);return{secp256k1:i}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:f,v:l,yParity:d}=t,h=Number(d??l),g=ai(h);return new r.Signature(Fe(u),Fe(f)).addRecoveryBit(g)}const i=Oe(t)?t:ut(t);if(K(i)!==65)throw new Error("invalid signature length");const a=Qe(`0x${i.slice(130)}`),c=ai(a);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function ai(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function mc({hash:e,signature:t}){return cd(await ud({hash:e,signature:t}))}function fd(e,t="hex"){const n=yc(e),r=no(new Uint8Array(n.length));return n.encode(r),t==="hex"?X(r.bytes):r.bytes}function yc(e){return Array.isArray(e)?ld(e.map(t=>yc(t))):dd(e)}function ld(e){const t=e.reduce((s,o)=>s+o.length,0),n=wc(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function dd(e){const t=typeof e=="string"?Re(e):e,n=wc(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function wc(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new B("Length is too large.")}function hd(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,o=te(Wt(["0x05",fd([t?_(t):"0x",s,n?_(n):"0x"])]));return r==="bytes"?Re(o):o}async function xc(e){const{authorization:t,signature:n}=e;return mc({hash:hd(t),signature:n??t})}class pd extends B{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){const h=jn({from:n?.address,to:l,value:typeof d<"u"&&`${sn(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${fe(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${fe(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${fe(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class jt extends B{constructor({cause:t,message:n}={}){const r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(jt,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(jt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class nr extends B{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${fe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(nr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class xs extends B{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${fe(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(xs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class vs extends B{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(vs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Es extends B{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
36
|
+
`)})}}Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class fn extends de{constructor(t){super(t,{code:fn.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ln extends de{constructor(t){super(t,{code:ln.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ln,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class dn extends de{constructor(t){super(t,{code:dn.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(dn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class pt extends de{constructor(t,{method:n}={}){super(t,{code:pt.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Ht extends de{constructor(t){super(t,{code:Ht.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class hn extends de{constructor(t){super(t,{code:hn.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Lt extends ge{constructor(t){super(t,{code:Lt.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class pn extends ge{constructor(t){super(t,{code:pn.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(pn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class bn extends ge{constructor(t,{method:n}={}){super(t,{code:bn.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(bn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class gn extends ge{constructor(t){super(t,{code:gn.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class mn extends ge{constructor(t){super(t,{code:mn.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(mn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class yn extends ge{constructor(t){super(t,{code:yn.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wn extends ge{constructor(t){super(t,{code:wn.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(wn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class xn extends ge{constructor(t){super(t,{code:xn.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class vn extends ge{constructor(t){super(t,{code:vn.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class En extends ge{constructor(t){super(t,{code:En.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(En,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class An extends ge{constructor(t){super(t,{code:An.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(An,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Pn extends ge{constructor(t){super(t,{code:Pn.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Pn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class In extends ge{constructor(t){super(t,{code:In.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(In,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class id extends de{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const ad=3;function Dt(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const a=e instanceof xr?e:e instanceof B?e.walk(g=>"data"in g)||e.walk():{},{code:c,data:u,details:f,message:l,shortMessage:d}=a,h=e instanceof Cn?new rd({functionName:o}):[ad,wt.code].includes(c)&&(u||f||l||d)||c===lt.code&&f==="execution reverted"&&u?new ws({abi:t,data:typeof u=="object"?u.data:u,functionName:o,message:a instanceof so?f:d??l}):e;return new gc(h,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}function cd(e){const t=te(`0x${e.substring(4)}`).substring(26);return yr(`0x${t}`)}async function ud({hash:e,signature:t}){const n=je(e)?e:ut(e),{secp256k1:r}=await dr(async()=>{const{secp256k1:i}=await Promise.resolve().then(()=>Ib);return{secp256k1:i}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:f,v:l,yParity:d}=t,h=Number(d??l),g=ai(h);return new r.Signature(Fe(u),Fe(f)).addRecoveryBit(g)}const i=je(t)?t:ut(t);if(K(i)!==65)throw new Error("invalid signature length");const a=Qe(`0x${i.slice(130)}`),c=ai(a);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function ai(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function mc({hash:e,signature:t}){return cd(await ud({hash:e,signature:t}))}function fd(e,t="hex"){const n=yc(e),r=no(new Uint8Array(n.length));return n.encode(r),t==="hex"?X(r.bytes):r.bytes}function yc(e){return Array.isArray(e)?ld(e.map(t=>yc(t))):dd(e)}function ld(e){const t=e.reduce((s,o)=>s+o.length,0),n=wc(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function dd(e){const t=typeof e=="string"?Re(e):e,n=wc(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function wc(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new B("Length is too large.")}function hd(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,o=te(Wt(["0x05",fd([t?_(t):"0x",s,n?_(n):"0x"])]));return r==="bytes"?Re(o):o}async function xc(e){const{authorization:t,signature:n}=e;return mc({hash:hd(t),signature:n??t})}class pd extends B{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){const h=On({from:n?.address,to:l,value:typeof d<"u"&&`${sn(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${fe(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${fe(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${fe(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Ot extends B{constructor({cause:t,message:n}={}){const r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ot,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ot,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class nr extends B{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${fe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(nr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class xs extends B{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${fe(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(xs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class vs extends B{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(vs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Es extends B{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
37
37
|
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Es,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class As extends B{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(As,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Ps extends B{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
38
38
|
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Ps,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Is extends B{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Is,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ks extends B{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(ks,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class $s extends B{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty($s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class rr extends B{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${fe(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${fe(r)} gwei`:""}).`].join(`
|
|
39
|
-
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(rr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class On extends B{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function vr(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof B?e.walk(s=>s?.code===jt.code):e;return r instanceof B?new jt({cause:e,message:r.details}):jt.nodeMessage.test(n)?new jt({cause:e,message:e.details}):nr.nodeMessage.test(n)?new nr({cause:e,maxFeePerGas:t?.maxFeePerGas}):xs.nodeMessage.test(n)?new xs({cause:e,maxFeePerGas:t?.maxFeePerGas}):vs.nodeMessage.test(n)?new vs({cause:e,nonce:t?.nonce}):Es.nodeMessage.test(n)?new Es({cause:e,nonce:t?.nonce}):As.nodeMessage.test(n)?new As({cause:e,nonce:t?.nonce}):Ps.nodeMessage.test(n)?new Ps({cause:e}):Is.nodeMessage.test(n)?new Is({cause:e,gas:t?.gas}):ks.nodeMessage.test(n)?new ks({cause:e,gas:t?.gas}):$s.nodeMessage.test(n)?new $s({cause:e}):rr.nodeMessage.test(n)?new rr({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new On({cause:e})}function bd(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof On?e:s})();return new pd(r,{docsPath:t,...n})}function Er(e,{format:t}){if(!t)return{};const n={};function r(o){const i=Object.keys(o);for(const a of i)a in e&&(n[a]=e[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const s=t(e||{});return r(s),n}const gd={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Fn(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=md(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>X(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=_(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=_(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=_(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=_(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=_(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=_(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=gd[e.type]),typeof e.value<"u"&&(n.value=_(e.value)),n}function md(e){return e.map(t=>({address:t.address,r:t.r?_(BigInt(t.r)):t.r,s:t.s?_(BigInt(t.s)):t.s,chainId:_(t.chainId),nonce:_(t.nonce),...typeof t.yParity<"u"?{yParity:_(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:_(t.v)}:{}}))}function ci(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Wo({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Wo({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function yd(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=_(t)),n!==void 0&&(i.nonce=_(n)),r!==void 0&&(i.state=ci(r)),s!==void 0){if(i.state)throw new Yl;i.stateDiff=ci(s)}return i}function oo(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!xe(n,{strict:!1}))throw new ft({address:n});if(t[n])throw new Kl({address:n});t[n]=yd(r)}return t}const wd=2n**256n-1n;function Zt(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:s}=e,o=t?pe(t):void 0;if(o&&!xe(o.address))throw new ft({address:o.address});if(s&&!xe(s))throw new ft({address:s});if(n&&n>wd)throw new nr({maxFeePerGas:n});if(r&&n&&r>n)throw new rr({maxFeePerGas:n,maxPriorityFeePerGas:r})}class vc extends B{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class io extends B{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class xd extends B{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${fe(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Ec extends B{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Ac={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function ao(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Qe(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Qe(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ac[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=vd(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function vd(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Pc(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:ao(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Ee(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:s}={}){const o=s??!1,i=n!==void 0?_(n):void 0;let a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[i||r,o]},{dedupe:!!i}),!a)throw new Ec({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||Pc)(a,"getBlock")}async function co(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Ed(e,t){return Ic(e,t)}async function Ic(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};try{const o=r?.fees?.maxPriorityFeePerGas??r?.fees?.defaultPriorityFee;if(typeof o=="function"){const a=n||await U(e,Ee,"getBlock")({}),c=await o({block:a,client:e,request:s});if(c===null)throw new Error;return c}if(typeof o<"u")return o;const i=await e.request({method:"eth_maxPriorityFeePerGas"});return Fe(i)}catch{const[o,i]=await Promise.all([n?Promise.resolve(n):U(e,Ee,"getBlock")({}),U(e,co,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new io;const a=i-o.baseFeePerGas;return a<0n?0n:a}}async function Ad(e,t){return Bs(e,t)}async function Bs(e,t){const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},i=await(async()=>typeof r?.fees?.baseFeeMultiplier=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new vc;const c=10**(i.toString().split(".")[1]?.length??0),u=d=>d*BigInt(Math.ceil(i*c))/BigInt(c),f=n||await U(e,Ee,"getBlock")({});if(typeof r?.fees?.estimateFeesPerGas=="function"){const d=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(d!==null)return d}if(o==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new io;const d=typeof s?.maxPriorityFeePerGas=="bigint"?s.maxPriorityFeePerGas:await Ic(e,{block:f,chain:r,request:s}),h=u(f.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??h+d,maxPriorityFeePerGas:d}}return{gasPrice:s?.gasPrice??u(await U(e,co,"getGasPrice")({}))}}async function kc(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?_(r):n]},{dedupe:!!r});return Qe(s)}function $c(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>Re(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>X(o))}function Bc(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Re(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>Re(i)):e.commitments,o=[];for(let i=0;i<r.length;i++){const a=r[i],c=s[i];o.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return n==="bytes"?o:o.map(i=>X(i))}function Pd(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}function Id(e,t,n){return e&t^~e&n}function kd(e,t,n){return e&t^e&n^t&n}let $d=class extends Za{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=zr(this.buffer)}update(t){tr(this),t=Xs(t),tn(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let i=0;i<o;){const a=Math.min(s-this.pos,o-i);if(a===s){const c=zr(t);for(;s<=o-i;i+=s)this.process(c,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){tr(this),Wa(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:i}=this;n[i++]=128,nn(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let l=i;l<s;l++)n[l]=0;Pd(r,s-8,BigInt(this.length*8),o),this.process(r,0);const a=zr(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,f[l],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=o,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}};const st=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Bd=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);let Cd=class extends $d{constructor(t=32){super(64,t,8,!1),this.A=st[0]|0,this.B=st[1]|0,this.C=st[2]|0,this.D=st[3]|0,this.E=st[4]|0,this.F=st[5]|0,this.G=st[6]|0,this.H=st[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=ot[l-15],h=ot[l-2],g=Se(d,7)^Se(d,18)^d>>>3,p=Se(h,17)^Se(h,19)^h>>>10;ot[l]=p+ot[l-7]+g+ot[l-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=Se(a,6)^Se(a,11)^Se(a,25),h=f+d+Id(a,c,u)+Bd[l]+ot[l]|0,p=(Se(r,2)^Se(r,13)^Se(r,22))+kd(r,s,o)|0;f=u,u=c,c=a,a=i+h|0,i=o,o=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,o,i,a,c,u,f)}roundClean(){nn(ot)}destroy(){this.set(0,0,0,0,0,0,0,0),nn(this.buffer)}};const Sd=Ka(()=>new Cd),Td=Sd;function Nd(e,t){return Td(Oe(e,{strict:!1})?qt(e):e)}function jd(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Nd(t);return s.set([n],0),r==="bytes"?s:X(s)}function Od(e){const{commitments:t,version:n}=e,r=e.to,s=[];for(const o of t)s.push(jd({commitment:o,to:r,version:n}));return s}const ui=6,Cc=32,uo=4096,Sc=Cc*uo,fi=Sc*ui-1-1*uo*ui;class Fd extends B{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Rd extends B{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function Ld(e){const t=typeof e.data=="string"?Re(e.data):e.data,n=K(t);if(!n)throw new Rd;if(n>fi)throw new Fd({maxSize:fi,size:n});const r=[];let s=!0,o=0;for(;s;){const i=no(new Uint8Array(Sc));let a=0;for(;a<uo;){const c=t.slice(o,o+(Cc-1));if(i.pushByte(0),i.pushBytes(c),c.length<31){i.pushByte(128),s=!1;break}a++,o+=31}r.push(i)}return r.map(i=>X(i.bytes))}function Md(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Ld({data:t}),o=e.commitments??$c({blobs:s,kzg:n,to:r}),i=e.proofs??Bc({blobs:s,commitments:o,kzg:n,to:r}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:o[c],proof:i[c]});return a}function zd(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Xl({transaction:e})}function Ud(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof On?e:s})();return new Ql(r,{docsPath:t,...n})}async function fo(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Qe(t)}async function Tc(e,t){const{account:n=e.account,accessList:r,authorizationList:s,chain:o=e.chain,blobVersionedHashes:i,blobs:a,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:g,nonceManager:p,to:w,type:A,value:$,...v}=t,m=await(async()=>{if(!n||!p||typeof g<"u")return g;const I=pe(n),T=o?o.id:await U(e,fo,"getChainId")({});return await p.consume({address:I.address,chainId:T,client:e})})();Zt(t);const y=o?.formatters?.transactionRequest?.format,x=(y||Fn)({...Er(v,{format:y}),account:n?pe(n):void 0,accessList:r,authorizationList:s,blobs:a,blobVersionedHashes:i,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:w,type:A,value:$},"fillTransaction");try{const I=await e.request({method:"eth_fillTransaction",params:[x]}),E=(o?.formatters?.transaction?.format||ao)(I.tx);delete E.blockHash,delete E.blockNumber,delete E.r,delete E.s,delete E.transactionIndex,delete E.v,delete E.yParity,E.data=E.input,E.gas&&(E.gas=t.gas??E.gas),E.gasPrice&&(E.gasPrice=t.gasPrice??E.gasPrice),E.maxFeePerBlobGas&&(E.maxFeePerBlobGas=t.maxFeePerBlobGas??E.maxFeePerBlobGas),E.maxFeePerGas&&(E.maxFeePerGas=t.maxFeePerGas??E.maxFeePerGas),E.maxPriorityFeePerGas&&(E.maxPriorityFeePerGas=t.maxPriorityFeePerGas??E.maxPriorityFeePerGas),E.nonce&&(E.nonce=t.nonce??E.nonce);const k=await(async()=>{if(typeof o?.fees?.baseFeeMultiplier=="function"){const S=await U(e,Ee,"getBlock")({});return o.fees.baseFeeMultiplier({block:S,client:e,request:t})}return o?.fees?.baseFeeMultiplier??1.2})();if(k<1)throw new vc;const F=10**(k.toString().split(".")[1]?.length??0),G=S=>S*BigInt(Math.ceil(k*F))/BigInt(F);return E.maxFeePerGas&&!t.maxFeePerGas&&(E.maxFeePerGas=G(E.maxFeePerGas)),E.gasPrice&&!t.gasPrice&&(E.gasPrice=G(E.gasPrice)),{raw:I.raw,transaction:{from:x.from,...E}}}catch(I){throw Ud(I,{...t,chain:e.chain})}}const _d=["blobVersionedHashes","chainId","fees","gas","nonce","type"],li=new Map,Hr=new mr(128);async function Nc(e,t){let n=t;n.account??=e.account,n.parameters??=_d;const{account:r,chain:s=e.chain,nonceManager:o,parameters:i}=n,a=(()=>{if(typeof s?.prepareTransactionRequest=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s?.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let c;async function u(){return c||(typeof n.chainId<"u"?n.chainId:s?s.id:(c=await U(e,fo,"getChainId")({}),c))}const f=r&&pe(r);let l=n.nonce;if(i.includes("nonce")&&typeof l>"u"&&f&&o){const m=await u();l=await o.consume({address:f.address,chainId:m,client:e})}a?.fn&&a.runAt?.includes("beforeFillTransaction")&&(n=await a.fn({...n,chain:s},{phase:"beforeFillTransaction"}),l??=n.nonce);const h=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||Hr.get(e.uid)===!1||!["fees","gas"].some(y=>i.includes(y))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof l!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await U(e,Tc,"fillTransaction")({...n,nonce:l}).then(m=>{const{chainId:y,from:P,gas:x,gasPrice:I,nonce:T,maxFeePerBlobGas:E,maxFeePerGas:k,maxPriorityFeePerGas:N,type:F,...G}=m.transaction;return Hr.set(e.uid,!0),{...n,...P?{from:P}:{},...F?{type:F}:{},...typeof y<"u"?{chainId:y}:{},...typeof x<"u"?{gas:x}:{},...typeof I<"u"?{gasPrice:I}:{},...typeof T<"u"?{nonce:T}:{},...typeof E<"u"?{maxFeePerBlobGas:E}:{},...typeof k<"u"?{maxFeePerGas:k}:{},...typeof N<"u"?{maxPriorityFeePerGas:N}:{},..."nonceKey"in G&&typeof G.nonceKey<"u"?{nonceKey:G.nonceKey}:{}}}).catch(m=>{const y=m;return y.name!=="TransactionExecutionError"||y.walk?.(x=>{const I=x;return I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError"})&&Hr.set(e.uid,!1),n}):n;l??=h.nonce,n={...h,...f?{from:f?.address}:{},...l?{nonce:l}:{}};const{blobs:g,gas:p,kzg:w,type:A}=n;a?.fn&&a.runAt?.includes("beforeFillParameters")&&(n=await a.fn({...n,chain:s},{phase:"beforeFillParameters"}));let $;async function v(){return $||($=await U(e,Ee,"getBlock")({blockTag:"latest"}),$)}if(i.includes("nonce")&&typeof l>"u"&&f&&!o&&(n.nonce=await U(e,kc,"getTransactionCount")({address:f.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&g&&w){const m=$c({blobs:g,kzg:w});if(i.includes("blobVersionedHashes")){const y=Od({commitments:m,to:"hex"});n.blobVersionedHashes=y}if(i.includes("sidecars")){const y=Bc({blobs:g,commitments:m,kzg:w}),P=Md({blobs:g,commitments:m,proofs:y,to:"hex"});n.sidecars=P}}if(i.includes("chainId")&&(n.chainId=await u()),(i.includes("fees")||i.includes("type"))&&typeof A>"u")try{n.type=zd(n)}catch{let m=li.get(e.uid);typeof m>"u"&&(m=typeof(await v())?.baseFeePerGas=="bigint",li.set(e.uid,m)),n.type=m?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const m=await v(),{maxFeePerGas:y,maxPriorityFeePerGas:P}=await Bs(e,{block:m,chain:s,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<P)throw new xd({maxPriorityFeePerGas:P});n.maxPriorityFeePerGas=P,n.maxFeePerGas=y}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new io;if(typeof n.gasPrice>"u"){const m=await v(),{gasPrice:y}=await Bs(e,{block:m,chain:s,request:n,type:"legacy"});n.gasPrice=y}}return i.includes("gas")&&typeof p>"u"&&(n.gas=await U(e,lo,"estimateGas")({...n,account:f,prepare:f?.type==="local"?[]:["blobVersionedHashes"]})),a?.fn&&a.runAt?.includes("afterFillParameters")&&(n=await a.fn({...n,chain:s},{phase:"afterFillParameters"})),Zt(n),delete n.parameters,n}async function lo(e,t){const{account:n=e.account,prepare:r=!0}=t,s=n?pe(n):void 0,o=(()=>{if(Array.isArray(r))return r;if(s?.type!=="local")return["blobVersionedHashes"]})();try{const i=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await xc({authorization:t.authorizationList[0]}).catch(()=>{throw new B("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,blockNumber:l,blockTag:d,data:h,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,value:m,stateOverride:y,...P}=r?await Nc(e,{...t,parameters:o,to:i}):t;if(g&&t.gas!==g)return g;const I=(typeof l=="bigint"?_(l):void 0)||d,T=oo(y);Zt(t);const E=e.chain?.formatters?.transactionRequest?.format,N=(E||Fn)({...Er(P,{format:E}),account:s,accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,data:h,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:i,value:m},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:T?[N,I??e.experimental_blockTag??"latest",T]:I?[N,I]:[N]}))}catch(i){throw bd(i,{...t,account:s,chain:e.chain})}}async function Hd(e,t){const{abi:n,address:r,args:s,functionName:o,dataSuffix:i,...a}=t,c=Be({abi:n,args:s,functionName:o});try{return await U(e,lo,"estimateGas")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...a})}catch(u){const f=a.account?pe(a.account):void 0;throw Dt(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:f?.address})}}function Ar(e,t){if(!xe(e,{strict:!1}))throw new ft({address:e});if(!xe(t,{strict:!1}))throw new ft({address:t});return e.toLowerCase()===t.toLowerCase()}const di="/docs/contract/decodeEventLog";function sr(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[i,...a]=s;if(!i)throw new $f({docsPath:di});const c=t.find(p=>p.type==="event"&&i===gr(Ae(p)));if(!(c&&"name"in c)||c.type!=="event")throw new Bf(i,{docsPath:di});const{name:u,inputs:f}=c,l=f?.some(p=>!("name"in p&&p.name)),d=l?[]:{},h=f.map((p,w)=>[p,w]).filter(([p])=>"indexed"in p&&p.indexed);for(let p=0;p<h.length;p++){const[w,A]=h[p],$=a[p];if(!$)throw new Ys({abiItem:c,param:w});d[l?A:w.name||A]=Dd({param:w,value:$})}const g=f.filter(p=>!("indexed"in p&&p.indexed));if(g.length>0){if(n&&n!=="0x")try{const p=Nn(g,n);if(p)if(l)for(let w=0;w<f.length;w++)d[w]=d[w]??p.shift();else for(let w=0;w<g.length;w++)d[g[w].name]=p[w]}catch(p){if(o)throw p instanceof Ua||p instanceof fc?new er({abiItem:c,data:n,params:g,size:K(n)}):p}else if(o)throw new er({abiItem:c,data:"0x",params:g,size:0})}return{eventName:u,args:Object.values(d).length>0?d:void 0}}function Dd({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Nn([e],t)||[])[0]}function ho(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,o=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{const a=t.filter(f=>f.type==="event"&&i.topics[0]===gr(f));if(a.length===0)return null;let c,u;for(const f of a)try{c=sr({...i,abi:[f],strict:!0}),u=f;break}catch{}if(!c&&!s){u=a[0];try{c=sr({...i,abi:[u],strict:!1})}catch{const f=u.inputs?.some(l=>!("name"in l&&l.name));return{...i,args:f?[]:{},eventName:u.name}}}return!c||!u||o&&!o.includes(c.eventName)||!Gd({args:c.args,inputs:u.inputs,matchArgs:n})?null:{...c,...i}}).filter(Boolean)}function Gd(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(o,i,a){try{return o.type==="address"?Ar(i,a):o.type==="string"||o.type==="bytes"?te(qt(i))===a:i===a}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((o,i)=>{if(o==null)return!0;const a=n[i];return a?(Array.isArray(o)?o:[o]).some(u=>s(a,u,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([o,i])=>{if(i==null)return!0;const a=n.find(u=>u.name===o);return a?(Array.isArray(i)?i:[i]).some(u=>s(a,u,t[o])):!1}):!1}function et(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function po(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:i,args:a,strict:c}={}){const u=c??!1,f=i??(o?[o]:void 0);let l=[];f&&(l=[f.flatMap(p=>Tn({abi:[p],eventName:p.name,args:i?void 0:a}))],o&&(l=l[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,blockHash:n}]}):d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,fromBlock:typeof r=="bigint"?_(r):r,toBlock:typeof s=="bigint"?_(s):s}]});const h=d.map(g=>et(g));return f?ho({abi:f,args:a,logs:h,strict:u}):h}async function jc(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:i,fromBlock:a,toBlock:c,strict:u}=t,f=i?Pt({abi:n,name:i}):void 0,l=f?void 0:n.filter(d=>d.type==="event");return U(e,po,"getLogs")({address:r,args:s,blockHash:o,event:f,events:l,fromBlock:a,toBlock:c,strict:u})}const Dr="/docs/contract/decodeFunctionResult";function It(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const a=Pt({abi:t,args:n,name:r});if(!a)throw new Ut(r,{docsPath:Dr});o=a}if(o.type!=="function")throw new Ut(void 0,{docsPath:Dr});if(!o.outputs)throw new Ha(o.name,{docsPath:Dr});const i=Nn(o.outputs,s);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bo=BigInt(0),Cs=BigInt(1);function Rn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function go(e){if(!Rn(e))throw new Error("Uint8Array expected")}function kn(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Vn(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Oc(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?bo:BigInt("0x"+e)}const Fc=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Vd=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $n(e){if(go(e),Fc)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Vd[e[n]];return t}const qe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hi(e){if(e>=qe._0&&e<=qe._9)return e-qe._0;if(e>=qe.A&&e<=qe.F)return e-(qe.A-10);if(e>=qe.a&&e<=qe.f)return e-(qe.a-10)}function or(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Fc)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const i=hi(e.charCodeAt(o)),a=hi(e.charCodeAt(o+1));if(i===void 0||a===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}r[s]=i*16+a}return r}function yt(e){return Oc($n(e))}function Rc(e){return go(e),Oc($n(Uint8Array.from(e).reverse()))}function Ln(e,t){return or(e.toString(16).padStart(t*2,"0"))}function Lc(e,t){return Ln(e,t).reverse()}function we(e,t,n){let r;if(typeof t=="string")try{r=or(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Rn(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function ir(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];go(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.length}return n}const Gr=e=>typeof e=="bigint"&&bo<=e;function mo(e,t,n){return Gr(e)&&Gr(t)&&Gr(n)&&t<=e&&e<n}function Mt(e,t,n,r){if(!mo(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function qd(e){let t;for(t=0;e>bo;e>>=Cs,t+=1);return t}const Pr=e=>(Cs<<BigInt(e))-Cs,Vr=e=>new Uint8Array(e),pi=e=>Uint8Array.from(e);function Wd(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Vr(e),s=Vr(e),o=0;const i=()=>{r.fill(1),s.fill(0),o=0},a=(...l)=>n(s,r,...l),c=(l=Vr(0))=>{s=a(pi([0]),l),r=a(),l.length!==0&&(s=a(pi([1]),l),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l<t;){r=a();const h=r.slice();d.push(h),l+=r.length}return ir(...d)};return(l,d)=>{i(),c(l);let h;for(;!(h=d(u()));)c();return i(),h}}const Zd={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Rn(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,n={}){const r=(s,o,i)=>{const a=Zd[o];if(typeof a!="function")throw new Error("invalid validator function");const c=e[s];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+o+", got "+c)};for(const[s,o]of Object.entries(t))r(s,o,!1);for(const[s,o]of Object.entries(n))r(s,o,!0);return e}function bi(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const o=e(n,...r);return t.set(n,o),o}}const Kd="0.1.1";function Yd(){return Kd}class D extends Error{static setStaticOptions(t){D.prototype.docsOrigin=t.docsOrigin,D.prototype.showVersion=t.showVersion,D.prototype.version=t.version}constructor(t,n={}){const r=(()=>{if(n.cause instanceof D){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),s=n.cause instanceof D&&n.cause.docsPath||n.docsPath,o=n.docsOrigin??D.prototype.docsOrigin,i=`${o}${s??""}`,a=!!(n.version??D.prototype.showVersion),c=n.version??D.prototype.version,u=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s||a?["",r?`Details: ${r}`:void 0,s?`See: ${i}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(f=>typeof f=="string").join(`
|
|
40
|
-
`);super(u,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=o,this.docsPath=s,this.shortMessage=t,this.showVersion=a,this.version=c}walk(t){return Mc(this,t)}}Object.defineProperty(D,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Yd()}`}});D.setStaticOptions(D.defaultStaticOptions);function Mc(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Mc(e.cause,t):t?null:e}function Mn(e,t){if(Ot(e)>t)throw new h1({givenSize:Ot(e),maxSize:t})}const We={zero:48,nine:57,A:65,F:70,a:97,f:102};function gi(e){if(e>=We.zero&&e<=We.nine)return e-We.zero;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function Jd(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new p1({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let o=0;o<r;o++){const i=n==="right";s[i?o:r-o-1]=e[i?o:e.length-o-1]}return s}function zc(e,t={}){const{dir:n="left"}=t;let r=e,s=0;for(let o=0;o<r.length-1&&r[n==="left"?o:r.length-o-1].toString()==="0";o++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r}function kr(e,t){if(be(e)>t)throw new x1({givenSize:be(e),maxSize:t})}function Xd(e,t){if(typeof t=="number"&&t>0&&t>be(e)-1)throw new Zc({offset:t,position:"start",size:be(e)})}function Qd(e,t,n){if(typeof t=="number"&&typeof n=="number"&&be(e)!==n-t)throw new Zc({offset:n,position:"end",size:be(e)})}function Uc(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new v1({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const e1="#__bigint";function _c(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+e1:s,n)}const t1=new TextDecoder,n1=new TextEncoder;function r1(e){return e instanceof Uint8Array?e:typeof e=="string"?Hc(e):s1(e)}function s1(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Hc(e,t={}){const{size:n}=t;let r=e;n&&(kr(e,n),r=vt(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const o=s.length/2,i=new Uint8Array(o);for(let a=0,c=0;a<o;a++){const u=gi(s.charCodeAt(c++)),f=gi(s.charCodeAt(c++));if(u===void 0||f===void 0)throw new D(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);i[a]=u<<4|f}return i}function o1(e,t={}){const{size:n}=t,r=n1.encode(e);return typeof n=="number"?(Mn(r,n),i1(r,n)):r}function i1(e,t){return Jd(e,{dir:"right",size:t})}function Ot(e){return e.length}function a1(e,t,n,r={}){const{strict:s}=r;return e.slice(t,n)}function c1(e,t={}){const{size:n}=t;typeof n<"u"&&Mn(e,n);const r=Ie(e,t);return Vc(r,t)}function u1(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Mn(r,n),r=Dc(r)),r.length>1||r[0]>1)throw new d1(r);return!!r[0]}function Je(e,t={}){const{size:n}=t;typeof n<"u"&&Mn(e,n);const r=Ie(e,t);return qc(r,t)}function f1(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Mn(r,n),r=l1(r)),t1.decode(r)}function Dc(e){return zc(e,{dir:"left"})}function l1(e){return zc(e,{dir:"right"})}class d1 extends D{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let h1=class extends D{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},p1=class extends D{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const b1=new TextEncoder,g1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function m1(e,t={}){const{strict:n=!1}=t;if(!e)throw new mi(e);if(typeof e!="string")throw new mi(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new yi(e);if(!e.startsWith("0x"))throw new yi(e)}function Pe(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function y1(e){return e instanceof Uint8Array?Ie(e):Array.isArray(e)?Ie(new Uint8Array(e)):e}function Gc(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(kr(n,t.size),xt(n,t.size)):n}function Ie(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=g1[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(kr(r,t.size),vt(r,t.size)):r}function oe(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<i){const u=typeof e=="bigint"?"n":"";throw new Wc({max:o?`${o}${u}`:void 0,min:`${i}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&s<0?BigInt.asUintN(r*8,BigInt(s)):s).toString(16)}`;return r?xt(c,r):c}function yo(e,t={}){return Ie(b1.encode(e),t)}function xt(e,t){return Uc(e,{dir:"left",size:t})}function vt(e,t){return Uc(e,{dir:"right",size:t})}function je(e,t,n,r={}){const{strict:s}=r;Xd(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&Qd(o,t,n),o}function be(e){return Math.ceil((e.length-2)/2)}function Vc(e,t={}){const{signed:n}=t;t.size&&kr(e,t.size);const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<BigInt(s)*8n)-1n,i=o>>1n;return r<=i?r:r-o-1n}function qc(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Vc(e,t))}function w1(e,t={}){const{strict:n=!1}=t;try{return m1(e,{strict:n}),!0}catch{return!1}}class Wc extends D{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number \`${o}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class mi extends D{constructor(t){super(`Value \`${typeof t=="object"?_c(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class yi extends D{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class x1 extends D{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class Zc extends D{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class v1 extends D{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function E1(e){return{address:e.address,amount:oe(e.amount),index:oe(e.index),validatorIndex:oe(e.validatorIndex)}}function Kc(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:oe(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:oe(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:oe(e.gasLimit)},...typeof e.number=="bigint"&&{number:oe(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:oe(e.prevRandao)},...typeof e.time=="bigint"&&{time:oe(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(E1)}}}const ar=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],Ss=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],Yc=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Jc=[...Yc,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],A1=[...Yc,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],wi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],xi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Xc=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],vi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],P1="0x82ad56cb",Qc="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",I1="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",k1="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",wo="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Ts extends B{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class eu extends B{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const qr="/docs/contract/encodeDeployData";function xo(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(i=>"type"in i&&i.type==="constructor");if(!s)throw new Ef({docsPath:qr});if(!("inputs"in s))throw new Go({docsPath:qr});if(!s.inputs||s.inputs.length===0)throw new Go({docsPath:qr});const o=At(s.inputs,n);return Wt([r,o])}function Kt({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Ts({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Ts({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function tu(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof On?e:s})();return new bc(r,{docsPath:t,...n})}function nu(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const Wr=new Map;function ru({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const f=c();i();const l=f.map(({args:d})=>d);l.length!==0&&e(l).then(d=>{s&&Array.isArray(d)&&d.sort(s);for(let h=0;h<f.length;h++){const{resolve:g}=f[h];g?.([d[h],d])}}).catch(d=>{for(let h=0;h<f.length;h++){const{reject:g}=f[h];g?.(d)}})},i=()=>Wr.delete(t),a=()=>c().map(({args:f})=>f),c=()=>Wr.get(t)||[],u=f=>Wr.set(t,[...c(),f]);return{flush:i,async schedule(f){const{promise:l,resolve:d,reject:h}=nu();return n?.([...a(),f])&&o(),c().length>0?(u({args:f,resolve:d,reject:h}),l):(u({args:f,resolve:d,reject:h}),setTimeout(o,r),l)}}}async function $r(e,t){const{account:n=e.account,authorizationList:r,batch:s=!!e.batch?.multicall,blockNumber:o,blockTag:i=e.experimental_blockTag??"latest",accessList:a,blobs:c,blockOverrides:u,code:f,data:l,factory:d,factoryData:h,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:m,value:y,stateOverride:P,...x}=t,I=n?pe(n):void 0;if(f&&(d||h))throw new B("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&m)throw new B("Cannot provide both `code` & `to` as parameters.");const T=f&&l,E=d&&h&&m&&l,k=T||E,N=T?su({code:f,data:l}):E?C1({data:l,factory:d,factoryData:h,to:m}):l;try{Zt(t);const G=(typeof o=="bigint"?_(o):void 0)||i,S=u?Kc(u):void 0,C=oo(P),M=e.chain?.formatters?.transactionRequest?.format,L=(M||Fn)({...Er(x,{format:M}),accessList:a,account:I,authorizationList:r,blobs:c,data:N,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:k?void 0:m,value:y},"call");if(s&&$1({request:L})&&!C&&!S)try{return await B1(e,{...L,blockNumber:o,blockTag:i})}catch(W){if(!(W instanceof eu)&&!(W instanceof Ts))throw W}const H=(()=>{const W=[L,G];return C&&S?[...W,C,S]:C?[...W,C]:S?[...W,{},S]:W})(),V=await e.request({method:"eth_call",params:H});return V==="0x"?{data:void 0}:{data:V}}catch(F){const G=S1(F),{offchainLookup:S,offchainLookupSignature:C}=await dr(async()=>{const{offchainLookup:M,offchainLookupSignature:j}=await import("./ccip-EHA4QwVS.js");return{offchainLookup:M,offchainLookupSignature:j}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));if(e.ccipRead!==!1&&G?.slice(0,10)===C&&m)return{data:await S(e,{data:G,to:m})};throw k&&G?.slice(0,10)==="0x101bb98d"?new sd({factory:d}):tu(F,{...t,account:I,chain:e.chain})}}function $1({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(P1)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function B1(e,t){const{batchSize:n=1024,deployless:r=!1,wait:s=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:i=e.experimental_blockTag??"latest",data:a,to:c}=t,u=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Kt({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new eu})(),l=(typeof o=="bigint"?_(o):void 0)||i,{schedule:d}=ru({id:`${e.uid}.${l}`,wait:s,shouldSplitBatch(p){return p.reduce((A,{data:$})=>A+($.length-2),0)>n*2},fn:async p=>{const w=p.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),A=Be({abi:ar,args:[w],functionName:"aggregate3"}),$=await e.request({method:"eth_call",params:[{...u===null?{data:su({code:wo,data:A})}:{to:u,data:A}},l]});return It({abi:ar,args:[w],functionName:"aggregate3",data:$||"0x"})}}),[{returnData:h,success:g}]=await d({data:a,to:c});if(!g)throw new xr({data:h});return h==="0x"?{data:void 0}:{data:h}}function su(e){const{code:t,data:n}=e;return xo({abi:La(["constructor(bytes, bytes)"]),bytecode:Qc,args:[t,n]})}function C1(e){const{data:t,factory:n,factoryData:r,to:s}=e;return xo({abi:La(["constructor(address, bytes, address, bytes)"]),bytecode:I1,args:[s,t,n,r]})}function S1(e){if(!(e instanceof B))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function ke(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=Be({abi:n,args:s,functionName:o});try{const{data:c}=await U(e,$r,"call")({...i,data:a,to:r});return It({abi:n,args:s,functionName:o,data:c||"0x"})}catch(c){throw Dt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function T1(e,t){const{abi:n,address:r,args:s,dataSuffix:o,functionName:i,...a}=t,c=a.account?pe(a.account):e.account,u=Be({abi:n,args:s,functionName:i});try{const{data:f}=await U(e,$r,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:r,...a,account:c}),l=It({abi:n,args:s,functionName:i,data:f||"0x"}),d=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:l,request:{abi:d,address:r,args:s,dataSuffix:o,functionName:i,...a,account:c}}}catch(f){throw Dt(f,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}const Zr=new Map,Ei=new Map;let N1=0;function dt(e,t,n){const r=++N1,s=()=>Zr.get(e)||[],o=()=>{const f=s();Zr.set(e,f.filter(l=>l.id!==r))},i=()=>{const f=s();if(!f.some(d=>d.id===r))return;const l=Ei.get(e);if(f.length===1&&l){const d=l();d instanceof Promise&&d.catch(()=>{})}o()},a=s();if(Zr.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const c={};for(const f in t)c[f]=(...l)=>{const d=s();if(d.length!==0)for(const h of d)h.fns[f]?.(...l)};const u=n(c);return typeof u=="function"&&Ei.set(e,u),i}async function Ns(e){return new Promise(t=>setTimeout(t,e))}function zn(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const o=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:o}));const c=await n?.(a)??r;await Ns(c);const u=async()=>{s&&(await e({unpoll:o}),await Ns(r),u())};u()})(),o}const j1=new Map,O1=new Map;function F1(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:i=>o.set(s,i)}),n=t(e,j1),r=t(e,O1);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function R1(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=F1(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let o=r.promise.get();o||(o=e(),r.promise.set(o));try{const i=await o;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const L1=e=>`blockNumber.${e}`;async function Un(e,{cacheTime:t=e.cacheTime}={}){const n=await R1(()=>e.request({method:"eth_blockNumber"}),{cacheKey:L1(e.uid),cacheTime:t});return BigInt(n)}async function Br(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(o=>et(o));return!("abi"in t)||!t.abi?s:ho({abi:t.abi,logs:s,strict:n})}async function Cr(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function M1(e,t){const{abi:n,address:r,args:s,batch:o=!0,eventName:i,fromBlock:a,onError:c,onLogs:u,poll:f,pollingInterval:l=e.pollingInterval,strict:d}=t;return(typeof f<"u"?f:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const w=d??!1,A=ne(["watchContractEvent",r,s,o,e.uid,i,l,w,a]);return dt(A,{onLogs:u,onError:c},$=>{let v;a!==void 0&&(v=a-1n);let m,y=!1;const P=zn(async()=>{if(!y){try{m=await U(e,cc,"createContractEventFilter")({abi:n,address:r,args:s,eventName:i,strict:w,fromBlock:a})}catch{}y=!0;return}try{let x;if(m)x=await U(e,Br,"getFilterChanges")({filter:m});else{const I=await U(e,Un,"getBlockNumber")({});v&&v<I?x=await U(e,jc,"getContractEvents")({abi:n,address:r,args:s,eventName:i,fromBlock:v+1n,toBlock:I,strict:w}):x=[],v=I}if(x.length===0)return;if(o)$.onLogs(x);else for(const I of x)$.onLogs([I])}catch(x){m&&x instanceof lt&&(y=!1),$.onError?.(x)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await U(e,Cr,"uninstallFilter")({filter:m}),P()}})})():(()=>{const w=d??!1,A=ne(["watchContractEvent",r,s,o,e.uid,i,l,w]);let $=!0,v=()=>$=!1;return dt(A,{onLogs:u,onError:c},m=>((async()=>{try{const y=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return I?I.value:e.transport}return e.transport})(),P=i?Tn({abi:n,eventName:i,args:s}):[],{unsubscribe:x}=await y.subscribe({params:["logs",{address:r,topics:P}],onData(I){if(!$)return;const T=I.result;try{const{eventName:E,args:k}=sr({abi:n,data:T.data,topics:T.topics,strict:d}),N=et(T,{args:k,eventName:E});m.onLogs([N])}catch(E){let k,N;if(E instanceof er||E instanceof Ys){if(d)return;k=E.abiItem.name,N=E.abiItem.inputs?.some(G=>!("name"in G&&G.name))}const F=et(T,{args:N?[]:{},eventName:k});m.onLogs([F])}},onError(I){m.onError?.(I)}});v=x,$||v()}catch(y){c?.(y)}})(),()=>v()))})()}async function z1(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function js(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,o)=>{const i=async({count:a=0}={})=>{const c=async({error:u})=>{const f=typeof t=="function"?t({count:a,error:u}):t;f&&await Ns(f),i({count:a+1})};try{const u=await e();s(u)}catch(u){if(a<n&&await r({count:a,error:u}))return c({error:u});o(u)}};i()})}const U1={"0x0":"reverted","0x1":"success"};function ou(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>et(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Qe(e.transactionIndex):null,status:e.status?U1[e.status]:null,type:e.type?Ac[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Os=256;let qn=Os,Wn;function iu(e=11){if(!Wn||qn+e>Os*2){Wn="",qn=0;for(let t=0;t<Os;t++)Wn+=(256+Math.random()*256|0).toString(16).substring(1)}return Wn.substring(qn,qn+++e)}function _1(e){const{batch:t,chain:n,ccipRead:r,key:s="base",name:o="Base Client",type:i="base"}=e,a=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),f=e.pollingInterval??u,l=e.cacheTime??f,d=e.account?pe(e.account):void 0,{config:h,request:g,value:p}=e.transport({account:d,chain:n,pollingInterval:f}),w={...h,...p},A={account:d,batch:t,cacheTime:l,ccipRead:r,chain:n,key:s,name:o,pollingInterval:f,request:g,transport:w,type:i,uid:iu(),...a?{experimental_blockTag:a}:{}};function $(v){return m=>{const y=m(v);for(const x in A)delete y[x];const P={...v,...y};return Object.assign(P,{extend:$(P)})}}return Object.assign(A,{extend:$(A)})}function vo(e){if(!(e instanceof B))return!1;const t=e.walk(n=>n instanceof ws);return t instanceof ws?t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile":!1}function H1(e){const{abi:t,data:n}=e,r=_t(n,0,4),s=t.find(o=>o.type==="function"&&r===Sn(Ae(o)));if(!s)throw new Cf(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Nn(s.inputs,_t(n,4)):void 0}}const Kr="/docs/contract/encodeErrorResult";function Ai(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=Pt({abi:t,args:r,name:n});if(!c)throw new Vo(n,{docsPath:Kr});s=c}if(s.type!=="error")throw new Vo(void 0,{docsPath:Kr});const o=Ae(s),i=Sn(o);let a="0x";if(r&&r.length>0){if(!s.inputs)throw new kf(s.name,{docsPath:Kr});a=At(s.inputs,r)}return Wt([i,a])}const Yr="/docs/contract/encodeFunctionResult";function D1(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const i=Pt({abi:t,name:n});if(!i)throw new Ut(n,{docsPath:Yr});s=i}if(s.type!=="function")throw new Ut(void 0,{docsPath:Yr});if(!s.outputs)throw new Ha(s.name,{docsPath:Yr});const o=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Da(r)})();return At(s.outputs,o)}const Sr="x-batch-gateway:true";async function G1(e){const{data:t,ccipRequest:n}=e,{args:[r]}=H1({abi:Ss,data:t}),s=[],o=[];return await Promise.all(r.map(async(i,a)=>{try{o[a]=i.urls.includes(Sr)?await G1({data:i.data,ccipRequest:n}):await n(i),s[a]=!1}catch(c){s[a]=!0,o[a]=V1(c)}})),D1({abi:Ss,functionName:"query",result:[s,o]})}function V1(e){return e.name==="HttpRequestError"&&e.status?Ai({abi:Ss,errorName:"HttpError",args:[e.status,e.shortMessage]}):Ai({abi:[uc],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function au(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Oe(t)?t:null}function Fs(e){let t=new Uint8Array(32).fill(0);if(!e)return X(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=au(n[r]),o=s?qt(s):te(mt(n[r]),"bytes");t=te(Le([t,o]),"bytes")}return X(t)}function q1(e){return`[${e.slice(2)}]`}function W1(e){const t=new Uint8Array(32).fill(0);return e?au(e)||te(mt(e)):X(t)}function Eo(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(mt(t).byteLength+2);let r=0;const s=t.split(".");for(let o=0;o<s.length;o++){let i=mt(s[o]);i.byteLength>255&&(i=mt(q1(W1(s[o])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Z1(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:o,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;if(f&&!f.some(d=>o.endsWith(d)))return null;const l=s!=null?[Fs(o),BigInt(s)]:[Fs(o)];try{const d=Be({abi:xi,functionName:"addr",args:l}),h={address:u,abi:Jc,functionName:"resolveWithGateways",args:[ut(Eo(o)),d,i??[Sr]],blockNumber:n,blockTag:r},p=await U(e,ke,"readContract")(h);if(p[0]==="0x")return null;const w=It({abi:xi,args:l,functionName:"addr",data:p[0]});return w==="0x"||gt(w)==="0x00"?null:w}catch(d){if(a)throw d;if(vo(d))return null;throw d}}class K1 extends B{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Jt extends B{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ao extends B{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Y1 extends B{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const J1=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,X1=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Q1=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,eh=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function th(e){try{const t=await fetch(e,{method:"HEAD"});return t.status===200?t.headers.get("content-type")?.startsWith("image/"):!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Pi(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function cu({uri:e,gatewayUrls:t}){const n=Q1.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Pi(t?.ipfs,"https://ipfs.io"),s=Pi(t?.arweave,"https://arweave.net"),o=e.match(J1),{protocol:i,subpath:a,target:c,subtarget:u=""}=o?.groups||{},f=i==="ipns:/"||a==="ipns/",l=i==="ipfs:/"||a==="ipfs/"||X1.test(e);if(e.startsWith("http")&&!f&&!l){let h=e;return t?.arweave&&(h=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((f||l)&&c)return{uri:`${r}/${f?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(eh,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new Ao({uri:e})}function uu(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new K1({data:e});return e.image||e.image_url||e.image_data}async function nh({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await Po({gatewayUrls:e,uri:uu(n)})}catch{throw new Ao({uri:t})}}async function Po({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=cu({uri:t,gatewayUrls:e});if(r||await th(n))return n;throw new Ao({uri:t})}function rh(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,i]=n.split(":"),[a,c]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Jt({reason:"Only EIP-155 supported"});if(!i)throw new Jt({reason:"Chain ID not found"});if(!c)throw new Jt({reason:"Contract address not found"});if(!s)throw new Jt({reason:"Token ID not found"});if(!a)throw new Jt({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function sh(e,{nft:t}){if(t.namespace==="erc721")return ke(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return ke(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Y1({namespace:t.namespace})}async function oh(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?ih(e,{gatewayUrls:t,record:n}):Po({uri:n,gatewayUrls:t})}async function ih(e,{gatewayUrls:t,record:n}){const r=rh(n),s=await sh(e,{nft:r}),{uri:o,isOnChain:i,isEncoded:a}=cu({uri:s,gatewayUrls:t});if(i&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=a?atob(o.replace("data:application/json;base64,","")):o,f=JSON.parse(u);return Po({uri:uu(f),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),nh({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}async function fu(e,t){const{blockNumber:n,blockTag:r,key:s,name:o,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;if(f&&!f.some(l=>o.endsWith(l)))return null;try{const l={address:u,abi:Jc,args:[ut(Eo(o)),Be({abi:wi,functionName:"text",args:[Fs(o),s]}),i??[Sr]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},h=await U(e,ke,"readContract")(l);if(h[0]==="0x")return null;const g=It({abi:wi,functionName:"text",data:h[0]});return g===""?null:g}catch(l){if(a)throw l;if(vo(l))return null;throw l}}async function ah(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){const c=await U(e,fu,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:o,strict:i});if(!c)return null;try{return await oh(e,{record:c,gatewayUrls:r})}catch{return null}}async function ch(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:o=60n,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const f={address:u,abi:A1,args:[n,o,i??[Sr]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},l=U(e,ke,"readContract"),[d]=await l(f);return d||null}catch(f){if(a)throw f;if(vo(f))return null;throw f}}async function uh(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:o}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),a=o?.ensTlds;if(a&&!a.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${a?.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);const[c]=await U(e,ke,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ut(Eo(s))],blockNumber:n,blockTag:r});return c}async function lu(e,t){const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:o,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:l,to:d,value:h,...g}=t,p=n?pe(n):void 0;try{Zt(t);const A=(typeof r=="bigint"?_(r):void 0)||s,$=e.chain?.formatters?.transactionRequest?.format,m=($||Fn)({...Er(g,{format:$}),account:p,blobs:o,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:l,to:d,value:h},"createAccessList"),y=await e.request({method:"eth_createAccessList",params:[m,A]});return{accessList:y.accessList,gasUsed:BigInt(y.gasUsed)}}catch(w){throw tu(w,{...t,account:p,chain:e.chain})}}async function fh(e){const t=wr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function du(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:i,toBlock:a}={}){const c=s??(r?[r]:void 0),u=wr(e,{method:"eth_newFilter"});let f=[];c&&(f=[c.flatMap(h=>Tn({abi:[h],eventName:h.name,args:n}))],r&&(f=f[0]));const l=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?_(o):o,toBlock:typeof a=="bigint"?_(a):a,...f.length?{topics:f}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:o,id:l,request:u(l),strict:!!i,toBlock:a,type:"event"}}async function hu(e){const t=wr(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function lh(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const s=typeof n=="bigint"?_(n):void 0,o=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(o)}async function dh(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function hh(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?_(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),Qe(o)}async function Rs(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?_(n):void 0,o=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(o!=="0x")return o}class ph extends B{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function bh(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[o,i,a,c,u,f,l]=await U(e,ke,"readContract")({abi:gh,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:i,version:a,chainId:Number(c),verifyingContract:u,salt:f},extensions:l,fields:o}}catch(o){const i=o;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new ph({address:n}):i}}const gh=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function mh(e){return{baseFeePerGas:e.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map(t=>t.map(n=>BigInt(n)))}}async function yh(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=typeof n=="bigint"?_(n):void 0,i=await e.request({method:"eth_feeHistory",params:[_(t),o||r,s]},{dedupe:!!o});return mh(i)}async function wh(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>et(o));return t.abi?ho({abi:t.abi,logs:s,strict:n}):s}async function xh({address:e,authorization:t,signature:n}){return Ar(nc(e),await xc({authorization:t,signature:n}))}const Zn=new mr(8192);function vh(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Zn.get(n))return Zn.get(n);const r=e().finally(()=>Zn.delete(n));return Zn.set(n,r),r}function Eh(e,t={}){return async(n,r={})=>{const{dedupe:s=!1,methods:o,retryDelay:i=150,retryCount:a=3,uid:c}={...t,...r},{method:u}=n;if(o?.exclude?.includes(u))throw new pt(new Error("method not supported"),{method:u});if(o?.include&&!o.include.includes(u))throw new pt(new Error("method not supported"),{method:u});const f=s?en(`${c}.${ne(n)}`):void 0;return vh(()=>js(async()=>{try{return await e(n)}catch(l){const d=l;switch(d.code){case on.code:throw new on(d);case an.code:throw new an(d);case cn.code:throw new cn(d,{method:n.method});case un.code:throw new un(d);case wt.code:throw new wt(d);case lt.code:throw new lt(d);case fn.code:throw new fn(d);case ln.code:throw new ln(d);case dn.code:throw new dn(d);case pt.code:throw new pt(d,{method:n.method});case Ht.code:throw new Ht(d);case hn.code:throw new hn(d);case Lt.code:throw new Lt(d);case pn.code:throw new pn(d);case bn.code:throw new bn(d);case gn.code:throw new gn(d);case mn.code:throw new mn(d);case yn.code:throw new yn(d);case wn.code:throw new wn(d);case xn.code:throw new xn(d);case vn.code:throw new vn(d);case En.code:throw new En(d);case An.code:throw new An(d);case Pn.code:throw new Pn(d);case In.code:throw new In(d);case 5e3:throw new Lt(d);default:throw l instanceof B?l:new id(d)}}},{delay:({count:l,error:d})=>{if(d&&d instanceof Qt){const h=d?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1e3}return~~(1<<l)*i},retryCount:a,shouldRetry:({error:l})=>Ah(l)}),{enabled:s,id:f})}}function Ah(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Ht.code||e.code===wt.code:e instanceof Qt&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function Tr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const o=typeof s=="function"?s(r):s,i={...r,...o};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function Ph(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let i;try{const a=new AbortController;n>0&&(i=setTimeout(()=>{r&&a.abort()},n)),s(await e({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&o(t),o(a)}finally{clearTimeout(i)}})()})}function Ih(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Ii=Ih();function kh(e,t={}){const{url:n,headers:r}=$h(e);return{async request(s){const{body:o,fetchFn:i=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:c=t.onResponse,timeout:u=t.timeout??1e4}=s,f={...t.fetchOptions??{},...s.fetchOptions??{}},{headers:l,method:d,signal:h}=f;try{const g=await Ph(async({signal:w})=>{const A={...f,body:Array.isArray(o)?ne(o.map(y=>({jsonrpc:"2.0",id:y.id??Ii.take(),...y}))):ne({jsonrpc:"2.0",id:o.id??Ii.take(),...o}),headers:{...r,"Content-Type":"application/json",...l},method:d||"POST",signal:h||(u>0?w:null)},$=new Request(n,A),v=await a?.($,A)??{...A,url:n};return await i(v.url??n,v)},{errorInstance:new ii({body:o,url:n}),timeout:u,signal:!0});c&&await c(g);let p;if(g.headers.get("Content-Type")?.startsWith("application/json"))p=await g.json();else{p=await g.text();try{p=JSON.parse(p||"{}")}catch(w){if(g.ok)throw w;p={error:p}}}if(!g.ok)throw new Qt({body:o,details:ne(p.error)||g.statusText,headers:g.headers,status:g.status,url:n});return p}catch(g){throw g instanceof Qt||g instanceof ii?g:new Qt({body:o,cause:g,url:n})}}}}function $h(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const Bh=`Ethereum Signed Message:
|
|
41
|
-
`;function Ch(e){const t=typeof e=="string"?en(e):typeof e.raw=="string"?e.raw:X(e.raw),n=en(`${Bh}${K(t)}`);return Le([n,t])}function pu(e,t){return te(Ch(e),t)}class Sh extends B{constructor({domain:t}){super(`Invalid domain "${ne(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Th extends B{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Nh extends B{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function jh(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(i,a)=>{for(const c of i){const{name:u,type:f}=c,l=a[u],d=f.match(ic);if(d&&(typeof l=="number"||typeof l=="bigint")){const[p,w,A]=d;_(l,{signed:w==="int",size:Number.parseInt(A,10)/8})}if(f==="address"&&typeof l=="string"&&!xe(l))throw new ft({address:l});const h=f.match(El);if(h){const[p,w]=h;if(w&&K(l)!==Number.parseInt(w,10))throw new Tf({expectedSize:Number.parseInt(w,10),givenSize:K(l)})}const g=s[f];g&&(Fh(f),o(g,l))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Sh({domain:t});o(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])o(s[r],n);else throw new Th({primaryType:r,types:s})}function Oh({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Fh(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Nh({type:e})}function Rh(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:Oh({domain:t}),...e.types};jh({domain:t,message:n,primaryType:r,types:s});const o=["0x1901"];return t&&o.push(Lh({domain:t,types:s})),r!=="EIP712Domain"&&o.push(bu({data:n,primaryType:r,types:s})),te(Le(o))}function Lh({domain:e,types:t}){return bu({data:e,primaryType:"EIP712Domain",types:t})}function bu({data:e,primaryType:t,types:n}){const r=gu({data:e,primaryType:t,types:n});return te(r)}function gu({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Mh({primaryType:t,types:n})];for(const o of n[t]){const[i,a]=yu({types:n,name:o.name,type:o.type,value:e[o.name]});r.push(i),s.push(a)}return At(r,s)}function Mh({primaryType:e,types:t}){const n=ut(zh({primaryType:e,types:t}));return te(n)}function zh({primaryType:e,types:t}){let n="";const r=mu({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const o of s)n+=`${o}(${t[o].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return n}function mu({primaryType:e,types:t},n=new Set){const s=e.match(/^\w*/u)?.[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const o of t[s])mu({primaryType:o.type,types:t},n);return n}function yu({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},te(gu({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},te(r)];if(n==="string")return[{type:"bytes32"},te(ut(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),o=r.map(i=>yu({name:t,type:s,types:e,value:i}));return[{type:"bytes32"},te(At(o.map(([i])=>i),o.map(([,i])=>i)))]}return[{type:n},r]}class Uh extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const _h={checksum:new Uh(8192)},Jr=_h.checksum;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hh(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ki(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function cr(e,...t){if(!Hh(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function $i(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Dh(e,t){cr(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Gh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function wu(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Vh=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function qh(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Wh(e){for(let t=0;t<e.length;t++)e[t]=qh(e[t]);return e}const Bi=Vh?e=>e:Wh;function Zh(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function xu(e){return typeof e=="string"&&(e=Zh(e)),cr(e),e}let Kh=class{};function Yh(e){const t=r=>e().update(xu(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Kn=BigInt(2**32-1),Ci=BigInt(32);function Jh(e,t=!1){return t?{h:Number(e&Kn),l:Number(e>>Ci&Kn)}:{h:Number(e>>Ci&Kn)|0,l:Number(e&Kn)|0}}function Xh(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:i,l:a}=Jh(e[o],t);[r[o],s[o]]=[i,a]}return[r,s]}const Qh=(e,t,n)=>e<<n|t>>>32-n,ep=(e,t,n)=>t<<n|e>>>32-n,tp=(e,t,n)=>t<<n-32|e>>>64-n,np=(e,t,n)=>e<<n-32|t>>>64-n,rp=BigInt(0),Xt=BigInt(1),sp=BigInt(2),op=BigInt(7),ip=BigInt(256),ap=BigInt(113),vu=[],Eu=[],Au=[];for(let e=0,t=Xt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vu.push(2*(5*r+n)),Eu.push((e+1)*(e+2)/2%64);let s=rp;for(let o=0;o<7;o++)t=(t<<Xt^(t>>op)*ap)%ip,t&sp&&(s^=Xt<<(Xt<<BigInt(o))-Xt);Au.push(s)}const Pu=Xh(Au,!0),cp=Pu[0],up=Pu[1],Si=(e,t,n)=>n>32?tp(e,t,n):Qh(e,t,n),Ti=(e,t,n)=>n>32?np(e,t,n):ep(e,t,n);function fp(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],f=n[c+1],l=Si(u,f,1)^n[a],d=Ti(u,f,1)^n[a+1];for(let h=0;h<50;h+=10)e[i+h]^=l,e[i+h+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=Eu[i],c=Si(s,o,a),u=Ti(s,o,a),f=vu[i];s=e[f],o=e[f+1],e[f]=c,e[f+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=cp[r],e[1]^=up[r]}wu(n)}class Io extends Kh{constructor(t,n,r,s=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,ki(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Gh(this.state)}clone(){return this._cloneInto()}keccak(){Bi(this.state32),fp(this.state32,this.rounds),Bi(this.state32),this.posOut=0,this.pos=0}update(t){$i(this),t=xu(t),cr(t);const{blockLen:n,state:r}=this,s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let a=0;a<i;a++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){$i(this,!1),cr(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ki(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Dh(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,wu(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new Io(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const lp=(e,t,n)=>Yh(()=>new Io(t,e,n)),dp=lp(1,136,256/8);function Iu(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=dp(r1(e));return n==="Bytes"?r:Ie(r)}const hp=/^0x[a-fA-F0-9]{40}$/;function Nr(e,t={}){const{strict:n=!0}=t;if(!hp.test(e))throw new Ni({address:e,cause:new pp});if(n){if(e.toLowerCase()===e)return;if(ku(e)!==e)throw new Ni({address:e,cause:new bp})}}function ku(e){if(Jr.has(e))return Jr.get(e);Nr(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Iu(o1(t),{as:"Bytes"}),r=t.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(n[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const s=`0x${r.join("")}`;return Jr.set(e,s),s}function Ls(e,t={}){const{strict:n=!0}=t??{};try{return Nr(e,{strict:n}),!0}catch{return!1}}class Ni extends D{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class pp extends D{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class bp extends D{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const gp=/^(.*)\[([0-9]*)\]$/,mp=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$u=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,ji=2n**256n-1n;function zt(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=Bo(t.type);if(o){const[i,a]=o;return wp(e,{...t,type:a},{checksumAddress:r,length:i,staticPosition:s})}if(t.type==="tuple")return Ap(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return yp(e,{checksum:r});if(t.type==="bool")return xp(e);if(t.type.startsWith("bytes"))return vp(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Ep(e,t);if(t.type==="string")return Pp(e,{staticPosition:s});throw new So(t.type)}const Oi=32,Ms=32;function yp(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(o=>n?ku(o):o)(Ie(a1(r,-20))),32]}function wp(e,t,n){const{checksumAddress:r,length:s,staticPosition:o}=n;if(!s){const c=Je(e.readBytes(Ms)),u=o+c,f=u+Oi;e.setPosition(u);const l=Je(e.readBytes(Oi)),d=Bn(t);let h=0;const g=[];for(let p=0;p<l;++p){e.setPosition(f+(d?p*32:h));const[w,A]=zt(e,t,{checksumAddress:r,staticPosition:f});h+=A,g.push(w)}return e.setPosition(o+32),[g,32]}if(Bn(t)){const c=Je(e.readBytes(Ms)),u=o+c,f=[];for(let l=0;l<s;++l){e.setPosition(u+l*32);const[d]=zt(e,t,{checksumAddress:r,staticPosition:u});f.push(d)}return e.setPosition(o+32),[f,32]}let i=0;const a=[];for(let c=0;c<s;++c){const[u,f]=zt(e,t,{checksumAddress:r,staticPosition:o+i});i+=f,a.push(u)}return[a,i]}function xp(e){return[u1(e.readBytes(32),{size:32}),32]}function vp(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=Je(e.readBytes(32));e.setPosition(n+i);const a=Je(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[Ie(c),32]}return[Ie(e.readBytes(Number.parseInt(s,10),32)),32]}function Ep(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?c1(s,{signed:n}):Je(s,{signed:n}),32]}function Ap(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=t.components.length===0||t.components.some(({name:c})=>!c),i=o?[]:{};let a=0;if(Bn(t)){const c=Je(e.readBytes(Ms)),u=s+c;for(let f=0;f<t.components.length;++f){const l=t.components[f];e.setPosition(u+a);const[d,h]=zt(e,l,{checksumAddress:r,staticPosition:u});a+=h,i[o?f:l?.name]=d}return e.setPosition(s+32),[i,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[f,l]=zt(e,u,{checksumAddress:r,staticPosition:s});i[o?c:u?.name]=f,a+=l}return[i,a]}function Pp(e,{staticPosition:t}){const n=Je(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Je(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=f1(Dc(o));return e.setPosition(t+32),[i,32]}function Ip({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(ko({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function ko({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Bo(r.type);if(s){const[o,i]=s;return $p(n,{checksumAddress:e,length:o,parameter:{...r,type:i}})}if(r.type==="tuple")return Np(n,{checksumAddress:e,parameter:r});if(r.type==="address")return kp(n,{checksum:e});if(r.type==="bool")return Cp(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const o=r.type.startsWith("int"),[,,i="256"]=$u.exec(r.type)??[];return Sp(n,{signed:o,size:Number(i)})}if(r.type.startsWith("bytes"))return Bp(n,{type:r.type});if(r.type==="string")return Tp(n);throw new So(r.type)}function $o(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?t+=32:t+=be(a)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push(oe(t+s,{size:32})),r.push(a),s+=be(a)):n.push(a)}return Pe(...n,...r)}function kp(e,t){const{checksum:n=!1}=t;return Nr(e,{strict:n}),{dynamic:!1,encoded:xt(e.toLowerCase())}}function $p(e,t){const{checksumAddress:n,length:r,parameter:s}=t,o=r===null;if(!Array.isArray(e))throw new _p(e);if(!o&&e.length!==r)throw new Up({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let i=!1;const a=[];for(let c=0;c<e.length;c++){const u=ko({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(i=!0),a.push(u)}if(o||i){const c=$o(a);if(o){const u=oe(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Pe(u,c):u}}if(i)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Pe(...a.map(({encoded:c})=>c))}}function Bp(e,{type:t}){const[,n]=t.split("bytes"),r=be(e);if(!n){let s=e;return r%32!==0&&(s=vt(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Pe(xt(oe(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new Cu({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:vt(e)}}function Cp(e){if(typeof e!="boolean")throw new D(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:xt(Gc(e))}}function Sp(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Wc({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:oe(e,{size:32,signed:t})}}function Tp(e){const t=yo(e),n=Math.ceil(be(t)/32),r=[];for(let s=0;s<n;s++)r.push(vt(je(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:Pe(vt(oe(be(t),{size:32})),...r)}}function Np(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const o=[];for(let i=0;i<r.components.length;i++){const a=r.components[i],c=Array.isArray(e)?i:a.name,u=ko({checksumAddress:n,parameter:a,value:e[c]});o.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?$o(o):Pe(...o.map(({encoded:i})=>i))}}function Bo(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Bn(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Bn);const n=Bo(e.type);return!!(n&&Bn({...e,type:n[1]}))}const jp={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Rp({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Fp({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Fi({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Fi({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Op(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(jp);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Fi extends D{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Fp extends D{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Rp extends D{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Lp(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,o=typeof t=="string"?Hc(t):t,i=Op(o);if(Ot(o)===0&&e.length>0)throw new zp;if(Ot(o)&&Ot(o)<32)throw new Mp({data:typeof t=="string"?t:Ie(t),parameters:e,size:Ot(o)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const f=e[u];i.setPosition(a);const[l,d]=zt(i,f,{checksumAddress:s,staticPosition:0});a+=d,r==="Array"?c.push(l):c[f.name??u]=l}return c}function Co(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Su({expectedLength:e.length,givenLength:t.length});const s=Ip({checksumAddress:r,parameters:e,values:t}),o=$o(s);return o.length===0?"0x":o}function zs(e,t){if(e.length!==t.length)throw new Su({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r];n.push(zs.encode(s,o))}return Pe(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return Nr(c),xt(c.toLowerCase(),s?32:0)}if(n==="string")return yo(r);if(n==="bytes")return r;if(n==="bool")return xt(Gc(r),s?32:1);const o=n.match($u);if(o){const[c,u,f="256"]=o,l=Number.parseInt(f,10)/8;return oe(r,{size:s?32:l,signed:u==="int"})}const i=n.match(mp);if(i){const[c,u]=i;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new Cu({expectedSize:Number.parseInt(u,10),value:r});return vt(r,s?32:0)}const a=n.match(gp);if(a&&Array.isArray(r)){const[c,u]=a,f=[];for(let l=0;l<r.length;l++)f.push(t(u,r[l],!0));return f.length===0?"0x":Pe(...f)}throw new So(n)}e.encode=t})(zs||(zs={}));function Bu(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Do(e):e}class Mp extends D{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Nt(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class zp extends D{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Up extends D{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Cu extends D{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${be(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Su extends D{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
42
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class _p extends D{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class So extends D{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}const St=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Us(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function _n(e,...t){if(!Hp(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Dp(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Us(e.outputLen),Us(e.blockLen)}function ur(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Gp(e,t){_n(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function fr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Xr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Te(e,t){return e<<32-t|e>>>t}function Vp(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function To(e){return typeof e=="string"&&(e=Vp(e)),_n(e),e}function qp(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];_n(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.length}return n}class Tu{}function Wp(e){const t=r=>e().update(To(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Zp(e=32){if(St&&typeof St.getRandomValues=="function")return St.getRandomValues(new Uint8Array(e));if(St&&typeof St.randomBytes=="function")return Uint8Array.from(St.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function Kp(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}function Yp(e,t,n){return e&t^~e&n}function Jp(e,t,n){return e&t^e&n^t&n}class Xp extends Tu{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Xr(this.buffer)}update(t){ur(this),t=To(t),_n(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let i=0;i<o;){const a=Math.min(s-this.pos,o-i);if(a===s){const c=Xr(t);for(;s<=o-i;i+=s)this.process(c,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ur(this),Gp(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:i}=this;n[i++]=128,fr(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let l=i;l<s;l++)n[l]=0;Kp(r,s-8,BigInt(this.length*8),o),this.process(r,0);const a=Xr(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,f[l],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=o,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const it=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qp=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),at=new Uint32Array(64);class eb extends Xp{constructor(t=32){super(64,t,8,!1),this.A=it[0]|0,this.B=it[1]|0,this.C=it[2]|0,this.D=it[3]|0,this.E=it[4]|0,this.F=it[5]|0,this.G=it[6]|0,this.H=it[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)at[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=at[l-15],h=at[l-2],g=Te(d,7)^Te(d,18)^d>>>3,p=Te(h,17)^Te(h,19)^h>>>10;at[l]=p+at[l-7]+g+at[l-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=Te(a,6)^Te(a,11)^Te(a,25),h=f+d+Yp(a,c,u)+Qp[l]+at[l]|0,p=(Te(r,2)^Te(r,13)^Te(r,22))+Jp(r,s,o)|0;f=u,u=c,c=a,a=i+h|0,i=o,o=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,o,i,a,c,u,f)}roundClean(){fr(at)}destroy(){this.set(0,0,0,0,0,0,0,0),fr(this.buffer)}}const tb=Wp(()=>new eb);class Nu extends Tu{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Dp(t);const r=To(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?t.create().update(r).digest():r);for(let i=0;i<o.length;i++)o[i]^=54;this.iHash.update(o),this.oHash=t.create();for(let i=0;i<o.length;i++)o[i]^=106;this.oHash.update(o),fr(o)}update(t){return ur(this),this.iHash.update(t),this}digestInto(t){ur(this),_n(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:o,blockLen:i,outputLen:a}=this;return t=t,t.finished=s,t.destroyed=o,t.blockLen=i,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ju=(e,t,n)=>new Nu(e,t).update(n).digest();ju.create=(e,t)=>new Nu(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ue=BigInt(0),ie=BigInt(1),bt=BigInt(2),nb=BigInt(3),Ou=BigInt(4),Fu=BigInt(5),Ru=BigInt(8);function ce(e,t){const n=e%t;return n>=ue?n:t+n}function me(e,t,n){let r=e;for(;t-- >ue;)r*=r,r%=n;return r}function _s(e,t){if(e===ue)throw new Error("invert: expected non-zero number");if(t<=ue)throw new Error("invert: expected positive modulus, got "+t);let n=ce(e,t),r=t,s=ue,o=ie;for(;n!==ue;){const a=r/n,c=r%n,u=s-o*a;r=n,n=c,s=o,o=u}if(r!==ie)throw new Error("invert: does not exist");return ce(s,t)}function Lu(e,t){const n=(e.ORDER+ie)/Ou,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function rb(e,t){const n=(e.ORDER-Fu)/Ru,r=e.mul(t,bt),s=e.pow(r,n),o=e.mul(t,s),i=e.mul(e.mul(o,bt),s),a=e.mul(o,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function sb(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-ie,n=0;for(;t%bt===ue;)t/=bt,n++;let r=bt;const s=No(e);for(;Ri(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Lu;let o=s.pow(r,t);const i=(t+ie)/bt;return function(c,u){if(c.is0(u))return u;if(Ri(c,u)!==1)throw new Error("Cannot find square root");let f=n,l=c.mul(c.ONE,o),d=c.pow(u,t),h=c.pow(u,i);for(;!c.eql(d,c.ONE);){if(c.is0(d))return c.ZERO;let g=1,p=c.sqr(d);for(;!c.eql(p,c.ONE);)if(g++,p=c.sqr(p),g===f)throw new Error("Cannot find square root");const w=ie<<BigInt(f-g-1),A=c.pow(l,w);f=g,l=c.sqr(A),d=c.mul(d,l),h=c.mul(h,A)}return h}}function ob(e){return e%Ou===nb?Lu:e%Ru===Fu?rb:sb(e)}const ib=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ab(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=ib.reduce((r,s)=>(r[s]="function",r),t);return Ir(e,n)}function cb(e,t,n){if(n<ue)throw new Error("invalid exponent, negatives unsupported");if(n===ue)return e.ONE;if(n===ie)return t;let r=e.ONE,s=t;for(;n>ue;)n&ie&&(r=e.mul(r,s)),s=e.sqr(s),n>>=ie;return r}function Mu(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),s=t.reduce((i,a,c)=>e.is0(a)?i:(r[c]=i,e.mul(i,a)),e.ONE),o=e.inv(s);return t.reduceRight((i,a,c)=>e.is0(a)?i:(r[c]=e.mul(i,r[c]),e.mul(i,a)),o),r}function Ri(e,t){const n=(e.ORDER-ie)/bt,r=e.pow(t,n),s=e.eql(r,e.ONE),o=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!s&&!o&&!i)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function zu(e,t){t!==void 0&&Us(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function No(e,t,n=!1,r={}){if(e<=ue)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:o}=zu(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const a=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:o,MASK:Pr(s),ZERO:ue,ONE:ie,create:c=>ce(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return ue<=c&&c<e},is0:c=>c===ue,isOdd:c=>(c&ie)===ie,neg:c=>ce(-c,e),eql:(c,u)=>c===u,sqr:c=>ce(c*c,e),add:(c,u)=>ce(c+u,e),sub:(c,u)=>ce(c-u,e),mul:(c,u)=>ce(c*u,e),pow:(c,u)=>cb(a,c,u),div:(c,u)=>ce(c*_s(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>_s(c,e),sqrt:r.sqrt||(c=>(i||(i=ob(e)),i(a,c))),toBytes:c=>n?Lc(c,o):Ln(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return n?Rc(c):yt(c)},invertBatch:c=>Mu(a,c),cmov:(c,u,f)=>f?u:c});return Object.freeze(a)}function Uu(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function _u(e){const t=Uu(e);return t+Math.ceil(t/2)}function ub(e,t,n=!1){const r=e.length,s=Uu(t),o=_u(t);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const i=n?Rc(e):yt(e),a=ce(i,t-ie)+ie;return n?Lc(a,s):Ln(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Li=BigInt(0),Hs=BigInt(1);function Qr(e,t){const n=t.negate();return e?n:t}function Hu(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function es(e,t){Hu(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,o=Pr(e),i=BigInt(e);return{windows:n,windowSize:r,mask:o,maxNumber:s,shiftBy:i}}function Mi(e,t,n){const{windowSize:r,mask:s,maxNumber:o,shiftBy:i}=n;let a=Number(e&s),c=e>>i;a>r&&(a-=o,c+=Hs);const u=t*r,f=u+Math.abs(a)-1,l=a===0,d=a<0,h=t%2!==0;return{nextN:c,offset:f,isZero:l,isNeg:d,isNegF:h,offsetF:u}}function fb(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function lb(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const ts=new WeakMap,Du=new WeakMap;function ns(e){return Du.get(e)||1}function db(e,t){return{constTimeNegate:Qr,hasPrecomputes(n){return ns(n)!==1},unsafeLadder(n,r,s=e.ZERO){let o=n;for(;r>Li;)r&Hs&&(s=s.add(o)),o=o.double(),r>>=Hs;return s},precomputeWindow(n,r){const{windows:s,windowSize:o}=es(r,t),i=[];let a=n,c=a;for(let u=0;u<s;u++){c=a,i.push(c);for(let f=1;f<o;f++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(n,r,s){let o=e.ZERO,i=e.BASE;const a=es(n,t);for(let c=0;c<a.windows;c++){const{nextN:u,offset:f,isZero:l,isNeg:d,isNegF:h,offsetF:g}=Mi(s,c,a);s=u,l?i=i.add(Qr(h,r[g])):o=o.add(Qr(d,r[f]))}return{p:o,f:i}},wNAFUnsafe(n,r,s,o=e.ZERO){const i=es(n,t);for(let a=0;a<i.windows&&s!==Li;a++){const{nextN:c,offset:u,isZero:f,isNeg:l}=Mi(s,a,i);if(s=c,!f){const d=r[u];o=o.add(l?d.negate():d)}}return o},getPrecomputes(n,r,s){let o=ts.get(r);return o||(o=this.precomputeWindow(r,n),n!==1&&ts.set(r,s(o))),o},wNAFCached(n,r,s){const o=ns(n);return this.wNAF(o,this.getPrecomputes(o,n,s),r)},wNAFCachedUnsafe(n,r,s,o){const i=ns(n);return i===1?this.unsafeLadder(n,r,o):this.wNAFUnsafe(i,this.getPrecomputes(i,n,s),r,o)},setWindowSize(n,r){Hu(r,t),Du.set(n,r),ts.delete(n)}}}function hb(e,t,n,r){fb(n,e),lb(r,t);const s=n.length,o=r.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,a=qd(BigInt(s));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=Pr(c),f=new Array(Number(u)+1).fill(i),l=Math.floor((t.BITS-1)/c)*c;let d=i;for(let h=l;h>=0;h-=c){f.fill(i);for(let p=0;p<o;p++){const w=r[p],A=Number(w>>BigInt(h)&u);f[A]=f[A].add(n[p])}let g=i;for(let p=f.length-1,w=i;p>0;p--)w=w.add(f[p]),g=g.add(w);if(d=d.add(g),h!==0)for(let p=0;p<c;p++)d=d.double()}return d}function Gu(e){return ab(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...zu(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zi(e){e.lowS!==void 0&&kn("lowS",e.lowS),e.prehash!==void 0&&kn("prehash",e.prehash)}function pb(e){const t=Gu(e);Ir(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class bb extends Error{constructor(t=""){super(t)}}const Ze={Err:bb,_tlv:{encode:(e,t)=>{const{Err:n}=Ze;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=Vn(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const o=r>127?Vn(s.length/2|128):"";return Vn(e)+o+s+t},decode(e,t){const{Err:n}=Ze;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],o=!!(s&128);let i=0;if(!o)i=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)i=i<<8|f;if(r+=c,i<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+i);if(a.length!==i)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Ze;if(e<Ke)throw new t("integer: negative integers are not allowed");let n=Vn(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ze;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return yt(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ze,s=we("signature",e),{v:o,l:i}=r.decode(48,s);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,o),{v:u,l:f}=r.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Ze,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),o=r+s;return t.encode(48,o)}};function rs(e,t){return $n(Ln(e,t))}const Ke=BigInt(0),Q=BigInt(1);BigInt(2);const ss=BigInt(3),gb=BigInt(4);function mb(e){const t=pb(e),{Fp:n}=t,r=No(t.n,t.nBitLength),s=t.toBytes||((v,m,y)=>{const P=m.toAffine();return ir(Uint8Array.from([4]),n.toBytes(P.x),n.toBytes(P.y))}),o=t.fromBytes||(v=>{const m=v.subarray(1),y=n.fromBytes(m.subarray(0,n.BYTES)),P=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:y,y:P}});function i(v){const{a:m,b:y}=t,P=n.sqr(v),x=n.mul(P,v);return n.add(n.add(x,n.mul(v,m)),y)}function a(v,m){const y=n.sqr(m),P=i(v);return n.eql(y,P)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(t.a,ss),gb),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,u)))throw new Error("bad curve params: a or b");function f(v){return mo(v,Q,t.n)}function l(v){const{allowedPrivateKeyLengths:m,nByteLength:y,wrapPrivateKey:P,n:x}=t;if(m&&typeof v!="bigint"){if(Rn(v)&&(v=$n(v)),typeof v!="string"||!m.includes(v.length))throw new Error("invalid private key");v=v.padStart(y*2,"0")}let I;try{I=typeof v=="bigint"?v:yt(we("private key",v,y))}catch{throw new Error("invalid private key, expected hex or "+y+" bytes, got "+typeof v)}return P&&(I=ce(I,x)),Mt("private key",I,Q,x),I}function d(v){if(!(v instanceof p))throw new Error("ProjectivePoint expected")}const h=bi((v,m)=>{const{px:y,py:P,pz:x}=v;if(n.eql(x,n.ONE))return{x:y,y:P};const I=v.is0();m==null&&(m=I?n.ONE:n.inv(x));const T=n.mul(y,m),E=n.mul(P,m),k=n.mul(x,m);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:T,y:E}}),g=bi(v=>{if(v.is0()){if(t.allowInfinityPoint&&!n.is0(v.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=v.toAffine();if(!n.isValid(m)||!n.isValid(y))throw new Error("bad point: x or y not FE");if(!a(m,y))throw new Error("bad point: equation left != right");if(!v.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(m,y,P){if(m==null||!n.isValid(m))throw new Error("x required");if(y==null||!n.isValid(y)||n.is0(y))throw new Error("y required");if(P==null||!n.isValid(P))throw new Error("z required");this.px=m,this.py=y,this.pz=P,Object.freeze(this)}static fromAffine(m){const{x:y,y:P}=m||{};if(!m||!n.isValid(y)||!n.isValid(P))throw new Error("invalid affine point");if(m instanceof p)throw new Error("projective point not allowed");const x=I=>n.eql(I,n.ZERO);return x(y)&&x(P)?p.ZERO:new p(y,P,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=Mu(n,m.map(P=>P.pz));return m.map((P,x)=>P.toAffine(y[x])).map(p.fromAffine)}static fromHex(m){const y=p.fromAffine(o(we("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return p.BASE.multiply(l(m))}static msm(m,y){return hb(p,r,m,y)}_setWindowSize(m){$.setWindowSize(this,m)}assertValidity(){g(this)}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:P,pz:x}=this,{px:I,py:T,pz:E}=m,k=n.eql(n.mul(y,E),n.mul(I,x)),N=n.eql(n.mul(P,E),n.mul(T,x));return k&&N}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,P=n.mul(y,ss),{px:x,py:I,pz:T}=this;let E=n.ZERO,k=n.ZERO,N=n.ZERO,F=n.mul(x,x),G=n.mul(I,I),S=n.mul(T,T),C=n.mul(x,I);return C=n.add(C,C),N=n.mul(x,T),N=n.add(N,N),E=n.mul(m,N),k=n.mul(P,S),k=n.add(E,k),E=n.sub(G,k),k=n.add(G,k),k=n.mul(E,k),E=n.mul(C,E),N=n.mul(P,N),S=n.mul(m,S),C=n.sub(F,S),C=n.mul(m,C),C=n.add(C,N),N=n.add(F,F),F=n.add(N,F),F=n.add(F,S),F=n.mul(F,C),k=n.add(k,F),S=n.mul(I,T),S=n.add(S,S),F=n.mul(S,C),E=n.sub(E,F),N=n.mul(S,G),N=n.add(N,N),N=n.add(N,N),new p(E,k,N)}add(m){d(m);const{px:y,py:P,pz:x}=this,{px:I,py:T,pz:E}=m;let k=n.ZERO,N=n.ZERO,F=n.ZERO;const G=t.a,S=n.mul(t.b,ss);let C=n.mul(y,I),M=n.mul(P,T),j=n.mul(x,E),L=n.add(y,P),H=n.add(I,T);L=n.mul(L,H),H=n.add(C,M),L=n.sub(L,H),H=n.add(y,x);let V=n.add(I,E);return H=n.mul(H,V),V=n.add(C,j),H=n.sub(H,V),V=n.add(P,x),k=n.add(T,E),V=n.mul(V,k),k=n.add(M,j),V=n.sub(V,k),F=n.mul(G,H),k=n.mul(S,j),F=n.add(k,F),k=n.sub(M,F),F=n.add(M,F),N=n.mul(k,F),M=n.add(C,C),M=n.add(M,C),j=n.mul(G,j),H=n.mul(S,H),M=n.add(M,j),j=n.sub(C,j),j=n.mul(G,j),H=n.add(H,j),C=n.mul(M,H),N=n.add(N,C),C=n.mul(V,H),k=n.mul(L,k),k=n.sub(k,C),C=n.mul(L,M),F=n.mul(V,F),F=n.add(F,C),new p(k,N,F)}subtract(m){return this.add(m.negate())}is0(){return this.equals(p.ZERO)}wNAF(m){return $.wNAFCached(this,m,p.normalizeZ)}multiplyUnsafe(m){const{endo:y,n:P}=t;Mt("scalar",m,Ke,P);const x=p.ZERO;if(m===Ke)return x;if(this.is0()||m===Q)return this;if(!y||$.hasPrecomputes(this))return $.wNAFCachedUnsafe(this,m,p.normalizeZ);let{k1neg:I,k1:T,k2neg:E,k2:k}=y.splitScalar(m),N=x,F=x,G=this;for(;T>Ke||k>Ke;)T&Q&&(N=N.add(G)),k&Q&&(F=F.add(G)),G=G.double(),T>>=Q,k>>=Q;return I&&(N=N.negate()),E&&(F=F.negate()),F=new p(n.mul(F.px,y.beta),F.py,F.pz),N.add(F)}multiply(m){const{endo:y,n:P}=t;Mt("scalar",m,Q,P);let x,I;if(y){const{k1neg:T,k1:E,k2neg:k,k2:N}=y.splitScalar(m);let{p:F,f:G}=this.wNAF(E),{p:S,f:C}=this.wNAF(N);F=$.constTimeNegate(T,F),S=$.constTimeNegate(k,S),S=new p(n.mul(S.px,y.beta),S.py,S.pz),x=F.add(S),I=G.add(C)}else{const{p:T,f:E}=this.wNAF(m);x=T,I=E}return p.normalizeZ([x,I])[0]}multiplyAndAddUnsafe(m,y,P){const x=p.BASE,I=(E,k)=>k===Ke||k===Q||!E.equals(x)?E.multiplyUnsafe(k):E.multiply(k),T=I(this,y).add(I(m,P));return T.is0()?void 0:T}toAffine(m){return h(this,m)}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===Q)return!0;if(y)return y(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===Q?this:y?y(p,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return kn("isCompressed",m),this.assertValidity(),s(p,this,m)}toHex(m=!0){return kn("isCompressed",m),$n(this.toRawBytes(m))}}p.BASE=new p(t.Gx,t.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:A}=t,$=db(p,w?Math.ceil(A/2):A);return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:f}}function yb(e){const t=Gu(e);return Ir(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function wb(e){const t=yb(e),{Fp:n,n:r,nByteLength:s,nBitLength:o}=t,i=n.BYTES+1,a=2*n.BYTES+1;function c(S){return ce(S,r)}function u(S){return _s(S,r)}const{ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:d,isWithinCurveOrder:h}=mb({...t,toBytes(S,C,M){const j=C.toAffine(),L=n.toBytes(j.x),H=ir;return kn("isCompressed",M),M?H(Uint8Array.from([C.hasEvenY()?2:3]),L):H(Uint8Array.from([4]),L,n.toBytes(j.y))},fromBytes(S){const C=S.length,M=S[0],j=S.subarray(1);if(C===i&&(M===2||M===3)){const L=yt(j);if(!mo(L,Q,n.ORDER))throw new Error("Point is not on curve");const H=d(L);let V;try{V=n.sqrt(H)}catch(re){const Y=re instanceof Error?": "+re.message:"";throw new Error("Point is not on curve"+Y)}const W=(V&Q)===Q;return(M&1)===1!==W&&(V=n.neg(V)),{x:L,y:V}}else if(C===a&&M===4){const L=n.fromBytes(j.subarray(0,n.BYTES)),H=n.fromBytes(j.subarray(n.BYTES,2*n.BYTES));return{x:L,y:H}}else{const L=i,H=a;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+H+", got "+C)}}});function g(S){const C=r>>Q;return S>C}function p(S){return g(S)?c(-S):S}const w=(S,C,M)=>yt(S.slice(C,M));class A{constructor(C,M,j){Mt("r",C,Q,r),Mt("s",M,Q,r),this.r=C,this.s=M,j!=null&&(this.recovery=j),Object.freeze(this)}static fromCompact(C){const M=s;return C=we("compactSignature",C,M*2),new A(w(C,0,M),w(C,M,2*M))}static fromDER(C){const{r:M,s:j}=Ze.toSig(we("DER",C));return new A(M,j)}assertValidity(){}addRecoveryBit(C){return new A(this.r,this.s,C)}recoverPublicKey(C){const{r:M,s:j,recovery:L}=this,H=x(we("msgHash",C));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const V=L===2||L===3?M+t.n:M;if(V>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const W=L&1?"03":"02",J=f.fromHex(W+rs(V,n.BYTES)),re=u(V),Y=c(-H*re),ze=c(j*re),ve=f.BASE.multiplyAndAddUnsafe(J,Y,ze);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return or(this.toDERHex())}toDERHex(){return Ze.hexFromSig(this)}toCompactRawBytes(){return or(this.toCompactHex())}toCompactHex(){const C=s;return rs(this.r,C)+rs(this.s,C)}}const $={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const S=_u(t.n);return ub(t.randomBytes(S),t.n)},precompute(S=8,C=f.BASE){return C._setWindowSize(S),C.multiply(BigInt(3)),C}};function v(S,C=!0){return f.fromPrivateKey(S).toRawBytes(C)}function m(S){if(typeof S=="bigint")return!1;if(S instanceof f)return!0;const M=we("key",S).length,j=n.BYTES,L=j+1,H=2*j+1;if(!(t.allowedPrivateKeyLengths||s===L))return M===L||M===H}function y(S,C,M=!0){if(m(S)===!0)throw new Error("first arg must be private key");if(m(C)===!1)throw new Error("second arg must be public key");return f.fromHex(C).multiply(l(S)).toRawBytes(M)}const P=t.bits2int||function(S){if(S.length>8192)throw new Error("input is too large");const C=yt(S),M=S.length*8-o;return M>0?C>>BigInt(M):C},x=t.bits2int_modN||function(S){return c(P(S))},I=Pr(o);function T(S){return Mt("num < 2^"+o,S,Ke,I),Ln(S,s)}function E(S,C,M=k){if(["recovered","canonical"].some(Ce=>Ce in M))throw new Error("sign() legacy options not supported");const{hash:j,randomBytes:L}=t;let{lowS:H,prehash:V,extraEntropy:W}=M;H==null&&(H=!0),S=we("msgHash",S),zi(M),V&&(S=we("prehashed msgHash",j(S)));const J=x(S),re=l(C),Y=[T(re),T(J)];if(W!=null&&W!==!1){const Ce=W===!0?L(n.BYTES):W;Y.push(we("extraEntropy",Ce))}const ze=ir(...Y),ve=J;function nt(Ce){const Ue=P(Ce);if(!h(Ue))return;const $t=u(Ue),rt=f.BASE.multiply(Ue).toAffine(),_e=c(rt.x);if(_e===Ke)return;const He=c($t*c(ve+_e*re));if(He===Ke)return;let De=(rt.x===_e?0:2)|Number(rt.y&Q),Dn=He;return H&&g(He)&&(Dn=p(He),De^=1),new A(_e,Dn,De)}return{seed:ze,k2sig:nt}}const k={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function F(S,C,M=k){const{seed:j,k2sig:L}=E(S,C,M),H=t;return Wd(H.hash.outputLen,H.nByteLength,H.hmac)(j,L)}f.BASE._setWindowSize(8);function G(S,C,M,j=N){const L=S;C=we("msgHash",C),M=we("publicKey",M);const{lowS:H,prehash:V,format:W}=j;if(zi(j),"strict"in j)throw new Error("options.strict was renamed to lowS");if(W!==void 0&&W!=="compact"&&W!=="der")throw new Error("format must be compact or der");const J=typeof L=="string"||Rn(L),re=!J&&!W&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!J&&!re)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,ze;try{if(re&&(Y=new A(L.r,L.s)),J){try{W!=="compact"&&(Y=A.fromDER(L))}catch(De){if(!(De instanceof Ze.Err))throw De}!Y&&W!=="der"&&(Y=A.fromCompact(L))}ze=f.fromHex(M)}catch{return!1}if(!Y||H&&Y.hasHighS())return!1;V&&(C=t.hash(C));const{r:ve,s:nt}=Y,Ce=x(C),Ue=u(nt),$t=c(Ce*Ue),rt=c(ve*Ue),_e=f.BASE.multiplyAndAddUnsafe(ze,$t,rt)?.toAffine();return _e?c(_e.x)===ve:!1}return{CURVE:t,getPublicKey:v,getSharedSecret:y,sign:F,verify:G,ProjectivePoint:f,Signature:A,utils:$}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xb(e){return{hash:e,hmac:(t,...n)=>ju(e,t,qp(...n)),randomBytes:Zp}}function vb(e,t){const n=r=>wb({...e,...xb(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vu=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ui=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Eb=BigInt(0),Ab=BigInt(1),Ds=BigInt(2),_i=(e,t)=>(e+t/Ds)/t;function Pb(e){const t=Vu,n=BigInt(3),r=BigInt(6),s=BigInt(11),o=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,f=u*u*e%t,l=me(f,n,t)*f%t,d=me(l,n,t)*f%t,h=me(d,Ds,t)*u%t,g=me(h,s,t)*h%t,p=me(g,o,t)*g%t,w=me(p,a,t)*p%t,A=me(w,c,t)*w%t,$=me(A,a,t)*p%t,v=me($,n,t)*f%t,m=me(v,i,t)*g%t,y=me(m,r,t)*u%t,P=me(y,Ds,t);if(!Gs.eql(Gs.sqr(P),e))throw new Error("Cannot find square root");return P}const Gs=No(Vu,void 0,void 0,{sqrt:Pb}),qu=vb({a:Eb,b:BigInt(7),Fp:Gs,n:Ui,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ui,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ab*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,i=BigInt("0x100000000000000000000000000000000"),a=_i(o*e,t),c=_i(-r*e,t);let u=ce(e-a*n-c*s,t),f=ce(-a*r-c*o,t);const l=u>i,d=f>i;if(l&&(u=t-u),d&&(f=t-f),u>i||f>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:u,k2neg:d,k2:f}}}},tb),Ib=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:qu},Symbol.toStringTag,{value:"Module"}));function Wu(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new os({signature:e});if(typeof e.s>"u")throw new os({signature:e});if(n&&typeof e.yParity>"u")throw new os({signature:e});if(e.r<0n||e.r>ji)throw new Nb({value:e.r});if(e.s<0n||e.s>ji)throw new jb({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Oo({value:e.yParity})}function kb(e){return Zu(Ie(e))}function Zu(e){if(e.length!==130&&e.length!==132)throw new Tb({signature:e});const t=BigInt(je(e,0,32)),n=BigInt(je(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return jo(s)}catch{throw new Oo({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function $b(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Bb(e)}function Bb(e){const t=typeof e=="string"?Zu(e):e instanceof Uint8Array?kb(e):typeof e.r=="string"?Sb(e):e.v?Cb(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Wu(t),t}function Cb(e){return{r:e.r,s:e.s,yParity:jo(e.v)}}function Sb(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=jo(n)),typeof r!="number")throw new Oo({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function jo(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new Ob({value:e})}class Tb extends D{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${be(y1(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class os extends D{constructor({signature:t}){super(`Signature \`${_c(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Nb extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class jb extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Oo extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Ob extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function Fb(e,t={}){return typeof e.chainId=="string"?Rb(e):{...e,...t.signature}}function Rb(e){const{address:t,chainId:n,nonce:r}=e,s=$b(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}const Lb="0x8010801080108010801080108010801080108010801080108010801080108010",Mb=Bu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function Ku(e){if(typeof e=="string"){if(je(e,-32)!==Lb)throw new _b(e)}else Wu(e.authorization)}function zb(e){Ku(e);const t=qc(je(e,-64,-32)),n=je(e,-t-64,-64),r=je(e,0,-t-64),[s,o,i]=Lp(Mb,n);return{authorization:Fb({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...i&&i!=="0x"?{data:i,to:o}:{}}}function Ub(e){try{return Ku(e),!0}catch{return!1}}let _b=class extends D{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};function Hb(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function Db(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Qe(e.nonce):void 0,storageProof:e.storageProof?Hb(e.storageProof):void 0}}async function Gb(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const o=r??"latest",i=n!==void 0?_(n):void 0,a=await e.request({method:"eth_getProof",params:[t,s,i||o]});return Db(a)}async function Vb(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const o=n!==void 0?_(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,o||r]})}async function Fo(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o,sender:i,nonce:a}){const c=r||"latest",u=n!==void 0?_(n):void 0;let f=null;if(s?f=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?f=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,_(o)]},{dedupe:!0}):typeof o=="number"?f=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||c,_(o)]},{dedupe:!!u}):i&&typeof a=="number"&&(f=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,_(a)]},{dedupe:!0})),!f)throw new hc({blockHash:t,blockNumber:n,blockTag:c,hash:s,index:o});return(e.chain?.formatters?.transaction?.format||ao)(f,"getTransaction")}async function qb(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([U(e,Un,"getBlockNumber")({}),t?U(e,Fo,"getTransaction")({hash:t}):void 0]),o=n?.blockNumber||s?.blockNumber;return o?r-o+1n:0n}async function Xn(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new pc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||ou)(n,"getTransactionReceipt")}async function Wb(e,t){const{account:n,authorizationList:r,allowFailure:s=!0,blockNumber:o,blockOverrides:i,blockTag:a,stateOverride:c}=t,u=t.contracts,{batchSize:f=t.batchSize??1024,deployless:l=t.deployless??!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},d=(()=>{if(t.multicallAddress)return t.multicallAddress;if(l)return null;if(e.chain)return Kt({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let g=0,p=0;for(let $=0;$<u.length;$++){const{abi:v,address:m,args:y,functionName:P}=u[$];try{const x=Be({abi:v,args:y,functionName:P});p+=(x.length-2)/2,f>0&&p>f&&h[g].length>0&&(g++,p=(x.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:x,target:m}]}catch(x){const I=Dt(x,{abi:v,address:m,args:y,docsPath:"/docs/contract/multicall",functionName:P,sender:n});if(!s)throw I;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:m}]}}const w=await Promise.allSettled(h.map($=>U(e,ke,"readContract")({...d===null?{code:wo}:{address:d},abi:ar,account:n,args:[$],authorizationList:r,blockNumber:o,blockOverrides:i,blockTag:a,functionName:"aggregate3",stateOverride:c}))),A=[];for(let $=0;$<w.length;$++){const v=w[$];if(v.status==="rejected"){if(!s)throw v.reason;for(let y=0;y<h[$].length;y++)A.push({status:"failure",error:v.reason,result:void 0});continue}const m=v.value;for(let y=0;y<m.length;y++){const{returnData:P,success:x}=m[y],{callData:I}=h[$][y],{abi:T,address:E,functionName:k,args:N}=u[A.length];try{if(I==="0x")throw new Cn;if(!x)throw new xr({data:P});const F=It({abi:T,args:N,data:P,functionName:k});A.push(s?{result:F,status:"success"}:F)}catch(F){const G=Dt(F,{abi:T,address:E,args:N,docsPath:"/docs/contract/multicall",functionName:k});if(!s)throw G;A.push({error:G,result:void 0,status:"failure"})}}}if(A.length!==u.length)throw new B("multicall results mismatch");return A}async function Vs(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:o,traceTransfers:i,validation:a}=t;try{const c=[];for(const d of s){const h=d.blockOverrides?Kc(d.blockOverrides):void 0,g=d.calls.map(w=>{const A=w,$=A.account?pe(A.account):void 0,v=A.abi?Be(A):A.data,m={...A,account:$,data:A.dataSuffix?Le([v||"0x",A.dataSuffix]):v,from:A.from??$?.address};return Zt(m),Fn(m)}),p=d.stateOverrides?oo(d.stateOverrides):void 0;c.push({blockOverrides:h,calls:g,stateOverrides:p})}const f=(typeof n=="bigint"?_(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:o,traceTransfers:i,validation:a},f]})).map((d,h)=>({...Pc(d),calls:d.calls.map((g,p)=>{const{abi:w,args:A,functionName:$,to:v}=s[h].calls[p],m=g.error?.data??g.returnData,y=BigInt(g.gasUsed),P=g.logs?.map(E=>et(E)),x=g.status==="0x1"?"success":"failure",I=w&&x==="success"&&m!=="0x"?It({abi:w,data:m,functionName:$}):null,T=(()=>{if(x==="success")return;let E;if(g.error?.data==="0x"?E=new Cn:g.error&&(E=new xr(g.error)),!!E)return Dt(E,{abi:w??[],address:v??"0x",args:A,functionName:$??"<unknown>"})})();return{data:m,gasUsed:y,logs:P,status:x,...x==="success"?{result:I}:{error:T}}})}))}catch(c){const u=c,f=vr(u,{});throw f instanceof On?u:f}}function qs(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){o=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!o)throw new D("Unable to normalize signature.");return s}function Ws(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ls(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>Ws(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Ws(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Yu(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return Yu(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Ls(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Ls(n[r],{strict:!1}):!1)return i}}function Ju(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Ho(e):e;return{...r,...n?{hash:Ft(r)}:{}}}function jr(e,t,n){const{args:r=[],prepare:s=!0}=n??{},o=w1(t,{strict:!1}),i=e.filter(u=>o?u.type==="function"||u.type==="error"?Xu(u)===je(t,0,4):u.type==="event"?Ft(u)===t:!1:"name"in u&&u.name===t);if(i.length===0)throw new lr({name:t});if(i.length===1)return{...i[0],...s?{hash:Ft(i[0])}:{}};let a;for(const u of i){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:Ft(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((l,d)=>{const h="inputs"in u&&u.inputs[d];return h?Ws(l,h):!1})){if(a&&"inputs"in a&&a.inputs){const l=Yu(u.inputs,a.inputs,r);if(l)throw new Kb({abiItem:u,type:l[0]},{abiItem:a,type:l[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...f]=i;return{...u,overloads:f}})();if(!c)throw new lr({name:t});return{...c,...s?{hash:Ft(c)}:{}}}function Xu(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return jr(n,r)}return e[0]})();return je(Ft(t),0,4)}function Zb(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,s]=e;return jr(r,s)}return e[0]})(),n=typeof t=="string"?t:Qn(t);return qs(n)}function Ft(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return jr(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Iu(yo(Zb(t)))}class Kb extends D{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${qs(Qn(t.abiItem))}\`, and`,`\`${n.type}\` in \`${qs(Qn(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class lr extends D{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Yb(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[o,i]=e;return[Xb(o),i]}return e})(),{bytecode:r,args:s}=n;return Pe(r,t.inputs?.length&&s?.length?Co(t.inputs,s):"0x")}function Jb(e){return Ju(e)}function Xb(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new lr({name:"constructor"});return t}function Qb(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[u,f,l]=e;return[Hi(u,f,{args:l}),l]}const[a,c]=e;return[a,c]})(),{overloads:r}=t,s=r?Hi([t,...r],t.name,{args:n}):t,o=e5(s),i=n.length>0?Co(s.inputs,n):void 0;return i?Pe(o,i):o}function Tt(e,t={}){return Ju(e,t)}function Hi(e,t,n){const r=jr(e,t,n);if(r.type!=="function")throw new lr({name:t,type:"function"});return r}function e5(e){return Xu(e)}const t5="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ne="0x0000000000000000000000000000000000000000",n5="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function r5(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:o,traceAssetChanges:i,traceTransfers:a,validation:c}=t,u=t.account?pe(t.account):void 0;if(i&&!u)throw new B("`account` is required when `traceAssetChanges` is true");const f=u?Yb(Jb("constructor(bytes, bytes)"),{bytecode:Qc,args:[n5,Qb(Tt("function getBalance(address)"),[u.address])]}):void 0,l=i?await Promise.all(t.calls.map(async j=>{if(!j.data&&!j.abi)return;const{accessList:L}=await lu(e,{account:u.address,...j,data:j.abi?Be(j):j.data});return L.map(({address:H,storageKeys:V})=>V.length>0?H:null)})).then(j=>j.flat().filter(Boolean)):[],d=await Vs(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:f}],stateOverrides:o},{calls:l.map((j,L)=>({abi:[Tt("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:j,from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]}]:[],{calls:[...s,{}].map(j=>({...j,from:u?.address})),stateOverrides:o},...i?[{calls:[{data:f}]},{calls:l.map((j,L)=>({abi:[Tt("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:j,from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((j,L)=>({to:j,abi:[Tt("function decimals() returns (uint256)")],functionName:"decimals",from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((j,L)=>({to:j,abi:[Tt("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((j,L)=>({to:j,abi:[Tt("function symbol() returns (string)")],functionName:"symbol",from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]}]:[]],traceTransfers:a,validation:c}),h=i?d[2]:d[0],[g,p,,w,A,$,v,m]=i?d:[],{calls:y,...P}=h,x=y.slice(0,-1)??[],I=g?.calls??[],T=p?.calls??[],E=[...I,...T].map(j=>j.status==="success"?Fe(j.data):null),k=w?.calls??[],N=A?.calls??[],F=[...k,...N].map(j=>j.status==="success"?Fe(j.data):null),G=($?.calls??[]).map(j=>j.status==="success"?j.result:null),S=(m?.calls??[]).map(j=>j.status==="success"?j.result:null),C=(v?.calls??[]).map(j=>j.status==="success"?j.result:null),M=[];for(const[j,L]of F.entries()){const H=E[j];if(typeof L!="bigint"||typeof H!="bigint")continue;const V=G[j-1],W=S[j-1],J=C[j-1],re=j===0?{address:t5,decimals:18,symbol:"ETH"}:{address:l[j-1],decimals:J||V?Number(V??1):void 0,symbol:W??void 0};M.some(Y=>Y.token.address===re.address)||M.push({token:re,value:{pre:H,post:L,diff:L-H}})}return{assetChanges:M,block:P,results:x}}const Qu="0x6492649264926492649264926492649264926492649264926492649264926492";function s5(e){if(je(e,-32)!==Qu)throw new a5(e)}function o5(e){const{data:t,signature:n,to:r}=e;return Pe(Co(Bu("address, bytes, bytes"),[r,t,n]),Qu)}function i5(e){try{return s5(e),!0}catch{return!1}}class a5 extends D{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function c5({r:e,s:t,to:n="hex",v:r,yParity:s}){const o=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new qu.Signature(Fe(e),Fe(t)).toCompactHex()}${o===0?"1b":"1c"}`;return n==="hex"?i:Re(i)}async function Or(e,t){const{address:n,chain:r=e.chain,hash:s,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??r?.contracts?.erc6492Verifier?.address,multicallAddress:i=t.multicallAddress??r?.contracts?.multicall3?.address}=t;if(r?.verifyHash)return await r.verifyHash(e,t);const a=(()=>{const c=t.signature;return Oe(c)?c:typeof c=="object"&&"r"in c&&"s"in c?c5(c):X(c)})();try{return Ub(a)?await u5(e,{...t,multicallAddress:i,signature:a}):await f5(e,{...t,verifierAddress:o,signature:a})}catch(c){try{if(Ar(nc(n),await mc({hash:s,signature:a})))return!0}catch{}if(c instanceof Et)return!1;throw c}}async function u5(e,t){const{address:n,blockNumber:r,blockTag:s,hash:o,multicallAddress:i}=t,{authorization:a,data:c,signature:u,to:f}=zb(t.signature);if(await Rs(e,{address:n,blockNumber:r,blockTag:s})===Wt(["0xef0100",a.address]))return await l5(e,{address:n,blockNumber:r,blockTag:s,hash:o,signature:u});const d={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:_(a.r,{size:32}),s:_(a.s,{size:32}),yParity:a.yParity};if(!await xh({address:n,authorization:d}))throw new Et;const g=await U(e,ke,"readContract")({...i?{address:i}:{code:wo},authorizationList:[d],abi:ar,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:f??n,callData:c}]:[],{allowFailure:!0,target:n,callData:Be({abi:Xc,functionName:"isValidSignature",args:[o,u]})}]]});if(g[g.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new Et}async function f5(e,t){const{address:n,factory:r,factoryData:s,hash:o,signature:i,verifierAddress:a,...c}=t,u=await(async()=>!r&&!s||i5(i)?i:o5({data:s,signature:i,to:r}))(),f=a?{to:a,data:Be({abi:vi,functionName:"isValidSig",args:[n,o,u]}),...c}:{data:xo({abi:vi,args:[n,o,u],bytecode:k1}),...c},{data:l}=await U(e,$r,"call")(f).catch(d=>{throw d instanceof bc?new Et:d});if(Uf(l??"0x0"))return!0;throw new Et}async function l5(e,t){const{address:n,blockNumber:r,blockTag:s,hash:o,signature:i}=t;if((await U(e,ke,"readContract")({address:n,abi:Xc,args:[o,i],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof gc?new Et:c})).startsWith("0x1626ba7e"))return!0;throw new Et}class Et extends Error{}async function d5(e,{address:t,message:n,factory:r,factoryData:s,signature:o,...i}){const a=pu(n);return U(e,Or,"verifyHash")({address:t,factory:r,factoryData:s,hash:a,signature:o,...i})}async function h5(e,t){const{address:n,factory:r,factoryData:s,signature:o,message:i,primaryType:a,types:c,domain:u,...f}=t,l=Rh({message:i,primaryType:a,types:c,domain:u});return U(e,Or,"verifyHash")({address:n,factory:r,factoryData:s,hash:l,signature:o,...f})}function e0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:o,pollingInterval:i=e.pollingInterval}){const a=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let c;return a?(()=>{const l=ne(["watchBlockNumber",e.uid,t,n,i]);return dt(l,{onBlockNumber:r,onError:s},d=>zn(async()=>{try{const h=await U(e,Un,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(h===c)return;if(h-c>1&&n)for(let g=c+1n;g<h;g++)d.onBlockNumber(g,c),c=g}(c===void 0||h>c)&&(d.onBlockNumber(h,c),c=h)}catch(h){d.onError?.(h)}},{emitOnBegin:t,interval:i}))})():(()=>{const l=ne(["watchBlockNumber",e.uid,t,n]);return dt(l,{onBlockNumber:r,onError:s},d=>{let h=!0,g=()=>h=!1;return(async()=>{try{const p=(()=>{if(e.transport.type==="fallback"){const A=e.transport.transports.find($=>$.config.type==="webSocket"||$.config.type==="ipc");return A?A.value:e.transport}return e.transport})(),{unsubscribe:w}=await p.subscribe({params:["newHeads"],onData(A){if(!h)return;const $=Fe(A.result?.number);d.onBlockNumber($,c),c=$},onError(A){d.onError?.(A)}});g=w,h||g()}catch(p){s?.(p)}})(),()=>g()})})()}async function p5(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:s,onReplaced:o,retryCount:i=6,retryDelay:a=({count:y})=>~~(1<<y)*200,timeout:c=18e4}=t,u=ne(["waitForTransactionReceipt",e.uid,s]),f=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let l,d,h,g=!1,p,w;const{promise:A,resolve:$,reject:v}=nu(),m=c?setTimeout(()=>{w?.(),p?.(),v(new td({hash:s}))},c):void 0;return p=dt(u,{onReplaced:o,resolve:$,reject:v},async y=>{if(h=await U(e,Xn,"getTransactionReceipt")({hash:s}).catch(()=>{}),h&&r<=1){clearTimeout(m),y.resolve(h),p?.();return}w=U(e,e0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:f,async onBlockNumber(P){const x=T=>{clearTimeout(m),w?.(),T(),p?.()};let I=P;if(!g)try{if(h){if(r>1&&(!h.blockNumber||I-h.blockNumber+1n<r))return;x(()=>y.resolve(h));return}if(n&&!l&&(g=!0,await js(async()=>{l=await U(e,Fo,"getTransaction")({hash:s}),l.blockNumber&&(I=l.blockNumber)},{delay:a,retryCount:i}),g=!1),h=await U(e,Xn,"getTransactionReceipt")({hash:s}),r>1&&(!h.blockNumber||I-h.blockNumber+1n<r))return;x(()=>y.resolve(h))}catch(T){if(T instanceof hc||T instanceof pc){if(!l){g=!1;return}try{d=l,g=!0;const E=await js(()=>U(e,Ee,"getBlock")({blockNumber:I,includeTransactions:!0}),{delay:a,retryCount:i,shouldRetry:({error:F})=>F instanceof Ec});g=!1;const k=E.transactions.find(({from:F,nonce:G})=>F===d.from&&G===d.nonce);if(!k||(h=await U(e,Xn,"getTransactionReceipt")({hash:k.hash}),r>1&&(!h.blockNumber||I-h.blockNumber+1n<r)))return;let N="replaced";k.to===d.to&&k.value===d.value&&k.input===d.input?N="repriced":k.from===k.to&&k.value===0n&&(N="cancelled"),x(()=>{y.onReplaced?.({reason:N,replacedTransaction:d,transaction:k,transactionReceipt:h}),y.resolve(h)})}catch(E){x(()=>y.reject(E))}}else x(()=>y.reject(T))}}})}),A}function b5(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:o,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){const u=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=i??!1;let l;return u?(()=>{const g=ne(["watchBlocks",e.uid,t,n,r,f,c]);return dt(g,{onBlock:s,onError:o},p=>zn(async()=>{try{const w=await U(e,Ee,"getBlock")({blockTag:t,includeTransactions:f});if(w.number!==null&&l?.number!=null){if(w.number===l.number)return;if(w.number-l.number>1&&n)for(let A=l?.number+1n;A<w.number;A++){const $=await U(e,Ee,"getBlock")({blockNumber:A,includeTransactions:f});p.onBlock($,l),l=$}}(l?.number==null||t==="pending"&&w?.number==null||w.number!==null&&w.number>l.number)&&(p.onBlock(w,l),l=w)}catch(w){p.onError?.(w)}},{emitOnBegin:r,interval:c}))})():(()=>{let g=!0,p=!0,w=()=>g=!1;return(async()=>{try{r&&U(e,Ee,"getBlock")({blockTag:t,includeTransactions:f}).then(v=>{g&&p&&(s(v,void 0),p=!1)}).catch(o);const A=(()=>{if(e.transport.type==="fallback"){const v=e.transport.transports.find(m=>m.config.type==="webSocket"||m.config.type==="ipc");return v?v.value:e.transport}return e.transport})(),{unsubscribe:$}=await A.subscribe({params:["newHeads"],async onData(v){if(!g)return;const m=await U(e,Ee,"getBlock")({blockNumber:v.result?.number,includeTransactions:f}).catch(()=>{});g&&(s(m,l),p=!1,l=m)},onError(v){o?.(v)}});w=$,g||w()}catch(A){o?.(A)}})(),()=>w()})()}function g5(e,{address:t,args:n,batch:r=!0,event:s,events:o,fromBlock:i,onError:a,onLogs:c,poll:u,pollingInterval:f=e.pollingInterval,strict:l}){const d=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),h=l??!1;return d?(()=>{const w=ne(["watchEvent",t,n,r,e.uid,s,f,i]);return dt(w,{onLogs:c,onError:a},A=>{let $;i!==void 0&&($=i-1n);let v,m=!1;const y=zn(async()=>{if(!m){try{v=await U(e,du,"createEventFilter")({address:t,args:n,event:s,events:o,strict:h,fromBlock:i})}catch{}m=!0;return}try{let P;if(v)P=await U(e,Br,"getFilterChanges")({filter:v});else{const x=await U(e,Un,"getBlockNumber")({});$&&$!==x?P=await U(e,po,"getLogs")({address:t,args:n,event:s,events:o,fromBlock:$+1n,toBlock:x}):P=[],$=x}if(P.length===0)return;if(r)A.onLogs(P);else for(const x of P)A.onLogs([x])}catch(P){v&&P instanceof lt&&(m=!1),A.onError?.(P)}},{emitOnBegin:!0,interval:f});return async()=>{v&&await U(e,Cr,"uninstallFilter")({filter:v}),y()}})})():(()=>{let w=!0,A=()=>w=!1;return(async()=>{try{const $=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),v=o??(s?[s]:void 0);let m=[];v&&(m=[v.flatMap(x=>Tn({abi:[x],eventName:x.name,args:n}))],s&&(m=m[0]));const{unsubscribe:y}=await $.subscribe({params:["logs",{address:t,topics:m}],onData(P){if(!w)return;const x=P.result;try{const{eventName:I,args:T}=sr({abi:v??[],data:x.data,topics:x.topics,strict:h}),E=et(x,{args:T,eventName:I});c([E])}catch(I){let T,E;if(I instanceof er||I instanceof Ys){if(l)return;T=I.abiItem.name,E=I.abiItem.inputs?.some(N=>!("name"in N&&N.name))}const k=et(x,{args:E?[]:{},eventName:T});c([k])}},onError(P){a?.(P)}});A=y,w||A()}catch($){a?.($)}})(),()=>A()})()}function m5(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=ne(["watchPendingTransactions",e.uid,t,o]);return dt(u,{onTransactions:r,onError:n},f=>{let l;const d=zn(async()=>{try{if(!l)try{l=await U(e,hu,"createPendingTransactionFilter")({});return}catch(g){throw d(),g}const h=await U(e,Br,"getFilterChanges")({filter:l});if(h.length===0)return;if(t)f.onTransactions(h);else for(const g of h)f.onTransactions([g])}catch(h){f.onError?.(h)}},{emitOnBegin:!0,interval:o});return async()=>{l&&await U(e,Cr,"uninstallFilter")({filter:l}),d()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:l}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;const h=d.result;r([h])},onError(d){n?.(d)}});f=l,u||f()}catch(l){n?.(l)}})(),()=>f()})()}function y5(e){const{scheme:t,statement:n,...r}=e.match(w5)?.groups??{},{chainId:s,expirationTime:o,issuedAt:i,notBefore:a,requestId:c,...u}=e.match(x5)?.groups??{},f=e.split("Resources:")[1]?.split(`
|
|
43
|
-
- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...o?{expirationTime:new Date(o)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...f?{resources:f}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const w5=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,x5=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function v5(e){const{address:t,domain:n,message:r,nonce:s,scheme:o,time:i=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||o&&r.scheme!==o||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!xe(r.address,{strict:!1})||t&&!Ar(r.address,t))return!1}catch{return!1}return!0}async function E5(e,t){const{address:n,domain:r,message:s,nonce:o,scheme:i,signature:a,time:c=new Date,...u}=t,f=y5(s);if(!f.address||!v5({address:n,domain:r,message:f,nonce:o,scheme:i,time:c}))return!1;const d=pu(s);return Or(e,{address:f.address,hash:d,signature:a,...u})}async function A5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){const s=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,_(r)]:[t]},{retryCount:0}),i=(e.chain?.formatters?.transactionReceipt?.format||ou)(s);if(i.status==="reverted"&&n)throw new ed({receipt:i});return i}function P5(e){return{call:t=>$r(e,t),createAccessList:t=>lu(e,t),createBlockFilter:()=>fh(e),createContractEventFilter:t=>cc(e,t),createEventFilter:t=>du(e,t),createPendingTransactionFilter:()=>hu(e),estimateContractGas:t=>Hd(e,t),estimateGas:t=>lo(e,t),getBalance:t=>lh(e,t),getBlobBaseFee:()=>dh(e),getBlock:t=>Ee(e,t),getBlockNumber:t=>Un(e,t),getBlockTransactionCount:t=>hh(e,t),getBytecode:t=>Rs(e,t),getChainId:()=>fo(e),getCode:t=>Rs(e,t),getContractEvents:t=>jc(e,t),getEip712Domain:t=>bh(e,t),getEnsAddress:t=>Z1(e,t),getEnsAvatar:t=>ah(e,t),getEnsName:t=>ch(e,t),getEnsResolver:t=>uh(e,t),getEnsText:t=>fu(e,t),getFeeHistory:t=>yh(e,t),estimateFeesPerGas:t=>Ad(e,t),getFilterChanges:t=>Br(e,t),getFilterLogs:t=>wh(e,t),getGasPrice:()=>co(e),getLogs:t=>po(e,t),getProof:t=>Gb(e,t),estimateMaxPriorityFeePerGas:t=>Ed(e,t),fillTransaction:t=>Tc(e,t),getStorageAt:t=>Vb(e,t),getTransaction:t=>Fo(e,t),getTransactionConfirmations:t=>qb(e,t),getTransactionCount:t=>kc(e,t),getTransactionReceipt:t=>Xn(e,t),multicall:t=>Wb(e,t),prepareTransactionRequest:t=>Nc(e,t),readContract:t=>ke(e,t),sendRawTransaction:t=>z1(e,t),sendRawTransactionSync:t=>A5(e,t),simulate:t=>Vs(e,t),simulateBlocks:t=>Vs(e,t),simulateCalls:t=>r5(e,t),simulateContract:t=>T1(e,t),verifyHash:t=>Or(e,t),verifyMessage:t=>d5(e,t),verifySiweMessage:t=>E5(e,t),verifyTypedData:t=>h5(e,t),uninstallFilter:t=>Cr(e,t),waitForTransactionReceipt:t=>p5(e,t),watchBlocks:t=>b5(e,t),watchBlockNumber:t=>e0(e,t),watchContractEvent:t=>M1(e,t),watchEvent:t=>g5(e,t),watchPendingTransactions:t=>m5(e,t)}}function Di(e){const{key:t="public",name:n="Public Client"}=e;return _1({...e,key:t,name:n,type:"publicClient"}).extend(P5)}function I5({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:o=150,timeout:i,type:a},c){const u=iu();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:o,timeout:i,type:a},request:Eh(r,{methods:t,retryCount:s,retryDelay:o,uid:u}),value:c}}class k5 extends B{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Gi(e,t={}){const{batch:n,fetchFn:r,fetchOptions:s,key:o="http",methods:i,name:a="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:f,raw:l}=t;return({chain:d,retryCount:h,timeout:g})=>{const{batchSize:p=1e3,wait:w=0}=typeof n=="object"?n:{},A=t.retryCount??h,$=g??t.timeout??1e4,v=e||d?.rpcUrls.default.http[0];if(!v)throw new k5;const m=kh(v,{fetchFn:r,fetchOptions:s,onRequest:c,onResponse:u,timeout:$});return I5({key:o,methods:i,name:a,async request({method:y,params:P}){const x={method:y,params:P},{schedule:I}=ru({id:v,wait:w,shouldSplitBatch(N){return N.length>p},fn:N=>m.request({body:N}),sort:(N,F)=>N.id-F.id}),T=async N=>n?I(N):[await m.request({body:N})],[{error:E,result:k}]=await T(x);if(l)return{error:E,result:k};if(E)throw new so({body:x,error:E,url:v});return k},retryCount:A,retryDelay:f,timeout:$,type:"http"},{fetchOptions:s,url:v})}}const $5=Tr({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),B5=Tr({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),C5=Tr({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),S5=Tr({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),Vi={production:{ethereum:{address:"0x0f5d2fb29fb7d3cfee444a200298f468908cc942",rpc:"https://rpc.decentraland.org/mainnet"},polygon:{address:"0xA1c57f48F0Deb89f569dFbE6E2B7f46D33606fD4",rpc:"https://rpc.decentraland.org/polygon"}},development:{ethereum:{address:"0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",rpc:"https://rpc.decentraland.org/sepolia"},polygon:{address:"0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",rpc:"https://rpc.decentraland.org/amoy"}}},qi=[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]}],T5=10*60*1e3,Zs=.01;function t0(){return Aa()===us.PRODUCTION?Vi.production:Vi.development}let is=null,as=null;function N5(){if(!is||!as){const e=t0(),t=Aa();is=Di({chain:t===us.PRODUCTION?$5:S5,transport:Gi(e.ethereum.rpc)}),as=Di({chain:t===us.PRODUCTION?B5:C5,transport:Gi(e.polygon.rpc)})}return{ethClient:is,polyClient:as}}function j5(e){const[t,n]=O.useState(null),[r,s]=O.useState(!1),o=O.useRef(!1),i=O.useRef(null),a=O.useRef(e);O.useEffect(()=>{a.current=e,e?i.current&&i.current.address!==e&&n(null):(n(null),i.current=null)},[e]);const c=O.useCallback(()=>{if(!e||o.current)return;const u=i.current;if(u&&u.address===e&&Date.now()-u.fetchedAt<T5){n(u.balances);return}o.current=!0,s(!0);const f=e,l=t0(),{ethClient:d,polyClient:h}=N5();Promise.all([d.readContract({address:l.ethereum.address,abi:qi,functionName:"balanceOf",args:[f]}),h.readContract({address:l.polygon.address,abi:qi,functionName:"balanceOf",args:[f]})]).then(([g,p])=>{if(a.current!==e)return;const w={ethereum:parseFloat(sn(g)),polygon:parseFloat(sn(p))};i.current={address:e,balances:w,fetchedAt:Date.now()},n(w)}).catch(()=>{}).finally(()=>{o.current=!1,s(!1)})},[e]);return{balances:t,isLoading:r,fetchBalances:c,minDisplayBalance:Zs}}const Wi=O.memo(function(t){return b.jsxs("svg",{viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45 89.9999C69.8528 89.9999 89.9999 69.8528 89.9999 45C89.9999 20.1472 69.8528 0 45 0C20.1472 0 0 20.1472 0 45C0 69.8528 20.1472 89.9999 45 89.9999Z",fill:"url(#dcl-nav0)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 80.9996C25.515 86.6471 34.875 89.9996 45 89.9996C55.125 89.9996 64.485 86.6471 72 80.9996H18Z",fill:"#FF2D55"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 71.9996C11.565 75.397 14.603 78.435 18 80.9996H72C75.398 78.435 78.435 75.397 81 71.9996H9Z",fill:"#FFA25A"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 62.9997H3.758C5.153 66.2172 6.93 69.2322 9 71.9997H60.39V62.9997H60.368Z",fill:"#FFC95B"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.883 29.25V63H60.008L31.883 29.25Z",fill:"url(#dcl-nav1)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.758 63H31.883V29.25L3.758 63Z",fill:"white"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 47.25V72H81L60.368 47.25Z",fill:"url(#dcl-nav2)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.757 72H60.367V47.25L39.757 72Z",fill:"white"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 40.5C66.58 40.5 71.618 35.463 71.618 29.25C71.618 23.037 66.58 18 60.368 18C54.154 18 49.118 23.037 49.118 29.25C49.118 35.463 54.154 40.5 60.368 40.5Z",fill:"#FFC95B"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.882 22.5C34.989 22.5 37.507 19.981 37.507 16.875C37.507 13.768 34.989 11.25 31.882 11.25C28.776 11.25 26.257 13.768 26.257 16.875C26.257 19.981 28.776 22.5 31.882 22.5Z",fill:"#FFC95B"}),b.jsxs("defs",{children:[b.jsxs("linearGradient",{id:"dcl-nav0",x1:"45",y1:"-18.64",x2:"-18.64",y2:"45",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#FF2D55"}),b.jsx("stop",{offset:"1",stopColor:"#FFBC5B"})]}),b.jsxs("linearGradient",{id:"dcl-nav1",x1:"31.873",y1:"29.25",x2:"31.873",y2:"63",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#A524B3"}),b.jsx("stop",{offset:"1",stopColor:"#FF2D55"})]}),b.jsxs("linearGradient",{id:"dcl-nav2",x1:"60.36",y1:"47.25",x2:"60.36",y2:"72",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#A524B3"}),b.jsx("stop",{offset:"1",stopColor:"#FF2D55"})]})]})]})}),O5=O.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M3 6H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M3 18H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),F5=O.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),Zi=O.memo(function(t){return b.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),R5=O.memo(function(t){return b.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M15 12.5L10 7.5L5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),Ki=O.memo(function(t){return b.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M12 21.75C13.1 21.75 14 20.85 14 19.75H10C10 20.85 10.89 21.75 12 21.75ZM18 15.75V10.75C18 7.68 16.36 5.11 13.5 4.43V3.75C13.5 2.92 12.83 2.25 12 2.25C11.17 2.25 10.5 2.92 10.5 3.75V4.43C7.63 5.11 6 7.67 6 10.75V15.75L4 17.75V18.75H20V17.75L18 15.75Z",fill:"#FCFCFC"})})}),Yi=O.memo(function(t){return b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M10 2H14V6",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M6.66699 9.33333L14.0003 2",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})]})}),Ji=O.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M7.5 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V4.16667C2.5 3.72464 2.67559 3.30072 2.98816 2.98816C3.30072 2.67559 3.72464 2.5 4.16667 2.5H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M13.333 14.1667L17.4997 10.0001L13.333 5.83337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M17.5 10H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})});O.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"5.25",stroke:"#FCFCFC",strokeOpacity:"0.3",strokeWidth:"1.5"}),b.jsx("path",{d:"M18.7111 11.065L14.034 6.39027C13.2002 5.55695 11.7971 6.14637 11.7971 7.32523V8.86994C11.7564 8.86994 11.7361 8.86994 11.6954 8.86994H7.25895C6.50654 8.86994 5.89648 9.45936 5.89648 10.2114V13.7683C5.89648 14.5203 6.50654 15.1301 7.25895 15.1301H11.6751C11.7158 15.1301 11.7361 15.1301 11.7768 15.1301V16.6748C11.7768 17.8536 13.2002 18.4431 14.0137 17.6097L18.6908 12.935C19.2195 12.4065 19.2195 11.5732 18.7111 11.065Z",fill:"#FCFCFC"})]})});const Xi=O.memo(function(t){return b.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",stroke:"currentColor",strokeWidth:"1"}),b.jsx("path",{d:"M8.5 3.5V2C8.5 1.17157 7.82843 0.5 7 0.5H2C1.17157 0.5 0.5 1.17157 0.5 2V7C0.5 7.82843 1.17157 8.5 2 8.5H3.5",stroke:"currentColor",strokeWidth:"1"})]})}),Qi=O.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M10 10C11.3807 10 12.5 8.88071 12.5 7.5C12.5 6.11929 11.3807 5 10 5C8.61929 5 7.5 6.11929 7.5 7.5C7.5 8.88071 8.61929 10 10 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M5 16.25C5 14.1789 7.23858 12.5 10 12.5C12.7614 12.5 15 14.1789 15 16.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ea=O.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M15.8333 7.5L13.3333 3.33337H6.66667L4.16667 7.5L2.5 16.6667H17.5L15.8333 7.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M6.66667 3.33337L7.5 7.50004L10 9.16671L12.5 7.50004L13.3333 3.33337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ta=O.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M16.1666 10C16.1666 9.58337 16.1249 9.16671 16.0416 8.75004L17.9166 7.27087L16.4166 4.72921L14.1666 5.52087C13.5416 4.97921 12.8124 4.56254 11.9999 4.31254L11.6666 1.66671H8.33325L7.99992 4.31254C7.18742 4.56254 6.45825 4.97921 5.83325 5.52087L3.58325 4.72921L2.08325 7.27087L3.95825 8.75004C3.87492 9.16671 3.83325 9.58337 3.83325 10C3.83325 10.4167 3.87492 10.8334 3.95825 11.25L2.08325 12.7292L3.58325 15.2709L5.83325 14.4792C6.45825 15.0209 7.18742 15.4375 7.99992 15.6875L8.33325 18.3334H11.6666L11.9999 15.6875C12.8124 15.4375 13.5416 15.0209 14.1666 14.4792L16.4166 15.2709L17.9166 12.7292L16.0416 11.25C16.1249 10.8334 16.1666 10.4167 16.1666 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),na=O.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M5 1.66663L2.5 4.99996V16.6666C2.5 17.1087 2.67559 17.5326 2.98816 17.8452C3.30072 18.1577 3.72464 18.3333 4.16667 18.3333H15.8333C16.2754 18.3333 16.6993 18.1577 17.0118 17.8452C17.3244 17.5326 17.5 17.1087 17.5 16.6666V4.99996L15 1.66663H5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M13.3334 8.33337C13.3334 9.21743 12.9822 10.0653 12.3571 10.6904C11.7319 11.3155 10.8841 11.6667 10.0001 11.6667C9.11603 11.6667 8.26818 11.3155 7.64306 10.6904C7.01794 10.0653 6.66675 9.21743 6.66675 8.33337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),L5=O.memo(function(t){return b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M9.864 6.952C9.864 4.968 8.264 3.32 6.28 3.32C4.296 3.32 2.696 4.968 2.696 6.952C2.696 8.92 4.296 10.52 6.28 10.52C8.264 10.52 9.864 8.92 9.864 6.952ZM9.032 6.952C9.032 8.456 7.688 9.688 6.28 9.688C4.728 9.688 3.528 8.488 3.528 6.952C3.528 5.432 4.728 4.152 6.28 4.152C7.704 4.152 9.032 5.432 9.032 6.952ZM12.248 10.424V3.544L6.28 0.12L0.312 3.544V10.424L6.28 13.848L12.248 10.424ZM11.192 9.832L6.296 12.632L1.368 9.832V4.184L6.28 1.336L11.192 4.184V9.832Z",fill:"#FF2D55"})})}),M5=O.memo(function(t){return b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0L24 12L12 24L0 12L12 0ZM12.0002 3.36001L20.6402 12L12.0002 20.64L3.36023 12L12.0002 3.36001ZM12.0009 16.32C14.3868 16.32 16.3209 14.3859 16.3209 12C16.3209 9.61415 14.3868 7.68002 12.0009 7.68002C9.61507 7.68002 7.68094 9.61415 7.68094 12C7.68094 14.3859 9.61507 16.32 12.0009 16.32Z",fill:"#FCFCFC"})})}),ye={explore:{labelKey:"component.landing.navbar.explore",url:"https://decentraland.org/events"},shop:{labelKey:"component.landing.navbar.shop",items:[{labelKey:"component.landing.navbar.shop_all",url:"https://decentraland.org/marketplace"},{labelKey:"component.landing.navbar.wearables",url:"https://decentraland.org/marketplace/browse?assetType=item§ion=wearables&status=on_sale"},{labelKey:"component.landing.navbar.emotes",url:"https://decentraland.org/marketplace/browse?assetType=item§ion=emotes&status=on_sale"},{labelKey:"component.landing.navbar.names",url:"https://decentraland.org/marketplace/names/claim"},{labelKey:"component.landing.navbar.land",url:"https://decentraland.org/marketplace/lands"},{labelKey:"component.landing.navbar.merch",url:"https://store.decentraland.org/",isExternal:!0}]},create:{labelKey:"component.landing.navbar.create",items:[{labelKey:"component.landing.navbar.create_in_decentraland",url:"https://decentraland.org/create/"},{labelKey:"component.landing.navbar.publish_wearables_emotes",url:"https://decentraland.org/builder/collections"},{labelKey:"component.landing.navbar.publish_land",url:"https://decentraland.org/builder/land"}]},learn:{labelKey:"component.landing.navbar.learn",url:"https://decentraland.org/blog/"}},ra=[{labelKey:"component.landing.navbar.view_profile",url:"https://decentraland.org/profile"},{labelKey:"component.landing.navbar.my_assets",url:"https://decentraland.org/marketplace/account"},{labelKey:"component.landing.navbar.account_settings",url:"https://decentraland.org/account"},{labelKey:"component.landing.navbar.marketplace_authorizations",url:"https://decentraland.org/marketplace/settings"}],sa=["shop","create"],ht="@media (max-width: 991px)",se="@media (min-width: 992px)",z5="0px 1.333px 24px rgba(0,0,0,0.12), 0px 8px 13.333px rgba(0,0,0,0.14), 0px 4px 6.667px rgba(0,0,0,0.2)",kt="rgba(38, 38, 38, 0.8)",Ro="0.5px solid #5E5B67",Hn="0 2px 20px 16px rgba(0, 0, 0, 0.25)",Me="blur(12.5px)",n0=hr`
|
|
39
|
+
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(rr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class jn extends B{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function vr(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof B?e.walk(s=>s?.code===Ot.code):e;return r instanceof B?new Ot({cause:e,message:r.details}):Ot.nodeMessage.test(n)?new Ot({cause:e,message:e.details}):nr.nodeMessage.test(n)?new nr({cause:e,maxFeePerGas:t?.maxFeePerGas}):xs.nodeMessage.test(n)?new xs({cause:e,maxFeePerGas:t?.maxFeePerGas}):vs.nodeMessage.test(n)?new vs({cause:e,nonce:t?.nonce}):Es.nodeMessage.test(n)?new Es({cause:e,nonce:t?.nonce}):As.nodeMessage.test(n)?new As({cause:e,nonce:t?.nonce}):Ps.nodeMessage.test(n)?new Ps({cause:e}):Is.nodeMessage.test(n)?new Is({cause:e,gas:t?.gas}):ks.nodeMessage.test(n)?new ks({cause:e,gas:t?.gas}):$s.nodeMessage.test(n)?new $s({cause:e}):rr.nodeMessage.test(n)?new rr({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new jn({cause:e})}function bd(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof jn?e:s})();return new pd(r,{docsPath:t,...n})}function Er(e,{format:t}){if(!t)return{};const n={};function r(o){const i=Object.keys(o);for(const a of i)a in e&&(n[a]=e[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const s=t(e||{});return r(s),n}const gd={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Fn(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=md(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>X(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=_(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=_(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=_(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=_(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=_(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=_(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=gd[e.type]),typeof e.value<"u"&&(n.value=_(e.value)),n}function md(e){return e.map(t=>({address:t.address,r:t.r?_(BigInt(t.r)):t.r,s:t.s?_(BigInt(t.s)):t.s,chainId:_(t.chainId),nonce:_(t.nonce),...typeof t.yParity<"u"?{yParity:_(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:_(t.v)}:{}}))}function ci(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Wo({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Wo({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function yd(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=_(t)),n!==void 0&&(i.nonce=_(n)),r!==void 0&&(i.state=ci(r)),s!==void 0){if(i.state)throw new Yl;i.stateDiff=ci(s)}return i}function oo(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!xe(n,{strict:!1}))throw new ft({address:n});if(t[n])throw new Kl({address:n});t[n]=yd(r)}return t}const wd=2n**256n-1n;function Zt(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:s}=e,o=t?pe(t):void 0;if(o&&!xe(o.address))throw new ft({address:o.address});if(s&&!xe(s))throw new ft({address:s});if(n&&n>wd)throw new nr({maxFeePerGas:n});if(r&&n&&r>n)throw new rr({maxFeePerGas:n,maxPriorityFeePerGas:r})}class vc extends B{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class io extends B{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class xd extends B{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${fe(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Ec extends B{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Ac={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function ao(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Qe(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Qe(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ac[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=vd(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function vd(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Pc(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:ao(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Ee(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:s}={}){const o=s??!1,i=n!==void 0?_(n):void 0;let a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[i||r,o]},{dedupe:!!i}),!a)throw new Ec({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||Pc)(a,"getBlock")}async function co(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Ed(e,t){return Ic(e,t)}async function Ic(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};try{const o=r?.fees?.maxPriorityFeePerGas??r?.fees?.defaultPriorityFee;if(typeof o=="function"){const a=n||await U(e,Ee,"getBlock")({}),c=await o({block:a,client:e,request:s});if(c===null)throw new Error;return c}if(typeof o<"u")return o;const i=await e.request({method:"eth_maxPriorityFeePerGas"});return Fe(i)}catch{const[o,i]=await Promise.all([n?Promise.resolve(n):U(e,Ee,"getBlock")({}),U(e,co,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new io;const a=i-o.baseFeePerGas;return a<0n?0n:a}}async function Ad(e,t){return Bs(e,t)}async function Bs(e,t){const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},i=await(async()=>typeof r?.fees?.baseFeeMultiplier=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new vc;const c=10**(i.toString().split(".")[1]?.length??0),u=d=>d*BigInt(Math.ceil(i*c))/BigInt(c),f=n||await U(e,Ee,"getBlock")({});if(typeof r?.fees?.estimateFeesPerGas=="function"){const d=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(d!==null)return d}if(o==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new io;const d=typeof s?.maxPriorityFeePerGas=="bigint"?s.maxPriorityFeePerGas:await Ic(e,{block:f,chain:r,request:s}),h=u(f.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??h+d,maxPriorityFeePerGas:d}}return{gasPrice:s?.gasPrice??u(await U(e,co,"getGasPrice")({}))}}async function kc(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?_(r):n]},{dedupe:!!r});return Qe(s)}function $c(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>Re(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>X(o))}function Bc(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Re(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>Re(i)):e.commitments,o=[];for(let i=0;i<r.length;i++){const a=r[i],c=s[i];o.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return n==="bytes"?o:o.map(i=>X(i))}function Pd(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}function Id(e,t,n){return e&t^~e&n}function kd(e,t,n){return e&t^e&n^t&n}let $d=class extends Za{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=zr(this.buffer)}update(t){tr(this),t=Xs(t),tn(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let i=0;i<o;){const a=Math.min(s-this.pos,o-i);if(a===s){const c=zr(t);for(;s<=o-i;i+=s)this.process(c,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){tr(this),Wa(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:i}=this;n[i++]=128,nn(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let l=i;l<s;l++)n[l]=0;Pd(r,s-8,BigInt(this.length*8),o),this.process(r,0);const a=zr(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,f[l],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=o,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}};const st=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Bd=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);let Cd=class extends $d{constructor(t=32){super(64,t,8,!1),this.A=st[0]|0,this.B=st[1]|0,this.C=st[2]|0,this.D=st[3]|0,this.E=st[4]|0,this.F=st[5]|0,this.G=st[6]|0,this.H=st[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=ot[l-15],h=ot[l-2],g=Se(d,7)^Se(d,18)^d>>>3,p=Se(h,17)^Se(h,19)^h>>>10;ot[l]=p+ot[l-7]+g+ot[l-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=Se(a,6)^Se(a,11)^Se(a,25),h=f+d+Id(a,c,u)+Bd[l]+ot[l]|0,p=(Se(r,2)^Se(r,13)^Se(r,22))+kd(r,s,o)|0;f=u,u=c,c=a,a=i+h|0,i=o,o=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,o,i,a,c,u,f)}roundClean(){nn(ot)}destroy(){this.set(0,0,0,0,0,0,0,0),nn(this.buffer)}};const Sd=Ka(()=>new Cd),Td=Sd;function Nd(e,t){return Td(je(e,{strict:!1})?qt(e):e)}function Od(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Nd(t);return s.set([n],0),r==="bytes"?s:X(s)}function jd(e){const{commitments:t,version:n}=e,r=e.to,s=[];for(const o of t)s.push(Od({commitment:o,to:r,version:n}));return s}const ui=6,Cc=32,uo=4096,Sc=Cc*uo,fi=Sc*ui-1-1*uo*ui;class Fd extends B{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Rd extends B{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function Ld(e){const t=typeof e.data=="string"?Re(e.data):e.data,n=K(t);if(!n)throw new Rd;if(n>fi)throw new Fd({maxSize:fi,size:n});const r=[];let s=!0,o=0;for(;s;){const i=no(new Uint8Array(Sc));let a=0;for(;a<uo;){const c=t.slice(o,o+(Cc-1));if(i.pushByte(0),i.pushBytes(c),c.length<31){i.pushByte(128),s=!1;break}a++,o+=31}r.push(i)}return r.map(i=>X(i.bytes))}function Md(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Ld({data:t}),o=e.commitments??$c({blobs:s,kzg:n,to:r}),i=e.proofs??Bc({blobs:s,commitments:o,kzg:n,to:r}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:o[c],proof:i[c]});return a}function zd(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Xl({transaction:e})}function Ud(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof jn?e:s})();return new Ql(r,{docsPath:t,...n})}async function fo(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Qe(t)}async function Tc(e,t){const{account:n=e.account,accessList:r,authorizationList:s,chain:o=e.chain,blobVersionedHashes:i,blobs:a,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:g,nonceManager:p,to:w,type:A,value:$,...v}=t,m=await(async()=>{if(!n||!p||typeof g<"u")return g;const I=pe(n),T=o?o.id:await U(e,fo,"getChainId")({});return await p.consume({address:I.address,chainId:T,client:e})})();Zt(t);const y=o?.formatters?.transactionRequest?.format,x=(y||Fn)({...Er(v,{format:y}),account:n?pe(n):void 0,accessList:r,authorizationList:s,blobs:a,blobVersionedHashes:i,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:w,type:A,value:$},"fillTransaction");try{const I=await e.request({method:"eth_fillTransaction",params:[x]}),E=(o?.formatters?.transaction?.format||ao)(I.tx);delete E.blockHash,delete E.blockNumber,delete E.r,delete E.s,delete E.transactionIndex,delete E.v,delete E.yParity,E.data=E.input,E.gas&&(E.gas=t.gas??E.gas),E.gasPrice&&(E.gasPrice=t.gasPrice??E.gasPrice),E.maxFeePerBlobGas&&(E.maxFeePerBlobGas=t.maxFeePerBlobGas??E.maxFeePerBlobGas),E.maxFeePerGas&&(E.maxFeePerGas=t.maxFeePerGas??E.maxFeePerGas),E.maxPriorityFeePerGas&&(E.maxPriorityFeePerGas=t.maxPriorityFeePerGas??E.maxPriorityFeePerGas),E.nonce&&(E.nonce=t.nonce??E.nonce);const k=await(async()=>{if(typeof o?.fees?.baseFeeMultiplier=="function"){const S=await U(e,Ee,"getBlock")({});return o.fees.baseFeeMultiplier({block:S,client:e,request:t})}return o?.fees?.baseFeeMultiplier??1.2})();if(k<1)throw new vc;const F=10**(k.toString().split(".")[1]?.length??0),G=S=>S*BigInt(Math.ceil(k*F))/BigInt(F);return E.maxFeePerGas&&!t.maxFeePerGas&&(E.maxFeePerGas=G(E.maxFeePerGas)),E.gasPrice&&!t.gasPrice&&(E.gasPrice=G(E.gasPrice)),{raw:I.raw,transaction:{from:x.from,...E}}}catch(I){throw Ud(I,{...t,chain:e.chain})}}const _d=["blobVersionedHashes","chainId","fees","gas","nonce","type"],li=new Map,Hr=new mr(128);async function Nc(e,t){let n=t;n.account??=e.account,n.parameters??=_d;const{account:r,chain:s=e.chain,nonceManager:o,parameters:i}=n,a=(()=>{if(typeof s?.prepareTransactionRequest=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s?.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let c;async function u(){return c||(typeof n.chainId<"u"?n.chainId:s?s.id:(c=await U(e,fo,"getChainId")({}),c))}const f=r&&pe(r);let l=n.nonce;if(i.includes("nonce")&&typeof l>"u"&&f&&o){const m=await u();l=await o.consume({address:f.address,chainId:m,client:e})}a?.fn&&a.runAt?.includes("beforeFillTransaction")&&(n=await a.fn({...n,chain:s},{phase:"beforeFillTransaction"}),l??=n.nonce);const h=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||Hr.get(e.uid)===!1||!["fees","gas"].some(y=>i.includes(y))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof l!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await U(e,Tc,"fillTransaction")({...n,nonce:l}).then(m=>{const{chainId:y,from:P,gas:x,gasPrice:I,nonce:T,maxFeePerBlobGas:E,maxFeePerGas:k,maxPriorityFeePerGas:N,type:F,...G}=m.transaction;return Hr.set(e.uid,!0),{...n,...P?{from:P}:{},...F?{type:F}:{},...typeof y<"u"?{chainId:y}:{},...typeof x<"u"?{gas:x}:{},...typeof I<"u"?{gasPrice:I}:{},...typeof T<"u"?{nonce:T}:{},...typeof E<"u"?{maxFeePerBlobGas:E}:{},...typeof k<"u"?{maxFeePerGas:k}:{},...typeof N<"u"?{maxPriorityFeePerGas:N}:{},..."nonceKey"in G&&typeof G.nonceKey<"u"?{nonceKey:G.nonceKey}:{}}}).catch(m=>{const y=m;return y.name!=="TransactionExecutionError"||y.walk?.(x=>{const I=x;return I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError"})&&Hr.set(e.uid,!1),n}):n;l??=h.nonce,n={...h,...f?{from:f?.address}:{},...l?{nonce:l}:{}};const{blobs:g,gas:p,kzg:w,type:A}=n;a?.fn&&a.runAt?.includes("beforeFillParameters")&&(n=await a.fn({...n,chain:s},{phase:"beforeFillParameters"}));let $;async function v(){return $||($=await U(e,Ee,"getBlock")({blockTag:"latest"}),$)}if(i.includes("nonce")&&typeof l>"u"&&f&&!o&&(n.nonce=await U(e,kc,"getTransactionCount")({address:f.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&g&&w){const m=$c({blobs:g,kzg:w});if(i.includes("blobVersionedHashes")){const y=jd({commitments:m,to:"hex"});n.blobVersionedHashes=y}if(i.includes("sidecars")){const y=Bc({blobs:g,commitments:m,kzg:w}),P=Md({blobs:g,commitments:m,proofs:y,to:"hex"});n.sidecars=P}}if(i.includes("chainId")&&(n.chainId=await u()),(i.includes("fees")||i.includes("type"))&&typeof A>"u")try{n.type=zd(n)}catch{let m=li.get(e.uid);typeof m>"u"&&(m=typeof(await v())?.baseFeePerGas=="bigint",li.set(e.uid,m)),n.type=m?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const m=await v(),{maxFeePerGas:y,maxPriorityFeePerGas:P}=await Bs(e,{block:m,chain:s,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<P)throw new xd({maxPriorityFeePerGas:P});n.maxPriorityFeePerGas=P,n.maxFeePerGas=y}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new io;if(typeof n.gasPrice>"u"){const m=await v(),{gasPrice:y}=await Bs(e,{block:m,chain:s,request:n,type:"legacy"});n.gasPrice=y}}return i.includes("gas")&&typeof p>"u"&&(n.gas=await U(e,lo,"estimateGas")({...n,account:f,prepare:f?.type==="local"?[]:["blobVersionedHashes"]})),a?.fn&&a.runAt?.includes("afterFillParameters")&&(n=await a.fn({...n,chain:s},{phase:"afterFillParameters"})),Zt(n),delete n.parameters,n}async function lo(e,t){const{account:n=e.account,prepare:r=!0}=t,s=n?pe(n):void 0,o=(()=>{if(Array.isArray(r))return r;if(s?.type!=="local")return["blobVersionedHashes"]})();try{const i=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await xc({authorization:t.authorizationList[0]}).catch(()=>{throw new B("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,blockNumber:l,blockTag:d,data:h,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,value:m,stateOverride:y,...P}=r?await Nc(e,{...t,parameters:o,to:i}):t;if(g&&t.gas!==g)return g;const I=(typeof l=="bigint"?_(l):void 0)||d,T=oo(y);Zt(t);const E=e.chain?.formatters?.transactionRequest?.format,N=(E||Fn)({...Er(P,{format:E}),account:s,accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,data:h,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:i,value:m},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:T?[N,I??e.experimental_blockTag??"latest",T]:I?[N,I]:[N]}))}catch(i){throw bd(i,{...t,account:s,chain:e.chain})}}async function Hd(e,t){const{abi:n,address:r,args:s,functionName:o,dataSuffix:i,...a}=t,c=Be({abi:n,args:s,functionName:o});try{return await U(e,lo,"estimateGas")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...a})}catch(u){const f=a.account?pe(a.account):void 0;throw Dt(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:f?.address})}}function Ar(e,t){if(!xe(e,{strict:!1}))throw new ft({address:e});if(!xe(t,{strict:!1}))throw new ft({address:t});return e.toLowerCase()===t.toLowerCase()}const di="/docs/contract/decodeEventLog";function sr(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[i,...a]=s;if(!i)throw new $f({docsPath:di});const c=t.find(p=>p.type==="event"&&i===gr(Ae(p)));if(!(c&&"name"in c)||c.type!=="event")throw new Bf(i,{docsPath:di});const{name:u,inputs:f}=c,l=f?.some(p=>!("name"in p&&p.name)),d=l?[]:{},h=f.map((p,w)=>[p,w]).filter(([p])=>"indexed"in p&&p.indexed);for(let p=0;p<h.length;p++){const[w,A]=h[p],$=a[p];if(!$)throw new Ys({abiItem:c,param:w});d[l?A:w.name||A]=Dd({param:w,value:$})}const g=f.filter(p=>!("indexed"in p&&p.indexed));if(g.length>0){if(n&&n!=="0x")try{const p=Nn(g,n);if(p)if(l)for(let w=0;w<f.length;w++)d[w]=d[w]??p.shift();else for(let w=0;w<g.length;w++)d[g[w].name]=p[w]}catch(p){if(o)throw p instanceof Ua||p instanceof fc?new er({abiItem:c,data:n,params:g,size:K(n)}):p}else if(o)throw new er({abiItem:c,data:"0x",params:g,size:0})}return{eventName:u,args:Object.values(d).length>0?d:void 0}}function Dd({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Nn([e],t)||[])[0]}function ho(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,o=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{const a=t.filter(f=>f.type==="event"&&i.topics[0]===gr(f));if(a.length===0)return null;let c,u;for(const f of a)try{c=sr({...i,abi:[f],strict:!0}),u=f;break}catch{}if(!c&&!s){u=a[0];try{c=sr({...i,abi:[u],strict:!1})}catch{const f=u.inputs?.some(l=>!("name"in l&&l.name));return{...i,args:f?[]:{},eventName:u.name}}}return!c||!u||o&&!o.includes(c.eventName)||!Gd({args:c.args,inputs:u.inputs,matchArgs:n})?null:{...c,...i}}).filter(Boolean)}function Gd(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(o,i,a){try{return o.type==="address"?Ar(i,a):o.type==="string"||o.type==="bytes"?te(qt(i))===a:i===a}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((o,i)=>{if(o==null)return!0;const a=n[i];return a?(Array.isArray(o)?o:[o]).some(u=>s(a,u,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([o,i])=>{if(i==null)return!0;const a=n.find(u=>u.name===o);return a?(Array.isArray(i)?i:[i]).some(u=>s(a,u,t[o])):!1}):!1}function et(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function po(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:i,args:a,strict:c}={}){const u=c??!1,f=i??(o?[o]:void 0);let l=[];f&&(l=[f.flatMap(p=>Tn({abi:[p],eventName:p.name,args:i?void 0:a}))],o&&(l=l[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,blockHash:n}]}):d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,fromBlock:typeof r=="bigint"?_(r):r,toBlock:typeof s=="bigint"?_(s):s}]});const h=d.map(g=>et(g));return f?ho({abi:f,args:a,logs:h,strict:u}):h}async function Oc(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:i,fromBlock:a,toBlock:c,strict:u}=t,f=i?Pt({abi:n,name:i}):void 0,l=f?void 0:n.filter(d=>d.type==="event");return U(e,po,"getLogs")({address:r,args:s,blockHash:o,event:f,events:l,fromBlock:a,toBlock:c,strict:u})}const Dr="/docs/contract/decodeFunctionResult";function It(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const a=Pt({abi:t,args:n,name:r});if(!a)throw new Ut(r,{docsPath:Dr});o=a}if(o.type!=="function")throw new Ut(void 0,{docsPath:Dr});if(!o.outputs)throw new Ha(o.name,{docsPath:Dr});const i=Nn(o.outputs,s);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bo=BigInt(0),Cs=BigInt(1);function Rn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function go(e){if(!Rn(e))throw new Error("Uint8Array expected")}function kn(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Vn(e){const t=e.toString(16);return t.length&1?"0"+t:t}function jc(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?bo:BigInt("0x"+e)}const Fc=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Vd=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $n(e){if(go(e),Fc)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Vd[e[n]];return t}const qe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hi(e){if(e>=qe._0&&e<=qe._9)return e-qe._0;if(e>=qe.A&&e<=qe.F)return e-(qe.A-10);if(e>=qe.a&&e<=qe.f)return e-(qe.a-10)}function or(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Fc)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const i=hi(e.charCodeAt(o)),a=hi(e.charCodeAt(o+1));if(i===void 0||a===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}r[s]=i*16+a}return r}function yt(e){return jc($n(e))}function Rc(e){return go(e),jc($n(Uint8Array.from(e).reverse()))}function Ln(e,t){return or(e.toString(16).padStart(t*2,"0"))}function Lc(e,t){return Ln(e,t).reverse()}function we(e,t,n){let r;if(typeof t=="string")try{r=or(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Rn(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function ir(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];go(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.length}return n}const Gr=e=>typeof e=="bigint"&&bo<=e;function mo(e,t,n){return Gr(e)&&Gr(t)&&Gr(n)&&t<=e&&e<n}function Mt(e,t,n,r){if(!mo(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function qd(e){let t;for(t=0;e>bo;e>>=Cs,t+=1);return t}const Pr=e=>(Cs<<BigInt(e))-Cs,Vr=e=>new Uint8Array(e),pi=e=>Uint8Array.from(e);function Wd(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Vr(e),s=Vr(e),o=0;const i=()=>{r.fill(1),s.fill(0),o=0},a=(...l)=>n(s,r,...l),c=(l=Vr(0))=>{s=a(pi([0]),l),r=a(),l.length!==0&&(s=a(pi([1]),l),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l<t;){r=a();const h=r.slice();d.push(h),l+=r.length}return ir(...d)};return(l,d)=>{i(),c(l);let h;for(;!(h=d(u()));)c();return i(),h}}const Zd={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Rn(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,n={}){const r=(s,o,i)=>{const a=Zd[o];if(typeof a!="function")throw new Error("invalid validator function");const c=e[s];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+o+", got "+c)};for(const[s,o]of Object.entries(t))r(s,o,!1);for(const[s,o]of Object.entries(n))r(s,o,!0);return e}function bi(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const o=e(n,...r);return t.set(n,o),o}}const Kd="0.1.1";function Yd(){return Kd}class D extends Error{static setStaticOptions(t){D.prototype.docsOrigin=t.docsOrigin,D.prototype.showVersion=t.showVersion,D.prototype.version=t.version}constructor(t,n={}){const r=(()=>{if(n.cause instanceof D){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),s=n.cause instanceof D&&n.cause.docsPath||n.docsPath,o=n.docsOrigin??D.prototype.docsOrigin,i=`${o}${s??""}`,a=!!(n.version??D.prototype.showVersion),c=n.version??D.prototype.version,u=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s||a?["",r?`Details: ${r}`:void 0,s?`See: ${i}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(f=>typeof f=="string").join(`
|
|
40
|
+
`);super(u,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=o,this.docsPath=s,this.shortMessage=t,this.showVersion=a,this.version=c}walk(t){return Mc(this,t)}}Object.defineProperty(D,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Yd()}`}});D.setStaticOptions(D.defaultStaticOptions);function Mc(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Mc(e.cause,t):t?null:e}function Mn(e,t){if(jt(e)>t)throw new h1({givenSize:jt(e),maxSize:t})}const We={zero:48,nine:57,A:65,F:70,a:97,f:102};function gi(e){if(e>=We.zero&&e<=We.nine)return e-We.zero;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function Jd(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new p1({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let o=0;o<r;o++){const i=n==="right";s[i?o:r-o-1]=e[i?o:e.length-o-1]}return s}function zc(e,t={}){const{dir:n="left"}=t;let r=e,s=0;for(let o=0;o<r.length-1&&r[n==="left"?o:r.length-o-1].toString()==="0";o++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r}function kr(e,t){if(be(e)>t)throw new x1({givenSize:be(e),maxSize:t})}function Xd(e,t){if(typeof t=="number"&&t>0&&t>be(e)-1)throw new Zc({offset:t,position:"start",size:be(e)})}function Qd(e,t,n){if(typeof t=="number"&&typeof n=="number"&&be(e)!==n-t)throw new Zc({offset:n,position:"end",size:be(e)})}function Uc(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new v1({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const e1="#__bigint";function _c(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+e1:s,n)}const t1=new TextDecoder,n1=new TextEncoder;function r1(e){return e instanceof Uint8Array?e:typeof e=="string"?Hc(e):s1(e)}function s1(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Hc(e,t={}){const{size:n}=t;let r=e;n&&(kr(e,n),r=vt(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const o=s.length/2,i=new Uint8Array(o);for(let a=0,c=0;a<o;a++){const u=gi(s.charCodeAt(c++)),f=gi(s.charCodeAt(c++));if(u===void 0||f===void 0)throw new D(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);i[a]=u<<4|f}return i}function o1(e,t={}){const{size:n}=t,r=n1.encode(e);return typeof n=="number"?(Mn(r,n),i1(r,n)):r}function i1(e,t){return Jd(e,{dir:"right",size:t})}function jt(e){return e.length}function a1(e,t,n,r={}){const{strict:s}=r;return e.slice(t,n)}function c1(e,t={}){const{size:n}=t;typeof n<"u"&&Mn(e,n);const r=Ie(e,t);return Vc(r,t)}function u1(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Mn(r,n),r=Dc(r)),r.length>1||r[0]>1)throw new d1(r);return!!r[0]}function Je(e,t={}){const{size:n}=t;typeof n<"u"&&Mn(e,n);const r=Ie(e,t);return qc(r,t)}function f1(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Mn(r,n),r=l1(r)),t1.decode(r)}function Dc(e){return zc(e,{dir:"left"})}function l1(e){return zc(e,{dir:"right"})}class d1 extends D{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let h1=class extends D{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},p1=class extends D{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const b1=new TextEncoder,g1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function m1(e,t={}){const{strict:n=!1}=t;if(!e)throw new mi(e);if(typeof e!="string")throw new mi(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new yi(e);if(!e.startsWith("0x"))throw new yi(e)}function Pe(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function y1(e){return e instanceof Uint8Array?Ie(e):Array.isArray(e)?Ie(new Uint8Array(e)):e}function Gc(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(kr(n,t.size),xt(n,t.size)):n}function Ie(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=g1[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(kr(r,t.size),vt(r,t.size)):r}function oe(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<i){const u=typeof e=="bigint"?"n":"";throw new Wc({max:o?`${o}${u}`:void 0,min:`${i}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&s<0?BigInt.asUintN(r*8,BigInt(s)):s).toString(16)}`;return r?xt(c,r):c}function yo(e,t={}){return Ie(b1.encode(e),t)}function xt(e,t){return Uc(e,{dir:"left",size:t})}function vt(e,t){return Uc(e,{dir:"right",size:t})}function Oe(e,t,n,r={}){const{strict:s}=r;Xd(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&Qd(o,t,n),o}function be(e){return Math.ceil((e.length-2)/2)}function Vc(e,t={}){const{signed:n}=t;t.size&&kr(e,t.size);const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<BigInt(s)*8n)-1n,i=o>>1n;return r<=i?r:r-o-1n}function qc(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Vc(e,t))}function w1(e,t={}){const{strict:n=!1}=t;try{return m1(e,{strict:n}),!0}catch{return!1}}class Wc extends D{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number \`${o}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class mi extends D{constructor(t){super(`Value \`${typeof t=="object"?_c(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class yi extends D{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class x1 extends D{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class Zc extends D{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class v1 extends D{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function E1(e){return{address:e.address,amount:oe(e.amount),index:oe(e.index),validatorIndex:oe(e.validatorIndex)}}function Kc(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:oe(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:oe(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:oe(e.gasLimit)},...typeof e.number=="bigint"&&{number:oe(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:oe(e.prevRandao)},...typeof e.time=="bigint"&&{time:oe(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(E1)}}}const ar=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],Ss=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],Yc=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Jc=[...Yc,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],A1=[...Yc,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],wi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],xi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Xc=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],vi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],P1="0x82ad56cb",Qc="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",I1="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",k1="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",wo="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Ts extends B{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class eu extends B{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const qr="/docs/contract/encodeDeployData";function xo(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(i=>"type"in i&&i.type==="constructor");if(!s)throw new Ef({docsPath:qr});if(!("inputs"in s))throw new Go({docsPath:qr});if(!s.inputs||s.inputs.length===0)throw new Go({docsPath:qr});const o=At(s.inputs,n);return Wt([r,o])}function Kt({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Ts({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Ts({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function tu(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof jn?e:s})();return new bc(r,{docsPath:t,...n})}function nu(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const Wr=new Map;function ru({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const f=c();i();const l=f.map(({args:d})=>d);l.length!==0&&e(l).then(d=>{s&&Array.isArray(d)&&d.sort(s);for(let h=0;h<f.length;h++){const{resolve:g}=f[h];g?.([d[h],d])}}).catch(d=>{for(let h=0;h<f.length;h++){const{reject:g}=f[h];g?.(d)}})},i=()=>Wr.delete(t),a=()=>c().map(({args:f})=>f),c=()=>Wr.get(t)||[],u=f=>Wr.set(t,[...c(),f]);return{flush:i,async schedule(f){const{promise:l,resolve:d,reject:h}=nu();return n?.([...a(),f])&&o(),c().length>0?(u({args:f,resolve:d,reject:h}),l):(u({args:f,resolve:d,reject:h}),setTimeout(o,r),l)}}}async function $r(e,t){const{account:n=e.account,authorizationList:r,batch:s=!!e.batch?.multicall,blockNumber:o,blockTag:i=e.experimental_blockTag??"latest",accessList:a,blobs:c,blockOverrides:u,code:f,data:l,factory:d,factoryData:h,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:m,value:y,stateOverride:P,...x}=t,I=n?pe(n):void 0;if(f&&(d||h))throw new B("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&m)throw new B("Cannot provide both `code` & `to` as parameters.");const T=f&&l,E=d&&h&&m&&l,k=T||E,N=T?su({code:f,data:l}):E?C1({data:l,factory:d,factoryData:h,to:m}):l;try{Zt(t);const G=(typeof o=="bigint"?_(o):void 0)||i,S=u?Kc(u):void 0,C=oo(P),M=e.chain?.formatters?.transactionRequest?.format,L=(M||Fn)({...Er(x,{format:M}),accessList:a,account:I,authorizationList:r,blobs:c,data:N,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:$,nonce:v,to:k?void 0:m,value:y},"call");if(s&&$1({request:L})&&!C&&!S)try{return await B1(e,{...L,blockNumber:o,blockTag:i})}catch(W){if(!(W instanceof eu)&&!(W instanceof Ts))throw W}const H=(()=>{const W=[L,G];return C&&S?[...W,C,S]:C?[...W,C]:S?[...W,{},S]:W})(),V=await e.request({method:"eth_call",params:H});return V==="0x"?{data:void 0}:{data:V}}catch(F){const G=S1(F),{offchainLookup:S,offchainLookupSignature:C}=await dr(async()=>{const{offchainLookup:M,offchainLookupSignature:O}=await import("./ccip-DAt5iVuT.js");return{offchainLookup:M,offchainLookupSignature:O}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));if(e.ccipRead!==!1&&G?.slice(0,10)===C&&m)return{data:await S(e,{data:G,to:m})};throw k&&G?.slice(0,10)==="0x101bb98d"?new sd({factory:d}):tu(F,{...t,account:I,chain:e.chain})}}function $1({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(P1)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function B1(e,t){const{batchSize:n=1024,deployless:r=!1,wait:s=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:i=e.experimental_blockTag??"latest",data:a,to:c}=t,u=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Kt({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new eu})(),l=(typeof o=="bigint"?_(o):void 0)||i,{schedule:d}=ru({id:`${e.uid}.${l}`,wait:s,shouldSplitBatch(p){return p.reduce((A,{data:$})=>A+($.length-2),0)>n*2},fn:async p=>{const w=p.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),A=Be({abi:ar,args:[w],functionName:"aggregate3"}),$=await e.request({method:"eth_call",params:[{...u===null?{data:su({code:wo,data:A})}:{to:u,data:A}},l]});return It({abi:ar,args:[w],functionName:"aggregate3",data:$||"0x"})}}),[{returnData:h,success:g}]=await d({data:a,to:c});if(!g)throw new xr({data:h});return h==="0x"?{data:void 0}:{data:h}}function su(e){const{code:t,data:n}=e;return xo({abi:La(["constructor(bytes, bytes)"]),bytecode:Qc,args:[t,n]})}function C1(e){const{data:t,factory:n,factoryData:r,to:s}=e;return xo({abi:La(["constructor(address, bytes, address, bytes)"]),bytecode:I1,args:[s,t,n,r]})}function S1(e){if(!(e instanceof B))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function ke(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=Be({abi:n,args:s,functionName:o});try{const{data:c}=await U(e,$r,"call")({...i,data:a,to:r});return It({abi:n,args:s,functionName:o,data:c||"0x"})}catch(c){throw Dt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function T1(e,t){const{abi:n,address:r,args:s,dataSuffix:o,functionName:i,...a}=t,c=a.account?pe(a.account):e.account,u=Be({abi:n,args:s,functionName:i});try{const{data:f}=await U(e,$r,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:r,...a,account:c}),l=It({abi:n,args:s,functionName:i,data:f||"0x"}),d=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:l,request:{abi:d,address:r,args:s,dataSuffix:o,functionName:i,...a,account:c}}}catch(f){throw Dt(f,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}const Zr=new Map,Ei=new Map;let N1=0;function dt(e,t,n){const r=++N1,s=()=>Zr.get(e)||[],o=()=>{const f=s();Zr.set(e,f.filter(l=>l.id!==r))},i=()=>{const f=s();if(!f.some(d=>d.id===r))return;const l=Ei.get(e);if(f.length===1&&l){const d=l();d instanceof Promise&&d.catch(()=>{})}o()},a=s();if(Zr.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const c={};for(const f in t)c[f]=(...l)=>{const d=s();if(d.length!==0)for(const h of d)h.fns[f]?.(...l)};const u=n(c);return typeof u=="function"&&Ei.set(e,u),i}async function Ns(e){return new Promise(t=>setTimeout(t,e))}function zn(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const o=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:o}));const c=await n?.(a)??r;await Ns(c);const u=async()=>{s&&(await e({unpoll:o}),await Ns(r),u())};u()})(),o}const O1=new Map,j1=new Map;function F1(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:i=>o.set(s,i)}),n=t(e,O1),r=t(e,j1);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function R1(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=F1(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let o=r.promise.get();o||(o=e(),r.promise.set(o));try{const i=await o;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const L1=e=>`blockNumber.${e}`;async function Un(e,{cacheTime:t=e.cacheTime}={}){const n=await R1(()=>e.request({method:"eth_blockNumber"}),{cacheKey:L1(e.uid),cacheTime:t});return BigInt(n)}async function Br(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(o=>et(o));return!("abi"in t)||!t.abi?s:ho({abi:t.abi,logs:s,strict:n})}async function Cr(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function M1(e,t){const{abi:n,address:r,args:s,batch:o=!0,eventName:i,fromBlock:a,onError:c,onLogs:u,poll:f,pollingInterval:l=e.pollingInterval,strict:d}=t;return(typeof f<"u"?f:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const w=d??!1,A=ne(["watchContractEvent",r,s,o,e.uid,i,l,w,a]);return dt(A,{onLogs:u,onError:c},$=>{let v;a!==void 0&&(v=a-1n);let m,y=!1;const P=zn(async()=>{if(!y){try{m=await U(e,cc,"createContractEventFilter")({abi:n,address:r,args:s,eventName:i,strict:w,fromBlock:a})}catch{}y=!0;return}try{let x;if(m)x=await U(e,Br,"getFilterChanges")({filter:m});else{const I=await U(e,Un,"getBlockNumber")({});v&&v<I?x=await U(e,Oc,"getContractEvents")({abi:n,address:r,args:s,eventName:i,fromBlock:v+1n,toBlock:I,strict:w}):x=[],v=I}if(x.length===0)return;if(o)$.onLogs(x);else for(const I of x)$.onLogs([I])}catch(x){m&&x instanceof lt&&(y=!1),$.onError?.(x)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await U(e,Cr,"uninstallFilter")({filter:m}),P()}})})():(()=>{const w=d??!1,A=ne(["watchContractEvent",r,s,o,e.uid,i,l,w]);let $=!0,v=()=>$=!1;return dt(A,{onLogs:u,onError:c},m=>((async()=>{try{const y=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return I?I.value:e.transport}return e.transport})(),P=i?Tn({abi:n,eventName:i,args:s}):[],{unsubscribe:x}=await y.subscribe({params:["logs",{address:r,topics:P}],onData(I){if(!$)return;const T=I.result;try{const{eventName:E,args:k}=sr({abi:n,data:T.data,topics:T.topics,strict:d}),N=et(T,{args:k,eventName:E});m.onLogs([N])}catch(E){let k,N;if(E instanceof er||E instanceof Ys){if(d)return;k=E.abiItem.name,N=E.abiItem.inputs?.some(G=>!("name"in G&&G.name))}const F=et(T,{args:N?[]:{},eventName:k});m.onLogs([F])}},onError(I){m.onError?.(I)}});v=x,$||v()}catch(y){c?.(y)}})(),()=>v()))})()}async function z1(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Os(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,o)=>{const i=async({count:a=0}={})=>{const c=async({error:u})=>{const f=typeof t=="function"?t({count:a,error:u}):t;f&&await Ns(f),i({count:a+1})};try{const u=await e();s(u)}catch(u){if(a<n&&await r({count:a,error:u}))return c({error:u});o(u)}};i()})}const U1={"0x0":"reverted","0x1":"success"};function ou(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>et(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Qe(e.transactionIndex):null,status:e.status?U1[e.status]:null,type:e.type?Ac[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const js=256;let qn=js,Wn;function iu(e=11){if(!Wn||qn+e>js*2){Wn="",qn=0;for(let t=0;t<js;t++)Wn+=(256+Math.random()*256|0).toString(16).substring(1)}return Wn.substring(qn,qn+++e)}function _1(e){const{batch:t,chain:n,ccipRead:r,key:s="base",name:o="Base Client",type:i="base"}=e,a=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),f=e.pollingInterval??u,l=e.cacheTime??f,d=e.account?pe(e.account):void 0,{config:h,request:g,value:p}=e.transport({account:d,chain:n,pollingInterval:f}),w={...h,...p},A={account:d,batch:t,cacheTime:l,ccipRead:r,chain:n,key:s,name:o,pollingInterval:f,request:g,transport:w,type:i,uid:iu(),...a?{experimental_blockTag:a}:{}};function $(v){return m=>{const y=m(v);for(const x in A)delete y[x];const P={...v,...y};return Object.assign(P,{extend:$(P)})}}return Object.assign(A,{extend:$(A)})}function vo(e){if(!(e instanceof B))return!1;const t=e.walk(n=>n instanceof ws);return t instanceof ws?t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile":!1}function H1(e){const{abi:t,data:n}=e,r=_t(n,0,4),s=t.find(o=>o.type==="function"&&r===Sn(Ae(o)));if(!s)throw new Cf(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Nn(s.inputs,_t(n,4)):void 0}}const Kr="/docs/contract/encodeErrorResult";function Ai(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=Pt({abi:t,args:r,name:n});if(!c)throw new Vo(n,{docsPath:Kr});s=c}if(s.type!=="error")throw new Vo(void 0,{docsPath:Kr});const o=Ae(s),i=Sn(o);let a="0x";if(r&&r.length>0){if(!s.inputs)throw new kf(s.name,{docsPath:Kr});a=At(s.inputs,r)}return Wt([i,a])}const Yr="/docs/contract/encodeFunctionResult";function D1(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const i=Pt({abi:t,name:n});if(!i)throw new Ut(n,{docsPath:Yr});s=i}if(s.type!=="function")throw new Ut(void 0,{docsPath:Yr});if(!s.outputs)throw new Ha(s.name,{docsPath:Yr});const o=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Da(r)})();return At(s.outputs,o)}const Sr="x-batch-gateway:true";async function G1(e){const{data:t,ccipRequest:n}=e,{args:[r]}=H1({abi:Ss,data:t}),s=[],o=[];return await Promise.all(r.map(async(i,a)=>{try{o[a]=i.urls.includes(Sr)?await G1({data:i.data,ccipRequest:n}):await n(i),s[a]=!1}catch(c){s[a]=!0,o[a]=V1(c)}})),D1({abi:Ss,functionName:"query",result:[s,o]})}function V1(e){return e.name==="HttpRequestError"&&e.status?Ai({abi:Ss,errorName:"HttpError",args:[e.status,e.shortMessage]}):Ai({abi:[uc],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function au(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return je(t)?t:null}function Fs(e){let t=new Uint8Array(32).fill(0);if(!e)return X(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=au(n[r]),o=s?qt(s):te(mt(n[r]),"bytes");t=te(Le([t,o]),"bytes")}return X(t)}function q1(e){return`[${e.slice(2)}]`}function W1(e){const t=new Uint8Array(32).fill(0);return e?au(e)||te(mt(e)):X(t)}function Eo(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(mt(t).byteLength+2);let r=0;const s=t.split(".");for(let o=0;o<s.length;o++){let i=mt(s[o]);i.byteLength>255&&(i=mt(q1(W1(s[o])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Z1(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:o,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;if(f&&!f.some(d=>o.endsWith(d)))return null;const l=s!=null?[Fs(o),BigInt(s)]:[Fs(o)];try{const d=Be({abi:xi,functionName:"addr",args:l}),h={address:u,abi:Jc,functionName:"resolveWithGateways",args:[ut(Eo(o)),d,i??[Sr]],blockNumber:n,blockTag:r},p=await U(e,ke,"readContract")(h);if(p[0]==="0x")return null;const w=It({abi:xi,args:l,functionName:"addr",data:p[0]});return w==="0x"||gt(w)==="0x00"?null:w}catch(d){if(a)throw d;if(vo(d))return null;throw d}}class K1 extends B{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Jt extends B{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ao extends B{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Y1 extends B{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const J1=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,X1=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Q1=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,eh=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function th(e){try{const t=await fetch(e,{method:"HEAD"});return t.status===200?t.headers.get("content-type")?.startsWith("image/"):!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Pi(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function cu({uri:e,gatewayUrls:t}){const n=Q1.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Pi(t?.ipfs,"https://ipfs.io"),s=Pi(t?.arweave,"https://arweave.net"),o=e.match(J1),{protocol:i,subpath:a,target:c,subtarget:u=""}=o?.groups||{},f=i==="ipns:/"||a==="ipns/",l=i==="ipfs:/"||a==="ipfs/"||X1.test(e);if(e.startsWith("http")&&!f&&!l){let h=e;return t?.arweave&&(h=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((f||l)&&c)return{uri:`${r}/${f?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(eh,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new Ao({uri:e})}function uu(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new K1({data:e});return e.image||e.image_url||e.image_data}async function nh({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await Po({gatewayUrls:e,uri:uu(n)})}catch{throw new Ao({uri:t})}}async function Po({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=cu({uri:t,gatewayUrls:e});if(r||await th(n))return n;throw new Ao({uri:t})}function rh(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,i]=n.split(":"),[a,c]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Jt({reason:"Only EIP-155 supported"});if(!i)throw new Jt({reason:"Chain ID not found"});if(!c)throw new Jt({reason:"Contract address not found"});if(!s)throw new Jt({reason:"Token ID not found"});if(!a)throw new Jt({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function sh(e,{nft:t}){if(t.namespace==="erc721")return ke(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return ke(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Y1({namespace:t.namespace})}async function oh(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?ih(e,{gatewayUrls:t,record:n}):Po({uri:n,gatewayUrls:t})}async function ih(e,{gatewayUrls:t,record:n}){const r=rh(n),s=await sh(e,{nft:r}),{uri:o,isOnChain:i,isEncoded:a}=cu({uri:s,gatewayUrls:t});if(i&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=a?atob(o.replace("data:application/json;base64,","")):o,f=JSON.parse(u);return Po({uri:uu(f),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),nh({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}async function fu(e,t){const{blockNumber:n,blockTag:r,key:s,name:o,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;if(f&&!f.some(l=>o.endsWith(l)))return null;try{const l={address:u,abi:Jc,args:[ut(Eo(o)),Be({abi:wi,functionName:"text",args:[Fs(o),s]}),i??[Sr]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},h=await U(e,ke,"readContract")(l);if(h[0]==="0x")return null;const g=It({abi:wi,functionName:"text",data:h[0]});return g===""?null:g}catch(l){if(a)throw l;if(vo(l))return null;throw l}}async function ah(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){const c=await U(e,fu,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:o,strict:i});if(!c)return null;try{return await oh(e,{record:c,gatewayUrls:r})}catch{return null}}async function ch(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:o=60n,gatewayUrls:i,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const f={address:u,abi:A1,args:[n,o,i??[Sr]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},l=U(e,ke,"readContract"),[d]=await l(f);return d||null}catch(f){if(a)throw f;if(vo(f))return null;throw f}}async function uh(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:o}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Kt({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),a=o?.ensTlds;if(a&&!a.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${a?.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);const[c]=await U(e,ke,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ut(Eo(s))],blockNumber:n,blockTag:r});return c}async function lu(e,t){const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:o,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:l,to:d,value:h,...g}=t,p=n?pe(n):void 0;try{Zt(t);const A=(typeof r=="bigint"?_(r):void 0)||s,$=e.chain?.formatters?.transactionRequest?.format,m=($||Fn)({...Er(g,{format:$}),account:p,blobs:o,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:l,to:d,value:h},"createAccessList"),y=await e.request({method:"eth_createAccessList",params:[m,A]});return{accessList:y.accessList,gasUsed:BigInt(y.gasUsed)}}catch(w){throw tu(w,{...t,account:p,chain:e.chain})}}async function fh(e){const t=wr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function du(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:i,toBlock:a}={}){const c=s??(r?[r]:void 0),u=wr(e,{method:"eth_newFilter"});let f=[];c&&(f=[c.flatMap(h=>Tn({abi:[h],eventName:h.name,args:n}))],r&&(f=f[0]));const l=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?_(o):o,toBlock:typeof a=="bigint"?_(a):a,...f.length?{topics:f}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:o,id:l,request:u(l),strict:!!i,toBlock:a,type:"event"}}async function hu(e){const t=wr(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function lh(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const s=typeof n=="bigint"?_(n):void 0,o=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(o)}async function dh(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function hh(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?_(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),Qe(o)}async function Rs(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?_(n):void 0,o=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(o!=="0x")return o}class ph extends B{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function bh(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[o,i,a,c,u,f,l]=await U(e,ke,"readContract")({abi:gh,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:i,version:a,chainId:Number(c),verifyingContract:u,salt:f},extensions:l,fields:o}}catch(o){const i=o;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new ph({address:n}):i}}const gh=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function mh(e){return{baseFeePerGas:e.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map(t=>t.map(n=>BigInt(n)))}}async function yh(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=typeof n=="bigint"?_(n):void 0,i=await e.request({method:"eth_feeHistory",params:[_(t),o||r,s]},{dedupe:!!o});return mh(i)}async function wh(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>et(o));return t.abi?ho({abi:t.abi,logs:s,strict:n}):s}async function xh({address:e,authorization:t,signature:n}){return Ar(nc(e),await xc({authorization:t,signature:n}))}const Zn=new mr(8192);function vh(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Zn.get(n))return Zn.get(n);const r=e().finally(()=>Zn.delete(n));return Zn.set(n,r),r}function Eh(e,t={}){return async(n,r={})=>{const{dedupe:s=!1,methods:o,retryDelay:i=150,retryCount:a=3,uid:c}={...t,...r},{method:u}=n;if(o?.exclude?.includes(u))throw new pt(new Error("method not supported"),{method:u});if(o?.include&&!o.include.includes(u))throw new pt(new Error("method not supported"),{method:u});const f=s?en(`${c}.${ne(n)}`):void 0;return vh(()=>Os(async()=>{try{return await e(n)}catch(l){const d=l;switch(d.code){case on.code:throw new on(d);case an.code:throw new an(d);case cn.code:throw new cn(d,{method:n.method});case un.code:throw new un(d);case wt.code:throw new wt(d);case lt.code:throw new lt(d);case fn.code:throw new fn(d);case ln.code:throw new ln(d);case dn.code:throw new dn(d);case pt.code:throw new pt(d,{method:n.method});case Ht.code:throw new Ht(d);case hn.code:throw new hn(d);case Lt.code:throw new Lt(d);case pn.code:throw new pn(d);case bn.code:throw new bn(d);case gn.code:throw new gn(d);case mn.code:throw new mn(d);case yn.code:throw new yn(d);case wn.code:throw new wn(d);case xn.code:throw new xn(d);case vn.code:throw new vn(d);case En.code:throw new En(d);case An.code:throw new An(d);case Pn.code:throw new Pn(d);case In.code:throw new In(d);case 5e3:throw new Lt(d);default:throw l instanceof B?l:new id(d)}}},{delay:({count:l,error:d})=>{if(d&&d instanceof Qt){const h=d?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1e3}return~~(1<<l)*i},retryCount:a,shouldRetry:({error:l})=>Ah(l)}),{enabled:s,id:f})}}function Ah(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Ht.code||e.code===wt.code:e instanceof Qt&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function Tr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const o=typeof s=="function"?s(r):s,i={...r,...o};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function Ph(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let i;try{const a=new AbortController;n>0&&(i=setTimeout(()=>{r&&a.abort()},n)),s(await e({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&o(t),o(a)}finally{clearTimeout(i)}})()})}function Ih(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Ii=Ih();function kh(e,t={}){const{url:n,headers:r}=$h(e);return{async request(s){const{body:o,fetchFn:i=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:c=t.onResponse,timeout:u=t.timeout??1e4}=s,f={...t.fetchOptions??{},...s.fetchOptions??{}},{headers:l,method:d,signal:h}=f;try{const g=await Ph(async({signal:w})=>{const A={...f,body:Array.isArray(o)?ne(o.map(y=>({jsonrpc:"2.0",id:y.id??Ii.take(),...y}))):ne({jsonrpc:"2.0",id:o.id??Ii.take(),...o}),headers:{...r,"Content-Type":"application/json",...l},method:d||"POST",signal:h||(u>0?w:null)},$=new Request(n,A),v=await a?.($,A)??{...A,url:n};return await i(v.url??n,v)},{errorInstance:new ii({body:o,url:n}),timeout:u,signal:!0});c&&await c(g);let p;if(g.headers.get("Content-Type")?.startsWith("application/json"))p=await g.json();else{p=await g.text();try{p=JSON.parse(p||"{}")}catch(w){if(g.ok)throw w;p={error:p}}}if(!g.ok)throw new Qt({body:o,details:ne(p.error)||g.statusText,headers:g.headers,status:g.status,url:n});return p}catch(g){throw g instanceof Qt||g instanceof ii?g:new Qt({body:o,cause:g,url:n})}}}}function $h(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const Bh=`Ethereum Signed Message:
|
|
41
|
+
`;function Ch(e){const t=typeof e=="string"?en(e):typeof e.raw=="string"?e.raw:X(e.raw),n=en(`${Bh}${K(t)}`);return Le([n,t])}function pu(e,t){return te(Ch(e),t)}class Sh extends B{constructor({domain:t}){super(`Invalid domain "${ne(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Th extends B{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Nh extends B{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Oh(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(i,a)=>{for(const c of i){const{name:u,type:f}=c,l=a[u],d=f.match(ic);if(d&&(typeof l=="number"||typeof l=="bigint")){const[p,w,A]=d;_(l,{signed:w==="int",size:Number.parseInt(A,10)/8})}if(f==="address"&&typeof l=="string"&&!xe(l))throw new ft({address:l});const h=f.match(El);if(h){const[p,w]=h;if(w&&K(l)!==Number.parseInt(w,10))throw new Tf({expectedSize:Number.parseInt(w,10),givenSize:K(l)})}const g=s[f];g&&(Fh(f),o(g,l))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Sh({domain:t});o(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])o(s[r],n);else throw new Th({primaryType:r,types:s})}function jh({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Fh(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Nh({type:e})}function Rh(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:jh({domain:t}),...e.types};Oh({domain:t,message:n,primaryType:r,types:s});const o=["0x1901"];return t&&o.push(Lh({domain:t,types:s})),r!=="EIP712Domain"&&o.push(bu({data:n,primaryType:r,types:s})),te(Le(o))}function Lh({domain:e,types:t}){return bu({data:e,primaryType:"EIP712Domain",types:t})}function bu({data:e,primaryType:t,types:n}){const r=gu({data:e,primaryType:t,types:n});return te(r)}function gu({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Mh({primaryType:t,types:n})];for(const o of n[t]){const[i,a]=yu({types:n,name:o.name,type:o.type,value:e[o.name]});r.push(i),s.push(a)}return At(r,s)}function Mh({primaryType:e,types:t}){const n=ut(zh({primaryType:e,types:t}));return te(n)}function zh({primaryType:e,types:t}){let n="";const r=mu({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const o of s)n+=`${o}(${t[o].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return n}function mu({primaryType:e,types:t},n=new Set){const s=e.match(/^\w*/u)?.[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const o of t[s])mu({primaryType:o.type,types:t},n);return n}function yu({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},te(gu({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},te(r)];if(n==="string")return[{type:"bytes32"},te(ut(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),o=r.map(i=>yu({name:t,type:s,types:e,value:i}));return[{type:"bytes32"},te(At(o.map(([i])=>i),o.map(([,i])=>i)))]}return[{type:n},r]}class Uh extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const _h={checksum:new Uh(8192)},Jr=_h.checksum;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hh(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ki(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function cr(e,...t){if(!Hh(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function $i(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Dh(e,t){cr(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Gh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function wu(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Vh=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function qh(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Wh(e){for(let t=0;t<e.length;t++)e[t]=qh(e[t]);return e}const Bi=Vh?e=>e:Wh;function Zh(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function xu(e){return typeof e=="string"&&(e=Zh(e)),cr(e),e}let Kh=class{};function Yh(e){const t=r=>e().update(xu(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Kn=BigInt(2**32-1),Ci=BigInt(32);function Jh(e,t=!1){return t?{h:Number(e&Kn),l:Number(e>>Ci&Kn)}:{h:Number(e>>Ci&Kn)|0,l:Number(e&Kn)|0}}function Xh(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:i,l:a}=Jh(e[o],t);[r[o],s[o]]=[i,a]}return[r,s]}const Qh=(e,t,n)=>e<<n|t>>>32-n,ep=(e,t,n)=>t<<n|e>>>32-n,tp=(e,t,n)=>t<<n-32|e>>>64-n,np=(e,t,n)=>e<<n-32|t>>>64-n,rp=BigInt(0),Xt=BigInt(1),sp=BigInt(2),op=BigInt(7),ip=BigInt(256),ap=BigInt(113),vu=[],Eu=[],Au=[];for(let e=0,t=Xt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vu.push(2*(5*r+n)),Eu.push((e+1)*(e+2)/2%64);let s=rp;for(let o=0;o<7;o++)t=(t<<Xt^(t>>op)*ap)%ip,t&sp&&(s^=Xt<<(Xt<<BigInt(o))-Xt);Au.push(s)}const Pu=Xh(Au,!0),cp=Pu[0],up=Pu[1],Si=(e,t,n)=>n>32?tp(e,t,n):Qh(e,t,n),Ti=(e,t,n)=>n>32?np(e,t,n):ep(e,t,n);function fp(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],f=n[c+1],l=Si(u,f,1)^n[a],d=Ti(u,f,1)^n[a+1];for(let h=0;h<50;h+=10)e[i+h]^=l,e[i+h+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=Eu[i],c=Si(s,o,a),u=Ti(s,o,a),f=vu[i];s=e[f],o=e[f+1],e[f]=c,e[f+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=cp[r],e[1]^=up[r]}wu(n)}class Io extends Kh{constructor(t,n,r,s=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,ki(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Gh(this.state)}clone(){return this._cloneInto()}keccak(){Bi(this.state32),fp(this.state32,this.rounds),Bi(this.state32),this.posOut=0,this.pos=0}update(t){$i(this),t=xu(t),cr(t);const{blockLen:n,state:r}=this,s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let a=0;a<i;a++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){$i(this,!1),cr(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ki(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Dh(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,wu(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new Io(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const lp=(e,t,n)=>Yh(()=>new Io(t,e,n)),dp=lp(1,136,256/8);function Iu(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=dp(r1(e));return n==="Bytes"?r:Ie(r)}const hp=/^0x[a-fA-F0-9]{40}$/;function Nr(e,t={}){const{strict:n=!0}=t;if(!hp.test(e))throw new Ni({address:e,cause:new pp});if(n){if(e.toLowerCase()===e)return;if(ku(e)!==e)throw new Ni({address:e,cause:new bp})}}function ku(e){if(Jr.has(e))return Jr.get(e);Nr(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Iu(o1(t),{as:"Bytes"}),r=t.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(n[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const s=`0x${r.join("")}`;return Jr.set(e,s),s}function Ls(e,t={}){const{strict:n=!0}=t??{};try{return Nr(e,{strict:n}),!0}catch{return!1}}class Ni extends D{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class pp extends D{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class bp extends D{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const gp=/^(.*)\[([0-9]*)\]$/,mp=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$u=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Oi=2n**256n-1n;function zt(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=Bo(t.type);if(o){const[i,a]=o;return wp(e,{...t,type:a},{checksumAddress:r,length:i,staticPosition:s})}if(t.type==="tuple")return Ap(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return yp(e,{checksum:r});if(t.type==="bool")return xp(e);if(t.type.startsWith("bytes"))return vp(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Ep(e,t);if(t.type==="string")return Pp(e,{staticPosition:s});throw new So(t.type)}const ji=32,Ms=32;function yp(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(o=>n?ku(o):o)(Ie(a1(r,-20))),32]}function wp(e,t,n){const{checksumAddress:r,length:s,staticPosition:o}=n;if(!s){const c=Je(e.readBytes(Ms)),u=o+c,f=u+ji;e.setPosition(u);const l=Je(e.readBytes(ji)),d=Bn(t);let h=0;const g=[];for(let p=0;p<l;++p){e.setPosition(f+(d?p*32:h));const[w,A]=zt(e,t,{checksumAddress:r,staticPosition:f});h+=A,g.push(w)}return e.setPosition(o+32),[g,32]}if(Bn(t)){const c=Je(e.readBytes(Ms)),u=o+c,f=[];for(let l=0;l<s;++l){e.setPosition(u+l*32);const[d]=zt(e,t,{checksumAddress:r,staticPosition:u});f.push(d)}return e.setPosition(o+32),[f,32]}let i=0;const a=[];for(let c=0;c<s;++c){const[u,f]=zt(e,t,{checksumAddress:r,staticPosition:o+i});i+=f,a.push(u)}return[a,i]}function xp(e){return[u1(e.readBytes(32),{size:32}),32]}function vp(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=Je(e.readBytes(32));e.setPosition(n+i);const a=Je(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[Ie(c),32]}return[Ie(e.readBytes(Number.parseInt(s,10),32)),32]}function Ep(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?c1(s,{signed:n}):Je(s,{signed:n}),32]}function Ap(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=t.components.length===0||t.components.some(({name:c})=>!c),i=o?[]:{};let a=0;if(Bn(t)){const c=Je(e.readBytes(Ms)),u=s+c;for(let f=0;f<t.components.length;++f){const l=t.components[f];e.setPosition(u+a);const[d,h]=zt(e,l,{checksumAddress:r,staticPosition:u});a+=h,i[o?f:l?.name]=d}return e.setPosition(s+32),[i,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[f,l]=zt(e,u,{checksumAddress:r,staticPosition:s});i[o?c:u?.name]=f,a+=l}return[i,a]}function Pp(e,{staticPosition:t}){const n=Je(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Je(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=f1(Dc(o));return e.setPosition(t+32),[i,32]}function Ip({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(ko({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function ko({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Bo(r.type);if(s){const[o,i]=s;return $p(n,{checksumAddress:e,length:o,parameter:{...r,type:i}})}if(r.type==="tuple")return Np(n,{checksumAddress:e,parameter:r});if(r.type==="address")return kp(n,{checksum:e});if(r.type==="bool")return Cp(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const o=r.type.startsWith("int"),[,,i="256"]=$u.exec(r.type)??[];return Sp(n,{signed:o,size:Number(i)})}if(r.type.startsWith("bytes"))return Bp(n,{type:r.type});if(r.type==="string")return Tp(n);throw new So(r.type)}function $o(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?t+=32:t+=be(a)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push(oe(t+s,{size:32})),r.push(a),s+=be(a)):n.push(a)}return Pe(...n,...r)}function kp(e,t){const{checksum:n=!1}=t;return Nr(e,{strict:n}),{dynamic:!1,encoded:xt(e.toLowerCase())}}function $p(e,t){const{checksumAddress:n,length:r,parameter:s}=t,o=r===null;if(!Array.isArray(e))throw new _p(e);if(!o&&e.length!==r)throw new Up({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let i=!1;const a=[];for(let c=0;c<e.length;c++){const u=ko({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(i=!0),a.push(u)}if(o||i){const c=$o(a);if(o){const u=oe(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Pe(u,c):u}}if(i)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Pe(...a.map(({encoded:c})=>c))}}function Bp(e,{type:t}){const[,n]=t.split("bytes"),r=be(e);if(!n){let s=e;return r%32!==0&&(s=vt(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Pe(xt(oe(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new Cu({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:vt(e)}}function Cp(e){if(typeof e!="boolean")throw new D(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:xt(Gc(e))}}function Sp(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Wc({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:oe(e,{size:32,signed:t})}}function Tp(e){const t=yo(e),n=Math.ceil(be(t)/32),r=[];for(let s=0;s<n;s++)r.push(vt(Oe(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:Pe(vt(oe(be(t),{size:32})),...r)}}function Np(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const o=[];for(let i=0;i<r.components.length;i++){const a=r.components[i],c=Array.isArray(e)?i:a.name,u=ko({checksumAddress:n,parameter:a,value:e[c]});o.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?$o(o):Pe(...o.map(({encoded:i})=>i))}}function Bo(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Bn(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Bn);const n=Bo(e.type);return!!(n&&Bn({...e,type:n[1]}))}const Op={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Rp({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Fp({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Fi({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Fi({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function jp(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Op);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Fi extends D{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Fp extends D{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Rp extends D{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Lp(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,o=typeof t=="string"?Hc(t):t,i=jp(o);if(jt(o)===0&&e.length>0)throw new zp;if(jt(o)&&jt(o)<32)throw new Mp({data:typeof t=="string"?t:Ie(t),parameters:e,size:jt(o)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const f=e[u];i.setPosition(a);const[l,d]=zt(i,f,{checksumAddress:s,staticPosition:0});a+=d,r==="Array"?c.push(l):c[f.name??u]=l}return c}function Co(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Su({expectedLength:e.length,givenLength:t.length});const s=Ip({checksumAddress:r,parameters:e,values:t}),o=$o(s);return o.length===0?"0x":o}function zs(e,t){if(e.length!==t.length)throw new Su({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r];n.push(zs.encode(s,o))}return Pe(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return Nr(c),xt(c.toLowerCase(),s?32:0)}if(n==="string")return yo(r);if(n==="bytes")return r;if(n==="bool")return xt(Gc(r),s?32:1);const o=n.match($u);if(o){const[c,u,f="256"]=o,l=Number.parseInt(f,10)/8;return oe(r,{size:s?32:l,signed:u==="int"})}const i=n.match(mp);if(i){const[c,u]=i;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new Cu({expectedSize:Number.parseInt(u,10),value:r});return vt(r,s?32:0)}const a=n.match(gp);if(a&&Array.isArray(r)){const[c,u]=a,f=[];for(let l=0;l<r.length;l++)f.push(t(u,r[l],!0));return f.length===0?"0x":Pe(...f)}throw new So(n)}e.encode=t})(zs||(zs={}));function Bu(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Do(e):e}class Mp extends D{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Nt(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class zp extends D{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Up extends D{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Cu extends D{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${be(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Su extends D{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
42
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class _p extends D{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class So extends D{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}const St=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Us(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function _n(e,...t){if(!Hp(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Dp(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Us(e.outputLen),Us(e.blockLen)}function ur(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Gp(e,t){_n(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function fr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Xr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Te(e,t){return e<<32-t|e>>>t}function Vp(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function To(e){return typeof e=="string"&&(e=Vp(e)),_n(e),e}function qp(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];_n(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.length}return n}class Tu{}function Wp(e){const t=r=>e().update(To(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Zp(e=32){if(St&&typeof St.getRandomValues=="function")return St.getRandomValues(new Uint8Array(e));if(St&&typeof St.randomBytes=="function")return Uint8Array.from(St.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function Kp(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}function Yp(e,t,n){return e&t^~e&n}function Jp(e,t,n){return e&t^e&n^t&n}class Xp extends Tu{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Xr(this.buffer)}update(t){ur(this),t=To(t),_n(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let i=0;i<o;){const a=Math.min(s-this.pos,o-i);if(a===s){const c=Xr(t);for(;s<=o-i;i+=s)this.process(c,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ur(this),Gp(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:i}=this;n[i++]=128,fr(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let l=i;l<s;l++)n[l]=0;Kp(r,s-8,BigInt(this.length*8),o),this.process(r,0);const a=Xr(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,f[l],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=o,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const it=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qp=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),at=new Uint32Array(64);class eb extends Xp{constructor(t=32){super(64,t,8,!1),this.A=it[0]|0,this.B=it[1]|0,this.C=it[2]|0,this.D=it[3]|0,this.E=it[4]|0,this.F=it[5]|0,this.G=it[6]|0,this.H=it[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)at[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=at[l-15],h=at[l-2],g=Te(d,7)^Te(d,18)^d>>>3,p=Te(h,17)^Te(h,19)^h>>>10;at[l]=p+at[l-7]+g+at[l-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=Te(a,6)^Te(a,11)^Te(a,25),h=f+d+Yp(a,c,u)+Qp[l]+at[l]|0,p=(Te(r,2)^Te(r,13)^Te(r,22))+Jp(r,s,o)|0;f=u,u=c,c=a,a=i+h|0,i=o,o=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,o,i,a,c,u,f)}roundClean(){fr(at)}destroy(){this.set(0,0,0,0,0,0,0,0),fr(this.buffer)}}const tb=Wp(()=>new eb);class Nu extends Tu{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Dp(t);const r=To(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?t.create().update(r).digest():r);for(let i=0;i<o.length;i++)o[i]^=54;this.iHash.update(o),this.oHash=t.create();for(let i=0;i<o.length;i++)o[i]^=106;this.oHash.update(o),fr(o)}update(t){return ur(this),this.iHash.update(t),this}digestInto(t){ur(this),_n(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:o,blockLen:i,outputLen:a}=this;return t=t,t.finished=s,t.destroyed=o,t.blockLen=i,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ou=(e,t,n)=>new Nu(e,t).update(n).digest();Ou.create=(e,t)=>new Nu(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ue=BigInt(0),ie=BigInt(1),bt=BigInt(2),nb=BigInt(3),ju=BigInt(4),Fu=BigInt(5),Ru=BigInt(8);function ce(e,t){const n=e%t;return n>=ue?n:t+n}function me(e,t,n){let r=e;for(;t-- >ue;)r*=r,r%=n;return r}function _s(e,t){if(e===ue)throw new Error("invert: expected non-zero number");if(t<=ue)throw new Error("invert: expected positive modulus, got "+t);let n=ce(e,t),r=t,s=ue,o=ie;for(;n!==ue;){const a=r/n,c=r%n,u=s-o*a;r=n,n=c,s=o,o=u}if(r!==ie)throw new Error("invert: does not exist");return ce(s,t)}function Lu(e,t){const n=(e.ORDER+ie)/ju,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function rb(e,t){const n=(e.ORDER-Fu)/Ru,r=e.mul(t,bt),s=e.pow(r,n),o=e.mul(t,s),i=e.mul(e.mul(o,bt),s),a=e.mul(o,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function sb(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-ie,n=0;for(;t%bt===ue;)t/=bt,n++;let r=bt;const s=No(e);for(;Ri(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Lu;let o=s.pow(r,t);const i=(t+ie)/bt;return function(c,u){if(c.is0(u))return u;if(Ri(c,u)!==1)throw new Error("Cannot find square root");let f=n,l=c.mul(c.ONE,o),d=c.pow(u,t),h=c.pow(u,i);for(;!c.eql(d,c.ONE);){if(c.is0(d))return c.ZERO;let g=1,p=c.sqr(d);for(;!c.eql(p,c.ONE);)if(g++,p=c.sqr(p),g===f)throw new Error("Cannot find square root");const w=ie<<BigInt(f-g-1),A=c.pow(l,w);f=g,l=c.sqr(A),d=c.mul(d,l),h=c.mul(h,A)}return h}}function ob(e){return e%ju===nb?Lu:e%Ru===Fu?rb:sb(e)}const ib=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ab(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=ib.reduce((r,s)=>(r[s]="function",r),t);return Ir(e,n)}function cb(e,t,n){if(n<ue)throw new Error("invalid exponent, negatives unsupported");if(n===ue)return e.ONE;if(n===ie)return t;let r=e.ONE,s=t;for(;n>ue;)n&ie&&(r=e.mul(r,s)),s=e.sqr(s),n>>=ie;return r}function Mu(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),s=t.reduce((i,a,c)=>e.is0(a)?i:(r[c]=i,e.mul(i,a)),e.ONE),o=e.inv(s);return t.reduceRight((i,a,c)=>e.is0(a)?i:(r[c]=e.mul(i,r[c]),e.mul(i,a)),o),r}function Ri(e,t){const n=(e.ORDER-ie)/bt,r=e.pow(t,n),s=e.eql(r,e.ONE),o=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!s&&!o&&!i)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function zu(e,t){t!==void 0&&Us(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function No(e,t,n=!1,r={}){if(e<=ue)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:o}=zu(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const a=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:o,MASK:Pr(s),ZERO:ue,ONE:ie,create:c=>ce(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return ue<=c&&c<e},is0:c=>c===ue,isOdd:c=>(c&ie)===ie,neg:c=>ce(-c,e),eql:(c,u)=>c===u,sqr:c=>ce(c*c,e),add:(c,u)=>ce(c+u,e),sub:(c,u)=>ce(c-u,e),mul:(c,u)=>ce(c*u,e),pow:(c,u)=>cb(a,c,u),div:(c,u)=>ce(c*_s(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>_s(c,e),sqrt:r.sqrt||(c=>(i||(i=ob(e)),i(a,c))),toBytes:c=>n?Lc(c,o):Ln(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return n?Rc(c):yt(c)},invertBatch:c=>Mu(a,c),cmov:(c,u,f)=>f?u:c});return Object.freeze(a)}function Uu(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function _u(e){const t=Uu(e);return t+Math.ceil(t/2)}function ub(e,t,n=!1){const r=e.length,s=Uu(t),o=_u(t);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const i=n?Rc(e):yt(e),a=ce(i,t-ie)+ie;return n?Lc(a,s):Ln(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Li=BigInt(0),Hs=BigInt(1);function Qr(e,t){const n=t.negate();return e?n:t}function Hu(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function es(e,t){Hu(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,o=Pr(e),i=BigInt(e);return{windows:n,windowSize:r,mask:o,maxNumber:s,shiftBy:i}}function Mi(e,t,n){const{windowSize:r,mask:s,maxNumber:o,shiftBy:i}=n;let a=Number(e&s),c=e>>i;a>r&&(a-=o,c+=Hs);const u=t*r,f=u+Math.abs(a)-1,l=a===0,d=a<0,h=t%2!==0;return{nextN:c,offset:f,isZero:l,isNeg:d,isNegF:h,offsetF:u}}function fb(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function lb(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const ts=new WeakMap,Du=new WeakMap;function ns(e){return Du.get(e)||1}function db(e,t){return{constTimeNegate:Qr,hasPrecomputes(n){return ns(n)!==1},unsafeLadder(n,r,s=e.ZERO){let o=n;for(;r>Li;)r&Hs&&(s=s.add(o)),o=o.double(),r>>=Hs;return s},precomputeWindow(n,r){const{windows:s,windowSize:o}=es(r,t),i=[];let a=n,c=a;for(let u=0;u<s;u++){c=a,i.push(c);for(let f=1;f<o;f++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(n,r,s){let o=e.ZERO,i=e.BASE;const a=es(n,t);for(let c=0;c<a.windows;c++){const{nextN:u,offset:f,isZero:l,isNeg:d,isNegF:h,offsetF:g}=Mi(s,c,a);s=u,l?i=i.add(Qr(h,r[g])):o=o.add(Qr(d,r[f]))}return{p:o,f:i}},wNAFUnsafe(n,r,s,o=e.ZERO){const i=es(n,t);for(let a=0;a<i.windows&&s!==Li;a++){const{nextN:c,offset:u,isZero:f,isNeg:l}=Mi(s,a,i);if(s=c,!f){const d=r[u];o=o.add(l?d.negate():d)}}return o},getPrecomputes(n,r,s){let o=ts.get(r);return o||(o=this.precomputeWindow(r,n),n!==1&&ts.set(r,s(o))),o},wNAFCached(n,r,s){const o=ns(n);return this.wNAF(o,this.getPrecomputes(o,n,s),r)},wNAFCachedUnsafe(n,r,s,o){const i=ns(n);return i===1?this.unsafeLadder(n,r,o):this.wNAFUnsafe(i,this.getPrecomputes(i,n,s),r,o)},setWindowSize(n,r){Hu(r,t),Du.set(n,r),ts.delete(n)}}}function hb(e,t,n,r){fb(n,e),lb(r,t);const s=n.length,o=r.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,a=qd(BigInt(s));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=Pr(c),f=new Array(Number(u)+1).fill(i),l=Math.floor((t.BITS-1)/c)*c;let d=i;for(let h=l;h>=0;h-=c){f.fill(i);for(let p=0;p<o;p++){const w=r[p],A=Number(w>>BigInt(h)&u);f[A]=f[A].add(n[p])}let g=i;for(let p=f.length-1,w=i;p>0;p--)w=w.add(f[p]),g=g.add(w);if(d=d.add(g),h!==0)for(let p=0;p<c;p++)d=d.double()}return d}function Gu(e){return ab(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...zu(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zi(e){e.lowS!==void 0&&kn("lowS",e.lowS),e.prehash!==void 0&&kn("prehash",e.prehash)}function pb(e){const t=Gu(e);Ir(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class bb extends Error{constructor(t=""){super(t)}}const Ze={Err:bb,_tlv:{encode:(e,t)=>{const{Err:n}=Ze;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=Vn(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const o=r>127?Vn(s.length/2|128):"";return Vn(e)+o+s+t},decode(e,t){const{Err:n}=Ze;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],o=!!(s&128);let i=0;if(!o)i=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)i=i<<8|f;if(r+=c,i<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+i);if(a.length!==i)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Ze;if(e<Ke)throw new t("integer: negative integers are not allowed");let n=Vn(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ze;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return yt(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ze,s=we("signature",e),{v:o,l:i}=r.decode(48,s);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,o),{v:u,l:f}=r.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Ze,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),o=r+s;return t.encode(48,o)}};function rs(e,t){return $n(Ln(e,t))}const Ke=BigInt(0),Q=BigInt(1);BigInt(2);const ss=BigInt(3),gb=BigInt(4);function mb(e){const t=pb(e),{Fp:n}=t,r=No(t.n,t.nBitLength),s=t.toBytes||((v,m,y)=>{const P=m.toAffine();return ir(Uint8Array.from([4]),n.toBytes(P.x),n.toBytes(P.y))}),o=t.fromBytes||(v=>{const m=v.subarray(1),y=n.fromBytes(m.subarray(0,n.BYTES)),P=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:y,y:P}});function i(v){const{a:m,b:y}=t,P=n.sqr(v),x=n.mul(P,v);return n.add(n.add(x,n.mul(v,m)),y)}function a(v,m){const y=n.sqr(m),P=i(v);return n.eql(y,P)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(t.a,ss),gb),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,u)))throw new Error("bad curve params: a or b");function f(v){return mo(v,Q,t.n)}function l(v){const{allowedPrivateKeyLengths:m,nByteLength:y,wrapPrivateKey:P,n:x}=t;if(m&&typeof v!="bigint"){if(Rn(v)&&(v=$n(v)),typeof v!="string"||!m.includes(v.length))throw new Error("invalid private key");v=v.padStart(y*2,"0")}let I;try{I=typeof v=="bigint"?v:yt(we("private key",v,y))}catch{throw new Error("invalid private key, expected hex or "+y+" bytes, got "+typeof v)}return P&&(I=ce(I,x)),Mt("private key",I,Q,x),I}function d(v){if(!(v instanceof p))throw new Error("ProjectivePoint expected")}const h=bi((v,m)=>{const{px:y,py:P,pz:x}=v;if(n.eql(x,n.ONE))return{x:y,y:P};const I=v.is0();m==null&&(m=I?n.ONE:n.inv(x));const T=n.mul(y,m),E=n.mul(P,m),k=n.mul(x,m);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:T,y:E}}),g=bi(v=>{if(v.is0()){if(t.allowInfinityPoint&&!n.is0(v.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=v.toAffine();if(!n.isValid(m)||!n.isValid(y))throw new Error("bad point: x or y not FE");if(!a(m,y))throw new Error("bad point: equation left != right");if(!v.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(m,y,P){if(m==null||!n.isValid(m))throw new Error("x required");if(y==null||!n.isValid(y)||n.is0(y))throw new Error("y required");if(P==null||!n.isValid(P))throw new Error("z required");this.px=m,this.py=y,this.pz=P,Object.freeze(this)}static fromAffine(m){const{x:y,y:P}=m||{};if(!m||!n.isValid(y)||!n.isValid(P))throw new Error("invalid affine point");if(m instanceof p)throw new Error("projective point not allowed");const x=I=>n.eql(I,n.ZERO);return x(y)&&x(P)?p.ZERO:new p(y,P,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=Mu(n,m.map(P=>P.pz));return m.map((P,x)=>P.toAffine(y[x])).map(p.fromAffine)}static fromHex(m){const y=p.fromAffine(o(we("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return p.BASE.multiply(l(m))}static msm(m,y){return hb(p,r,m,y)}_setWindowSize(m){$.setWindowSize(this,m)}assertValidity(){g(this)}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:P,pz:x}=this,{px:I,py:T,pz:E}=m,k=n.eql(n.mul(y,E),n.mul(I,x)),N=n.eql(n.mul(P,E),n.mul(T,x));return k&&N}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,P=n.mul(y,ss),{px:x,py:I,pz:T}=this;let E=n.ZERO,k=n.ZERO,N=n.ZERO,F=n.mul(x,x),G=n.mul(I,I),S=n.mul(T,T),C=n.mul(x,I);return C=n.add(C,C),N=n.mul(x,T),N=n.add(N,N),E=n.mul(m,N),k=n.mul(P,S),k=n.add(E,k),E=n.sub(G,k),k=n.add(G,k),k=n.mul(E,k),E=n.mul(C,E),N=n.mul(P,N),S=n.mul(m,S),C=n.sub(F,S),C=n.mul(m,C),C=n.add(C,N),N=n.add(F,F),F=n.add(N,F),F=n.add(F,S),F=n.mul(F,C),k=n.add(k,F),S=n.mul(I,T),S=n.add(S,S),F=n.mul(S,C),E=n.sub(E,F),N=n.mul(S,G),N=n.add(N,N),N=n.add(N,N),new p(E,k,N)}add(m){d(m);const{px:y,py:P,pz:x}=this,{px:I,py:T,pz:E}=m;let k=n.ZERO,N=n.ZERO,F=n.ZERO;const G=t.a,S=n.mul(t.b,ss);let C=n.mul(y,I),M=n.mul(P,T),O=n.mul(x,E),L=n.add(y,P),H=n.add(I,T);L=n.mul(L,H),H=n.add(C,M),L=n.sub(L,H),H=n.add(y,x);let V=n.add(I,E);return H=n.mul(H,V),V=n.add(C,O),H=n.sub(H,V),V=n.add(P,x),k=n.add(T,E),V=n.mul(V,k),k=n.add(M,O),V=n.sub(V,k),F=n.mul(G,H),k=n.mul(S,O),F=n.add(k,F),k=n.sub(M,F),F=n.add(M,F),N=n.mul(k,F),M=n.add(C,C),M=n.add(M,C),O=n.mul(G,O),H=n.mul(S,H),M=n.add(M,O),O=n.sub(C,O),O=n.mul(G,O),H=n.add(H,O),C=n.mul(M,H),N=n.add(N,C),C=n.mul(V,H),k=n.mul(L,k),k=n.sub(k,C),C=n.mul(L,M),F=n.mul(V,F),F=n.add(F,C),new p(k,N,F)}subtract(m){return this.add(m.negate())}is0(){return this.equals(p.ZERO)}wNAF(m){return $.wNAFCached(this,m,p.normalizeZ)}multiplyUnsafe(m){const{endo:y,n:P}=t;Mt("scalar",m,Ke,P);const x=p.ZERO;if(m===Ke)return x;if(this.is0()||m===Q)return this;if(!y||$.hasPrecomputes(this))return $.wNAFCachedUnsafe(this,m,p.normalizeZ);let{k1neg:I,k1:T,k2neg:E,k2:k}=y.splitScalar(m),N=x,F=x,G=this;for(;T>Ke||k>Ke;)T&Q&&(N=N.add(G)),k&Q&&(F=F.add(G)),G=G.double(),T>>=Q,k>>=Q;return I&&(N=N.negate()),E&&(F=F.negate()),F=new p(n.mul(F.px,y.beta),F.py,F.pz),N.add(F)}multiply(m){const{endo:y,n:P}=t;Mt("scalar",m,Q,P);let x,I;if(y){const{k1neg:T,k1:E,k2neg:k,k2:N}=y.splitScalar(m);let{p:F,f:G}=this.wNAF(E),{p:S,f:C}=this.wNAF(N);F=$.constTimeNegate(T,F),S=$.constTimeNegate(k,S),S=new p(n.mul(S.px,y.beta),S.py,S.pz),x=F.add(S),I=G.add(C)}else{const{p:T,f:E}=this.wNAF(m);x=T,I=E}return p.normalizeZ([x,I])[0]}multiplyAndAddUnsafe(m,y,P){const x=p.BASE,I=(E,k)=>k===Ke||k===Q||!E.equals(x)?E.multiplyUnsafe(k):E.multiply(k),T=I(this,y).add(I(m,P));return T.is0()?void 0:T}toAffine(m){return h(this,m)}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===Q)return!0;if(y)return y(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===Q?this:y?y(p,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return kn("isCompressed",m),this.assertValidity(),s(p,this,m)}toHex(m=!0){return kn("isCompressed",m),$n(this.toRawBytes(m))}}p.BASE=new p(t.Gx,t.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:A}=t,$=db(p,w?Math.ceil(A/2):A);return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:f}}function yb(e){const t=Gu(e);return Ir(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function wb(e){const t=yb(e),{Fp:n,n:r,nByteLength:s,nBitLength:o}=t,i=n.BYTES+1,a=2*n.BYTES+1;function c(S){return ce(S,r)}function u(S){return _s(S,r)}const{ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:d,isWithinCurveOrder:h}=mb({...t,toBytes(S,C,M){const O=C.toAffine(),L=n.toBytes(O.x),H=ir;return kn("isCompressed",M),M?H(Uint8Array.from([C.hasEvenY()?2:3]),L):H(Uint8Array.from([4]),L,n.toBytes(O.y))},fromBytes(S){const C=S.length,M=S[0],O=S.subarray(1);if(C===i&&(M===2||M===3)){const L=yt(O);if(!mo(L,Q,n.ORDER))throw new Error("Point is not on curve");const H=d(L);let V;try{V=n.sqrt(H)}catch(re){const Y=re instanceof Error?": "+re.message:"";throw new Error("Point is not on curve"+Y)}const W=(V&Q)===Q;return(M&1)===1!==W&&(V=n.neg(V)),{x:L,y:V}}else if(C===a&&M===4){const L=n.fromBytes(O.subarray(0,n.BYTES)),H=n.fromBytes(O.subarray(n.BYTES,2*n.BYTES));return{x:L,y:H}}else{const L=i,H=a;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+H+", got "+C)}}});function g(S){const C=r>>Q;return S>C}function p(S){return g(S)?c(-S):S}const w=(S,C,M)=>yt(S.slice(C,M));class A{constructor(C,M,O){Mt("r",C,Q,r),Mt("s",M,Q,r),this.r=C,this.s=M,O!=null&&(this.recovery=O),Object.freeze(this)}static fromCompact(C){const M=s;return C=we("compactSignature",C,M*2),new A(w(C,0,M),w(C,M,2*M))}static fromDER(C){const{r:M,s:O}=Ze.toSig(we("DER",C));return new A(M,O)}assertValidity(){}addRecoveryBit(C){return new A(this.r,this.s,C)}recoverPublicKey(C){const{r:M,s:O,recovery:L}=this,H=x(we("msgHash",C));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const V=L===2||L===3?M+t.n:M;if(V>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const W=L&1?"03":"02",J=f.fromHex(W+rs(V,n.BYTES)),re=u(V),Y=c(-H*re),ze=c(O*re),ve=f.BASE.multiplyAndAddUnsafe(J,Y,ze);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return or(this.toDERHex())}toDERHex(){return Ze.hexFromSig(this)}toCompactRawBytes(){return or(this.toCompactHex())}toCompactHex(){const C=s;return rs(this.r,C)+rs(this.s,C)}}const $={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const S=_u(t.n);return ub(t.randomBytes(S),t.n)},precompute(S=8,C=f.BASE){return C._setWindowSize(S),C.multiply(BigInt(3)),C}};function v(S,C=!0){return f.fromPrivateKey(S).toRawBytes(C)}function m(S){if(typeof S=="bigint")return!1;if(S instanceof f)return!0;const M=we("key",S).length,O=n.BYTES,L=O+1,H=2*O+1;if(!(t.allowedPrivateKeyLengths||s===L))return M===L||M===H}function y(S,C,M=!0){if(m(S)===!0)throw new Error("first arg must be private key");if(m(C)===!1)throw new Error("second arg must be public key");return f.fromHex(C).multiply(l(S)).toRawBytes(M)}const P=t.bits2int||function(S){if(S.length>8192)throw new Error("input is too large");const C=yt(S),M=S.length*8-o;return M>0?C>>BigInt(M):C},x=t.bits2int_modN||function(S){return c(P(S))},I=Pr(o);function T(S){return Mt("num < 2^"+o,S,Ke,I),Ln(S,s)}function E(S,C,M=k){if(["recovered","canonical"].some(Ce=>Ce in M))throw new Error("sign() legacy options not supported");const{hash:O,randomBytes:L}=t;let{lowS:H,prehash:V,extraEntropy:W}=M;H==null&&(H=!0),S=we("msgHash",S),zi(M),V&&(S=we("prehashed msgHash",O(S)));const J=x(S),re=l(C),Y=[T(re),T(J)];if(W!=null&&W!==!1){const Ce=W===!0?L(n.BYTES):W;Y.push(we("extraEntropy",Ce))}const ze=ir(...Y),ve=J;function nt(Ce){const Ue=P(Ce);if(!h(Ue))return;const $t=u(Ue),rt=f.BASE.multiply(Ue).toAffine(),_e=c(rt.x);if(_e===Ke)return;const He=c($t*c(ve+_e*re));if(He===Ke)return;let De=(rt.x===_e?0:2)|Number(rt.y&Q),Dn=He;return H&&g(He)&&(Dn=p(He),De^=1),new A(_e,Dn,De)}return{seed:ze,k2sig:nt}}const k={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function F(S,C,M=k){const{seed:O,k2sig:L}=E(S,C,M),H=t;return Wd(H.hash.outputLen,H.nByteLength,H.hmac)(O,L)}f.BASE._setWindowSize(8);function G(S,C,M,O=N){const L=S;C=we("msgHash",C),M=we("publicKey",M);const{lowS:H,prehash:V,format:W}=O;if(zi(O),"strict"in O)throw new Error("options.strict was renamed to lowS");if(W!==void 0&&W!=="compact"&&W!=="der")throw new Error("format must be compact or der");const J=typeof L=="string"||Rn(L),re=!J&&!W&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!J&&!re)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,ze;try{if(re&&(Y=new A(L.r,L.s)),J){try{W!=="compact"&&(Y=A.fromDER(L))}catch(De){if(!(De instanceof Ze.Err))throw De}!Y&&W!=="der"&&(Y=A.fromCompact(L))}ze=f.fromHex(M)}catch{return!1}if(!Y||H&&Y.hasHighS())return!1;V&&(C=t.hash(C));const{r:ve,s:nt}=Y,Ce=x(C),Ue=u(nt),$t=c(Ce*Ue),rt=c(ve*Ue),_e=f.BASE.multiplyAndAddUnsafe(ze,$t,rt)?.toAffine();return _e?c(_e.x)===ve:!1}return{CURVE:t,getPublicKey:v,getSharedSecret:y,sign:F,verify:G,ProjectivePoint:f,Signature:A,utils:$}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xb(e){return{hash:e,hmac:(t,...n)=>Ou(e,t,qp(...n)),randomBytes:Zp}}function vb(e,t){const n=r=>wb({...e,...xb(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vu=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ui=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Eb=BigInt(0),Ab=BigInt(1),Ds=BigInt(2),_i=(e,t)=>(e+t/Ds)/t;function Pb(e){const t=Vu,n=BigInt(3),r=BigInt(6),s=BigInt(11),o=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,f=u*u*e%t,l=me(f,n,t)*f%t,d=me(l,n,t)*f%t,h=me(d,Ds,t)*u%t,g=me(h,s,t)*h%t,p=me(g,o,t)*g%t,w=me(p,a,t)*p%t,A=me(w,c,t)*w%t,$=me(A,a,t)*p%t,v=me($,n,t)*f%t,m=me(v,i,t)*g%t,y=me(m,r,t)*u%t,P=me(y,Ds,t);if(!Gs.eql(Gs.sqr(P),e))throw new Error("Cannot find square root");return P}const Gs=No(Vu,void 0,void 0,{sqrt:Pb}),qu=vb({a:Eb,b:BigInt(7),Fp:Gs,n:Ui,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ui,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ab*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,i=BigInt("0x100000000000000000000000000000000"),a=_i(o*e,t),c=_i(-r*e,t);let u=ce(e-a*n-c*s,t),f=ce(-a*r-c*o,t);const l=u>i,d=f>i;if(l&&(u=t-u),d&&(f=t-f),u>i||f>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:u,k2neg:d,k2:f}}}},tb),Ib=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:qu},Symbol.toStringTag,{value:"Module"}));function Wu(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new os({signature:e});if(typeof e.s>"u")throw new os({signature:e});if(n&&typeof e.yParity>"u")throw new os({signature:e});if(e.r<0n||e.r>Oi)throw new Nb({value:e.r});if(e.s<0n||e.s>Oi)throw new Ob({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new jo({value:e.yParity})}function kb(e){return Zu(Ie(e))}function Zu(e){if(e.length!==130&&e.length!==132)throw new Tb({signature:e});const t=BigInt(Oe(e,0,32)),n=BigInt(Oe(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return Oo(s)}catch{throw new jo({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function $b(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Bb(e)}function Bb(e){const t=typeof e=="string"?Zu(e):e instanceof Uint8Array?kb(e):typeof e.r=="string"?Sb(e):e.v?Cb(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Wu(t),t}function Cb(e){return{r:e.r,s:e.s,yParity:Oo(e.v)}}function Sb(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Oo(n)),typeof r!="number")throw new jo({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Oo(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new jb({value:e})}class Tb extends D{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${be(y1(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class os extends D{constructor({signature:t}){super(`Signature \`${_c(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Nb extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Ob extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class jo extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class jb extends D{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function Fb(e,t={}){return typeof e.chainId=="string"?Rb(e):{...e,...t.signature}}function Rb(e){const{address:t,chainId:n,nonce:r}=e,s=$b(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}const Lb="0x8010801080108010801080108010801080108010801080108010801080108010",Mb=Bu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function Ku(e){if(typeof e=="string"){if(Oe(e,-32)!==Lb)throw new _b(e)}else Wu(e.authorization)}function zb(e){Ku(e);const t=qc(Oe(e,-64,-32)),n=Oe(e,-t-64,-64),r=Oe(e,0,-t-64),[s,o,i]=Lp(Mb,n);return{authorization:Fb({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...i&&i!=="0x"?{data:i,to:o}:{}}}function Ub(e){try{return Ku(e),!0}catch{return!1}}let _b=class extends D{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};function Hb(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function Db(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Qe(e.nonce):void 0,storageProof:e.storageProof?Hb(e.storageProof):void 0}}async function Gb(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const o=r??"latest",i=n!==void 0?_(n):void 0,a=await e.request({method:"eth_getProof",params:[t,s,i||o]});return Db(a)}async function Vb(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const o=n!==void 0?_(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,o||r]})}async function Fo(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o,sender:i,nonce:a}){const c=r||"latest",u=n!==void 0?_(n):void 0;let f=null;if(s?f=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?f=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,_(o)]},{dedupe:!0}):typeof o=="number"?f=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||c,_(o)]},{dedupe:!!u}):i&&typeof a=="number"&&(f=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,_(a)]},{dedupe:!0})),!f)throw new hc({blockHash:t,blockNumber:n,blockTag:c,hash:s,index:o});return(e.chain?.formatters?.transaction?.format||ao)(f,"getTransaction")}async function qb(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([U(e,Un,"getBlockNumber")({}),t?U(e,Fo,"getTransaction")({hash:t}):void 0]),o=n?.blockNumber||s?.blockNumber;return o?r-o+1n:0n}async function Xn(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new pc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||ou)(n,"getTransactionReceipt")}async function Wb(e,t){const{account:n,authorizationList:r,allowFailure:s=!0,blockNumber:o,blockOverrides:i,blockTag:a,stateOverride:c}=t,u=t.contracts,{batchSize:f=t.batchSize??1024,deployless:l=t.deployless??!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},d=(()=>{if(t.multicallAddress)return t.multicallAddress;if(l)return null;if(e.chain)return Kt({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let g=0,p=0;for(let $=0;$<u.length;$++){const{abi:v,address:m,args:y,functionName:P}=u[$];try{const x=Be({abi:v,args:y,functionName:P});p+=(x.length-2)/2,f>0&&p>f&&h[g].length>0&&(g++,p=(x.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:x,target:m}]}catch(x){const I=Dt(x,{abi:v,address:m,args:y,docsPath:"/docs/contract/multicall",functionName:P,sender:n});if(!s)throw I;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:m}]}}const w=await Promise.allSettled(h.map($=>U(e,ke,"readContract")({...d===null?{code:wo}:{address:d},abi:ar,account:n,args:[$],authorizationList:r,blockNumber:o,blockOverrides:i,blockTag:a,functionName:"aggregate3",stateOverride:c}))),A=[];for(let $=0;$<w.length;$++){const v=w[$];if(v.status==="rejected"){if(!s)throw v.reason;for(let y=0;y<h[$].length;y++)A.push({status:"failure",error:v.reason,result:void 0});continue}const m=v.value;for(let y=0;y<m.length;y++){const{returnData:P,success:x}=m[y],{callData:I}=h[$][y],{abi:T,address:E,functionName:k,args:N}=u[A.length];try{if(I==="0x")throw new Cn;if(!x)throw new xr({data:P});const F=It({abi:T,args:N,data:P,functionName:k});A.push(s?{result:F,status:"success"}:F)}catch(F){const G=Dt(F,{abi:T,address:E,args:N,docsPath:"/docs/contract/multicall",functionName:k});if(!s)throw G;A.push({error:G,result:void 0,status:"failure"})}}}if(A.length!==u.length)throw new B("multicall results mismatch");return A}async function Vs(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:o,traceTransfers:i,validation:a}=t;try{const c=[];for(const d of s){const h=d.blockOverrides?Kc(d.blockOverrides):void 0,g=d.calls.map(w=>{const A=w,$=A.account?pe(A.account):void 0,v=A.abi?Be(A):A.data,m={...A,account:$,data:A.dataSuffix?Le([v||"0x",A.dataSuffix]):v,from:A.from??$?.address};return Zt(m),Fn(m)}),p=d.stateOverrides?oo(d.stateOverrides):void 0;c.push({blockOverrides:h,calls:g,stateOverrides:p})}const f=(typeof n=="bigint"?_(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:o,traceTransfers:i,validation:a},f]})).map((d,h)=>({...Pc(d),calls:d.calls.map((g,p)=>{const{abi:w,args:A,functionName:$,to:v}=s[h].calls[p],m=g.error?.data??g.returnData,y=BigInt(g.gasUsed),P=g.logs?.map(E=>et(E)),x=g.status==="0x1"?"success":"failure",I=w&&x==="success"&&m!=="0x"?It({abi:w,data:m,functionName:$}):null,T=(()=>{if(x==="success")return;let E;if(g.error?.data==="0x"?E=new Cn:g.error&&(E=new xr(g.error)),!!E)return Dt(E,{abi:w??[],address:v??"0x",args:A,functionName:$??"<unknown>"})})();return{data:m,gasUsed:y,logs:P,status:x,...x==="success"?{result:I}:{error:T}}})}))}catch(c){const u=c,f=vr(u,{});throw f instanceof jn?u:f}}function qs(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){o=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!o)throw new D("Unable to normalize signature.");return s}function Ws(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ls(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>Ws(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Ws(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Yu(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return Yu(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Ls(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Ls(n[r],{strict:!1}):!1)return i}}function Ju(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Ho(e):e;return{...r,...n?{hash:Ft(r)}:{}}}function Or(e,t,n){const{args:r=[],prepare:s=!0}=n??{},o=w1(t,{strict:!1}),i=e.filter(u=>o?u.type==="function"||u.type==="error"?Xu(u)===Oe(t,0,4):u.type==="event"?Ft(u)===t:!1:"name"in u&&u.name===t);if(i.length===0)throw new lr({name:t});if(i.length===1)return{...i[0],...s?{hash:Ft(i[0])}:{}};let a;for(const u of i){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:Ft(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((l,d)=>{const h="inputs"in u&&u.inputs[d];return h?Ws(l,h):!1})){if(a&&"inputs"in a&&a.inputs){const l=Yu(u.inputs,a.inputs,r);if(l)throw new Kb({abiItem:u,type:l[0]},{abiItem:a,type:l[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...f]=i;return{...u,overloads:f}})();if(!c)throw new lr({name:t});return{...c,...s?{hash:Ft(c)}:{}}}function Xu(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Or(n,r)}return e[0]})();return Oe(Ft(t),0,4)}function Zb(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,s]=e;return Or(r,s)}return e[0]})(),n=typeof t=="string"?t:Qn(t);return qs(n)}function Ft(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Or(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Iu(yo(Zb(t)))}class Kb extends D{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${qs(Qn(t.abiItem))}\`, and`,`\`${n.type}\` in \`${qs(Qn(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class lr extends D{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Yb(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[o,i]=e;return[Xb(o),i]}return e})(),{bytecode:r,args:s}=n;return Pe(r,t.inputs?.length&&s?.length?Co(t.inputs,s):"0x")}function Jb(e){return Ju(e)}function Xb(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new lr({name:"constructor"});return t}function Qb(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[u,f,l]=e;return[Hi(u,f,{args:l}),l]}const[a,c]=e;return[a,c]})(),{overloads:r}=t,s=r?Hi([t,...r],t.name,{args:n}):t,o=e5(s),i=n.length>0?Co(s.inputs,n):void 0;return i?Pe(o,i):o}function Tt(e,t={}){return Ju(e,t)}function Hi(e,t,n){const r=Or(e,t,n);if(r.type!=="function")throw new lr({name:t,type:"function"});return r}function e5(e){return Xu(e)}const t5="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ne="0x0000000000000000000000000000000000000000",n5="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function r5(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:o,traceAssetChanges:i,traceTransfers:a,validation:c}=t,u=t.account?pe(t.account):void 0;if(i&&!u)throw new B("`account` is required when `traceAssetChanges` is true");const f=u?Yb(Jb("constructor(bytes, bytes)"),{bytecode:Qc,args:[n5,Qb(Tt("function getBalance(address)"),[u.address])]}):void 0,l=i?await Promise.all(t.calls.map(async O=>{if(!O.data&&!O.abi)return;const{accessList:L}=await lu(e,{account:u.address,...O,data:O.abi?Be(O):O.data});return L.map(({address:H,storageKeys:V})=>V.length>0?H:null)})).then(O=>O.flat().filter(Boolean)):[],d=await Vs(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:f}],stateOverrides:o},{calls:l.map((O,L)=>({abi:[Tt("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:O,from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]}]:[],{calls:[...s,{}].map(O=>({...O,from:u?.address})),stateOverrides:o},...i?[{calls:[{data:f}]},{calls:l.map((O,L)=>({abi:[Tt("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:O,from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((O,L)=>({to:O,abi:[Tt("function decimals() returns (uint256)")],functionName:"decimals",from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((O,L)=>({to:O,abi:[Tt("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]},{calls:l.map((O,L)=>({to:O,abi:[Tt("function symbol() returns (string)")],functionName:"symbol",from:Ne,nonce:L})),stateOverrides:[{address:Ne,nonce:0}]}]:[]],traceTransfers:a,validation:c}),h=i?d[2]:d[0],[g,p,,w,A,$,v,m]=i?d:[],{calls:y,...P}=h,x=y.slice(0,-1)??[],I=g?.calls??[],T=p?.calls??[],E=[...I,...T].map(O=>O.status==="success"?Fe(O.data):null),k=w?.calls??[],N=A?.calls??[],F=[...k,...N].map(O=>O.status==="success"?Fe(O.data):null),G=($?.calls??[]).map(O=>O.status==="success"?O.result:null),S=(m?.calls??[]).map(O=>O.status==="success"?O.result:null),C=(v?.calls??[]).map(O=>O.status==="success"?O.result:null),M=[];for(const[O,L]of F.entries()){const H=E[O];if(typeof L!="bigint"||typeof H!="bigint")continue;const V=G[O-1],W=S[O-1],J=C[O-1],re=O===0?{address:t5,decimals:18,symbol:"ETH"}:{address:l[O-1],decimals:J||V?Number(V??1):void 0,symbol:W??void 0};M.some(Y=>Y.token.address===re.address)||M.push({token:re,value:{pre:H,post:L,diff:L-H}})}return{assetChanges:M,block:P,results:x}}const Qu="0x6492649264926492649264926492649264926492649264926492649264926492";function s5(e){if(Oe(e,-32)!==Qu)throw new a5(e)}function o5(e){const{data:t,signature:n,to:r}=e;return Pe(Co(Bu("address, bytes, bytes"),[r,t,n]),Qu)}function i5(e){try{return s5(e),!0}catch{return!1}}class a5 extends D{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function c5({r:e,s:t,to:n="hex",v:r,yParity:s}){const o=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new qu.Signature(Fe(e),Fe(t)).toCompactHex()}${o===0?"1b":"1c"}`;return n==="hex"?i:Re(i)}async function jr(e,t){const{address:n,chain:r=e.chain,hash:s,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??r?.contracts?.erc6492Verifier?.address,multicallAddress:i=t.multicallAddress??r?.contracts?.multicall3?.address}=t;if(r?.verifyHash)return await r.verifyHash(e,t);const a=(()=>{const c=t.signature;return je(c)?c:typeof c=="object"&&"r"in c&&"s"in c?c5(c):X(c)})();try{return Ub(a)?await u5(e,{...t,multicallAddress:i,signature:a}):await f5(e,{...t,verifierAddress:o,signature:a})}catch(c){try{if(Ar(nc(n),await mc({hash:s,signature:a})))return!0}catch{}if(c instanceof Et)return!1;throw c}}async function u5(e,t){const{address:n,blockNumber:r,blockTag:s,hash:o,multicallAddress:i}=t,{authorization:a,data:c,signature:u,to:f}=zb(t.signature);if(await Rs(e,{address:n,blockNumber:r,blockTag:s})===Wt(["0xef0100",a.address]))return await l5(e,{address:n,blockNumber:r,blockTag:s,hash:o,signature:u});const d={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:_(a.r,{size:32}),s:_(a.s,{size:32}),yParity:a.yParity};if(!await xh({address:n,authorization:d}))throw new Et;const g=await U(e,ke,"readContract")({...i?{address:i}:{code:wo},authorizationList:[d],abi:ar,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:f??n,callData:c}]:[],{allowFailure:!0,target:n,callData:Be({abi:Xc,functionName:"isValidSignature",args:[o,u]})}]]});if(g[g.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new Et}async function f5(e,t){const{address:n,factory:r,factoryData:s,hash:o,signature:i,verifierAddress:a,...c}=t,u=await(async()=>!r&&!s||i5(i)?i:o5({data:s,signature:i,to:r}))(),f=a?{to:a,data:Be({abi:vi,functionName:"isValidSig",args:[n,o,u]}),...c}:{data:xo({abi:vi,args:[n,o,u],bytecode:k1}),...c},{data:l}=await U(e,$r,"call")(f).catch(d=>{throw d instanceof bc?new Et:d});if(Uf(l??"0x0"))return!0;throw new Et}async function l5(e,t){const{address:n,blockNumber:r,blockTag:s,hash:o,signature:i}=t;if((await U(e,ke,"readContract")({address:n,abi:Xc,args:[o,i],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof gc?new Et:c})).startsWith("0x1626ba7e"))return!0;throw new Et}class Et extends Error{}async function d5(e,{address:t,message:n,factory:r,factoryData:s,signature:o,...i}){const a=pu(n);return U(e,jr,"verifyHash")({address:t,factory:r,factoryData:s,hash:a,signature:o,...i})}async function h5(e,t){const{address:n,factory:r,factoryData:s,signature:o,message:i,primaryType:a,types:c,domain:u,...f}=t,l=Rh({message:i,primaryType:a,types:c,domain:u});return U(e,jr,"verifyHash")({address:n,factory:r,factoryData:s,hash:l,signature:o,...f})}function e0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:o,pollingInterval:i=e.pollingInterval}){const a=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let c;return a?(()=>{const l=ne(["watchBlockNumber",e.uid,t,n,i]);return dt(l,{onBlockNumber:r,onError:s},d=>zn(async()=>{try{const h=await U(e,Un,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(h===c)return;if(h-c>1&&n)for(let g=c+1n;g<h;g++)d.onBlockNumber(g,c),c=g}(c===void 0||h>c)&&(d.onBlockNumber(h,c),c=h)}catch(h){d.onError?.(h)}},{emitOnBegin:t,interval:i}))})():(()=>{const l=ne(["watchBlockNumber",e.uid,t,n]);return dt(l,{onBlockNumber:r,onError:s},d=>{let h=!0,g=()=>h=!1;return(async()=>{try{const p=(()=>{if(e.transport.type==="fallback"){const A=e.transport.transports.find($=>$.config.type==="webSocket"||$.config.type==="ipc");return A?A.value:e.transport}return e.transport})(),{unsubscribe:w}=await p.subscribe({params:["newHeads"],onData(A){if(!h)return;const $=Fe(A.result?.number);d.onBlockNumber($,c),c=$},onError(A){d.onError?.(A)}});g=w,h||g()}catch(p){s?.(p)}})(),()=>g()})})()}async function p5(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:s,onReplaced:o,retryCount:i=6,retryDelay:a=({count:y})=>~~(1<<y)*200,timeout:c=18e4}=t,u=ne(["waitForTransactionReceipt",e.uid,s]),f=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let l,d,h,g=!1,p,w;const{promise:A,resolve:$,reject:v}=nu(),m=c?setTimeout(()=>{w?.(),p?.(),v(new td({hash:s}))},c):void 0;return p=dt(u,{onReplaced:o,resolve:$,reject:v},async y=>{if(h=await U(e,Xn,"getTransactionReceipt")({hash:s}).catch(()=>{}),h&&r<=1){clearTimeout(m),y.resolve(h),p?.();return}w=U(e,e0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:f,async onBlockNumber(P){const x=T=>{clearTimeout(m),w?.(),T(),p?.()};let I=P;if(!g)try{if(h){if(r>1&&(!h.blockNumber||I-h.blockNumber+1n<r))return;x(()=>y.resolve(h));return}if(n&&!l&&(g=!0,await Os(async()=>{l=await U(e,Fo,"getTransaction")({hash:s}),l.blockNumber&&(I=l.blockNumber)},{delay:a,retryCount:i}),g=!1),h=await U(e,Xn,"getTransactionReceipt")({hash:s}),r>1&&(!h.blockNumber||I-h.blockNumber+1n<r))return;x(()=>y.resolve(h))}catch(T){if(T instanceof hc||T instanceof pc){if(!l){g=!1;return}try{d=l,g=!0;const E=await Os(()=>U(e,Ee,"getBlock")({blockNumber:I,includeTransactions:!0}),{delay:a,retryCount:i,shouldRetry:({error:F})=>F instanceof Ec});g=!1;const k=E.transactions.find(({from:F,nonce:G})=>F===d.from&&G===d.nonce);if(!k||(h=await U(e,Xn,"getTransactionReceipt")({hash:k.hash}),r>1&&(!h.blockNumber||I-h.blockNumber+1n<r)))return;let N="replaced";k.to===d.to&&k.value===d.value&&k.input===d.input?N="repriced":k.from===k.to&&k.value===0n&&(N="cancelled"),x(()=>{y.onReplaced?.({reason:N,replacedTransaction:d,transaction:k,transactionReceipt:h}),y.resolve(h)})}catch(E){x(()=>y.reject(E))}}else x(()=>y.reject(T))}}})}),A}function b5(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:o,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){const u=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=i??!1;let l;return u?(()=>{const g=ne(["watchBlocks",e.uid,t,n,r,f,c]);return dt(g,{onBlock:s,onError:o},p=>zn(async()=>{try{const w=await U(e,Ee,"getBlock")({blockTag:t,includeTransactions:f});if(w.number!==null&&l?.number!=null){if(w.number===l.number)return;if(w.number-l.number>1&&n)for(let A=l?.number+1n;A<w.number;A++){const $=await U(e,Ee,"getBlock")({blockNumber:A,includeTransactions:f});p.onBlock($,l),l=$}}(l?.number==null||t==="pending"&&w?.number==null||w.number!==null&&w.number>l.number)&&(p.onBlock(w,l),l=w)}catch(w){p.onError?.(w)}},{emitOnBegin:r,interval:c}))})():(()=>{let g=!0,p=!0,w=()=>g=!1;return(async()=>{try{r&&U(e,Ee,"getBlock")({blockTag:t,includeTransactions:f}).then(v=>{g&&p&&(s(v,void 0),p=!1)}).catch(o);const A=(()=>{if(e.transport.type==="fallback"){const v=e.transport.transports.find(m=>m.config.type==="webSocket"||m.config.type==="ipc");return v?v.value:e.transport}return e.transport})(),{unsubscribe:$}=await A.subscribe({params:["newHeads"],async onData(v){if(!g)return;const m=await U(e,Ee,"getBlock")({blockNumber:v.result?.number,includeTransactions:f}).catch(()=>{});g&&(s(m,l),p=!1,l=m)},onError(v){o?.(v)}});w=$,g||w()}catch(A){o?.(A)}})(),()=>w()})()}function g5(e,{address:t,args:n,batch:r=!0,event:s,events:o,fromBlock:i,onError:a,onLogs:c,poll:u,pollingInterval:f=e.pollingInterval,strict:l}){const d=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),h=l??!1;return d?(()=>{const w=ne(["watchEvent",t,n,r,e.uid,s,f,i]);return dt(w,{onLogs:c,onError:a},A=>{let $;i!==void 0&&($=i-1n);let v,m=!1;const y=zn(async()=>{if(!m){try{v=await U(e,du,"createEventFilter")({address:t,args:n,event:s,events:o,strict:h,fromBlock:i})}catch{}m=!0;return}try{let P;if(v)P=await U(e,Br,"getFilterChanges")({filter:v});else{const x=await U(e,Un,"getBlockNumber")({});$&&$!==x?P=await U(e,po,"getLogs")({address:t,args:n,event:s,events:o,fromBlock:$+1n,toBlock:x}):P=[],$=x}if(P.length===0)return;if(r)A.onLogs(P);else for(const x of P)A.onLogs([x])}catch(P){v&&P instanceof lt&&(m=!1),A.onError?.(P)}},{emitOnBegin:!0,interval:f});return async()=>{v&&await U(e,Cr,"uninstallFilter")({filter:v}),y()}})})():(()=>{let w=!0,A=()=>w=!1;return(async()=>{try{const $=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),v=o??(s?[s]:void 0);let m=[];v&&(m=[v.flatMap(x=>Tn({abi:[x],eventName:x.name,args:n}))],s&&(m=m[0]));const{unsubscribe:y}=await $.subscribe({params:["logs",{address:t,topics:m}],onData(P){if(!w)return;const x=P.result;try{const{eventName:I,args:T}=sr({abi:v??[],data:x.data,topics:x.topics,strict:h}),E=et(x,{args:T,eventName:I});c([E])}catch(I){let T,E;if(I instanceof er||I instanceof Ys){if(l)return;T=I.abiItem.name,E=I.abiItem.inputs?.some(N=>!("name"in N&&N.name))}const k=et(x,{args:E?[]:{},eventName:T});c([k])}},onError(P){a?.(P)}});A=y,w||A()}catch($){a?.($)}})(),()=>A()})()}function m5(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=ne(["watchPendingTransactions",e.uid,t,o]);return dt(u,{onTransactions:r,onError:n},f=>{let l;const d=zn(async()=>{try{if(!l)try{l=await U(e,hu,"createPendingTransactionFilter")({});return}catch(g){throw d(),g}const h=await U(e,Br,"getFilterChanges")({filter:l});if(h.length===0)return;if(t)f.onTransactions(h);else for(const g of h)f.onTransactions([g])}catch(h){f.onError?.(h)}},{emitOnBegin:!0,interval:o});return async()=>{l&&await U(e,Cr,"uninstallFilter")({filter:l}),d()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:l}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;const h=d.result;r([h])},onError(d){n?.(d)}});f=l,u||f()}catch(l){n?.(l)}})(),()=>f()})()}function y5(e){const{scheme:t,statement:n,...r}=e.match(w5)?.groups??{},{chainId:s,expirationTime:o,issuedAt:i,notBefore:a,requestId:c,...u}=e.match(x5)?.groups??{},f=e.split("Resources:")[1]?.split(`
|
|
43
|
+
- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...o?{expirationTime:new Date(o)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...f?{resources:f}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const w5=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,x5=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function v5(e){const{address:t,domain:n,message:r,nonce:s,scheme:o,time:i=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||o&&r.scheme!==o||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!xe(r.address,{strict:!1})||t&&!Ar(r.address,t))return!1}catch{return!1}return!0}async function E5(e,t){const{address:n,domain:r,message:s,nonce:o,scheme:i,signature:a,time:c=new Date,...u}=t,f=y5(s);if(!f.address||!v5({address:n,domain:r,message:f,nonce:o,scheme:i,time:c}))return!1;const d=pu(s);return jr(e,{address:f.address,hash:d,signature:a,...u})}async function A5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){const s=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,_(r)]:[t]},{retryCount:0}),i=(e.chain?.formatters?.transactionReceipt?.format||ou)(s);if(i.status==="reverted"&&n)throw new ed({receipt:i});return i}function P5(e){return{call:t=>$r(e,t),createAccessList:t=>lu(e,t),createBlockFilter:()=>fh(e),createContractEventFilter:t=>cc(e,t),createEventFilter:t=>du(e,t),createPendingTransactionFilter:()=>hu(e),estimateContractGas:t=>Hd(e,t),estimateGas:t=>lo(e,t),getBalance:t=>lh(e,t),getBlobBaseFee:()=>dh(e),getBlock:t=>Ee(e,t),getBlockNumber:t=>Un(e,t),getBlockTransactionCount:t=>hh(e,t),getBytecode:t=>Rs(e,t),getChainId:()=>fo(e),getCode:t=>Rs(e,t),getContractEvents:t=>Oc(e,t),getEip712Domain:t=>bh(e,t),getEnsAddress:t=>Z1(e,t),getEnsAvatar:t=>ah(e,t),getEnsName:t=>ch(e,t),getEnsResolver:t=>uh(e,t),getEnsText:t=>fu(e,t),getFeeHistory:t=>yh(e,t),estimateFeesPerGas:t=>Ad(e,t),getFilterChanges:t=>Br(e,t),getFilterLogs:t=>wh(e,t),getGasPrice:()=>co(e),getLogs:t=>po(e,t),getProof:t=>Gb(e,t),estimateMaxPriorityFeePerGas:t=>Ed(e,t),fillTransaction:t=>Tc(e,t),getStorageAt:t=>Vb(e,t),getTransaction:t=>Fo(e,t),getTransactionConfirmations:t=>qb(e,t),getTransactionCount:t=>kc(e,t),getTransactionReceipt:t=>Xn(e,t),multicall:t=>Wb(e,t),prepareTransactionRequest:t=>Nc(e,t),readContract:t=>ke(e,t),sendRawTransaction:t=>z1(e,t),sendRawTransactionSync:t=>A5(e,t),simulate:t=>Vs(e,t),simulateBlocks:t=>Vs(e,t),simulateCalls:t=>r5(e,t),simulateContract:t=>T1(e,t),verifyHash:t=>jr(e,t),verifyMessage:t=>d5(e,t),verifySiweMessage:t=>E5(e,t),verifyTypedData:t=>h5(e,t),uninstallFilter:t=>Cr(e,t),waitForTransactionReceipt:t=>p5(e,t),watchBlocks:t=>b5(e,t),watchBlockNumber:t=>e0(e,t),watchContractEvent:t=>M1(e,t),watchEvent:t=>g5(e,t),watchPendingTransactions:t=>m5(e,t)}}function Di(e){const{key:t="public",name:n="Public Client"}=e;return _1({...e,key:t,name:n,type:"publicClient"}).extend(P5)}function I5({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:o=150,timeout:i,type:a},c){const u=iu();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:o,timeout:i,type:a},request:Eh(r,{methods:t,retryCount:s,retryDelay:o,uid:u}),value:c}}class k5 extends B{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Gi(e,t={}){const{batch:n,fetchFn:r,fetchOptions:s,key:o="http",methods:i,name:a="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:f,raw:l}=t;return({chain:d,retryCount:h,timeout:g})=>{const{batchSize:p=1e3,wait:w=0}=typeof n=="object"?n:{},A=t.retryCount??h,$=g??t.timeout??1e4,v=e||d?.rpcUrls.default.http[0];if(!v)throw new k5;const m=kh(v,{fetchFn:r,fetchOptions:s,onRequest:c,onResponse:u,timeout:$});return I5({key:o,methods:i,name:a,async request({method:y,params:P}){const x={method:y,params:P},{schedule:I}=ru({id:v,wait:w,shouldSplitBatch(N){return N.length>p},fn:N=>m.request({body:N}),sort:(N,F)=>N.id-F.id}),T=async N=>n?I(N):[await m.request({body:N})],[{error:E,result:k}]=await T(x);if(l)return{error:E,result:k};if(E)throw new so({body:x,error:E,url:v});return k},retryCount:A,retryDelay:f,timeout:$,type:"http"},{fetchOptions:s,url:v})}}const $5=Tr({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),B5=Tr({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),C5=Tr({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),S5=Tr({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),Vi={production:{ethereum:{address:"0x0f5d2fb29fb7d3cfee444a200298f468908cc942",rpc:"https://rpc.decentraland.org/mainnet"},polygon:{address:"0xA1c57f48F0Deb89f569dFbE6E2B7f46D33606fD4",rpc:"https://rpc.decentraland.org/polygon"}},development:{ethereum:{address:"0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",rpc:"https://rpc.decentraland.org/sepolia"},polygon:{address:"0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",rpc:"https://rpc.decentraland.org/amoy"}}},qi=[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]}],T5=10*60*1e3,Zs=.01;function t0(){return Aa()===us.PRODUCTION?Vi.production:Vi.development}let is=null,as=null;function N5(){if(!is||!as){const e=t0(),t=Aa();is=Di({chain:t===us.PRODUCTION?$5:S5,transport:Gi(e.ethereum.rpc)}),as=Di({chain:t===us.PRODUCTION?B5:C5,transport:Gi(e.polygon.rpc)})}return{ethClient:is,polyClient:as}}function O5(e){const[t,n]=j.useState(null),[r,s]=j.useState(!1),o=j.useRef(!1),i=j.useRef(null),a=j.useRef(e);j.useEffect(()=>{a.current=e,e?i.current&&i.current.address!==e&&n(null):(n(null),i.current=null)},[e]);const c=j.useCallback(()=>{if(!e||o.current)return;const u=i.current;if(u&&u.address===e&&Date.now()-u.fetchedAt<T5){n(u.balances);return}o.current=!0,s(!0);const f=e,l=t0(),{ethClient:d,polyClient:h}=N5();Promise.all([d.readContract({address:l.ethereum.address,abi:qi,functionName:"balanceOf",args:[f]}),h.readContract({address:l.polygon.address,abi:qi,functionName:"balanceOf",args:[f]})]).then(([g,p])=>{if(a.current!==e)return;const w={ethereum:parseFloat(sn(g)),polygon:parseFloat(sn(p))};i.current={address:e,balances:w,fetchedAt:Date.now()},n(w)}).catch(()=>{}).finally(()=>{o.current=!1,s(!1)})},[e]);return{balances:t,isLoading:r,fetchBalances:c,minDisplayBalance:Zs}}const Wi=j.memo(function(t){return b.jsxs("svg",{viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45 89.9999C69.8528 89.9999 89.9999 69.8528 89.9999 45C89.9999 20.1472 69.8528 0 45 0C20.1472 0 0 20.1472 0 45C0 69.8528 20.1472 89.9999 45 89.9999Z",fill:"url(#dcl-nav0)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 80.9996C25.515 86.6471 34.875 89.9996 45 89.9996C55.125 89.9996 64.485 86.6471 72 80.9996H18Z",fill:"#FF2D55"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 71.9996C11.565 75.397 14.603 78.435 18 80.9996H72C75.398 78.435 78.435 75.397 81 71.9996H9Z",fill:"#FFA25A"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 62.9997H3.758C5.153 66.2172 6.93 69.2322 9 71.9997H60.39V62.9997H60.368Z",fill:"#FFC95B"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.883 29.25V63H60.008L31.883 29.25Z",fill:"url(#dcl-nav1)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.758 63H31.883V29.25L3.758 63Z",fill:"white"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 47.25V72H81L60.368 47.25Z",fill:"url(#dcl-nav2)"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.757 72H60.367V47.25L39.757 72Z",fill:"white"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.368 40.5C66.58 40.5 71.618 35.463 71.618 29.25C71.618 23.037 66.58 18 60.368 18C54.154 18 49.118 23.037 49.118 29.25C49.118 35.463 54.154 40.5 60.368 40.5Z",fill:"#FFC95B"}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.882 22.5C34.989 22.5 37.507 19.981 37.507 16.875C37.507 13.768 34.989 11.25 31.882 11.25C28.776 11.25 26.257 13.768 26.257 16.875C26.257 19.981 28.776 22.5 31.882 22.5Z",fill:"#FFC95B"}),b.jsxs("defs",{children:[b.jsxs("linearGradient",{id:"dcl-nav0",x1:"45",y1:"-18.64",x2:"-18.64",y2:"45",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#FF2D55"}),b.jsx("stop",{offset:"1",stopColor:"#FFBC5B"})]}),b.jsxs("linearGradient",{id:"dcl-nav1",x1:"31.873",y1:"29.25",x2:"31.873",y2:"63",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#A524B3"}),b.jsx("stop",{offset:"1",stopColor:"#FF2D55"})]}),b.jsxs("linearGradient",{id:"dcl-nav2",x1:"60.36",y1:"47.25",x2:"60.36",y2:"72",gradientUnits:"userSpaceOnUse",children:[b.jsx("stop",{stopColor:"#A524B3"}),b.jsx("stop",{offset:"1",stopColor:"#FF2D55"})]})]})]})}),j5=j.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M3 6H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M3 18H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),F5=j.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),b.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),Zi=j.memo(function(t){return b.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),R5=j.memo(function(t){return b.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M15 12.5L10 7.5L5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),Ki=j.memo(function(t){return b.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M12 21.75C13.1 21.75 14 20.85 14 19.75H10C10 20.85 10.89 21.75 12 21.75ZM18 15.75V10.75C18 7.68 16.36 5.11 13.5 4.43V3.75C13.5 2.92 12.83 2.25 12 2.25C11.17 2.25 10.5 2.92 10.5 3.75V4.43C7.63 5.11 6 7.67 6 10.75V15.75L4 17.75V18.75H20V17.75L18 15.75Z",fill:"#FCFCFC"})})}),Yi=j.memo(function(t){return b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M10 2H14V6",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M6.66699 9.33333L14.0003 2",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})]})}),Ji=j.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M7.5 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V4.16667C2.5 3.72464 2.67559 3.30072 2.98816 2.98816C3.30072 2.67559 3.72464 2.5 4.16667 2.5H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M13.333 14.1667L17.4997 10.0001L13.333 5.83337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M17.5 10H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})});j.memo(function(t){return b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"5.25",stroke:"#FCFCFC",strokeOpacity:"0.3",strokeWidth:"1.5"}),b.jsx("path",{d:"M18.7111 11.065L14.034 6.39027C13.2002 5.55695 11.7971 6.14637 11.7971 7.32523V8.86994C11.7564 8.86994 11.7361 8.86994 11.6954 8.86994H7.25895C6.50654 8.86994 5.89648 9.45936 5.89648 10.2114V13.7683C5.89648 14.5203 6.50654 15.1301 7.25895 15.1301H11.6751C11.7158 15.1301 11.7361 15.1301 11.7768 15.1301V16.6748C11.7768 17.8536 13.2002 18.4431 14.0137 17.6097L18.6908 12.935C19.2195 12.4065 19.2195 11.5732 18.7111 11.065Z",fill:"#FCFCFC"})]})});const Xi=j.memo(function(t){return b.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",stroke:"currentColor",strokeWidth:"1"}),b.jsx("path",{d:"M8.5 3.5V2C8.5 1.17157 7.82843 0.5 7 0.5H2C1.17157 0.5 0.5 1.17157 0.5 2V7C0.5 7.82843 1.17157 8.5 2 8.5H3.5",stroke:"currentColor",strokeWidth:"1"})]})}),Qi=j.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M10 10C11.3807 10 12.5 8.88071 12.5 7.5C12.5 6.11929 11.3807 5 10 5C8.61929 5 7.5 6.11929 7.5 7.5C7.5 8.88071 8.61929 10 10 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M5 16.25C5 14.1789 7.23858 12.5 10 12.5C12.7614 12.5 15 14.1789 15 16.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ea=j.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M15.8333 7.5L13.3333 3.33337H6.66667L4.16667 7.5L2.5 16.6667H17.5L15.8333 7.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M6.66667 3.33337L7.5 7.50004L10 9.16671L12.5 7.50004L13.3333 3.33337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ta=j.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M16.1666 10C16.1666 9.58337 16.1249 9.16671 16.0416 8.75004L17.9166 7.27087L16.4166 4.72921L14.1666 5.52087C13.5416 4.97921 12.8124 4.56254 11.9999 4.31254L11.6666 1.66671H8.33325L7.99992 4.31254C7.18742 4.56254 6.45825 4.97921 5.83325 5.52087L3.58325 4.72921L2.08325 7.27087L3.95825 8.75004C3.87492 9.16671 3.83325 9.58337 3.83325 10C3.83325 10.4167 3.87492 10.8334 3.95825 11.25L2.08325 12.7292L3.58325 15.2709L5.83325 14.4792C6.45825 15.0209 7.18742 15.4375 7.99992 15.6875L8.33325 18.3334H11.6666L11.9999 15.6875C12.8124 15.4375 13.5416 15.0209 14.1666 14.4792L16.4166 15.2709L17.9166 12.7292L16.0416 11.25C16.1249 10.8334 16.1666 10.4167 16.1666 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),na=j.memo(function(t){return b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[b.jsx("path",{d:"M5 1.66663L2.5 4.99996V16.6666C2.5 17.1087 2.67559 17.5326 2.98816 17.8452C3.30072 18.1577 3.72464 18.3333 4.16667 18.3333H15.8333C16.2754 18.3333 16.6993 18.1577 17.0118 17.8452C17.3244 17.5326 17.5 17.1087 17.5 16.6666V4.99996L15 1.66663H5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.jsx("path",{d:"M13.3334 8.33337C13.3334 9.21743 12.9822 10.0653 12.3571 10.6904C11.7319 11.3155 10.8841 11.6667 10.0001 11.6667C9.11603 11.6667 8.26818 11.3155 7.64306 10.6904C7.01794 10.0653 6.66675 9.21743 6.66675 8.33337",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),L5=j.memo(function(t){return b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{d:"M9.864 6.952C9.864 4.968 8.264 3.32 6.28 3.32C4.296 3.32 2.696 4.968 2.696 6.952C2.696 8.92 4.296 10.52 6.28 10.52C8.264 10.52 9.864 8.92 9.864 6.952ZM9.032 6.952C9.032 8.456 7.688 9.688 6.28 9.688C4.728 9.688 3.528 8.488 3.528 6.952C3.528 5.432 4.728 4.152 6.28 4.152C7.704 4.152 9.032 5.432 9.032 6.952ZM12.248 10.424V3.544L6.28 0.12L0.312 3.544V10.424L6.28 13.848L12.248 10.424ZM11.192 9.832L6.296 12.632L1.368 9.832V4.184L6.28 1.336L11.192 4.184V9.832Z",fill:"#FF2D55"})})}),M5=j.memo(function(t){return b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0L24 12L12 24L0 12L12 0ZM12.0002 3.36001L20.6402 12L12.0002 20.64L3.36023 12L12.0002 3.36001ZM12.0009 16.32C14.3868 16.32 16.3209 14.3859 16.3209 12C16.3209 9.61415 14.3868 7.68002 12.0009 7.68002C9.61507 7.68002 7.68094 9.61415 7.68094 12C7.68094 14.3859 9.61507 16.32 12.0009 16.32Z",fill:"#FCFCFC"})})}),ye={whatsOn:{labelKey:"component.landing.navbar.whats_on",url:"https://decentraland.org/events"},shop:{labelKey:"component.landing.navbar.shop",items:[{labelKey:"component.landing.navbar.shop_all",url:"https://decentraland.org/marketplace"},{labelKey:"component.landing.navbar.wearables",url:"https://decentraland.org/marketplace/browse?assetType=item§ion=wearables&status=on_sale"},{labelKey:"component.landing.navbar.emotes",url:"https://decentraland.org/marketplace/browse?assetType=item§ion=emotes&status=on_sale"},{labelKey:"component.landing.navbar.names",url:"https://decentraland.org/marketplace/names/claim"},{labelKey:"component.landing.navbar.land",url:"https://decentraland.org/marketplace/lands"},{labelKey:"component.landing.navbar.merch",url:"https://store.decentraland.org/",isExternal:!0}]},create:{labelKey:"component.landing.navbar.create",items:[{labelKey:"component.landing.navbar.create_in_decentraland",url:"https://decentraland.org/create/"},{labelKey:"component.landing.navbar.publish_wearables_emotes",url:"https://decentraland.org/builder/collections"},{labelKey:"component.landing.navbar.publish_land",url:"https://decentraland.org/builder/land"}]},learn:{labelKey:"component.landing.navbar.learn",url:"https://decentraland.org/blog/"}},ra=[{labelKey:"component.landing.navbar.view_profile",url:"https://decentraland.org/profile"},{labelKey:"component.landing.navbar.my_assets",url:"https://decentraland.org/marketplace/account"},{labelKey:"component.landing.navbar.account_settings",url:"https://decentraland.org/account"},{labelKey:"component.landing.navbar.marketplace_authorizations",url:"https://decentraland.org/marketplace/settings"}],sa=["shop","create"],ht="@media (max-width: 991px)",se="@media (min-width: 992px)",z5="0px 1.333px 24px rgba(0,0,0,0.12), 0px 8px 13.333px rgba(0,0,0,0.14), 0px 4px 6.667px rgba(0,0,0,0.2)",kt="rgba(38, 38, 38, 0.8)",Ro="0.5px solid #5E5B67",Hn="0 2px 20px 16px rgba(0, 0, 0, 0.25)",Me="blur(12.5px)",n0=hr`
|
|
44
44
|
0% { opacity: 1; }
|
|
45
45
|
50% { opacity: 0.5; }
|
|
46
46
|
100% { opacity: 1; }
|
|
@@ -49,7 +49,7 @@ ${Jl(h)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
49
49
|
25% { transform: rotate(8deg); }
|
|
50
50
|
50% { transform: rotate(-8deg); }
|
|
51
51
|
75% { transform: rotate(4deg); }
|
|
52
|
-
`,K5=R("button")({all:"unset",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,color:Z.white,cursor:"pointer",flexShrink:0,borderRadius:4,"&.has-unread":{animation:`${Z5} 0.8s`,animationIterationCount:4},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:24,height:24}}),Y5=R("span")({position:"absolute",top:-4,right:-6,minWidth:16,height:16,borderRadius:8,backgroundColor:ee.primary,color:"#fff",fontSize:10,fontWeight:700,fontFamily:"Inter, Helvetica, Arial, sans-serif",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 4px",lineHeight:1,pointerEvents:"none"}),J5=R("div")({position:"relative"}),X5=R("div")({position:"absolute",top:"100%",right:-12,marginTop:16,width:390,maxHeight:"70vh",zIndex:1102,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,border:Ro,borderRadius:12,boxShadow:Hn,display:"flex",flexDirection:"column",overflow:"hidden",paddingTop:12,paddingBottom:24,animation:`${Fr} 0.15s ease forwards`,[ht]:{position:"fixed",top:64,left:0,right:0,width:"auto",maxHeight:"calc(100vh - 64px)",borderRadius:0}}),Q5=R("div")({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px 12px 24px",borderBottom:"0.5px solid #5e5b67"}),e6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc"}),t6=R("div")({flex:1,overflowY:"auto",overflowX:"hidden",maxHeight:290,padding:"4px 0",[ht]:{maxHeight:"calc(100vh - 200px)"}}),fa=R("div")({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16,padding:"40px 80px",textAlign:"center",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:16,color:Z.gray4}),la=R("div")({display:"flex",alignItems:"center",gap:8,padding:"8px 16px",borderRadius:8,width:"100%",boxSizing:"border-box",transition:"background-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}}),n6=R("div")({width:56,height:56,marginLeft:16,borderRadius:"50%",backgroundColor:"rgba(103, 99, 112, 0.4)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden",position:"relative","& img":{width:48,height:48,borderRadius:"50%",objectFit:"contain"}}),r6=R("div")({width:8,height:8,borderRadius:"50%",backgroundColor:"transparent",flexShrink:0,"&.unread":{backgroundColor:ee.primary}}),s6=R("div")({flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4}),o6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:16,fontWeight:600,color:"#fcfcfc",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),i6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:12,fontWeight:400,color:"#a09ba8"}),a6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:12,fontWeight:400,color:"#ecebed",lineHeight:"20px",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),c6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,borderRadius:100,backgroundColor:"#FF4BED",border:"2px solid rgba(255, 255, 255, 0.5)",overflow:"hidden",[ht]:{width:40,height:40},[se]:{width:48,height:48},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"&.loading":{animation:`${n0} 1.5s ease-in-out infinite`}}),u6=R("img")({borderRadius:100,objectFit:"cover",width:"100%",height:"100%"});R("div")({borderRadius:100,backgroundColor:"#FF4BED",width:"100%",height:"100%"});const f6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:40,height:40,backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:8,color:Z.white,cursor:"pointer",flexShrink:0,transition:"background-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.15)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.2)"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},[se]:{display:"none"}});R("a")({display:"none",[se]:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,height:40,padding:"0 16px",backgroundColor:ee.primary,borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,letterSpacing:"0.46px",textTransform:"uppercase",color:Z.white,textDecoration:"none",whiteSpace:"nowrap",cursor:"pointer",transition:"background-color 0.15s ease, transform 0.1s ease","&:hover":{backgroundColor:ee.primaryDark1},"&:active":{backgroundColor:ee.primaryDark2,transform:"scale(0.98)"},"&:focus-visible":{outline:`2px solid ${Z.white}`,outlineOffset:2},"& svg":{width:24,height:24,flexShrink:0}}});const da=R("button")({all:"unset",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 22px",border:`1px solid ${Z.softWhite}`,borderRadius:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,lineHeight:"24px",letterSpacing:.46,textTransform:"uppercase",color:Z.softWhite,cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 0.15s ease, border-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)",borderColor:"rgba(255, 255, 255, 0.7)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.12)"},"&:disabled":{opacity:.5,pointerEvents:"none"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2}}),l6=R("button")({all:"unset",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",gap:12,height:40,padding:"0 16px",backgroundColor:"#FF2D55",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,lineHeight:"24px",letterSpacing:.46,textTransform:"uppercase",color:"#FCFCFC",cursor:"pointer",whiteSpace:"nowrap",outline:"2px solid transparent",outlineOffset:2,transition:"outline-color 0.15s ease","&:hover":{outlineColor:"white"},"&:focus-visible":{outlineColor:"white"}});R("span")({display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"50%",border:"1.5px solid rgba(252, 252, 252, 0.3)",boxSizing:"border-box","&::after":{content:'""',display:"block",width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 7px",borderColor:"transparent transparent transparent #FCFCFC",marginLeft:2}});const d6=R("div")(({open:e})=>({position:"fixed",top:64,left:0,right:0,bottom:0,zIndex:1099,pointerEvents:e?"auto":"none",backgroundColor:e?"rgba(0, 0, 0, 0.3)":"transparent",transition:"background-color 0.25s ease",[se]:{display:"none"}})),h6=R("div")(({open:e})=>({position:"fixed",top:64,left:0,right:0,zIndex:1100,maxHeight:e?"calc(100vh - 64px)":0,overflowY:"auto",background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,boxShadow:e?Hn:"none",padding:e?12:"0 12px",transition:"max-height 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease",[se]:{display:"none"}})),cs=R("div")({borderBottom:"0.5px solid rgba(255, 255, 255, 0.1)"}),ha=R("a")({display:"flex",alignItems:"center",padding:"24px 16px",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:16,lineHeight:1.75,color:Z.white,textDecoration:"none","&:hover":{color:Z.gray5},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2}}),p6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"24px 16px",boxSizing:"border-box",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:16,lineHeight:1.75,color:Z.white,cursor:"pointer","&:hover":{color:Z.gray5},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2},"& svg":{width:20,height:20,flexShrink:0,transition:"transform 0.2s ease"}}),b6=R("div")(({open:e})=>({maxHeight:e?500:0,overflow:"hidden",transition:"max-height 0.25s ease"})),g6=R("a")({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"12px 16px",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,color:Z.gray4,textDecoration:"none","&:hover":{color:Z.white},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2},"& svg":{width:16,height:16,flexShrink:0,opacity:.6}}),m6=R("div")({position:"fixed",top:92,right:54,zIndex:1201,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,border:Ro,borderRadius:12,boxShadow:Hn,display:"none",padding:12,gap:24,animation:`${Fr} 0.15s ease forwards`,minWidth:484,[se]:{display:"flex"}}),y6=R("div")({width:151,minHeight:240,borderRadius:12,border:"0.5px solid #c640cd",background:"linear-gradient(180deg, rgba(198, 64, 205, 0.2) 0%, rgba(105, 31, 169, 0.2) 100%)",display:"flex",alignItems:"flex-end",justifyContent:"center",overflow:"hidden",flexShrink:0}),w6=R("img")({width:"100%",height:"auto",objectFit:"cover",objectPosition:"top"}),pa=R("div")({display:"flex",flexDirection:"column",paddingRight:12,paddingTop:4,paddingBottom:4,flex:1,minWidth:0,[ht]:{gap:12}}),x6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc",marginBottom:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),v6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#cfcdd4"}),E6=R("div")({display:"flex",alignItems:"center",gap:8,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#fcfcfc",marginBottom:4}),A6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#fcfcfc",opacity:.7,transition:"opacity 0.15s ease","&:hover":{opacity:1}}),ba=R("a")({display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,lineHeight:1.75,color:Z.gray4,textDecoration:"none",whiteSpace:"nowrap",cursor:"pointer",transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{color:Z.white,backgroundColor:"rgba(255, 255, 255, 0.05)"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:20,height:20,flexShrink:0}}),Yn=R("div")({height:.5,backgroundColor:"rgba(255, 255, 255, 0.1)",margin:"8px 0"}),ga=R("button")({all:"unset",display:"flex",alignItems:"center",gap:12,padding:"12px 16px",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,lineHeight:1.75,color:Z.gray4,cursor:"pointer",whiteSpace:"nowrap",transition:"color 0.15s ease","&:hover":{color:ee.primary},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:18,height:18}}),P6=R("div")({position:"relative"}),I6=R("div")({position:"fixed",top:64,left:0,right:0,zIndex:1201,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,boxShadow:Hn,padding:"24px 12px",animation:`${Fr} 0.15s ease forwards`,[se]:{display:"none"}}),k6=R("div")({display:"flex",alignItems:"center",gap:12,paddingBottom:8}),$6=R("div")({width:73,height:73,borderRadius:100,border:"3px solid rgba(255, 255, 255, 0.5)",backgroundColor:"#FF4BED",overflow:"hidden",flexShrink:0,"&.loading":{animation:`${n0} 1.5s ease-in-out infinite`}}),B6=R("img")({width:"100%",height:"100%",objectFit:"cover",borderRadius:100}),C6=R("div")({display:"flex",flexDirection:"column",gap:2,minWidth:0}),S6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),T6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#cfcdd4"}),N6=R("div")({display:"flex",alignItems:"center",gap:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#fcfcfc"}),r0=R("div")({display:"flex",alignItems:"center",gap:16,paddingTop:8}),j6=R(r0)({paddingLeft:91}),ma=R("div")({display:"flex",alignItems:"center",gap:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:14,fontWeight:500,color:"#FCFCFC"}),O6=hr`
|
|
52
|
+
`,K5=R("button")({all:"unset",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,color:Z.white,cursor:"pointer",flexShrink:0,borderRadius:4,"&.has-unread":{animation:`${Z5} 0.8s`,animationIterationCount:4},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:24,height:24}}),Y5=R("span")({position:"absolute",top:-4,right:-6,minWidth:16,height:16,borderRadius:8,backgroundColor:ee.primary,color:"#fff",fontSize:10,fontWeight:700,fontFamily:"Inter, Helvetica, Arial, sans-serif",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 4px",lineHeight:1,pointerEvents:"none"}),J5=R("div")({position:"relative"}),X5=R("div")({position:"absolute",top:"100%",right:-12,marginTop:16,width:390,maxHeight:"70vh",zIndex:1102,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,border:Ro,borderRadius:12,boxShadow:Hn,display:"flex",flexDirection:"column",overflow:"hidden",paddingTop:12,paddingBottom:24,animation:`${Fr} 0.15s ease forwards`,[ht]:{position:"fixed",top:64,left:0,right:0,width:"auto",maxHeight:"calc(100vh - 64px)",borderRadius:0}}),Q5=R("div")({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px 12px 24px",borderBottom:"0.5px solid #5e5b67"}),e6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc"}),t6=R("div")({flex:1,overflowY:"auto",overflowX:"hidden",maxHeight:290,padding:"4px 0",[ht]:{maxHeight:"calc(100vh - 200px)"}}),fa=R("div")({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16,padding:"40px 80px",textAlign:"center",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:16,color:Z.gray4}),la=R("div")({display:"flex",alignItems:"center",gap:8,padding:"8px 16px",borderRadius:8,width:"100%",boxSizing:"border-box",transition:"background-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}}),n6=R("div")({width:56,height:56,marginLeft:16,borderRadius:"50%",backgroundColor:"rgba(103, 99, 112, 0.4)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden",position:"relative","& img":{width:48,height:48,borderRadius:"50%",objectFit:"contain"}}),r6=R("div")({width:8,height:8,borderRadius:"50%",backgroundColor:"transparent",flexShrink:0,"&.unread":{backgroundColor:ee.primary}}),s6=R("div")({flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4}),o6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:16,fontWeight:600,color:"#fcfcfc",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),i6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:12,fontWeight:400,color:"#a09ba8"}),a6=R("div")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:12,fontWeight:400,color:"#ecebed",lineHeight:"20px",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),c6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,borderRadius:100,backgroundColor:"#FF4BED",border:"2px solid rgba(255, 255, 255, 0.5)",overflow:"hidden",[ht]:{width:40,height:40},[se]:{width:48,height:48},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"&.loading":{animation:`${n0} 1.5s ease-in-out infinite`}}),u6=R("img")({borderRadius:100,objectFit:"cover",width:"100%",height:"100%"});R("div")({borderRadius:100,backgroundColor:"#FF4BED",width:"100%",height:"100%"});const f6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:40,height:40,backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:8,color:Z.white,cursor:"pointer",flexShrink:0,transition:"background-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.15)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.2)"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},[se]:{display:"none"}});R("a")({display:"none",[se]:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,height:40,padding:"0 16px",backgroundColor:ee.primary,borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,letterSpacing:"0.46px",textTransform:"uppercase",color:Z.white,textDecoration:"none",whiteSpace:"nowrap",cursor:"pointer",transition:"background-color 0.15s ease, transform 0.1s ease","&:hover":{backgroundColor:ee.primaryDark1},"&:active":{backgroundColor:ee.primaryDark2,transform:"scale(0.98)"},"&:focus-visible":{outline:`2px solid ${Z.white}`,outlineOffset:2},"& svg":{width:24,height:24,flexShrink:0}}});const da=R("button")({all:"unset",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 22px",border:`1px solid ${Z.softWhite}`,borderRadius:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,lineHeight:"24px",letterSpacing:.46,textTransform:"uppercase",color:Z.softWhite,cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 0.15s ease, border-color 0.15s ease","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)",borderColor:"rgba(255, 255, 255, 0.7)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.12)"},"&:disabled":{opacity:.5,pointerEvents:"none"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2}}),l6=R("button")({all:"unset",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",gap:12,height:40,padding:"0 16px",backgroundColor:"#FF2D55",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:15,lineHeight:"24px",letterSpacing:.46,textTransform:"uppercase",color:"#FCFCFC",cursor:"pointer",whiteSpace:"nowrap",outline:"2px solid transparent",outlineOffset:2,transition:"outline-color 0.15s ease","&:hover":{outlineColor:"white"},"&:focus-visible":{outlineColor:"white"}});R("span")({display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"50%",border:"1.5px solid rgba(252, 252, 252, 0.3)",boxSizing:"border-box","&::after":{content:'""',display:"block",width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 7px",borderColor:"transparent transparent transparent #FCFCFC",marginLeft:2}});const d6=R("div")(({open:e})=>({position:"fixed",top:64,left:0,right:0,bottom:0,zIndex:1099,pointerEvents:e?"auto":"none",backgroundColor:e?"rgba(0, 0, 0, 0.3)":"transparent",transition:"background-color 0.25s ease",[se]:{display:"none"}})),h6=R("div")(({open:e})=>({position:"fixed",top:64,left:0,right:0,zIndex:1100,maxHeight:e?"calc(100vh - 64px)":0,overflowY:"auto",background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,boxShadow:e?Hn:"none",padding:e?12:"0 12px",transition:"max-height 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease",[se]:{display:"none"}})),cs=R("div")({borderBottom:"0.5px solid rgba(255, 255, 255, 0.1)"}),ha=R("a")({display:"flex",alignItems:"center",padding:"24px 16px",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:16,lineHeight:1.75,color:Z.white,textDecoration:"none","&:hover":{color:Z.gray5},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2}}),p6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"24px 16px",boxSizing:"border-box",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:16,lineHeight:1.75,color:Z.white,cursor:"pointer","&:hover":{color:Z.gray5},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2},"& svg":{width:20,height:20,flexShrink:0,transition:"transform 0.2s ease"}}),b6=R("div")(({open:e})=>({maxHeight:e?500:0,overflow:"hidden",transition:"max-height 0.25s ease"})),g6=R("a")({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"12px 16px",fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,color:Z.gray4,textDecoration:"none","&:hover":{color:Z.white},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:-2},"& svg":{width:16,height:16,flexShrink:0,opacity:.6}}),m6=R("div")({position:"fixed",top:92,right:54,zIndex:1201,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,border:Ro,borderRadius:12,boxShadow:Hn,display:"none",padding:12,gap:24,animation:`${Fr} 0.15s ease forwards`,minWidth:484,[se]:{display:"flex"}}),y6=R("div")({width:151,minHeight:240,borderRadius:12,border:"0.5px solid #c640cd",background:"linear-gradient(180deg, rgba(198, 64, 205, 0.2) 0%, rgba(105, 31, 169, 0.2) 100%)",display:"flex",alignItems:"flex-end",justifyContent:"center",overflow:"hidden",flexShrink:0}),w6=R("img")({width:"100%",height:"auto",objectFit:"cover",objectPosition:"top"}),pa=R("div")({display:"flex",flexDirection:"column",paddingRight:12,paddingTop:4,paddingBottom:4,flex:1,minWidth:0,[ht]:{gap:12}}),x6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc",marginBottom:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),v6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#cfcdd4"}),E6=R("div")({display:"flex",alignItems:"center",gap:8,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#fcfcfc",marginBottom:4}),A6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#fcfcfc",opacity:.7,transition:"opacity 0.15s ease","&:hover":{opacity:1}}),ba=R("a")({display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,lineHeight:1.75,color:Z.gray4,textDecoration:"none",whiteSpace:"nowrap",cursor:"pointer",transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{color:Z.white,backgroundColor:"rgba(255, 255, 255, 0.05)"},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:20,height:20,flexShrink:0}}),Yn=R("div")({height:.5,backgroundColor:"rgba(255, 255, 255, 0.1)",margin:"8px 0"}),ga=R("button")({all:"unset",display:"flex",alignItems:"center",gap:12,padding:"12px 16px",borderRadius:12,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:16,lineHeight:1.75,color:Z.gray4,cursor:"pointer",whiteSpace:"nowrap",transition:"color 0.15s ease","&:hover":{color:ee.primary},"&:focus-visible":{outline:`2px solid ${ee.primary}`,outlineOffset:2},"& svg":{width:18,height:18}}),P6=R("div")({position:"relative"}),I6=R("div")({position:"fixed",top:64,left:0,right:0,zIndex:1201,background:kt,backdropFilter:Me,WebkitBackdropFilter:Me,boxShadow:Hn,padding:"24px 12px",animation:`${Fr} 0.15s ease forwards`,[se]:{display:"none"}}),k6=R("div")({display:"flex",alignItems:"center",gap:12,paddingBottom:8}),$6=R("div")({width:73,height:73,borderRadius:100,border:"3px solid rgba(255, 255, 255, 0.5)",backgroundColor:"#FF4BED",overflow:"hidden",flexShrink:0,"&.loading":{animation:`${n0} 1.5s ease-in-out infinite`}}),B6=R("img")({width:"100%",height:"100%",objectFit:"cover",borderRadius:100}),C6=R("div")({display:"flex",flexDirection:"column",gap:2,minWidth:0}),S6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:600,fontSize:20,color:"#fcfcfc",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),T6=R("span")({fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#cfcdd4"}),N6=R("div")({display:"flex",alignItems:"center",gap:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontWeight:400,fontSize:12,color:"#fcfcfc"}),r0=R("div")({display:"flex",alignItems:"center",gap:16,paddingTop:8}),O6=R(r0)({paddingLeft:91}),ma=R("div")({display:"flex",alignItems:"center",gap:6,fontFamily:"Inter, Helvetica, Arial, sans-serif",fontSize:14,fontWeight:500,color:"#FCFCFC"}),j6=hr`
|
|
53
53
|
0%, 100% { opacity: 0.4; }
|
|
54
54
|
50% { opacity: 1; }
|
|
55
|
-
`,ya=R("div")({width:60,height:16,borderRadius:4,backgroundColor:"rgba(255,255,255,0.12)",animation:`${O6} 1.5s ease-in-out infinite`}),F6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#fcfcfc",transition:"opacity 0.15s ease","&:hover":{opacity:.7},"& svg":{width:20,height:20}});let Jn=null;const R6="https://peer.decentraland.org/content/contents/";function L6(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function M6(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function wa(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:e<1?e.toFixed(2):Math.floor(e).toString()}function xa(e,t,n){const r=e;if(t)return b.jsxs(r,{children:[b.jsx(ya,{}),b.jsx(ya,{})]});if(!n)return null;const s=n.ethereum>=Zs,o=n.polygon>=Zs;return!s&&!o?null:b.jsxs(r,{children:[s&&b.jsxs(ma,{children:[b.jsx(L5,{})," ",wa(n.ethereum)]}),o&&b.jsxs(ma,{children:[b.jsx(M5,{})," ",wa(n.polygon)]})]})}function va(e){if(e)return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")?e:`${R6}${e}`}const s0=O.memo(function({isSignedIn:t,isSigningIn:n=!1,isLandingPage:r=!1,isLoadingProfile:s=!1,address:o,avatar:i,manaBalances:a,isManaLoading:c=!1,notifications:u,onClickSignIn:f,onClickSignOut:l,onClickJumpIn:d,onOpenUserCard:h}){const g=r&&!t,p=h0(),{locale:w}=Pa(),{isInitialized:A,track:$}=Ea(),[v,m]=O.useState(!1),y=O.useCallback(z=>{A&&$(p0.CLICK,{place:b0.LANDING_NAVBAR,event:"click",action:z})},[A,$]),[P,x]=O.useState(null),[I,T]=O.useState(null),[E,k]=O.useState(!1),[N,F]=O.useState(!1),G=O.useRef(null),S=O.useRef(null),C=u?.items?.filter(z=>!z.read).length??0,[M,j]=O.useState(!!Jn),L=O.useRef(!1),H=O.useCallback(z=>{u?.onClick&&u.onClick(z),L.current=!L.current,k(!1),T(null),Jn||dr(()=>import("./utils-CJGePSnj.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,11,12,13,14,15,16,17])).then(q=>{Jn=q.NotificationComponentByType,j(!0)})},[u]),V=O.useCallback(()=>{L.current&&u?.onClose&&(u.onClose(),L.current=!1)},[u]),J=va(i?.avatar?.snapshots?.face256)??Mo("/avatar_face.webp"),[re,Y]=O.useState(),ze=re===J,ve=va(i?.avatar?.snapshots?.body),nt=i?.name||(o?`${o.slice(0,6)}...${o.slice(-4)}`:""),Ce=o?`${o.slice(0,6)}...${o.slice(-4)}`:"",[Ue,$t]=O.useState(!1),rt=O.useCallback(()=>{o&&navigator.clipboard.writeText(o).then(()=>{$t(!0),setTimeout(()=>$t(!1),2e3)}).catch(()=>{})},[o]),_e=O.useCallback(()=>{m(z=>(z||(T(null),k(!1)),!z))},[]),He=O.useCallback(()=>{m(!1),x(null)},[]),De=O.useCallback(z=>{x(q=>q===z?null:z)},[]),Dn=O.useCallback(z=>{S.current&&(clearTimeout(S.current),S.current=null),T(z),k(!1)},[]),o0=O.useCallback(()=>{S.current=setTimeout(()=>{T(null)},300)},[]),Bt=O.useCallback(()=>{T(null)},[]),i0=O.useCallback(()=>{k(z=>(z||(T(null),m(!1),V(),h?.()),!z))},[V,h]),Ct=O.useCallback(()=>{k(!1)},[]);O.useEffect(()=>{function z(q){const Ge=q.target;if(G.current&&!G.current.contains(Ge)){if(document.querySelector("[data-mobile-user-card]")?.contains(Ge))return;Bt(),Ct(),V()}}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[Bt,Ct,V]),O.useEffect(()=>{if(!g)return;const z=()=>F(window.scrollY>50);return window.addEventListener("scroll",z,{passive:!0}),()=>window.removeEventListener("scroll",z)},[g]),O.useEffect(()=>{const z=()=>{Ct(),Bt(),V()};return window.addEventListener("scroll",z,{passive:!0}),()=>window.removeEventListener("scroll",z)},[Ct,Bt,V]),O.useEffect(()=>{function z(q){q.key==="Escape"&&(Bt(),Ct(),He())}return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[Bt,Ct,He]),O.useEffect(()=>(v?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[v]);const a0=()=>b.jsx(u6,{src:J,alt:"",onLoad:()=>Y(J),onError:()=>Y(J),style:{opacity:ze?1:0}}),c0=O.useCallback(()=>b.jsxs(b.Fragment,{children:[b.jsx(cs,{children:b.jsx(ha,{href:ye.explore.url,children:p(ye.explore.labelKey)})}),sa.map(z=>{const q=ye[z],Ge=P===z;return b.jsxs(cs,{children:[b.jsxs(p6,{onClick:()=>De(z),"aria-expanded":Ge,children:[p(q.labelKey),Ge?b.jsx(R5,{}):b.jsx(Zi,{})]}),b.jsx(b6,{open:Ge,children:q.items?.map(ae=>b.jsxs(g6,{href:ae.url,target:ae.isExternal?"_blank":void 0,rel:ae.isExternal?"noopener noreferrer":void 0,children:[p(ae.labelKey),ae.isExternal&&b.jsx(Yi,{})]},ae.labelKey))})]},z)}),b.jsx(cs,{children:b.jsx(ha,{href:ye.learn.url,children:p(ye.learn.labelKey)})})]}),[p,P,De]);return g?b.jsxs(oa,{ref:G,className:"minimal",children:[b.jsxs(ia,{style:{gap:16},children:[b.jsx(ca,{href:"https://decentraland.org","aria-label":"Decentraland Home",children:b.jsx(Wi,{})}),b.jsx("img",{src:Mo("/dcl_name.svg"),alt:"Decentraland",className:"desktop-only",style:{height:20,opacity:N?0:1,transition:"opacity 0.3s ease",pointerEvents:N?"none":"auto"}})]}),b.jsx(aa,{children:N&&d?b.jsxs(l6,{onClick:z=>{y("jump_in"),d(z)},children:[p("component.landing.navbar.jump_in"),b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"5.25",stroke:"#FCFCFC",strokeOpacity:"0.3",strokeWidth:"1.5"}),b.jsx("path",{d:"M18.7111 11.065L14.034 6.39027C13.2002 5.55695 11.7971 6.14637 11.7971 7.32523V8.86994C11.7564 8.86994 11.7361 8.86994 11.6954 8.86994H7.25895C6.50654 8.86994 5.89648 9.45936 5.89648 10.2114V13.7683C5.89648 14.5203 6.50654 15.1301 7.25895 15.1301H11.6751C11.7158 15.1301 11.7361 15.1301 11.7768 15.1301V16.6748C11.7768 17.8536 13.2002 18.4431 14.0137 17.6097L18.6908 12.935C19.2195 12.4065 19.2195 11.5732 18.7111 11.065Z",fill:"#FCFCFC"})]})]}):b.jsx(da,{onClick:()=>{y("sign_in"),f()},disabled:n,children:p(n?"component.landing.navbar.signing_in":"component.landing.navbar.sign_in")})})]}):b.jsxs(b.Fragment,{children:[b.jsxs(oa,{ref:G,className:r&&t?"logged-landing":"",children:[b.jsxs(ia,{children:[b.jsx(ca,{href:"https://decentraland.org","aria-label":"Decentraland Home",children:b.jsx(Wi,{})}),b.jsxs(_5,{children:[b.jsx(ua,{href:ye.explore.url,children:p(ye.explore.labelKey)}),sa.map(z=>b.jsxs(G5,{onMouseEnter:()=>Dn(z),onMouseLeave:o0,children:[b.jsxs(D5,{"aria-expanded":I===z,"aria-haspopup":"true",onClick:()=>{const q=ye[z].items?.[0];q&&window.open(q.url,"_self")},children:[p(ye[z].labelKey),b.jsx(Zi,{style:{transform:I===z?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}),I===z&&b.jsx(V5,{children:b.jsx(q5,{children:ye[z].items?.map(q=>b.jsxs(W5,{href:q.url,target:q.isExternal?"_blank":void 0,rel:q.isExternal?"noopener noreferrer":void 0,children:[p(q.labelKey),q.isExternal&&b.jsx(Yi,{})]},q.labelKey))})})]},z)),b.jsx(ua,{href:ye.learn.url,children:p(ye.learn.labelKey)})]})]}),b.jsxs(aa,{children:[t&&b.jsxs(U5,{children:[b.jsxs(J5,{children:[b.jsxs(K5,{onClick:H,"aria-label":"Notifications","aria-expanded":u?.isOpen,className:C>0?"has-unread":"",children:[b.jsx(Ki,{}),C>0&&b.jsx(Y5,{children:C>9?"9+":C})]}),u?.isOpen&&b.jsxs(X5,{onClick:z=>z.stopPropagation(),children:[b.jsx(Q5,{children:b.jsx(e6,{children:p("component.landing.navbar.notifications_title")})}),b.jsx(t6,{children:u.isLoading?b.jsx(fa,{children:p("component.landing.navbar.notifications_loading")}):(()=>{const z=u.items;return z.length===0?b.jsx(fa,{children:p("component.landing.navbar.notifications_empty_new")}):z.slice(0,30).map(q=>{const Ge=Jn?.[q.type];if(Ge&&M)return b.jsx(la,{style:{padding:0},children:b.jsx(Ge,{notification:q,locale:w})},q.id);const ae=q.metadata,u0=ae?.title||ae?.nftName||M6(q.type),Lo=ae?.description||ae?.message,Rr=ae?.link||ae?.url;return b.jsxs(la,{onClick:()=>Rr&&window.open(Rr,"_blank","noopener"),style:{cursor:Rr?"pointer":"default"},children:[b.jsx(n6,{children:b.jsx(Ki,{})}),b.jsxs(s6,{children:[b.jsx(o6,{children:u0}),Lo&&b.jsx(a6,{children:Lo}),b.jsx(i6,{children:L6(q.timestamp)})]}),!q.read&&b.jsx(r6,{className:"unread"})]},q.id)})})()})]})]}),b.jsxs(P6,{children:[b.jsx(c6,{onClick:i0,"aria-label":"User menu","aria-expanded":E,"aria-haspopup":"true",className:s?"loading":void 0,children:!s&&a0()}),E&&b.jsxs(m6,{onClick:z=>z.stopPropagation(),children:[b.jsx(y6,{children:ve?b.jsx(w6,{src:ve,alt:""}):null}),b.jsxs(pa,{children:[b.jsxs("div",{style:{paddingLeft:16,paddingBottom:8,display:"flex",flexDirection:"column",gap:4},children:[b.jsx(x6,{title:nt,children:nt}),b.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[b.jsx(v6,{children:p("component.landing.navbar.wallet_address")}),b.jsxs(E6,{children:[Ue?p("component.landing.navbar.address_copied"):Ce,b.jsx(A6,{onClick:rt,"aria-label":"Copy address",children:b.jsx(Xi,{})})]})]}),xa(r0,c,a)]}),b.jsx(Yn,{}),ra.map((z,q)=>b.jsxs(ba,{href:z.url,children:[q===0&&b.jsx(Qi,{}),q===1&&b.jsx(ea,{}),q===2&&b.jsx(ta,{}),q===3&&b.jsx(na,{}),p(z.labelKey)]},z.labelKey)),b.jsx(Yn,{}),b.jsxs(ga,{onClick:l,children:[b.jsx(Ji,{}),p("component.landing.navbar.logout")]})]})]})]})]}),!t&&b.jsx(da,{onClick:()=>{y("sign_in"),f()},disabled:n,children:p(n?"component.landing.navbar.signing_in":"component.landing.navbar.sign_in")}),b.jsx(f6,{onClick:_e,"aria-label":v?"Close menu":"Open menu","aria-expanded":v,children:v?b.jsx(F5,{}):b.jsx(O5,{})})]})]}),b.jsx(d6,{open:v,onClick:He}),b.jsx(h6,{open:v,role:"navigation","aria-label":"Mobile navigation",children:c0()}),t&&E&&b.jsxs(I6,{"data-mobile-user-card":!0,onClick:z=>z.stopPropagation(),children:[b.jsxs(k6,{children:[b.jsx($6,{className:s?"loading":void 0,children:!s&&b.jsx(B6,{src:J,alt:"",onLoad:()=>Y(J),onError:()=>Y(J),style:{opacity:ze?1:0}})}),b.jsxs(C6,{children:[b.jsx(S6,{title:nt,children:nt}),b.jsx(T6,{children:p("component.landing.navbar.wallet_address")}),b.jsxs(N6,{children:[Ue?p("component.landing.navbar.address_copied"):Ce,b.jsx(F6,{onClick:rt,"aria-label":"Copy address",children:b.jsx(Xi,{})})]})]})]}),xa(j6,c,a),b.jsx(Yn,{}),b.jsxs(pa,{children:[ra.map((z,q)=>b.jsxs(ba,{href:z.url,children:[q===0&&b.jsx(Qi,{}),q===1&&b.jsx(ea,{}),q===2&&b.jsx(ta,{}),q===3&&b.jsx(na,{}),p(z.labelKey)]},z.labelKey)),b.jsx(Yn,{}),b.jsxs(ga,{onClick:l,children:[b.jsx(Ji,{}),p("component.landing.navbar.logout")]})]})]})]})});s0.displayName="LandingNavbar";const z6=R("div")({width:"100%",height:425,background:"radial-gradient(ellipse at 0% 0%, rgba(121,47,158,0.6) 0%, rgba(74,23,102,0.8) 25%, rgba(51,12,74,0.9) 50%, rgba(27,0,46,1) 75%)"}),U6=O.lazy(()=>dr(()=>import("./index-Bd63106P.js"),__vite__mapDeps([18,1,2,3,4,5,6,7])).then(e=>({default:e.LandingFooter}))),_6=({children:e,withNavbar:t=!0,withFooter:n=!0})=>{const r=x0(),{locale:s}=Pa(),{address:o,isConnected:i,disconnect:a}=g0(),{data:c,isLoading:u}=E0(o??void 0,{skip:!o}),f=c?.avatars?.[0],l=i||!!o;T0(r.pathname);const{balances:d,isLoading:h,fetchBalances:g}=j5(o||void 0),{identity:p}=A0(),{handleClick:w,isDownloadModalOpen:A,closeDownloadModal:$,downloadModalProps:v}=m0(),m=s==="es"?"es":s==="zh"?"zh":"en",{notificationProps:y}=N0({identity:p,isConnected:i,locale:m}),P=O.useCallback(()=>{const I=window.location.pathname+window.location.search;y0(I)},[]),x=O.useCallback(()=>{a()},[a]);return b.jsxs("div",{children:[t&&b.jsx(s0,{isSignedIn:l,isLandingPage:r.pathname==="/",isLoadingProfile:u,address:o||void 0,avatar:f,manaBalances:d,isManaLoading:h,onOpenUserCard:g,notifications:y,onClickSignIn:P,onClickSignOut:x,onClickJumpIn:w}),e??b.jsx(v0,{}),b.jsx(w0,{open:A,onClose:$,...v}),n&&b.jsx(O.Suspense,{fallback:b.jsx(z6,{}),children:b.jsx(U6,{})})]})},dg=Object.freeze(Object.defineProperty({__proto__:null,Layout:_6},Symbol.toStringTag,{value:"Module"}));export{B,Qt as H,G1 as a,Le as b,$r as c,ql as d,At as e,Oe as f,ro as g,dg as h,Ar as i,Sr as l,ne as s};
|
|
55
|
+
`,ya=R("div")({width:60,height:16,borderRadius:4,backgroundColor:"rgba(255,255,255,0.12)",animation:`${j6} 1.5s ease-in-out infinite`}),F6=R("button")({all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#fcfcfc",transition:"opacity 0.15s ease","&:hover":{opacity:.7},"& svg":{width:20,height:20}});let Jn=null;const R6="https://peer.decentraland.org/content/contents/";function L6(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function M6(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function wa(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:e<1?e.toFixed(2):Math.floor(e).toString()}function xa(e,t,n){const r=e;if(t)return b.jsxs(r,{children:[b.jsx(ya,{}),b.jsx(ya,{})]});if(!n)return null;const s=n.ethereum>=Zs,o=n.polygon>=Zs;return!s&&!o?null:b.jsxs(r,{children:[s&&b.jsxs(ma,{children:[b.jsx(L5,{})," ",wa(n.ethereum)]}),o&&b.jsxs(ma,{children:[b.jsx(M5,{})," ",wa(n.polygon)]})]})}function va(e){if(e)return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")?e:`${R6}${e}`}const s0=j.memo(function({isSignedIn:t,isSigningIn:n=!1,isLandingPage:r=!1,isLoadingProfile:s=!1,address:o,avatar:i,manaBalances:a,isManaLoading:c=!1,notifications:u,onClickSignIn:f,onClickSignOut:l,onClickJumpIn:d,onOpenUserCard:h}){const g=r&&!t,p=h0(),{locale:w}=Pa(),{isInitialized:A,track:$}=Ea(),[v,m]=j.useState(!1),y=j.useCallback(z=>{A&&$(p0.CLICK,{place:b0.LANDING_NAVBAR,event:"click",action:z})},[A,$]),[P,x]=j.useState(null),[I,T]=j.useState(null),[E,k]=j.useState(!1),[N,F]=j.useState(!1),G=j.useRef(null),S=j.useRef(null),C=u?.items?.filter(z=>!z.read).length??0,[M,O]=j.useState(!!Jn),L=j.useRef(!1),H=j.useCallback(z=>{u?.onClick&&u.onClick(z),L.current=!L.current,k(!1),T(null),Jn||dr(()=>import("./utils-BmJLp6Wz.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,11,12,13,14,15,16,17])).then(q=>{Jn=q.NotificationComponentByType,O(!0)})},[u]),V=j.useCallback(()=>{L.current&&u?.onClose&&(u.onClose(),L.current=!1)},[u]),J=va(i?.avatar?.snapshots?.face256)??Mo("/avatar_face.webp"),[re,Y]=j.useState(),ze=re===J,ve=va(i?.avatar?.snapshots?.body),nt=i?.name||(o?`${o.slice(0,6)}...${o.slice(-4)}`:""),Ce=o?`${o.slice(0,6)}...${o.slice(-4)}`:"",[Ue,$t]=j.useState(!1),rt=j.useCallback(()=>{o&&navigator.clipboard.writeText(o).then(()=>{$t(!0),setTimeout(()=>$t(!1),2e3)}).catch(()=>{})},[o]),_e=j.useCallback(()=>{m(z=>(z||(T(null),k(!1)),!z))},[]),He=j.useCallback(()=>{m(!1),x(null)},[]),De=j.useCallback(z=>{x(q=>q===z?null:z)},[]),Dn=j.useCallback(z=>{S.current&&(clearTimeout(S.current),S.current=null),T(z),k(!1)},[]),o0=j.useCallback(()=>{S.current=setTimeout(()=>{T(null)},300)},[]),Bt=j.useCallback(()=>{T(null)},[]),i0=j.useCallback(()=>{k(z=>(z||(T(null),m(!1),V(),h?.()),!z))},[V,h]),Ct=j.useCallback(()=>{k(!1)},[]);j.useEffect(()=>{function z(q){const Ge=q.target;if(G.current&&!G.current.contains(Ge)){if(document.querySelector("[data-mobile-user-card]")?.contains(Ge))return;Bt(),Ct(),V()}}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[Bt,Ct,V]),j.useEffect(()=>{if(!g)return;const z=()=>F(window.scrollY>50);return window.addEventListener("scroll",z,{passive:!0}),()=>window.removeEventListener("scroll",z)},[g]),j.useEffect(()=>{const z=()=>{Ct(),Bt(),V()};return window.addEventListener("scroll",z,{passive:!0}),()=>window.removeEventListener("scroll",z)},[Ct,Bt,V]),j.useEffect(()=>{function z(q){q.key==="Escape"&&(Bt(),Ct(),He())}return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[Bt,Ct,He]),j.useEffect(()=>(v?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[v]);const a0=()=>b.jsx(u6,{src:J,alt:"",onLoad:()=>Y(J),onError:()=>Y(J),style:{opacity:ze?1:0}}),c0=j.useCallback(()=>b.jsxs(b.Fragment,{children:[b.jsx(cs,{children:b.jsx(ha,{href:ye.whatsOn.url,children:p(ye.whatsOn.labelKey)})}),sa.map(z=>{const q=ye[z],Ge=P===z;return b.jsxs(cs,{children:[b.jsxs(p6,{onClick:()=>De(z),"aria-expanded":Ge,children:[p(q.labelKey),Ge?b.jsx(R5,{}):b.jsx(Zi,{})]}),b.jsx(b6,{open:Ge,children:q.items?.map(ae=>b.jsxs(g6,{href:ae.url,target:ae.isExternal?"_blank":void 0,rel:ae.isExternal?"noopener noreferrer":void 0,children:[p(ae.labelKey),ae.isExternal&&b.jsx(Yi,{})]},ae.labelKey))})]},z)}),b.jsx(cs,{children:b.jsx(ha,{href:ye.learn.url,children:p(ye.learn.labelKey)})})]}),[p,P,De]);return g?b.jsxs(oa,{ref:G,className:"minimal",children:[b.jsxs(ia,{style:{gap:16},children:[b.jsx(ca,{href:"https://decentraland.org","aria-label":"Decentraland Home",children:b.jsx(Wi,{})}),b.jsx("img",{src:Mo("/dcl_name.svg"),alt:"Decentraland",className:"desktop-only",style:{height:20,opacity:N?0:1,transition:"opacity 0.3s ease",pointerEvents:N?"none":"auto"}})]}),b.jsx(aa,{children:N&&d?b.jsxs(l6,{onClick:z=>{y("jump_in"),d(z)},children:[p("component.landing.navbar.jump_in"),b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"5.25",stroke:"#FCFCFC",strokeOpacity:"0.3",strokeWidth:"1.5"}),b.jsx("path",{d:"M18.7111 11.065L14.034 6.39027C13.2002 5.55695 11.7971 6.14637 11.7971 7.32523V8.86994C11.7564 8.86994 11.7361 8.86994 11.6954 8.86994H7.25895C6.50654 8.86994 5.89648 9.45936 5.89648 10.2114V13.7683C5.89648 14.5203 6.50654 15.1301 7.25895 15.1301H11.6751C11.7158 15.1301 11.7361 15.1301 11.7768 15.1301V16.6748C11.7768 17.8536 13.2002 18.4431 14.0137 17.6097L18.6908 12.935C19.2195 12.4065 19.2195 11.5732 18.7111 11.065Z",fill:"#FCFCFC"})]})]}):b.jsx(da,{onClick:()=>{y("sign_in"),f()},disabled:n,children:p(n?"component.landing.navbar.signing_in":"component.landing.navbar.sign_in")})})]}):b.jsxs(b.Fragment,{children:[b.jsxs(oa,{ref:G,className:r&&t?"logged-landing":"",children:[b.jsxs(ia,{children:[b.jsx(ca,{href:"https://decentraland.org","aria-label":"Decentraland Home",children:b.jsx(Wi,{})}),b.jsxs(_5,{children:[b.jsx(ua,{href:ye.whatsOn.url,children:p(ye.whatsOn.labelKey)}),sa.map(z=>b.jsxs(G5,{onMouseEnter:()=>Dn(z),onMouseLeave:o0,children:[b.jsxs(D5,{"aria-expanded":I===z,"aria-haspopup":"true",onClick:()=>{const q=ye[z].items?.[0];q&&window.open(q.url,"_self")},children:[p(ye[z].labelKey),b.jsx(Zi,{style:{transform:I===z?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}),I===z&&b.jsx(V5,{children:b.jsx(q5,{children:ye[z].items?.map(q=>b.jsxs(W5,{href:q.url,target:q.isExternal?"_blank":void 0,rel:q.isExternal?"noopener noreferrer":void 0,children:[p(q.labelKey),q.isExternal&&b.jsx(Yi,{})]},q.labelKey))})})]},z)),b.jsx(ua,{href:ye.learn.url,children:p(ye.learn.labelKey)})]})]}),b.jsxs(aa,{children:[t&&b.jsxs(U5,{children:[b.jsxs(J5,{children:[b.jsxs(K5,{onClick:H,"aria-label":"Notifications","aria-expanded":u?.isOpen,className:C>0?"has-unread":"",children:[b.jsx(Ki,{}),C>0&&b.jsx(Y5,{children:C>9?"9+":C})]}),u?.isOpen&&b.jsxs(X5,{onClick:z=>z.stopPropagation(),children:[b.jsx(Q5,{children:b.jsx(e6,{children:p("component.landing.navbar.notifications_title")})}),b.jsx(t6,{children:u.isLoading?b.jsx(fa,{children:p("component.landing.navbar.notifications_loading")}):(()=>{const z=u.items;return z.length===0?b.jsx(fa,{children:p("component.landing.navbar.notifications_empty_new")}):z.slice(0,30).map(q=>{const Ge=Jn?.[q.type];if(Ge&&M)return b.jsx(la,{style:{padding:0},children:b.jsx(Ge,{notification:q,locale:w})},q.id);const ae=q.metadata,u0=ae?.title||ae?.nftName||M6(q.type),Lo=ae?.description||ae?.message,Rr=ae?.link||ae?.url;return b.jsxs(la,{onClick:()=>Rr&&window.open(Rr,"_blank","noopener"),style:{cursor:Rr?"pointer":"default"},children:[b.jsx(n6,{children:b.jsx(Ki,{})}),b.jsxs(s6,{children:[b.jsx(o6,{children:u0}),Lo&&b.jsx(a6,{children:Lo}),b.jsx(i6,{children:L6(q.timestamp)})]}),!q.read&&b.jsx(r6,{className:"unread"})]},q.id)})})()})]})]}),b.jsxs(P6,{children:[b.jsx(c6,{onClick:i0,"aria-label":"User menu","aria-expanded":E,"aria-haspopup":"true",className:s?"loading":void 0,children:!s&&a0()}),E&&b.jsxs(m6,{onClick:z=>z.stopPropagation(),children:[b.jsx(y6,{children:ve?b.jsx(w6,{src:ve,alt:""}):null}),b.jsxs(pa,{children:[b.jsxs("div",{style:{paddingLeft:16,paddingBottom:8,display:"flex",flexDirection:"column",gap:4},children:[b.jsx(x6,{title:nt,children:nt}),b.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[b.jsx(v6,{children:p("component.landing.navbar.wallet_address")}),b.jsxs(E6,{children:[Ue?p("component.landing.navbar.address_copied"):Ce,b.jsx(A6,{onClick:rt,"aria-label":"Copy address",children:b.jsx(Xi,{})})]})]}),xa(r0,c,a)]}),b.jsx(Yn,{}),ra.map((z,q)=>b.jsxs(ba,{href:z.url,children:[q===0&&b.jsx(Qi,{}),q===1&&b.jsx(ea,{}),q===2&&b.jsx(ta,{}),q===3&&b.jsx(na,{}),p(z.labelKey)]},z.labelKey)),b.jsx(Yn,{}),b.jsxs(ga,{onClick:l,children:[b.jsx(Ji,{}),p("component.landing.navbar.logout")]})]})]})]})]}),!t&&b.jsx(da,{onClick:()=>{y("sign_in"),f()},disabled:n,children:p(n?"component.landing.navbar.signing_in":"component.landing.navbar.sign_in")}),b.jsx(f6,{onClick:_e,"aria-label":v?"Close menu":"Open menu","aria-expanded":v,children:v?b.jsx(F5,{}):b.jsx(j5,{})})]})]}),b.jsx(d6,{open:v,onClick:He}),b.jsx(h6,{open:v,role:"navigation","aria-label":"Mobile navigation",children:c0()}),t&&E&&b.jsxs(I6,{"data-mobile-user-card":!0,onClick:z=>z.stopPropagation(),children:[b.jsxs(k6,{children:[b.jsx($6,{className:s?"loading":void 0,children:!s&&b.jsx(B6,{src:J,alt:"",onLoad:()=>Y(J),onError:()=>Y(J),style:{opacity:ze?1:0}})}),b.jsxs(C6,{children:[b.jsx(S6,{title:nt,children:nt}),b.jsx(T6,{children:p("component.landing.navbar.wallet_address")}),b.jsxs(N6,{children:[Ue?p("component.landing.navbar.address_copied"):Ce,b.jsx(F6,{onClick:rt,"aria-label":"Copy address",children:b.jsx(Xi,{})})]})]})]}),xa(O6,c,a),b.jsx(Yn,{}),b.jsxs(pa,{children:[ra.map((z,q)=>b.jsxs(ba,{href:z.url,children:[q===0&&b.jsx(Qi,{}),q===1&&b.jsx(ea,{}),q===2&&b.jsx(ta,{}),q===3&&b.jsx(na,{}),p(z.labelKey)]},z.labelKey)),b.jsx(Yn,{}),b.jsxs(ga,{onClick:l,children:[b.jsx(Ji,{}),p("component.landing.navbar.logout")]})]})]})]})});s0.displayName="LandingNavbar";const z6=R("div")({width:"100%",height:425,background:"radial-gradient(ellipse at 0% 0%, rgba(121,47,158,0.6) 0%, rgba(74,23,102,0.8) 25%, rgba(51,12,74,0.9) 50%, rgba(27,0,46,1) 75%)"}),U6=j.lazy(()=>dr(()=>import("./index-DvGiXclv.js"),__vite__mapDeps([18,1,2,3,4,5,6,7])).then(e=>({default:e.LandingFooter}))),_6=({children:e,withNavbar:t=!0,withFooter:n=!0})=>{const r=x0(),{locale:s}=Pa(),{address:o,isConnected:i,disconnect:a}=g0(),{data:c,isLoading:u}=E0(o??void 0,{skip:!o}),f=c?.avatars?.[0],l=i||!!o;T0(r.pathname);const{balances:d,isLoading:h,fetchBalances:g}=O5(o||void 0),{identity:p}=A0(),{handleClick:w,isDownloadModalOpen:A,closeDownloadModal:$,downloadModalProps:v}=m0(),m=s==="es"?"es":s==="zh"?"zh":"en",{notificationProps:y}=N0({identity:p,isConnected:i,locale:m}),P=j.useCallback(()=>{const I=window.location.pathname+window.location.search;y0(I)},[]),x=j.useCallback(()=>{a()},[a]);return b.jsxs("div",{children:[t&&b.jsx(s0,{isSignedIn:l,isLandingPage:r.pathname==="/",isLoadingProfile:u,address:o||void 0,avatar:f,manaBalances:d,isManaLoading:h,onOpenUserCard:g,notifications:y,onClickSignIn:P,onClickSignOut:x,onClickJumpIn:w}),e??b.jsx(v0,{}),b.jsx(w0,{open:A,onClose:$,...v}),n&&b.jsx(j.Suspense,{fallback:b.jsx(z6,{}),children:b.jsx(U6,{})})]})},dg=Object.freeze(Object.defineProperty({__proto__:null,Layout:_6},Symbol.toStringTag,{value:"Module"}));export{B,Qt as H,G1 as a,Le as b,$r as c,ql as d,At as e,je as f,ro as g,dg as h,Ar as i,Sr as l,ne as s};
|