PageSourceSearch

https://kometri.com/assets/DashboardPage-waHcfPj3.js

js kometri.com collected 2026-10-02 01:35:05 UTC 45,081 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useAchievementTracker-CQSfb5Ot.js","assets/vendor-react-CkrtinOd.js","assets/index-BGtza9SP.js","assets/vendor-query-CsYqNbmM.js","assets/vendor-i18n-l7OMnJqp.js","assets/vendor-ui-Dv3q5jvr.js","assets/index-CgSQ2Evs.css","assets/achievements-svpGmeV8.js"])))=>i.map(i=>d[i]);
2import{B as $,m as Pe,t as de,u as Ke,n as He,_ as qe,z as We,F as ce}from"./index-BGtza9SP.js";import{j as e,a as be}from"./vendor-query-CsYqNbmM.js";import{r as f,R as ve,h as Ue,L as k,N as Qe}from"./vendor-react-CkrtinOd.js";import{f as P,u as Xe,a as Ye,b as Ge,c as Je,d as Ze}from"./useFlashcards-64TzSHOJ.js";import{s as ae,f as W,a as es,u as L}from"./studyStore-DGaaHfmJ.js";import{u as R}from"./vendor-i18n-l7OMnJqp.js";import{triggerAchievementCheck as ss}from"./useAchievementTracker-CQSfb5Ot.js";import{t as ts,d as me,s as ue}from"./transliterate-lY8u3lJP.js";import{p as rs,f as as,W as ns}from"./WeakSpotsModal-bjK6uXWD.js";import{X as U,V as ls,T as re,y as ye,F as is,H as xe,f as B,o as z,I as os,s as ds,J as Y,K as he,G as cs,Z as ms,C as us,B as xs,d as hs,N as fs,k as gs,O as ps}from"./vendor-ui-Dv3q5jvr.js";import{d as bs,i as vs,C as ys}from"./extension-CaFZ50XK.js";import{C as js,a as Ns}from"./Card-BxTRi_ci.js";import{d as ws}from"./discoverApi-GjuhMc7F.js";import{g as _s,t as ks,a as je,A as Ss,c as Cs,M as Ds,R as Ms,b as Ts,d as Ne,i as Vs}from"./discoveryStreak-6rVDiiHk.js";import{m as As}from"./proxy-DpZWPpz2.js";import{useAchievementStore as Es,ACHIEVEMENTS as fe}from"./achievements-svpGmeV8.js";import{u as Is,a as Ls}from"./useReferral-Bc2vg7T6.js";import"./useUsage-dTXyyGA_.js";import"./en-US-CozxgUTw.js";import"./Input-CLys67fG.js";import"./agent-Cz1qD7uu.js";import"./useDecks-B3B_xCUp.js";import"./constants-C7efP49C.js";import"./referralApi-BBp_akhU.js";const we=["hsl(var(--muted))","#86efac","#4ade80","#22c55e","#16a34a"];function Rs(s,r){return s===0?0:s<r*.5?1:s<r?2:s<r*2?3:4}function $s({records:s,dailyGoal:r}){const{t:l}=R("study"),c=new Date,a=Array.from({length:7},(n,h)=>{const t=ae(c,6-h),g=W(t,"yyyy-MM-dd"),p=s[g]?.cardsStudied??0,j=h===6,S=(t.getDay()+6)%7,C=["mon","tue","wed","thu","fri","sat","sun"][S];return{key:g,cards:p,isToday:j,label:l(`days.${C}`)}}),b=Math.max(...a.map(n=>n.cards),r,1),m=72;return e.jsx("div",{className:"flex items-end gap-2",style:{height:108},children:a.map(n=>{const h=n.cards>0?Math.max(6,Math.round(n.cards/b*m)):3,t=n.cards===0?"hsl(var(--muted-foreground) / 0.2)":n.cards>=r?"#16a34a":"#4ade80";return e.jsxs("div",{className:"flex-1 flex flex-col items-center",style:{height:108},children:[e.jsxs("div",{className:"flex-1 flex flex-col justify-end items-center w-full",children:[n.cards>0&&e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground mb-0.5 leading-none",children:n.cards}),e.jsx("div",{className:"w-full rounded-t-[3px] transition-all duration-500",style:{height:h,backgroundColor:t},title:`${n.key}: ${n.cards} cards`})]}),e.jsx("span",{className:`text-[10px] font-medium mt-1.5 ${n.isToday?"text-primary font-semibold":"text-muted-foreground"}`,children:n.label})]},n.key)})})}function Fs({records:s,dailyGoal:r}){const l=new Date,c=W(l,"yyyy-MM-dd"),a=(l.getDay()+6)%7,b=ae(l,a+21),m=Array.from({length:28},(t,g)=>{const p=es(b,g),j=W(p,"yyyy-MM-dd"),S=p>l,C=(p.getDay()+6)%7;return{key:j,cards:S?0:s[j]?.cardsStudied??0,isToday:j===c,isFuture:S,isMonday:C===0,dayNum:W(p,"d")}}),n=Math.max(...m.map(t=>t.cards),r,1),h=72;return e.jsx("div",{className:"flex items-end gap-0.5",style:{height:108},children:m.map(t=>{const g=!t.isFuture&&t.cards>0?Math.max(4,Math.round(t.cards/n*h)):t.isFuture?0:2,p=t.isFuture?"hsl(var(--muted-foreground) / 0.08)":t.cards===0?"hsl(var(--muted-foreground) / 0.2)":t.cards>=r?"#16a34a":"#4ade80";return e.jsxs("div",{className:"flex-1 flex flex-col items-center",style:{height:108},children:[e.jsxs("div",{className:"flex-1 flex flex-col justify-end w-full",children:[!t.isFuture&&t.cards>0&&e.jsx("span",{className:"text-[8px] font-medium text-muted-foreground text-center leading-none mb-0.5",children:t.cards}),e.jsx("div",{className:"w-full rounded-t-[2px] transition-all duration-500",style:{height:g,backgroundColor:p}
2,title:t.isFuture?"":`${t.key}: ${t.cards} cards`})]}),e.jsx("span",{className:`text-[8px] mt-1 leading-none ${t.isToday?"text-primary font-bold":t.isMonday?"text-muted-foreground":"text-transparent select-none"}`,children:t.dayNum})]},t.key)})})}function Os({records:s,dailyGoal:r}){const{t:l}=R("study"),c=53,a=7,b=[l("days.mon"),"",l("days.wed"),"",l("days.fri"),"",""],m=new Date,n=(m.getDay()+6)%7,h=(c-1)*a+n,t=[];for(let x=h;x>=0;x--){const v=ae(m,x),y=W(v,"yyyy-MM-dd"),w=s[y]?.cardsStudied??0;t.push({date:y,cards:w,level:Rs(w,r)})}const g=t.length%a===0?0:a-t.length%a,p=[...t,...Array(g).fill(null)],j=[];for(let x=0;x<Math.ceil(p.length/a);x++)j.push(p.slice(x*a,(x+1)*a));const S=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],C=[];let I="",N=-4;j.forEach((x,v)=>{const y=x.find(w=>w!==null);if(y){const w=y.date.slice(0,7);if(w!==I&&v-N>=4){const _=new Date(y.date).getMonth();C.push({label:l(`months.${S[_]}`),col:v}),I=w,N=v}else w!==I&&(I=w)}});const M=10,A=2,E=24,u=M+A,T=M+A,V=j.length,d=E+V*u,o=12+a*T;return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("svg",{viewBox:`0 0 ${d} ${o}`,width:d,height:o,className:"block",children:[C.map(x=>e.jsx("text",{x:E+x.col*u,y:9,fontSize:9,fill:"hsl(var(--muted-foreground))",children:x.label},x.col)),b.map((x,v)=>x?e.jsx("text",{x:E-3,y:12+v*T+M-2,fontSize:8,textAnchor:"end",fill:"hsl(var(--muted-foreground))",children:x},v):null),j.map((x,v)=>x.map((y,w)=>{const _=E+v*u,G=12+w*T,J=y?.level??0,Z=!y;return e.jsx("rect",{x:_,y:G,width:M,height:M,rx:2,fill:Z?"hsl(var(--muted) / 0.15)":we[J],children:y&&e.jsxs("title",{children:[y.date,": ",y.cards," cards"]})},`${v}-${w}`)}))]})})}const Bs=({records:s,dailyGoal:r})=>{const{t:l}=R("study"),[c,a]=f.useState("week"),b=Object.values(s).reduce((n,h)=>n+h.cardsStudied,0),m=Object.values(s).filter(n=>n.cardsStudied>0).length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:l("study_activity")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:m===1?l("cards_in_day",{count:b,days:m}):l("cards_in_days",{count:b,days:m})})]}),e.jsx("div",{className:"flex items-center gap-0.5 bg-muted/60 rounded-lg p-0.5",children:["week","month","year"].map(n=>e.jsx("button",{onClick:()=>a(n),className:`text-[11px] px-2.5 py-1 rounded-md font-medium transition-colors ${c===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:l(`view_${n}`)},n))})]}),c==="week"&&e.jsx($s,{records:s,dailyGoal:r}),c==="month"&&e.jsx(Fs,{records:s,dailyGoal:r}),c==="year"&&e.jsx(Os,{records:s,dailyGoal:r}),e.jsxs("div",{className:"flex items-center gap-1 mt-2 justify-end",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground mr-0.5",children:l("less")}),we.map((n,h)=>e.jsx("div",{className:"rounded-sm",style:{width:10,height:10,backgroundColor:n}},h)),e.jsx("span",{className:"text-[10px] text-muted-foreground ml-0.5",children:l("more")})]})]})},zs=({open:s,onClose:r,flashcards:l,onComplete:c})=>{const{t:a}=R("study"),[b,m]=f.useState([]),[n,h]=f.useState(0),[t,g]=f.useState(!1),[p,j]=f.useState([]),[S,C]=f.useState("studying"),[I]=f.useState(()=>Date.now()),N=[{value:1,label:a("again"),color:"text-red-500",borderColor:"border-l-red-500"},{value:2,label:a("hard"),color:"text-amber-500",borderColor:"border-l-amber-500"},{value:3,label:a("good"),color:"text-language",borderColor:"border-l-primary"},{value:4,label:a("easy"),color:"text-success",borderColor:"border-l-success"}],M=be(),A=ve.useRef([]),E=L(d=>d.recordSession);f.useEffect(()=>(s?(document.body.style.overflow="hidden",l.length>0&&(m(l.slice(0,5)),h(0),g(!1),j([]),C("studying"))):document.body.style.overflow="",()=>{document.body.style.overflow=""}),[s]),f.useEffect(()=>{if(!s)return;const d=o=>{if(o.key==="Escape"){r();return}if(S==="studying"){if(o.key==="p"||o.key==="P"){if(o.preventDefault(),u){const x=t?u.back_text:u.front_text,v=t?me(u.back_text)??"en":u.language;ue(x,v)}return}t?(o.key==="1"&&(o.preventDefault(),T(1)),o.key==="2"&&(o.preventDefault(),T(2)),o.key==="3"&&(o.preventDefault(),T(3)),o.key==="4"&&(o.preventDefault(),T(4))):(o.key===" "||o.key==="Enter")&&(o.preventDefault(),g(!0))}};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[s,S,t,n]);const u=b[n],T=async d=>{if(!u)return;A.current.push(Pe.review(u.id,{quality:d}).catch(()=>{}));const o=[...p,{quality:d}];if(j(o),n<b.length-1)h(x=>x+1),g(!1);else{await Promise.allSettled(A.current),A.current=[];const x=o.filter(y=>y.quality>=2).length,v={cardsStudied:o.length,correctCount:x,incorrectCount:o.length-x,successRate:Math.round(x/o.length*100),timeSpentSeconds:Math.round((Date.now()-I)/1e3)};E(v),c?.(v),M.invalidateQueries({queryKey:P.duePrefix()}),M.invalidateQueries({queryKey:P.statsPrefix()}),M.invalidateQueries({queryKey:P.studyActivity()}),ss(),C("summary")}
2};if(!s)return null;const V=p.filter(d=>d.quality>=2).length;return Ue.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 bg-background",children:[e.jsx("button",{onClick:r,className:"absolute top-4 right-4 p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:e.jsx(U,{className:"h-5 w-5"})}),e.jsxs("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-lg px-4",children:[S==="studying"&&u&&e.jsxs("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-300",children:[e.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:b.map((d,o)=>e.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${o<n?p[o]?.quality>=3?"w-2 bg-success":"w-2 bg-red-400":o===n?"w-8 bg-gradient-to-r from-primary to-[#355126]":"w-2 bg-muted-foreground/20"}`},o))}),e.jsx("div",{className:"bg-card shadow-lg rounded-2xl min-h-[280px] flex items-center justify-center border border-border cursor-pointer select-none",onClick:()=>!t&&g(!0),children:e.jsxs("div",{className:"text-center px-8 py-12",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-3",children:a(t?"answer":"question")}),e.jsx("p",{className:"text-2xl font-medium text-foreground",children:t?u.back_text:u.front_text}),!t&&(()=>{const d=ts(u.front_text,u.language);return d?e.jsx("p",{className:"text-sm text-muted-foreground/70 mt-1 italic",children:d}):null})(),t&&(u.examples?.length??0)>0&&e.jsxs("p",{className:"text-sm text-muted-foreground italic mt-4",children:['"',u.examples?.[0]?.text,'"']})]})}),e.jsx("div",{className:"flex justify-center mt-3",children:e.jsxs("button",{onClick:()=>{const d=t?u.back_text:u.front_text,o=t?me(u.back_text)??"en":u.language;ue(d,o)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-3 py-1.5 rounded-lg hover:bg-muted",children:[e.jsx(ls,{className:"h-3.5 w-3.5"}),a("speak")]})}),e.jsx("div",{className:"mt-3",children:t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-4 gap-3",children:(()=>{const d=u.progress,o=d?.stability??1,x=d?.difficulty??5,v=d?.repetition_count??0,y=d?.last_reviewed_at?(Date.now()-new Date(d.last_reviewed_at).getTime())/864e5:0,w=rs(o,x,v,y);return N.map(_=>e.jsxs("button",{onClick:()=>T(_.value),className:`cursor-pointer flex flex-col items-center justify-center gap-1 px-2 py-3 rounded-lg bg-card border border-border border-l-4 ${_.borderColor} hover:bg-muted transition-all duration-150 hover:scale-105 active:scale-95 min-h-[60px]`,children:[e.jsx("span",{className:`text-xs font-semibold ${_.color} text-center leading-tight`,children:_.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:as(w[_.value])})]},_.value))})()}),e.jsx("p",{className:"hidden sm:block text-center text-[10px] text-muted-foreground mt-2",children:a("keyboard_hint_rate")})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{variant:"default",onClick:()=>g(!0),className:"w-full h-12 text-base rounded-xl",children:a("tap_to_reveal")}),e.jsx("p",{className:"hidden sm:block text-center text-[10px] text-muted-foreground mt-2",children:a("keyboard_hint_reveal")})]})})]}),S==="summary"&&e.jsxs("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-500 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-primary to-[#355126] flex items-center justify-center shadow-lg shadow-primary/20",children:e.jsx(re,{className:"w-8 h-8 text-white"})})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:a("session_complete")}),e.jsxs("p",{className:"text-muted-foreground mb-6",children:[V,"/",p.length," ",a("correct")]}),e.jsx("div",{className:"flex items-center justify-center gap-2 mb-8",children:p.map((d,o)=>e.jsx("div",{children:d.quality>=2?e.jsx(ye,{className:"h-6 w-6 text-success"}):e.jsx(is,{className:"h-6 w-6 text-red-400"})},o))}),e.jsx("div",{className:"flex gap-3 justify-center",children:e.jsx($,{variant:"brand",onClick:r,children:a("done")})})]})]})]}),document.body)},Ps=3,Ks=()=>{const{t:s}=R("study"),[r,l]=f.useState({open:!1,cards:[],topic:null}),{data:c=[]}=Xe(20),{data:a=[]}=Ye(3),b=c.length>=Ps,m=c[0]?.language??"en";if(!b)return e.jsx("div",{className:"rounded-xl border border-border bg-card/50 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center",children:e.jsx(xe,{className:"w-4 h-4 text-amber-500"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:s("weak_spots_zero_title",{defaultValue:"Weak Spots will appear here"})}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:s("weak_spots_zero_body",{defaultValue:"Once you start missing cards, we build remedial decks targeting what you keep forgetting — not just resurfacing the same cards."})})]})]})});const n=()=>{de("weak_spots_overview_clicked",{struggling_count:c.length,language:m,source:"dashboard_widget",scope:"all"}),l({open:!0,cards:c,topic:null})},h=(t,g)=>{const p=c.filter(j=>
2g.includes(j.id));de("weak_spots_overview_clicked",{struggling_count:p.length,language:p[0]?.language??m,source:"dashboard_widget",scope:"topic",topic:t}),l({open:!0,cards:p,topic:t})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:n,className:"group relative w-full rounded-xl bg-gradient-to-br from-amber-400 via-orange-500 to-rose-500 p-[1.5px] shadow-sm hover:shadow-md transition-shadow",children:e.jsxs("div",{className:"flex items-center gap-3 w-full rounded-[10px] bg-card px-4 py-3 group-hover:bg-card/95 transition-colors",children:[e.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-lg bg-gradient-to-br from-amber-400 to-rose-500 flex items-center justify-center",children:e.jsx(xe,{className:"h-4 w-4 text-white"})}),e.jsxs("div",{className:"flex-1 text-left min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:s("weak_spots_overview_title",{defaultValue:"Crack your weak spots"})}),e.jsx(B,{className:"h-3.5 w-3.5 text-amber-500"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("weak_spots_overview_sub",{count:c.length,defaultValue:`${c.length} cards you've been struggling with — generate a refresher`})})]}),e.jsx(z,{className:"h-4 w-4 text-muted-foreground group-hover:text-foreground group-hover:translate-x-0.5 transition-all flex-shrink-0"})]})}),a.filter(t=>t.card_count>=2&&t.topic!=="untagged").length>=1&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 pl-1",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s("weak_spots_topics_label",{defaultValue:"or by topic:"})}),a.filter(t=>t.card_count>=2&&t.topic!=="untagged").map(t=>e.jsxs("button",{onClick:()=>h(t.topic,t.source_card_ids),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-rose-500/10 border border-rose-500/20 hover:bg-rose-500/15 hover:border-rose-500/40 transition-colors",children:[e.jsx("span",{className:"text-[11px] font-medium text-foreground capitalize",children:t.topic}),e.jsxs("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[t.card_count," · ",Math.round(t.avg_failure_rate*100),"%"]})]},t.topic))]})]}),e.jsx(ns,{open:r.open,onClose:()=>l({open:!1,cards:[],topic:null}),failedCards:r.cards,language:m})]})},ge="flshify_extension_hint_dismissed";function Hs({enabled:s=!0}){const{t:r}=R("dashboard"),[l,c]=f.useState(()=>{try{return localStorage.getItem(ge)==="true"}catch{return!1}}),[a,b]=f.useState(!0),m=vs(),n=s&&m&&!l;if(f.useEffect(()=>{if(!n)return;let t=!1;return bs().then(g=>{t||b(g)}),()=>{t=!0}},[n]),!n||a)return null;const h=()=>{c(!0);try{localStorage.setItem(ge,"true")}catch{}};return e.jsxs("div",{className:"mb-6 animate-in flex items-center gap-3 px-4 py-2.5 rounded-xl border border-border/60 bg-card/50",children:[e.jsx(os,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"font-medium text-foreground",children:r("extension_hint_title",{defaultValue:"Save words from anything you read"})})," — ",r("extension_hint_desc",{defaultValue:"The browser extension drops them into your deck without leaving the page."})," ",e.jsx("a",{href:ys,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary hover:underline whitespace-nowrap",children:r("extension_hint_cta",{defaultValue:"Take a look"})})]})}),e.jsx("button",{type:"button",onClick:h,"aria-label":r("dismiss",{defaultValue:"Dismiss"}),title:r("dismiss",{defaultValue:"Dismiss"}),className:"flex-shrink-0 text-muted-foreground/60 hover:text-foreground transition-colors",children:e.jsx(U,{className:"h-3.5 w-3.5"})})]})}const _e="discover_drop_eager_prefetch_v1";function qs(){try{return sessionStorage.getItem(_e)==="1"}catch{return!1}}function pe(){try{sessionStorage.setItem(_e,"1")}catch{}}function Ws(){const{isAuthenticated:s,user:r}=Ke();f.useEffect(()=>{if(!s||!r||qs())return;const l=r.learning_language??"en",c=_s(r.ui_language),a=ks(r.language_level),b=je(r.id);if(!b.topic||!Ss.includes(b.topic))return;const m=b.topic;if(Cs(l,a,m,c)>=Ds){pe();return}let n=!1;return pe(),ws.getFeed({language:l,level:a,source_language:c,count:Ms,exclude_words:[],topic:m}).then(h=>
2{n||h.cards.length>0&&(Ts(l,a,m,h.cards,c),console.debug(`[Discover] Eager drop prefetch landed ${h.cards.length} cards for "${m}"`))}).catch(h=>{console.debug(`[Discover] Eager drop prefetch failed for "${m}"`,h)}),()=>{n=!0}},[s,r?.id])}function Us({userId:s,className:r}){const{t:l}=R("common"),c=je(s),a=Ne();if(Vs())return e.jsxs("div",{className:`relative rounded-2xl border border-success/20 bg-success/[0.04] dark:bg-success/[0.07] px-4 py-3.5 flex items-center gap-3 overflow-hidden ${r??""}`,children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-success/15 flex items-center justify-center shrink-0",children:e.jsx(ds,{className:"h-5 w-5 text-success",strokeWidth:2.5})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l("todays_drop_done_title",{defaultValue:"Today's drop done"})}),e.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:a>0?l("todays_drop_done_streak",{count:a,defaultValue:`Day ${a} of your discovery streak. Fresh drop tomorrow.`}):l("todays_drop_done_back",{defaultValue:"Come back tomorrow for a fresh theme."})})]}),a>0&&e.jsxs("div",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400 bg-amber-500/10 border border-amber-500/30 px-2 py-1 rounded-full text-xs font-bold shrink-0",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),a]})]});const m=l(c.titleKey,{defaultValue:c.topic??"Today's drop"}),n=l(c.outcomeKey,{defaultValue:""});return e.jsxs(k,{to:"/discover",className:`group relative block rounded-2xl border border-primary/25 bg-gradient-to-br from-primary/8 via-signal/10 to-primary/8 dark:from-primary/12 dark:via-signal/8 dark:to-primary/10 px-4 py-4 sm:px-5 sm:py-5 overflow-hidden hover:border-primary/40 transition-all ${r??""}`,children:[e.jsx(As.div,{className:"absolute -top-10 -right-10 w-32 h-32 rounded-full bg-primary/15 blur-2xl pointer-events-none",animate:{scale:[1,1.15,1],opacity:[.6,.9,.6]},transition:{duration:4,repeat:1/0,ease:"easeInOut"}}),e.jsxs("div",{className:"relative flex items-start gap-3 sm:gap-4",children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center w-14 h-14 sm:w-16 sm:h-16 rounded-2xl bg-white/40 dark:bg-white/[0.08] backdrop-blur-sm border border-white/40 dark:border-white/10 shadow-sm select-none",style:{fontSize:"clamp(2rem, 6vw, 2.5rem)",lineHeight:1},"aria-hidden":!0,children:c.emoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.18em] text-primary/80",children:l("drop_label_today",{defaultValue:"Today's drop"})}),a>0?e.jsxs("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400 bg-amber-500/10 border border-amber-500/30 px-1.5 py-0.5 rounded-full text-[10px] font-bold",children:[e.jsx(Y,{className:"h-2.5 w-2.5"}),a]}):e.jsxs("span",{className:"flex items-center gap-1 bg-signal text-[#111713] border border-[#111713]/10 px-1.5 py-0.5 rounded-full text-[10px] font-bold shadow-sm shadow-signal/20",children:[e.jsx(B,{className:"h-2.5 w-2.5"}),l("todays_drop_new",{defaultValue:"New"})]})]}),e.jsx("h3",{className:"text-base sm:text-lg font-bold text-foreground leading-tight",children:m}),n&&e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground leading-snug mt-1 line-clamp-2",children:n}),e.jsxs("div",{className:"mt-2.5 flex items-center gap-1.5 text-sm font-bold text-primary group-hover:gap-2.5 transition-all",children:[l("drop_begin",{defaultValue:"Begin"}),e.jsx(z,{className:"h-4 w-4"})]})]})]})]})}function Qs(){const s=new Date().getHours();return s<12?"greeting_morning":s<18?"greeting_afternoon":"greeting_evening"}function vt(){Ws();const{t:s}=R("dashboard"),{data:r,isLoading:l}=He(),{data:c,isLoading:a}=Ge(),{data:b,isLoading:m}=Je(200),{data:n}=Ze(),h=L(i=>i.hydrateFromBackend),t=f.useRef(!1);f.useEffect(()=>{n&&!t.current&&(t.current=!0,h(n))},[n,h]);const g=L(i=>i.records),p=L(i=>i.dailyGoal),j=L(i=>i.setDailyGoal),S=Object.values(g).reduce((i,D)=>i+D.sessions,0),C=c?.languages??[],I=C.length>0?C:r?.learning_language?[r.learning_language]:[],N=L(i=>i.currentStreak),M=L(i=>i.longestStreak),A=L(i=>i.lastStudyDate),E=f.useMemo(()=>Ne(),[r?.discover_streak,r?.discover_streak_last_date]),u=c?.due_flashcards??b?.length??0,T=f.useMemo(()=>
2{if(r?.full_name)return r.full_name.split(" ")[0];if(r?.email){const i=r.email.split("@")[0].replace(/[._]/g," ").split(" ")[0];return i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()}return""},[r]),V=f.useMemo(()=>{const i=new Date().toISOString().split("T")[0];if(A===i)return null;const D=new Date(Date.now()-864e5).toISOString().split("T")[0];if(A===D&&N>0)return{type:"at_risk",streak:N};const se=new Date(Date.now()-2*864e5).toISOString().split("T")[0];if(A===se&&N===0)return{type:"lost"};const q=[7,14,30,50,100,200,365].find(X=>N===X-1);return q&&N>0?{type:"milestone",streak:N,next:q}:null},[A,N]),d=c?.total_flashcards??0,{unlockedIds:o,checkAndUnlock:x}=Es(),v=Object.values(g).reduce((i,D)=>i+D.cardsStudied,0),y=Object.values(g).reduce((i,D)=>i+D.sessions,0),w=Object.values(g).filter(i=>i.cardsStudied>0).length,_=f.useMemo(()=>{const i=new Date,D=new Date(i.getTime()-10080*60*1e3),se=new Date(i.getTime()-720*60*60*1e3);let H=0,q=0,X=0;for(const[ze,te]of Object.entries(g)){const oe=new Date(ze);oe>=D&&(H+=te.cardsStudied,q+=te.correctCount),oe>=se&&(X+=te.cardsStudied)}const Be=H>0?Math.round(q/H*100):null;return{weekCards:H,weekAccuracy:Be,monthCards:X}},[g]);f.useEffect(()=>{!a&&d>0&&d<10&&p===10&&j(Math.max(3,d))},[a,d,p,j]);const G=f.useMemo(()=>m?null:u>0?s("subtitle_due",{count:u}):N>1?s("subtitle_caught_up_streak",{count:N}):s("subtitle_caught_up"),[m,u,N,s]);ve.useEffect(()=>{(d>0||v>0)&&(x({totalCards:d,totalReviewed:v,currentStreak:N,longestStreak:M,totalSessions:y,activeDays:w}),qe(async()=>{const{triggerAchievementCheck:D}=await import("./useAchievementTracker-CQSfb5Ot.js");return{triggerAchievementCheck:D}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({triggerAchievementCheck:D})=>{D()}))},[d,v,N,M,y,w]);const J=fe.filter(i=>o.includes(i.id)),Z=fe.filter(i=>!o.includes(i.id)).slice(0,2),ke=r?.onboarding_completed===!0||localStorage.getItem(`flshify_onboarding_complete_${r?.id}`)==="true",Q=be(),Se=f.useCallback(()=>{Q.invalidateQueries({queryKey:P.duePrefix()}),Q.invalidateQueries({queryKey:P.statsPrefix()}),Q.invalidateQueries({queryKey:P.studyActivity()})},[Q]),[Ce,ne]=f.useState(!1),[K,De]=f.useState(!0),[Me,Te]=f.useState(()=>localStorage.getItem("flshify_first_session_banner_dismissed")==="true"),le=S===1&&!Me,Ve=()=>{localStorage.setItem("flshify_first_session_banner_dismissed","true"),Te(!0)},Ae=Is(),{data:Ee}=Ls(),Ie=r?.referral_banner_dismissed===!0||localStorage.getItem("flshify_referral_banner_dismissed")==="true",Le=r?.tier==="free"&&!Ie&&!le&&(N>=3||v>=10),Re=()=>{localStorage.setItem("flshify_referral_banner_dismissed","true"),Ae.mutate({referral_banner_dismissed:!0})},[$e,ie]=f.useState(()=>{try{return localStorage.getItem("flshify_signed_up_via_demo")==="1"}catch{return!1}}),Fe=()=>{ie(!1);try{localStorage.removeItem("flshify_signed_up_via_demo")}catch{}},[F,Oe]=f.useState(()=>{try{const i=localStorage.getItem("flshify_just_created_deck");return i?JSON.parse(i):null}catch{return null}}),ee=()=>{Oe(null),ie(!1);try{localStorage.removeItem("flshify_just_created_deck"),localStorage.removeItem("flshify_signed_up_via_demo")}catch{}},O=F?"just_created":$e?"level":V?"comeback":le?"first_session":Le?"referral":null;return l?e.jsx("div",{className:"bg-background",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"h-8 w-56 bg-muted rounded-lg animate-shimmer mb-2"}),e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-shimmer mb-3"}),e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"h-8 w-28 bg-muted rounded-full animate-shimmer"}),e.jsx("div",{className:"h-8 w-24 bg-muted rounded-full animate-shimmer"})]}),e.jsx("div",{className:"h-6 w-full bg-muted rounded-lg animate-shimmer"})]}),e.jsx("div",{className:"mb-6",children:e.jsx("div",{className:"rounded-xl border border-border bg-card px-4 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted animate-shimmer flex-shrink-0"}),e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-6 w-32 bg-muted rounded animate-shimmer"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"h-8 w-28 bg-muted rounded-lg animate-shimmer"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-lg animate-shimmer"})]})]})})}),e.jsx("div",{className:"mb-6",children:e.jsx("div",{className:"flex items-center gap-2 sm:gap-3",children:[1,2,3,4].map(i=>e.jsxs("div",{className:"flex-1 rounded-xl border border-border bg-card py-3 px-2 flex flex-col items-center gap-1.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-muted animate-shimmer"}),e.jsx("div",{className:"h-3 w-12 bg-muted rounded animate-shimmer"})]},i))})}),e.jsx("div",{className:"mb-5",children:e.jsxs("div",{className:"rounded-xl border border-border bg-card px-4 py-4 space-y-3",children:[e.jsx("div",{className:"h-4 w-24 bg-muted rounded animate-shimmer"}),e.jsx("div",{className:"h-8 w-40 bg-muted rounded animate-shimmer"}),e.jsx("div",{className:"h-4 w-full bg-muted rounded animate-shimmer"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-lg animate-shimmer"})]})})]})}):!l&&d===0&&!ke?e.jsx(Qe,{to:"/onboarding",replace:!0}):e.jsxs("div",{className:"bg-background",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8",children:[O==="just_created"&&F&&e.jsx("div",{className:"mb-3 animate-in",children:e.jsxs("div",{className:"relative rounded-2xl border border-primary/30 bg-gradient-to-br from-primary/8 via-primary/5 to-transparent dark:from-primary/12 px-5 py-4 sm:px-6 sm:py-5 overflow-hidden",children:[e.jsx("div",{className:"absolute -top-8 -right-8 w-32 h-32 rounded-full bg-primary/10 blur-2xl pointer-events-none"}),e.jsx("button",{type:"button",onClick:ee,className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground transition-colors p-0.5 z-10","aria-label":"Dismiss",children:e.jsx(U,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4 relative",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/25 animate-ping"}),e.jsx("div",{className:"relative w-10 h-10 sm:w-11 sm:h-11 rounded-full bg-primary/15 flex items-center justify-center",children:e.jsx(B,{className:"h-5 w-5 text-primary"})})]}),e.jsxs("div",{className:"flex-1 min-w-0 pr-8",children:[e.jsx("h2",{className:"text-base sm:text-lg font-bold text-foreground mb-0.5",children:s("welcome_hero_title",{count:F.count,defaultValue:"Welcome — your Discoveries are ready"})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3 leading-relaxed",children:s("welcome_hero_body",{count:F.count,defaultValue:`We saved ${F.count} cards from your trial. Pick up where you left off, or fine-tune your level first.`})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(k,{to:`/study?deck_id=${F.deck_id}`,onClick:ee,className:"inline-flex items-center gap-1.5 bg-primary hover:bg-primary/90 text-primary-foreground text-sm font-semibold px-4 py-2 rounded-xl transition-colors",children:[e.jsx(he,{className:"h-3.5 w-3.5"}),s("welcome_hero_cta",{defaultValue:"Study now"})]}),e.jsx(k,{to:"/profile",onClick:ee,className:"inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground px-3 py-2 transition-colors",children:s("welcome_hero_set_level",{defaultValue:"Set your level →"})})]})]})]})]})}),O==="level"&&e.jsx("div",{className:"mb-3 animate-in",children:e.jsxs("div",{className:"rounded-xl border border-primary/25 bg-primary/8 dark:bg-primary/10 px-4 py-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/20 animate-ping"}),e.jsx(B,{className:"relative h-5 w-5 text-primary"})]}),e.jsxs("p",{className:"text-sm min-w-0",children:[e.jsx("span",{className:"font-semibold text-primary",children:s("level_cta_highlight",{defaultValue:"Set your level"})}
2)," ",e.jsx("span",{className:"text-foreground/80",children:s("level_cta_text",{defaultValue:"We defaulted to Beginner — adjust it to get cards matched to you."})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsxs(k,{to:"/profile",className:"text-sm font-semibold text-primary hover:opacity-75 transition-opacity whitespace-nowrap inline-flex items-center gap-1",children:[s("level_cta_action",{defaultValue:"Open profile"}),e.jsx(z,{className:"h-3.5 w-3.5"})]}),e.jsx("button",{type:"button",onClick:Fe,className:"text-muted-foreground hover:text-foreground transition-colors p-0.5","aria-label":"Dismiss",children:e.jsx(U,{className:"h-3.5 w-3.5"})})]})]})}),O==="referral"&&e.jsx("div",{className:"mb-5 animate-in",children:e.jsxs("div",{className:"rounded-xl border border-primary/25 bg-primary/8 dark:bg-primary/10 px-4 py-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(cs,{className:"h-5 w-5 text-language flex-shrink-0"}),e.jsxs("p",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-language dark:text-language",children:s("referral_banner_highlight")}),e.jsx("span",{className:"text-foreground/80",children:s("referral_banner_text")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{const i=Ee?.referral_link;i?navigator.clipboard.writeText(i).then(()=>{We.success(s("referral_link_copied"))}):window.location.href="/profile?tab=billing"},className:"text-sm font-semibold text-language dark:text-language hover:opacity-75 transition-opacity whitespace-nowrap",children:s("referral_banner_cta")}),e.jsx("button",{type:"button",onClick:Re,className:"text-muted-foreground hover:text-foreground transition-colors p-0.5","aria-label":"Dismiss",children:e.jsx(U,{className:"h-4 w-4"})})]})]})}),e.jsxs("div",{className:"mb-5 animate-in flex items-center justify-between gap-3","data-tour":"streak",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight text-foreground truncate",children:[s(Qs()),T?`, ${T}`:""]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:G??s("subtitle")})]}),E>0&&e.jsxs("div",{className:"flex-shrink-0 inline-flex items-center gap-1 px-2.5 py-1 rounded-full bg-amber-500/10 border border-amber-500/20",title:s("common:dashboard_streak_inline",{count:E,defaultValue:`${E}-day streak`}),children:[e.jsx(Y,{className:"h-3.5 w-3.5 text-amber-500"}),e.jsx("span",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400",children:E})]})]}),O==="comeback"&&V&&e.jsxs("div",{className:"mb-5 animate-in",children:[V.type==="at_risk"&&e.jsxs("div",{className:"rounded-xl bg-amber-500/8 border border-amber-500/25 px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:"h-5 w-5 text-amber-500 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("streak_at_risk",{count:V.streak,defaultValue:`Your ${V.streak}-day streak ends tonight — keep it going!`})})]}),e.jsx(k,{to:"/study",children:e.jsx($,{variant:"outline",size:"sm",className:"text-xs border-amber-500/40 text-amber-600 dark:text-amber-400 hover:bg-amber-500/10 flex-shrink-0 ml-3",children:s("study_now",{defaultValue:"Study now"})})})]}),V.type==="milestone"&&e.jsxs("div",{className:"rounded-xl bg-primary/8 border border-primary/25 px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(re,{className:"h-5 w-5 text-primary flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("streak_milestone",{next:V.next,defaultValue:`One more day to reach a ${V.next}-day streak!`})})]}),e.jsx(k,{to:"/study",children:e.jsx($,{variant:"outline",size:"sm",className:"text-xs flex-shrink-0 ml-3",children:s("study_now",{defaultValue:"Study now"})})})]})]}),O==="first_session"&&e.jsx("div",{className:"mb-5 animate-in",children:e.jsxs("div",{className:"rounded-xl bg-primary/10 px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5 text-primary flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium text-primary",children:s("first_session_message")})]}),e.jsx("button",{onClick:Ve,className:"text-sm font-semibold text-primary hover:text-primary/70 ml-4 flex-shrink-0",children:s("dismiss")})]})}),e.jsx("div",{className:"mb-6 animate-in","data-tour":"study",children:m?e.jsx("div",{className:"rounded-xl border border-border bg-card px-4 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted animate-shimmer flex-shrink-0"}),e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-6 w-36 bg-muted rounded animate-shimmer"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"h-8 w-28 bg-muted rounded-lg animate-shimmer"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-lg animate-shimmer"})]})]})}):u>0?e.jsxs("div",{className:"relative rounded-2xl border border-primary/40 bg-primary/[0.04] dark:bg-primary/[0.07] overflow-hidden px-5 py-5 sm:px-7 sm:py-6",children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary rounded-l-2xl"}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[e.jsx("div",{className:"w-14 h-14 roun
2ded-xl flex items-center justify-center flex-shrink-0 bg-primary/15",children:e.jsx(ms,{className:"h-7 w-7 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-4xl sm:text-5xl font-extrabold text-foreground leading-none tabular-nums",children:u}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1.5",children:s("cards_due_label",{count:u})})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 sm:shrink-0",children:[e.jsxs($,{variant:"brand",size:"lg",onClick:()=>ne(!0),className:"w-full sm:w-auto",children:[e.jsx(he,{className:"mr-1.5 h-4 w-4 shrink-0"}),s("quick_review")]}),e.jsx(k,{to:"/study",className:"w-full sm:w-auto",children:e.jsxs($,{variant:"outline",size:"lg",className:"w-full sm:w-auto",children:[s("review_all",{count:u}),e.jsx(z,{className:"ml-1.5 h-4 w-4 shrink-0"})]})})]})]})]}):e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 rounded-xl bg-success/5 border border-success/20",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ye,{className:"h-5 w-5 text-success flex-shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s("all_caught_up")})]}),e.jsx(k,{to:"/discover",children:e.jsxs($,{variant:"ghost",size:"sm",className:"text-xs",children:[s("common:discover_title",{defaultValue:"Discover"})," ",e.jsx(z,{className:"ml-1 h-3 w-3"})]})})]})}),_.weekCards>0&&e.jsx("div",{className:"mb-6 animate-in",children:e.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-card px-3 py-3 sm:px-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s("week_accuracy",{defaultValue:"Accuracy this week"})}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground tabular-nums mt-0.5",children:_.weekAccuracy!==null?`${_.weekAccuracy}%`:"—"})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card px-3 py-3 sm:px-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s("week_reviewed",{defaultValue:"Reviewed this week"})}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground tabular-nums mt-0.5",children:_.weekCards})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card px-3 py-3 sm:px-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s("month_reviewed",{defaultValue:"Reviewed this month"})}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground tabular-nums mt-0.5",children:_.monthCards})]})]})}),e.jsx("div",{className:"mb-6 animate-in","data-tour":"actions",children:e.jsxs("div",{className:"flex items-stretch gap-2 sm:gap-3",children:[e.jsx(k,{to:"/discover",className:"flex-1 flex",title:s("common:discover_title",{defaultValue:"Discover"}),children:e.jsxs("div",{className:"w-full flex flex-col items-center justify-start gap-1.5 py-2.5 px-1 rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-primary/[0.04] transition-colors",children:[e.jsx("div",{className:"w-[26px] h-[26px] sm:w-7 sm:h-7 rounded-md bg-primary/15 flex items-center justify-center",children:e.jsx(us,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 text-primary"})}),e.jsx("span",{className:"text-[10px] sm:text-[11px] font-medium text-foreground text-center leading-tight line-clamp-2",children:s("common:discover_title",{defaultValue:"Discover"})})]})}),e.jsx(k,{to:"/chat",className:"flex-1 flex",title:s("practice_with_ai"),children:e.jsxs("div",{className:"w-full flex flex-col items-center justify-start gap-1.5 py-2.5 px-1 rounded-xl border border-border bg-card hover:border-violet-500/30 hover:bg-violet-500/[0.03] transition-colors",children:[e.jsx(ce,{size:26}),e.jsx("span",{className:"text-[10px] sm:text-[11px] font-medium text-foreground text-center leading-tight line-clamp-2",children:s("practice_with_ai")})]})}),e.jsx(k,{to:"/generate",className:"flex-1 flex",title:s("generate_a_deck"),children:e.jsxs("div",{className:"w-full flex flex-col items-center justify-start gap-1.5 py-2.5 px-1 rounded-xl border border-border bg-card hover:border-amber-500/30 hover:bg-amber-500/[0.03] transition-colors",children:[e.jsx("div",{className:"w-[26px] h-[26px] sm:w-7 sm:h-7 rounded-md bg-amber-500/10 flex items-center justify-center",children:e.jsx(B,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 text-amber-500"})}),e.jsx("span",{className:"text-[10px] sm:text-[11px] font-medium text-foreground text-center leading-tight line-clamp-2",children:s("generate_a_deck")})]})}),e.jsx(k,{to:"/flashcards",className:"flex-1 flex",title:s("browse_flashcards"),children:e.jsxs("div",{className:"w-full flex flex-col items-center justify-start gap-1.5 py-2.5 px-1 rounded-xl border border-border bg-card hover:border-success/30 hover:bg-success/[0.03] transition-colors",children:[e.jsx("div",{className:"w-[26px] h-[26px] sm:w-7 sm:h-7 rounded-md bg-success/10 flex items-center justify-center",children:e.jsx(xs,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 text-success"})}),e.jsx("span",{className:"text-[10px] sm:text-[11px] font-medium text-foreground text-center leading-tight line-clamp-2",children:s("browse_flashcards")})]})})]})}),e.jsx(Hs,{enabled:O===null&&!a&&d>0}),e.jsxs("div",{className:"animate-in",children:[e.jsx("div",{className:"mb-5",children:e.jsx(Ks,{})}),I.length>0&&e.jsx("div",{className:"mb-5","data-tour":"vocab",children:e.jsx(Us,{userId:r?.id?.toString()})}),!a&&I.length===0&&C.length===0&&e.jsx("div",{className:"mb-5","data-tour":"vocab",children:e.jsxs(k,{to:"/chat",className:"flex items-center gap-4 px-5 py-4 rounded-xl border border-border bg-card hover:bg-muted/30 transition-colors group",children:[e.jsx(ce,{size:40}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground group-hover:text-primary transition-colors",children:s("learning_tip_title")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:s("learning_tip_description")})]}),e.jsx(z,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0"})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[(J.length>0||Z.length>0)&&e.jsx(k,{to:"/achievements",children:e.jsxs("div",{className:"flex flex-col items-center gap-0.5 px-3 py-2.5 rounded-xl border border-border bg-card hover:bg-muted/40 transition-colors text-center",children:[e.jsx(re,{className:"h-4 w-4 text-amber-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:s("achievements")})]})}),e.jsxs("button",{type:"button",onClick:()=>De(!K),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 rounded-xl border transition-colors text-center ${K?"border-primary/40 bg-primary/5":"border-border bg-card hover:bg-muted/40"}`,children:[e.jsx(hs,{className:`h-4 w-4 ${K?"text-primary":"text-blue-500"}`}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:s("activity_label")}),K?e.jsx(fs,{className:"h-2.5 w-2.5 text-muted-foreground"}
2):e.jsx(gs,{className:"h-2.5 w-2.5 text-muted-foreground/40"})]})]}),e.jsx(k,{to:"/insights",children:e.jsxs("div",{className:"flex flex-col items-center gap-1 px-3 py-2.5 rounded-xl border border-border bg-card hover:bg-muted/40 transition-colors text-center",children:[e.jsx(ps,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:s("insights_label")})]})})]}),K&&e.jsx(js,{className:"mt-3 animate-in fade-in duration-200",children:e.jsx(Ns,{className:"pt-4 pb-4",children:e.jsx(Bs,{records:g,dailyGoal:p})})})]})]}),e.jsx(zs,{open:Ce,onClose:()=>ne(!1),flashcards:b??[],onComplete:Se})]})}export{vt 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.