1import{dh as u,d_ as W,dr as T,ds as le,d9 as S,db as e,dc as o,dj as r,df as I,dk as F,de as _,fV as w,fW as Le,fX as $e,eO as We,eW as v,fY as oe,dv as ze,eN as Oe,dB as Ne,eP as Pe,eZ as Be,dR as ce,eQ as V,ej as Me,ek as Ue,dU as He,dg as Ke,d5 as qe,eY as K,dm as Fe,eV as Ve,dV as Ge,di as Ye,dX as Qe}from"./main-HVX7KApq.js";import{aE as Xe,aF as Ze,p as G,b as j,T as Y,b8 as Q,O as k,aB as me,L as A,a6 as Je,t as et,a7 as tt,X as ot,l as D,aU as nt,b9 as pe,ba as rt,bb as at,aX as fe,bc as it,aT as ge,a$ as dt,bd as st,aY as lt,be as ct,bf as mt,i as ve,a as pt,r as ft,a2 as he,c as gt,J as vt,e as ht,bg as ut,bh as yt,bi as xt,a9 as bt,k as St,g as It,ab as _t,P as wt}from"./App-BfPngx7p.js";import{D as Ct}from"./ContentSection-DmZ72mVd.js";import{C as Rt}from"./ContentSectionHeader-D3o8svIA.js";import{u as ue,P as C,a as jt,b as At,c as Dt,S as ne,L as re}from"./SwapAndStakingPanel-D2Ro4bS2.js";import{e as X}from"./csv-aAkMdxD8.js";import"./tooltips-CQ9mVgJp.js";import"./tslib.es6-Cr1Ls5ik.js";import"./clsx.m-irjavGej.js";import"./createPublicClient-BVpTaity.js";import"./index-CcSRvz_k.js";import"./js-CE9XUIHO.js";import"./index.es-B9L2lvLV.js";import"./dijkstra-COg3n3zL.js";import"./createWalletClient-CYCHizUI.js";const kt=()=>Xe(Ze.ffOnlyShowLiquidationRebates);var ye=(t=>(t.Rank="Rank",t.Trader="Trader",t.PNL="PNL",t.EstimatedPrize="EstimatedPrize",t))(ye||{});const Tt=()=>{const t=u(),{data:a,isLoading:i}=ue(),{dydxAddress:n}=W(),s=T(le),l=S.useCallback(d=>d.rank,[]),c=Object.values(ye).map(d=>$t({key:d,stringGetter:t,dydxAddress:n})),p=(a??[]).reduce((d,m)=>[...d,{rank:m.position,account:m.address,dollarReward:m.dollarReward,pnl:+m.pnl}],[]),f=()=>{if(p.length===0)return;const d=p.map(m=>({rank:m.rank,address:m.account,pnl:m.pnl,dollarRewards:m.dollarReward}));X(d,{filename:`loss-rebates-leaderboard-${new Date().toLocaleDateString(s,{month:"short",year:"numeric"})}`,columnHeaders:[{key:"rank",displayLabel:t({key:r.RANK})},{key:"address",displayLabel:t({key:r.TRADER})},{key:"pnl",displayLabel:t({key:r.PNL})}]})};return e.jsx(Et,{children:e.jsxs(Wt,{children:[e.jsxs(zt,{children:[e.jsx(Ot,{children:t({key:r.COMPETITION_LEADERBOARD_TITLE})}),e.jsx("button",{onClick:f,type:"button","aria-label":t({key:r.DOWNLOAD}),children:e.jsx(Nt,{size:"1.25rem",iconName:I.Download})})]}),e.jsx(Pt,{children:e.jsx(Lt,{label:t({key:r.LEADERBOARD}),data:p,tableId:"trading-rewards",getRowKey:l,columns:c,defaultSortDescriptor:{column:"Rank",direction:"ascending"},getIsRowPinned:d=>
1d.account===n,slotEmpty:i?e.jsx(G,{id:"rewards-leaderboard"}):e.jsxs(Bt,{children:[e.jsx(Mt,{iconName:I.OrderPending}),t({key:r.TRADING_REWARD_TABLE_EMPTY_STATE})]}),getRowAttributes:({account:d})=>({style:{backgroundColor:d===n?"var(--color-accent-faded)":void 0}}),selectionBehavior:"replace",withInnerBorders:!0,initialPageSize:10,withScrollSnapColumns:!0,withScrollSnapRows:!0})})]})})},Et=o(C).withConfig({componentId:"sc-zjfpeq-0"})(["--panel-content-paddingY:1.5rem;--panel-content-paddingX:1.5rem;"]),Lt=o(Y).withConfig({componentId:"sc-zjfpeq-1"})(["--tableCell-padding:0.25rem;font:var(--font-mini-book);--stickyArea-background:transparent;table{--stickyArea-background:transparent;}thead,tbody{--stickyArea-background:transparent;tr{td:first-of-type,th:first-of-type{--tableCell-padding:0.5rem 0.25rem 0.5rem 1rem;}td:last-of-type,th:last-of-type{--tableCell-padding:0.5rem 1rem 0.5rem 0.25rem;}}}tbody{font:var(--font-small-book);}tfoot{--stickyArea-background:transparent;--tableCell-padding:0.5rem 1rem 0.5rem 1rem;}min-width:1px;tbody{font:var(--font-small-book);}"]),$t=({key:t,stringGetter:a,dydxAddress:i})=>({...{Rank:{columnKey:"Rank",getCellValue:n=>n.rank,label:e.jsx(Ut,{children:a({key:r.RANK})}),renderCell:({rank:n,account:s})=>e.jsxs(Ht,{children:[e.jsx(Kt,{children:e.jsx(qt,{children:n})}),n===1&&e.jsx(Ft,{}),n===2&&e.jsx(Vt,{}),n===3&&e.jsx(Gt,{}),s===i&&e.jsx(Yt,{children:e.jsx(Qt,{children:a({key:r.YOU})})})]})},Trader:{columnKey:"Trader",getCellValue:n=>n.account,label:e.jsx(Xt,{children:a({key:r.TRADER})}),renderCell:({account:n})=>e.jsx(Zt,{value:n,buttonType:"text",$_css:[{display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"},{color:n===i?"var(--color-accent)":"var(--color-text-1)"}],children:F(n)})},PNL:{columnKey:"PNL",getCellValue:n=>n.pnl,label:e.jsx(Jt,{children:a({key:r.PNL})}),renderCell:({pnl:n})=>e.jsx(eo,{type:j.Fiat,value:n,$_css2:[{color:n>=0?"var(--color-positive)":"var(--color-negative)"},{fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"}]})},EstimatedPrize:{columnKey:"EstimatedPrize",getCellValue:n=>n.dollarReward,label:e.jsx(to,{children:a({key:r.ESTIMATED_PRIZE})}),renderCell:({dollarReward:n})=>e.jsx(oo,{type:j.Fiat,value:n})}}[t]});var Wt=o("div").withConfig({componentId:"sc-zjfpeq-2"})({display:"flex",flexDirection:"column",gap:"1rem"}),zt=o("div").withConfig({componentId:"sc-zjfpeq-3"})({display:"flex",alignItems:"center",justifyContent:"space-between"}),Ot=o("div").withConfig({componentId:"sc-zjfpeq-4"})({font:"var(--font-medium-bold)"}),Nt=o(_).withConfig({componentId:"sc-zjfpeq-5"})({color:"var(--color-text-0)"}),Pt=o("div").withConfig({componentId:"sc-zjfpeq-6"})({overflow:"hidden",borderRadius:"0.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)"}),Bt=o("div").withConfig({componentId:"sc-zjfpeq-7"})({display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"}),Mt=o(_).withConfig({componentId:"sc-zjfpeq-8"})({fontSize:"3em"}),Ut=o("div").withConfig({componentId:"sc-zjfpeq-9"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),Ht=o("div").withConfig({componentId:"sc-zjfpeq-10"})({display:"flex",gap:"0.5rem"}),Kt=o("div").withConfig({componentId:"sc-zjfpeq-11"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)",padding:"0.5rem"}),qt=o("div").withConfig({componentId:"sc-zjfpeq-12"})({display:"flex",height:"0.5rem",minWidth:"0.5rem",alignItems:"center",justifyContent:"center",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"}),Ft=o(w).withConfig({componentId:"sc-zjfpeq-13"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(229 195 70 / var(--tw-text-opacity, 1))"}),Vt=o(w).withConfig({componentId:"sc-zjfpeq-14"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(201 201 203 / var(--tw-text-opacity, 1))"}),Gt=o(w).withConfig({componentId:"sc-zjfpeq-15"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(195 123 63 / var(--tw-text-opacity, 1))"}),Yt=o("div").withConfig({componentId:"sc-zjfpeq-16"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-accent)",paddingLeft:"0.5rem",paddingRight:"0.5rem"}),Qt=o("span").withConfig({componentId:"sc-zjfpeq-17"})({fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-accent)"}),Xt=o("div").withConfig({componentId:"sc-zjfpeq-18"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),Zt=o(Q).withConfig({componentId:"sc-zjfpeq-19"})(["",""],t=>t.$_css),Jt=o("div").withConfig({componentId:"sc-zjfpeq-20"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),eo=o(k).withConfig({componentId:"sc-zjfpeq-21"})(["",""],t=>t.$_css2),to=o("div").withConfig({componentId:"sc-zjfpeq-22"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),oo=o(k).withConfig({componentId:"sc-zjfpeq-23"})({fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"});const ae=()=>{const t=u();return e.jsx(C,{children:t({key:r.TRADING_REWARDS_UNAVAILABLE_IN_US,params:{TERMS_OF_USE_LINK:e.jsx(no,{isInline:!0})}})})};var no=o(me).withConfig({componentId:"sc-c0ttma-0"})({textDecorationLine:"underline"});const ro=()=>{const t=u();return e.jsx(ao,{children:e.jsx(io,{children:e.jsx(so,{children:e.jsxs(lo,{children:[e.jsx(co,{children:e.jsx(mo,{children:e.jsx(po,{children:t({key:r.LIQUIDATION_REBATES_HEADLINE,params:{REBATE_AMOUNT:Le.rebateAmount}})})})}),e.jsxs("div",{children:[e.jsx(fo,{children:t({key:r.LIQUIDATION_REBATES_BODY})}),e.jsx(go,{children:t({key:r.LIQUIDATION_REBATES_SUB_BODY,params:{LOSS_REBATES_LINK:e.jsx(A,{href:"https://dydx.forum/t/drc-realized-losses-rebate-pilot-program/4828/2",isInline:!0,children:t({key:r.LOSS_REBATES})}),CHECK_ELIGIBILITY_LINK:e.jsx(A,{href:"https://www.dydx.xyz/liquid
1ation-rebates",isInline:!0,children:t({key:r.HERE})})}})})]})]})})})})},ao=o(C)({width:"100%",backgroundColor:"var(--color-layer-3)"});var io=o("div")({display:"flex",gap:"3rem",paddingBottom:"0.25rem",paddingTop:"0.5rem"}),so=o("div")({display:"flex",flexDirection:"column",gap:"1.5rem"}),lo=o("div")({display:"flex",flexDirection:"column",gap:"0.5rem"}),co=o("div")({display:"flex",alignItems:"center",gap:"0.5rem"}),mo=o("div")({font:"var(--font-medium-bold)"}),po=o("span")({fontWeight:"var(--fontWeight-bold)"}),fo=o("p")({marginBottom:"0.5rem",color:"var(--color-text-0)"}),go=o("p").withConfig({componentId:"sc-197pkz3-0"})({color:"var(--color-text-0)"}),xe=(t=>(t.Rank="Rank",t.Trader="Trader",t.TotalLosses="TotalLosses",t))(xe||{});const vo=()=>{const t=u(),{data:a,isLoading:i}=jt(),{dydxAddress:n}=W(),s=T(le),l=S.useCallback(d=>d.rank,[]),c=Object.values(xe).map(d=>yo({key:d,stringGetter:t,dydxAddress:n})),p=(a??[]).map(d=>({rank:d.rank,account:d.address,totalLosses:parseFloat(d.total_liquidation_losses)})),f=()=>{if(p.length===0)return;const d=p.map(m=>({rank:m.rank,address:m.account,totalLiquidationLosses:m.totalLosses}));X(d,{filename:`liquidation-leaderboard-${new Date().toLocaleDateString(s,{month:"short",year:"numeric"})}`,columnHeaders:[{key:"rank",displayLabel:t({key:r.RANK})},{key:"address",displayLabel:t({key:r.TRADER})},{key:"totalLiquidationLosses",displayLabel:t({key:r.LIQUIDATION_LOSSES})}]})};return e.jsx(ho,{children:e.jsxs(xo,{children:[e.jsxs(bo,{children:[e.jsx(So,{children:"Liquidation Rebates"}),e.jsx("button",{onClick:f,type:"button","aria-label":t({key:r.DOWNLOAD}),children:e.jsx(Io,{size:"1.25rem",iconName:I.Download})})]}),e.jsx(_o,{children:e.jsx(uo,{label:t({key:r.LEADERBOARD}),data:p,tableId:"trading-rewards",getRowKey:l,columns:c,defaultSortDescriptor:{column:"Rank",direction:"ascending"},getIsRowPinned:d=>
1d.account===n,slotEmpty:i?e.jsx(G,{id:"rewards-leaderboard"}):e.jsxs(wo,{children:[e.jsx(Co,{iconName:I.OrderPending}),t({key:r.TRADING_REWARD_TABLE_EMPTY_STATE})]}),getRowAttributes:({account:d})=>({style:{backgroundColor:d===n?"var(--color-accent-faded)":void 0}}),selectionBehavior:"replace",withInnerBorders:!0,initialPageSize:10,withScrollSnapColumns:!0,withScrollSnapRows:!0})})]})})},ho=o(C).withConfig({componentId:"sc-1ipz9fd-0"})(["--panel-content-paddingY:1.5rem;--panel-content-paddingX:1.5rem;"]),uo=o(Y).withConfig({componentId:"sc-1ipz9fd-1"})(["--tableCell-padding:0.25rem;font:var(--font-mini-book);--stickyArea-background:transparent;table{--stickyArea-background:transparent;}thead,tbody{--stickyArea-background:transparent;tr{td:first-of-type,th:first-of-type{--tableCell-padding:0.5rem 0.25rem 0.5rem 1rem;}td:last-of-type,th:last-of-type{--tableCell-padding:0.5rem 1rem 0.5rem 0.25rem;}}}tbody{font:var(--font-small-book);}tfoot{--stickyArea-background:transparent;--tableCell-padding:0.5rem 1rem 0.5rem 1rem;}min-width:1px;tbody{font:var(--font-small-book);}"]),yo=({key:t,stringGetter:a,dydxAddress:i})=>({...{Rank:{columnKey:"Rank",getCellValue:n=>n.rank,label:e.jsx(Ro,{children:a({key:r.RANK})}),renderCell:({rank:n,account:s})=>e.jsxs(jo,{children:[e.jsx(Ao,{children:e.jsx(Do,{children:n})}),n===1&&e.jsx(ko,{}),n===2&&e.jsx(To,{}),n===3&&e.jsx(Eo,{}),s===i&&e.jsx(Lo,{children:e.jsx($o,{children:a({key:r.YOU})})})]})},Trader:{columnKey:"Trader",getCellValue:n=>n.account,label:e.jsx(Wo,{children:a({key:r.TRADER})}),renderCell:({account:n})=>e.jsx(zo,{value:n,buttonType:"text",$_css:[{display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"},{color:n===i?"var(--color-accent)":"var(--color-text-1)"}],children:F(n)})},TotalLosses:{columnKey:"TotalLosses",getCellValue:n=>n.totalLosses,label:e.jsx(Oo,{children:"Total Liquidation Losses"}),renderCell:({totalLosses:n})=>e.jsx(No,{type:j.Fiat,value:n})}}[t]});var xo=o("div").withConfig({componentId:"sc-1ipz9fd-2"})({display:"flex",flexDirection:"column",gap:"1rem"}),bo=o("div").withConfig({componentId:"sc-1ipz9fd-3"})({display:"flex",alignItems:"center",justifyContent:"space-between"}),So=o("div").withConfig({componentId:"sc-1ipz9fd-4"})({font:"var(--font-medium-bold)"}),Io=o(_).withConfig({componentId:"sc-1ipz9fd-5"})({color:"var(--color-text-0)"}),_o=o("div").withConfig({componentId:"sc-1ipz9fd-6"})({overflow:"hidden",borderRadius:"0.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)"}),wo=o("div").withConfig({componentId:"sc-1ipz9fd-7"})({display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"}),Co=o(_).withConfig({componentId:"sc-1ipz9fd-8"})({fontSize:"3em"}),Ro=o("div").withConfig({componentId:"sc-1ipz9fd-9"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),jo=o("div").withConfig({componentId:"sc-1ipz9fd-10"})({display:"flex",gap:"0.5rem"}),Ao=o("div").withConfig({componentId:"sc-1ipz9fd-11"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)",padding:"0.5rem"}),Do=o("div").withConfig({componentId:"sc-1ipz9fd-12"})({display:"flex",height:"0.5rem",minWidth:"0.5rem",alignItems:"center",justifyContent:"center",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"}),ko=o(w).withConfig({componentId:"sc-1ipz9fd-13"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(229 195 70 / var(--tw-text-opacity, 1))"}),To=o(w).withConfig({componentId:"sc-1ipz9fd-14"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(201 201 203 / var(--tw-text-opacity, 1))"}),Eo=o(w).withConfig({componentId:"sc-1ipz9fd-15"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(195 123 63 / var(--tw-text-opacity, 1))"}),Lo=o("div").withConfig({componentId:"sc-1ipz9fd-16"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-accent)",paddingLeft:"0.5rem",paddingRight:"0.5rem"}),$o=o("span").withConfig({componentId:"sc-1ipz9fd-17"})({fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-accent)"}),Wo=o("div").withConfig({componentId:"sc-1ipz9fd-18"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),zo=o(Q).withConfig({componentId:"sc-1ipz9fd-19"})(["",""],t=>t.$_css),Oo=o("div").withConfig({componentId:"sc-1ipz9fd-20"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),No=o(k).withConfig({componentId:"sc-1ipz9fd-21"})({fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-negative)"});const Po=()=>e.jsx(Bo,{}),Bo=()=>{const t=u(),a=new Date,i=(a.getUTCFullYear()-2025)*12+(a.getUTCMonth()-11)+1,n=(()=>{const s=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+1,
11,0,0,0,0));return s.setTime(s.getTime()-1),s.toISOString()})();return e.jsx(Ho,{children:e.jsxs(qo,{children:[e.jsxs(Fo,{children:[e.jsxs(Vo,{children:[e.jsxs(Go,{children:[e.jsx(Yo,{children:e.jsx(Qo,{children:t({key:r.COMPETITION_HEADLINE_DEC_2025_UPDATE_1,params:{REWARD_AMOUNT:$e.rewardAmount}})})}),e.jsx(Je,{size:et.Medium,children:t({key:r.ACTIVE})})]}),e.jsxs("div",{children:[e.jsx(Xo,{children:t({key:r.COMPETITION_BODY_1_DEC_2025,params:{PROGRAM_LINK:e.jsx(A,{href:"https://www.mintscan.io/dydx/proposals/321",isInline:!0,children:t({key:r.COMPETITION_BODY_1_DEC_2025_LINK_TEXT})})}})}),e.jsx(Zo,{children:t({key:r.COMPETITION_BODY_2_DEC_2025,params:{HERE_LINK:e.jsx(A,{href:"https://www.dydx.xyz/liquidation-rebates",isInline:!0,children:t({key:r.HERE})})}})})]})]}),e.jsxs(Jo,{children:[e.jsx(en,{iconName:I.Clock,size:"1.25rem"}),e.jsxs(tn,{children:[e.jsxs(on,{children:[t({key:r.MONTH_COUNTDOWN,params:{MONTH:i}}),":"]}),e.jsx(Uo,{endTime:n})]})]})]}),e.jsx(Mo,{})]})})},Mo=()=>{const t=u(),{dydxAddress:a}=W(),{data:i,isLoading:n}=ue(),s=i?.find(l=>l.address===a)?.dollarReward??0;return e.jsxs(nn,{children:[e.jsxs(rn,{style:{backgroundImage:"url('/dots-background-3.svg')",backgroundSize:"cover"},children:[e.jsxs(an,{children:[e.jsx(ot,{tooltipString:t({key:r.SURGE_EST_AMOUNT_TOOLTIP}),slotTrigger:e.jsxs(dn,{children:[t({key:r.ESTIMATED_PRIZE}),e.jsx(_,{iconName:I.InfoStroke})]})}),e.jsx(Ko,{children:e.jsx(sn,{type:j.Fiat,value:s,isLoading:n})})]}),e.jsx(ln,{src:"/rewards-stars.svg",alt:"reward-stars"})]}),e.jsxs(cn,{children:[t({key:r.POWERED_BY_ALL_CAPS})," ",e.jsx(mn,{href:"https://cryptolearningclub.org/",isAccent:!0,title:"Crypto Learning Club",children:"CLC"})]})]})},Uo=({endTime:t})=>{const a=Date.parse(t),i=tt(),[n,s]=S.useState(Math.max(0,Math.floor(a-Date.now())));S.useEffect(()=>{if(i>a)return;const c=Math.max(0,Math.floor(a-i));s(c)},[i,a]);const l=S.useMemo(()=>We.fromMillis(n).shiftTo("days","hours","minutes","seconds").toFormat("d'd' h'h' m'm' s's'",{floor:!0}),[n]);return e.jsx("div",{children:l})},Ho=o(C).withConfig({componentId:"sc-bf801l-0"})({width:"100%",backgroundColor:"var(--color-layer-3)"}),Ko=o.span.withConfig({componentId:"sc-bf801l-1"})([""," gap:0.25rem;font:var(--font-large-book);color:var(--color-text-0);output{color:var(--color-text-2);}"],D.inlineRow);var qo=o("div").withConfig({componentId:"sc-bf801l-2"})({display:"flex",gap:"3rem",paddingBottom:"0.25rem",paddingTop:"0.5rem"}),Fo=o("div").withConfig({componentId:"sc-bf801l-3"})({display:"flex",flexDirection:"column",gap:"1.5rem"}),Vo=o("div").withConfig({componentId:"sc-bf801l-4"})({display:"flex",flexDirection:"column",gap:"0.5rem"}),Go=o("div").withConfig({componentId:"sc-bf801l-5"})({display:"flex",alignItems:"center",gap:"0.5rem"}),Yo=o("div").withConfig({componentId:"sc-bf801l-6"})({font:"var(--font-medium-bold)"}),Qo=o("span").withConfig({componentId:"sc-bf801l-7"})({fontWeight:"var(--fontWeight-bold)"}),Xo=o("p").withConfig({componentId:"sc-bf801l-8"})({marginBottom:"0.5rem",color:"var(--color-text-0)"}),Zo=o("p").withConfig({componentId:"sc-bf801l-9"})({color:"var(--color-text-0)"}),Jo=o("div").withConfig({componentId:"sc-bf801l-10"})({display:"flex",alignItems:"center",gap:"0.25rem",alignSelf:"flex-start",borderRadius:"3rem",backgroundColor:"var(--color-layer-1)",paddingLeft:"0.875rem",paddingRight:"0.875rem",paddingTop:"0.5rem",paddingBottom:"0.5rem"}),en=o(_).withConfig({componentId:"sc-bf801l-11"})({color:"var(--color-accent)"}),tn=o("div").withConfig({componentId:"sc-bf801l-12"})({display:"flex",gap:"0.375rem"}),on=o("div").withConfig({componentId:"sc-bf801l-13"})({color:"var(--color-accent)"}),nn=o("div").withConfig({componentId:"sc-bf801l-14"})({display:"flex",flexDirection:"column",justifyContent:"space-between",gap:"0.75rem",alignSelf:"stretch"}),rn=o("div").withConfig({componentId:"sc-bf801l-15"})({display:"flex",gap:"4rem",borderRadius:"0.75rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-accent-faded)",backgroundColor:"var(--color-accent-more-faded)",padding:"1rem"}),an=o("div").withConfig({componentId:"sc-bf801l-16"})({display:"flex",flexDirection:"column",gap:"0.5rem"}),dn=o("div").withConfig({componentId:"sc-bf801l-17"})({display:"flex",flexDirection:"row",alignItems:"center",cursor:"help",gap:"0.5rem",textWrap:"nowrap",fontWeight:"var(--fontWeight-medium)",color:"var(--color-accent)",textDecorationLine:"none"}),sn=o(k).withConfig({componentId:"sc-bf801l-18"})({fontSize:"var(--fontSize-extra)",font:"var(--font-extra-bold)"}),ln=o("img").withConfig({componentId:"sc-bf801l-19"})({height:"auto",width:"2rem",alignSelf:"flex-start"}),cn=o("div").withConfig({componentId:"sc-bf801l-20"})({display:"flex",alignItems:"center",gap:"0.5em",alignSelf:"flex-end",font:"var(--font-tiny-medium)"}
1),mn=o(A).withConfig({componentId:"sc-bf801l-21"})({font:"var(--font-small-bold)"}),y="Accordion",pn=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Z,fn,gn]=it(y),[z]=nt(y,[gn,pe]),J=pe(),be=v.forwardRef((t,a)=>{const{type:i,...n}=t,s=n,l=n;return e.jsx(Z.Provider,{scope:t.__scopeAccordion,children:i==="multiple"?e.jsx(yn,{...l,ref:a}):e.jsx(un,{...s,ref:a})})});be.displayName=y;var[Se,vn]=z(y),[Ie,hn]=z(y,{collapsible:!1}),un=v.forwardRef((t,a)=>{const{value:i,defaultValue:n,onValueChange:s=()=>{},collapsible:l=!1,...c}=t,[p,f]=ge({prop:i,defaultProp:n??"",onChange:s,caller:y});return e.jsx(Se,{scope:t.__scopeAccordion,value:v.useMemo(()=>p?[p]:[],[p]),onItemOpen:f,onItemClose:v.useCallback(()=>l&&f(""),[l,f]),children:e.jsx(Ie,{scope:t.__scopeAccordion,collapsible:l,children:e.jsx(_e,{...c,ref:a})})})}),yn=v.forwardRef((t,a)=>{const{value:i,defaultValue:n,onValueChange:s=()=>{},...l}=t,[c,p]=ge({prop:i,defaultProp:n??[],onChange:s,caller:y}),f=v.useCallback(m=>p((g=[])=>[...g,m]),[p]),d=v.useCallback(m=>p((g=[])=>g.filter(R=>R!==m)),[p]);return e.jsx(Se,{scope:t.__scopeAccordion,value:c,onItemOpen:f,onItemClose:d,children:e.jsx(Ie,{scope:t.__scopeAccordion,collapsible:!0,children:e.jsx(_e,{...l,ref:a})})})}),[xn,O]=z(y),_e=v.forwardRef((t,a)=>{const{__scopeAccordion:i,disabled:n,dir:s,orientation:l="vertical",...c}=t,p=v.useRef(null),f=dt(p,a),d=fn(i),g=st(s)==="ltr",R=lt(t.onKeyDown,x=>{if(!pn.includes(x.key))return;const h=x.target,N=d().filter(H=>!H.ref.current?.disabled),E=N.findIndex(H=>H.ref.current===h),te=N.length;if(E===-1)return;x.preventDefault();let b=E;const P=0,B=te-1,M=()=>{b=E+1,b>B&&(b=P)},U=()=>{b=E-1,b<P&&(b=B)};switch(x.key){case"Home":b=P;break;case"End":b=B;break;case"ArrowRight":l==="horizontal"&&(g?M():U());break;case"ArrowDown":l==="vertical"&&M();break;case"ArrowLeft":l==="horizontal"&&(g?U():M());break;case"ArrowUp":l==="vertical"&&U();break}const Ee=b%te;N[Ee].ref.current?.focus()});return e.jsx(xn,{scope:i,disabled:n,direction:s,orientation:l,children:e.jsx(Z.Slot,{scope:i,children:e.jsx(fe.div,{...c,"data-orientation":l,ref:f,onKeyDown:n?void 0:R})})})}),$="AccordionItem",[bn,ee]=z($),we=v.forwardRef((t,a)=>{const{__scopeAccordion:i,value:n,...s}=t,l=O($,i),c=vn($,i),p=J(i),f=rt(),d=n&&c.value.includes(n)||!1,m=l.disabled||t.disabled;return e.jsx(bn,{scope:i,open:d,disabled:m,triggerId:f,children:e.jsx(at,{"data-orientation":l.orientation,"data-state":ke(d),...p,...s,ref:a,disabled:m,open:d,onOpenChange:g=>{g?c.onItemOpen(n):c.onItemClose(n)}})})});we.displayName=$;var Ce="AccordionHeader",Re=v.forwardRef((t,a)=>{const{__scopeAccordion:i,...n}=t,s=O(y,i),l=ee(Ce,i);return e.jsx(fe.h3,{"data-orientation":s.orientation,"data-state":ke(l.open),"data-disabled":l.disabled?"":void 0,...n,ref:a})});Re.displayName=Ce;var q="AccordionTrigger",je=v.forwardRef((t,a)=>{const{__scopeAccordion:i,...n}=t,s=O(y,i),l=ee(q,i),c=hn(q,i),p=J(i);return e.jsx(Z.ItemSlot,{scope:i,children:e.jsx(ct,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...p,...n,ref:a})})});je.displayName=q;var Ae="AccordionContent",De=v.forwardRef((t,a)=>{const{__scopeAccordion:i,...n}=t,s=O(y,i),l=ee(Ae,i),c=J(i);return e.jsx(mt,{role:"region","aria-labelledby":l.triggerId,"data-orientation":s.orientation,...c,...n,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});De.displayName=Ae;function ke(t){return t?"open":"closed"}var Sn=be,In=we,_n=Re,wn=je,Cn=De;const Rn=({items:t,className:a,triggerIcon:i,triggerRotation:n})=>e.jsx(jn,{className:a,type:"single",collapsible:!0,children:t.map(({header:s,content:l},c)=>e.jsxs(In,{value:c.toString(),children:[e.jsx(_n,{children:e.jsxs(An,{$triggerRotation:n,children:[s,i??e.jsx(L,{children:e.jsx(_,{iconName:I.Plus,size:"1.125em"})})]})}),e.jsx(Dn,{children:l})]},c))}),jn=o(Sn).withConfig({componentId:"sc-165busm-0"})(["--accordion-paddingY:1rem;--accordion-paddingX:1rem;@media ","{--accordion-paddingX:1.5rem;}> *:not(:last-child){border-bottom:var(--border-width) solid var(--border-color);}"],ve.notTablet),L=o.div.withConfig({componentId:"sc-165busm-1"})(["display:inline-flex;justify-content:center;align-items:center;width:2.25rem;height:2.25rem;
1--color-border:var(--color-layer-6);color:var(--color-text-1);background-color:var(--color-layer-5);border:solid var(--border-width) var(--color-border);border-radius:50%;font:var(--font-small-book);"]),An=o(wn).withConfig({componentId:"sc-165busm-2"})(["display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--accordion-paddingY) var(--accordion-paddingX);gap:0.5rem;color:var(--color-text-1);text-align:start;&:hover{","{color:var(--color-text-2);filter:brightness(var(--hover-filter-base));}}","{color:var(--color-text-0);transition:transform 0.3s var(--ease-out-expo);}&[data-state='open'] ","{transform:",";}"],L,L,L,({$triggerRotation:t})=>`rotate(${t??45}deg)`),Dn=o(Cn).withConfig({componentId:"sc-165busm-3"})(["overflow:hidden;margin:0 var(--accordion-paddingX) var(--accordion-paddingY);color:var(--color-text-0);&[data-state='open']{animation:"," 0.3s var(--ease-out-expo);}&[data-state='closed']{animation:"," 0.1s var(--ease-in-expo);}"],oe(["from{height:0;}to{height:var(--radix-accordion-content-height);}"]),oe(["from{height:var(--radix-accordion-content-height);}to{height:0;}"])),ie=()=>{const t=u(),{protocolStaking:a,tradingRewardsLearnMore:i,stakingAndClaimingRewardsLearnMore:n}=pt(),s=l=>e.jsx(A,{isAccent:!0,isInline:!0,href:l,children:t({key:r.HERE})});return e.jsx(kn,{slotHeader:e.jsxs(Tn,{children:[e.jsx("h3",{children:t({key:r.HELP})}),i&&e.jsx(A,{withIcon:!0,href:i,children:t({key:r.LEARN_MORE})})]}),children:e.jsx(Rn,{items:[{header:t({key:r.FAQ_WHO_IS_ELIGIBLE_FOR_SURGE_REWARDS_QUESTION}),content:t({key:r.FAQ_WHO_IS_ELIGIBLE_FOR_SURGE_REWARDS_ANSWER})},{header:t({key:r.FAQ_HOW_DO_SURGE_REWARDS_WORK_QUESTION}),content:t({key:r.FAQ_HOW_DO_SURGE_REWARDS_WORK_ANSWER})},{header:t({key:r.FAQ_HOW_DO_I_CLAIM_MY_SURGE_REWARDS_QUESTION}),content:t({key:r.FAQ_HOW_DO_I_CLAIM_MY_SURGE_REWARDS_ANSWER})},{header:t({key:r.FAQ_WHAT_IS_STAKING_QUESTION}),content:t({key:r.FAQ_WHAT_IS_STAKING_ANSWER,params:{HERE_LINK:s(a)}})},{header:t({key:r.FAQ_HOW_DO_I_STAKE_AND_CLAIM_REWARDS_QUESTION}),content:t({key:r.FAQ_HOW_DO_I_STAKE_AND_CLAIM_REWARDS_ANSWER,params:{HERE_LINK:s(n)}})},{header:t({key:r.FAQ_WHAT_ARE_THE_RISKS_OF_STAKING_QUESTION}),content:t({key:r.FAQ_WHAT_ARE_THE_RISKS_OF_STAKING_ANSWER})}]})})},kn=o(C).withConfig({componentId:"sc-t4m96x-0"})(["--panel-content-paddingX:0;--panel-content-paddingY:0;width:100%;height:max-content;padding:0;gap:0;text-align:start;"]),Tn=o.div.withConfig({componentId:"sc-t4m96x-1"})([""," gap:1ch;padding:1rem 1rem;border-bottom:var(--border-width) solid var(--border-color);font:var(--font-base-book);@media ","{padding:1.5rem;}h3{font:var(--font-medium-book);color:var(--color-text-2);}"],D.spacedRow,ve.notTablet);var Te=(t=>(t.Rank="Rank",t.Trader="Trader",t.Rewards="Rewards",t))(Te||{});const En=()=>{const t=u(),{dydxAddress:a}=W(),i=T(ze.rewardParams.data).tokenPrice,{data:n,isLoading:s}=At({address:a}),l=S.useMemo(()=>n?.leaderboard.map(d=>Dt(d,i)),[n?.leaderboard,i]),c=S.useCallback(d=>d.rank,[]),p=Object.values(Te).map(d=>Wn({key:d,stringGetter:t,dydxAddress:a})),f=()=>{if(!l)return;const d=l?.map(m=>({rank:m.rank,address:m.address,estimatedRewards:m.estimatedDydxRewards}));X(d,{filename:`rewards-leaderboard-season-${Oe.season}`,columnHeaders:[{key:"rank",displayLabel:t({key:r.RANK})},{key:"address",displayLabel:t({key:r.TRADER})},{key:"estimatedRewards",displayLabel:t({key:r.ESTIMATED_REWARDS})}]})};return e.jsx(Ln,{children:e.jsxs(zn,{children:[e.jsxs(On,{children:[e.jsx(Nn,{children:t({key:r.SURGE_LEADERBOARD_TITLE})}),e.jsx("button",{onClick:f,type:"button","aria-label":t({key:r.DOWNLOAD}),children:e.jsx(Pn,{size:"1.25rem",iconName:I.Download})})]}),e.jsx(Bn,{children:e.jsx($n,{label:t({key:r.LEADERBOARD}),data:l??[],tableId:"trading-rewards",getRowKey:c,columns:p,defaultSortDescriptor:{column:"Rank",direction:"ascending"},getIsRowPinned:d=>d.address===a,slotEmpty:s?e.jsx(G,{id:"rewards-leaderboard"}):e.jsxs(Mn,{children:[e.jsx(Un,{iconName:I.OrderPending}),t({key:r.TRADING_REWARD_TABLE_EMPTY_STATE})]}),getRowAttributes:({address:d})=>({style:{backgroundColor:d===a?"var(--color-accent-faded)":void 0}}),selectionBehavior:"replace",withInnerBorders:!0,initialPageSize:10,withScrollSnapColumns:!0,withScrollSnapRows:!0})})]})})},Ln=o(C).withConfig({componentId:"sc-s1lto0-0"})(["--panel-content-paddingY:1.5rem;--panel-content-paddingX:1.5rem;"]),$n=o(Y).withConfig({componentId:"sc-s1lto0-1"})(["--tableCell-padding:0.25rem;font:var(--font-mini-book);--stickyArea-background:transparent;table{--stickyArea-background:transparent;}thead,tbody{--stickyArea-background:transparent;tr{td:first-of-type,th:first-of-type{--tableCell-padding:0.5rem 0.25rem 0.5rem 1rem;}td:last-of-type,th:last-of-type{--tableCell-padding:0.5rem 1rem 0.5rem 0.25rem;}}}tbody{font:var(--font-small-book);}tfoot{--stickyArea-background:transparent;--tableCell-padding:0.5rem 1rem 0.5rem 1rem;}min-width:1px;tbody{font:var(--font-small-book);}"]),Wn=({key:t,stringGetter:a,dydxAddress:i})=>({...{Rank:{columnKey:"Rank",getCellValue:n=>n.rank,label:e.jsx(Hn,{children:a({key:r.RANK})}),renderCell:({rank:n,address:s})=>
1e.jsxs(Kn,{children:[e.jsx(qn,{children:e.jsx(Fn,{children:n})}),n===1&&e.jsx(Vn,{}),n===2&&e.jsx(Gn,{}),n===3&&e.jsx(Yn,{}),s===i&&e.jsx(Qn,{children:e.jsx(Xn,{children:a({key:r.YOU})})})]})},Trader:{columnKey:"Trader",getCellValue:n=>n.address,label:e.jsx(Zn,{children:a({key:r.TRADER})}),renderCell:({address:n})=>e.jsx(Jn,{value:n,buttonType:"text",$_css:[{display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"},{color:n===i?"var(--color-accent)":"var(--color-text-1)"}],children:F(n)})},Rewards:{columnKey:"Rewards",getCellValue:n=>n.estimatedDydxRewards,label:e.jsx(er,{children:a({key:r.ESTIMATED_REWARDS})}),renderCell:({estimatedDydxRewards:n,address:s})=>e.jsx(tr,{slotRight:" DYDX",type:j.Number,value:Number.isNaN(Number(n))?0:n,$_css2:[{color:s===i?"var(--color-accent)":"var(--color-text-1)"},{fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"}]})}}[t]});var zn=o("div").withConfig({componentId:"sc-s1lto0-2"})({display:"flex",flexDirection:"column",gap:"1rem"}),On=o("div").withConfig({componentId:"sc-s1lto0-3"})({display:"flex",alignItems:"center",justifyContent:"space-between"}),Nn=o("div").withConfig({componentId:"sc-s1lto0-4"})({font:"var(--font-medium-bold)"}),Pn=o(_).withConfig({componentId:"sc-s1lto0-5"})({color:"var(--color-text-0)"}),Bn=o("div").withConfig({componentId:"sc-s1lto0-6"})({overflow:"hidden",borderRadius:"0.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)"}),Mn=o("div").withConfig({componentId:"sc-s1lto0-7"})({display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"}),Un=o(_).withConfig({componentId:"sc-s1lto0-8"})({fontSize:"3em"}),Hn=o("div").withConfig({componentId:"sc-s1lto0-9"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),Kn=o("div").withConfig({componentId:"sc-s1lto0-10"})({display:"flex",gap:"0.5rem"}),qn=o("div").withConfig({componentId:"sc-s1lto0-11"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-border)",padding:"0.5rem"}),Fn=o("div").withConfig({componentId:"sc-s1lto0-12"})({display:"flex",height:"0.5rem",minWidth:"0.5rem",alignItems:"center",justifyContent:"center",fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)"}),Vn=o(w).withConfig({componentId:"sc-s1lto0-13"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(229 195 70 / var(--tw-text-opacity, 1))"}),Gn=o(w).withConfig({componentId:"sc-s1lto0-14"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(201 201 203 / var(--tw-text-opacity, 1))"}),Yn=o(w).withConfig({componentId:"sc-s1lto0-15"})({width:"1.5rem",height:"1.5rem","--tw-text-opacity":"1",color:"rgb(195 123 63 / var(--tw-text-opacity, 1))"}),Qn=o("div").withConfig({componentId:"sc-s1lto0-16"})({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"20rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--color-accent)",paddingLeft:"0.5rem",paddingRight:"0.5rem"}),Xn=o("span").withConfig({componentId:"sc-s1lto0-17"})({fontSize:"var(--fontSize-small)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-accent)"}),Zn=o("div").withConfig({componentId:"sc-s1lto0-18"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),Jn=o(Q).withConfig({componentId:"sc-s1lto0-19"})(["",""],t=>t.$_css),er=o("div").withConfig({componentId:"sc-s1lto0-20"})({paddingTop:"0.375rem",paddingBottom:"0.375rem",fontSize:"var(--fontSize-base)",fontWeight:"var(--fontWeight-medium)",color:"var(--color-text-0)"}),tr=o(k).withConfig({componentId:"sc-s1lto0-21"})(["",""],t=>t.$_css2);const or=({usdcRewards:t})=>{const a=Ne(),i=u(),n=T(Pe),s=T(Be),{validators:l}=ce.useStakingRewards().data??{},{usdcImage:c}=V(),p=S.useCallback(()=>a(Me(Ue.StakingReward({validators:l??[],usdcRewards:t}))),[a,l,t]);return e.jsx(rr,{backgroundImagePath:s,slotHeader:e.jsx(nr,{children:i({key:r.STAKING_REWARDS_AVAILABLE})}),slotRight:n&&e.jsx(dr,{action:vt.Primary,size:gt.Base,onClick:p,children:i({key:r.CLAIM})}),children:e.jsxs(ar,{children:[e.jsx(ir,{type:j.Asset,value:t,showSign:ft.Both,fractionDigits:He}),e.jsx(he,{logoUrl:c,symbol:"USDC"})]})})},nr=o.h3.withConfig({componentId:"sc-xkmm5l-0"})(["padding:var(--panel-paddingY) var(--panel-paddingX) 0;font:var(--font-medium-book);z-index:1;"]),rr=o(C).withConfig({componentId:"sc-xkmm5l-1"}
1)(["--gradient-start-color:var(--color-layer-5);"," position:relative;&::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:var(--panel-border-radius);background:var(--gradient-start-color);mask-image:linear-gradient(270deg,transparent,var(--gradient-start-color) 60%);}"],({backgroundImagePath:t})=>Ke(["background:url(","),linear-gradient(270deg,var(--color-positive-dark),var(--gradient-start-color) 60%);"],t)),ar=o.span.withConfig({componentId:"sc-xkmm5l-2"})([""," height:100%;--asset-icon-size:1.3rem;"],D.inlineRow),ir=o(k).withConfig({componentId:"sc-xkmm5l-3"})(["--output-sign-color:var(--color-positive);color:var(--color-text-2);font:var(--font-large-book);"]);var dr=o(ht).withConfig({componentId:"sc-xkmm5l-4"})({zIndex:"1",marginRight:"var(--panel-paddingX)"});const de=()=>{const t=u(),a=ut(),{unbondingValidators:i}=yt(),{chainTokenDecimals:n,chainTokenImage:s,chainTokenLabel:l}=V();return a?.length?e.jsx(cr,{children:a.map(c=>{const p=new Date(c.completionTime).getTime(),f=new Date().getTime(),d=p-f,m=Math.floor(d/K.day),g=Math.floor(d/K.hour),R=Math.floor(d/K.minute),x=m>1?t({key:r.AVAILABLE_IN_DAYS,params:{DAYS:m}}):g>=1?t({key:r.AVAILABLE_IN,params:{DURATION:t({key:r.X_HOURS_LOWERCASED,params:{X:g}})}}):t({key:r.AVAILABLE_IN,params:{DURATION:t({key:r.X_MINUTES_LOWERCASED,params:{X:R}})}}),h=i?.[c.validatorAddress]?.[0];return e.jsx(C,{slotHeader:e.jsxs(sr,{children:[e.jsx(lr,{children:t({key:r.UNSTAKING_FROM,params:{VALIDATOR:h?.description?.moniker}})}),e.jsx(xt,{url:h?.description?.website,fallbackText:h?.description?.moniker})]}),children:e.jsxs(mr,{children:[e.jsx(fr,{type:j.Asset,value:qe(BigInt(c.balance),n),slotRight:e.jsx(pr,{logoUrl:s,symbol:l})}),e.jsx(gr,{children:x})]})},`${c.validatorAddress}-${c.completionTime}`)})}):null},sr=o.div` 2 ${D.spacedRow} 3 padding: var(--panel-paddingY) var(--panel-paddingX) 0; 4`,lr=o.h3` 5 ${D.inlineRow} 6 ${D.textTruncate} 7 8 font: var(--font-medium-book); 9 color: var(--color-text-1); 10`;var cr=o("div")({display:"flex",flexDirection:"column",minWidth:"0",gap:"1.5rem"}),mr=o("div")({display:"flex",flexDirection:"column",minWidth:"0",gap:"1rem"}),pr=o(he)({marginLeft:"0.5rem"}),fr=o(k)({color:"var(--color-text-2)",font:"var(--font-large-book)"}),gr=o("div").withConfig({componentId:"sc-g6k97h-0"})({color:"var(--color-text-0)"});const Pr=()=>{const t=u(),a=Fe(),{complianceState:i}=bt(),{isTablet:n}=St(),s=kt(),{usdcDenom:l}=V(),[c,p]=S.useState(s?"LiquidationRebates":"Rewards"),{totalRewards:f}=Ve(ce.useStakingRewards().data),d=Ge.sumBy((f??Ye).filter(h=>h.denom===l&&h.amount),h=>h.amount),m=i!==_t.FULL_ACCESS,g=d>0&&!m,R=e.jsx(or,{usdcRewards:d}),x=e.jsx(yr,{children:t({key:r.TRADING_REWARDS_LEGAL_DISCLAIMER,params:{TERMS_OF_USE_LINK:e.jsx(me,{isInline:!0})}})});return e.jsx(vr,{children:n?e.jsxs("div",{children:[e.jsx(Rt,{title:t({key:r.TRADING_REWARDS}
10),slotLeft:e.jsx(It,{onClick:()=>a(Qe.Profile)})}),e.jsxs(se,{children:[m&&e.jsx(ae,{}),g&&R,e.jsx(ne,{}),e.jsx(de,{}),e.jsx(re,{}),e.jsx(ie,{}),x]})]}):e.jsx(se,{children:e.jsxs(xr,{children:[e.jsx(ur,{fullWidthTabs:!0,dividerStyle:"underline",value:c,onValueChange:h=>{p(h)},items:s?[{content:e.jsxs(br,{children:[e.jsx(ro,{}),e.jsx(vo,{})]}),label:t({key:r.LIQUIDATION_REBATES}),value:"LiquidationRebates"}]:[{content:e.jsxs(Sr,{children:[e.jsx(re,{}),e.jsx(En,{})]}),label:t({key:r.REWARDS}),value:"Rewards"},{content:e.jsxs(Ir,{children:[e.jsx(Po,{}),e.jsx(Tt,{})]}),label:t({key:r.REBATES}),value:"Competition"}],withTransitions:!1}),e.jsxs(_r,{children:[m&&e.jsx(ae,{}),g&&R,e.jsx(ne,{}),e.jsx(de,{}),e.jsx(ie,{}),x]})]})})})},vr=o.div.withConfig({componentId:"sc-iy5ebj-0"})(["",""],D.contentContainerPage),se=o(Ct).withConfig({componentId:"sc-iy5ebj-1"})({display:"flex",maxWidth:"80rem",flexDirection:"column",gap:"1.5rem",padding:"1rem","@media (max-width: 64rem)":{width:"100vw"}}),hr=o(wt).withConfig({componentId:"sc-iy5ebj-2"})(["--trigger-active-underline-backgroundColor:var(--color-layer-2);"]);var ur=o(hr).withConfig({componentId:"sc-iy5ebj-3"})({flex:"2"}),yr=o("div").withConfig({componentId:"sc-iy5ebj-4"})({color:"var(--color-text-0)",font:"var(--font-mini-book)"}),xr=o("div").withConfig({componentId:"sc-iy5ebj-5"})({display:"flex",gap:"1.5rem"}),br=o("div").withConfig({componentId:"sc-iy5ebj-6"})({display:"flex",flexDirection:"column",minWidth:"0",gap:"1.5rem"}),Sr=o("div").withConfig({componentId:"sc-iy5ebj-7"})({display:"flex",flexDirection:"column",minWidth:"0",gap:"1.5rem"}),Ir=o("div").withConfig({componentId:"sc-iy5ebj-8"})({display:"flex",flexDirection:"column",minWidth:"0",gap:"1.5rem"}),_r=o("div").withConfig({componentId:"sc-iy5ebj-9"})({display:"flex",flexDirection:"column",minWidth:"0",flex:"1 1 0%",gap:"1.5rem"});export{Pr 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.