1import{r as p,j as e}from"./vendor-react-BmaOEVXd.js";import{M as F}from"./MainLayout-CD8lUdKW.js";import{d as E,bQ as P,f as m,e as w,T as b,S as A,bD as S,k as B,bW as C,ak as I}from"./index-DaR3WIIn.js";import{a as G,G as x,T as v}from"./glass-DL169LZi.js";import{a as M,H as N,b as L,c as f}from"./gameGlass-ZkVSRP2Q.js";import{g as D}from"./gamesHubApi-BaXhCH6s.js";import{L as H}from"./index.es-DWwTiEcw.js";import{b as W,u as O}from"./vendor-router-YJ1kuUK4.js";import{u as $}from"./vendor-i18n-DFLJMoQz.js";import{m as l}from"./vendor-motion-2QGaoAUv.js";import{T as k}from"./timer-CwVXPNN8.js";import{T as R}from"./trending-up-BEQqQCnT.js";import{A as K}from"./award-DPla39OZ.js";import{Z as z}from"./zap-BKeaeTWH.js";import{B as U}from"./book-open-k156t6Bi.js";import"./vendor-ui-DP4RxKPZ.js";import"./vendor-query-CvUMyKt2.js";import"./vendor-firebase--9_-N0hd.js";import"./vendor-supabase-B_SzD5j0.js";import"./play-DnSuqs-4.js";const Y=E("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Z=({url:a,size:s=48,fallback:t})=>{const n=!!a&&/\.json($|[?#])/i.test(a),[o,g]=p.useState(null),[y,u]=p.useState(null);return p.useEffect(()=>{if(!a||!n)return;let c=!1;return fetch(a).then(i=>i.json()).then(i=>{c||g({url:a,data:i})}).catch(()=>{c||g({url:a,data:null})}),()=>{c=!0}},[a,n]),a?n?o?.url===a&&o.data?e.jsx(H,{animationData:o.data,loop:!0,autoplay:!0,style:{width:s,height:s}}):e.jsx(e.Fragment,{children:t}):y===a?e.jsx(e.Fragment,{children:t}):e.jsx("img",{src:a,alt:"",className:"object-contain",style:{width:s,height:s},onError:()=>u(a)}):e.jsx(e.Fragment,{children:t})},d=[.22,1,.36,1],_=({letter:a,delay:s,x:t,y:n,className:o})=>e.jsx(l.div,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1,y:[0,-12,0]},transition:{delay:s,duration:.5,y:{repeat:1/0,duration:3.2,ease:"easeInOut",delay:s+.5}},className:m("absolute text-2xl font-black sm:text-3xl",o),style:{left:`${t}%`,top:`${n}%`},children:a}),X=[{letter:"A",delay:.3,x:8,y:12,className:"text-[#5B5CE2]/30 dark:text-[#A8A9FF]/30"},{letter:"B",delay:.5,x:84,y:10,className:"text-[#39BFCB]/40 dark:text-[#76E2E9]/35"},{letter:"C",delay:.7,x:78,y:72,className:"text-[#5B5CE2]/25 dark:text-[#A8A9FF]/25"},{letter:"X",delay:.9,x:12,y:76,className:"text-[#39BFCB]/35 dark:text-[#76E2E9]/30"},{letter:"Z",delay:1.1,x:90,y:42,className:"text-[#5B5CE2]/25 dark:text-[#A8A9FF]/25"},{letter:"K",delay:1.3,x:4,y:44,className:"text-[#5B5CE2]/20 dark:text-[#A8A9FF]/20"},{letter:"M",delay:1.5,x:46,y:6,className:"text-[#39BFCB]/30 dark:text-[#76E2E9]/25"},{letter:"R",delay:1.7,x:52,y:86,className:"text-[#5B5CE2]/20 dark:text-[#A8A9FF]/20"}],q=["R","O","I","T","A","X"],T=({icon:a,tone:s,title:t})=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:m("flex h-9 w-9 shrink-0 items-center justify-center rounded-[12px]",v[s]),children:e.jsx(a,{className:"h-[18px] w-[18px]",strokeWidth:1.9})}),e.jsx("h3",{className:"text-base font-bold text-[#14171F] dark:text-white",children:t})]}),h=({icon:a,title:s,value:t,tone:n})=>e.jsxs("div",{className:"min-w-0 rounded-[16px] bg-white/55 p-3.5 dark:bg-white/[0.04] home-elev",children:[e.jsx("span",{className:m("flex h-9 w-9 items-center justify-center rounded-[12px]",v[n]),children:e.jsx(a,{className:"h-[18px] w-[18px]",strokeWidth:1.9})}),e.jsx("p",{className:"mt-3 truncate text-[10px] font-bold uppercase tracking-[0.08em] text-[#768196] dark:text-[#9EA9BC]",children:s}),e.jsx("p",{className:"mt-0.5 truncate text-[15px] font-bold text-[#14171F] dark:text-white",children:t})]}),j=({icon:a,title:s,tone:t})=>e.jsxs("div",{className:"flex items-center gap-3 rounded-[16px] bg-white/55 px-3.5 py-3 dark:bg-white/[0.04] home-elev",children:[e.jsx("span",{className:m("flex h-9 w-9 shrink-0 items-center justify-center rounded-[12px]",v[t]),children:e.jsx(a,{className:"h-[18px] w-[18px]",strokeWidth:1.9})}),e.jsx("span",{className:"text-sm font-semibold text-[#14171F] dark:text-white",children:s})]});function ue(){const a=W(),s=O(),{t}=$(),[n,o]=p.useState(null);s.state?.fromHub;const y=s.state?.game?.icon;p.useEffect(()=>{(async()=>{const r=await D.getGameStats("SPEED_TYPING");o(r)})()},[]);const u=()=>{I.levelStart("SPEED_TYPING"),a("/games/speed-typing/play")},c=[t("speedTypingPreview.step1"),t("speedTypingPreview.step2"),t("speedTypingPreview.step3")];return P(()=>a("/games"),t("speedTypingPreview.title")),e.jsx(F,{children:e.jsx(G,{children:e.jsxs("div",{className:"home-dashboard-grid",children:[e.jsx(l.div,{initial:{opacity:0,y:12}
1,animate:{opacity:1,y:0},transition:{duration:.45,ease:d},className:"min-w-0 lg:col-span-7",children:e.jsx(x,{accent:"indigo",className:"h-full !rounded-[26px] p-3 sm:p-4",children:e.jsxs("div",{className:"relative flex h-full min-h-[280px] flex-col items-center justify-center gap-6 overflow-hidden rounded-[20px] bg-[linear-gradient(135deg,rgba(91,92,226,.14),rgba(57,191,203,.10))] px-4 py-8 home-elev dark:bg-[linear-gradient(135deg,rgba(109,112,241,.2),rgba(57,191,203,.09))] sm:min-h-[340px]",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-16 -top-20 h-64 w-64 rounded-full bg-[#6F72FF]/20 blur-[52px]"}),e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -bottom-24 -left-16 h-72 w-72 rounded-full bg-[#39BFCB]/[0.18] blur-[52px]"}),e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",children:X.map(i=>e.jsx(_,{...i},i.letter))}),e.jsx(l.div,{initial:{opacity:0,scale:.85},animate:{opacity:1,scale:1},transition:{duration:.5,delay:.1,ease:d},className:"relative z-10 flex h-32 w-32 items-center justify-center rounded-[34px] bg-white/70 backdrop-blur-sm home-elev dark:bg-white/[0.08] sm:h-40 sm:w-40 sm:rounded-[40px]",children:e.jsx(Z,{url:y,size:88,fallback:e.jsx(l.div,{animate:{y:[0,-4,0]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:e.jsx(Y,{className:"h-16 w-16 text-[#5B5CE2] dark:text-[#A8A9FF] sm:h-20 sm:w-20",strokeWidth:1.6})})})}),e.jsx("div",{"aria-hidden":!0,className:"relative z-10 flex gap-1.5 sm:gap-2",children:q.map((i,r)=>e.jsx(l.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.35,delay:.25+r*.05,ease:d},className:m("flex h-10 w-10 items-center justify-center rounded-[12px] text-base font-bold home-elev sm:h-12 sm:w-12 sm:text-lg",r<2?"bg-[#25B67A]/[0.14] text-[#15925E] dark:bg-[#25B67A]/[0.18] dark:text-[#5FE0A6]":r===2?"pill-primary":"bg-white/70 text-[#303743] dark:bg-white/[0.07] dark:text-white"),children:i},i))}),e.jsxs("span",{className:"relative z-10 inline-flex items-center gap-1.5 rounded-full bg-white/70 px-3.5 py-2 text-sm font-bold text-[#14171F] backdrop-blur-sm home-elev dark:bg-white/[0.08] dark:text-white",children:[e.jsx(k,{className:"h-4 w-4 text-[#147C8B] dark:text-[#76E2E9]",strokeWidth:2}),"60 ",t("speedTypingPreview.seconds")]})]})})}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-4 lg:col-span-5",children:[e.jsx(M,{title:t("speedTypingPreview.title"),description:t("speedTypingPreview.heroDesc"),action:e.jsx(L,{onHero:!0,onClick:u,children:t("speedTypingPreview.startTyping")}),children:e.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[e.jsx(N,{label:t("speedTypingPreview.timeLimit"),value:`60 ${t("speedTypingPreview.seconds")}`}),e.jsx(N,{label:t("speedTypingPreview.avgScore"),value:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["1,000",e.jsx(w,{className:"h-[18px] w-[18px] text-[#FFD76A]",fill:"currentColor",strokeWidth:1.6})]})})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(f,{icon:b,label:t("speedTypingPreview.bestScore"),value:n?.bestScore?.toLocaleString()||"0",tone:"amber",delay:.1}),e.jsx(f,{icon:R,label:t("speedTypingPreview.wpm"),value:n?.wpm?.toString()||"0",tone:"success",delay:.15}),e.jsx(f,{icon:K,label:t("speedTypingPreview.games"),value:n?.games?.toString()||"0",tone:"indigo",delay:.2})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:col-span-12 xl:grid-cols-3",children:[e.jsx(l.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.45,delay:.15,ease:d},className:"min-w-0",children:e.jsxs(x,{accent:"teal",className:"h-full !rounded-[24px] p-4 sm:p-5",children:[e.jsx(T,{icon:A,tone:"amber",title:t("speedTypingPreview.gameFeatures")}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2.5",children:[e.jsx(h,{icon:k,title:t("speedTypingPreview.duration"),value:`60 ${t("speedTypingPreview.seconds")}`,tone:"teal"}),e.jsx(h,{icon:S,title:t("speedTypingPreview.combos"),value:t("speedTypingPreview.buildStreaks"),tone:"orange"}),e.jsx(h,{icon:z,title:t("speedTypingPreview.momentum"),value:t("speedTypingPreview.stateBonu
1s"),tone:"indigo"}),e.jsx(h,{icon:w,title:t("speedTypingPreview.perWord"),value:`50-150 ${t("common.pointsUnit")}`,tone:"success"})]})]})}),e.jsx(l.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.45,delay:.2,ease:d},className:"min-w-0",children:e.jsxs(x,{accent:"indigo",className:"h-full !rounded-[24px] p-4 sm:p-5",children:[e.jsx(T,{icon:B,tone:"teal",title:t("speedTypingPreview.howToPlay")}),e.jsx("ol",{className:"mt-4 space-y-2.5",children:c.map((i,r)=>e.jsxs("li",{className:"flex items-start gap-3 rounded-[16px] bg-white/55 px-3.5 py-3 text-sm leading-snug text-[#475064] dark:bg-white/[0.04] dark:text-[#C9D1E0] home-elev",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[#5B5CE2]/10 text-xs font-bold text-[#5B5CE2] dark:bg-[#A8A9FF]/15 dark:text-[#A8A9FF]",children:r+1}),e.jsx("span",{className:"pt-0.5",children:i})]},r))})]})}),e.jsx(l.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.45,delay:.25,ease:d},className:"min-w-0 md:col-span-2 xl:col-span-1",children:e.jsx(x,{accent:"pink",className:"h-full !rounded-[24px] p-4 sm:p-5",children:e.jsxs("div",{className:"grid h-full gap-2.5 md:grid-cols-3 md:content-center xl:grid-cols-1",children:[e.jsx(j,{icon:b,title:t("speedTypingPreview.earnPoints"),tone:"amber"}),e.jsx(j,{icon:U,title:t("speedTypingPreview.learnTerms"),tone:"teal"}),e.jsx(j,{icon:C,title:t("speedTypingPreview.unlockAchievements"),tone:"pink"})]})})})]})]})})})}export{ue 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.