1import{u as C,j as t,P as w,S,b as k}from"./index--siChAZm.js";import{u as z,r as a}from"./react-vendor-B-clOVnp.js";import{C as B}from"./ChatDrawer-CxtfCn__.js";import{c as I}from"./chatEntrevistaClt-BwHgaBhb.js";import{V as R,bN as _,ci as A,j as W,ap as D}from"./icons-BCLA8W0j.js";import"./ImageLightbox-Br-jnYUy.js";import"./CancelarTrabalhoModal-DeiP10nl.js";import"./dataHoraBrasil-CF_Rw_UK.js";const l="#031D44";function Z(){const{token:r}=C(),h=z(),[p,u]=a.useState([]),[m,b]=a.useState(!0),[s,f]=a.useState(""),[n,x]=a.useState(null),[g,d]=a.useState("");a.useEffect(()=>{(async()=>{try{const e=await fetch("/api/admin/entrevistas-clt/gravacoes",{headers:{Authorization:`Bearer ${r}`}}),c=await e.json();if(!e.ok)throw new Error(c.error||"Falha ao carregar gravações");u(c.gravacoes||[])}catch(e){d(e.message)}finally{b(!1)}})()},[r]);async function v(e){if(await k({titulo:"Excluir gravação",mensagem:`Excluir permanentemente a gravação da vaga â${e.tituloVaga}â? Esta ação não pode ser desfeita.`,textoConfirmar:"Excluir gravação",perigoso:!0})){f(e._id),d("");try{const i=await fetch(`/api/admin/entrevistas-clt/gravacoes/${e._id}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`}}),y=await i.json();if(!i.ok)throw new Error(y.error||"Falha ao excluir gravação");u(j=>j.filter(E=>E._id!==e._id))}catch(i){d(i.message)}finally{f("")}}}return t.jsxs("div",{style:{width:"100%",maxWidth:1050,minWidth:0,boxSizing:"border-box",margin:"0 auto",padding:20},children:[t.jsxs("button",{onClick:()=>h("/admin/vagas-clt"),style:V,children:[t.jsx(R,{size:16})," Voltar à s vagas"]}),t.jsxs("div",{style:F,children:[t.jsx(_,{size:18}),t.jsx("h1",{style:{margin:0,fontSize:17},children:"Entrevistas CLT gravadas"})]}),g&&t.jsx("div",{style:P,children:g}),m&&t.jsx(w,{variant:"lista",itens:4}),!m&&p.length===0&&t.jsxs("div",{style:U,children:[t.jsx(A,{size:28})," Nenhuma entrevista gravada ainda."]}),t.jsx("div",{style:L,children:p.map(e=>t.jsxs("article",{style:$,children:[t.jsx("video",{controls:!0,preload:"metadata",style:G,src:`/api/admin/entrevistas-clt/gravacoes/${e._id}/stream?token=${encodeURIComponent(r)}`}),t.jsx("strong",{style:{color:l},children:e.tituloVaga}),t.jsx("span",{style:o,children:e.empresaNome||"Empresa"}),t.jsxs("span",{style:o,children:["Entrevista: ",e.entrevistaEm?new Date(e.entrevistaEm).toLocaleString("pt-BR"):"â"]}),t.jsxs("span",{style:o,children:["Gravada em: ",new Date(e.createdAt).toLocaleString("pt-BR")]}),t.jsxs("span",{style:o,children:[Math.round((e.tamanho||0)/1024/1024)," MB · ",Math.round((e.duracaoSeg||0)/60)," min"]}),t.jsxs("div",{style:N,children:[t.jsxs("button",{type:"button",onClick:()=>x(e),style:T,children:[t.jsx(W,{size:14})," Ver chat"]}),t.jsxs("button",{type:"button",onClick:()=>v(e),disabled:s===e._id,style:{...M,opacity:s===e._id?.65:1},children:[s===e._id?t.jsx(S,{size:14}):t.jsx(D,{size:14}),s===e._id?"Excluindoâ¦":"Excluir gravação"]})]})]},e._id))}),t.jsx(B,{aberto:!!n,eventoId:n?.vagaId,freelancerUserBubbleId:n?.freelancerBubbleId,token:r,perfil:"admin",tituloParte:"Chat da entrevista",onFechar:()=>x(null),apiFns:I,zBase:500})]})}const V={display:"inline-flex",gap:6,alignItems:"center",border:0,background:"transparent",color:l,fontWeight:700,cursor:"pointer",marginBottom:12},F={display:"flex",gap:8,alignItems:"center",width:"fit-content",background:l,color:"#fff",padding:"10px 16px",borderRadius:999,marginBottom:16},L={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(300px, 100%), 1fr))",gap:14,minWidth:0},$={display:"flex",flexDirection:"column",gap:6,background:"#fff",border:"1px solid #e5e7eb",borderRadius:12,padding:12,minWidth:0,boxSizing:"border-box"},G={width:"100%",aspectRatio:"16/9",background:"#111827",borderRadius:8},o={fontSize:12,color:"#6b7280"},N={display:"flex",justifyContent:"flex-end",gap:8,flexWrap:"wrap",marginTop:6},T={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,border:"1px solid #bae6fd",background:"#f0f9ff",color:"#0369a1",borderRadius:8,padding:"8px 11px",fontSize:12,fontWeight:700,cursor:"pointer"},M={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,border:"1px solid #fecaca",background:"#fff",color:"#b91c1c",borderRadius:8,padding:"8px 11px",fontSize:12,fontWeight:700,cursor:"pointer"},P={background:"#fee2e2",color:"#991b1b",padding:10,borderRadius:8},U={display:"flex",flexDirection:"column",alignItems:"center",gap:8,color:"#6b7280",padding:36,border:"1px dashed #d1d5db",borderRadius:12};export{Z 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.