PageSourceSearch

https://www.speedrunapp.com/assets/xp-summary-BeariHrA.js

js speedrunapp.com collected 2026-10-07 22:37:08 UTC 6,539 bytes, 1 lines download raw bytes

1import{j as e}from"./markdown-BXfohX-5.js";import{r as s,u as t}from"./ui-utils-C1rVVF17.js";import{u as a,f as r,H as n,R as l,C as i,S as o}from"./Sidebar-e6ka033K.js";import{d as c,o as d,v as m,e as p,f as u,r as x,u as f,c as g,s as j}from"./constants-BBB3i-qT.js";import{F as w}from"./Footer-B1qIaqo9.js";import{H as h}from"./Heading-DAGxg877.js";import{X as y}from"./XpBreakdownCard-CLukyz07.js";import{b,g as N}from"./background-D_l8dy4N.js";import{t as v}from"./theme-BUoCvDZk.js";import"./utils-CJ9cKvh6.js";import"./auth-kit-DsbJR9YV.js";import"./index-XrPMGToq.js";const k={as:{type:"enum",values:["div","span"],default:"div"},...d,display:{type:"enum",className:"rt-r-display",values:["none","inline-grid","grid"],responsive:!0},areas:{type:"string",className:"rt-r-gta",customProperties:["--grid-template-areas"],responsive:!0},columns:{type:"enum | string",className:"rt-r-gtc",customProperties:["--grid-template-columns"],values:["1","2","3","4","5","6","7","8","9"],parseValue:S,responsive:!0},rows:{type:"enum | string",className:"rt-r-gtr",customProperties:["--grid-template-rows"],values:["1","2","3","4","5","6","7","8","9"],parseValue:S,responsive:!0},flow:{type:"enum",className:"rt-r-gaf",values:["row","column","dense","row-dense","column-dense"],responsive:!0},align:{type:"enum",className:"rt-r-ai",values:["start","center","end","baseline","stretch"],responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:["start","center","end","between"],parseValue:function(e){return"between"===e?"space-between":e},responsive:!0},...c};function S(e){return k.columns.values.includes(e)?e:e?.match(/^\d+$/)?`repeat(${e}, minmax(0, 1fr))`:e}const P=s.forwardRef((e,t)=>{const{className:a,asChild:r,as:n="div",...l}=m(e,k,f,x);return s.createElement(r?p:n,{...l,ref:t,className:u("rt-Grid",a)})});P.displayName="Grid";const X=()=>[{title:"SpeedRun | XP Summary & Leaderboard"},{name:"description",content:"View your XP breakdown and ranking on the SpeedRun leaderboard. Track your progress with prompts, deployments, tokens, and more."},{property:"og:title",content:"SpeedRun | XP Summary & Leaderboard"},{property:"og:description",content:"View your XP breakdown and ranking on the SpeedRun leaderboard."},{property:"og:type",content:"website"},{property:"og:url",content:"https://speedrunapp.com/xp-summary"},{property:"og:image",content:"https://www.datocms-assets.com/86369/1758565842-speedrun-og-banner.jpg"},{property:"og:site_name",content:"SpeedRun"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:"SpeedRun | XP Summary & Leaderboard"},{name:"twitter:description",content:"View your XP breakdown and ranking on the SpeedRun leaderboard."},{name:"twitter:image",content:"https://www.datocms-assets.com/86369/1758565842-speedrun-og-banner.jpg"},{name:"viewport",content:"width=device-width, initial-scale=1"},{name:"theme-color",content:"#000000"},{tagName:"link",rel:"canonical",href:"https://speedrunapp.com/xp-summary"}];function R(){const{address:c,isConnected:d}=a(),{xpSummary:m,xpBreakdown:u,isLoading:x,error:f}=r(c),k="dark"===t(v),S=t(b.isBaseMiniAppMode),[X,R]=s.useState([]),[L,$]=s.useState(null),[A,B]=s.useState(!1),[V,C]=s.useState(null);s.useEffect(()=>{(async()=>{B(!0),C(null);try{const e=c?`?walletAddress=${encodeURIComponent(c)}`:"",s=await fetch(`/api/xp-leaderboard${e}`),t=await s.json();if(!s.ok||!t.success)throw new Error(t.error||"Failed to load leaderboard");R(t.top10||[]),$(t.user||null)}catch(p){C(p?.message||"Failed to load leaderboard"),R([]),$(null)}finally{B(!1)}})()},[c]);const E=L?.rank||0,F=L?.walletAddress||c||"";return d&&c?e.jsx(e.Fragment,{children:e.jsxs(l,{className:g("flex flex-col min-h-screen justify-between gap-y-20",{"bg-app-hero":!S}),style:S?N(k):void 0,children:[e.jsx(i,{children:()=>e.jsx(o,{})}),e.jsxs("section",{className:"flex flex-col gap-y-10 justify-between w-full",children:[e.jsx(n,{}),e.jsx("section",{className:"flex items-center justify-center",children:e.jsxs(P,{columns:{initial:"1",md:"3"},className:g(j.MultiShadowYellow,"text-chat bg-chat  max-w-7xl mx-auto w-full"),children:[e.jsx(y,{xpSummary:m,xpBreakdown:u,isBorder:!0,isLoading:x,error:f,description:e.jsxs(e.Fragment,{children:["View your XP breakdown across prompts, deployed templates, deployed tokens, daily streaks, and remixed templates.",e.jsx("br",{}),"Each activity contributes to your total XP score."]})}),e.jsxs("article",{className:g(j.GradientBorderTopBottomLeft,"flex flex-col gap-y-10 items-center w-full sm:p-6 lg:p-10"),children:[e.jsx(h,{className:"text-speedrun-orange-gradient text-center heading-1 w-full",title:"XP LEADERBOARD"}),e.jsxs("div",{className:g("flex bg-transparent-white flex-col border border-speedrun-primary-orange gap-y-4 p-6 w-full"),children:[e.jsx(h,{className:"text-speedrun-orange-gradient heading-2 w-full",title:"Your Ranking"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsx("span",{children:A?"...":E||"-"}),e.jsx("span",{children:F?`${F.slice(0,6)}...${F.slice(-4)}`:"-"})]}
1),e.jsxs("span",{children:[(L?.totalXP??m.totalXP).toLocaleString()," XP"]})]})]}),e.jsx(h,{className:"text-speedrun-orange-gradient heading-2 w-full",title:"Top 10 Users"}),e.jsxs("ul",{className:"flex flex-col gap-y-4 w-full",children:[A&&e.jsx("li",{className:"flex items-center justify-between",children:e.jsx("span",{children:"Loading..."})}),V&&!A&&e.jsx("li",{className:"flex items-center justify-between",children:e.jsx("span",{children:V})}),!A&&!V&&0===X.length&&e.jsx("li",{className:"flex items-center justify-between",children:e.jsx("span",{children:"No data"})}),X.map((s,t)=>e.jsxs("li",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsx("span",{children:t+1}),e.jsx("span",{children:s.walletAddress?`${s.walletAddress.slice(0,6)}...${s.walletAddress.slice(-4)}`:"—"})]}),e.jsxs("span",{children:[(s.totalXP||0).toLocaleString()," XP"]})]},s.userId))]})]})]})}),e.jsx(w,{})]})]})}):e.jsxs("div",{className:"bg-app-landing flex flex-col min-h-screen bg-chat text-chat",children:[e.jsx(n,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Connect Your Wallet"}),e.jsx("p",{className:"text-gray-400",children:"Please connect your wallet to view your XP breakdown."})]})})]})}export{R as default,X as meta};

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.