1import{u as l,j as e}from"./vendor-query-6nO0aXI-.js";import{a as i}from"./api-B7OcOsYd.js";import{M as x}from"./layout-CSgm68uq.js";import{Y as d,Z as h,W as p,B as c,R as u,S as g,U as f,p as y,_ as j}from"./vendor-ui-CtoxC0Mt.js";import"./vendor-router-yscda1MA.js";import"./index-BOKZ6oQA.js";import"./vendor-react-k6yPa1qy.js";import"./languages-n-zsb-Mz.js";const n={bookworm:c,social_butterfly:f,reviewer:g,streak_master:u,first_read:c,chapter_champion:p,speed_reader:h,default:d};function B(){const{data:a=[]}=l({queryKey:["achievements"],queryFn:i.getAchievements}),{data:m=[]}=l({queryKey:["user-achievements"],queryFn:i.getUserAchievements}),r=new Set(m.map(s=>s.achievement_id));return e.jsx(x,{children:e.jsx("div",{className:"min-h-screen bg-[#0f0f1a]",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(d,{className:"w-12 h-12 text-yellow-400 mx-auto mb-3"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Achievements"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:[r.size," / ",a.length," earned"]}),e.jsx("div",{className:"w-full bg-[#1a1a2e] rounded-full h-2 mt-3 max-w-xs mx-auto",children:e.jsx("div",{className:"bg-gradient-to-r from-[#7c3aed] to-yellow-400 h-2 rounded-full transition-all",style:{width:`${a.length>0?r.size/a.length*100:0}%`}})})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:a.map(s=>{const t=r.has(s.id),o=n[s.icon||"default"]||n.default;return e.jsxs("div",{className:`rounded-xl p-4 flex gap-4 ${t?"bg-[#1a1a2e] border border-yellow-400/30":"bg-[#1a1a2e] opacity-60"}`,children:[e.jsx("div",{className:`w-14 h-14 rounded-xl flex items-center justify-center flex-shrink-0 ${t?"bg-yellow-400/20":"bg-gray-700/30"}`,children:t?e.jsx(o,{className:"w-7 h-7 text-yellow-400"}):e.jsx(y,{className:"w-7 h-7 text-gray-500"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h3",{className:`font-semibold ${t?"text-white":"text-gray-400"}`,children:[s.icon," ",s.title_en||s.title]}),t&&e.jsx(j,{className:"w-4 h-4 text-green-400"})]}),e.jsx("p",{className:"text-sm text-gray-400 mt-0.5",children:s.description_en||s.description}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsxs("span",{className:"text-xs px-2 py-0.5 bg-[#7c3aed]/20 text-[#7c3aed] rounded-full",children:[s.coins_reward||0," coins"]}),s.badge_url&&e.jsx("span",{className:"text-xs px-2 py-0.5 bg-yellow-400/20 text-yellow-400 rounded-full",children:"Badge"})]})]})]},s.id)})})]})})})}export{B 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.