PageSourceSearch

https://zulbot.com/assets/FRATFleetDashboard-B6iaH1bH.js

js zulbot.com collected 2026-10-09 22:58:48 UTC 17,673 bytes, 1 lines download raw bytes

1import{J as S,O as e,Q as s,ag as ee,S as r,ad as te,dk as re,ao as J,dr as L,ds as H,dt as O,du as T,dv as i,dw as P,af as se}from"./vendor-H79NKlR3.js";import{f as C}from"./frat-CFNoiNlL.js";import ne from"./LatentDetectorPanel-CHwJxIru.js";import"./vendor-charts-Dhre_-zM.js";import"./vendor-date-D2dqegYk.js";import"./index-Bqcvp0_M.js";import"./preload-helper-BXl3LOEh.js";import"./vendor-net-XAFgdCjt.js";import"./ProtectedAppRoutes-BMv270TH.js";import"./CookieConsentManager-BVZ8cDwn.js";import"./riskAiService-BYeND_Jp.js";import"./requestCancellation-35WgtjG2.js";const k=15,I=30,o="var(--font-heading)",u="var(--color-neutral-900)",z="var(--color-accent)",D="var(--color-accent-700)",W="var(--color-divider)",g="color-mix(in srgb, var(--color-text) 58%, transparent)",U="color-mix(in srgb, var(--color-accent) 28%, transparent)",K="color-mix(in srgb, var(--color-text) 4%, transparent)",ie={fontFamily:o,fontSize:12,fontWeight:600,letterSpacing:".2em",textTransform:"uppercase",color:g},oe={fontFamily:o,fontSize:18,fontWeight:600,letterSpacing:"-.01em",textTransform:"uppercase",color:"var(--color-text)"},p={fontFamily:o,fontSize:13,fontWeight:600,letterSpacing:".08em",textTransform:"uppercase",color:"color-mix(in srgb, var(--color-text) 60%, transparent)",borderBottom:`1px solid ${W}`,bgcolor:"transparent"},f={fontSize:15,borderBottom:"1px dashed var(--color-neutral-200)"};function X(){return e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"corner tl","aria-hidden":"true"}),e.jsx("i",{className:"corner tr","aria-hidden":"true"}),e.jsx("i",{className:"corner bl","aria-hidden":"true"}),e.jsx("i",{className:"corner br","aria-hidden":"true"})]})}function b({title:c,meta:m,metaTone:n,children:l,padded:x=!0,sx:_}){return e.jsxs(s,{component:"section",className:"blueprint",sx:{p:x?"15px 17px":0,bgcolor:"transparent",boxShadow:"var(--ind-shadow-sm)",minWidth:0,..._},children:[e.jsx(X,{}),e.jsxs(s,{sx:{display:"flex",alignItems:"baseline",gap:1.5,flexWrap:"wrap",borderBottom:"1px dashed var(--color-neutral-300)",pb:1.1,px:x?0:2,pt:x?0:1.4}
1,children:[e.jsx(r,{component:"h2",sx:oe,children:c}),e.jsx(s,{sx:{flex:1}}),m?e.jsx(r,{sx:{fontFamily:o,fontSize:12,fontWeight:600,letterSpacing:".1em",textTransform:"uppercase",color:n==="ink"?u:g},children:m}):null]}),l]})}function A({title:c,value:m,subtitle:n,tone:l="neutral",alert:x}){const _=l==="attention"?u:l==="ok"?z:W,j=l==="attention"?u:"var(--color-text)";return e.jsxs(s,{className:"blueprint",sx:{p:"13px 14px",bgcolor:"transparent",boxShadow:"var(--ind-shadow-sm)",borderLeft:`3px solid ${_}`,minWidth:0,height:"100%"},children:[e.jsx(X,{}),e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".14em",textTransform:"uppercase",color:g},children:c}),e.jsx(s,{sx:{display:"flex",alignItems:"baseline",gap:.6,mt:.6},children:e.jsx(r,{component:"span",sx:{fontFamily:o,fontSize:28,fontWeight:600,lineHeight:1,letterSpacing:"-.02em",color:j},children:m})}),n?e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".08em",textTransform:"uppercase",color:g,mt:.5},children:n}):null,x?e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".08em",textTransform:"uppercase",color:u,mt:.5},children:x}):null]})}function R({label:c,tone:m="neutral",sx:n}){const l={ink:{bd:u,fg:u},accent:{bd:z,fg:"var(--color-accent-800)"},neutral:{bd:W,fg:"color-mix(in srgb, var(--color-text) 62%, transparent)"}},x=l[m]||l.neutral;return e.jsx(s,{component:"span",sx:{display:"inline-flex",alignItems:"center",px:.9,py:"2px",border:`1px solid ${x.bd}`,color:x.fg,bgcolor:"transparent",fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".08em",textTransform:"uppercase",whiteSpace:"nowrap",...n},children:c})}function ae({data:c,height:m=168}){return c.length?e.jsx(s,{sx:{display:"grid",gridTemplateColumns:`repeat(${c.length}, 1fr)`,gap:1,alignItems:"end",height:m,mt:1.75},children:c.map(n=>e.jsxs(s,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-end",height:"100%",gap:.6,minWidth:0},children:[e.jsx(r,{sx:{fontFamily:o,fontSize:12,fontWeight:600,textAlign:"center",color:n.strong?D:g},children:n.valueLabel}),e.jsx(s,{sx:{height:`${n.pct}%`,minHeight:2,bgcolor:n.strong?z:U,borderTop:`2px solid ${n.strong?D:z}`}}),e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".06em",textTransform:"uppercase",textAlign:"center",color:"color-mix(in srgb, var(--color-text) 55%, transparent)"},children:n.label}),n.ratio?e.jsx(r,{sx:{fontFamily:o,fontSize:11,letterSpacing:".04em",textAlign:"center",color:"color-mix(in srgb, var(--color-text) 50%, transparent)"},children:n.ratio}):null]},n.key))}):null}function M({pct:c,ok:m,width:n="100%",height:l=6}){return e.jsx(s,{sx:{width:n,height:l,bgcolor:"var(--color-neutral-200)",flexShrink:0},children:e.jsx(s,{sx:{height:"100%",width:`${Math.min(100,Math.max(0,c))}%`,bgcolor:m?z:u}})})}const le={low:"Baixo",elevated:"Elevado",high:"Alto"};function ce({calibration:c}){const m=Array.isArray(c?.bands)?c.bands:[];return m.length?e.jsxs(b,{title:"Confiabilidade observada por faixa de score",meta:`Cobertura de debrief: ${c.debrief_coverage_pct??0}%`,children:[e.jsx(r,{sx:{fontSize:14,color:"color-mix(in srgb, var(--color-text) 68%, transparent)",mt:1},children:"Eventos explicitamente confirmados no debrief; debrief ausente é censurado."}),e.jsx(L,{sx:{mt:.5},children:e.jsxs(H,{size:"small","aria-label":"Confiabilidade FRAT por faixa de score",children:[e.jsx(O,{children:e.jsxs(T,{children:[e.jsx(i,{sx:p,children:"Faixa"}),e.jsx(i,{sx:p,children:"Evento observado"}),e.jsx(i,{sx:p,children:"Suporte / IC 90%"}),e.jsx(i,{sx:p,children:"Cobertura"})]})}),e.jsx(P,{children:m.map(n=>{const l=n.estimate||{},x=l.credible_interval_90_pct,_=!!n.calibration_gate?.passed&&!l.abstained;return e.jsxs(T,{children:[e.jsx(i,{sx:f,children:e.jsxs(r,{sx:{fontFamily:o,fontSize:14,fontWeight:600,letterSpacing:".06em",textTransform:"uppercase"},children:[le[n.score_band]||n.score_band," (",n.definition,")"]})}),e.jsx(i,{sx:f,children:_?`${l.event_rate_pct}%`:"Evidência insuficiente"}),e.jsxs(i,{sx:f,children:["n=",l.n??0,"/",l.min_n??0,x?` · ${x[0]}%–${x[1]}%`:""]}),e.jsxs(i,{sx:f,children:["debrief ",n.debrief_coverage_pct??0,"% · desfecho ",n.outcome_coverage_pct??0,"%",n.censored_n?` · censurados ${n.censored_n}`:""]})]},n.score_band)})})]})}),e.jsx(r,{sx:{mt:1.25,pt:1.25,borderTop:"1px dashed var(--color-neutral-300)",fontSize:13,lineHeight:1.55,color:"color-mix(in srgb, var(--color-text) 72%, transparent)"},children:"Evidência consultiva. Não altera o score, os limites GO/NO-GO nem a autoridade humana."})]}):null}function _e(){const[c,m]=S.useState(!0),[n,l]=S.useState(""),[x,_]=S.useState(null),[j,q]=S.useState(null),[y,Q]=S.useState([]),[F,Y]=S.useState(null),E=S.useCallback(async()=>{m(!0),l("");try{const[t,d,a,v]=await Promise.allSettled([C.getFleetDashboard({days:30,months:6}
1),C.getRiskPatterns(),C.getOverrideHistory(),C.getMitigationEffectiveness()]);t.status==="fulfilled"&&_(t.value),d.status==="fulfilled"&&q(d.value),a.status==="fulfilled"&&Q(a.value?.overrides||[]),v.status==="fulfilled"&&Y(v.value)}catch(t){l(t.message||"Não foi possível carregar o painel")}finally{m(!1)}},[]);S.useEffect(()=>{E()},[E]);const h=x?.safety_pulse||{},$=x?.trends||{},N=x?.risk_heatmap||[];if(c)return e.jsx(s,{sx:{display:"flex",justifyContent:"center",py:8},children:e.jsx(ee,{})});const G=($.completion_trend||[]).map((t,d)=>{const a=Number(t.rate??(t.total?Math.round(t.completed/t.total*100):0));return{key:`${t.month}-${d}`,label:t.month,valueLabel:`${a}%`,ratio:`${t.completed??0}/${t.total??0}`,pct:a,strong:a>=90}}),Z=Math.max(1,...($.score_trend||[]).map(t=>Number(t.avg_score)||0)),w=($.score_trend||[]).map((t,d)=>{const a=Number(t.avg_score)||0;return{key:`${t.month}-${d}`,label:t.month,valueLabel:String(a),pct:Math.round(a/Z*100),strong:a<=k}}),V=h.risk_distribution?[{label:"Baixo",value:h.risk_distribution.low||0,tone:"accent"},{label:"Moderado",value:h.risk_distribution.moderate||0,tone:"neutral"},{label:"Elevado",value:h.risk_distribution.elevated||0,tone:"ink"},{label:"Alto",value:h.risk_distribution.high||0,tone:"ink"}]:[],B=V.reduce((t,d)=>t+d.value,0);return e.jsxs(s,{sx:{minWidth:0,maxWidth:1400,mx:"auto",pb:5},children:[e.jsxs(s,{component:"header",sx:{display:"flex",alignItems:"flex-end",gap:2,px:3,py:1.75,borderBottom:`1px solid ${W}`,flexWrap:"wrap"},children:[e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(r,{sx:ie,children:"FRAT analytics · padrões de risco e tendências"}),e.jsx(r,{component:"h1",sx:{m:0,mt:.25,fontFamily:o,fontSize:26,lineHeight:1.1,fontWeight:600,letterSpacing:"-0.01em",color:"var(--color-text)"},children:"Fleet Safety Dashboard"})]}),e.jsx(s,{sx:{flex:1}}),e.jsx(r,{sx:{fontFamily:o,fontSize:12,fontWeight:600,letterSpacing:".08em",textTransform:"uppercase",color:g},children:"30 dias · 6 meses de tendência"}),e.jsx(te,{onClick:E,disabled:c,"aria-label":"Atualizar painel",sx:{border:`1px solid ${W}`,borderRadius:0,color:"var(--color-text)",p:.75},children:e.jsx(re,{sx:{fontSize:20}})})]}),n&&e.jsx(J,{severity:"error",sx:{mx:3,mt:2},children:n}),e.jsxs(s,{sx:{px:3,pt:2,display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",md:"repeat(4, minmax(0, 1fr))"},gap:1.25},children:[e.jsx(A,{title:"FRAT completion",value:`${h.completion_rate||0}%`,subtitle:`${h.frat_completed||0} de ${h.total_flights||0} trechos`,tone:h.on_track?"ok":"attention",alert:h.on_track?null:`abaixo da meta de ${h.company_goal_pct}%`}),e.jsx(A,{title:"Score médio",value:h.avg_score||0,subtitle:"últimos 30 dias",tone:h.avg_score>k?"attention":"ok"}),e.jsx(A,{title:"Trechos faixa alta",value:h.high_risk_count||0,subtitle:"score acima de 30",tone:h.high_risk_count>0?"attention":"ok"}),e.jsx(A,{title:"NO-GO overrides",value:y.length,subtitle:"requer revisão",tone:y.length>0?"attention":"ok"})]}),e.jsxs(s,{sx:{px:3,pt:1.75,display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(ce,{calibration:x?.score_band_calibration}),h.risk_distribution&&e.jsxs(s,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(0, 1fr) minmax(0, 1.6fr)"},gap:1.5},children:[e.jsx(b,{title:"Distribuição de risco",meta:`${B} trechos`,children:e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.25,mt:1.5},children:V.map(t=>e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",gap:1,mb:.5},children:[e.jsx(r,{sx:{fontFamily:o,fontSize:12,fontWeight:600,letterSpacing:".1em",textTransform:"uppercase",color:t.tone==="ink"&&t.value>0?u:"var(--color-text)"},children:t.label}),e.jsx(r,{sx:{fontFamily:o,fontSize:14,fontWeight:600,color:t.tone==="ink"&&t.value>0?u:D},children:t.value})]}),e.jsx(M,{pct:B?t.value/B*100:0,ok:t.tone!=="ink"})]},t.label))})}),e.jsx(b,{title:"Score médio por mês",meta:`faixas 0–${k} / ${k+1}–${I} / ${I+1}+`,children:w.length?e.jsx(s,{sx:{display:"grid",gridTemplateColumns:`repeat(${w.length}, 1fr)`,gap:.75,alignItems:"end",height:168,mt:1.75},children:w.map(t=>e.jsxs(s,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-end",height:"100%",gap:.6,minWidth:0},children:[e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,textAlign:"center",color:t.strong?g:u},children:t.valueLabel}),e.jsx(s,{sx:{height:`${t.pct}%`,minHeight:2,bgcolor:t.strong?U:u,borderTop:`2px solid ${t.strong?z:u}`}}),e.jsx(r,{sx:{fontFamily:o,fontSize:11,fontWeight:600,letterSpacing:".06em",textTransform:"uppercase",textAlign:"center",color:"color-mix(in srgb, var(--color-text) 55%, transparent)"},children:t.label})]},t.key))}):e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Sem dados no período."})})]}),e.jsx(b,{title:"Conclusão de FRAT por mês",meta:"enviados / trechos",children:G.length?e.jsx(ae,{data:G}):e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Sem dados no período."})}),e.jsx(b,{title:"Mapa de calor de risco por rota",meta:`${N.length} rotas`,children:N.length===0?e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Sem dados no período."}):e.jsx(L,{sx:{mt:.5},children:e.jsxs(H,{size:"small",children:[e.jsx(O,{children:e.jsxs(T,{children:[e.jsx(i,{sx:p,children:"Rota"}),e.jsx(i,{align:"center",sx:p,children:"Trechos"}),e.jsx(i,{align:"center",sx:p,children:"Score médio"}),e.jsx(i,{align:"center",sx:p,children:"Score máx"}),e.jsx(i,{sx:p,children:"Riscos mais ativados"})]})}),e.jsx(P,{children:N.slice(0,15).map((t,d)=>e.jsxs(T,{sx:{bgcolor:t.avg_score>k?K:"inherit"},children:[e.jsx(i,{sx:{...f,fontFamily:o,fontWeight:600,letterSpacing:".02em"},children:t.route}),e.jsx(i,{align:"center",sx:f,children:t.flight_count}),e.jsx(i,{align:"center",sx:f,children:e.jsx(R,{label:t.avg_score,tone:t.avg_score>I?"ink":t.avg_score>k?"neutral":"accent"})}),e.jsx(i,{align:"center",sx:{...f,fontFamily:o,fontWeight:600},children:t.max_score}),e.jsx(i,{sx:f,children:(t.top_risks||[]).slice(0,3).map((a,v)=>e.jsx(R,{label:`${a.label} (${a.count})`,tone:"neutral",sx:{mr:.5,mb:.5,whiteSpace:"normal"}},v))})]},d))})]})})}),j&&e.jsx(b,{title:"Padrões de risco — combinações recorrentes",meta:(j.recurring_combos||[]).length?`${(j.recurring_combos||[]).length} padrões`:null,padded:!1,children:e.jsxs(s,{sx:{px:2,pt:1.25,pb:1.5},children:[$.drift_alert&&e.jsxs(J,{severity:"warning",sx:{mb:1.5},children:[e.jsx("strong",{children:"Deriva de score detectada:"})," ",$.drift_alert.message]}),(j.recurring_combos||[]).length===0?e.jsx(r,{sx:{fontSize:14,color:g},children:"Nenhum padrão recorrente detectado ainda."}):(j.recurring_combos||[]).map((t,d)=>e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1.25,borderBottom:"1px dashed var(--color-neutral-200)",flexWrap:"wrap"},children:[e.jsxs(s,{sx:{flex:1,minWidth:220},children:[e.jsx(s,{sx:{display:"flex",gap:.75,flexWrap:"wrap"},children:t.labels.map((a,v)=>e.jsx(R,{label:a,tone:"ink"},v))}),t.recommendation?e.jsx(r,{sx:{fontSize:14,lineHeight:1.45,color:"color-mix(in srgb, var(--color-text) 72%, transparent)",mt:.6},children:t.recommendation}):null]}),e.jsx(M,{pct:t.percentage,ok:!1,width:150,height:13}),e.jsxs(r,{sx:{flexShrink:0,width:110,textAlign:"right",fontFamily:o,fontSize:14,fontWeight:600},children:[t.occurrences,"x · ",t.percentage,"%"]})]},d))]})}),j&&e.jsx(b,{title:"Pontos cegos do operador",children:(j.blind_spots||[]).length===0?e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Nenhum ponto cego detectado — todas as seções estão sendo revisadas."}):e.jsx(s,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"},gap:1.25,mt:1.5},children:(j.blind_spots||[]).map((t,d)=>e.jsxs(s,{sx:{display:"flex",gap:1.25,p:"10px 12px",border:`1px solid ${W}`,borderLeft:`3px solid ${u}`,minWidth:0},children:[e.jsx(se,{sx:{fontSize:18,color:u,mt:"2px"}}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsxs(r,{sx:{fontSize:15,fontWeight:600,lineHeight:1.35},children:[t.section,": ",t.selection_rate,"% de seleção"]}),e.jsx(r,{sx:{fontSize:14,lineHeight:1.45,color:"color-mix(in srgb, var(--color-text) 72%, transparent)",mt:.4},children:t.message})]})]},d))})}),e.jsxs(b,{title:"Latent Detector",children:[e.jsx(r,{sx:{fontSize:14,color:"color-mix(in srgb, var(--color-text) 68%, transparent)",mt:1,mb:1.5},children:"Correlacione Checklist, Ops Debrief, METAR e Manutenção para detectar sinais latentes e registrar achados no Registro de Perigos."}),e.jsx(ne,{})]}),e.jsx(b,{title:"Log de override",meta:y.length?`${y.length} overrides`:null,metaTone:y.length?"ink":void 0,children:y.length===0?e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Nenhum override registrado."}):e.jsx(L,{sx:{mt:.5},children:e.jsxs(H,{size:"small",children:[e.jsx(O,{children:e.jsxs(T,{children:[e.jsx(i,{sx:p,children:"Data"}),e.jsx(i,{sx:p,children:"Voo"}),e.jsx(i,{sx:p,children:"Rota"}),e.jsx(i,{align:"center",sx:p,children:"Score"}),e.jsx(i,{sx:p,children:"Ação"}),e.jsx(i,{sx:p,children:"Justificativa"}),e.jsx(i,{sx:p,children:"Piloto"})]})}),e.jsx(P,{children:y.map((t,d)=>e.jsxs(T,{sx:{bgcolor:K},children:[e.jsx(i,{sx:f,children:t.timestamp?new Date(t.timestamp).toLocaleDateString("pt-BR"):"—"}),e.jsx(i,{sx:f,children:t.flight_number||"—"}),e.jsx(i,{sx:{...f,fontFamily:o,fontWeight:600,letterSpacing:".02em"},children:t.route||"—"}),e.jsx(i,{align:"center",sx:f,children:e.jsx(R,{label:t.original_score,tone:"ink"})}),e.jsx(i,{sx:f,children:t.action}),e.jsx(i,{sx:{...f,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis"},children:t.justification||"—"}),e.jsx(i,{sx:f,children:t.user_name||"—"})]},d))})]})})}),e.jsx(b,{title:"Efetividade das mitigações",children:!F||(F.risk_summary||[]).length===0?e.jsx(r,{sx:{mt:1.5,fontSize:14,color:g},children:"Sem dados de efetividade ainda. Envie feedback no debrief pós-voo para construir esta leitura."}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{sx:{mt:1,fontFamily:o,fontSize:12,fontWeight:600,letterSpacing:".1em",textTransform:"uppercase",color:g},children:["Baseado em ",F.total_feedback_items," itens de feedback"]}),(F.risk_summary||[]).map((t,d)=>e.jsxs(s,{sx:{mt:1.75},children:[e.jsx(r,{sx:{fontSize:15,fontWeight:600,mb:.75},children:t.risk_label}),(t.actions||[]).map((a,v)=>e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.25,mb:.6,pl:2},children:[e.jsx(s,{sx:{flex:1,minWidth:0},children:e.jsx(r,{sx:{fontSize:14},noWrap:!0,title:a.action,children:a.action})}),e.jsx(M,{pct:a.effectiveness_rate,ok:a.effectiveness_rate>=70,width:100,height:8}),e.jsxs(r,{sx:{width:50,textAlign:"right",fontFamily:o,fontSize:14,fontWeight:600,color:a.effectiveness_rate>=70?D:u},children:[a.effectiveness_rate,"%"]}),e.jsxs(r,{sx:{fontFamily:o,fontSize:12,fontWeight:600,color:g},children:["(",a.total,")"]})]},v))]},d))]})})]})]})}export{_e 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.