import{r,O as z,o as B,a as A,b as i,c as u,d as s,q as f,h as _,f as w,w as N,H as R,z as p,C as g,v as b,F as x,s as y,P as q,Q as D,R as E,S as F,t as C,L as T,U as H}from"./main.84523976.js";/* empty css                */import{u as I}from"./use-meta.97669149.js";import{u as O}from"./StateStore.37eb0607.js";/* empty css                     */const Q={class:"layout-px-spacing"},j={class:"row layout-top-spacing"},G={class:"col-xl-6 col-lg-6 col-sm-6 mx-auto layout-spacing"},J={class:"panel p-3"},K={class:"row"},W={class:"col-xl-12 col-lg-12 col-sm-12"},X={class:"text-center titulo-dorado"},Y=["src"],Z={class:"col-xl-12 col-lg-12 col-sm-12"},$={class:"signup-link register"},ss={class:"row"},os={class:"col-md-6 col-sm-12 col-6"},as={class:"form-group"},ts={class:"invalid-feedback"},es={class:"col-md-6 col-sm-12 col-6"},ls={class:"form-group"},ns={class:"invalid-feedback"},rs={class:"col-md-12 mt-4"},is={class:"form-group"},fs={__name:"changepw",setup(us){const h=require("@/assets/images/app-logo.svg");I({title:"Cambiar contrase\xF1a"});const c=r(-1),k=r(null),n=r({}),e=r({uuid:null,password:null,password_confirmation:null}),d=r(!1),l=r(!0),S=O(),L=z(),v=()=>{P(),S.current_state.layout="auth",H.replace({name:"login-route"})},M=async()=>{try{l.value=!0,d.value=!0;const a=await D(e.value);V("Listo cambiaste tu contrase\xF1a"),v(),l.value=!1}catch(a){E.isAxiosError(a)&&(n.value=a.response.data.errors),l.value=!1}},P=async()=>{e.value={uuid:null,password:null,password_confirmation:null},n.value={},c.value=-1,l.value=!1,d.value=!1},U=async()=>{try{return await F({uuid:L.params.uuid})}catch(a){console.log(a),v()}},V=(a="",o="success")=>{window.Swal.mixin({toast:!0,position:"top",showConfirmButton:!1,timer:3e3}).fire({icon:o,title:a,padding:"10px 20px"})};return B(async()=>{const a=await U();c.value=a.id,e.value.uuid=a.uuid,l.value=!1}),(a,o)=>{const m=A("router-link");return i(),u("div",Q,[s("div",j,[s("div",G,[s("div",J,[s("div",K,[s("div",W,[s("div",X,[s("img",{src:f(h),class:"navbar-logo",alt:"logo"},null,8,Y),o[4]||(o[4]=s("h1",null,"Crea tu nueva contrase\xF1a",-1))])]),s("div",Z,[s("p",$,[o[6]||(o[6]=_("Regresar al ",-1)),w(m,{to:"/auth/login-boxed",class:"forgot-pass-link"},{default:N(()=>[...o[5]||(o[5]=[_("Acceso",-1)])]),_:1})]),s("form",{class:"mt-0",ref_key:"formComponent",ref:k,onSubmit:o[2]||(o[2]=R(()=>{},["stop","prevent"])),autocomplete:"off"},[s("div",ss,[s("div",os,[s("div",as,[o[7]||(o[7]=s("label",null,"Password",-1)),p(s("input",{"onUpdate:modelValue":o[0]||(o[0]=t=>e.value.password=t),type:"password",class:b(["form-control",[d.value?n.value.password?"is-invalid":"is-valid":""]]),placeholder:"Contrase\xF1a",autocomplete:"off"},null,2),[[g,e.value.password]]),o[8]||(o[8]=s("div",{class:"valid-feedback"},null,-1)),s("div",ts,[(i(!0),u(x,null,y(n.value.password,t=>(i(),u("li",null,C(t),1))),256))])])]),s("div",es,[s("div",ls,[o[9]||(o[9]=s("label",null,"Confirmar password",-1)),p(s("input",{"onUpdate:modelValue":o[1]||(o[1]=t=>e.value.password_confirmation=t),type:"password",class:b(["form-control",[d.value?n.value.password_confirmation?"is-invalid":"is-valid":""]]),placeholder:"Contrase\xF1a"},null,2),[[g,e.value.password_confirmation]]),o[10]||(o[10]=s("div",{class:"valid-feedback"},null,-1)),s("div",ns,[(i(!0),u(x,null,y(n.value.password_confirmation,t=>(i(),u("li",null,C(t),1))),256))])])]),s("div",rs,[s("div",is,[p(s("button",{type:"button",class:"btn btn-black w-100",onClick:M}," Actualizar Contrase\xF1a ",512),[[q,c.value!==-1]])])])])],544)])])])])]),w(f(T),{active:l.value,"onUpdate:active":o[3]||(o[3]=t=>l.value=t),"can-cancel":!1,"is-full-page":!0},null,8,["active"])])}}};export{fs as default};
