import{g as _,e as V,b as k}from"./primevue-CfIk0_DY.js";import{a1 as I,h as R,b as m,c as g,d as s,v as l,I as d,t as A,p as L,l as f,f as x,E as S,a as b}from"./vue-core-Di3IuVqe.js";import{_ as C,a as E,b as N,s as v}from"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const q={class:"login-page"},B={class:"login-container"},K={class:"login-card"},M={class:"p-8 space-y-6"},P={class:"space-y-2"},T={class:"login-input-wrapper"},O={class:"space-y-2"},U={class:"login-input-wrapper"},$={class:"space-y-2"},G={key:0,class:"rounded-lg bg-red-50 p-3 text-center text-sm text-red-600"},j={class:"text-center"},z={class:"text-center pt-2 border-t mt-4"},D={__name:"PortailSalarieLogin",setup(F){const p=I(),t=S({uid:"",email:"",password:""}),r=b(!1),a=b(""),n=async()=>{if(a.value="",!t.uid||!t.email||!t.password){a.value="Tous les champs sont obligatoires.";return}r.value=!0;try{const o=await N.post(`${v.lienApi}/portail-salarie/login`,{uid:t.uid.trim(),email:t.email,password:t.password});v.commit("PORTAIL_SALARIE_LOGIN",{token:o.data.token,employe:o.data.employe,societe:o.data.societe,db:o.data.db,nomSociete:o.data.nomSociete,changementRequis:o.data.changementRequis,sessionId:o.data.sessionId}),o.data.changementRequis?p.push("/portail-salarie/changer-mot-de-passe"):p.push("/portail-salarie/accueil")}catch(o){a.value=o.response?.data?.message||"Erreur de connexion."}finally{r.value=!1}};return(o,e)=>{const u=_,y=V,w=k,c=R("RouterLink");return m(),g("section",q,[e[13]||(e[13]=s("div",{class:"login-bg-circle login-bg-circle-1"},null,-1)),e[14]||(e[14]=s("div",{class:"login-bg-circle login-bg-circle-2"},null,-1)),e[15]||(e[15]=s("div",{class:"login-bg-circle login-bg-circle-3"},null,-1)),s("div",B,[e[12]||(e[12]=s("div",{class:"flex justify-center mb-6"},[s("img",{src:E,alt:"OMAG",class:"h-16 logo-omag"})],-1)),s("div",K,[s("div",M,[e[11]||(e[11]=s("div",{class:"text-center"},[s("h1",{class:"text-2xl font-bold text-gray-900"},"Espace salarié"),s("p",{class:"text-gray-500 mt-1"},"Accédez à vos bulletins, congés et documents")],-1)),s("div",P,[e[4]||(e[4]=s("label",{class:"block text-sm font-medium text-gray-700"},"Identifiant entreprise",-1)),s("div",T,[e[3]||(e[3]=s("i",{class:"pi pi-building login-input-icon"},null,-1)),l(u,{modelValue:t.uid,"onUpdate:modelValue":e[0]||(e[0]=i=>t.uid=i),class:"w-full login-input",placeholder:"Identifiant reçu par votre employeur",onKeydown:d(n,["enter"])},null,8,["modelValue"])]),e[5]||(e[5]=s("p",{class:"text-xs text-gray-400"},"Code unique fourni par votre entreprise",-1))]),s("div",O,[e[7]||(e[7]=s("label",{class:"block text-sm font-medium text-gray-700"},"Email",-1)),s("div",U,[e[6]||(e[6]=s("i",{class:"pi pi-envelope login-input-icon"},null,-1)),l(u,{modelValue:t.email,"onUpdate:modelValue":e[1]||(e[1]=i=>t.email=i),type:"email",class:"w-full login-input",placeholder:"Votre adresse email",onKeydown:d(n,["enter"])},null,8,["modelValue"])])]),s("div",$,[e[8]||(e[8]=s("label",{class:"block text-sm font-medium text-gray-700"},"Mot de passe",-1)),l(y,{modelValue:t.password,"onUpdate:modelValue":e[2]||(e[2]=i=>t.password=i),feedback:!1,toggleMask:"",class:"w-full",inputClass:"w-full login-input",placeholder:"Votre mot de passe",onKeydown:d(n,["enter"])},null,8,["modelValue"])]),l(w,{label:"Se connecter",class:"w-full login-btn",icon:"pi pi-sign-in",onClick:n,loading:r.value},null,8,["loading"]),a.value?(m(),g("p",G,A(a.value),1)):L("",!0),s("div",j,[l(c,{to:"/portail-salarie/mot-de-passe-oublie",class:"text-blue-600 hover:text-blue-800 text-sm font-medium transition-colors"},{default:f(()=>[...e[9]||(e[9]=[x(" Mot de passe oublié ? ",-1)])]),_:1})]),s("div",z,[l(c,{to:"/login",class:"text-gray-500 hover:text-blue-700 text-sm transition-colors"},{default:f(()=>[...e[10]||(e[10]=[x(" Accès gestion (administrateur) ",-1)])]),_:1})])])])])])}}},Z=C(D,[["__scopeId","data-v-c3fba257"]]);export{Z as default};
