1import{r as m,j as e}from"./react-vendor-pafHdoJx.js";import{b as u,d as h,P as j}from"./index-Db0fDLGN.js";import{c as g}from"./ErrorState-B9i6eo2M.js";import{q as y,as as v,l as f,S as l,D as b,am as N,r as R}from"./ui-vendor-DLXJn6s3.js";import"./map-vendor-Dr8zbd0c.js";import"./firebase-vendor-D3UzkAhn.js";const k={ok:{color:"#10B981",label:"OK · sem risco",icon:b},"5d":{color:"#F59E0B",label:"Risco · 5d suspensão",icon:l},"10d":{color:"#F97316",label:"Risco · 10d suspensão",icon:l},"20d":{color:"#EF4444",label:"Risco · 20d suspensão",icon:l},"30d":{color:"#DC2626",label:"Risco crÃtico · 30d",icon:f}};function F(){const[t,c]=m.useState(!1),{data:s,loading:n,error:o,refetch:d}=u(()=>h.penalidadesAnttTrack(),[]);if(n)return null;if(!s){const a=o?g(o):null;return o&&j(new Error(String(o)),{card:"penalidades-antt"}),e.jsxs("div",{className:"rounded-lg px-3 py-2 flex items-center gap-2 text-xs",role:"status",style:{background:"var(--surface-secondary)",border:"1px solid var(--border-primary)",color:"var(--page-text-muted)"},children:[e.jsx(y,{className:"w-3.5 h-3.5 shrink-0",style:{color:"var(--page-text-muted)"}}),e.jsxs("span",{className:"flex-1 min-w-0 truncate",title:a==null?void 0:a.description,children:["Penalidades ANTT indisponÃvel agora",a?` · ${a.title.toLowerCase()}`:"",a&&!a.retryable?" â avisamos o suporte":""]}),e.jsxs("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 font-semibold",style:{color:"var(--accent-brand, #F97316)"},children:[e.jsx(v,{className:"w-3 h-3"}),"Tentar"]})]})}const r=k[s.tierAtual],p=r.icon,i=s.proximoRiscoSuspensao.proximoTierValorMin-s.totalValorAutuacoes,x=s.tierAtual==="ok"?0:Math.min(100,s.totalValorAutuacoes/s.proximoRiscoSuspensao.proximoTierValorMin*100);return e.jsxs("div",{className:"rounded-xl",style:{background:"var(--surface-secondary)",border:`1px solid ${s.tierAtual!=="ok"?r.color+"50":"var(--border-primary)"}`},children:[e.jsxs("button",{onClick:()=>c(!t),className:"w-full flex items-center justify-between px-4 py-3 hover-surface",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{className:"w-5 h-5",style:{color:r.color}}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-sm font-semibold",style:{color:"var(--page-text)"},children:"Penalidades ANTT (Res 6.077/2026)"}),e.jsxs("p",{className:"text-[11px]",style:{color:"var(--page-text-muted)"},children:[s.totalAutuacoes6m," autuações nos últimos ",s.janelaDias,"d ·"," ",s.totalValorAutuacoes.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded uppercase tracking-wider",style:{background:r.color+"22",color:r.color},children:r.label}),t?e.jsx(N,{className:"w-4 h-4"}):e.jsx(R,{className:"w-4 h-4"})]})]}),t&&e.jsxs("div",{className:"px-4 pb-4 space-y-3",style:{borderTop:"1px solid var(--border-primary)"},children:[s.proximoRiscoSuspensao.proximoTier&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"flex justify-between text-[11px] mb-1",children:[e.jsxs("span",{style:{color:"var(--page-text-muted)"},children:["Próximo tier · ",s.proximoRiscoSuspensao.proximoTier," suspensão RNTRC"]}),e.jsxs("span",{style:{color:"var(--page-text)"},children:["R$ ",s.proximoRiscoSuspensao.proximoTierValorMin.toLocaleString("pt-BR")]})]}),e.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-tertiary)"},children:e.jsx("div",{className:"h-full transition-all",style:{width:`${x}%`,background:r.color}})}),i>0?e.jsxs("p",{className:"text-[11px] mt-1.5",style:{color:"var(--page-text-muted)"},children:["Falta R$ ",i.toLocaleString("pt-BR",{minimumFractionDigits:2})," pra atingir o próximo tier de suspensão"]}):e.jsx("p",{className:"text-[11px] mt-1.5 font-semibold",style:{color:r.color},children:"â Tier atingido · suspensão RNTRC pode ser aplicada com >3 autuações em 6m"})]}),e.jsx("div",{className:"rounded-lg p-3 text-xs leading-relaxed",style:{background:s.alertaCritico?r.color+"14":"var(--surface-tertiary)",color:s.alertaCritico?r.color:"var(--page-text-secondary)"},children:e.jsx("strong",{children:s.detalhe})}),e.jsxs("div",{className:"text-[10px] space-y-1",style:{color:"var(--page-text-muted)"},children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:["R$ 50kâ250k â ",e.jsx("strong",{style:{color:"#F59E0B"},children:"5 dias"})," suspensão"]}),e.jsxs("div",{children:["R$ 250kâ500k â ",e.jsx("strong",{style:{color:"#F97316"},children:"10 dias"})]}),e.jsxs("div",{children:["R$ 500kâ1M â ",e.jsx("strong",{style:{color:"#EF4444"},children:"20 dias"})]}),e.jsxs("div",{children:["> R$ 1M â ",e.jsx("strong",{style:{color:"#DC2626"},children:"30 dias"})]})]}),e.jsx("p",{className:"mt-1",children:"Suspensão cautelar disparada com mais de 3 autuações em 6 meses + valor acumulado no tier."})]})]})]})}export{F as PenalidadesAnttCard};
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.