PageSourceSearch

https://toguzkumalak.com/assets/AchievementsView-BRswelNE.js

js toguzkumalak.com collected 2026-10-03 02:42:56 UTC 5,593 bytes, 1 lines download raw bytes

1import{r as i,j as t}from"./react-vendor-DVl_j3ZO.js";import{u as k}from"./gamificationStore-BlGFIB9G.js";import{e as g,t as a,c as d,a1 as f,am as A}from"./index-DOARK-DV.js";import{L}from"./LockedItemOverlay-NpusqAva.js";import{y as m}from"./App-BJdRIa6w.js";import{u as I}from"./useLocale-C-pPUmlD.js";import"./profile-CSEvIE3K.js";import{A as D}from"./UserAvatar-DhZoPfzA.js";import"./preload-helper-BXtGQ0on.js";import{c as T,T as E,k as S}from"./ui-vendor-BK1JzGH1.js";import"./balanceEvents-Fbn2NYEs.js";import"./promoStore-BHTwuo1d.js";import"./state-vendor-B2bKdg16.js";import"./vendor-D0IlVHJ8.js";import"./style-utils-vendor-CZ__NpDL.js";import"./game-CAsdsSnD.js";import"./guestStore-BHL6h8OW.js";import"./surfaceAvailability-DmBQde5L.js";import"./featureFlagStore-BcWLf4r3.js";import"./framer-vendor-CdZfGxFf.js";import"./settingsStore-Dq6nEw_Z.js";import"./gameModeStore-B6TiAEhT.js";import"./ModalPortal-ZqX7mXiE.js";import"./tournament-DIEESYWE.js";import"./accountAgeGate-CxVK7-ZB.js";import"./pvpStore-OQfzdOIy.js";import"./additionalSagas-DWTOgSyy.js";import"./Button-D212SBON.js";import"./radix-vendor--rFHbw22.js";import"./productionFeatureFlags-ZJcd7d9Z.js";import"./referral-D4h2ud8c.js";import"./Card-DoVErbH_.js";import"./pvpChallenges-BPV7tsND.js";import"./dailyBonus-ChiZEqGW.js";import"./usePersistentPuzzleBgmSession-DazOF5xV.js";import"./ProfileFrameOverlay-AmEA_SWj.js";import"./publicUrl-MhrC-xX0.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="1061b32c-f909-4dd6-a758-27d63c509cc0",s._sentryDebugIdIdentifier="sentry-dbid-1061b32c-f909-4dd6-a758-27d63c509cc0")}catch{}})();const b={common:"border-night-border",rare:"border-blue-500",epic:"border-purple-500",legendary:"border-gold"};function fe({onBack:s}){const o=I(),{userAchievements:n,unlocked:h,total:y,isLoading:v,fetchUserAchievements:p}=k(),[c,j]=i.useState("all");i.useLayoutEffect(()=>{m();const e=requestAnimationFrame(()=>m());return()=>cancelAnimationFrame(e)},[]),i.useEffect(()=>{const e=setTimeout(()=>m(),350);return()=>clearTimeout(e)},[]),i.useEffect(()=>{p()},[p]);const w=i.useMemo(()=>{const e=new Set(n.map(r=>r.category||"general"));return["all",...Array.from(e)]},[n]),N=c==="all"?n:n.filter(e=>(e.category||"general")===c),_=i.useCallback((e,r)=>{const l=[];return e>0&&l.push(g("achievements.reward_xp",{n:e})),r>0&&l.push(g("achievements.reward_coins",{n:r})),l},[]);return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("button",{onClick:s,"aria-label":a("btn.back"),className:"p-1.5 rounded-lg hover:bg-night-slate/50 text-night-text-secondary",children:t.jsx(T,{className:"w-5 h-5"})}),t.jsx(E,{className:"w-5 h-5 text-gold"}),t.jsx("span",{className:"text-lg font-bold text-white",children:a("profile.achievements_title")})]}),t.jsxs("span",{className:"text-sm text-night-text-secondary",children:[h,"/",y]})]}),t.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:w.map(e=>t.jsx("button",{onClick:()=>j(e),className:d("px-3 py-1.5 rounded-lg text-xs font-medium transition-colors whitespace-nowrap",c===e?"bg-brand text-white":"bg-night-slate/30 text-night-text-secondary hover:text-white"),children:e==="all"?a("shop.filter.all"):e},e))}),v?t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[...Array(6)].map((e,r)=>t.jsx("div",{className:"animate-pulse h-32 rounded-xl bg-night-slate/30"},r))}):t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:N.map(e=>{const r=f(e.name_localized,e.id,o),l=f(e.description_localized,a("achievements.complete_condition"),o),x=_(e.xp_reward,e.coin_reward);return t.jsx(L,{locked:!e.is_unlocked,condition:l,children:t.jsxs("div",{className:d("relative flex h-full flex-col items-center gap-2 p-4 rounded-xl border-2 transition-all",e.is_unlocked?b[e.rarity||"common"]||b.common:"border-night-border/30","bg-night-slate/20 hover:bg-night-slate/30"),children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-night-slate/50 flex items-center justify-center text-2xl",children:e.is_unlocked?t.jsx(D,{achievementId:e.id,category:e.category,label:r,rarity:e.rarity,iconUrl:e.icon_url,size:40}):t.jsx(S,{className:"w-5 h-5 text-night-text-secondary"})}),t.jsxs("div",{className:"flex flex-1 flex-col text-center",children:[t.jsx("div",{className:d("text-xs font-medium",e.is_unlocked?"text-white":"text-night-text-secondary"),children:r}),e.is_unlocked&&e.earned_at&&t.jsx("div",{className:"text-[10px] text-night-text-secondary mt-0.5",children:new Date(e.earned_at).toLocaleDateString(A())}),t.jsx("div",{className:"mt-2 flex flex-wrap justify-center gap-1.5",children:x.length>0?x.map(u=>t.jsx("span",{className:"rounded-full border border-brand/20 bg-brand/10 px-2 py-0.5 text-[10px] font-bold text-brand",children:u},`${e.id}-${u}`)):t.jsx("span",{className:"rounded-full border border-white/10 bg-white/[0.04] px-2 py-0.5 text-[10px] font-bold text-night-text-secondary",children:a("achievements.reward_none")})})]}),e.rarity&&e.rarity!=="common"&&t.jsx("span",{className:d("absolute top-1 right-1 px-1.5 py-0.5 rounded text-[9px] font-bold uppercase",e.rarity==="legendary"&&"bg-gold/20 text-gold",e.rarity==="epic"&&"bg-purple-500/20 text-purple-400",e.rarity==="rare"&&"bg-blue-500/20 text-blue-400"),children:e.rarity})]})},e.id)})})]})}export{fe as AchievementsView};

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.