1import{j as ie,q as re,i as v,A as de,c as a,a as t,y as J,e as ue,w as ce,r as pe,f as g,b as ve,F as _,E as y,d as c,k as K,l as N,v as L,p as Q,t as r,z as W,B as M,o as l,n as O,G as me}from"./app-BjrRHTkE.js";const fe={class:"space-y-4 sm:space-y-6"},xe={class:"flex items-center justify-between"},ge={class:"flex items-center gap-2 sm:gap-3"},_e={key:0,class:"flex justify-center py-12"},he={key:1,class:"card-schoolface p-8 text-center"},be={key:2,class:"space-y-4"},ye={class:"p-4 border-b"},ke={class:"flex items-start justify-between"},we={class:"flex-1 min-w-0"},Ce={class:"flex items-center gap-2 flex-wrap"},Ve={class:"font-semibold text-gray-900"},$e={key:0,class:"px-2 py-0.5 text-xs bg-green-100 text-green-700 rounded-full"},Me={key:1,class:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded-full"},je={key:2,class:"px-2 py-0.5 text-xs bg-indigo-100 text-indigo-700 rounded-full"},Ee={key:3,class:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded-full"},Se={key:0,class:"text-sm text-gray-500 mt-1"},Be={class:"text-xs text-gray-400 mt-1"},ze={key:0},Ne={key:0,class:"flex items-center gap-1 ml-2"},Oe=["onClick"],De=["onClick"],Ue={class:"p-4 space-y-2"},Ae={key:0,class:"pb-2 border-b"},He={class:"flex flex-wrap gap-1"},Le=["onClick"],Te={class:"relative"},Pe=["onClick"],Fe={class:"flex items-center gap-2 min-w-0"},qe={key:0,class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},Re={class:"text-sm font-medium text-gray-900 truncate"},Ge={class:"flex items-center gap-2 flex-shrink-0 ml-2"},Je={class:"text-sm font-semibold text-gray-700"},Ke={class:"text-xs text-gray-400"},Qe={class:"absolute inset-0 rounded-lg overflow-hidden pointer-events-none"},We={key:1,class:"pt-2 space-y-2"},Xe={key:0},Ye={class:"flex flex-wrap gap-1"},Ze=["onClick"],Ie={class:"flex gap-2"},et=["onClick","disabled"],tt=["onClick"],ot={class:"flex items-center justify-between pt-2 text-xs text-gray-400"},st={key:0},lt={key:2,class:"pt-2 border-t"},nt={key:0,class:"flex flex-wrap gap-1"},at=["onClick"],it={class:"flex flex-wrap gap-1"},rt=["onClick"],dt={key:3,class:"pt-2 border-t"},ut={class:"text-gray-600"},ct={class:"text-gray-400"},pt={class:"font-medium text-gray-700"},vt=["onClick"],mt={class:"flex items-center justify-center min-h-screen px-4"},ft={class:"relative bg-white rounded-xl shadow-xl max-w-lg w-full p-6 z-10 max-h-[90vh] overflow-y-auto"},xt={class:"space-y-4"},gt={class:"space-y-2"},_t=["onUpdate:modelValue","placeholder"],ht=["onClick"],bt={class:"flex items-center gap-2 cursor-pointer"},yt={class:"flex items-center gap-2 cursor-pointer"},kt={class:"flex justify-end gap-3 mt-6 pt-4 border-t"},wt=["disabled"],Ct={class:"flex items-end sm:items-center justify-center min-h-screen px-4"},Vt={class:"relative bg-white rounded-t-2xl sm:rounded-xl shadow-xl max-w-sm w-full p-6 z-10"},$t={class:"text-sm text-gray-500 mb-4"},Mt={class:"text-sm font-medium text-gray-700 mb-3"},jt={class:"text-purple-600"},Et={key:0,class:"mb-4"},St={class:"flex flex-wrap gap-1"},Bt=["onClick"],zt={key:1,class:"text-sm font-medium text-gray-700 mb-4"},Nt={class:"text-purple-600"},Ot={class:"flex justify-end gap-3 pt-4 border-t"},Dt=["disabled"],Ht={__name:"CourseSurveys",setup(Ut){const X=re(),h=ie(()=>X.params.id),T=v([]),P=v(!0),j=v(!1),U=v(!1),A=v({}),E=v(!1),k=v(null),D=v(null),w=v(null),C=v(!1),f=v([]),b=v({}),V=v({}),d=v({title:"",description:"",options:["",""],allow_multiple:!1,is_anonymous:!1,closes_at:""});async function S(){P.value=!0;try{const s=await M.get(`/courses/${h.value}/surveys`);s.data.success&&(T.value=s.data.data.surveys)}catch{}finally{P.value=!1}}async function Y(){try{const s=await M.get(`/courses/${h.value}/my-children`);s.data.success&&(f.value=s.data.data.children||s.data.data||[])}catch{}}async function Z(){var e,i;const s=d.value.options.filter(u=>u.trim());if(!d.value.title.trim()||s.length<2){alert("Ingresa un titulo y al menos 2 opciones.");return}U.value=!0;try{(await M.post(`/courses/${h.value}/surveys`,{title:d.value.title.trim(),description:d.value.description.trim()||null,options:s,allow_multiple:d.value.allow_multiple,is_anonymous:d.value.is_anonymous,closes_at:d.value.closes_at||null})).data.success&&(j.value=!1,d.value={title:"",description:"",options:["",""],allow_multiple:!1,is_anonymous:!1,closes_at:""},await S())}catch(u){alert(((i=(e=u.response)==null?void 0:e.data)==null?void 0:i.message)||"Error al crear encuesta")}finally{U.value=!1}}function I(s,e){if(!s.is_open)return;if(s.allow_multiple){if(!B(s.id)){const x=f.value;if(x.length===0)return;if(x.length===1)F(s,x[0]);else{const o=[];b.value[s.id]=[...o]}}const u=b.value[s.id]||[],$=u.indexOf(e);$>=0?u.splice($,1):u.push(e),b.value[s.id]=[...u];return}const i=z(s);i.length!==0&&(k.value=s,D.value=e,w.value=i.length===1?i[0]:null,E.value=!0)}function ee(s,e){s.is_open&&(k.value=s,w.value=e,D.value=null,E.value=!1)}function B(s){return b.value[s]!==void 0}function F(s,e){const i=s.my_votes.filter(u=>u.student_id===e.id).map(u=>u.selected_option);b.value[s.id]=[...i],V.value[s.id]=e}function q(s){delete b.value[s],delete V.value[s]}async function te(s){var u,$;let e=V.value[s.id];!e&&f.value.length===1&&(e=f.value[0]);const i=b.value[s.id]||[];
1if(!(!e||i.length===0)){C.value=!0;try{const x=s.my_votes.filter(n=>n.student_id===e.id).map(n=>n.selected_option),o=i.filter(n=>!x.includes(n)),m=x.filter(n=>!i.includes(n));for(const n of o)await M.post(`/courses/${h.value}/surveys/${s.id}/vote`,{student_id:e.id,selected_option:n});for(const n of m)await M.post(`/courses/${h.value}/surveys/${s.id}/vote`,{student_id:e.id,selected_option:n});q(s.id),await S()}catch(x){alert((($=(u=x.response)==null?void 0:u.data)==null?void 0:$.message)||"Error al votar")}finally{C.value=!1}}}async function oe(){var s,e;if(!(!k.value||D.value===null||!w.value)){C.value=!0;try{(await M.post(`/courses/${h.value}/surveys/${k.value.id}/vote`,{student_id:w.value.id,selected_option:D.value})).data.success&&(E.value=!1,await S())}catch(i){alert(((e=(s=i.response)==null?void 0:s.data)==null?void 0:e.message)||"Error al votar")}finally{C.value=!1}}}async function se(s){var e,i;if(confirm("Cerrar esta encuesta? No se podran registrar mas votos."))try{await M.post(`/courses/${h.value}/surveys/${s.id}/close`),await S()}catch(u){alert(((i=(e=u.response)==null?void 0:e.data)==null?void 0:i.message)||"Error al cerrar encuesta")}}async function le(s){var e,i;if(confirm("Eliminar esta encuesta y todos sus votos?"))try{await M.delete(`/courses/${h.value}/surveys/${s.id}`),await S()}catch(u){alert(((i=(e=u.response)==null?void 0:e.data)==null?void 0:i.message)||"Error al eliminar encuesta")}}function z(s){if(!s.is_open)return[];if(s.allow_multiple)return f.value;const e=s.my_votes.map(i=>i.student_id);return f.value.filter(i=>!e.includes(i.id))}function ne(s,e){return s.my_votes.some(i=>i.selected_option===e)}function H(s,e){return s.allow_multiple&&B(s.id)?(b.value[s.id]||[]).includes(e):ne(s,e)}function ae(s,e){return H(s,e)?"border-purple-300 bg-purple-50 cursor-pointer":s.allow_multiple&&B(s.id)||!s.allow_multiple&&s.is_open&&z(s).length>0?"border-gray-200 hover:border-purple-300 hover:bg-purple-50 cursor-pointer":"border-gray-100 cursor-default"}function R(s){return s?new Date(s).toLocaleDateString("es-CL",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):""}return de(async()=>{await Promise.all([S(),Y()])}),(s,e)=>{var u,$,x;const i=pe("router-link");return l(),a("div",fe,[t("div",xe,[t("div",ge,[ue(i,{to:{name:"course-dashboard",params:{id:h.value}},class:"text-gray-500 hover:text-gray-700 p-1 -ml-1"},{default:ce(()=>[...e[14]||(e[14]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1},8,["to"]),e[15]||(e[15]=t("h1",{class:"text-lg sm:text-2xl font-bold text-gray-900"},"Encuestas",-1))]),t("button",{onClick:e[0]||(e[0]=o=>j.value=!0),class:"btn-schoolface text-sm flex items-center gap-1.5"},[...e[16]||(e[16]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),g(" Nueva ",-1)])])]),P.value?(l(),a("div",_e,[...e[17]||(e[17]=[t("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"},null,-1)])])):T.value.length===0?(l(),a("div",he,[e[18]||(e[18]=ve('<div class="w-16 h-16 mx-auto rounded-full bg-purple-100 flex items-center justify-center mb-4"><svg class="w-8 h-8 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path></svg></div><h3 class="text-base font-semibold text-gray-900 mb-2">No hay encuestas</h3><p class="text-sm text-gray-500 mb-4">Crea la primera encuesta para el curso</p>',3)),t("button",{onClick:e[1]||(e[1]=o=>j.value=!0),class:"btn-schoolface text-sm"},"Crear Encuesta")])):(l(),a("div",be,[(l(!0),a(_,null,y(T.value,o=>{var m;return l(),a("div",{key:o.id,class:"card-schoolface overflow-hidden"},[t("div",ye,[t("div",ke,[t("div",we,[t("div",Ce,[t("h3",Ve,r(o.title),1),o.is_o
1pen?(l(),a("span",$e,"Abierta")):(l(),a("span",Me,"Cerrada")),o.allow_multiple?(l(),a("span",je,"Multiple")):c("",!0),o.is_anonymous?(l(),a("span",Ee,"Anonima")):c("",!0)]),o.description?(l(),a("p",Se,r(o.description),1)):c("",!0),t("p",Be,[g(" Creada por "+r(o.created_by)+" · "+r(R(o.created_at))+" ",1),o.closes_at?(l(),a("span",ze," · Cierra: "+r(R(o.closes_at)),1)):c("",!0)])]),o.is_owner?(l(),a("div",Ne,[o.is_open?(l(),a("button",{key:0,onClick:n=>se(o),class:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg",title:"Cerrar encuesta"},[...e[19]||(e[19]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})],-1)])],8,Oe)):c("",!0),t("button",{onClick:n=>le(o),class:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg",title:"Eliminar"},[...e[20]||(e[20]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,De)])):c("",!0)])]),t("div",Ue,[o.allow_multiple&&o.is_open&&f.value.length>1&&B(o.id)?(l(),a("div",Ae,[e[21]||(e[21]=t("p",{class:"text-xs text-gray-500 mb-1"},"Votando por:",-1)),t("div",He,[(l(!0),a(_,null,y(f.value,n=>{var p;return l(),a("button",{key:n.id,onClick:G=>V.value[o.id]=n,class:O(["px-2 py-1 rounded text-xs font-medium transition-colors",((p=V.value[o.id])==null?void 0:p.id)===n.id?"bg-purple-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"])},r(n.name),11,Le)}),128))])])):c("",!0),(l(!0),a(_,null,y(o.results,(n,p)=>(l(),a("div",{key:p},[t("div",Te,[t("div",{class:O(["relative z-10 flex items-center justify-between p-3 rounded-lg border transition-all",ae(o,p)]),onClick:G=>I(o,p)},[t("div",Fe,[t("div",{class:O(["w-5 h-5 border-2 flex items-center justify-center flex-shrink-0",[o.allow_multiple?"rounded":"rounded-full",H(o,p)?"border-purple-600 bg-purple-600":"border-gray-300"]])},[H(o,p)?(l(),a("svg",qe,[...e[22]||(e[22]=[t("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):c("",!0)],2),t("span",Re,r(n.option),1)]),t("div",Ge,[t("span",Je,r(n.votes),1),t("span",Ke,"("+r(n.percentage)+"%)",1)])],10,Pe),t("div",Qe,[t("div",{class:O(["h-full transition-all duration-500 rounded-lg",H(o,p)?"bg-purple-100":"bg-gray-50"]),style:me({width:n.percentage+"%"})},null,6)])])]))),128)),o.allow_multiple&&B(o.id)?(l(),a("div",We,[f.value.length>1?(l(),a("div",Xe,[e[23]||(e[23]=t("p",{class:"text-xs text-gray-500 mb-1"},"Votar por:",-1)),t("div",Ye,[(l(!0),a(_,null,y(f.value,n=>{var p;return l(),a("button",{key:n.id,onClick:G=>V.value[o.id]=n,class:O(["px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",((p=V.value[o.id])==null?void 0:p.id)===n.id?"bg-purple-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"])},r(n.name),11,Ze)}),128))])])):c("",!0),t("div",Ie,[t("button",{onClick:n=>te(o),disabled:((m=b.value[o.id])==null?void 0:m.length)===0||f.value.length>1&&!V.value[o.id]||C.value,class:"btn-schoolface flex-1 text-sm py-2 disabled:opacity-50"},r(C.value?"Votando...":"Confirmar voto"),9,et),t("button",{onClick:n=>q(o.id),class:"px-4 py-2 text-gray-600 hover:text-gray-800 text-sm"}," Cancelar ",8,tt)])])):c("",!0),t("div",ot,[t("span",null,r(o.votes_count)+" de "+r(o.eligible_voters)+" votos",1),o.eligible_voters>0?(l(),a("span",st,r(Math.round(o.votes_count/o.eligible_voters*100))+"% participacion",1)):c("",!0)]),o.is_open&&!B(o.id)&&z(o).length>0?(l(),a("div",lt,[o.allow_multiple?(l(),a("div",nt,[(l(!0),a(_,null,y(f.value,n=>(l(),a("button",{key:n.id,onClick:p=>F(o,n),class:"px-3 py-1.5 bg-purple-50 text-purple-700 rounded-lg text-xs font-medium hover:bg-purple-100 transition-colors flex items-center gap-1"},[e[24]||(e[24]=t("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})],-1)),g(" Votar por "+r(n.name),1)],8,at))),128))])):(l(),a(_,{key:1},[e[25]||(e[25]=t("p",{class:"text-xs text-purple-600 font-medium mb-1"},"Puedes votar por:",-1)),t("div",it,[(l(!0),a(_,null,y(z(o),n=>(l(),a("span",{key:n.id,class:"px-2 py-0.5 bg-purple-50 text-purple-700 rounded text-xs cursor-pointer hover:bg-purple-100",onClick:p=>ee(o,n)},r(n.name),9,rt))),128))])],64))])):c("",!0),!o.is_anonymous&&o.voters&&o.voters.length>0&&A.value[o.id]?(l(),a("div",dt,[(l(!0),a(_,null,y(o.voters,(n,p)=>(l(),a("div",{key:p,class:"flex items-center justify-between py-1 text-xs"},[t("span",ut,[g(r(n.student_name)+" ",1),t("span",ct,"("+r(n.user_name)+")",1)]),t("span",pt,r(o.options[n.selected_option]),1)]))),128))])):c("",!0),!o.is_anonymous&&o.voters&&o.voters.length>0?(l(),a("button",{key:4,onClick:n=>A.value[o.id]=!A.value[o.id],class:"text-xs text-purple-600 hover:text-purple-800 mt-1"},r(A.value[o.id]?"Ocultar detalle":"Ver detalle de votos"),9,vt)):c("",!0)])])}),128))])),(l(),J(W,{to:"body"},[j.value?(l(),a("div",{key:0,class:"fixed inset-0 z-50 overflow-y-auto",onClick:e[10]||(e[10]=K(o=>j.value=!1,["self"]))},[t("div",mt,[t("div",{class:"fixed inset-0 bg-black bg-opacity-50",onClick:e[2]||(e[2]=o=>j.value=!1)}),t("div",ft,[e[34]||(e[34]=t("h2",{class:"text-xl font-semibold text-gray-900 mb-4"},"Nueva Encuesta",-1)),t("div",xt,[t("div",null,[e[26]||(e[26]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Pregunta / Titulo *",-1)),N(t("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>d.value.title=o),type:"text",class:"input-schoolface w-full",placeholder:"Ej: Donde prefieren hacer el paseo?"},null,512),[[L,d.value.title]])]),t("div",null,[e[27]||(e[27]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},[g("Descripcion "),t("span",{class:"text-gray-400 font-normal"},"(opcional)")],-1)),N(t("textarea",{"onUpdate:modelValue":e[4]||(e[4]=o=>d.value.description=o),rows:"2",class:"input-schoolface w-full",placeholder:"Contexto o detalles adicionales..."},null,512),[[L,d.value.description]])]),t("div",null,[e[30]||(e[30]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Opciones *",-1)),t("div",gt,[(l(!0),a(_,null,y(d.value.options,
1(o,m)=>(l(),a("div",{key:m,class:"flex items-center gap-2"},[N(t("input",{"onUpdate:modelValue":n=>d.value.options[m]=n,type:"text",class:"input-schoolface flex-1",placeholder:"Opcion "+(m+1)},null,8,_t),[[L,d.value.options[m]]]),d.value.options.length>2?(l(),a("button",{key:0,type:"button",onClick:n=>d.value.options.splice(m,1),class:"p-1.5 text-gray-400 hover:text-red-500"},[...e[28]||(e[28]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,ht)):c("",!0)]))),128))]),d.value.options.length<10?(l(),a("button",{key:0,type:"button",onClick:e[5]||(e[5]=o=>d.value.options.push("")),class:"mt-2 text-sm text-purple-600 hover:text-purple-800 flex items-center gap-1"},[...e[29]||(e[29]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),g(" Agregar opcion ",-1)])])):c("",!0)]),t("div",null,[e[31]||(e[31]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},[g("Fecha de cierre "),t("span",{class:"text-gray-400 font-normal"},"(opcional)")],-1)),N(t("input",{"onUpdate:modelValue":e[6]||(e[6]=o=>d.value.closes_at=o),type:"datetime-local",class:"input-schoolface w-full"},null,512),[[L,d.value.closes_at]])]),t("label",bt,[N(t("input",{"onUpdate:modelValue":e[7]||(e[7]=o=>d.value.allow_multiple=o),type:"checkbox",class:"h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded"},null,512),[[Q,d.value.allow_multiple]]),e[32]||(e[32]=t("span",{class:"text-sm text-gray-700"},[g("Permitir seleccion multiple "),t("span",{class:"text-gray-400"},"(el padre puede votar por mas de una opcion)")],-1))]),t("label",yt,[N(t("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>d.value.is_anonymous=o),type:"checkbox",class:"h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded"},null,512),[[Q,d.value.is_anonymous]]),e[33]||(e[33]=t("span",{class:"text-sm text-gray-700"},[g("Encuesta anonima "),t("span",{class:"text-gray-400"},"(no se mostrara quien voto)")],-1))])]),t("div",kt,[t("button",{onClick:e[9]||(e[9]=o=>j.value=!1),class:"px-4 py-2 text-gray-600 hover:text-gray-800"},"Cancelar"),t("button",{onClick:Z,disabled:U.value,class:"btn-schoolface"},r(U.value?"Creando...":"Crear Encuesta"),9,wt)])])])])):c("",!0)])),(l(),J(W,{to:"body"},[E.value?(l(),a("div",{key:0,class:"fixed inset-0 z-50 overflow-y-auto",onClick:e[13]||(e[13]=K(o=>E.value=!1,["self"]))},[t("div",Ct,[t("div",{class:"fixed inset-0 bg-black bg-opacity-50",onClick:e[11]||(e[11]=o=>E.value=!1)}),t("div",Vt,[e[38]||(e[38]=t("h3",{class:"text-lg font-semibold text-gray-900 mb-2"},"Confirmar voto",-1)),t("p",$t,r((u=k.value)==null?void 0:u.title),
11),t("p",Mt,[e[35]||(e[35]=g("Opcion: ",-1)),t("span",jt,r(($=k.value)==null?void 0:$.options[D.value]),1)]),z(k.value).length>1?(l(),a("div",Et,[e[36]||(e[36]=t("p",{class:"text-sm font-medium text-gray-700 mb-2"},"Votar por:",-1)),t("div",St,[(l(!0),a(_,null,y(z(k.value),o=>{var m;return l(),a("button",{key:o.id,onClick:n=>w.value=o,class:O(["px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",((m=w.value)==null?void 0:m.id)===o.id?"bg-purple-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"])},r(o.name),11,Bt)}),128))])])):(l(),a("p",zt,[e[37]||(e[37]=g("Estudiante: ",-1)),t("span",Nt,r((x=w.value)==null?void 0:x.name),1)])),t("div",Ot,[t("button",{onClick:e[12]||(e[12]=o=>E.value=!1),class:"px-4 py-2 text-gray-600"},"Cancelar"),t("button",{onClick:oe,disabled:C.value||!w.value,class:"btn-schoolface disabled:opacity-50"},r(C.value?"Votando...":"Confirmar Voto"),9,Dt)])])])])):c("",!0)]))])}}};export{Ht 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.