1import{I as ce,z as g,N as e,cx as R,O as E,K as D,eh as Z,f0 as ee,f1 as te,ad as de,eC as xe,cw as me,dv as fe,cp as ue,e_ as ye,dw as he,dN as be,dO as pe}from"./index-BLLX5Hn7.js";import{f as ge,s as je}from"./shareRetro-CfcSdsr6.js";import{R as se,X as ve,Y as we,T as Ne,B as Fe,C as $e}from"./generateCategoricalChart-DqImlECw.js";import{B as Se}from"./BarChart-DLjXKCau.js";import{C as Me}from"./CartesianGrid-CPOOLN-V.js";import{P as Ce,a as Te}from"./PieChart-DW2hVchQ.js";import"./clsx-B-dksMZM.js";import"./tiny-invariant-CopsF_GD.js";import"./diverging-DL4tkKFS.js";import"./range-OtVwhkKS.js";import"./string-DKhJvYFa.js";import"./index-DIdgi3-j.js";import"./index-Chjiymov.js";import"./PolarAngleAxis-Bwbz9csS.js";const G=[{key:"30d",i18nKey:"diff.window30d",days:30},{key:"90d",i18nKey:"diff.window90d",days:90},{key:"6m",i18nKey:"diff.window6m",days:180},{key:"12m",i18nKey:"diff.window12m",days:365}],ke={essential:"Estudo essencial",conversation:"Conversação",listening:"Compreensão auditiva",pronunciation:"Pronúncia",shadowing:"Shadowing",dictation:"Ditado",reading:"Leitura",writing:"Escrita",review:"Revisão SRS",flashcard:"Flashcards",exercise_pool:"Banco de exercÃcios",exercise_lesson:"ExercÃcios (lição)",exercise_chapter:"ExercÃcios (capÃtulo)",simulado:"Simulados",course_lesson:"Aulas de curso",course_activity:"Atividade em curso",planner_session:"Planner",planner_task:"Planner â tarefas",navigation:"Navegação"},Y=t=>{if(!t||t<0)return"0m";const a=Math.floor(t/60),s=t%60;return a>0&&s>0?`${a}h ${s}m`:a>0?`${a}h`:`${s}m`},_=t=>t.toISOString().slice(0,10);function K(t,a){const s=new Date(t);return s.setUTCDate(s.getUTCDate()+a),s}async function q(t,a){const s=localStorage.getItem("authToken");if(!s)return{error:"unauthenticated"};try{const i=new URLSearchParams({period:"range",from:t,to:a}),o=await fetch(`${D}/activity/detailed?${i}`,{headers:{Authorization:`Bearer ${s}`}});if(o.status===401)return{error:"unauthenticated"};if(o.status===429)return{error:"rate_limited"};if(!o.ok)return{error:"fetch_failed"};const l=await o.json();return l!=null&&l.success?l:{error:"fetch_failed"}}catch{return{error:"network"}}}function H(t){if(!t||t.error)return{totalMinutes:0,activeDays:0,avgPerActiveDay:0,exercises:0,correct:0,accuracy:null,themesTouched:0,sessions:0};const a=t.daily||[],s=a.reduce((n,d)=>n+(d.minutes||0),0),i=a.filter(n=>(n.minutes||0)>0).length,o=a.reduce((n,d)=>n+(d.exercises||0),0),l=a.reduce((n,d)=>n+(d.correct||0),0),r=a.reduce((n,d)=>n+(d.sessions||0),0);return{totalMinutes:s,activeDays:i,avgPerActiveDay:i>0?Math.round(s/i):0,exercises:o,correct:l,accuracy:o>0?Math.round(l/o*100):null,themesTouched:(t.byTheme||[]).filter(n=>(n.minutes||0)>0).length,sessions:r}}function Ee(t=[],a=[],s=8){var f;const i=t||[],o=a||[],l=new Map(o.map(x=>[x.themeId,x.minutes||0])),r=new Map;for(const x of i)x.themeName&&r.set(x.themeId,x.themeName);for(const x of o)!r.has(x.themeId)&&x.themeName&&r.set(x.themeId,x.themeName);const n=new Set([...i.map(x=>x.themeId),...l.keys()]),d=[];for(const x of n){const m=((f=i.find(c=>c.themeId===x))==null?void 0:f.minutes)||0,h=l.get(x)||0;d.push({themeId:x,themeName:r.get(x)||null,now:m,prev:h,delta:m-h,isNew:h===0&&m>0,isLost:h>0&&m===0})}return d.sort((x,m)=>Math.abs(m.delta)-Math.abs(x.delta)),d.slice(0,s)}function Ae(t={},a={}){const s=new Set([...Object.keys(t),...Object.keys(a)]),i=[];for(const o of s){const l=t[o]||{minutes:0},r=a[o]||{minutes:0};i.push({key:o,label:ke[o]||o,nowMin:l.minutes||0,prevMin:r.minutes||0,delta:(l.minutes||0)-(r.minutes||0)})}return i.sort((o,l)=>Math.abs(l.delta)-Math.abs(o.delta)),i.filter(o=>o.nowMin>0||o.prevMin>0).slice(0,10)}const ae=({delta:t,suffix:a="",isPercentage:s=!1,theme:i})=>{const o=t>0,l=t<0,r=o?Z:l?ee:te,n=o?"text-emerald-500":l?"text-rose-500":"text-slate-400",d=o?"+":"";return e.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[11px] font-semibold ${n}`,style:i!=null&&i.numberFont?{fontFamily:i.numberFont}:void 0,children:[e.jsx(r,{className:"w-3 h-3"}),d,s?`${t}pp`:t,a]})},M=({label:t,prev:a,now:s,delta:i,format:o="number",unit:l="",isDark:r,theme:n,prevAvailable:d=!0})=>{const f=m=>m==null?"â":o==="minutes"?Y(m):o==="percent"?`${m}%`:`${m}${l}`,x=d&&a!=null&&s!=null&&i!==0;return e.jsxs("div",{className:`border rounded-xl p-3 2 ${r?"bg-slate-800/60 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsx("div",{className:`text-[10px] uppercase tracking-wider mb-2 3 ${r?"text-slate-500":"text-slate-400"}`,style:n!=null&&n.bodyFont?{fontFamily:n.bodyFont}:void 0,children:t}),e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[e.jsx("span",{className:`text-base font-bold ${r?"text-white":"text-slate-800"}`,style:n!=null&&n.numberFont?{fontFamily:n.numberFont}:void 0,children:f(s)}),d&&a!=null&&e.jsxs("span",{className:`text-[11px] ${r?"text-slate-500":"text-slate-400"}`,style:n!=null&&n.bodyFont?{fontFamily:n.bodyFont}:void 0,children:["antes ",f(a)]})]}),x&&e.jsx("div",{className:"mt-1",children:e.jsx(ae,{delta:o==="percent"?i:o==="minutes"?Math.round(i):i,isPercentage:o==="percent",suffix:o==="minutes"?"m":o==="percent"?"":l,theme:n})})]})},Q=({label:t,prevMin:a,nowMin:s,delta:i,isNew:o,isLost:l,isDark:r,theme:n,t:d})=>{const f=Math.max(s,a,1),x=s/f*100,m=a/f*100,h=n!=null&&n.bodyFont?{fontFamily:n.bodyFont}:void 0,c=n!=null&&n.numberFont?{fontFamily:n.numberFont}:void 0;return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1 gap-2",children:[e.jsxs("span",{className:`text-[12px] truncate flex-1 ${r?"text-slate-200":"text-slate-700"}`,style:h,children:[t,o&&e.jsx("span",{className:"ml-2 text-[9px] font-bold text-emerald-500 uppercase",children:d("diff.newLabel")}),l&&e.jsx("span",{className:"ml-2 text-[9px] font-bold text-amber-500 uppercase",children:d("diff.stoppedLabel")})]}),e.jsx(ae,{delta:Math.round(i),suffix:"m",theme:n})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsxs("div",{className:"flex-1 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] w-10 ${r?"text-slate-500":"text-slate-400"}`,style:h,children:d("diff.before")}),e.jsx("div",{className:`flex-1 h-1.5 rounded-full overflow-hidden ${r?"bg-slate-800":"bg-slate-100"}`,children:e.jsx("div",{className:`h-full rounded-full ${r?"bg-slate-600":"bg-slate-300"}`,style:{width:`${m}%`}})}),e.jsx("span",{className:`text-[9px] w-10 text-right tabular-nums ${r?"text-slate-500":"text-slate-400"}`,style:c,children:Y(a)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] w-10 ${r?"text-cyan-400":"text-cyan-600"}`,style:h,children:d("diff.now")}),e.jsx("div",{className:`flex-1 h-1.5 rounded-full overflow-hidden ${r?"bg-slate-800":"bg-slate-100"}`,children:e.jsx("div",{className:"h-full rounded-full bg-cyan-500",style:{width:`${x}%`}})}),e.jsx("span",{className:`text-[9px] w-10 text-right font-medium tabular-nums ${r?"text-cyan-400":"text-cyan-600"}`,style:c,children:Y(s)})]})]})})]})};function Pe(t){if(!t)return"â";const a=String(t);
3if(/^[a-f0-9]{24}$/i.test(a))return`Tema ${a.slice(-4).toUpperCase()}`;let s=a.replace(/^wiki-[a-z]{2}-/,"").replace(/^draft-/,"").replace(/-/g," ");return s.length>0&&(s=s[0].toUpperCase()+s.slice(1)),s}const Le=({isDark:t,theme:a})=>{const s=ce(),[i,o]=g.useState("90d"),[l,r]=g.useState(!0),[n,d]=g.useState(null),[f,x]=g.useState(null),m=g.useMemo(()=>{const u=G.find(w=>w.key===i);return(u==null?void 0:u.days)||90},[i]);g.useEffect(()=>{let u=!1;r(!0);const w=new Date,P=_(K(w,-m+1)),S=_(w),I=_(K(w,-m*2+1)),B=_(K(w,-m));return Promise.all([q(P,S),q(I,B)]).then(([O,z])=>{u||(d(O),x(z),r(!1))}),()=>{u=!0}},[m]);const h=(n==null?void 0:n.error)||null,c=(f==null?void 0:f.error)||null,v=!!h,p=g.useMemo(()=>H(n),[n]),b=g.useMemo(()=>H(f),[f]),F=!c,N=g.useMemo(()=>Ee(n==null?void 0:n.byTheme,f==null?void 0:f.byTheme,8).map(w=>({...w,themeName:w.themeName||Pe(w.themeId)})),[n,f]),A=g.useMemo(()=>Ae(n==null?void 0:n.byModule,f==null?void 0:f.byModule),[n,f]),T=p.totalMinutes>0||b.totalMinutes>0;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:`border rounded-xl p-3 4 ${t?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsx("div",{className:`text-[11px] mb-2 ${t?"text-slate-400":"text-slate-500"}`,style:{fontFamily:a==null?void 0:a.bodyFont},children:s("diff.compareLast")}),e.jsx("div",{className:"flex gap-1",children:G.map(u=>e.jsx("button",{onClick:()=>o(u.key),className:`flex-1 px-2 py-1.5 rounded-lg text-[11px] font-medium transition-all cursor-pointer 5 ${i===u.key?t?"bg-cyan-500/20 text-cyan-400":"bg-cyan-50 text-cyan-700 ring-1 ring-cyan-200":t?"text-slate-400 hover:bg-slate-700/50":"text-slate-500 hover:bg-slate-100"}`,style:{fontFamily:a==null?void 0:a.bodyFont},children:s(u.i18nKey)},u.key))})]}),l&&e.jsxs("div",{className:`flex items-center justify-center py-12 6 ${t?"text-slate-500":"text-slate-400"}`,children:[e.jsx(R,{className:"w-5 h-5 animate-spin mr-2"}),e.jsx("span",{className:"text-sm",children:s("diff.computingProgress")})]}),!l&&v&&e.jsxs("div",{className:`border rounded-xl p-6 text-center 7 ${t?"bg-rose-500/10 border-rose-500/30 text-rose-300":"bg-rose-50 border-rose-200 text-rose-700"}`,children:[e.jsx("p",{className:"text-sm font-medium",style:{fontFamily:a==null?void 0:a.bodyFont},children:"Não consegui carregar a comparação."}),e.jsx("p",{className:"text-[11px] mt-1 opacity-80",style:{fontFamily:a==null?void 0:a.bodyFont},children:h==="unauthenticated"?"Faça login para ver sua evolução.":h==="rate_limited"?"Muitas requisições. Tente em alguns minutos.":"Verifique sua conexão e tente novamente."})]}),!l&&!v&&!T&&e.jsxs("div",{className:`border rounded-xl p-8 text-center 8 ${t?"bg-slate-800/60 border-slate-700/80 text-slate-500":"bg-white border-slate-200 text-slate-400"}`,children:[e.jsx("p",{className:"text-sm",style:{fontFamily:a==null?void 0:a.bodyFont},children:s("diff.notEnoughData")}),e.jsx("p",{className:"text-[11px] mt-1 opacity-70",style:{fontFamily:a==null?void 0:a.bodyFont},children:s("diff.studyMore")})]}),!l&&!v&&T&&e.jsxs(e.Fragment,{children:[e.jsxs(E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25},className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[e.jsx(M,{label:s("diff.totalTime"),prev:b.totalMinutes,now:p.totalMinutes,delta:p.totalMinutes-b.totalMinutes,format:"minutes",isDark:t,theme:a,prevAvailable:F}),e.jsx(M,{label:s("diff.activeDays"),prev:b.activeDays,now:p.activeDays,delta:p.activeDays-b.activeDays,unit:` ${s("diff.activeDaysUnit")}`,isDark:t,theme:a,prevAvailable:F}),e.jsx(M,{label:s("diff.avgPerActiveDay"),prev:b.avgPerActiveDay,now:p.avgPerActiveDay,delta:p.avgPerActiveDay-b.avgPerActiveDay,format:"minutes",isDark:t,theme:a,prevAvailable:F}),e.jsx(M,{label:s("diff.exercises"),prev:b.exercises,now:p.exercises,delta:p.exercises-b.exercises,isDark:t,theme:a,prevAvailable:F}),e.jsx(M,{label:s("diff.accuracy"),prev:b.accuracy,now:p.accuracy,delta:p.accuracy!=null&&b.accuracy!=null?p.accuracy-b.accuracy:0,format:"percent",isDark:t,theme:a,prevAvailable:F}),e.jsx(M,{label:s("diff.themesStudied"),prev:b.themesTouched,now:p.themesTouched,delta:p.themesTouched-b.themesTouched,isDark:t,theme:a,prevAvailable:F})]}),!F&&e.jsx("div",{className:`text-[11px] px-3 py-2 rounded-lg border 9 ${t?"bg-slate-800/40 border-slate-700/60 text-slate-400":"bg-slate-50 border-slate-200 text-slate-500"}`,style:{fontFamily:a==null?void 0:a.bodyFont}
9,children:"Sem dados na janela anterior â mostrando só a janela atual."}),N.length>0&&e.jsxs(E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,delay:.05},className:`border rounded-xl p-4 10 ${t?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsxs("div",{className:`text-xs font-semibold mb-3 flex items-center justify-between 11 ${t?"text-slate-200":"text-slate-700"}`,style:{fontFamily:a==null?void 0:a.bodyFont},children:[e.jsx("span",{children:s("diff.changeBySubject")}),e.jsxs("span",{className:`text-[10px] font-normal 12 ${t?"text-slate-500":"text-slate-400"}`,children:[s("diff.top")," ",N.length]})]}),e.jsx("div",{className:`space-y-1 divide-y divide-dashed 13 ${t?"divide-slate-700/40":"divide-slate-200/70"}`,children:N.map((u,w)=>e.jsx(Q,{label:u.themeName,prevMin:u.prev,nowMin:u.now,delta:u.delta,isNew:u.isNew,isLost:u.isLost,isDark:t,theme:a,t:s},u.themeId||`theme-${w}`))})]}),A.length>0&&e.jsxs(E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,delay:.1},className:`border rounded-xl p-4 14 ${t?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsx("div",{className:`text-xs font-semibold mb-3 15 ${t?"text-slate-200":"text-slate-700"}`,style:{fontFamily:a==null?void 0:a.bodyFont},children:s("diff.changeByModule")}),e.jsx("div",{className:`space-y-1 divide-y divide-dashed 16 ${t?"divide-slate-700/40":"divide-slate-200/70"}`,children:A.map(u=>e.jsx(Q,{label:u.label,prevMin:u.prevMin,nowMin:u.nowMin,delta:u.delta,isDark:t,theme:a,t:s},u.key))})]})]})]})},_e="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Silkscreen:wght@400;700&family=DM+Sans:wght@400;500;600;700&display=swap",U={kawaii:{key:"kawaii",label:"Kawaii",headingFont:"'Silkscreen', monospace",bodyFont:"'Space Grotesk', sans-serif",numberFont:"'Space Grotesk', sans-serif",accentColors:{streak:"#eab308",today:"#10b981",week:"#8b5cf6",month:"#ec4899",total:"#f97316"},showCompanion:!0},clean:{key:"clean",label:"Minimalista",headingFont:"'DM Sans', sans-serif",bodyFont:"'DM Sans', sans-serif",numberFont:"'DM Sans', sans-serif",accentColors:{streak:"#525252",today:"#525252",week:"#525252",month:"#525252",total:"#525252"},accentColorsDark:{streak:"#d4d4d4",today:"#d4d4d4",week:"#d4d4d4",month:"#d4d4d4",total:"#d4d4d4"},showCompanion:!1},trophy:{key:"trophy",label:"Competitivo",headingFont:"'Space Grotesk', sans-serif",bodyFont:"'Space Grotesk', sans-serif",numberFont:"'Space Grotesk', sans-serif",accentColors:{streak:"#ea580c",today:"#0891b2",week:"#7c3aed",month:"#db2777",total:"#059669"},showCompanion:!1,showRank:!0}},$=t=>{if(t==null||t<0)return"N/A";if(!t)return"0m";const a=Math.floor(t/60),s=t%60;return a>0&&s>0?`${a}h ${s}m`:a>0?`${a}h`:`${s}m`},V=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],Re=["D","S","T","Q","Q","S","S"],X=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316","#84cc16","#6366f1","#14b8a6","#e11d48"],Ie={essential:"Estudo essencial",conversation:"Conversação",listening:"Compreensão auditiva",pronunciation:"Pronúncia",shadowing:"Shadowing",dictation:"Ditado",reading:"Leitura",writing:"Escrita",review:"Revisão SRS",flashcard:"Flashcards",exercise_pool:"Banco de exercÃcios",exercise_lesson:"ExercÃcios (lição)",exercise_chapter:"ExercÃcios (capÃtulo)",simulado:"Simulados",course_lesson:"Aulas de curso",course_activity:"Atividade em curso",planner_session:"Planner",planner_task:"Planner â tarefas",navigation:"Navegação"},J={essential:"#3b82f6",conversation:"#8b5cf6",listening:"#10b981",pronunciation:"#f59e0b",shadowing:"#6366f1",dictation:"#ec4899",reading:"#14b8a6",writing:"#f97316",review:"#ef4444",flashcard:"#a855f7",exercise_pool:"#06b6d4",exercise_lesson:"#2563eb",exercise_chapter:"#1d4ed8",simulado:"#dc2626",course_lesson:"#059669",course_activity:"#047857",planner_session:"#7c3aed",planner_task:"#9333ea",navigation:"#64748b"};async function Be(t="month"){try{const a=localStorage.getItem("authToken");if(!a)return null;const s=await fetch(`${D}/activity/detailed?period=${t}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)return null;const i=await s.json();return i!=null&&i.success?i:null}catch{return null}}const Oe=({todayMinutes:t=0,streak:a=0,isDark:s,theme:i})=>{const o=t<=0?"sleeping":t<15?"waking":t<30?"happy":t<60?"studying":t<90?"focused":"fire",l={sleeping:"ð¤",waking:"ð¥±",happy:"ð",studying:"ð",focused:"â¨",fire:"
16ð¥"}[o],r=a<3?0:a<7?1:a<14?2:a<30?3:4,n=[{l:"Semente",i:"ð±"},{l:"Broto",i:"ð¿"},{l:"Planta",i:"ð³"},{l:"Florescendo",i:"ð¸"},{l:"Ãrvore mágica",i:"ð"}][r],d=Math.min(t*2,300)+Math.min(a*5,100),f=Math.floor(d/100)+1,x=["#a5d6a7","#81c784","#66bb6a","#4caf50","#43a047"][r],m=o!=="sleeping",h=o==="fire",c=o==="focused"||h,v=t<=0?a>0?"Sua sequência te espera!":"Comece o dia com uma sessão!":t<15?"Bom começo! Continue para ganhar XP.":t<30?"Indo bem! Seu companion está feliz.":t<60?a>=7?`${a} dias seguidos!`:"Excelente sessão!":t<90?"Foco impressionante!":a>=30?`ð ${a} dias de dedicação!`:"Sessão épica! Imparável.";return e.jsx("div",{className:`border rounded-xl overflow-hidden 17 ${s?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 p-3",children:[e.jsx(E.div,{className:"flex-shrink-0 w-36 sm:w-44",animate:m?{y:[0,-2,0]}:{},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"},children:e.jsxs("svg",{viewBox:"0 0 140 100",className:"w-full",children:[e.jsx("rect",{x:"5",y:"0",width:"130",height:"68",fill:s?"#0f172a":"#e8f5e9",rx:"8"}),!s&&e.jsx("circle",{cx:"115",cy:"18",r:"8",fill:"#fff176",opacity:".6"}),s&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"25",cy:"12",r:"1",fill:"#fdd835",opacity:".4"}),e.jsx("circle",{cx:"80",cy:"8",r:"1",fill:"#fdd835",opacity:".3"}),e.jsx("circle",{cx:"110",cy:"16",r:"1",fill:"#fdd835",opacity:".4"})]}),e.jsx("ellipse",{cx:"70",cy:"78",rx:"62",ry:"16",fill:s?"#1a2332":"#8bc34a"}),e.jsx("ellipse",{cx:"70",cy:"81",rx:"50",ry:"11",fill:s?"#0f1a27":"#6d9b2e"}),r>=1&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"28",cy:"70",r:"2.5",fill:"#f48fb1"}),e.jsx("line",{x1:"28",y1:"70",x2:"28",y2:"78",stroke:"#66bb6a",strokeWidth:"1"})]}),r>=2&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"110",cy:"72",r:"2.5",fill:"#ce93d8"}),e.jsx("line",{x1:"110",y1:"72",x2:"110",y2:"80",stroke:"#66bb6a",strokeWidth:"1"})]}),r>=3&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"48",cy:"74",r:"2",fill:"#90caf9"}),e.jsx("line",{x1:"48",y1:"74",x2:"48",y2:"80",stroke:"#66bb6a",strokeWidth:"1"})]}),e.jsxs("g",{children:[e.jsx("ellipse",{cx:"70",cy:"64",rx:r>=3?14:11,ry:r>=3?12:10,fill:x}),o==="sleeping"?e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M63 59 Q66 61 69 59",stroke:"#2e7d32",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M71 59 Q74 61 77 59",stroke:"#2e7d32",strokeWidth:"1.5",fill:"none"}),e.jsx("text",{x:"80",y:"52",fontSize:"7",fill:s?"#475569":"#9e9e9e",fontWeight:"bold",opacity:".5",children:"z"})]}):e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"65",cy:"59",r:"2.5",fill:"white"}),e.jsx("circle",{cx:"75",cy:"59",r:"2.5",fill:"white"}),e.jsx("circle",{cx:c?"66":"65",cy:"59",r:"1.5",fill:"#1b5e20"}),e.jsx("circle",{cx:c?"76":"75",cy:"59",r:"1.5",fill:"#1b5e20"}),e.jsx("circle",{cx:"66",cy:"58",r:".5",fill:"white"}),e.jsx("circle",{cx:"76",cy:"58",r:".5",fill:"white"}),m&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"59",cy:"63",r:"2",fill:"#f48fb1",opacity:".3"}),e.jsx("circle",{cx:"81",cy:"63",r:"2",fill:"#f48fb1",opacity:".3"})]}),h?e.jsx("path",{d:"M65 65 Q70 70 75 65",stroke:"#1b5e20",strokeWidth:"1.2",fill:"none"}):e.jsx("path",{d:"M67 64 Q70 67 73 64",stroke:"#1b5e20",strokeWidth:"1.2",fill:"none"})]}),r>=1&&e.jsx("ellipse",{cx:"61",cy:"52",rx:"3",ry:"5",fill:"#81c784",transform:"rotate(-20 61 52)"}),r>=2&&e.jsx("ellipse",{cx:"79",cy:"52",rx:"3",ry:"5",fill:"#66bb6a",transform:"rotate(20 79 52)"}),r>=3&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"70",cy:"49",r:"2.5",fill:"#fff176"}),e.jsx("circle",{cx:"70",cy:"49",r:"1.2",fill:"#ffab40"})]}),r>=4&&e.jsx("polygon",{points:"63,48 66,43 70,48 74,43 77,48",fill:"#fdd835",stroke:"#f9a825",strokeWidth:".4"}),(o==="studying"||o==="focused")&&e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"55",y:"68",width:"9",height:"7",rx:"1",fill:"#42a5f5"}),e.jsx("rect",{x:"56",y:"69",width:"7",height:"5",rx:"1",fill:"#e3f2fd"})]})]}),h&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"58",cy:"48",r:"2",fill:"#ff9800",opacity:".5"}),e.jsx("circle",{cx:"82",cy:"47",r:"1.5",fill:"#ff5722",opacity:".4"})]})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full 18 ${s?"bg-slate-700 text-slate-300":"bg-slate-100 text-slate-600"}`,style:{fontFamily:i.bodyFont},children:[n.i," ",n.l]}),a>0&&e.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full 19 ${s?"bg-orange-500/15 text-orange-400":"bg-orange-50 text-orange-600"}`,children:["ð¥ ",a,"d"]}),e.jsx("span",{className:"ml-auto text-base",children:l})]}),e.jsx("p",{className:`text-xs sm:text-sm leading-relaxed mb-2 20 ${s?"text-slate-300":"text-slate-600"}`,style:{fontFamily:i.bodyFont},children:v}),e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsxs("span",{className:`text-[10px] font-bold ${s?"text-amber-400":"text-amber-600"}`,style:{fontFamily:i.headingFont},children:["Lv.",f]}),e.jsxs("span",{className:`text-[9px] ${s?"text-slate-500":"text-slate-400"}`,style:{fontFamily:i.bodyFont},children:[d,"/400 XP"]})]}),e.jsx("div",{className:`h-1.5 rounded-full overflow-hidden ${s?"bg-slate-700":"bg-slate-200"}`,children:e.jsx(E.div,{className:"h-full rounded-full",style:{background:"linear-gradient(90deg,#f59e0b,#fbbf24)"},initial:{width:0},animate:{width:`${Math.min(100,d/400*100)}%`},transition:{duration:1}})})]})]})})},ze=({stats:t,isDark:a,theme:s})=>{const i=t.totalTimeMinutes||0,o=i>=36e3?{label:"Diamante",icon:"ð",color:"#22d3ee"}:i>=18e3?{label:"Platina",icon:"âª",color:"#94a3b8"}:i>=7200?{label:"Ouro",icon:"ð¥",color:"#f59e0b"}:i>=3600?{label:"Prata",icon:"ð¥",color:"#9ca3af"}:i>=600?{label:"Bronze",icon:"ð¥",color:"#d97706"}:{label:"Iniciante",icon:"ð",color:"#6b7280"};return e.jsxs("div",{className:`border rounded-xl p-3 flex items-center gap-3 21 ${a?"bg-slate-800/70 border-amber-500/15":"bg-white border-amber-200/40"}`,children:[e.jsx("div",{className:"text-2xl",children:o.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-sm font-semibold ${a?"text-white":"text-slate-800"}`,style:{fontFamily:s.headingFont},children:o.label}),e.jsxs("p",{className:`text-[10px] ${a?"text-slate-400":"text-slate-500"}`,style:{fontFamily:s.bodyFont},children:[$(i)," de estudo total"]})]}),e.jsxs("div",{className:"text-xs font-bold",style:{color:o.color,fontFamily:s.numberFont},children:[t.streak||0,"ð¥"]})]})},We=({streak:t=0,weekData:a=[],isDark:s,theme:i})=>(new Date().getDay(),e.jsxs("div",{className:`flex items-center gap-3 border rounded-xl px-3 py-2.5 22 ${s?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsxs("div",{className:"text-center mr-1 flex-shrink-0",children:[e.jsx("div",{className:`text-lg font-bold ${s?"text-white":"text-slate-800"}`,style:{fontFamily:i.numberFont},children:t}),e.jsx("div",{className:`text-[9px] ${s?"text-slate-500":"text-slate-400"}`,style:{fontFamily:i.bodyFont},children:"Dias de streak"})]}),e.jsx("div",{className:"flex gap-1.5 sm:gap-2 flex-1 justify-center",children:Re.map((o,l)=>{const r=(a[l]||0)>0,n=l===6;return e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:`text-[9px] ${s?"text-slate-500":"text-slate-400"}`,style:{fontFamily:i.bodyFont},children:o}),e.jsx("div",{className:`w-6 h-6 sm:w-7 sm:h-7 rounded-full border-2 flex items-center justify-center 23 ${r?"border-green-500 bg-green-100":n?`border-blue-500 ${s?"bg-slate-700":"bg-white"}`:`${s?"border-slate-600 bg-slate-800":"border-slate-200 bg-white"}`}`,children:r&&e.jsx("svg",{viewBox:"0 0 12 12",className:"w-2.5 h-2.5",children:e.jsx("polyline",{points:"2,6 5,9 10,3",fill:"none",stroke:"#10b981",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),n&&e.jsx("div",{className:`w-1 h-1 rounded-full ${s?"bg-blue-400":"bg-blue-500"}`})]},l)})})]})),k=({label:t,value:a,unit:s,color:i,sub:o,isDark:l,theme:r})=>e.jsxs("div",{className:`border rounded-lg px-2.5 py-2 24 ${l?"bg-slate-800/60 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsx("div",{className:`text-[10px] mb-0.5 truncate ${l?"text-slate-400":"text-slate-500"}`,style:{fontFamily:r.bodyFont},children:t}),e.jsxs("div",{className:"font-bold text-base sm:text-lg leading-tight truncate",style:{fontFamily:r.numberFont,color:i},children:[a,s&&e.jsx("span",{className:`text-[10px] sm:text-xs font-normal ml-0.5 25 ${l?"text-slate-400":"text-slate-500"}`,style:{fontFamily:r.bodyFont},children:s})]}),o&&e.jsx("div",{className:`text-[9px] mt-0.5 truncate ${l?"text-slate-500":"text-slate-400"}`,style:{fontFamily:r.bodyFont},children:o})]}),C=({title:t,children:a,isDark:s,theme:i})=>e.jsxs("div",{className:`border rounded-xl p-4 26 ${s?"bg-slate-800/70 border-slate-700/80":"bg-white border-slate-200"}`,children:[e.jsx("div",{className:`text-xs font-semibold mb-3 ${s?"text-slate-200":"text-slate-700"}`,style:{fontFamily:i.bodyFont},children:t}),a]}),Ke=({data:t,isDark:a,theme:s})=>{const i=["essential","conversation","review","exercise_pool","planner_session","flashcard","reading","writing","simulado"],o={};
26i.forEach(n=>{o[n]=0}),t&&Object.entries(t).forEach(([n,d])=>{o[n]=typeof d=="number"?d:(d==null?void 0:d.minutes)||0});const l=Object.entries(o).sort((n,d)=>d[1]-n[1]),r=Math.max(...l.map(n=>n[1]),1);return e.jsx("div",{className:"space-y-2",children:l.map(([n,d])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:J[n]||"#64748b"}}),e.jsx("span",{className:`text-[11px] flex-1 truncate ${a?"text-slate-300":"text-slate-600"}`,style:{fontFamily:s.bodyFont},children:Ie[n]||n}),e.jsx("span",{className:`text-[11px] font-medium w-12 text-right ${a?"text-slate-200":"text-slate-700"}`,style:{fontFamily:s.numberFont,fontSize:11},children:d>0?$(d):"0"}),e.jsx("div",{className:`w-16 h-1.5 rounded-full overflow-hidden flex-shrink-0 27 ${a?"bg-slate-700":"bg-slate-100"}`,children:e.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${d/r*100}%`,backgroundColor:J[n]||"#64748b"}})})]},n))})},Ue=({data:t,isDark:a,theme:s})=>{const i=t&&t.length>0&&t.some(l=>l.minutes>0),o=i?t.slice(0,8).map((l,r)=>({name:l.themeName||l.themeId||`Tema ${r+1}`,value:l.minutes||0,fill:X[r%X.length]})):[{name:"Sem dados",value:1,fill:a?"#334155":"#e2e8f0"}];return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-24 h-24 sm:w-28 sm:h-28 flex-shrink-0",children:e.jsx(se,{width:"100%",height:"100%",children:e.jsx(Ce,{children:e.jsx(Te,{data:o,cx:"50%",cy:"50%",innerRadius:24,outerRadius:42,dataKey:"value",strokeWidth:2,stroke:a?"#0f172a":"#fff",children:o.map((l,r)=>e.jsx($e,{fill:o[r].fill},r))})})})}),e.jsx("div",{className:"flex-1 space-y-1 min-w-0",children:i?o.slice(0,5).map((l,r)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:l.fill}}),e.jsx("span",{className:`text-[10px] truncate flex-1 ${a?"text-slate-300":"text-slate-600"}`,style:{fontFamily:s.bodyFont},children:l.name}),e.jsx("span",{className:`text-[10px] font-medium ${a?"text-slate-200":"text-slate-700"}`,style:{fontFamily:s.numberFont,fontSize:10},children:$(l.value)})]},r)):e.jsx("div",{className:`text-[10px] ${a?"text-slate-500":"text-slate-400"}`,style:{fontFamily:s.bodyFont},children:"Estude para ver distribuição"})})]})},Ye=({dailyData:t,year:a,month:s,isDark:i,theme:o})=>{const l=new Date(a,s+1,0).getDate(),r={};(t||[]).forEach(x=>{r[x.date]=x.minutes||0});const n=Math.max(...Object.values(r),1),d=x=>x<=0?0:Math.min(4,Math.ceil(x/n*4)),f=i?["bg-slate-800","bg-cyan-900/60","bg-cyan-700/70","bg-cyan-500/80","bg-cyan-400"]:["bg-slate-100","bg-cyan-100","bg-cyan-200","bg-cyan-400","bg-cyan-600"];return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-[3px]",children:Array.from({length:l},(x,m)=>{const h=m+1,c=`${a}-${String(s+1).padStart(2,"0")}-${String(h).padStart(2,"0")}`,v=r[c]||0;return e.jsx("div",{className:`w-[14px] h-[14px] rounded-[3px] flex items-center justify-center text-[7px] cursor-default transition-colors ${f[d(v)]}`,title:`${c}: ${v}min`,style:{fontFamily:o.bodyFont,color:v>0?"white":i?"#475569":"#94a3b8"},children:h},h)})}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsx("span",{className:`text-[9px] ${i?"text-slate-500":"text-slate-400"}`,children:"Menos"}),f.map((x,m)=>e.jsx("div",{className:`w-2.5 h-2.5 rounded-sm ${x}`},m)),e.jsx("span",{className:`text-[9px] ${i?"text-slate-500":"text-slate-400"}`,children:"Mais"})]})]})},Ge=({total:t=0,correct:a=0,isDark:s,theme:i})=>{const o=t>0?Math.round(a/t*100):0,l=2*Math.PI*28,r=l-o/100*l,n=o>=80?"#10b981":o>=60?"#f59e0b":o>0?"#ef4444":s?"#334155":"#e2e8f0";return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative w-16 h-16",children:[e.jsxs("svg",{viewBox:"0 0 70 70",className:"w-full h-full -rotate-90",children:[e.jsx("circle",{cx:"35",cy:"35",r:"28",fill:"none",stroke:s?"#1e293b":"#f1f5f9",strokeWidth:"5"}),e.jsx("circle",{cx:"35",cy:"35",r:"28",fill:"none",stroke:n,strokeWidth:"5",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:r,style:{transition:"stroke-dashoffset 1s ease"}})]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("span",{className:`text-sm font-bold ${s?"text-white":"text-slate-800"}`,style:{fontFamily:i.numberFont},children:[o,"%"]})})]}),e.jsxs("div",{children:[e.jsx("div",{className:`text-xs ${s?"text-slate-300":"text-slate-600"}`,style:{fontFamily:i.bodyFont},children:"Precisão"}),e.jsxs("div",{className:`text-[10px] ${s?"text-slate-500":"text-slate-400"}`,style:{fontFamily:i.bodyFont},children:[a,"/",t," corretos"]})]})]})},qe=({data:t,isDark:a,theme:s})=>{const i=t&&t.length===24?t:new Array(24).fill(0),o=Math.max(...i,1);return e.jsxs("div",{children:[e.jsx("div",{className:"flex items-end gap-px h-14",children:i.map((l,r)=>e.jsx("div",{className:`flex-1 rounded-t-sm transition-colors 28 ${l>0?a?"bg-cyan-500/70":"bg-cyan-400":a?"bg-slate-800":"bg-slate-100"}`,style:{height:`${Math.max(l/o*100,3)}%`},title:`${String(r).padStart(2,"0")}h: ${l}`},r))}),e.jsx("div",{className:"flex justify-between mt-1",children:[0,6,12,18,23].map(l=>e.jsxs("span",{className:`text-[8px] ${a?"text-slate-600":"text-slate-400"}`,style:{fontFamily:s.bodyFont},children:[String(l).padStart(2,"0"),"h"]},l))})]})},rt=()=>{const{isDark:t}=de(),{isLoading:a,stats:s,getLast7DaysUsage:i,refreshStats:o}=xe(),[l,r]=g.useState(null),[n,d]=g.useState("summary"),[f,x]=g.useState("kawaii"),[m,h]=g.useState("idle"),c=U[f]||U.kawaii,v=t&&c.accentColorsDark?c.accentColorsDark:c.accentColors,p=new Date,[b,F]=g.useState(p.getMonth()),[N,A]=g.useState(p.getFullYear()),T=y=>{let j=b+y,L=N;j<0?(j=11,L--):j>11&&(j=0,L++);const re=p.getFullYear()*12+p.getMonth();L*12+j>re||(F(j),A(L))};g.useEffect(()=>{const y=`${N}
28-${String(b+1).padStart(2,"0")}`;Be(`month&yearMonth=${y}`).then(j=>{j&&r(j)})},[b,N]);const u=i()||Array(7).fill(0),w=["6d","5d","4d","3d","2d","Ontem","Hoje"],P=u.map((y,j)=>({name:w[j],minutes:y||0})),S=(s==null?void 0:s.trend)||"stable",I=(s==null?void 0:s.byModule)||(l==null?void 0:l.byModule)||null,B=(l==null?void 0:l.byTheme)||null,O=(l==null?void 0:l.hourDistribution)||null,z=(l==null?void 0:l.daily)||null,ne=((s==null?void 0:s.plannerTotalMinutes)||0)>0,W=`${V[b]} ${N}`,le={backgroundColor:t?"rgba(15,23,42,.92)":"rgba(255,255,255,.95)",borderRadius:"6px",fontSize:"11px",border:`1px solid ${t?"rgba(100,116,139,.3)":"rgba(203,213,225,.5)"}`,fontFamily:c.bodyFont},oe=g.useCallback(async()=>{if(m!=="generating"){h("generating");try{const y=`${N}-${String(b+1).padStart(2,"0")}`,j=await ge(y);if(!j){h("idle"),alert("Retrospectiva ainda não disponÃvel para este mês. Estude um pouco mais!");return}await je({retro:j,isDark:t,monthLabel:W,yearMonth:y}),h("done"),setTimeout(()=>h("idle"),2500)}catch(y){console.error("Share error:",y),h("idle")}}},[m,N,b,t,W]),ie=S==="improving"?Z:S==="declining"?ee:te;return g.useEffect(()=>{if(!document.querySelector('link[href*="Space+Grotesk"]')){const y=document.createElement("link");y.rel="stylesheet",y.href=_e,document.head.appendChild(y)}},[]),a&&!s.totalTimeMinutes&&!u.some(y=>y>0)?e.jsxs("div",{className:`flex flex-col items-center justify-center min-h-screen 29 ${t?"bg-gray-950 text-slate-300":"bg-white text-slate-600"}`,children:[e.jsx(R,{className:"w-10 h-10 text-cyan-500 animate-spin mb-3"}),e.jsx("p",{className:"text-sm",style:{fontFamily:c.bodyFont},children:"Carregando estatÃsticas..."})]}):e.jsx("div",{className:`min-h-screen transition-colors duration-500 30 ${t?"bg-gradient-to-b from-gray-950 via-slate-900 to-gray-950 text-slate-100":"bg-gradient-to-b from-slate-50 via-white to-slate-50 text-slate-800"}`,children:e.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg sm:text-xl font-bold",style:{fontFamily:c.headingFont},children:e.jsx("span",{className:t?"text-cyan-400":"text-cyan-600",children:"Painel de Atividade"})}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full mt-1 31 ${S==="improving"?t?"bg-green-500/15 text-green-400":"bg-green-50 text-green-600":S==="declining"?t?"bg-orange-500/15 text-orange-400":"bg-orange-50 text-orange-600":t?"bg-slate-700 text-slate-400":"bg-slate-100 text-slate-500"}`,style:{fontFamily:c.bodyFont},children:[e.jsx(ie,{className:"w-3 h-3"}),S==="improving"?"Melhorando":S==="declining"?"Em queda":"Estável"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`flex rounded-lg p-0.5 ${t?"bg-slate-800":"bg-slate-100"}`,children:[{k:"summary",l:"Resumo"},{k:"detailed",l:"Detalhado"},{k:"compare",l:"Comparativo"}].map(({k:y,l:j})=>e.jsx("button",{onClick:()=>d(y),className:`px-2 py-1 text-[11px] font-medium rounded-md transition-all 32 ${n===y?t?"bg-cyan-500/20 text-cyan-400":"bg-white text-cyan-700 shadow-sm":t?"text-slate-400":"text-slate-500"}`,style:{fontFamily:c.bodyFont},children:j},y))}),e.jsx("select",{value:f,onChange:y=>x(y.target.value),className:`text-[11px] font-medium rounded-lg px-2 py-1.5 border appearance-none cursor-pointer transition-all 33 ${t?"bg-slate-800 border-slate-700 text-slate-300 hover:border-slate-500":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"}`,style:{fontFamily:c.bodyFont},children:Object.values(U).map(y=>e.jsx("option",{value:y.key,children:y.label},y.key))}),e.jsx("button",{onClick:o,disabled:a,className:`p-1.5 rounded-lg transition-all disabled:opacity-50 34 ${t?"bg-slate-700/70 text-slate-300":"bg-white border border-slate-200 text-slate-700"}`,children:a?e.jsx(R,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(me,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:`mb-3 border rounded-xl overflow-hidden 35 ${t?"bg-gradient-to-r from-cyan-950/60 via-slate-800/60 to-purple-950/40 border-cyan-700/40":"bg-gradient-to-r from-cyan-50 via-white to-purple-50 border-cyan-200/70"}`,children:e.jsxs("div",{className:"flex items-center gap-3 p-3 sm:p-3.5",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 36 ${t?"bg-cyan-500/20 text-cyan-400":"bg-cyan-100 text-cyan-700"}`,children:e.jsx(fe,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:`text-sm font-bold leading-tight ${t?"text-white":"text-slate-800"}`,style:{fontFamily:c.headingFont},children:["Retrospectiva de ",W]}),e.jsx("p",{className:`text-[11px] mt-0.5 leading-tight ${t?"text-slate-400":"text-slate-500"}
36`,style:{fontFamily:c.bodyFont},children:"Card compartilhável com seus números do mês"})]}),e.jsxs("button",{onClick:oe,disabled:m==="generating",className:`flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1.5 rounded-lg transition-all 37 ${m==="done"?t?"bg-green-500/15 text-green-400":"bg-green-50 text-green-700":m==="generating"?t?"bg-slate-700 text-slate-400":"bg-slate-100 text-slate-500":t?"bg-cyan-500/15 hover:bg-cyan-500/25 text-cyan-400":"bg-cyan-100 hover:bg-cyan-200 text-cyan-700"}`,style:{fontFamily:c.bodyFont},title:"Compartilhar",children:[m==="done"?e.jsx(ue,{className:"w-3.5 h-3.5"}):m==="generating"?e.jsx(R,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(ye,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:m==="done"?"Pronto":m==="generating"?"Gerando":"Compartilhar"})]}),e.jsx("a",{href:"/retrospective",className:`p-1.5 rounded-lg transition-all flex-shrink-0 38 ${t?"bg-slate-700/60 hover:bg-slate-600 text-slate-300":"bg-white border border-slate-200 hover:border-slate-300 text-slate-700"}`,title:"Abrir página completa",children:e.jsx(he,{className:"w-4 h-4"})})]})}),n!=="compare"&&e.jsxs("div",{className:"flex items-center justify-center gap-4 mb-3",children:[e.jsx("button",{onClick:()=>T(-1),className:`p-1 rounded-md border 39 ${t?"border-slate-700 text-slate-400 hover:border-slate-500":"border-slate-200 text-slate-500 hover:border-slate-300"}`,children:e.jsx(be,{className:"w-4 h-4"})}),e.jsxs("span",{className:"text-sm font-semibold",style:{fontFamily:c.headingFont},children:[V[b]," ",N]}),e.jsx("button",{onClick:()=>T(1),disabled:N===p.getFullYear()&&b===p.getMonth(),className:`p-1 rounded-md border disabled:opacity-30 40 ${t?"border-slate-700 text-slate-400 hover:border-slate-500":"border-slate-200 text-slate-500 hover:border-slate-300"}`,children:e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"mb-3",children:[c.showCompanion&&e.jsx(Oe,{todayMinutes:s.todayTimeMinutes||0,streak:s.streak||0,isDark:t,theme:c}),c.showRank&&e.jsx(ze,{stats:s,isDark:t,theme:c}),!c.showCompanion&&!c.showRank&&e.jsxs("div",{className:`border rounded-xl px-4 py-3 41 ${t?"bg-slate-800/40 border-slate-700/60":"bg-slate-50/80 border-slate-200/60"}`,children:[e.jsxs("p",{className:`text-sm font-medium ${t?"text-white":"text-slate-800"}`,style:{fontFamily:c.headingFont},children:[$(s.todayTimeMinutes)," hoje"]}),e.jsx("p",{className:`text-[11px] mt-0.5 ${t?"text-slate-400":"text-slate-500"}`,style:{fontFamily:c.bodyFont},children:s.streak>0?`${s.streak} dias de sequência`:"Comece a estudar para iniciar sua sequência"})]})]}),e.jsx("div",{className:"mb-3",children:e.jsx(We,{streak:s.streak||0,weekData:u,isDark:t,theme:c})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-2 mb-3",children:[e.jsx(k,{label:"Sequência",value:s.streak??0,unit:" dias",color:v.streak,isDark:t,theme:c}),e.jsx(k,{label:"Foco hoje",value:$(s.todayTimeMinutes),color:v.today,isDark:t,theme:c}),e.jsx(k,{label:"Semana",value:$(s.weekTimeMinutes),color:v.week,isDark:t,theme:c}),e.jsx(k,{label:"Mês",value:$(s.monthTimeMinutes),color:v.month,isDark:t,theme:c}),e.jsx(k,{label:"Total",value:$(s.totalTimeMinutes),color:v.total,isDark:t,theme:c,sub:ne?`Planner: ${$(s.plannerTotalMinutes||0)}`:void 0})]}),n==="summary"&&e.jsx("div",{className:"space-y-3",children:e.jsx(C,{title:"Ritmo semanal",isDark:t,theme:c,children:P.some(y=>y.minutes>0)?e.jsx(se,{width:"100%",height:160,children:e.jsxs(Se,{data:P,margin:{top:0,right:0,left:-30,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"bg",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:t?"#22d3ee":"#0891b2",stopOpacity:.85}),e.jsx("stop",{offset:"100%",stopColor:t?"#06b6d4":"#0e7490",stopOpacity:.25})]})}),e.jsx(Me,{strokeDasharray:"3 3",stroke:t?"rgba(71,85,105,.25)":"rgba(203,213,225,.4)",vertical:!1}),e.jsx(ve,{dataKey:"name",tickLine:!1,axisLine:!1,stroke:t?"#475569":"#94a3b8",fontSize:10,fontFamily:c.bodyFont}
41),e.jsx(we,{unit:"m",tickLine:!1,axisLine:!1,stroke:t?"#475569":"#94a3b8",fontSize:10,width:35,fontFamily:c.bodyFont}),e.jsx(Ne,{contentStyle:le}),e.jsx(Fe,{dataKey:"minutes",radius:[4,4,0,0],barSize:24,fill:"url(#bg)"})]})}):e.jsx("div",{className:`flex items-center justify-center h-[120px] text-xs 42 ${t?"text-slate-600":"text-slate-400"}`,style:{fontFamily:c.bodyFont},children:"Sem dados esta semana"})})}),n==="detailed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[e.jsx(C,{title:"Tempo por matéria",isDark:t,theme:c,children:e.jsx(Ue,{data:B,isDark:t,theme:c})}),e.jsx(C,{title:"Tempo por módulo",isDark:t,theme:c,children:e.jsx(Ke,{data:I,isDark:t,theme:c})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[e.jsx(C,{title:"Mapa de atividade",isDark:t,theme:c,children:e.jsx(Ye,{dailyData:z,year:N,month:b,isDark:t,theme:c})}),e.jsx(C,{title:"ExercÃcios",isDark:t,theme:c,children:e.jsx(Ge,{total:s.totalExercises||0,correct:s.totalExercisesCorrect||0,isDark:t,theme:c})})]}),e.jsx(C,{title:"Horários de estudo",isDark:t,theme:c,children:e.jsx(qe,{data:O,isDark:t,theme:c})})]}),n==="compare"&&e.jsx("div",{className:"space-y-3",children:e.jsx(Le,{isDark:t,theme:c})}),e.jsxs("div",{className:`mt-4 text-center text-[10px] ${t?"text-slate-600":"text-slate-400"}`,style:{fontFamily:c.bodyFont},children:["Ãltima sincronização: ",new Date().toLocaleTimeString()]})]})})};export{rt 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.