1import{i as S,e as v,r as x,j as e,C as b,B as I,q as N,H as h,A as R,N as B,T as p,V as y,s as l,v as A,w as L}from"./index-CUYrygIZ.js";import{M as V,a as w,G as M}from"./Mushroom_Right-Bw3-TM6n.js";import{N as E}from"./index-CveLg7UC.js";import{u as G,a as T,b as $,c as k,F as d,I as m,d as D}from"./claim.api-CYOXZYdE.js";import{H}from"./chunk-7OLJDQMT-CQdD_cZI.js";import{F as c}from"./chunk-56K2BSAJ-B_zKqpWb.js";const W=()=>{const{address:r}=S(),{chain:i}=v(),[s,j]=x.useState();x.useEffect(()=>{fetch(`${L}/fetchRewardsClaimForAddress?address=${r}`).then(a=>a.json()).then(({vestingId:a})=>{j(a)}).catch(a=>{console.error("Error calling Cloud Function:",a)})},[r]);const{data:n}=G({args:[s||0n],enabled:!!s}),{data:t}=T({args:[s||0n],enabled:!!s}),{config:f}=$({args:[s||0n]}),{write:u,status:C,error:o}=k(f),F=g=>{g.preventDefault(),u&&u()};return e.jsxs(e.Fragment,{children:[![b.Mainnet,b.Sepolia].includes((i==null?void 0:i.id)||1)&&e.jsx(E,{}),e.jsx(I,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"bg.prim",zIndex:-1,background:`url(${V}) left bottom no-repeat, url(${w}) right bottom no-repeat, url(${M}) center bottom / 100% auto no-repeat`}),e.jsxs(N,{pt:20,children:[e.jsxs(h,{mb:4,children:[e.jsx(R,{src:B,size:"lg"}),e.jsx(H,{mb:1,children:"FUNG Claim page"})]}),e.jsx(p,{children:"Season 1 Rewards"}),e.jsx(p,{mb:4,color:"gray.500",fontSize:"sm",children:"Linear 6 month vest"}),e.jsxs(y,{as:"form",bg:"bg.prim",p:5,borderRadius:10,onSubmit:F,children:[e.jsxs(c,{isInvalid:!!o,children:[e.jsx(d,{color:"gray.100",children:"Total"}),e.jsx(m,{variant:"solid",bg:"bg.prim",isReadOnly:!0,value:l(t?t.amount:0n,18).bigNumber.toFixed(2)}),o&&e.jsx(D,{children:o.message||o.name})]}),e.jsxs(c,{children:[e.jsx(d,{color:"gray.100",children:"Claimed"}),e.jsx(m,{variant:"solid",bg:"bg.prim",isReadOnly:!0,value:l(t?t.claimed:0n,18).bigNumber.toFixed(2)})]}),e.jsxs(h,{alignItems:"flex-end",w:"full",children:[e.jsxs(c,{children:[e.jsx(d,{color:"gray.100",children:"Claimable"}),e.jsx(m,{variant:"solid",bg:"bg.prim",isReadOnly:!0,value:l(n||0n,18).bigNumber.toFixed(2)})]}),e.jsx(A,{type:"submit",colorScheme:"green",isLoading:C==="loading",isDisabled:!r||!n,px:8,children:r?"Claim":"Connect Wallet"})]})]})]})]})};export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.