PageSourceSearch

https://freelacerto.com/assets/CheckinPage-BAjgvSP-.js

js freelacerto.com collected 2026-10-02 01:29:48 UTC 21,963 bytes, 1 lines download raw bytes

1import{u as Qe,j as e,P as Pe,S as q,U as qe,_ as Te,aq as Le,a3 as _e,Q as he,ar as me,as as ue,at as Be,au as He}from"./index-D0NFXJHP.js";import{h as $e,u as Ge,r as n}from"./react-vendor-B-clOVnp.js";import{M as Ve}from"./ModalAvaliarFreelancer-CkmgXQba.js";import{a_ as O,V as fe,aw as X,as as M,X as ve,i as Y,J as We,u as Ye,t as xe,p as U,a3 as ge,aF as Ue,aa as Je,ao as Oe,al as J,a$ as pe}from"./icons-l1P0DWf7.js";import"./SoftskillsSelector-ayrgY8t8.js";const je="CHECKIN",T=15;function Xe(t){if(t<=0)return"00:00:00";const r=Math.floor(t/3600),c=Math.floor(t%3600/60),f=t%60;return[r,c,f].map(x=>String(x).padStart(2,"0")).join(":")}function y(t){return t?new Date(t).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}):"—"}function ke(t){if(!t)return"—";const r=new Date(t),c=new Date,f=new Date;f.setDate(c.getDate()+1);const x=(i,k)=>i.getFullYear()===k.getFullYear()&&i.getMonth()===k.getMonth()&&i.getDate()===k.getDate();return x(r,c)?"Hoje":x(r,f)?"Amanhã":r.toLocaleDateString("pt-BR",{weekday:"long",day:"2-digit",month:"2-digit",year:"numeric"})}function Ke({onScan:t,onClose:r}){const c=n.useRef(null),f=n.useRef(!1),x=n.useRef(t),[i,k]=n.useState("iniciando"),[l,L]=n.useState("");return n.useEffect(()=>{x.current=t}),n.useEffect(()=>{let m=!1;f.current=!1;async function v(){try{const{Html5Qrcode:p}=await He(async()=>{const{Html5Qrcode:j}=await import("./index-Tii1Toi7.js");return{Html5Qrcode:j}},[]);if(m)return;const z=new p("qr-scanner-box");c.current=z,await z.start({facingMode:"environment"},{fps:10,qrbox:{width:220,height:220}},j=>{!f.current&&!m&&(f.current=!0,setTimeout(()=>x.current(j),0))},()=>{}),m||k("ativo")}catch{m||(L("Não foi possível acessar a câmera. Verifique as permissões nas configurações do navegador."),k("erro"))}}return v(),()=>{m=!0;try{c.current?.stop().catch(()=>{})}catch{}}},[]),e.jsx("div",{className:"checkin-modal-overlay",children:e.jsxs("div",{className:"checkin-modal",children:[e.jsxs("div",{className:"checkin-modal-header",children:[e.jsx("span",{children:"Escanear QR Code"}),e.jsx("button",{className:"btn-icon",onClick:r,children:e.jsx(ve,{size:20})})]}),i==="erro"&&e.jsxs("div",{className:"checkin-modal-erro",children:[e.jsx(X,{size:32,color:"#dc2626"}),e.jsx("p",{children:l})]}),e.jsxs("div",{style:{position:"relative"},children:[i==="iniciando"&&e.jsxs("div",{className:"checkin-modal-loading",style:{position:"absolute",inset:0,zIndex:2,background:"#fff",minHeight:180},children:[e.jsx(O,{size:32,className:"spin"}),e.jsx("p",{children:"Iniciando câmera..."})]}),e.jsx("div",{id:"qr-scanner-box",style:{width:"100%",maxWidth:320,margin:"0 auto",minHeight:i==="iniciando"?180:"auto"}})]}),i==="ativo"&&e.jsx("p",{className:"checkin-scan-dica",children:"Aponte a câmera para o QR Code exibido pelo contratante"}),e.jsx("button",{className:"btn btn-ghost",style:{marginTop:"1rem",width:"100%"},onClick:r,children:"Cancelar"})]})})}function ta(){const{escalaId:t,diaId:r}=$e(),{token:c,usuario:f}=Qe(),x=Ge(),[i,k]=n.useState(null),[l,L]=n.useState(null),[m,v]=n.useState(null),[p,z]=n.useState([]),[j,be]=n.useState({antecipacaoHoras:1,toleranciaMinutos:15,distanciaMetros:500}),[_,K]=n.useState(!0),[b,C]=n.useState(!1),[Z,u]=n.useState(""),[ee,g]=n.useState(""),[Ce,B]=n.useState(!1),[Ne,ae]=n.useState(null),[H,se]=n.useState(null),[w,$]=n.useState(null),[N,E]=n.useState(null),[F,ne]=n.useState(!1),[Se,te]=n.useState(!1),[ye,I]=n.useState(!1),[A,G]=n.useState(null),V=n.useRef(null);n.useRef(null);const ie=f?.perfil||"freelancer",S=ie==="contratante"||ie==="admin",oe=Intl.DateTimeFormat().resolvedOptions().timeZone,ze=`${je}:${t}:${r}`,we=`https://api.qrserver.com/v1/create-qr-code/?size=220x220&data=${encodeURIComponent(ze)}&margin=10&color=031D44&bgcolor=FFFFFF`;async function Q(){try{K(!0);const[a,s]=await Promise.all([Te(c,t),Le()]);k(a),be(s);const o=a?.dias?.find(h=>h._id===r);L(o||null);const d=await _e(c,t,r);if(v(d.checkin||null),S){const h=await he(c,t,r);z(h||[])}}catch{u("Erro ao carregar dados do dia.")}finally{K(!1)}}n.useEffect(()=>{c&&t&&r&&Q()},[c,t,r]),n.useEffect(()=>{if(!w)return;function a(s){V.current&&!V.current.contains(s.target)&&$(null)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[w]),n.useEffect(()=>{if(!l?.data||!i?.horarioFim){se(0);return}function a(){const o=new Date(l.data),[d,h]=(i.horarioFim||"23:59").split(":").map(Number),D=new Date(o.getFullYear(),o.getMonth(),o.getDate(),d,h).getTime()-T*60*1e3,W=Math.ceil((D-Date.now())/1e3);se(W>0?W:0)}a();const s=setInterval(a,1e3);return()=>clearInterval(s)},[l,i]),n.useEffect(()=>{if(!S||!c||!t||!r||_)return;async function a(){if(document.visibilityState!=="hidden")try{te(!0);const d=await he(c,t,r);z(d||[])}catch{}finally{te(!1)}}let s;const o=setTimeout(()=>{s=setInterval(a,7e3)},5e3);return()=>{clearTimeout(o),clearInterval(s)}},[S,c,t,r,_]);async function re(){if(!navigator.geolocation)throw new Error("Geolocalização não disponível neste dispositivo");if(navigator.permissions)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied")throw new Error("Localização indisponível, Ative a localização nas configurações do dispositivo")}catch(a){if(a.message.includes("indisponível"))throw a}return new Promise((a,s)=>{navigator.geolocation.getCurrentPosition(o=>a({lat:o.coords.latitude,lng:o.coords.longitude}),o=>{o.code===1?s(new Error("Acesso a localização negada, se mesmo ativando a localização do dispositivo você ainda continua recebendo esse erro, reinstale o aplicativo")):o.code===3?s(new Error("Tempo esgotado ao obter localização. Verifique se o GPS está ativo e tente novamente.")):s(new Error("Não foi possível obter sua localização. Tente novamente."))},{enableHighAccuracy:!0,timeout:12e3})})}
1function ce(){if(!l?.data||!i?.horarioInicio)return null;const a=new Date(l.data),[s,o]=(i.horarioInicio||"00:00").split(":").map(Number),h=new Date(a.getFullYear(),a.getMonth(),a.getDate(),s,o).getTime()-j.antecipacaoHoras*60*60*1e3;if(Date.now()<h){const R=new Date(h).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}),D=ke(l.data);return`Check-in ainda não liberado. Disponível a partir das ${D==="Hoje"?`às ${R} de hoje`:`${D} às ${R}`}.`}return null}function le(){if(!l?.data||!i?.horarioFim)return null;const a=new Date(l.data),[s,o]=(i.horarioFim||"23:59").split(":").map(Number),d=new Date(a.getFullYear(),a.getMonth(),a.getDate(),s,o),h=d.getTime()-T*60*1e3;if(Date.now()<h){const R=d.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"});return`Check-out disponível apenas a partir das ${new Date(h).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})} (15 min antes do término às ${R}).`}return null}async function Ee(){const a=ce();if(a){u(a);return}u(""),g(""),C(!0);try{const{lat:s,lng:o}=await re(),d=await me(c,{escalaId:t,diaId:r,metodo:"gps",lat:s,lng:o,timezone:oe});v(d.checkin),g("Check-in realizado com sucesso!")}catch(s){u(s.message)}finally{C(!1)}}async function Re(){const a=le();if(a){u(a);return}u(""),g(""),C(!0);try{const{lat:s,lng:o}=await re(),d=await ue(c,{escalaId:t,diaId:r,metodo:"gps",lat:s,lng:o});v(d.checkin),g("Check-out realizado com sucesso!"),I(!0)}catch(s){u(s.message)}finally{C(!1)}}async function De(a){B(!1),u(""),g("");const s=a.trim().split(":");if(s.length!==3||s[0]!==je){u("QR Code inválido. Use o QR Code gerado pelo contratante para este evento.");return}const[,o,d]=s;if(o!==t||d!==r){u("Este QR Code pertence a outro evento ou dia. Escaneie o QR correto.");return}C(!0);try{if(Ne==="entrada"){const h=await me(c,{escalaId:t,diaId:r,metodo:"qrcode",timezone:oe});v(h.checkin),g("Check-in por QR Code realizado com sucesso!")}else{const h=await ue(c,{escalaId:t,diaId:r,metodo:"qrcode"});v(h.checkin),g("Check-out por QR Code realizado com sucesso!"),I(!0)}}catch(h){u(h.message)}finally{C(!1),ae(null)}}async function Me(){if(N){ne(!0),u(""),g("");try{await Be(c,{checkinId:N._id}),g(`Check-out manual de ${N.freelancerNome||"freelancer"} registrado com sucesso.`),E(null),await Q()}catch(a){u(a.message),E(null)}finally{ne(!1)}}}function de(a){if(a==="entrada"){const s=ce();if(s){u(s);return}}if(a==="saida"){const s=le();if(s){u(s);return}}ae(a),B(!0),u(""),g("")}if(_)return e.jsxs("div",{className:"loading",style:{minHeight:"60vh",flexDirection:"column",gap:12},children:[e.jsx(O,{size:32,className:"spin"}),e.jsx(Pe,{inline:!0})]});if(!i||!l)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("button",{className:"btn btn-ghost btn-sm",onClick:()=>x(-1),children:[e.jsx(fe,{size:16})," Voltar"]}),e.jsx("h2",{children:"Check-in"})]}),e.jsxs("div",{className:"empty-state",children:[e.jsx(X,{size:40}),e.jsx("p",{children:"Dia não encontrado."})]})]});const Fe=!!m?.horaEntrada,Ie=!!m?.horaSaida,P=(l?.confirmados||[]).length,Ae=S&&P>0&&p.length>=P&&p.every(a=>!!a.horaSaida);return e.jsxs("div",{className:"page",children:[Ce&&e.jsx(Ke,{onScan:De,onClose:()=>B(!1)}),ye&&e.jsx("div",{className:"checkin-modal-overlay",onClick:()=>I(!1),children:e.jsx("div",{className:"checkin-modal",style:{maxWidth:340,textAlign:"center"},onClick:a=>a.stopPropagation(),children:e.jsxs("div",{style:{padding:"2rem 1.5rem 1.5rem"},children:[e.jsx("div",{style:{width:64,height:64,borderRadius:"50%",background:"#d1fae5",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 1.25rem"},children:e.jsx(M,{size:32,color:"#059669"})}),e.jsx("p",{style:{fontWeight:700,fontSize:"1.05rem",marginBottom:"0.75rem",color:"#111827"},children:"Check-out realizado!"}),e.jsxs("p",{style:{fontSize:"0.9rem",color:"#374151",lineHeight:1.6,marginBottom:"0.5rem"},children:["Seu pagamento será liberado em até ",e.jsx("strong",{children:"24h"})," ou após a avaliação do contratante, o que acontecer primeiro."]}),e.jsx("p",{style:{fontSize:"0.88rem",color:"#6b7280",lineHeight:1.6,marginBottom:"1.5rem"},children:"Peça sua avaliação para receber mais rápido e fortalecer seu perfil. ⭐"}),e.jsx("button",{className:"btn btn-primary",style:{width:"100%",justifyContent:"center"},onClick:()=>I(!1),children:"Entendido"})]})})}),A&&e.jsx(Ve,{escala:i,dia:l,escalaId:t,freelancerNome:A.freelancerNome||A.freelancerId,freelancerFoto:A.freelancerFoto||"",onClose:()=>G(null),onSuccess:()=>{G(null),Q()}}),N&&e.jsx("div",{className:"checkin-modal-overlay",children:e.jsxs("div",{className:"checkin-modal",style:{maxWidth:360},children:[e.jsxs("div",{className:"checkin-modal-header",children:[e.jsx("span",{children:"Check-out Manual"}),e.jsx("button",{className:"btn-icon",onClick:()=>E(null),disabled:F,children:e.jsx(ve,{size:20})})]}),e.jsxs("div",{style:{padding:"1.25rem 1.5rem"},children:[e.jsxs("div",{style:{background:"#fff7ed",border:"1px solid #fed7aa",borderRadius:10,padding:"1rem",marginBottom:"1.25rem",display:"flex",gap:10,alignItems:"flex-start"},children:[e.jsx(Y,{size:18,color:"#ea580c",style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("p",{style:{margin:0,fontWeight:600,color:"#9a3412",fontSize:"0.9rem"},children:"Confirmar check-out manual?"}),e.jsxs("p",{style:{margin:"4px 0 0",color:"#78350f",fontSize:"0.82rem"},children:["Você está prestes a registrar o check-out de ",e.jsx("strong",{children:N.freelancerNome||"este freelancer"})," (entrada às ",y(N.horaEntrada),"). Use apenas se o freelancer não conseguir fazer o check-out pelo próprio dispositivo."]})]})]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("button",{className:"btn btn-ghost",style:{flex:1},onClick:()=>E(null),disabled:F,children:"Cancelar"}),e.jsx("button",{className:"btn btn-primary",style:{flex:1},onClick:Me,disabled:F,children:F?e.jsxs(e.Fragment,{children:[e.jsx(q,{size:14})," Registrando…"]}):"Confirmar check-out"})]})]})]})}),e.jsxs("div",{className:"page-header",children:[e.jsxs("button",{className:"btn btn-ghost btn-sm",onClick:()=>x(`/escalas/${t}`),children:[e.jsx(fe,{size:16})," Voltar"]}),e.jsx("h2",{children:"Check-in"})]}),e.jsxs("div",{className:"checkin-evento-card",children:[e.jsx("h3",{children:i.funcao}),e.jsxs("div",{className:"checkin-evento-info",children:[i.empresaNome&&e.jsxs("div",{className:"resumo-item",children:[e.jsx(We,{size:15}),e.jsx("span",{children:i.empresaNome})]}),e.jsxs("div",{className:"resumo-item",children:[e.jsx(Ye,{size:15}),e.jsx("span",{children:ke(l.data)})]}),e.jsxs("div",{className:"resumo-item",children:[e.jsx(xe,{size:15}),e.jsxs("span",{children:[i.horarioInicio," — ",i.horarioFim]})]}),i.endereco&&e.jsxs("div",{className:"resumo-item",children:[e.jsx(U,{size:15}),e.jsx("span",{children:i.endereco})]}),l.freelancerNome&&!S&&e.jsxs("div",{className:"resumo-item",children:[e.jsx(ge,{size:15}),e.jsxs("span",{children:["Freelancer: ",l.freelancerNome]})]})]}),(()=>{if(!l?.data||!i?.horarioInicio)return null;const[a,s]=i.horarioInicio.split(":").map(Number),o=new Date(l.data),d=new Date(o.getFullYear(),o.getMonth(),o.getDate(),a,s);return Date.now()>d.getTime()+j.toleranciaMinutos*60*1e3?null:e.jsxs("div",{className:"checkin-config-info",children:["Check-in liberado até ",e.jsxs("strong",{children:[j.antecipacaoHoras,"h antes"]})," do início · tolerância de ",e.jsxs("strong",{children:[j.toleranciaMinutos," min"]})," de atraso"]})})()]}),Z&&e.jsxs("div",{className:"alert alert-error",style:{marginBottom:"1rem"},children:[e.jsx(X,{size:15})," ",Z]}),ee&&e.jsxs("div",{className:"alert alert-success",style:{marginBottom:"1rem"},children:[e.jsx(M,{size:15})," ",ee]}),S?e.jsxs("div",{className:"checkin-contratante-layout",children:[Ae?e.jsxs("div",{style:{background:"#f0fdf4",border:"2px s
1olid #86efac",borderRadius:14,padding:"2rem 1.5rem",textAlign:"center",boxShadow:"0 2px 8px rgba(22,163,74,0.10)"},children:[e.jsx("div",{style:{width:64,height:64,borderRadius:"50%",background:"#dcfce7",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 1rem"},children:e.jsx(M,{size:32,color:"#16a34a"})}),e.jsx("p",{style:{fontWeight:800,fontSize:"1.1rem",color:"#14532d",margin:"0 0 0.5rem"},children:"Jornada concluída!"}),e.jsx("p",{style:{fontSize:"0.9rem",color:"#166534",margin:0},children:P===1?`O freelancer ${p[0]?.freelancerNome||""} realizou o check-out com sucesso.`.trim():`Todos os ${P} freelancers realizaram o check-out com sucesso.`})]}):e.jsxs("div",{className:"checkin-qr-card",children:[e.jsxs("div",{className:"checkin-qr-header",children:[e.jsx(Ue,{size:20}),e.jsx("span",{children:"QR Code do Dia"})]}),e.jsx("p",{className:"checkin-qr-desc",children:"Exiba este código para que os freelancers façam check-in e check-out escaneando com a câmera."}),e.jsx("div",{className:"checkin-qr-img-wrap",children:e.jsx("img",{src:we,alt:"QR Code",className:"checkin-qr-img"})}),e.jsx("p",{className:"checkin-qr-subdesc",children:"O mesmo QR Code serve para check-in e check-out de todos os freelancers deste dia."})]}),e.jsxs("div",{className:"checkin-lista-card",children:[e.jsxs("div",{className:"checkin-lista-header",children:[e.jsx(ge,{size:18}),e.jsxs("span",{children:["Check-ins (",p.length,")"]}),e.jsxs("span",{className:"checkin-ao-vivo",title:"Atualizando automaticamente",children:[Se?e.jsx(O,{size:12,className:"spin"}):e.jsx("span",{className:"checkin-dot-vivo"}),"ao vivo"]}),e.jsx("button",{className:"btn btn-ghost btn-sm",onClick:Q,style:{marginLeft:"auto"},children:"Atualizar"})]}),p.length===0?e.jsx("p",{className:"checkin-vazio",children:"Nenhum freelancer fez check-in ainda."}):e.jsxs("table",{className:"checkin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Freelancer"}),e.jsx("th",{children:"Entrada"}),e.jsx("th",{children:"Método"}),e.jsx("th",{children:"Saída"}),e.jsx("th",{children:"Método"}),e.jsx("th",{children:"Avaliação"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:p.map(a=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(qe,{foto:a.freelancerFoto||"",nome:a.freelancerNome||"",size:32}),e.jsx("span",{children:a.freelancerNome||a.freelancerId})]})}),e.jsx("td",{children:y(a.horaEntrada)}),e.jsx("td",{children:a.metodoEntrada==="gps"?"📍 GPS":a.metodoEntrada==="qrcode"?"🔲 QR":"—"}),e.jsx("td",{children:a.horaSaida?y(a.horaSaida):e.jsx("span",{className:"badge-pendente",children:"Pendente"})}),e.jsx("td",{children:a.metodoSaida==="gps"?"📍 GPS":a.metodoSaida==="qrcode"?"🔲 QR":a.metodoSaida==="manual"?"✋ Manual":a.metodoSaida==="automatico"?"⚙️ Automático":"—"}),e.jsx("td",{style:{whiteSpace:"nowrap"},children:a.horaSaida&&(l?.avaliacao?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3,color:"#b45309",fontWeight:600,fontSize:"0.82rem"},children:[e.jsx(Je,{size:13,fill:"#f59e0b",color:"#f59e0b"}),Number(l.avaliacao.nota).toFixed(1)]}):e.jsx("button",{className:"btn btn-ghost btn-sm",style:{fontSize:"0.78rem",padding:"3px 8px",color:"#2563eb",borderColor:"#bfdbfe",background:"#eff6ff"},onClick:()=>G(a),children:"Avaliar"}))}),e.jsx("td",{style:{position:"relative",width:36,padding:"0 4px"},children:a.horaEntrada&&!a.horaSaida&&e.jsxs("div",{ref:w===a._id?V:null,style:{position:"relative"},children:[e.jsx("button",{className:"btn-icon",style:{color:"#6b7280"},onClick:()=>$(w===a._id?null:a._id),children:e.jsx(Oe,{size:16})}),w===a._id&&e.jsx("div",{style:{position:"absolute",right:0,top:"100%",zIndex:50,background:"#fff",border:"1px solid #e5e7eb",borderRadius:10,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",minWidth:180,padding:"4px 0"},children:e.jsxs("button",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",background:"none",border:"none",padding:"10px 16px",cursor:"pointer",fontSize:"0.88rem",color:"#ea580c",textAlign:"left"},onClick:()=>{$(null),E(a)},children:[e.jsx(Y,{size:15}),"Check-out manual"]})})]})})]},a._id))})]})]})]}):e.jsx("div",{className:"checkin-freelancer-layout",children:Ie?e.jsxs("div",{className:"checkin-status-card checkin-status-completo",children:[e.jsx(M,{size:48,color:"#10b981"}),e.jsx("h3",{children:"Jornada Completa"}),e.jsxs("div",{className:"checkin-status-linha",children:[e.jsx(J,{size:16}),e.jsxs("span",{children:["Check-in: ",e.jsx("strong",{children:y(m.horaEntrada)})]}),e.jsx("span",{className:"checkin-metodo-badge",children:m.metodoEntrada==="gps"?"📍 GPS":"🔲 QR"})]}),e.jsxs("div",{className:"checkin-status-linha",children:[e.jsx(Y,{size:16}),e.jsxs("span",{children:["Check-out: ",e.jsx("strong",{children:y(m.horaSaida)})]}),e.jsx("span",{className:"checkin-metodo-badge",children:m.metodoSaida==="gps"?"📍 GPS":m.metodoSaida==="automatico"?"⚙️ Automático":m.metodoSaida==="manual"?"✋ Manual":"🔲 QR"})]})]}):Fe?e.jsxs("div",{className:"checkin-freelancer-section",children:[e.jsxs("div",{className:"checkin-status-card checkin-status-parcial",children:[e.jsx(M,{size:36,color:"#3b82f6"}),e.jsx("h3",{children:"Check-in realizado"}),e.jsxs("div",{className:"checkin-status-linha",children:[e.jsx(J,{size:16}),e.jsxs("span",{children:["Entrada: ",e.jsx("strong",{children:y(m.horaEntrada)})]}),e.jsx("span",{className:"checkin-metodo-badge",children:m.metodoEntrada==="gps"?"📍 GPS":"🔲 QR"})]})]}),e.jsx("div",{className:"checkin-acoes-titulo",children:"Fazer Check-out"}),H!==null&&H>0?e.jsxs("div",{style:{background:"#fffbeb",border:"1px solid #fcd34d",borderRadius:12,padding:"1.5rem",textAlign:"center",marginTop:"0.5rem"},children:[e.jsx(xe,{size:36,color:"#f59e0b",style:{marginBottom:10}}),e.jsxs("p",{style:{fontSize:"0.88rem",color:"#92400e",margin:"0 0 6px",fontWeight:500},children:["Check-out disponível apenas nos últimos ",T," minutos do evento"]}),e.jsxs("p",{style:{fontSize:"0.82rem",color:"#78716c",margin:"0 0 12px"},children:["Você poderá fazer o check-out a partir das ",e.jsx("strong",{children:i?.horarioFim?(()=>{const a=new Date(l.data),[s,o]=i.horarioFim.split(":").map(Number),d=new Date(a.getFullYear(),a.getMonth(),a.getDate(),s,o);return new Date(d.getTime()-T*60*1e3).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})})():"—"})]}),e.jsx("p",{style:{fontSize:"0.8rem",color:"#6b7280",margin:"0 0 4px"},children:"Tempo restante:"}),e.jsx("p",{style:{fontSize:"2rem",fontWeight:700,color:"#374151",margin:0,fontVariantNumeric:"tabular-nums",letterSpacing:2},children:Xe(H)})]}):e.jsxs("div",{className:"checkin-acoes-grid",children:[e.jsxs("button",{className:"checkin-btn-acao checkin-btn-gps",onClick:Re,disabled:b,children:[b?e.jsx(q,{size:20}):e.jsx(U,{size:24}),e.jsx("span",{children:"Check-out por GPS"}),e.jsx("small",{children:"Localização automática"})]}),e.jsxs("button",{className:"checkin-btn-acao checkin-btn-qr",onClick:()=>de("saida"),disabled:b,children:[b?e.jsx(q,{size:20}):e.jsx(pe,{size:24}),e.jsx("span",{children:"Check-out por QR Code"}),e.jsx("small",{children:"Escaneie o QR Code do contratante"})]})]})]}):e.jsxs("div",{className:"checkin-freelancer-section",children:[e.jsxs("div",{className:"checkin-aguardando-card",children:[e.jsx(J,{size:32,color:"var(--accent-dark)"}),e.jsx("p",{children:"Você ainda não fez check-in para este dia."}),e.jsxs("p",{style:{fontSize:"0.82rem",color:"#6b7280",marginTop:4},children:["Disponível a partir de ",e.jsxs("strong",{children:[j.antecipacaoHoras,"h"]})," antes do início."]})]}),e.jsx("div",{className:"checkin-acoes-titulo",children:"Fazer Check-in"}),e.jsxs("div",{className:"checkin-acoes-grid",children:[e.jsxs("button",{className:"checkin-btn-acao checkin-btn-gps",onClick:Ee,disabled:b,children:[b?e.jsx(q,{size:20}):e.jsx(U,{size:24}),e.jsx("span",{children:"Check-in por GPS"}),e.jsx("small",{children:"Localização automática"})]}),e.jsxs("button",{className:"checkin-btn-acao checkin-btn-qr",onClick:()=>de("entrada"),disabled:b,children:[e.jsx(pe,{size:24}),e.jsx("span",{children:"Escanear QR Code"}),e.jsx("small",{children:"Câmera do celular"})]})]})]})})]})}export{ta 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.