PageSourceSearch

https://sentinel-365-c9d4f.web.app/assets/AIOverviewDashboard-0oZ-eSz9.js

js sentinel-365-c9d4f.web.app collected 2026-10-03 12:39:24 UTC 8,901 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AIDemoShowcase-gJcluFvV.js","assets/react-vendor-pafHdoJx.js","assets/map-vendor-Dr8zbd0c.js","assets/map-vendor-Dgihpmma.css","assets/index-Db0fDLGN.js","assets/firebase-vendor-D3UzkAhn.js","assets/ui-vendor-DLXJn6s3.js","assets/index-i8_vqxvw.css","assets/AtlasInsightCard-BB4lVUAl.js","assets/DecisionCard-DNZ6nKSh.js","assets/BrokerMarketplaceCard-DgdwSt7i.js","assets/EcoConsumoCard-Du0WB7qn.js","assets/VigiliaMdfeCard-CNDdEVrs.js","assets/MentorCoachingCard-BQMKXzZJ.js","assets/SentinelaRiscoCard-z9LdKPfN.js","assets/MecanicoPreditivaCard-Cot8_LjS.js"])))=>i.map(i=>d[i]);
2import{a as v,d as b,_ as f}from"./index-Db0fDLGN.js";import{r,j as e,N as y}from"./react-vendor-pafHdoJx.js";import{i as j,a9 as N,j as w,L as u,as as A,l as k,a5 as S,B as U,n as O,S as C}from"./ui-vendor-DLXJn6s3.js";import"./firebase-vendor-D3UzkAhn.js";import"./map-vendor-Dr8zbd0c.js";const $=r.lazy(()=>f(()=>import("./AIDemoShowcase-gJcluFvV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),p={ok:"#16a34a",warning:"#ea580c",blocked:"#dc2626","no-limit":"#64748b"},_={ok:"OK",warning:"Atenção",blocked:"Bloqueado","no-limit":"Sem limite"},L={shadow:"Observando",suggest:"Sugerindo",exceptions:"Exceções",autonomous:"Autônomo"};function l(o){return`US$ ${o.toFixed(2)}`}function D(){const{role:o}=v(),[t,x]=r.useState(null),[d,i]=r.useState(!1),[c,g]=r.useState(null),[a,h]=r.useState(!1),m=r.useCallback(async()=>{i(!0),g(null);try{const s=await b.aiOverview();x(s)}catch(s){g((s==null?void 0:s.message)||"Falha ao carregar overview")}finally{i(!1)}},[]);return r.useEffect(()=>{o==="super_admin"&&m()},[o,m]),o!=="super_admin"?e.jsx(y,{to:"/hoje",replace:!0}):e.jsxs("div",{className:"space-y-6","data-testid":"ai-overview-dashboard",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5",style:{color:"#6366f1"}}),e.jsx("h1",{className:"text-xl font-bold",style:{color:"var(--page-text)"},children:"IA — Visão Geral"}),(t==null?void 0:t.period)&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"var(--surface-2)",color:"var(--page-text-muted)"},children:t.period})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("a",{href:"/admin/navigation-api-keys",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium hover-surface",style:{border:"1px solid var(--border-primary)",color:"var(--page-text)"},"data-testid":"nav-api-keys-link",title:"Configurar MapLink API keys",children:[e.jsx(N,{className:"w-3.5 h-3.5"}),"API Keys Navegação"]}),e.jsxs("button",{onClick:()=>h(s=>!s),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium",style:{border:"1px solid var(--border-primary)",background:a?"#a855f7":"transparent",color:a?"#fff":"var(--page-text)"},"data-testid":"ai-demo-toggle",title:"Mostra os 12 cards do roster com dados sintéticos",children:[e.jsx(w,{className:"w-3.5 h-3.5"}),a?"Sair do demo":"Modo demo"]}),e.jsxs("button",{onClick:()=>void m(),disabled:d||a,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium disabled:opacity-50",style:{border:"1px solid var(--border-primary)",color:"var(--page-text)"},"data-testid":"ai-overview-refresh",children:[d?e.jsx(u,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(A,{className:"w-3.5 h-3.5"}),"Atualizar"]})]})]}),a&&e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"text-sm",style:{color:"var(--page-text-muted)"},children:"Carregando demo…"}),children:e.jsx($,{})}),c&&!a&&e.jsxs("div",{className:"rounded-lg p-3 flex items-center gap-2 text-sm",style:{background:"#fef2f2",color:"#b91c1c"},children:[e.jsx(k,{className:"w-4 h-4"}),c]}),d&&!t&&!a&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--page-text-muted)"},children:[e.jsx(u,{className:"w-4 h-4 animate-spin"})," Carregando…"]}),t&&!a&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(n,{icon:S,color:"#16a34a",label:"Custo total (mês)",value:l(t.totals.totalCostUsd),hint:`média ${l(t.totals.avgCostPerOrg)}/org`}),e.jsx(n,{icon:U,color:"#6366f1",label:"Orgs usando IA",value:`${t.totals.orgsWithUsage}`,hint:`de ${t.totals.orgsTotal} ativas`}),e.jsx(n,{icon:O,color:"#0284c7",label:"Aceitação de cards",value:`${Math.round(t.cardAdoption.acceptRate*100)}%`,hint:`${t.cardAdoption.accepted}/${t.cardAdoption.exposed} cards`}),e.jsx(n,{icon:C,color:t.totals.blockedOrgs>0?"#dc2626":"#64748b",label:"Orgs bloqueadas",value:`${t.totals.blockedOrgs}
2`,hint:"atingiram o budget",emphasis:t.totals.blockedOrgs>0})]}),t.budgetAlerts.length>0&&e.jsxs("section",{children:[e.jsxs("h2",{className:"text-sm font-semibold mb-2",style:{color:"var(--page-text)"},children:["Alertas de budget (",t.budgetAlerts.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:t.budgetAlerts.map(s=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg px-3 py-2 text-sm",style:{background:"var(--surface-2)",border:`1px solid ${p[s.status]}40`},"data-testid":"budget-alert-row",children:[e.jsx("span",{className:"font-medium",style:{color:"var(--page-text)"},children:s.orgName}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{style:{color:"var(--page-text-muted)"},children:[l(s.spentUsd)," / ",l(s.budgetUsd)]}),e.jsxs("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:p[s.status],color:"#fff"},children:[Math.round(s.percentUsed*100),"% · ",_[s.status]]})]})]},s.orgId))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold mb-2",style:{color:"var(--page-text)"},children:"Maiores consumos de IA"}),t.topSpenders.length===0?e.jsx("p",{className:"text-sm",style:{color:"var(--page-text-muted)"},children:"Nenhum consumo registrado neste mês."}):e.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-primary)"},children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--surface-2)"},children:[e.jsx("th",{className:"text-left px-3 py-2 font-semibold",style:{color:"var(--page-text-muted)"},children:"Organização"}),e.jsx("th",{className:"text-right px-3 py-2 font-semibold",style:{color:"var(--page-text-muted)"},children:"Gasto"}),e.jsx("th",{className:"text-right px-3 py-2 font-semibold",style:{color:"var(--page-text-muted)"},children:"Budget"}),e.jsx("th",{className:"text-right px-3 py-2 font-semibold",style:{color:"var(--page-text-muted)"},children:"Uso"})]})}),e.jsx("tbody",{children:t.topSpenders.map(s=>e.jsxs("tr",{style:{borderTop:"1px solid var(--border-primary)"},"data-testid":"spender-row",children:[e.jsx("td",{className:"px-3 py-2",style:{color:"var(--page-text)"},children:s.orgName}),e.jsx("td",{className:"px-3 py-2 text-right",style:{color:"var(--page-text)"},children:l(s.spentUsd)}),e.jsx("td",{className:"px-3 py-2 text-right",style:{color:"var(--page-text-muted)"},children:s.budgetUsd>0?l(s.budgetUsd):"—"}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{style:{color:p[s.status],fontWeight:600},children:s.budgetUsd>0?`${Math.round(s.percentUsed*100)}%`:"—"})})]},s.orgId))})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold mb-2",style:{color:"var(--page-text)"},children:"Níveis de autonomia dos agentes"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:["shadow","suggest","exceptions","autonomous"].map(s=>e.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--surface-2)",border:"1px solid var(--border-primary)"},"data-testid":`autonomy-${s}`,children:[e.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--page-text)"},children:t.autonomyLevels[s]??0}),e.jsx("p",{className:"text-xs",style:{color:"var(--page-text-muted)"},children:L[s]})]},s))})]}),t.fromCache&&e.jsx("p",{className:"text-[10px] text-right",style:{color:"var(--page-text-muted)"},children:"Dados em cache (atualiza a cada 2min)"})]})]})}function n({icon:o,color:t,label:x,value:d,hint:i,emphasis:c}){return e.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-secondary)",border:c?`1px solid ${t}`:"1px solid var(--border-primary)"},children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center mb-3",style:{background:`${t}22`},children:e.jsx(o,{className:"w-4 h-4",style:{color:t}})}),e.jsx("p",{className:"text-2xl font-bold mb-0.5",style:{color:"var(--page-text)"},children:d}),e.jsx("p",{className:"text-xs font-semibold",style:{color:"var(--page-text)"},children:x}),e.jsx("p",{className:"text-xs",style:{color:"var(--page-text-muted)"},children:i})]})}export{D 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.