1import{r as x,j as e,s as A}from"./index-bMFZPluE.js";import{a as xa,s as ba}from"./emailApi-BQfIvn0G.js";import{p as w,s as ve,c as fe,a as he,f as ka,h as ie,g as ue,j as Q,b as ct,d as ga,e as fa,i as ha}from"./candidateAvailability-DgcALE0v.js";import{e as ne}from"./emailHtml-CNLY3Q4b.js";import{t as Na,f as dt}from"./phoneFormatting-bIoASOCT.js";import{l as pt,s as Ie,c as mt}from"./localCandidatePreview-soJiaFs0.js";import{o as ya}from"./protectedStorage-l8nXRU0Q.js";import{i as I}from"./AdminShell-CeQmJoPo.js";import{b as we,j as _a}from"./educationCatalog-pqwMnMBs.js";import"./laborAssignmentControls-PBEP3hIy.js";const ut=t=>{var s,l;return(t==null?void 0:t.first_name)||((s=t==null?void 0:t.full_name)==null?void 0:s.split(" ")[0])||((l=t==null?void 0:t.name)==null?void 0:l.split(" ")[0])||"profe"},xe=t=>{if(!t)return!1;const s=new Date(t),l=new Date;return Number.isNaN(s.getTime())?!1:s.getFullYear()===l.getFullYear()&&s.getMonth()===l.getMonth()},xt=t=>{const s=ut(t),l=ne(s),g=w(t==null?void 0:t.weekly_availability),c=w(t==null?void 0:t.summer_availability),d=ve(g,fe),k=ve(c,he),M=ka(t==null?void 0:t.availability_last_confirmed_at),h=(t==null?void 0:t.availability_state)||"Disponible ahora",B=`Sigues disponible este mes, ${s}?`,O=` 2 <div style="font-family: Arial, sans-serif; max-width: 620px; margin: 0 auto; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,0.05);"> 3 <div style="background: linear-gradient(135deg, #1c74e9 0%, #4f46e5 100%); padding: 30px 22px; text-align: center;"> 4 <div style="font-size: 30px; margin-bottom: 8px;">Agenda</div> 5 <h1 style="margin: 0; color: #ffffff; font-size: 26px; font-weight: 900;">Seguimos contando contigo</h1> 6 <p style="margin: 10px 0 0; color: #dbeafe; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;"> 7 Actualizacion mensual de disponibilidad 8 </p> 9 </div> 10 11 <div style="padding: 28px 22px;"> 12 <p style="font-size: 16px; margin-top: 0;">Hola <strong>${l}</strong>,</p> 13 <p style="font-size: 15px; line-height: 1.7; margin-bottom: 18px;"> 14 Te escribimos desde <strong>Profe en Casa</strong> para confirmar si sigues disponible este mes y si tus horarios, materias o zonas han cambiado. 15 Asi podemos contar contigo mejor para nuevos grupos, sustituciones, verano o clases que encajen de verdad contigo. 16 </p> 17 18 <div style="background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px; margin-bottom: 18px;"> 19 <p style="margin: 0 0 10px; font-size: 11px; font-weight: 900; color: #64748b; text-transform: uppercase; letter-spacing: 1px;">Lo que tenemos apuntado ahora</p> 20 <p style="margin: 0 0 8px; font-size: 14px;"><strong>Estado:</strong> ${ne(h)}</p> 21 <p style="margin: 0 0 8px; font-size: 14px;"><strong>Ultima confirmacion:</strong> ${ne(M)}</p> 22 <p style="margin: 0 0 8px; font-size: 14px;"><strong>Bloques semanales disponibles:</strong> ${d.totalAvailable}</p> 23 <p style="margin: 0; font-size: 14px;"><strong>Mananas de verano disponibles:</strong> ${k.totalAvailable}</p> 24 </div> 25 26 <div style="background: #eff6ff; border-left: 4px solid #1c74e9; padding: 16px; border-radius: 8px; margin-bottom: 18px;"> 27 <p style="margin: 0; font-size: 14px; line-height: 1.7; color: #1e3a8a;"> 28 Si sigues igual, nos basta con que respondas a este correo con un <strong>"Sigo disponible"</strong>. 29 Si ha cambiado algo, puedes responder contandonos: 30 </p> 31 <ul style="margin: 10px 0 0 18px; padding: 0; color: #1e3a8a; font-size: 14px; line-height: 1.7;"> 32 <li>dias u horas nuevas</li> 33 <li>bloques que ya no te encajan</li> 34 <li>disponibilidad de verano</li> 35 <li>cambios de materias o niveles</li> 36 </ul> 37 </div> 38 39 <div style="background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px; margin-bottom: 18px;"> 40 <p style="margin: 0; font-size: 14px; line-height: 1.7;"> 41 Si te resulta mas comodo, tambien puedes entrar en la app con tu mismo correo, ir a la pestaña <strong>Equipo</strong> y actualizar ahi tu disponibilidad semanal y de verano. 42 </p> 43 </div> 44 45 <p style="font-size: 15px; line-height: 1.7; margin-bottom: 0;"> 46 Gracias por ayudarnos a mantener tu perfil al dia. Eso nos permite proponerte clases que encajen mejor y avisarte antes cuando salga algo bonito para ti. 47 </p> 48 49 <p style="font-size: 15px; line-height: 1.7; margin-top: 24px;"> 50 Un abrazo,<br><br>
51 <span style="color: #6b7280; font-size: 14px;">Equipo de Seleccion · Profe en Casa</span> 52 </p> 53 </div> 54 </div> 55 `;return{subject:B,html:O}},Ca={1:{prefix:"mon",label:"Lunes"},2:{prefix:"tue",label:"Martes"},3:{prefix:"wed",label:"Miercoles"},4:{prefix:"thu",label:"Jueves"},5:{prefix:"fri",label:"Viernes"}},R=t=>String(t||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),bt=t=>String(t||"").split(",").map(s=>s.trim()).filter(Boolean),gt=t=>{const s=Ca[t.weekday],l=String(t.start_time||"").slice(0,5).replace(":","");return s&&l?`${s.prefix}_${l}`:""},ft=(t,s)=>{const l=we(s.level),g=bt(t.levels).map(d=>we(d));if(!l||R(l).includes("por confirmar"))return!1;if(g.includes(l))return!0;const c=l.match(/^(\d).*(\d).*eso$/i);if(c)return[c[1],c[2]].every(d=>g.some(k=>R(k).startsWith(d)&&R(k).includes("eso")));if(_a(s.subject)==="Inglés"&&l.includes("Bachillerato")){const d=R(t.availability);return d.includes("puede impartir ingles en:")&&d.includes("bachillerato")}return!1},ht=(t,s)=>{const l=_a(s.subject),g=R(l),c=R(t.subjects);if(!g||g.includes("por confirmar"))return!1;if(l==="Apoyo general / Deberes"){const d=we(s.level);return d==="Primaria"?c.includes("refuerzo general primaria")||c.includes("apoyo general primaria"):d.includes("ESO")?c.includes("refuerzo general eso")||c.includes("apoyo general eso"):c.includes(`apoyo general ${R(d)}`)}return l==="Inglés"?c.includes("ingles"):l==="Matemáticas Bach Sociales"?c.includes("matematicas bach sociales"):l==="Matemáticas"&&we(s.level).includes("Bachillerato")?c.includes("matematicas bach"):c.includes(g)},yt=t=>t.wants_academy===!0?"direct":t.has_car===!0||t.has_metro===!0||R(t.mobility)==="si"?"confirm_academy":null,va=(t,s)=>{const l=yt(t);if(!l)return[];const g=w(t.weekly_availability);return s.filter(c=>{const d=gt(c);return!!d&&ie(g,d)==="free"&&ft(t,c)&&ht(t,c)}).map(c=>{var d;return{planId:c.id,fit:t.status==="Profesor disponible"?l:"interview_priority",weekday:((d=Ca[c.weekday])==null?void 0:d.label)||"Dia pendiente",startTime:String(c.start_time||"").slice(0,5),endTime:String(c.end_time||"").slice(0,5),level:c.level,subject:c.subject,classroom:c.classroom||"Aula pendiente",occupiedPlaces:c.student_count,reason:t.status!=="Profesor disponible"?t.wants_academy===!0?"Coincide con una necesidad real, pero primero requiere revision y entrevista. No se puede asignar ni incorporar.":"Coincide en materia y horario, pero primero requiere entrevista y confirmar Academia. No se puede asignar ni incorporar.":l==="direct"?"Materia, nivel y horario coinciden con la ficha. Comprueba la agenda actual antes de asignar.":"Materia y horario coinciden, pero la ficha no marca Academia. Confirma modalidad y agenda actual antes de asignar."}}).sort((c,d)=>{const k={direct:0,confirm_academy:1,interview_priority:2};return c.fit!==d.fit?k[c.fit]-k[d.fit]:c.occupiedPlaces!==d.occupiedPlaces?d.occupiedPlaces-c.occupiedPlaces:`${c.weekday}${c.startTime}`.localeCompare(`${d.weekday}${d.startTime}`,"es")})}
55,vt=4320*60*1e3,je=t=>String(t||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),wt=t=>{const s=String((t==null?void 0:t.first_name)||"").trim();return s||String((t==null?void 0:t.full_name)||(t==null?void 0:t.name)||"Hola").trim().split(/\s+/)[0]},jt=t=>t.length===0?"":t.length===1?t[0]:`${t.slice(0,-1).join(", ")} y ${t[t.length-1]}`,kt=t=>Array.isArray(t==null?void 0:t.committed_weekdays)?t.committed_weekdays.map(s=>String(s).trim()).filter(Boolean):[],Nt=t=>t.some(s=>s.student_count>0&&je(s.subject).includes("ingles")&&je(s.level).includes("bachillerato")),_t=(t,s=new Date)=>{if((t==null?void 0:t.status)!=="Pendiente"||t!=null&&t.local_preview||t!=null&&t.morning_followup_email_sent_at||!(t!=null&&t.phone)&&!(t!=null&&t.email))return!1;const l=t!=null&&t.created_at?new Date(t.created_at).getTime():0;return l>0&&l>=s.getTime()-vt},Ct=(t,s,l)=>{const g=wt(t),c=kt(t),d=[],k=je(t==null?void 0:t.subjects),M=je(t==null?void 0:t.levels),h=s[0];h?d.push(`si sigues disponible el ${h.weekday.toLowerCase()} de ${h.startTime} a ${h.endTime}`):c.length>0?d.push(`si siguen disponibles las tardes de ${jt(c).toLowerCase()}`):d.push("qué tardes completas tienes disponibles actualmente"),k.includes("ingles")&&!M.includes("bachillerato")&&Nt(l)&&d.push("si puedes impartir Inglés de 1.º de Bachillerato"),(t==null?void 0:t.wants_academy)!==!0&&(t==null?void 0:t.has_car)!==!0&&(t==null?void 0:t.has_metro)!==!0?d.push("si buscas solo clases online o también podrÃas desplazarte a La Zubia"):(t==null?void 0:t.wants_academy)!==!0&&d.push("si estarÃas disponible para trabajar también en la academia de La Zubia"),d.push("en qué franja podrÃamos hacer una breve entrevista");const B=d.length===1?d[0]:`${d.slice(0,-1).join(", ")} y ${d[d.length-1]}`,O=h?`Hemos visto un posible encaje con ${h.subject} de ${h.level}, pero antes necesitamos comprobar contigo la disponibilidad y conocerte.`:"Hemos revisado tu perfil y queremos completar algunos datos antes de valorar una entrevista.",Ne=[`Hola ${g}, soy Francisco, de Profe en Casa.`,O,`¿Puedes confirmarme ${B}?`,"Esto no supone todavÃa una asignación; nos ayudará a comprobar el encaje correctamente.","Gracias."].join(` 56 57`);return{channel:!!String((t==null?void 0:t.phone)||"").replace(/\D/g,"")?"WhatsApp":"Email",priority:h?"Alta":"Media",reason:h?`Posible encaje: ${h.subject}, ${h.level}, ${h.weekday} ${h.startTime}.`:"Candidatura reciente pendiente de completar y entrevistar.",subject:"Seguimiento de tu candidatura en Profe en Casa",message:Ne}},Sa=["Pendiente","Entrevistado","Profesor disponible"],Ea=["En reserva"],Y=["Contratado","Descartado"],be=[...Sa,...Ea],ze=["Lunes","Martes","Miércoles","Jueves","Viernes"],St=10080*60*1e3,Et=(t=new Date)=>{const s=t.getMonth()>=5?t.getFullYear():t.getFullYear()-1;return{label:`${s}/${String(s+1).slice(-2)}`,startsAt:new Date(s,5,1).getTime()}},ye=Et(),Aa=t=>Math.max(...[t.created_at,t.availability_last_confirmed_at,t.availability_commitment_confirmed_at,t.incorporated_at].map(s=>s?new Date(s).getTime():0)),se=t=>!!t.local_preview||Aa(t)>=ye.startsAt,V=t=>{const s=t.created_at?new Date(t.created_at).getTime():0;return Number.isFinite(s)?s:0},J=t=>t.status==="Pendiente"&&V(t)>0&&V(t)<Date.now()-St,At=t=>{const s=V(t);return s?Math.max(0,Math.floor((Date.now()-s)/(1440*60*1e3))):0},Pt=t=>{const s=Aa(t);return s?new Date(s).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"Sin fecha registrada"},Dt={self_employed_invoice:"Declara que ya es autónomo/a y factura",could_register:"PodrÃa darse de alta si se concreta",cannot_invoice:"No puede facturar actualmente",needs_guidance:"Necesita orientación sobre facturación"},$t={auditoria_email:"Prueba tecnica",controlled_test:"Prueba tecnica",anuncio_candidatos:"Milanuncios",milanuncios:"Milanuncios",instagram_profes:"Instagram Profe en Casa",facebook_profes:"Facebook Profe en Casa",linkedin:"LinkedIn",jobtoday:"Job Today",ugr_icaro:"UGR - ICARO",sae:"Servicio Andaluz de Empleo",whatsapp:"WhatsApp",referido:"Referido",web:"Web"},Le=t=>t?$t[t]||t.replace(/[_-]+/g," "):null,Tt=t=>` 58 <div style="font-family: sans-serif; max-width: 600px; margin: 0 auto; color: #333; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05);"> 59 <div style="background-color: #1c74e9; padding: 30px 20px; text-align: center;"> 60 <h1 style="color: white; margin: 0; font-size: 24px; font-style: italic; font-weight: 900;">Bienvenido al Equipo</h1> 61 </div> 62 <div style="padding: 30px 20px;"> 63 <div style="font-size: 16px; line-height: 1.65;">${ne(t).replace(/\n/g,"<br>")}</div> 64 65 <div style="text-align: center; margin: 30px 0;"> 66 <a href="https://app.profe-en-casa.com" style="background-color: #1c74e9; color: white; text-decoration: none; padding: 14px 28px; border-radius: 8px; font-weight: 900; font-size: 16px; display: inline-block;"> 67 Acceder a mi Panel de Profesor 68 </a> 69 </div> 70 <p style="font-size: 16px; margin-top: 30px;">Un abrazo,<br><br><span style="color: #6b7280; font-size: 14px;">Equipo de Seleccion - Profe en Casa</span></p> 71 </div> 72 </div> 73 `,It=t=>{const s=t.first_name||t.full_name;return{subject:`Enhorabuena, ${s}. Estas dentro de Profe en Casa`,body:`Hola ${s}, 74 75Tras valorar tu candidatura, queremos darte la bienvenida al equipo de Profe en Casa. 76 77Siguientes pasos: 781. Accede a nuestra app desde el boton inferior. 792. Entra en EQUIPO, pulsa en "¿Es tu primera vez? Crea tu cuenta" y usa exactamente este correo: ${t.email}. 803. Dentro de tu panel podras completar tu ficha y aportar la documentacion solicitada. 81 82Coordinacion podra preparar tus primeras asignaciones. Antes de iniciar una clase presencial, Direccion comprobara el contrato o llamamiento y el alta o ampliacion de horas correspondiente.`}},z=t=>!!(t&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t.trim())),zt=t=>{if(!t)return"";const s=new Date(t);
82return Number.isNaN(s.getTime())?"":s.toLocaleString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})},Lt=()=>{const t=new Date().toLocaleDateString("es-ES",{month:"long",year:"numeric"});return t.charAt(0).toUpperCase()+t.slice(1)},ke=t=>t?t==="Seleccionado"?"Profesor disponible":t:"Pendiente",wa=t=>{const s=ke(t);return s==="Contratado"?"Incorporado":s},ge=t=>{const s=ke(t);return s==="Pendiente"?0:s==="Entrevistado"?1:s==="Profesor disponible"?2:s==="En reserva"?3:s==="Contratado"?4:5},Rt=t=>{var l,g;if(!t)return{workModality:null,availabilityNotes:null};const s=t.match(/^\[MODALIDAD:\s*(.+?)\]\s*-\s*(.*)$/i);return s?{workModality:((l=s[1])==null?void 0:l.trim())||null,availabilityNotes:((g=s[2])==null?void 0:g.trim())||null}:{workModality:null,availabilityNotes:t.trim()||null}},Mt=t=>t==="Pendiente"?"bg-orange-400":t==="Entrevistado"?"bg-blue-400":t==="Profesor disponible"?"bg-emerald-500":t==="En reserva"?"bg-violet-400":t==="Contratado"?"bg-green-500":"bg-gray-300",ja=t=>t==="Pendiente"?"bg-orange-50 text-orange-600 border-orange-200":t==="Entrevistado"?"bg-blue-50 text-blue-600 border-blue-200":t==="Profesor disponible"?"bg-emerald-50 text-emerald-700 border-emerald-200":t==="En reserva"?"bg-violet-50 text-violet-600 border-violet-200":t==="Contratado"?"bg-green-50 text-green-600 border-green-200":"bg-gray-50 text-gray-500 border-gray-200",L=t=>{const s=Na(t);return s?`https://wa.me/${s}`:void 0},K=t=>dt(t)||String(t||"").trim()||"Sin telefono",Jt=({onBack:t})=>{const s=typeof window<"u"&&["localhost","127.0.0.1"].includes(window.location.hostname),[l,g]=x.useState([]),[c,d]=x.useState([]),[k,M]=x.useState(!0),[h,B]=x.useState(null),[O,Ne]=x.useState(""),[oe,Pa]=x.useState("Todos"),[j,Re]=x.useState("active"),[C,Me]=x.useState(""),[P,qe]=x.useState(""),[D,Ve]=x.useState(""),[Be,Da]=x.useState(!1),[Oe,$a]=x.useState(!0),[He,We]=x.useState(null),[Fe,Ue]=x.useState(null),[le,Ge]=x.useState(null),[Qe,Ye]=x.useState(!1),[Je,Ke]=x.useState(null),[Ta,Ze]=x.useState({}),[Ia,Xe]=x.useState(null),[ea,Z]=x.useState(null),[aa,X]=x.useState(null),[S,ta]=x.useState(null),[$,_e]=x.useState([]),[Ce,Se]=x.useState(""),[ce,ee]=x.useState(!1),[ae,Ee]=x.useState(null),[b,v]=x.useState({mode:"academy",scheduleSummary:"",plannedStartDate:"",plannedWeeklyHours:"",candidateAccepted:!1,familyAccepted:!1,legalRouteValidated:!1,onlineAutonomyValidated:!1,directorAuthorized:!1,notes:"",welcomeEmailSubject:"",welcomeEmailBody:""}),[de,ra]=x.useState(!1),[sa,Ae]=x.useState(!1),[_,pe]=x.useState({weekly:{},summer:{},state:"Disponible ahora",notes:""}),T=a=>[...a].sort((r,i)=>{const n=ge(r.status)-ge(i.status);return n!==0?n:new Date(i.created_at||0).getTime()-new Date(r.created_at||0).getTime()}),H=async()=>{M(!0),B(null);const{data:a,error:r}=await A.from("candidates").select("*").order("created_at",{ascending:!1});if(r){B("No se ha podido cargar la bolsa de candidatos. Reintenta antes de continuar."),M(!1);return}const i=(a||[]).map(o=>({...o,status:ke(o.status)})),n=s?pt():null;g(T(n?[n,...i]:i)),M(!1)},za=async()=>{const{data:a,error:r}=await A.from("academic_group_plans").select("id, level, subject, weekday, start_time, end_time, classroom, pending_student_names").eq("academic_year","2026/27").in("status",["preparing","ready","scheduled"]).is("teacher_email",null);if(r||!a){d([]);return}const i=a.map(p=>String(p.id)),{data:n,error:o}=i.length>0?await A.from("academic_group_plan_students").select("plan_id").in("plan_id",i):{data:[],error:null};if(o){d([]);return}const m=new Map;(n||[]).forEach(p=>{const y=String(p.plan_id);m.set(y,(m.get(y)||0)+1)}),d(a.map(p=>({id:String(p.id),level:String(p.level||""),subject:String(p.subject||""),weekday:Number(p.weekday),start_time:String(p.start_time||""),end_time:String(p.end_time||""),classroom:p.classroom?String(p.classroom):null,student_count:(m.get(String(p.id))||0)+(Array.isArray(p.pending_student_names)?p.pending_student_names.length:0)})).filter(p=>p.student_count>0))};x.useEffect(()=>{H(),za()},[]);const La=a=>({weekly:w(a.weekly_availability),summer:w(a.summer_availability),state:a.availability_state||"Disponible ahora",notes:a.availability_update_notes||""}),Ra=a=>
82{if(ea===a.id){Z(null);return}pe(La(a)),Z(a.id)},ia=(a,r,i)=>{pe(n=>({...n,[a]:{...n[a],[r]:i}}))},Ma=async a=>{X(a.id);const r={weekly_availability:_.weekly,summer_availability:_.summer,availability_state:_.state,availability_update_notes:_.notes.trim()||null,availability_last_confirmed_at:new Date().toISOString()};if(s){const n={...a,...r};if(a.local_preview&&!Ie(n)){alert("No se pudo guardar la prueba en este navegador. Revisa el almacenamiento local e intentalo de nuevo."),X(null);return}g(o=>T(o.map(m=>m.id===a.id?n:m))),X(null),Z(null);return}const{error:i}=await A.from("candidates").update(r).eq("id",a.id);if(i){alert(`No se pudo guardar la disponibilidad: ${i.message}`),X(null);return}g(n=>T(n.map(o=>o.id===a.id?{...o,...r}:o))),X(null),Z(null)},qa=async(a,r)=>{const i=ke(r),n=l.find(m=>m.id===a);if(i==="Profesor disponible"){if(n){const m=ue(n),p=ha(w(n.weekly_availability)).filter(y=>ze.includes(y));ta(n),_e(m.length>0?m:p.slice(0,2)),Se(n.commitment_exception_reason||"")}return}if(n&&["En reserva","Descartado"].includes(i)){const m=i==="Descartado"?"descartar y archivar":"mover a la reserva";if(!window.confirm(`¿Quieres ${m} la ficha de ${n.full_name}? 83 84Podrás recuperarla después desde Histórico.`))return}if(s){const m={...n,status:i};if(n!=null&&n.local_preview&&!Ie(m)){alert("No se pudo guardar el estado de prueba en este navegador.");return}g(p=>T(p.map(y=>y.id===a?m:y)));return}const{error:o}=await A.from("candidates").update({status:i}).eq("id",a);if(o){alert(`Error al actualizar el estado: ${o.message}`);return}g(m=>T(m.map(p=>p.id===a?{...p,status:i}:p)))},Va=a=>{_e(r=>r.includes(a)?r.filter(i=>i!==a):[...r,a])},Pe=()=>{ta(null),_e([]),Se("")},Ba=()=>{ce||Pe()},Oa=async()=>{if(!S)return;if($.length===0){alert("Selecciona al menos una tarde completa. La recomendacion general son dos tardes completas.");return}if($.length===1&&!Ce.trim()){alert("Una sola tarde es una excepcion. Indica brevemente por que interesa conservar este perfil.");return}const a={status:"Profesor disponible",committed_weekdays:$,availability_commitment_confirmed_at:new Date().toISOString(),commitment_exception_reason:$.length===1?Ce.trim():null};if(ee(!0),s){const i={...S,...a};if(S.local_preview&&!Ie(i)){alert("No se pudo guardar el compromiso de prueba en este navegador."),ee(!1);return}g(n=>T(n.map(o=>o.id===S.id?i:o))),ee(!1),Pe();return}const{error:r}=await A.from("candidates").update(a).eq("id",S.id);if(r){alert(`No se pudo confirmar al profesor disponible: ${r.message}`),ee(!1);return}g(i=>T(i.map(n=>n.id===S.id?{...n,...a}:n))),ee(!1),Pe()},Ha=async(a,r)=>{if(s)return alert("Vista local validada: la incorporacion real se ejecuta desde produccion. No se ha enviado ningun correo."),!0;try{const i=Number(r.plannedWeeklyHours),{data:n,error:o}=await A.rpc("incorporate_candidate",{p_candidate_id:a.id,p_mode:r.mode,p_schedule_summary:r.scheduleSummary.trim(),p_planned_start_date:r.plannedStartDate,p_planned_weekly_hours:i,p_notes:r.notes.trim()||null});if(o)throw o;const m=new Date().toISOString(),{error:p}=await A.from("teachers").update({welcome_email_subject:r.welcomeEmailSubject.trim(),welcome_email_body:r.welcomeEmailBody.trim(),welcome_email_prepared_at:m,welcome_email_sent_at:null}).eq("id",n.teacher_id);if(p)throw p;return await H(),alert(`${a.full_name} ya esta ${n!=null&&n.existing_teacher?"reactivado":"incorporado"} como profesor. El correo de bienvenida ha quedado guardado como borrador pendiente de revision y no se ha enviado.`),!0}catch(i){return alert(`Error al incorporar: ${i.message}`),!1}},Wa=a=>{const{workModality:r}=Rt(a.availability),i=r!=null&&r.toLowerCase().includes("online")&&!(r!=null&&r.toLowerCase().includes("hÃbrido"))?"online":"academy",n=It(a);Ee(a),Ae(!1),v({mode:i,scheduleSummary:"",plannedStartDate:"",plannedWeeklyHours:"",candidateAccepted:!1,familyAccepted:!1,legalRouteValidated:!1,onlineAutonomyValidated:!1,directorAuthorized:!1,notes:"",welcomeEmailSubject:n.subject,welcomeEmailBody:n.body})},Fa=()=>{de||(Ae(!1),Ee(null))},Ua=async()=>{if(!ae)return;const a=Number(b.plannedWeeklyHours),r=[];if(b.scheduleSummary.trim()||r.push("horario acordado"),b.plannedStartDate||r.push("fecha de inicio"),(!Number.isFinite(a)||a<=0)&&r.push("horas semanales previstas"),b.candidateAccepted||r.push("aceptacion del profesor"),b.mode==="home"&&!b.familyAccepted&&r.push("aceptacion de la familia"),b.legalRouteValidated||r.push("via laboral o profesional validada"),b.mode==="online"&&!b.onlineAutonomyValidated&&r.push("autonomia online comprobada por Direccion"),b.directorAuthorized||r.push("autorizacion final de Direccion"),b.welcomeEmailSubject.trim()||r.push("asunto del correo de bienvenida"),b.welcomeEmailBody.trim()||r.push("texto del correo de bienvenida"),r.length>0){alert(`Antes de incorporar falta: ${r.join(", ")}.`);return}ra(!0);const i=await Ha(ae,b);ra(!1),i&&Ee(null)},Ga=async a=>{var i;if(s){alert("Simulacion local: el email de seguimiento no se ha enviado.");return}if(!a.email||!a.email.includes("@")){alert("Este candidato no tiene un email valido para enviarle seguimiento.");return}if(window.confirm(`Quieres enviar un email de seguimiento a ${a.full_name}? 85 86La idea es mantener el contacto con un tono cercano y dejar la puerta abierta para futuras oportunidades.`)){We(a.id);try{const n=a.first_name||((i=a.full_name)==null?void 0:i.split(" ")[0])||a.full_name,m=` 87 <div style="font-family: sans-serif; max-width: 600px; margin: 0 auto; color: #333; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05);"> 88 <div style="background-color: #7c3aed; padding: 28px 20px; text-align: center;"> 89 <h1 style="color: white; margin: 0; font-size: 24px; font-style: italic; font-weight: 900;">Seguimos en contacto</h1> 90 </div> 91 <div style="padding: 30px 20px;"> 92 <p style="font-size: 16px;">Hola <strong>${ne(n)}</strong>,</p> 93 <p style="font-size: 16px;">QuerÃamos saludarte desde <strong>Profe en Casa</strong> y decirte que seguimos teniendo muy presente tu perfil para futuras oportunidades del equipo.</p> 94 <p style="font-size: 16px;">Aunque en este momento no haya una incorporacion inmediata cerrada, nos encantaria mantener el contacto contigo para proximas vacantes, formaciones internas o recursos que puedan interesarte.</p> 95 <div style="background-color: #f5f3ff; border-left: 4px solid #8b5cf6; padding: 15px; margin: 25px 0; border-radius: 4px;"> 96 <p style="margin: 0; color: #5b21b6; font-size: 14px;"><strong>Lo importante:</strong> tu perfil sigue dentro de nuestra cantera y podremos escribirte cuando encaje una opcion bonita para ti.</p> 97 </div> 98 <p style="font-size: 16px;">Si en este tiempo cambia tu disponibilidad, tus zonas o las materias que te interesa impartir, puedes responder a este correo y lo tendremos en cuenta.</p> 99 <p style="font-size: 16px; margin-top: 30px;">Un abrazo,<br><br><span style="color: #6b7280; font-size: 14px;">Equipo de Seleccion - Profe en Casa</span></p> 100 </div> 101 </div> 102 `;await ba({from:"Profe en Casa RRHH <[email protected]>",to:a.email,subject:`Seguimos en contacto, ${n}`,html:m}),alert(`Email enviado a ${a.full_name}.`)}catch(n){alert(`No se pudo enviar el email: ${n.message||"Error inesperado"}`)}finally{We(null)}}},Qa=async a=>{if(!z(a.email)){alert("Este candidato no tiene un email válido para enviarle el acuse.");return}if(s){alert("Simulación local: no se ha enviado ningún correo.");return}if(window.confirm(`¿Quieres enviar ahora el acuse de recepción a ${a.full_name}?`)){Ue(a.id);try{const i=await xa({template:"candidate_intake_confirmation",recordId:String(a.id)});await H(),alert(i!=null&&i.alreadySent?"El acuse ya constaba como enviado.":"Acuse de recepción enviado.")}catch(i){console.error("No se pudo enviar el acuse de candidatura:",i),alert("No se ha podido envi
102ar el acuse. La candidatura sigue guardada y puedes reintentarlo más tarde.")}finally{Ue(null)}}},De=async(a,r)=>{if(!z(a.email))return r!=null&&r.silent||alert("Este candidato no tiene un email valido para enviarle la reconfirmacion."),!1;if(s)return r!=null&&r.silent||alert("Simulacion local: el recordatorio se ha revisado, pero no se ha enviado ni marcado como enviado."),!0;if(!(r!=null&&r.skipConfirm)&&!window.confirm(`Quieres enviar el recordatorio mensual de disponibilidad a ${a.full_name}? 103 104Le recordara sus horarios, verano y la opcion de contestar si algo ha cambiado.`))return!1;Ge(a.id);try{const{subject:i,html:n}=xt(a);await ba({from:"Profe en Casa RRHH <[email protected]>",to:a.email,subject:i,html:n});const o={availability_reminder_last_sent_at:new Date().toISOString()},{error:m}=await A.from("candidates").update(o).eq("id",a.id);if(m)throw m;return g(p=>T(p.map(y=>y.id===a.id?{...y,...o}:y))),r!=null&&r.silent||alert(`Recordatorio mensual enviado a ${a.full_name}.`),!0}catch(i){return r!=null&&r.silent||alert(`No se pudo enviar el recordatorio: ${i.message||"Error inesperado"}`),!1}finally{Ge(null)}},Ya=async()=>{const a=l.filter(o=>!I(o)&&se(o)&&be.includes(o.status)&&z(o.email)&&!xe(o.availability_reminder_last_sent_at));if(a.length===0){alert("No hay recordatorios pendientes este mes. La bolsa ya esta al dia.");return}if(s){alert(`Simulacion local: se han detectado ${a.length} recordatorio(s), pero no se enviara ni se marcara ninguno.`);return}if(!window.confirm(`Quieres enviar ahora ${a.length} recordatorio(s) de disponibilidad? 105 106Se mandaran solo a candidatos activos o en reserva con email valido y sin aviso este mes.`))return;Ye(!0);let i=0;const n=[];for(const o of a)await De(o,{skipConfirm:!0,silent:!0})?i+=1:n.push(o.full_name);if(Ye(!1),n.length===0){alert(`Recordatorios enviados correctamente a ${i} candidatos.`);return}alert(`Se enviaron ${i} recordatorios y fallaron ${n.length}. 107 108Revisa: ${n.join(", ")}`)},na=a=>{const r=`${window.location.origin}/candidate?portal=candidate&preview=${encodeURIComponent(a.email)}`;window.open(r,"_blank","noopener,noreferrer")},Ja=(a,r)=>{Ze(i=>({...i,[a]:r}));try{window.localStorage.setItem(`candidate-outreach-draft:${a}`,r)}catch{}},Ka=async(a,r)=>{try{await navigator.clipboard.writeText(r),Xe(a),window.setTimeout(()=>Xe(null),1800)}catch{window.prompt("Copia este mensaje:",r)}},Za=async(a,r,i)=>{if(!z(a.email)){alert("Este candidato no tiene un email valido.");return}if(!i.trim()){alert("Revisa el mensaje antes de enviarlo.");return}if(s){alert("Simulacion local: el seguimiento no se ha enviado ni marcado.");return}if(window.confirm(`Vas a enviar este seguimiento por email a ${a.full_name} (${a.email}). 109 110Las respuestas llegaran a [email protected]. ¿Confirmas el envio?`)){Ke(a.id);try{const o=await xa({template:"candidate_morning_followup",recordId:String(a.id),subject:r,message:i});try{window.localStorage.removeItem(`candidate-outreach-draft:${a.id}`)}catch{}await H(),alert(o!=null&&o.alreadySent?"Este seguimiento ya constaba como enviado; no se ha duplicado.":`Seguimiento enviado a ${a.full_name}.`)}catch(o){console.error("No se pudo enviar el seguimiento matinal:",o),alert("No se ha podido enviar. La ficha sigue pendiente y puedes reintentarlo sin duplicar el correo.")}finally{Ke(null)}}},Xa=a=>{window.confirm("¿Quieres quitar la candidatura de prueba de este navegador? Esta accion no afecta a Supabase.")&&(mt(),g(i=>i.filter(n=>n.id!==a)))},oa=l.filter(a=>{const r=O.toLowerCase();return(a.full_name||"").toLowerCase().includes(r)||(a.subjects||"").toLowerCase().includes(r)||(a.location||"").toLowerCase().includes(r)||(a.province||"").toLowerCase().includes(r)||(Le(a.source)||"").toLowerCase().includes(r)}),la=oa.filter(a=>!I(a)&&!Y.includes(a.status)&&se(a)),ca=[...la.filter(a=>oe==="Todos"?Sa.includes(a.status):a.status===oe)].sort((a,r)=>{const i=C?Number(ue(a).includes(C)):0,n=C?Number(ue(r).includes(C)):0;if(i!==n)return n-i;const o=w(a.weekly_availability),m=w(r.weekly_availability),p=w(a.summer_availability),y=w(r.summer_availability),q=P?Number(Q(o,P)):0,W=P?Number(Q(m,P)):0;if(q!==W)return W-q;const F=D?Number(Q(p,D)):0,U=D?Number(Q(y,D)):0;if(F!==U)return U-F;const re=Number(J(a)),G=Number(J(r));if(re!==G)return G-re;if(re&&G)return V(a)-V(r);const u=a.availability_last_confirmed_at?new Date(a.availability_last_confirmed_at).getTime():0,f=r.availability_last_confirmed_at?new Date(r.availability_last_confirmed_at).getTime():0;return u!==f?f-u:ge(a.status)-ge(r.status)}),$e=la.filter(a=>Ea.includes(a.status)),me=oa.filter(a=>I(a)||Y.includes(a.status)||!se(a)),E=l.filter(a=>!I(a)&&!Y.includes(a.status)&&se(a)),da=l.filter(a=>I(a)||Y.includes(a.status)||!se(a)),et=E.filter(a=>a.status==="Pendiente").length,Te=E.filter(a=>J(a)).length,at=E.filter(a=>a.status==="Entrevistado").length,tt=E.filter(a=>a.status==="Profesor disponible").length,rt=E.filter(a=>a.status==="En reserva").length,st=l.filter(a=>a.status==="Contratado").length,it=l.filter(a=>a.status==="Descartado").length,nt=da.filter(a=>!I(a)&&!Y.includes(a.status)).length,ot=l.filter(I).length,lt=Lt(),pa=E.filter(a=>be.includes(a.status)&&z(a.email)).length,ma=E.filter(a=>be.includes(a.status)&&z(a.email)&&xe(a.availability_reminder_last_sent_at)).length,ua=Math.max(pa-ma,0),te=E.filter(a=>_t(a)).map(a=>{const r=va(a,c).slice(0,3);
110return{candidate:a,draft:Ct(a,r,c)}}).sort((a,r)=>a.draft.priority!==r.draft.priority?a.draft.priority==="Alta"?-1:1:V(r.candidate)-V(a.candidate));return x.useEffect(()=>{typeof window>"u"||te.length===0||Ze(a=>{const r={...a};let i=!1;return te.forEach(({candidate:n,draft:o})=>{let m="";try{m=window.localStorage.getItem(`candidate-outreach-draft:${n.id}`)||""}catch{m=""}const p=m||o.message;r[n.id]!==p&&(r[n.id]=p,i=!0)}),i?r:a})},[l,c]),e.jsxs("div",{className:"p-6 pb-24 space-y-6 animate-in fade-in duration-300 relative text-left",children:[e.jsx("div",{className:"flex justify-between items-start mb-2",children:e.jsxs("div",{children:[e.jsx("button",{onClick:t,className:"text-gray-400 text-[10px] font-black uppercase hover:text-[#1c74e9] transition-colors mb-2 block",children:"â Volver al Inicio"}),e.jsx("h1",{className:"text-3xl font-black text-gray-900 leading-none italic",children:"Candidatos"}),e.jsxs("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mt-2 bg-blue-50 inline-block px-3 py-1 rounded-full border border-blue-100",children:["Bolsa de Empleo ",ye.label]})]})}),s&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-[20px] p-4",children:[e.jsx("p",{className:"text-amber-800 text-[10px] font-black uppercase tracking-widest",children:"Revision local segura"}),e.jsx("p",{className:"text-amber-900 text-xs font-bold mt-1 leading-relaxed",children:"Puedes probar estados y compromisos sin modificar Supabase ni enviar correos."})]}),h&&e.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-[20px] p-4 flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-red-800 text-xs font-bold leading-relaxed",children:h}),e.jsx("button",{type:"button",onClick:H,className:"shrink-0 rounded-xl bg-red-600 px-3 py-2 text-[10px] font-black uppercase tracking-wider text-white",children:"Reintentar"})]}),j==="active"&&e.jsxs("div",{className:"rounded-[20px] border border-emerald-200 bg-emerald-50 p-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-emerald-700",children:"Regla de incorporacion"}),e.jsx("p",{className:"mt-1 text-xs font-bold leading-relaxed text-emerald-950",children:"Solo quien figure como Profesor disponible puede preparar su incorporacion al Equipo. Las coincidencias de candidaturas pendientes sirven unicamente para priorizar entrevistas. Antes de asignar, confirma siempre su agenda actual y la modalidad."})]}),j==="active"&&te.length>0&&e.jsxs("section",{className:"rounded-[28px] border border-sky-200 bg-gradient-to-br from-sky-50 via-white to-orange-50 p-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-sky-700",children:"Seguimiento matinal"}),e.jsx("h2",{className:"mt-1 text-lg font-black text-slate-950",children:"Mensajes preparados para revisar"}),e.jsx("p",{className:"mt-1 max-w-2xl text-[10px] font-bold leading-relaxed text-slate-600",children:"Candidaturas reales recibidas durante las últimas 72 horas. Revisa el texto y confirma el envÃo. La app registra la fecha, evita duplicados y las respuestas llegan a [email protected]."})]}),e.jsxs("span",{className:"w-fit rounded-full border border-sky-200 bg-white px-3 py-1.5 text-[9px] font-black uppercase tracking-widest text-sky-700",children:[te.length," por revisar"]})]}),e.jsx("div",{className:"mt-4 space-y-3",children:te.map(({candidate:a,draft:r})=>{const i=Ta[a.id]??r.message,n=Na(a.phone),o=n?`https://wa.me/${n}?text=${encodeURIComponent(i)}`:void 0,m=z(a.email);return e.jsxs("article",{className:"rounded-2xl border border-white bg-white/90 p-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"break-words text-sm font-black text-slate-950 [overflow-wrap:anywhere]",children:a.full_name}),e.jsx("p",{className:"mt-1 text-[10px] font-bold leading-relaxed text-slate-600",children:r.reason})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsxs("span",{className:`rounded-full px-2.5 py-1 text-[8px] font-black uppercase tracking-widest ${r.priority==="Alta"?"bg-orange-100 text-orange-700":"bg-sky-100 text-sky-700"}
110`,children:["Prioridad ",r.priority]}),e.jsx("span",{className:"rounded-full bg-slate-100 px-2.5 py-1 text-[8px] font-black uppercase tracking-widest text-slate-600",children:r.channel})]})]}),e.jsx("textarea",{value:i,onChange:p=>Ja(a.id,p.target.value),rows:8,className:"mt-3 w-full resize-y rounded-2xl border border-slate-200 bg-slate-50 p-3 text-xs font-medium leading-relaxed text-slate-800 outline-none focus:border-sky-400 focus:bg-white","aria-label":`Borrador de seguimiento para ${a.full_name}`}),e.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-2 sm:grid-cols-3",children:[e.jsx("button",{type:"button",onClick:()=>void Ka(a.id,i),className:"rounded-xl border border-slate-200 bg-white px-3 py-2.5 text-[9px] font-black uppercase tracking-widest text-slate-700",children:Ia===a.id?"Texto copiado":"Copiar texto"}),o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"rounded-xl bg-emerald-500 px-3 py-2.5 text-center text-[9px] font-black uppercase tracking-widest text-white",children:"Abrir WhatsApp"}):e.jsx("span",{className:"rounded-xl bg-slate-100 px-3 py-2.5 text-center text-[9px] font-black uppercase tracking-widest text-slate-400",children:"Sin WhatsApp"}),m?e.jsx("button",{type:"button",onClick:()=>void Za(a,r.subject,i),disabled:Je===a.id,className:"rounded-xl bg-[#1c74e9] px-3 py-2.5 text-center text-[9px] font-black uppercase tracking-widest text-white disabled:cursor-wait disabled:opacity-60",children:Je===a.id?"Enviando...":"Enviar email"}):e.jsx("span",{className:"rounded-xl bg-slate-100 px-3 py-2.5 text-center text-[9px] font-black uppercase tracking-widest text-slate-400",children:"Sin email"})]})]},`outreach-${a.id}`)})})]}),e.jsxs("div",{className:"bg-white p-4 rounded-[24px] shadow-sm border border-gray-100 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-2xl bg-gray-50 p-1.5 border border-gray-100",children:[e.jsxs("button",{type:"button",onClick:()=>Re("active"),className:`min-w-0 rounded-xl px-3 py-3 text-[10px] font-black uppercase tracking-wider transition-all ${j==="active"?"bg-[#1c74e9] text-white shadow-md shadow-blue-500/20":"bg-transparent text-gray-500"}`,children:["Activos ",ye.label," (",E.length,")"]}),e.jsxs("button",{type:"button",onClick:()=>Re("archive"),className:`min-w-0 rounded-xl px-3 py-3 text-[10px] font-black uppercase tracking-wider transition-all ${j==="archive"?"bg-[#1c74e9] text-white shadow-md shadow-blue-500/20":"bg-transparent text-gray-500"}`,children:["Histórico (",da.length,")"]})]}),e.jsx("input",{type:"text",placeholder:"Buscar por nombre, zona o materia...",className:"w-full bg-gray-50 p-3 rounded-xl border border-gray-100 text-xs font-bold outline-none focus:border-[#1c74e9]",value:O,onChange:a=>Ne(a.target.value)}),j==="active"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",children:["Todos","Pendiente","Entrevistado","Profesor disponible"].map(a=>e.jsx("button",{onClick:()=>Pa(a),className:`px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest whitespace-nowrap transition-all ${oe===a?"bg-[#1c74e9] text-white shadow-md":"bg-gray-50 text-gray-500 hover:bg-gray-100"}`,children:a},a))}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold leading-relaxed",children:"Solo aparecen candidaturas recibidas o reconfirmadas desde el 1 de junio. El histórico se conserva y no recibe recordatorios por error."})]}):e.jsxs("p",{className:"text-gray-500 text-[10px] font-bold leading-relaxed",children:["Candidaturas ya incorporadas, descartadas, de pruebas tecnicas o de campañas anteriores sin reconfirmacion para ",ye.label,". No se ha borrado ni desactivado ninguna ficha de profesor."]})]}),e.jsxs("div",{className:`${j==="active"?"":"hidden"} bg-white p-4 rounded-[24px] shadow-sm border border-gray-100 space-y-3`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Disponibilidad real"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold",children:"Prioriza primero a quien sà tiene ese hueco libre o mañanas útiles en verano."})]}),e.jsx("button",{type:"button",onClick:()=>{Me(""),qe(""),Ve("")},className:"bg-gray-50 text-gray-500 border border-gray-200 px-3 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest",children:"Limpiar"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-emerald-600 uppercase tracking-widest block mb-1",children:"Tarde completa indicada"}),e.jsxs("select",{value:C,onChange:a=>Me(a.target.value),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-emerald-400",children:[e.jsx("option",{value:"",children:"Cualquier tarde"}),ze.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-[#1c74e9] uppercase tracking-widest block mb-1",children:"Bloque semanal prioritario"}),e.jsxs("select",{value:P,onChange:a=>qe(a.target.value),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9]",children:[e.jsx("option",{value:"",children:"Sin prioridad"}),fe.map(a=>e.jsx("option",{value:a.key,children:a.label},a.key))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-orange-500 uppercase tracking-widest block mb-1",children:"Verano mañana prioritario"}),e.jsxs("select",{value:D,onChange:a=>Ve(a.target.value),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-orange-400",children:[e.jsx("option",{value:"",children:"Sin prioridad"}),he.map(a=>e.jsx("option",{value:a.key,children:a.label},a.key))]})]})]})]}),e.jsxs("div",{className:`${j==="active"?"":"hidden"} bg-white p-4 rounded-[24px] shadow-sm border border-gray-100 space-y-4`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Reconfirmacion mensual"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold mt-1",children:"Email suave para confirmar si el candidato sigue disponible este mes y de cara al verano."})]}),e.jsx("span",{className:"shrink-0 bg-blue-50 text-[#1c74e9] border border-blue-100 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:lt})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-gray-400 text-[9px] font-black uppercase tracking-widest",children:"Con email"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none mt-2",children:pa})]}),e.jsxs("div",{className:"bg-emerald-50 border border-emerald-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-emerald-600 text-[9px] font-black uppercase tracking-widest",children:"Enviados"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none mt-2",children:ma})]}),e.jsxs("div",{className:"bg-orange-50 border border-orange-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-orange-500 text-[9px] font-black uppercase tracking-widest",children:"Pendientes"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none mt-2",children:ua})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:H,className:"flex-1 bg-white text-gray-600 border border-gray-200 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest",children:"Resumen del mes"}),e.jsx("button",{type:"button",onClick:Ya,disabled:Qe||ua===0,className:"flex-1 bg-[#1c74e9] text-white py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60 disabled:cursor-not-allowed",children:Qe?"Enviando...":"Enviar pendientes"})]})]}),e.jsxs("div",{className:`${j==="active"?"":"hidden"} grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[e.jsxs("div",{className:"bg-white p-4 rounded-[20px] border border-orange-100 shadow-sm",children:[e.jsx("p",{className:"text-orange-500 text-[9px] font-black uppercase tracking-widest mb-1",children:"Pendientes"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none",children:et})]}),e.jsxs("div",{className:"bg-white p-4 rounded-[20px] border border-blue-100 shadow-sm",children:[e.jsx("p",{className:"text-blue-500 text-[9px] font-black uppercase tracking-widest mb-1",children:"Entrevistados"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none",children:at})]}),e.jsxs("div",{className:"bg-white p-4 rounded-[20px] border border-emerald-100 shadow-sm",children:[e.jsx("p",{className:"text-emerald-600 text-[9px] font-black uppercase tracking-widest mb-1",children:"Profes disponibles"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none",children:tt})]}),e.jsxs("div",{className:"bg-white p-4 rounded-[20px] border border-violet-100 shadow-sm",children:[e.jsx("p",{className:"text-violet-500 text-[9px] font-black uppercase tracking-widest mb-1",children:"En reserva"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none",children:rt})]})]}),j==="active"&&Te>0&&e.jsxs("div",{className:"rounded-[20px] border border-amber-200 bg-amber-50 p-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-amber-800",children:"Revisión pendiente"}),e.jsx("p",{className:"mt-1 text-xs font-bold leading-relaxed text-amber-900",children:Te===1?"Hay una candidatura pendiente desde hace más de 7 dÃas. Conviene entrevistarla, reservarla o descartarla para que no quede olvidada.":`Hay ${Te} candidaturas pendientes desde hace más de 7 dÃas. Conviene revisar su siguiente paso.`})]}),e.jsx("div",{className:`${j==="active"?"":"hidden"} space-y-4`,children:k?e.jsxs("div",{className:"flex flex-col items-center py-20",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-[#1c74e9] border-t-transparent roun
110ded-full animate-spin mb-4"}),e.jsx("p",{className:"text-center text-gray-400 text-xs font-bold uppercase tracking-widest",children:"Cargando curriculums..."})]}):ca.length===0?e.jsxs("div",{className:"text-center bg-white p-8 rounded-[32px] border border-gray-100 shadow-sm",children:[e.jsx("span",{className:"text-4xl block mb-3 opacity-50",children:"ð"}),e.jsx("p",{className:"text-gray-900 font-bold text-sm",children:"No hay candidatos"}),e.jsx("p",{className:"text-gray-400 text-xs mt-1",children:"Prueba a cambiar los filtros de busqueda."})]}):ca.map(a=>{const r=w(a.weekly_availability),i=w(a.summer_availability),n=ve(r,fe),o=ve(i,he),m=P?Q(r,P):!1,p=D?Q(i,D):!1,y=a.availability_state||"Disponible ahora",q=ue(a),W=C?q.includes(C):!1,F=ea===a.id,U=xe(a.availability_reminder_last_sent_at),re=be.includes(a.status)&&z(a.email),G=va(a,c).slice(0,3);return e.jsxs("div",{className:`bg-white p-5 rounded-[24px] shadow-[0_4px_20px_rgba(0,0,0,0.03)] border relative overflow-hidden group transition-all ${W||m||p?"border-blue-200 shadow-blue-500/10":"border-gray-100 hover:border-blue-200"}`,children:[e.jsx("div",{className:`absolute top-0 left-0 w-1.5 h-full ${Mt(a.status)}`}),e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3 mb-3",children:[e.jsxs("div",{className:"min-w-0 pr-2",children:[e.jsx("h3",{className:"font-black text-sm text-gray-900 leading-tight break-words [overflow-wrap:anywhere]",children:a.full_name}),e.jsxs("p",{className:"text-gray-500 text-[10px] font-bold mt-1 leading-tight break-words [overflow-wrap:anywhere]",children:["ð ",a.location||"Sin localidad"," ",a.province?`(${a.province})`:""]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-bold leading-tight",children:[e.jsxs("a",{href:a.email?`mailto:${a.email}`:void 0,className:"break-words text-[#1c74e9] [overflow-wrap:anywhere]",children:["âï¸ ",a.email||"Sin email"]}),L(a.phone)?e.jsxs("a",{href:L(a.phone),target:"_blank",rel:"noreferrer",className:"break-words text-emerald-600 [overflow-wrap:anywhere]",children:["ð± ",K(a.phone)]}):e.jsxs("span",{className:"text-gray-400",children:["ð± ",K(a.phone)]})]}),e.jsx("p",{className:`mt-1 text-[9px] font-black uppercase tracking-wide ${a.intake_confirmation_email_sent_at?"text-emerald-600":"text-amber-600"}`,children:a.intake_confirmation_email_sent_at?`Acuse enviado · ${zt(a.intake_confirmation_email_sent_at)}`:"Acuse pendiente"}),!a.intake_confirmation_email_sent_at&&!a.local_preview&&!J(a)&&e.jsx("button",{type:"button",onClick:()=>void Qa(a),disabled:Fe===a.id,className:"mt-2 rounded-lg border border-amber-200 bg-amber-50 px-2 py-1.5 text-[9px] font-black uppercase tracking-wide text-amber-700 disabled:opacity-60",children:Fe===a.id?"Enviando...":"Reintentar acuse"}),Le(a.source)&&e.jsxs("p",{className:"mt-1 text-[9px] font-black uppercase tracking-widest text-orange-600",children:["Origen: ",Le(a.source)]})]}),e.jsxs("div",{className:"flex max-w-[138px] flex-col items-end gap-2",children:[J(a)&&e.jsxs("span",{className:"rounded-lg border border-amber-300 bg-amber-50 px-2 py-1 text-right text-[9px] font-black uppercase tracking-wide text-amber-800",children:["Revisar hoy · ",At(a)," dias"]}),a.local_preview&&e.jsx("span",{className:"rounded-lg border border-amber-200 bg-amber-50 px-2 py-1 text-[9px] font-black uppercase tracking-widest text-amber-700",children:"Prueba local"}),e.jsxs("select",{value:a.status,onChange:u=>qa(a.id,u.target.value),className:`max-w-full text-[9px] font-black uppercase tracking-wide px-2 py-1.5 rounded-lg outline-none cursor-pointer border ${ja(a.status)}`,children:[e.jsx("option",{value:"Pendiente",children:"Pendiente"}),e.jsx("option",{value:"Entrevistado",children:"Entrevistado"}),e.jsx("option",{value:"Profesor disponible",children:"Profesor disponible"}),e.jsx("option",{value:"En reserva",children:"En reserva"}),e.jsx("option",{value:"Descartado",children:"Descartado"})]})]})]}),J(a)&&e.jsxs("div",{className:"mb-4 rounded-2xl border border-amber-200 bg-amber-50 p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-amber-800",children:"Siguiente paso recomendado"}),e.jsx("p",{className:"mt-1 text-[10px] font-bold leading-relaxed text-amber-900",children:"Confirma primero si sigue en proceso y decide si corresponde entrevistar, reservar o descartar. El acuse automatico queda bloqueado para evitar enviarlo fuera de contexto."})]}),G.length>0&&e.jsxs("div",{className:"mb-4 rounded-2xl border border-sky-200 bg-sky-50 p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-sky-800",children:"Encajes con grupos sin profesor"}),e.jsx("p",{className:"mt-1 text-[10px] font-bold leading-relaxed text-sky-900",children:"Son sugerencias de revision: no asignan profesor ni cambian estados."}),e.jsx("div",{className:"mt-3 space-y-2",children:G.map(u=>e.jsxs("div",{className:"rounded-xl border border-white/80 bg-white/80 p-2.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:`rounded-full px-2 py-1 text-[8px] font-black uppercase tracking-wide ${u.fit==="direct"?"bg-emerald-100 text-emerald-800":u.fit==="confirm_academy"?"bg-amber-100 text-amber-800":"bg-blue-100 text-blue-800"}`,children:u.fit==="direct"?"Encaje directo":u.fit==="confirm_academy"?"Confirmar Academia y agenda":"Prioridad entrevista"}),e.jsxs("span",{className:"text-[9px] font-black text-gray-900",children:[u.weekday," ",u.startTime,"-",u.endTime]})]}),e.jsxs("p",{className:"mt-1 text-[10px] font-black text-gray-900",children:[u.subject," · ",u.level]}),e.jsxs("p",{className:"mt-1 text-[9px] font-bold text-gray-600",children:[u.occupiedPlaces,"/3 plazas · ",u.classroom,". ",u.reason]})]},u.planId))})]}),(a.status==="Profesor disponible"||q.length>0)&&e.jsxs("div",{className:"mb-4 rounded-2xl border border-emerald-200 bg-emerald-50 p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-emerald-700",children:a.status==="Profesor disponible"?"Tardes completas comprometidas":"Tardes completas indicadas en candidatura"}),e.jsx("p",{className:"mt-1 text-xs font-black text-gray-900",children:q.length>0?q.join(" y "):"Pendiente de confirmar con Coordinacion"}),a.commitment_exception_reason&&e.jsxs("p",{className:"mt-2 text-[10px] font-bold text-amber-700",children:["Excepcion de una tarde: ",a.commitment_exception_reason]})]}),e.jsxs("div",{className:"mb-3 space-y-1.5 bg-gray-50/50 p-2 rounded-xl",children:[a.studies&&e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium leading-tight",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Titulacion:"})," ",a.studies]}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium leading-tight",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Materias:"})," ",a.subjects]}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium leading-tight",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Niveles:"})," ",a.levels]})]}),e.jsxs("div",{className:"bg-gray-50 p-3 rounded-xl border border-gray-100 mb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-gray-400 text-[9px] font-black uppercase tracking-widest mr-1",children:"Zonas:"}),a.has_car&&e.jsx("span",{className:"bg-blue-100 text-blue-700 border border-blue-200 text-[9px] font-black px-2 py-1 rounded-md flex items-center gap-1",children:"Coche"}),a.has_metro&&e.jsx("span",{className:"bg-green-100 text-green-700 border border-green-200 text-[9px] font-black px-2 py-1 rounded-md flex items-center gap-1",children:"Metro"}),a.wants_academy&&e.jsx("span",{className:"bg-indigo-100 text-indigo-700 border border-indigo-200 text-[9px] font-black px-2 py-1 rounded-md flex items-center gap-1",children:"Academia"}),!a.has_car&&!a.has_metro&&!a.wants_academy&&e.jsx("span",{className:"bg-gray-200 text-gray-600 border border-gray-300 text-[9px] font-black px-2 py-1 rounded-md",children:"Solo Online"}),a.online_invoicing_status&&e.jsx("span",{className:"bg-cyan-50 text-cyan-700 border border-cyan-200 text-[9px] font-black px-2 py-1 rounded-md",children:Dt[a.online_invoicing_status]||"Situacion online pendiente de revisar"})]}),a.online_invoicing_status&&e.jsx("p",{className:"text-[9px] font-bold text-cyan-800",children:"Dato declarado por el candidato; debe comprobarse antes de incorporarlo."}),(a.winter_schedule||a.summer_schedule)&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mt-2 pt-2 border-t border-gray-200/60",children:[a.winter_schedule&&e.jsx("div",{className:"flex items-start gap-1.5",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black text-blue-600 uppercase tracking-widest leading-none mb-0.5",children:"Inviern
110o"}),e.jsx("p",{className:"text-[10px] text-gray-600 font-medium leading-tight",children:a.winter_schedule})]})}),a.summer_schedule&&e.jsx("div",{className:"flex items-start gap-1.5",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black text-orange-500 uppercase tracking-widest leading-none mb-0.5",children:"Verano"}),e.jsx("p",{className:"text-[10px] text-gray-600 font-medium leading-tight",children:a.summer_schedule})]})})]}),a.availability&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-gray-200/60",children:[e.jsx("p",{className:"text-[9px] font-black text-gray-400 uppercase tracking-widest mb-1",children:"Notas del candidato:"}),e.jsxs("p",{className:"text-[10px] text-gray-600 italic whitespace-pre-wrap",children:['"',a.availability,'"']})]})]}),e.jsxs("div",{className:"bg-white border border-gray-100 rounded-[20px] p-4 mb-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Disponibilidad real"}),e.jsxs("p",{className:"text-gray-400 text-[10px] font-bold mt-1",children:["Ãltima confirmación: ",ka(a.availability_last_confirmed_at)]})]}),e.jsx("span",{className:"shrink-0 bg-slate-50 text-slate-600 border border-slate-200 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:y})]}),(W||m||p)&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[W&&C&&e.jsxs("span",{className:"bg-emerald-50 text-emerald-700 border border-emerald-100 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:["Coincide en ",C]}),m&&P&&e.jsx("span",{className:"bg-blue-50 text-[#1c74e9] border border-blue-100 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:"Encaja en bloque semanal"}),p&&D&&e.jsx("span",{className:"bg-orange-50 text-orange-600 border border-orange-100 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:"Encaja en verano"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-blue-50/60 border border-blue-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[#1c74e9] text-[9px] font-black uppercase tracking-widest",children:"Bloques semanales"}),e.jsx("p",{className:"text-gray-900 text-xl font-black leading-none mt-2",children:n.totalAvailable}),e.jsxs("p",{className:"text-gray-500 text-[10px] font-bold mt-2 leading-relaxed",children:[n.onlineOnly>0?`${n.onlineOnly} solo online · `:"",n.extrasOnly>0?`${n.extrasOnly} solo extra`:"Según disponibilidad confirmada"]})]}),e.jsxs("div",{className:"bg-orange-50/60 border border-orange-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-orange-500 text-[9px] font-black uppercase tracking-widest",children:"Verano mañanas"}),e.jsx("p",{className:"text-gray-900 text-xl font-black leading-none mt-2",children:o.totalAvailable}),e.jsx("p",{className:"text-gray-500 text-[10px] font-bold mt-2 leading-relaxed",children:"Del 20 de junio al 31 de agosto"})]})]}),re&&e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-[10px] uppercase tracking-widest",children:"Reconfirmacion mensual"}),e.jsx("p",{className:`text-[10px] font-bold mt-1 ${U?"text-emerald-600":"text-orange-500"}`,children:U?"Enviado este mes":"Pendiente este mes"})]}),e.jsx("button",{type:"button",onClick:()=>De(a),disabled:le===a.id,className:"bg-[#1c74e9] text-white px-4 py-2.5 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60 disabled:cursor-not-allowed",children:le===a.id?"Enviando...":U?"Reenviar email":"Email mensual"})]}),F&&e.jsxs("div",{className:"space-y-4 pt-2 border-t border-gray-100",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-violet-600 uppercase tracking-widest block mb-1",children:"Estado actual"}),e.jsx("select",{value:_.state,onChange:u=>pe(f=>({...f,state:u.target.value})),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-violet-400",children:ct.map(u=>e.jsx("option",{value:u,children:u},u))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Nota interna"}),e.jsx("input",{type:"text",value:_.notes,onChange:u=>pe(f=>({...f,notes:u.target.value})),placeholder:"Ej: cambia en junio por oposiciones",className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9]"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black text-[#1c74e9] uppercase tracking-widest mb-2",children:"Disponibilidad semanal real"}),e.jsx("div",{className:"space-y-2",children:["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"].map(u=>e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400 mb-2",children:u}),e.jsx("div",{className:"space-y-2",children:fe.filter(f=>f.day===u).map(f=>e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-center",children:[e.jsx("p",{className:"text-[10px] font-bold text-gray-600",children:f.time}),e.jsx("select",{value:ie(_.weekly,f.key),onChange:N=>ia("weekly",f.key,N.target.value),className:`min-w-[120px] border p-2 rounded-xl text-[10px] font-black outline-none ${fa(ie(_.weekly,f.key))}`,children:ga.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))})]},f.key))})]},u))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black text-orange-500 uppercase tracking-widest mb-2",children:"Verano · mañanas del 20/06 al 31/08"}),e.jsx("div",{className:"space-y-2",children:["Lunes","Martes","Miércoles","Jueves","Viernes"].map(u=>e.jsxs("div",{className:"bg-orange-50/40 border border-orange-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-orange-400 mb-2",children:u}),e.jsx("div",{className:"space-y-2",children:he.filter(f=>f.day===u).map(f=>e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-center",children:[e.jsx("p",{className:"text-[10px] font-bold text-gray-600",children:f.time}),e.jsx("select",{value:ie(_.summer,f.key),onChange:N=>ia("summer",f.key,N.target.value),className:`min-w-[120px] border p-2 rounded-xl text-[10px] font-black outline-none ${fa(ie(_.summer,f.key))}`,children:ga.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))})]},f.key))})]},`summer-${u}`))})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>Z(null),className:"flex-1 bg-white text-gray-600 border border-gray-200 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:()=>Ma(a),disabled:aa===a.id,className:"flex-1 bg-[#1c74e9] text-white py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60 disabled:cursor-not-allowed",children:aa===a.id?"Guardando...":"Guardar disponibilidad"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.local_preview?e.jsx("div",{className:"min-h-[48px] bg-gray-50 text-gray-400 border border-gray-100 py-3 rounded-xl flex justify-center items-center gap-2 font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"Sin envÃos"}):e.jsx("a",{href:L(a.phone),target:"_blank",rel:"noreferrer",className:"min-w-0 min-h-[48px] bg-[#25D366]/10 hover:bg-[#25D366]/20 text-[#25D366] border border-[#25D366]/30 px-2 py-3 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-wide transition-colors text-center leading-tight [overflow-wrap:anywhere]",children:"WhatsApp"}),a.cv_url?e.jsx("button",{type:"button",onClick:()=>void ya("cvs",a.cv_url).catch(()=>alert("No se ha podido abrir el CV. Revisa tu acceso o vuelve a intentarlo.")),className:"min-w-0 min-h-[48px] bg-[#1c74e9] text-white px-2 py-3 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-wide shadow-lg shadow-blue-500/20 active:scale-95 transition-all text-center leading-tight [overflow-wrap:anywhere]",children:"Ver CV"}):a.local_preview&&a.local_cv_name?e.jsxs("div",{className:"min-h-[48px] bg-blue-50 text-blue-700 border border-blue-100 px-2 py-3 rounded-xl flex justify-center items-center gap-2 font-black text-[9px] uppercase tracking-widest text-center leading-tight",children:["CV prueba: ",a.local_cv_name]}):e.jsx("div",{className:"min-h-[48px] bg-gray-50 text-gray-400 border border-gray-100 py-3 rounded-xl flex justify-center items-center gap-2 font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"Sin CV"}),e.jsx("button",{type:"button",onClick:()=>na(a),className:"min-w-0 min-h-[48px] bg-gray-900 text-white px-2 py-3 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-wide shadow-lg shadow-gray-900/10 active:scale-95 transition-all text-center leading-tight [overflow-wrap:anywhere]",children:"Panel candidato"}),e.jsx("button",{type:"button",onClick:()=>Ra(a),className:`min-w-0 min-h-[48px] border px-2 py-3 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-wide transition-colors text-center leading-tight [overflow-wrap:anywhere] ${F?"bg-vi
110olet-600 text-white border-violet-600":"bg-violet-50 text-violet-600 border-violet-200 hover:bg-violet-100"}`,children:F?"Cerrar disponibilidad":"Disponibilidad"})]}),a.local_preview&&e.jsx("button",{type:"button",onClick:()=>Xa(a.id),className:"mt-3 w-full rounded-xl border border-amber-200 bg-amber-50 py-3 text-[10px] font-black uppercase tracking-widest text-amber-700",children:"Quitar candidatura de prueba"}),a.status==="Profesor disponible"&&e.jsx("button",{type:"button",onClick:()=>Wa(a),className:"mt-3 w-full rounded-2xl bg-emerald-600 py-4 text-xs font-black uppercase tracking-widest text-white shadow-lg shadow-emerald-500/20",children:"Preparar incorporacion"})]},a.id)})}),j==="active"&&$e.length>0&&e.jsxs("div",{className:"bg-white p-4 rounded-[24px] border border-violet-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Cantera en reserva"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold",children:"Perfiles interesantes para volver a contactar, compartir formacion o cubrir nuevas vacantes."})]}),e.jsx("button",{onClick:()=>Da(a=>!a),className:"bg-violet-600 text-white px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest",children:Be?"Ocultar":`Ver ${$e.length}`})]}),Be&&e.jsx("div",{className:"space-y-3 mt-4 pt-4 border-t border-violet-100",children:$e.map(a=>{const r=xe(a.availability_reminder_last_sent_at);return e.jsxs("div",{className:"bg-violet-50/50 p-4 rounded-[20px] border border-violet-100 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-gray-900 font-black text-sm leading-tight break-words [overflow-wrap:anywhere]",children:a.full_name}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-bold leading-tight",children:[e.jsxs("a",{href:a.email?`mailto:${a.email}`:void 0,className:"break-words text-[#1c74e9] [overflow-wrap:anywhere]",children:["âï¸ ",a.email||"Sin email"]}),L(a.phone)?e.jsxs("a",{href:L(a.phone),target:"_blank",rel:"noreferrer",className:"break-words text-emerald-600 [overflow-wrap:anywhere]",children:["ð± ",K(a.phone)]}):e.jsxs("span",{className:"text-gray-400",children:["ð± ",K(a.phone)]})]}),e.jsxs("p",{className:"text-gray-400 text-[10px] font-bold mt-1 leading-tight break-words [overflow-wrap:anywhere]",children:[a.location||"Sin localidad"," ",a.province?`· ${a.province}`:""]})]}),e.jsx("span",{className:"shrink-0 text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg border bg-violet-50 text-violet-600 border-violet-200",children:"En reserva"})]}),e.jsxs("div",{className:"bg-white border border-violet-100 rounded-2xl p-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-[10px] uppercase tracking-widest",children:"Disponibilidad del mes"}),e.jsx("p",{className:`text-[10px] font-bold mt-1 ${r?"text-emerald-600":"text-orange-500"}`,children:r?"Enviado este mes":"Pendiente este mes"})]}),e.jsx("button",{type:"button",onClick:()=>De(a),disabled:le===a.id,className:"bg-[#1c74e9] text-white px-4 py-2.5 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60 disabled:cursor-not-allowed",children:le===a.id?"Enviando...":r?"Reenviar email":"Email mensual"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>na(a),className:"min-h-[46px] bg-gray-900 text-white py-2.5 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"Espiar"}),e.jsx("button",{onClick:()=>Ga(a),disabled:He===a.id,className:"min-h-[46px] bg-violet-600 text-white py-2.5 rounded-xl font-black text-[10px] uppercase tracking-widest disabled:opacity-60 disabled:cursor-not-allowed text-center leading-tight",children:He===a.id?"Enviando...":"Email Seguimiento"}),e.jsx("a",{href:L(a.phone),target:"_blank",rel:"noreferrer",className:"min-h-[46px] bg-white text-violet-600 border border-violet-200 py-2.5 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"WhatsApp"}),a.cv_url?e.jsx("button",{type:"button",onClick:()=>void ya("cvs",a.cv_url).catch(()=>alert("No se ha podido abrir el CV. Revisa tu acceso o vuelve a intentarlo.")),className:"min-h-[46px] bg-[#1c74e9] text-white py-2.5 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"Ver CV"}):e.jsx("div",{className:"min-h-[46px] bg-gray-50 text-gray-400 border border-gray-100 py-2.5 rounded-xl flex justify-center items-center font-black text-[10px] uppercase tracking-widest text-center leading-tight",children:"Sin CV"})]})]},`reserve-${a.id}`)})})]}),j==="archive"&&e.jsxs("div",{className:"bg-white p-4 rounded-[24px] border border-gray-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Histórico de candidaturas"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold",children:"Los incorporados siguen en Equipo con su ficha de profesor; aqui solo se cierra su proceso de seleccion."}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[e.jsxs("span",{className:"bg-green-50 text-green-600 border border-green-200 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:["Incorporados ",st]}),e.jsxs("span",{className:"bg-gray-50 text-gray-500 border border-gray-200 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:["Descartados ",it]}),e.jsxs("span",{className:"bg-blue-50 text-[#1c74e9] border border-blue-100 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:["Sin reconfirmar ",nt]}),e.jsxs("span",{className:"bg-amber-50 text-amber-700 border border-amber-200 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:["Pruebas tecnicas ",ot]})]})]}),e.jsx("button",{onClick:()=>$a(a=>!a),className:"bg-gray-900 text-white px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest",children:Oe?"Ocultar":`Ver ${me.length}`})]}),Oe&&me.length>0&&e.jsx("div",{className:"space-y-3 mt-4 pt-4 border-t border-gray-100",children:me.map(a=>e.jsxs("div",{className:"bg-gray-50 p-4 rounded-[20px] border border-gray-100 grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-gray-900 font-black text-sm leading-tight break-words [overflow-wrap:anywhere]",children:a.full_name}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-bold leading-tight",children:[e.jsxs("a",{href:a.email?`mailto:${a.email}`:void 0,className:"break-words text-[#1c74e9] [overflow-wrap:anywhere]",children:["âï¸ ",a.email||"Sin email"]}),L(a.phone)?e.jsxs("a",{href:L(a.phone),target:"_blank",rel:"noreferrer",className:"break-words text-emerald-600 [overflow-wrap:anywhere]",children:["ð± ",K(a.phone)]}):e.jsxs("span",{className:"text-gray-400",children:["ð± ",K(a.phone)]})]}),e.jsxs("p",{className:"text-gray-400 text-[9px] font-bold mt-1",children:["Ultima actividad: ",Pt(a)]})]}),e.jsx("span",{className:`max-w-[132px] text-center text-[9px] font-black uppercase tracking-wide px-2 py-1 rounded-lg border ${ja(a.status)}`,children:I(a)?"Prueba tecnica":Y.includes(a.status)?wa(a.status):`${wa(a.status)} anterior`})]},`archive-${a.id}`))}),me.length===0&&e.jsxs("div",{className:"mt-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 text-center",children:[e.jsx("p",{className:"text-xs font-black text-gray-700",children:"No hay resultados en el histórico"}),e.jsx("p",{className:"mt-1 text-[10px] font-bold text-gray-400",children:"Prueba a cambiar la busqueda."})]})]}),S&&e.jsx("div",{className:"fixed inset-0 z-[10000] bg-gray-950/60 backdrop-blur-sm p-4 flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-lg max-h-[92vh] overflow-y-auto rounded-[30px] bg-white shadow-2xl border border-gray-100",children:[e.jsxs("div",{className:"bg-emerald-600 text-white p-6 rounded-t-[30px]",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[3px] text-emerald-100",children:"Paso de seleccion"}),e.jsx("h2",{className:"text-2xl font-black mt-2",children:"Profesor disponible"}),e.jsx("p",{className:"text-sm font-bold text-emerald-50 mt-2",children:S.full_name})]}),e.jsxs("div",{className:"p-6 space-y-5",children:[e.jsxs("div",{className:"rounded-2xl border border-blue-100 bg-blue-50 p-4",children:[e.jsx("p",{className:"text-sm font-black text-gray-900",children:"Esto no incorpora ni da de alta al profesor"}),e.jsx("p",{className:"text-xs font-medium text-gray-600 mt-2 leading-relaxed",children:"Solo confirma que sigue interesado y reserva tardes para que Coordinacion procure completarlas con grupos o clases compatibles."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-gray-500",children:"Tardes acordadas"}),e.jsx("p",{className:"text-xs font-bold text-gray-600 mt-1",children:"Selecciona dos como norma general. Cada una cubre de 16:00 a 20:30 en tres clases de 90 minutos."}),e.jsx("div",{className:"grid grid-cols-2 gap-2 mt-3",children:ze.map(a=>{const r=$.includes(a),i=ha(w(S.weekly_availability)).includes(a);return e.jsxs("button",{type:"button",onClick:()=>Va(a),className:`rounded-2xl border p-3 text-left transition-colors ${r?"border-emerald-500 bg-emerald-50 text-emerald-800":"border-gray-200 bg-white text-gray-600"}`,children:[e.jsx("span",{className:"block text-xs font-black",children:a}),e.jsx("span",{className:"block text-[9px] font-bold mt-1",children:i?"Marcada como disponible":"No constaba disponible"})]},a)})})]}),$.length===1&&e.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 p-4",children:[e.jsx("label",{className:"text-[10px] font-black uppercase tracking-widest text-amber-800",children:"Motivo de la excepcion"}),e.jsx("textarea",{value:Ce,onChange:a=>Se(a.target.value),placeholder:"Ej: especialista de Bachillerato dificil de cubrir.",rows:3,className:"mt-2 w-full rounded-xl border border-amber-200 bg-white p-3 text-xs font-bold text-gray-900 outline-none focus:border-amber-500 resize-none"})]}),$.length>2&&e.jsx("p",{className:"rounded-2xl border border-blue-200 bg-blue-50 p-3 text-xs font-bold text-blue-800",children:"Puedes conservar mas de dos tardes completas, aunque Coordinacion planificara primero las dos principales."}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:Ba,disabled:ce,className:"flex-1 rounded-2xl border border-gray-200 bg-white py-4 text-xs font-black uppercase tracking-widest text-gray-600 disabled:opacity-60",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:Oa,disabled:ce||$.length===0,className:"flex-1 rounded-2xl bg-emerald-600 py-4 text-xs font-black uppercase tracking-widest text-white shadow-lg shadow-emerald-500/20 disabled:opacity-60",children:ce?"Guardando...":s?"Simular confirmacion":"Confirmar disponibilidad"})]})]})]})}),ae&&e.jsx("div",{className:"fixed inset-0 z-[10000] bg-gray-950/70 backdrop-blur-sm p-4 flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-2xl max-h-[94vh] overflow-y-auto rounded-[30px] bg-white shadow-2xl border border-gray-100",children:[e.jsxs("div",{className:"bg-gray-950 text-white p-6 rounded-t-[30px]",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[3px] text-emerald-300",children:"Incorporacion guiada"}),e.jsx("h2",{className:"text-2xl font-black mt-2",children:ae.full_name}),e.jsx("p",{className:"mt-2 text-xs font-bold text-gray-300",children:"Esta accion esta separada del estado Profesor disponible."})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-gray-500",children:"Modalidad de la primera asignacion"}),e.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-3 gap-2",children:[{value:"academy",label:"Academia",detail
110:"Alta laboral antes de empezar"},{value:"home",label:"Domicilio",detail:"Familia y profesor aceptan primero"},{value:"online",label:"Online",detail:"Autonomo real validado"}].map(a=>e.jsxs("button",{type:"button",onClick:()=>v(r=>({...r,mode:a.value,familyAccepted:a.value==="home"?r.familyAccepted:!1,onlineAutonomyValidated:a.value==="online"?r.onlineAutonomyValidated:!1})),className:`rounded-2xl border p-4 text-left ${b.mode===a.value?"border-emerald-500 bg-emerald-50 text-emerald-800":"border-gray-200 bg-white text-gray-700"}`,children:[e.jsx("span",{className:"block text-sm font-black",children:a.label}),e.jsx("span",{className:"block mt-1 text-[10px] font-bold",children:a.detail})]},a.value))})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("label",{className:"sm:col-span-2",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-500",children:"Horario concreto acordado"}),e.jsx("input",{type:"text",value:b.scheduleSummary,onChange:a=>v(r=>({...r,scheduleSummary:a.target.value})),placeholder:"Ej: martes y jueves de 16:00 a 19:00",className:"mt-2 w-full rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-emerald-500"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-500",children:"Inicio previsto"}),e.jsx("input",{type:"date",value:b.plannedStartDate,onChange:a=>v(r=>({...r,plannedStartDate:a.target.value})),className:"mt-2 w-full rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-emerald-500"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-500",children:"Horas docentes semanales previstas"}),e.jsx("input",{type:"number",min:"0.5",step:"0.5",value:b.plannedWeeklyHours,onChange:a=>v(r=>({...r,plannedWeeklyHours:a.target.value})),placeholder:"Ej: 6",className:"mt-2 w-full rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-emerald-500"}),e.jsx("span",{className:"mt-2 block text-[10px] font-bold leading-relaxed text-gray-500",children:"Suma real de las clases asignadas. No son las horas de alta ni sustituyen el registro de jornada."})]})]}),b.mode!=="online"&&e.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 p-4",children:[e.jsx("p",{className:"text-xs font-black text-amber-950",children:"Las horas laborales se comprueban en Alta y horas"}),e.jsx("p",{className:"mt-2 text-[11px] font-bold leading-relaxed text-amber-900",children:"Aqui se anotan las horas docentes previstas. La jornada contractual, sus posibles variaciones y las horas efectivamente realizadas se registran y verifican despues en Coordinacion > Alta y horas antes de crear la primera clase en Agenda Centro."})]}),e.jsxs("div",{className:"space-y-2 rounded-2xl border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("label",{className:"flex items-start gap-3 rounded-xl bg-white p-3 border border-gray-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b.candidateAccepted,onChange:a=>v(r=>({...r,candidateAccepted:a.target.checked})),className:"mt-0.5 h-5 w-5 accent-emerald-600"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:"El profesor ha aceptado esta asignacion y este horario."})]}),b.mode==="home"&&e.jsxs("label",{className:"flex items-start gap-3 rounded-xl bg-white p-3 border border-gray-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b.familyAccepted,onChange:a=>v(r=>({...r,familyAccepted:a.target.checked})),className:"mt-0.5 h-5 w-5 accent-emerald-600"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:"La familia ha aceptado la propuesta cerrada para el curso."})]}),e.jsxs("label",{className:"flex items-start gap-3 rounded-xl bg-white p-3 border border-gray-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b.legalRouteValidated,onChange:a=>v(r=>({...r,legalRouteValidated:a.target.checked})),className:"mt-0.5 h-5 w-5 accent-emerald-600"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:b.mode==="online"?"La via profesional y la documentacion se han revisado.":"Direccion ha comprobado el contrato o llamamiento y que el alta o ampliacion de horas refleja la jornada laboral acordad
110a."})]}),b.mode==="online"&&e.jsxs("label",{className:"flex items-start gap-3 rounded-xl bg-amber-50 p-3 border border-amber-200 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b.onlineAutonomyValidated,onChange:a=>v(r=>({...r,onlineAutonomyValidated:a.target.checked})),className:"mt-0.5 h-5 w-5 accent-amber-600"}),e.jsx("span",{className:"text-xs font-bold text-amber-900",children:"Direccion ha comprobado que existe autonomia real y que puede facturar."})]}),e.jsxs("label",{className:"flex items-start gap-3 rounded-xl bg-white p-3 border border-gray-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b.directorAuthorized,onChange:a=>v(r=>({...r,directorAuthorized:a.target.checked})),className:"mt-0.5 h-5 w-5 accent-emerald-600"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:"Direccion autoriza expresamente la incorporacion."})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-500",children:"Notas internas opcionales"}),e.jsx("textarea",{value:b.notes,onChange:a=>v(r=>({...r,notes:a.target.value})),rows:3,placeholder:"Detalles de la asignacion, grupo o familia.",className:"mt-2 w-full rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-emerald-500 resize-none"})]}),e.jsxs("div",{className:"rounded-2xl border border-blue-100 bg-blue-50 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-black text-gray-900",children:"El correo queda preparado, pero no se envia"}),e.jsx("p",{className:"mt-1 text-[11px] font-bold leading-relaxed text-gray-600",children:"La incorporacion crea o reactiva al profesor y guarda este borrador editable. El envio se hara despues, desde Equipo, cuando Direccion lo revise y confirme."})]}),e.jsx("button",{type:"button",onClick:()=>Ae(a=>!a),className:"shrink-0 rounded-xl border border-blue-200 bg-white px-3 py-2 text-[9px] font-black uppercase tracking-widest text-blue-700",children:sa?"Ocultar correo":"Ver correo"})]}),sa&&e.jsxs("div",{className:"mt-4 overflow-hidden rounded-2xl border border-blue-200 bg-white",children:[e.jsxs("div",{className:"border-b border-blue-100 px-4 py-3 text-left",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Para"}),e.jsx("p",{className:"mt-1 break-all text-xs font-bold text-gray-800",children:ae.email}),e.jsx("p",{className:"mt-3 text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Asunto"}),e.jsx("input",{type:"text",value:b.welcomeEmailSubject,onChange:a=>v(r=>({...r,welcomeEmailSubject:a.target.value})),className:"mt-1 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-bold text-gray-800 outline-none focus:border-blue-500"})]}),e.jsxs("div",{className:"grid lg:grid-cols-2",children:[e.jsx("textarea",{value:b.welcomeEmailBody,onChange:a=>v(r=>({...r,welcomeEmailBody:a.target.value})),className:"min-h-[430px] resize-y border-b border-blue-100 p-4 text-xs leading-relaxed text-gray-800 outline-none focus:bg-blue-50/30 lg:border-b-0 lg:border-r","aria-label":"Texto editable del correo de bienvenida"}),e.jsx("iframe",{title:"Vista previa del correo de bienvenida",srcDoc:Tt(b.welcomeEmailBody),className:"h-[430px] w-full bg-white"})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:Fa,disabled:de,className:"flex-1 rounded-2xl border border-gray-200 bg-white py-4 text-xs font-black uppercase tracking-widest text-gray-600 disabled:opacity-60",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:Ua,disabled:de,className:"flex-1 rounded-2xl bg-emerald-600 py-4 text-xs font-black uppercase tracking-widest text-white shadow-lg shadow-emerald-500/20 disabled:opacity-60",children:de?"Procesando...":s?"Validar incorporacion":"Confirmar incorporacion"})]})]})]})})]})};export{Jt as AdminCandidates};
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.