(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1985],{92550:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/memes",function(){return s(47805)}])},89346:function(e,a,s){"use strict";s.d(a,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return l},aY:function(){return d},eW:function(){return m},ll:function(){return o}});var t=s(85893),r=s(67294),n=s(94777);let l=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("div",{ref:a,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...r})});l.displayName="Card";let i=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("div",{ref:a,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",s),...r})});i.displayName="CardHeader";let o=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("h3",{ref:a,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",s),...r})});o.displayName="CardTitle";let c=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("p",{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",s),...r})});c.displayName="CardDescription";let d=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("div",{ref:a,className:(0,n.cn)("p-6 pt-0",s),...r})});d.displayName="CardContent";let m=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("div",{ref:a,className:(0,n.cn)("flex items-center p-6 pt-0",s),...r})});m.displayName="CardFooter"},5305:function(e,a,s){"use strict";s.d(a,{$N:function(){return h},Be:function(){return g},GG:function(){return d},Vq:function(){return o},cN:function(){return f},cZ:function(){return u},fK:function(){return x}});var t=s(85893),r=s(67294),n=s(6327),l=s(62190),i=s(94777);let o=n.fC;n.xz;let c=n.h_,d=n.x8,m=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.aV,{ref:a,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...r})});m.displayName=n.aV.displayName;let u=r.forwardRef((e,a)=>{let{className:s,children:r,...o}=e;return(0,t.jsxs)(c,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)(n.VY,{ref:a,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...o,children:[r,(0,t.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(l.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=n.VY.displayName;let x=e=>{let{className:a,...s}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...s})};x.displayName="DialogHeader";let f=e=>{let{className:a,...s}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...s})};f.displayName="DialogFooter";let h=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.Dx,{ref:a,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",s),...r})});h.displayName=n.Dx.displayName;let g=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.dk,{ref:a,className:(0,i.cn)("text-sm text-muted-foreground",s),...r})});g.displayName=n.dk.displayName},88860:function(e,a,s){"use strict";s.d(a,{I:function(){return l}});var t=s(85893),r=s(67294),n=s(94777);let l=r.forwardRef((e,a)=>{let{className:s,type:r,...l}=e;return(0,t.jsx)("input",{type:r,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:a,...l})});l.displayName="Input"},1128:function(e,a,s){"use strict";s.d(a,{i:function(){return i}});var t=s(85893),r=s(67294),n=s(19615),l=s(94777);let i=r.forwardRef((e,a)=>{var s;let{className:r,...i}=e;return(0,t.jsxs)(n.fC,{ref:a,className:(0,l.cn)("relative flex w-full touch-none select-none items-center",r),...i,children:[(0,t.jsx)(n.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)(n.e6,{className:"absolute h-full bg-primary"})}),null===(s=i.defaultValue)||void 0===s?void 0:s.map((e,a)=>(0,t.jsx)(n.bU,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},a))]})});i.displayName=n.fC.displayName},62378:function(e,a,s){"use strict";s.d(a,{RM:function(){return o},SC:function(){return c},iA:function(){return l},pj:function(){return m},ss:function(){return d},xD:function(){return i}});var t=s(85893),r=s(67294),n=s(94777);let l=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:a,className:(0,n.cn)("w-full caption-bottom text-sm",s),...r})})});l.displayName="Table";let i=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("thead",{ref:a,className:(0,n.cn)("[&_tr]:border-b",s),...r})});i.displayName="TableHeader";let o=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("tbody",{ref:a,className:(0,n.cn)("[&_tr:last-child]:border-0",s),...r})});o.displayName="TableBody",r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("tfoot",{ref:a,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...r})}).displayName="TableFooter";let c=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("tr",{ref:a,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...r})});c.displayName="TableRow";let d=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("th",{ref:a,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...r})});d.displayName="TableHead";let m=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("td",{ref:a,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r})});m.displayName="TableCell",r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)("caption",{ref:a,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",s),...r})}).displayName="TableCaption"},93517:function(e,a,s){"use strict";s.d(a,{SP:function(){return c},dr:function(){return o},mQ:function(){return i},nU:function(){return d}});var t=s(85893),r=s(67294),n=s(82968),l=s(94777);let i=n.fC,o=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.aV,{ref:a,className:(0,l.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...r})});o.displayName=n.aV.displayName;let c=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.xz,{ref:a,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...r})});c.displayName=n.xz.displayName;let d=r.forwardRef((e,a)=>{let{className:s,...r}=e;return(0,t.jsx)(n.VY,{ref:a,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...r})});d.displayName=n.VY.displayName},47805:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return D}});var t=s(85893),r=s(67294),n=s(34240),l=s(54124),i=s(33305),o=s(16693),c=s(55678),d=s(98778),m=s(88860),u=s(1128),x=s(5305),f=s(62378),h=s(90437),g=s(74598),p=s(3112),b=s(25675),N=s.n(b),j=s(93517);function y(e){let{pools:a,lfyPrice:s,projectPrices:n}=e,[b,y]=(0,r.useState)(null),[v,k]=(0,r.useState)(!0),[w,F]=(0,r.useState)(""),[P,S]=(0,r.useState)(0),[C,D]=(0,r.useState)(!1),[A,R]=(0,r.useState)("stake"),{writeContract:T}=(0,l.S)(),{writeContract:E}=(0,l.S)(),{writeContract:I}=(0,l.S)(),{writeContract:V}=(0,l.S)(),B=e=>{y(e),k(!0),F(""),S(0),D(!0)},z=e=>{y(e),k(!1),F(""),S(0),D(!0)},Y=e=>{let a=e.target.value;F(a);let s=v?Number.parseFloat((null==b?void 0:b.userBalance)||"0"):Number.parseFloat((null==b?void 0:b.userStakedBalance)||"0");s>0?S(Math.min(Number.parseFloat(a||"0")/s*100,100)):S(0)},L=e=>{let a=e[0];S(a);let s=a/100*(v?Number.parseFloat((null==b?void 0:b.userBalance)||"0"):Number.parseFloat((null==b?void 0:b.userStakedBalance)||"0"));F(s.toFixed(s<.1?6:2))},U=()=>{F((v?Number.parseFloat((null==b?void 0:b.userBalance)||"0"):Number.parseFloat((null==b?void 0:b.userStakedBalance)||"0")).toString()),S(100)},_=()=>{if(!b||!w)return;let e=Number.parseFloat(w);if(isNaN(e)||e<=0){c.Am.error("Please enter a valid amount");return}if(v){if(parseFloat(b.allowance)Math.abs(e-parseFloat(b.userBalance))?(0,i.f)(w)-(0,i.f)("0.00000001"):(0,i.f)(w);E({address:b.stakedToken,abi:o.Wo,functionName:"approve",args:[b.stakingPool,a]},{onSuccess(e){console.log("Approval successful:",e),c.Am.success("Approval successful! Now you can deposit."),setTimeout(()=>{T({address:b.stakingPool,abi:p.U0,functionName:"stake",args:[a]},{onSuccess(e){console.log("Deposit successful:",e),c.Am.success("Deposit successful!"),D(!1)},onError(e){console.error("Deposit error:",e),c.Am.error("Deposit failed! Please try again.")}})},2e3)},onError(e){console.error("Approval error:",e),c.Am.error("Approval failed! Please try again.")}})}else{let a=1e-4>Math.abs(e-parseFloat(b.userBalance))?(0,i.f)(w)-(0,i.f)("0.00000001"):(0,i.f)(w);T({address:b.stakingPool,abi:p.U0,functionName:"stake",args:[a]},{onSuccess(e){console.log("Deposit successful:",e),c.Am.success("Deposit successful!"),D(!1)},onError(e){console.error("Deposit error:",e),c.Am.error("Deposit failed! Please try again.")}})}}else I({address:b.stakingPool,abi:p.U0,functionName:"withdraw",args:[(0,i.f)(w)]},{onSuccess(e){console.log("Withdraw successful:",e),c.Am.success("Withdraw successful!"),D(!1)},onError(e){console.error("Withdraw error:",e),c.Am.error("Withdraw failed! Please try again.")}})},M=(e,a)=>{V({address:e,abi:p.U0,functionName:"claimRewards",args:[a],chainId:56},{onSuccess(e){console.log("Claim successful:",e),c.Am.success("Claim successful!")},onError(e){console.error("Claim error:",e),c.Am.error("Claim failed! Please try again.")}})},Z=e=>{null!=b&&M(b.stakingPool,e)},O=()=>b?v?parseFloat(b.allowance)(null==e?void 0:e.userPendingReward)||"0",H=e=>{let a=Number.parseFloat(q(b));return a>0?e?"Claim ".concat((a/2).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})," LFY"):"Vest ".concat(a.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})," LFY"):"Nothing To Claim"},W=e=>{if(!n||!e||!s)return"0.00%";let t=a.findIndex(a=>a.id===e.id),r=(t(0,t.jsxs)(f.SC,{className:"hover:bg-green-900/30 border-green-800/50",children:[(0,t.jsx)(f.pj,{className:"font-medium text-white",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full overflow-hidden",children:(0,t.jsx)(N(),{src:e.poolImage,alt:"Pool Image",width:32,height:32,className:"rounded-full"})}),e.title]})}),(0,t.jsx)(f.pj,{children:(0,t.jsxs)("div",{className:"flex items-center gap-1 text-white",children:[(0,t.jsx)(h.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:W(e)})]})}),(0,t.jsxs)(f.pj,{className:"text-white",children:[parseFloat(e.totalStaked).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:0})," ",e.title]}),(0,t.jsxs)(f.pj,{className:"text-white",children:[parseFloat(e.userStakedBalance).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:3})," ",e.title]}),(0,t.jsxs)(f.pj,{className:"text-white",children:[parseFloat(e.userPendingReward).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:2})," LFY"]}),(0,t.jsx)(f.pj,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,t.jsx)(d.z,{variant:"outline",size:"sm",className:"border-green-500 bg-green-900/50 text-white hover:bg-green-800/70",onClick:()=>B(e),children:"Stake"}),(0,t.jsx)(d.z,{variant:"outline",size:"sm",className:"border-red-500 bg-red-900/50 text-white hover:bg-red-800/70",onClick:()=>z(e),disabled:0>=Number.parseFloat(e.userStakedBalance),children:"Unstake"})]})})]},e.id))})]})}),(0,t.jsx)(x.Vq,{open:C,onOpenChange:D,children:(0,t.jsxs)(x.cZ,{className:"bg-green-900/90 border-green-800 text-white backdrop-blur-md",children:[(0,t.jsxs)(x.fK,{children:[(0,t.jsxs)(x.$N,{children:[null==b?void 0:b.title," Pool"]}),(0,t.jsxs)(x.Be,{className:"text-gray-300",children:["Stake ",null==b?void 0:b.title," to earn LFY"]})]}),(0,t.jsxs)(j.mQ,{value:A,onValueChange:e=>R(e),className:"w-full",children:[(0,t.jsxs)(j.dr,{className:"grid w-full grid-cols-3 bg-green-950/50",children:[(0,t.jsx)(j.SP,{value:"stake",className:"data-[state=active]:bg-primary data-[state=active]:text-black",children:"Stake"}),(0,t.jsx)(j.SP,{value:"unstake",className:"data-[state=active]:bg-primary data-[state=active]:text-black",children:"Unstake"}),(0,t.jsx)(j.SP,{value:"rewards",className:"data-[state=active]:bg-primary data-[state=active]:text-black",children:"Rewards"})]}),(0,t.jsx)(j.nU,{value:"stake",className:"mt-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm text-gray-300",children:"Balance:"}),(0,t.jsxs)("span",{className:"font-medium",children:[parseFloat((null==b?void 0:b.userBalance)||"0").toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:2})," ",null==b?void 0:b.title]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{htmlFor:"stake-amount",className:"text-sm text-gray-300",children:"Amount"}),(0,t.jsx)(d.z,{variant:"ghost",size:"sm",className:"h-6 text-xs text-primary hover:text-primary hover:bg-primary/20",onClick:U,children:"MAX"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.I,{id:"stake-amount",type:"number",placeholder:"0.0",value:w,onChange:Y,className:"bg-green-950/50 border-green-800 text-white"}),(0,t.jsx)("div",{className:"bg-green-950/50 border border-green-800 rounded-md px-3 py-2 text-sm font-medium",children:null==b?void 0:b.title})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.i,{defaultValue:[0],max:100,step:1,value:[P],onValueChange:L,className:"py-4"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-gray-400",children:[(0,t.jsx)("span",{children:"0%"}),(0,t.jsx)("span",{children:"25%"}),(0,t.jsx)("span",{children:"50%"}),(0,t.jsx)("span",{children:"75%"}),(0,t.jsx)("span",{children:"100%"})]})]}),(0,t.jsxs)("div",{className:"rounded-md bg-green-950/50 p-3 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(g.Z,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("span",{className:"font-medium",children:"Meme Staking Information"})]}),(0,t.jsxs)("ul",{className:"space-y-1 text-gray-300",children:[(0,t.jsxs)("li",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Daily Rewards:"}),(0,t.jsxs)("span",{children:[null==b?void 0:b.tokensPerDay," LFY"]})]}),(0,t.jsxs)("li",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Reward Token:"}),(0,t.jsx)("span",{children:"LFY"})]})]})]}),(0,t.jsxs)(x.cN,{className:"pt-2",children:[(0,t.jsx)(d.z,{variant:"outline",onClick:()=>D(!1),className:"border-gray-600 bg-gray-800/50 text-gray-300 hover:bg-gray-700/50",children:"Cancel"}),(0,t.jsx)(d.z,{onClick:_,className:"bg-primary text-black hover:bg-primary/90",disabled:!w||0>=Number.parseFloat(w),children:O()})]})]})}),(0,t.jsx)(j.nU,{value:"unstake",className:"mt-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm text-gray-300",children:"Staked:"}),(0,t.jsxs)("span",{className:"font-medium",children:[(null==b?void 0:b.userStakedBalance)||"0"," ",null==b?void 0:b.title]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{htmlFor:"unstake-amount",className:"text-sm text-gray-300",children:"Amount"}),(0,t.jsx)(d.z,{variant:"ghost",size:"sm",className:"h-6 text-xs text-primary hover:text-primary hover:bg-primary/20",onClick:U,children:"MAX"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.I,{id:"unstake-amount",type:"number",placeholder:"0.0",value:w,onChange:Y,className:"bg-green-950/50 border-green-800 text-white"}),(0,t.jsx)("div",{className:"bg-green-950/50 border border-green-800 rounded-md px-3 py-2 text-sm font-medium",children:null==b?void 0:b.title})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.i,{defaultValue:[0],max:100,step:1,value:[P],onValueChange:L,className:"py-4"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-gray-400",children:[(0,t.jsx)("span",{children:"0%"}),(0,t.jsx)("span",{children:"25%"}),(0,t.jsx)("span",{children:"50%"}),(0,t.jsx)("span",{children:"75%"}),(0,t.jsx)("span",{children:"100%"})]})]}),(0,t.jsxs)(x.cN,{className:"pt-2",children:[(0,t.jsx)(d.z,{variant:"outline",onClick:()=>D(!1),className:"border-gray-600 bg-gray-800/50 text-gray-300 hover:bg-gray-700/50",children:"Cancel"}),(0,t.jsx)(d.z,{onClick:_,className:"bg-primary text-black hover:bg-primary/90",disabled:!w||0>=Number.parseFloat(w),children:O()})]})]})}),(0,t.jsx)(j.nU,{value:"rewards",className:"mt-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm text-gray-300",children:"Pending Rewards:"}),(0,t.jsxs)("span",{className:"font-medium",children:[q(b)," LFY"]})]}),(0,t.jsxs)("div",{className:"rounded-md bg-green-950/50 p-3 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(g.Z,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("span",{className:"font-medium",children:"Rewards Information"})]}),(0,t.jsxs)("ul",{className:"space-y-1 text-gray-300",children:[(0,t.jsxs)("li",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Claim Option:"}),(0,t.jsx)("span",{children:"Claim 50% now"})]}),(0,t.jsxs)("li",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Vest Option:"}),(0,t.jsx)("span",{children:"Vest 100% over 90 days"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.z,{onClick:()=>Z(!1),className:"w-full bg-primary text-black hover:bg-primary/90",disabled:0>=Number.parseFloat(q(b)),children:H(!0)}),(0,t.jsx)(d.z,{onClick:()=>Z(!0),className:"w-full bg-green-700 text-white hover:bg-green-600",disabled:0>=Number.parseFloat(q(b)),children:H(!1)})]}),(0,t.jsx)(x.cN,{className:"pt-2",children:(0,t.jsx)(d.z,{variant:"outline",onClick:()=>D(!1),className:"border-gray-600 bg-gray-800/50 text-gray-300 hover:bg-gray-700/50",children:"Close"})})]})})]})]})})]})}var v=s(89346),k=s(89810),w=s(82020),F=s(1958),P=s(39625),S=s(15229),C=s(56334);function D(){let[e,a]=(0,r.useState)("active"),[s,l]=(0,r.useState)(!1),{address:i,isConnected:o}=(0,w.Tj)(),[c,m]=(0,r.useState)([]),[u,f]=(0,r.useState)([]),h=e=>0==e?{id:"captain",title:"CaptainBNB",poolImage:"/icons/memecoins/captain.jpg",v3PoolAddress:"0x07F071AA224e2FC2Cf03cA2e6558Ec6181d66a90",isV3Pool:!0}:1==e?{id:"clancy",title:"Clancy",poolImage:"/icons/memecoins/clancy.jpg",v3PoolAddress:"0x6b9a2054df66892b728a0455ec20c45a72d7f9b4",isV3Pool:!0}:2==e?{id:"cast",title:"Cast",poolImage:"/icons/memecoins/castlogo.png",v3PoolAddress:"0x5889789eBf6b4EEE040FD42EE33EC2894e714fFe",isV3Pool:!1}:{id:"unknown",title:"Unknown",poolImage:"/icons/memecoins/unknown.jpg",v3PoolAddress:F.DR,isV3Pool:!1},{data:b}=(0,k.u)({address:p.lQ,abi:p.cf,functionName:"gatherAllInfo",args:[i||F.DR],chainId:56,query:{refetchInterval:3e3}}),{data:N}=(0,k.u)({address:p.tZ,abi:p.cf,functionName:"gatherAllInfo",args:[i||F.DR],chainId:C.p.id,query:{refetchInterval:3e3}});console.log("allPoolAndUserData",b),console.log("allPoolAndUserDataAVAX",N),(0,r.useEffect)(()=>{if(b&&N){console.log("allPoolAndUserData",b),console.log("allPoolAndUserDataAVAX",N);let e=b[0].filter((e,a)=>a>1).map((e,a)=>({stakedToken:e.stakedToken,stakingPool:e.stakingPool,tokensPerDay:(0,P.d)(e.tokensPerDay),fee:e.entryFee.toString()})),a=b[1].map(e=>(0,P.d)(e)),s=b[2].map(e=>(0,P.d)(e)),t=b[3].map(e=>(0,P.d)(e)),r=b[4].map(e=>(0,P.d)(e)),n=b[5].map(e=>(0,P.d)(e)),l=[];for(let i=0;i({stakedToken:e.stakedToken,stakingPool:e.stakingPool,tokensPerDay:(0,P.d)(e.tokensPerDay),fee:e.entryFee.toString()})),o=N[1].map(e=>(0,P.d)(e)),c=N[2].map(e=>(0,P.d)(e)),d=N[3].map(e=>(0,P.d)(e)),u=N[4].map(e=>(0,P.d)(e)),x=N[5].map(e=>(0,P.d)(e));for(let a=0;a56===e.chainId);c.filter(e=>e.chainId===C.p.id);let{data:A}=(0,k.u)({address:p.I,abi:p.NX,chainId:56,functionName:"priceOf",args:[p.hR],query:{refetchInterval:3e3,select:e=>e?parseFloat((0,P.d)(e)):0}}),{data:R}=(0,k.u)({address:p._2,abi:p.o8,chainId:C.p.id,functionName:"priceOf",args:["0xE3f3EF63f193f001D72bb623cA6eCe3E71451D3f","0x5889789eBf6b4EEE040FD42EE33EC2894e714fFe"],query:{refetchInterval:3e3,select:e=>e?parseFloat((0,P.d)(e[0]))*parseFloat((0,S.b)(e[1],8)):0}}),{data:T}=(0,k.u)({address:p.md,abi:p.C2,functionName:"getPrices",chainId:56,args:[D.map(e=>e.stakedToken),D.map(e=>e.v3PoolAddress),D.map(e=>e.isV3Pool),!0]});(0,r.useEffect)(()=>{T&&R&&f([...T.map(e=>parseFloat((0,P.d)(e))),R])},[T,R]);let E=()=>0===c.length?0:c.reduce((e,a)=>e+parseFloat(a.tokensPerDay),0);return console.log("pools",c),(0,t.jsxs)(n.Z,{children:[(0,t.jsxs)("div",{className:"w-full flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h1",{className:"text-3xl font-bold text-white",children:"Memecoin Staking"}),(0,t.jsx)("p",{className:"text-gray-400",children:"Stake any listed Memecoins to earn rewards in LFY Tokens"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)(v.Zb,{className:"bg-green-900/30 border-green-800/50 backdrop-blur-sm",children:[(0,t.jsx)(v.Ol,{className:"pb-2",children:(0,t.jsx)(v.ll,{className:"text-white text-lg",children:"Rewards Per Day"})}),(0,t.jsx)(v.aY,{children:(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsx)("span",{className:"text-2xl font-bold text-white",children:E().toLocaleString([],{maximumFractionDigits:2,minimumFractionDigits:2})}),(0,t.jsx)("span",{className:"text-green-500 text-sm mb-1",children:"LFY"}),(0,t.jsxs)("span",{className:"text-green-400 text-sm mb-1",children:["$",(E()*(A||0)).toLocaleString([],{maximumFractionDigits:2,minimumFractionDigits:2})]})]})})]}),(0,t.jsxs)(v.Zb,{className:"bg-green-900/30 border-green-800/50 backdrop-blur-sm",children:[(0,t.jsx)(v.Ol,{className:"pb-2",children:(0,t.jsx)(v.ll,{className:"text-white text-lg",children:"Total Value Locked"})}),(0,t.jsx)(v.aY,{children:(0,t.jsx)("div",{className:"flex items-end gap-2",children:(0,t.jsxs)("span",{className:"text-2xl font-bold text-white",children:["$",(()=>{if(!u||0===u.length||0==c.length||c.length!==u.length)return"0.00";let e=0;for(let a=0;al(!0),children:[(0,t.jsx)(g.Z,{className:"h-4 w-4 mr-1"}),"How it works"]})})]}),(0,t.jsx)(j.nU,{value:"active",className:"mt-0",children:(0,t.jsx)(y,{pools:c,lfyPrice:A,projectPrices:u})}),(0,t.jsx)(j.nU,{value:"ended",className:"mt-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,t.jsx)("p",{className:"text-gray-400 mb-2",children:"No ended pools at the moment"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Ended pools will appear here"})]})})]})})]}),(0,t.jsx)(x.Vq,{open:s,onOpenChange:l,children:(0,t.jsxs)(x.cZ,{className:"bg-green-900/90 border-green-800 text-white backdrop-blur-md max-w-md max-h-[80vh] overflow-y-auto",children:[(0,t.jsxs)(x.fK,{children:[(0,t.jsxs)(x.$N,{className:"text-xl flex items-center gap-2",children:[(0,t.jsx)(g.Z,{className:"h-5 w-5 text-primary"}),"How Meme Staking Works"]}),(0,t.jsx)(x.Be,{className:"text-gray-300",children:"Learn how to stake Memecoins and earn rewards"})]}),(0,t.jsx)("div",{className:"space-y-4 py-2",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"What is Staking?"}),(0,t.jsx)("p",{className:"text-gray-300 text-sm",children:"Staking is the process of locking up tokens in the protocol to earn rewards. By staking, you contribute to the security and stability of the market while earning passive income."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"How to Stake"}),(0,t.jsxs)("ol",{className:"list-decimal list-inside space-y-2 text-gray-300 text-sm",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-white",children:"Choose a Pool:"})," Select a staking pool based on which memecoin you want to stake. Different memecoins have varying APYs based on several factors."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-white",children:"Approve Tokens:"})," First-time stakers need to approve the staking contract to use their Memecoins."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-white",children:"Stake Your Tokens:"})," Enter the amount you wish to stake and confirm the transaction."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-white",children:"Earn Rewards:"})," Your staked tokens will automatically earn rewards based on the pool's APY. Rewards can be claimed at any time."]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Stake Fees"}),(0,t.jsx)("p",{className:"text-gray-300 text-sm",children:"Memecoin Staking does not have any enforced lock periods. However, there is a 5% fee on all stake/unstake transactions. This fee is used to maintain the protocol and provide liquidity for the staked tokens."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Claimable Rewards"}),(0,t.jsx)("p",{className:"text-gray-300 text-sm",children:"Rewards are distributed in LFY Tokens every 3 hours. You can claim your rewards at any time by clicking the claim button."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Unstaking"}),(0,t.jsx)("p",{className:"text-gray-300 text-sm",children:"You may unstake your tokens at any time. This returns your Memecoins, but you will no longer gain rewards."})]})]})}),(0,t.jsx)("div",{className:"flex justify-end mt-4",children:(0,t.jsx)(x.GG,{asChild:!0,children:(0,t.jsx)(d.z,{className:"bg-primary text-black hover:bg-primary/90",children:"Got it"})})})]})})]})}}},function(e){e.O(0,[9221,5666,6456,3043,5465,6525,2888,9774,179],function(){return e(e.s=92550)}),_N_E=e.O()}]);