1import{u as M,r as i,j as e,a as D}from"./react-vendor-CTonDsnR.js";import{c9 as L,bF as P,O as _,an as G,F as O,E as q,Q as u,bN as A,a8 as F,a9 as C,bJ as Q,$ as U,K as I,J as W,ac as B,bY as H,a6 as J,at as K,d as Y,af as z}from"./index-hUiFL0ms.js";import{p as V}from"./peiService-C0nqdU51.js";import{u as X}from"./usePatients-4Hd4z7nu.js";import"./agora-rtc-vendor-CXiD3fib.js";import"./vite-helpers-BNgm88M_.js";import"./charts-vendor-UIXnLpfR.js";import"./api-BNGKk99s.js";import"./toast-CXflIz9v.js";function Z(){return D().pathname.startsWith("/governo")?"/governo/educacional":"/dashboard/pei"}const $={activePEIs:0,draftPEIs:0,completedPEIs:0,avgProgress:0,pendingAlerts:0,totalStudents:0,goalsAchieved:0,totalGoals:0},l=({title:s,value:h,icon:a,gradient:n,onClick:r})=>e.jsxs("button",{type:"button",onClick:r,disabled:!r,className:` 2 relative bg-white dark:bg-gray-900 rounded-2xl border border-gray-100 dark:border-gray-800 3 p-5 overflow-hidden text-left transition-shadow hover:shadow-lg 4 ${r?"cursor-pointer":"cursor-default"} 5 `.trim(),children:[e.jsx("div",{className:`absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl ${n} opacity-[0.04] rounded-bl-full`}),e.jsxs("div",{className:"flex items-start justify-between mb-3 relative z-10",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:s}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white truncate",children:h})]}),e.jsx("div",{className:`w-10 h-10 rounded-xl bg-gradient-to-br ${n} flex items-center justify-center flex-shrink-0 shadow-lg`,children:e.jsx(a,{size:20,className:"text-white"})})]})]});function ne(){const s=M(),{user:h}=L(),a=Z(),n=a.startsWith("/governo"),[r,p]=i.useState($),[b,g]=i.useState(!0),{patients:c}=X({autoLoad:!0,includeStats:!1}),x=i.useCallback(async()=>{if(!c?.length){g(!1);return}g(!0);try{const t=await Promise.allSettled(c.map(d=>V.getDashboard(d.id)));let f=0,v=0,j=0,y=0,N=0,m=0,k=0,E=0;const w=new Set;t.forEach((d,T)=>{d.status==="fulfilled"&&Array.isArray(d.value)&&d.value.forEach(o=>{w.add(c[T]?.id),o.pei_status==="active"?f++:o.pei_status==="draft"?v++:o.pei_status==="completed"&&j++,y+=o.pending_alerts??0,o.avg_progress!=null&&(N+=o.avg_progress,m++),E+=o.total_goals??0,k+=o.goals_achieved??0})}),p({activePEIs:f,draftPEIs:v,completedPEIs:j,pendingAlerts:y,avgProgress:m>0?Math.round(N/m):0,totalStudents:w.size,goalsAchieved:k,totalGoals:E})}catch{p($)}finally{g(!1)}},[c?.map(t=>t.id).join(",")]);i.useEffect(()=>{x()},[x]);const R=i.useMemo(()=>[{id:"new-pei",label:"Novo PEI",description:"Iniciar processo de criação",icon:P,href:`${a}/novo`,gradient:"from-indigo-500 to-blue-500"},{id:"screening",label:"Triagem",description:"Identificar alunos",icon:_,href:`${a}/triagem`,gradient:"from-amber-500 to-orange-500"},{id:"contributions",label:"Contribuições ClÃnicas",description:"Laudos e recomendações",icon:G,href:`${a}/contribuicoes`,gradient:"from-rose-500 to-red-500"},{id:"list",label:"Ver Todos os PEIs",description:"Lista completa",icon:O,href:`${a}/lista`,gradient:"from-emerald-500 to-teal-500"}],[a]),S=i.useMemo(()=>[{step:1,title:"Triagem e Identificação",description:"Identificar alunos que necessitam de avaliação especializada",icon:q,href:`${a}/triagem`},{step:2,title:"Relatório Circunstanciado",description:"Documento pré-requisito com 4 seções (estudante, escola, famÃlia, clÃnica)",icon:u,href:`${a}/novo?fluxo=formal`},{step:3,title:"PAEE",description:"Plano de Atendimento Educacional Especializado e recursos de acessibilidade",icon:A,href:`${a}/paee`},{step:4,title:"PEI",description:"Plano Educacional Individualizado com metas e estratégias",icon:F,href:`${a}/novo`},{step:5,title:"Acompanhamento",description:"Monitorar progresso, gerar relatórios e revisar periodicamente",icon:C,href:`${a}/lista`}],[a]);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Dashboard Educacional"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Gestão de Planos Educacionais Indiv
5idualizados â PEI / PAEE"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>x(),className:"p-2.5 rounded-xl border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 transition-colors",title:"Atualizar dados",children:e.jsx(Q,{size:18,className:b?"animate-spin":""})}),e.jsxs("button",{onClick:()=>s(`${a}/novo`),className:"inline-flex items-center gap-2 rounded-xl bg-gradient-to-r from-indigo-600 to-blue-600 px-5 py-2.5 font-medium text-white shadow-lg shadow-indigo-500/25 transition hover:shadow-xl hover:shadow-indigo-500/30",children:[e.jsx(P,{size:18}),"Novo PEI"]})]})]}),b?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(U,{className:"h-8 w-8 animate-spin text-indigo-500"})}):e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:[e.jsx(l,{title:"PEIs Ativos",value:r.activePEIs,icon:I,gradient:"from-emerald-500 to-teal-500",onClick:()=>s(`${a}/lista`)}),e.jsx(l,{title:"Em Rascunho",value:r.draftPEIs,icon:W,gradient:"from-amber-500 to-orange-500"}),e.jsx(l,{title:"Progresso Médio",value:`${r.avgProgress}%`,icon:C,gradient:"from-blue-500 to-indigo-500"}),e.jsx(l,{title:"Metas Atingidas",value:`${r.goalsAchieved}/${r.totalGoals}`,icon:B,gradient:"from-purple-500 to-violet-500"}),e.jsx(l,{title:"Alertas",value:r.pendingAlerts,icon:H,gradient:r.pendingAlerts>0?"from-rose-500 to-red-500":"from-gray-500 to-slate-500"}),e.jsx(l,{title:"Alunos c/ PEI",value:r.totalStudents,icon:J,gradient:"from-indigo-500 to-blue-500"})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(K,{size:18,className:"text-indigo-500"}),"Ações Rápidas"]}),e.jsx("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:R.map(t=>e.jsxs("button",{onClick:()=>s(t.href),className:"group relative bg-white dark:bg-gray-900 rounded-2xl border border-gray-100 dark:border-gray-800 p-5 text-left overflow-hidden transition-shadow hover:shadow-lg hover:shadow-gray-200/50 dark:hover:shadow-gray-900/50",children:[e.jsx("div",{className:`absolute top-0 right-0 w-24 h-24 bg-gradient-to-bl ${t.gradient} opacity-[0.06] rounded-bl-full`}),e.jsx("div",{className:`w-10 h-10 rounded-xl bg-gradient-to-br ${t.gradient} flex items-center justify-center shadow-lg mb-3`,children:e.jsx(t.icon,{size:20,className:"text-white"})}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.label}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:t.description}),e.jsx(Y,{size:14,className:"absolute bottom-5 right-5 text-gray-300 dark:text-gray-600 transition group-hover:translate-x-1 group-hover:text-indigo-500"})]},t.id))})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-5",children:[e.jsxs("div",{className:"lg:col-span-3 bg-white dark:bg-gray-900 rounded-2xl border border-gray-100 dark:border-gray-800 p-6 overflow-hidden",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-5 flex items-center gap-2",children:[e.jsx(u,{size:18,className:"text-violet-500"}),"Fluxo de Trabalho â CNE/CP 50/2023"]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[19px] top-5 bottom-5 w-0.5 bg-gradient-to-b from-indigo-400 via-violet-400 to-emerald-400 dark:from-indigo-600 dark:via-violet-600 dark:to-emerald-600"}),e.jsx("div",{className:"space-y-4",children:S.map(t=>e.jsxs("button",{onClick:()=>s(t.href),className:"group flex w-full items-start gap-4 text-left",children:[e.jsx("div",{className:"relative z-10 flex h-10 w-10 shrink-0 items-center justify-center rounded-full border-2 border-indigo-400 bg-white text-sm font-bold text-indigo-600 transition group-hover:bg-indigo-600 group-hover:text-white dark:border-indigo-500 dark:bg-gray-900 dark:text-indigo-400 dark:group-hover:bg-indigo-600 dark:group-hover:text-white shadow-sm",children:t.step}),e.jsxs("div",{className:"flex-1 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{size:14,className:"text-indigo-500"}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.title})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t.description})]}),e.jsx(z,{size:14,className:"mt-3 shrink-0 text-gray-300 dark:text-gray-600 transition group-hover:text-indigo-500"})]},t.step))})]})]}),e.jsxs("div",{className:"lg:col-span-2 bg-gradient-to-br from-indigo-50 to-violet-50 dark:from-indigo-950/40 dark:to-violet-950/40 rounded-2xl border border-indigo-100 dark:border-indigo-800 p-6 overflow-hidden",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2 flex items-center gap-2",children:[e.jsx(u,{size:18,className:"text-indigo-500"}),"O que e o PEI ideal?"]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4",children:"Decreto 12.686/2025 e Parecer CNE/CP 50/2023 â Estrutura completa do Plano Educacional Individualizado"}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[{num:"1",title:"Identificacao do aluno",desc:"PEI e individual â nunca generico por serie",color:"text-blue-600 bg-blue-100 dar
5k:bg-blue-900/30"},{num:"2",title:"Avaliacao (RC)",desc:"Relatorio Circunstanciado / Estudo de Caso completo",color:"text-violet-600 bg-violet-100 dark:bg-violet-900/30"},{num:"3",title:"Objetivos mensuraveis",desc:"Curto (trimestre), medio (semestre), longo prazo (ano)",color:"text-indigo-600 bg-indigo-100 dark:bg-indigo-900/30"},{num:"4",title:"Programas de ensino",desc:"Habilidades pre-academicas aplicadas pelo prof. de apoio",color:"text-emerald-600 bg-emerald-100 dark:bg-emerald-900/30"},{num:"5",title:"Diretrizes de adaptacao",desc:"Guias QUANDO â ENTAO para o professor regente",color:"text-amber-600 bg-amber-100 dark:bg-amber-900/30"},{num:"6",title:"Recursos necessarios",desc:"Prof. apoio, CAA, roteiros visuais, materiais",color:"text-teal-600 bg-teal-100 dark:bg-teal-900/30"}].map(t=>e.jsxs("div",{className:"rounded-xl bg-white/70 dark:bg-gray-900/50 border border-gray-100 dark:border-gray-800 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:`flex h-5 w-5 items-center justify-center rounded-full text-[10px] font-bold ${t.color}`,children:t.num}),e.jsx("span",{className:"text-xs font-semibold text-gray-800 dark:text-gray-200",children:t.title})]}),e.jsx("p",{className:"text-[11px] text-gray-500 dark:text-gray-400 leading-relaxed",children:t.desc})]},t.num))}),e.jsx("div",{className:"mt-4 rounded-lg bg-white/50 dark:bg-gray-900/30 border border-indigo-100 dark:border-indigo-800 p-3",children:e.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 leading-relaxed",children:[e.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:"Quem faz o que?"})," ","Professor Regente + Professor AEE constroem juntos os objetivos, as diretrizes e os recursos. Programas de ensino sao escritos pelo Prof. AEE e aplicados pelo Profissional de Apoio. A familia participa dos objetivos. Prazo recomendado: 30-60 dias apos matricula."]})})]}),e.jsxs("div",{className:"lg:col-span-2 bg-white dark:bg-gray-900 rounded-2xl border border-gray-100 dark:border-gray-800 p-6 overflow-hidden",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(I,{size:18,className:"text-blue-500"}),"Conformidade Legal"]}),e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4 leading-relaxed",children:["Este módulo segue integralmente as diretrizes do"," ",e.jsx("strong",{className:"text-gray-700 dark:text-gray-300",children:"Parecer CNE/CP n.º 50/2023"}),","," ",e.jsx("strong",{className:"text-gray-700 dark:text-gray-300",children:"Decreto 12.686/2025"})," e"," ",e.jsx("strong",{className:"text-gray-700 dark:text-gray-300",children:"Lei n.º 14.254/2021"}),"."]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["Relatório Circunstanciado","PAEE","PEI","Programas de Ensino","Diretrizes de Adaptação","Recursos Necessários","Ensino Colaborativo","Autonomia Progressiva","Articulação Intersetorial","FamÃlia no Processo","Sala de Recursos"].map(t=>e.jsx("span",{className:"rounded-lg bg-blue-50 dark:bg-blue-900/20 px-2.5 py-1 text-[11px] font-medium text-blue-600 dark:text-blue-400 border border-blue-100 dark:border-blue-800",children:t},t))}),n&&e.jsxs("div",{className:"mt-6 pt-4 border-t border-gray-100 dark:border-gray-800",children:[e.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Rede Escolar"]}),e.jsxs("button",{onClick:()=>s("/governo/escolas"),className:"w-full flex items-center justify-between rounded-xl bg-gradient-to-r from-teal-50 to-emerald-50 dark:from-teal-900/20 dark:to-emerald-900/20 border border-teal-100 dark:border-teal-800 px-4 py-3 text-left transition-colors hover:from-teal-100 hover:to-emerald-100 dark:hover:from-teal-900/30 dark:hover:to-emerald-900/30",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-teal-700 dark:text-teal-300",children:"Gerenciar Escolas"}),e.jsx("p",{className:"text-xs text-teal-600/70 dark:text-teal-400/70",children:"Escolas, professores e turmas"})]}),e.jsx(z,{size:16,className:"text-teal-400"})]})]})]})]})]})}export{ne as PEIEducationDashboard};
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.