import{F as k,aw as x,L as E,aD as R,K as A,J as F,M as I,r as B,N as M,P as r,Q as w,R as m,X as n,T as V,e,Y as U,_ as P,W as q,a1 as i,a2 as _,a0 as o,ag as D}from"./vendor-3e8OGtgt.js";import{a3 as L,b_ as j,f as z}from"./index-D8gWJXbr.js";const H={class:"mt-8 md:mt-9"},J=k({__name:"forgot-password-form",emits:["succeeded"],setup(C,{emit:g}){const l=g,f=x(),{forgotPassword:s,loading:c}=L(),b=E(R({email:A().required().email().max(64)})),{errors:d,meta:u,handleSubmit:y}=F({validationSchema:b,initialValues:{email:""},validateOnMount:!1}),{value:p}=I("email"),h=B(!1),$=y(async t=>{const a=f.resolve({name:"ResetPassword"}).path;await s({email:`${t.email}`,resetPasswordUrlPath:a})?l("succeeded"):h.value=!0});return M(p,()=>{h.value=!1}),(t,a)=>{const S=r("VcInput"),N=r("VcAlert"),T=r("VcButton");return m(),w("form",{class:"text-start",onSubmit:a[1]||(a[1]=(...v)=>e($)&&e($)(...v))},[n(S,{modelValue:e(p),"onUpdate:modelValue":a[0]||(a[0]=v=>U(p)?p.value=v:null),modelModifiers:{trim:!0},class:"mb-4",label:t.$t("common.labels.email"),placeholder:t.$t("common.placeholders.email"),type:"email",name:"email",required:"",message:e(d).email,error:!!e(d).email,maxlength:64},null,8,["modelValue","label","placeholder","message","error"]),V("div",H,[h.value?(m(),P(N,{key:0,color:"danger",size:"sm",variant:"solid-light",class:"mb-4 text-xs",icon:""},{default:i(()=>[_(o(t.$t("shared.account.forgot_password_form.error_alert"))+" ",1),n(e(j))]),_:1})):q("",!0),n(T,{type:"submit",class:"mt-6 w-full lg:mt-3 lg:w-48",loading:e(c),disabled:!e(u).valid||e(u).pending},{default:i(()=>[_(o(t.$t("common.buttons.submit")),1)]),_:1},8,["loading","disabled"])])],32)}}}),K={key:0},O={class:"mb-4 text-base"},Q={key:1},W={class:"mb-5 text-base"},G=k({__name:"forgot-password",setup(C){const{t:g}=D();z({title:g("pages.forgot_password.meta.title")});const l=B(!1);function f(){l.value=!0}return(s,c)=>{const b=r("VcTypography"),d=r("VcButton"),u=r("VcEmptyPage");return m(),P(u,{icon:"outline-security",image:"sign-in.jpg","status-color":l.value?"success":"secondary"},{default:i(()=>[n(b,{tag:"h1",class:"order-first mb-3"},{default:i(()=>[_(o(s.$t("pages.forgot_password.header")),1)]),_:1}),l.value?(m(),w("div",Q,[V("div",W,o(s.$t("pages.forgot_password.reset_link_was_sent_message")),1),n(d,{to:"/","min-width":"12rem"},{default:i(()=>[_(o(s.$t("pages.forgot_password.home_button")),1)]),_:1})])):(m(),w("div",K,[V("div",O,o(s.$t("pages.forgot_password.email_will_be_sended_message")),1),n(e(J),{onSucceeded:c[0]||(c[0]=y=>f())})]))]),_:1},8,["status-color"])}}});export{G as default};
//# sourceMappingURL=forgot-password-D0ZaOZbS.js.map
