1import{J as u,O as e,bq as R,Q as o,gG as H,gH as W,ap as C}from"./vendor-H79NKlR3.js";import{ad as M}from"./FlightAgenda-BWf_Q6X4.js";import{e as k}from"./notamSubject-DSR6D4ap.js";import{dE as E,d0 as x,cZ as l,d2 as f,cX as i,dD as L,cW as n,d1 as A,dH as I,c$ as g,dB as b,c_ as c,dC as _,dI as p,dA as P}from"./ProtectedAppRoutes-BMv270TH.js";import"./vendor-charts-Dhre_-zM.js";import"./vendor-date-D2dqegYk.js";import"./preload-helper-BXl3LOEh.js";import"./airports-BLBniQEi.js";import"./index-Bqcvp0_M.js";import"./vendor-net-XAFgdCjt.js";import"./airportTime-BryuiW0a.js";import"./budgetPlans-xBo40jcS.js";import"./flightLogs-PBM-qw9n.js";import"./flightNumber-BzrLDv-A.js";import"./legInternational-CL07l4DD.js";import"./pavementAcrPcr-Bb6Y4vls.js";import"./airportEvaluationModel-DaOqur68.js";import"./segmentProjection-CqC4blS-.js";import"./dayOperation-B62Ohzg8.js";import"./flightChecklists-jfm2diSn.js";import"./aircraft-BPto4rHo.js";import"./pilots-AW__aHYj.js";import"./flightAgendaPassengers-Bn8chgtP.js";import"./aogEvents-B4SfL73O.js";import"./reactiveMaintenance-QCfZi4Oa.js";import"./dutyExceedance-CvYPFLxU.js";import"./guideSpotlight-BH2BycC6.js";import"./maintenance-BxoEH-3y.js";import"./dateOnly-BhLAIb68.js";import"./pilotCurrency-52Kc9Hgr.js";import"./financeiroScope-BlAcWZIU.js";import"./useSolicitorRegistry-wBnZKRh1.js";import"./SolicitorFormDialog-6C_NrSEw.js";import"./entryProvenance-DSs4aAl6.js";import"./FinanceDocumentViewer-KwM9sHNj.js";import"./FinanceiroChrome-DVh6URvu.js";import"./currencies-DreAZFDB.js";import"./CookieConsentManager-BVZ8cDwn.js";function V({text:h}){const s=k(h);return s?e.jsx(o,{component:"span",sx:{fontFamily:i,fontSize:"12px",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",p:"3px 8px",borderRadius:x.chip,bgcolor:"transparent",color:"var(--color-accent-800)",border:"1px solid var(--color-accent)"},children:s.label}):null}function Ne({open:h,onClose:s,notes:d="",fetchedAt:v=null,preloaded:N=!1,checked:j=!1,onMarkVerified:S,onOpenAisweb:y,onNotesChange:T}){const O=u.useMemo(()=>M(d),[d]),[z,D]=u.useState(null),[w,$]=u.useState("decoded"),m=O.airports,r=m.find(t=>t.icao===z)||m[0]||null,B=()=>{try{navigator.clipboard?.writeText(String(d||""))}catch{}},F=(()=>{if(!v)return null;const t=new Date(v);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})})();return e.jsxs(R,{open:h,onClose:s,maxWidth:"lg",fullWidth:!0,"aria-labelledby":"foc-v2-notam-list-title",PaperProps:{sx:{width:"min(1160px, calc(100vw - 32px))",height:"min(880px, calc(100vh - 40px))",maxHeight:"calc(100vh - 40px)",borderRadius:x.card,boxShadow:E.hover,overflow:"hidden",display:"flex",flexDirection:"column"}},children:[e.jsxs(o,{sx:{display:"flex",alignItems:"center",gap:1.5,p:"16px 20px",borderBottom:`1px solid ${l.headerDivider}`}
1,children:[e.jsx(o,{component:"span",sx:{minWidth:34,height:24,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:L,color:"var(--color-bg)",fontFamily:i,fontSize:f.micro,fontWeight:600,px:1,flexShrink:0},children:"01"}),e.jsxs(o,{sx:{flex:1,minWidth:0},children:[e.jsx(o,{id:"foc-v2-notam-list-title",sx:{fontFamily:A,fontWeight:700,fontSize:"18px",letterSpacing:"-0.01em",color:n.strong},children:"NOTAMs"}),e.jsx(o,{sx:{fontFamily:I,fontSize:"12px",fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:n.muted,mt:"2px"},children:"Infraestrutura · origem, destino, alternates, FIRs, rotas"})]}),N?e.jsx(o,{component:"span",sx:{fontFamily:i,fontSize:"12px",fontWeight:700,p:"4px 9px",borderRadius:x.chip,bgcolor:g.done.bg,color:g.done.text,border:`1px solid ${g.done.border}`,letterSpacing:"0.08em",flexShrink:0},children:"PRÃ-CARREGADO"}):null,e.jsx(o,{component:"button",type:"button",onClick:s,sx:b,children:"Fechar â"})]}),e.jsxs(o,{sx:{display:"flex",alignItems:"center",gap:.75,px:"20px",borderBottom:`1px solid ${l.headerDivider}`,bgcolor:c.cardHeader,flexWrap:"wrap"},children:[e.jsxs(H,{value:w,onChange:(t,a)=>$(a),"aria-label":"Visualização dos NOTAMs",sx:{minHeight:42,"& .MuiTab-root":{minHeight:42,textTransform:"none",fontWeight:700,px:1.5}},children:[e.jsx(W,{value:"decoded",label:"Leitura por aeródromo"}),e.jsx(W,{value:"raw",label:"Texto fonte"})]}),e.jsx(o,{sx:{flex:1}}),e.jsx(o,{component:"button",type:"button",onClick:B,sx:b,children:"Copiar tudo"}),r&&y?e.jsxs(o,{component:"button",type:"button",onClick:()=>y(r.icao),sx:{..._,flexShrink:0},children:["AISWEB ",r.icao," â"]}):null]}),e.jsx(o,{"data-testid":"foc-v2-notam-scroll-owner","data-scroll-owner":"true",sx:{flex:1,minHeight:0,overflowY:"auto",p:"16px 20px",bgcolor:"var(--color-bg)"},children:w==="raw"?e.jsxs(o,{children:[e.jsx(o,{sx:{mb:1.25,fontFamily:A,fontSize:14,color:n.secondary},children:"Texto integral preservado para auditoria, cópia e edição. A lista estruturada continua disponÃvel na aba anterior."}),e.jsx(C,{fullWidth:!0,multiline:!0,minRows:20,value:d,onChange:t=>T?.(t.target.value),placeholder:"Nenhum NOTAM carregado â use âBuscar NOTAMsâ.",InputProps:{readOnly:!T},sx:{"& .MuiOutlinedInput-root":{bgcolor:c.card,alignItems:"flex-start"},"& .MuiInputBase-input":{fontFamily:i,fontSize:14,lineHeight:1.65}}})]}):e.jsxs(o,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"210px minmax(0, 1fr)"},gap:2},children:[e.jsx(o,{component:"nav","aria-label":"Aeródromos do briefing NOTAM",sx:{display:"flex",flexDirection:{xs:"row",md:"column"},gap:.75,overflowX:{xs:"auto",md:"visible"},alignSelf:"start",position:{md:"sticky"},top:{md:0}},children:m.map(t=>{const a=t.icao===(r?.icao||null);return e.jsxs(o,{component:"button",type:"button",onClick:()=>D(t.icao),"aria-pressed":a,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,p:"9px 11px",minHeight:42,cursor:"pointer",flexShrink:0,fontFamily:i,fontSize:f.micro,...a?{border:`1px solid ${p}`,bgcolor:"var(--color-accent-100)",color:"var(--color-accent-800)",fontWeight:600,boxShadow:"inset 3px 0 0 var(--color-accent)"}:{border:`1px solid ${l.card}`,bgcolor:c.card,color:n.muted}},children:[e.jsx("span",{children:t.icao}),e.jsx(o,{component:"span",sx:{minWidth:24,textAlign:"center",p:"2px 6px",bgcolor:a?p:c.chip,color:a?"var(--color-bg)":n.secondary,borderRadius:x.chip,fontWeight:600},children:t.entries.length})]},t.icao)})}),e.jsxs(o,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:1.25},children:[m.length===0?e.jsx(o,{sx:{p:2,border:`1px dashed ${l.card}`,bgcolor:c.card,fontFamily:i,fontSize:f.caption,color:n.muted,whiteSpace:"pre-wrap"},children:String(d||"").trim()||'Nenhum NOTAM carregado â use "Buscar NOTAMs".'}):null,r?e.jsxs(e.Fragment,{children:[e.jsxs(o,{sx:{display:"flex",alignItems:"center",gap:1.25},children:[e.jsxs(o,{component:"span",sx:{fontFamily:I,fontSize:"12px",fontWeight:700,letterSpacing:"0.16em",textTransform:"uppercase",color:p},children:[r.icao," · ",r.entries.length," ",r.entries.length===1?"aviso":"avisos"]}),e.jsx(o,{component:"span",sx:{flex:1,height:"1px",bgcolor:l.headerDivider}})]}),r.note?e.jsx(o,{sx:{p:1.25,bgcolor:"color-mix(in srgb, var(--color-accent) 7%, transparent)",borderLeft:`3px solid ${p}`,fontFamily:i,fontSize:"13px",color:n.secondary,whiteSpace:"pre-wrap"},children:r.note}):null,r.entries.map((t,a)=>e.jsxs(o,{sx:{border:`1px solid ${l.headerDivider}`,borderLeft:`3px solid ${p}`,borderRadius:x.button,bgcolor:c.card,p:"14px 16px"},children:[e.jsxs(o,{sx:{display:"flex",alignItems:"center",gap:1.1,flexWrap:"wrap",mb:.9}
1,children:[e.jsx(o,{component:"span",sx:{display:"grid",placeItems:"center",minWidth:24,height:24,px:.5,bgcolor:p,color:"var(--color-bg)",fontFamily:i,fontSize:12,fontWeight:600},children:a+1}),e.jsx(o,{component:"span",sx:{fontFamily:i,fontSize:f.micro,fontWeight:700,color:n.strong},children:t.id?`NOTAM ${t.id}`:`Aviso ${a+1}`}),e.jsx(V,{text:t.text})]}),e.jsx(o,{sx:{fontFamily:i,fontSize:"13px",color:n.body,lineHeight:1.65,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t.text})]},`${r.icao}-${t.id||a}`)),r.filtered!=null&&r.total!=null?e.jsxs(o,{sx:{fontFamily:i,fontSize:"12px",color:n.muted},children:[r.filtered," de ",r.total," filtrados para esta rota",r.provider?` · provider ${r.provider}`:""]}):null]}):null]})]})}),e.jsxs(o,{sx:{p:"12px 20px",borderTop:`1px solid ${l.headerDivider}`,bgcolor:c.cardHeader,display:"flex",alignItems:"center",gap:1.25,flexWrap:"wrap"},children:[e.jsxs(o,{component:"span",sx:{fontFamily:i,fontSize:"12px",color:n.muted},children:["fonte AISWEB",F?` · consultado ${F}`:""," â confirme na fonte oficial antes do despacho"]}),e.jsx(o,{sx:{flex:1}}),e.jsx(o,{component:"button",type:"button",onClick:s,sx:{...b,minHeight:38},children:"Fechar"}),S?e.jsx(o,{component:"button",type:"button","data-testid":"foc-v2-notam-verify",onClick:()=>{S(),s?.()},disabled:j,sx:{...P,border:"none",minHeight:38,"&:disabled":{bgcolor:l.strong,color:"var(--color-bg)",boxShadow:"none",cursor:"default"}}
1,children:j?"Item verificado â":"Marcar item como verificado"}):null]})]})}export{Ne 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.