var T=(a,l,t)=>new Promise((n,s)=>{var d=e=>{try{u(t.next(e))}catch(m){s(m)}},r=e=>{try{u(t.throw(e))}catch(m){s(m)}},u=e=>e.done?n(e.value):Promise.resolve(e.value).then(d,r);u((t=t.apply(a,l)).next())});import{bh as B,b7 as P,b6 as i,b8 as v,bi as V}from"./bootstrap-Bqxdt4iG.js";import{T as $}from"./auth-title-Cr5EWHYB.js";import{a1 as k,P as C,E as x,ap as _,aj as S,p,az as y,ak as b,al as w,ax as h,ay as g,a9 as o,aR as F,L,ai as N}from"../jse/index-index-BUJ_4tQs.js";const R=k({name:"ForgetPassword",__name:"forget-password",props:{formSchema:{},loading:{type:Boolean,default:!1},loginPath:{default:"/auth/login"},title:{default:""},subTitle:{default:""},submitButtonText:{default:""}},emits:["submit"],setup(a,{expose:l,emit:t}){const n=a,s=t,[d,r]=B(C({commonConfig:{hideLabel:!0,hideRequiredMark:!0},schema:x(()=>n.formSchema),showDefaultActions:!1})),u=P();function e(){return T(this,null,function*(){const{valid:c}=yield r.validate(),f=yield r.getValues();c&&s("submit",f)})}function m(){u.push(n.loginPath)}return l({getFormApi:()=>r}),(c,f)=>(S(),_("div",null,[p($,null,{desc:b(()=>[w(c.$slots,"subTitle",{},()=>[h(g(a.subTitle||o(i)("authentication.forgetPasswordSubtitle")),1)])]),default:b(()=>[w(c.$slots,"title",{},()=>[h(g(a.title||o(i)("authentication.forgetPassword"))+" 🤦🏻‍♂️ ",1)])]),_:3}),p(o(d)),y("div",null,[p(o(v),{class:F([{"cursor-wait":a.loading},"mt-2 w-full"]),"aria-label":"submit",onClick:e},{default:b(()=>[w(c.$slots,"submitButtonText",{},()=>[h(g(a.submitButtonText||o(i)("authentication.sendResetLink")),1)])]),_:3},8,["class"]),p(o(v),{class:"mt-4 w-full",variant:"outline",onClick:f[0]||(f[0]=A=>m())},{default:b(()=>[h(g(o(i)("common.back")),1)]),_:1})])]))}}),q=k({name:"ForgetPassword",__name:"forget-password",setup(a){const l=L(!1),t=x(()=>[{component:"VbenInput",componentProps:{placeholder:"example@example.com"},fieldName:"email",label:i("authentication.email"),rules:V().min(1,{message:i("authentication.emailTip")}).email(i("authentication.emailValidErrorTip"))}]);function n(s){console.log("reset email:",s)}return(s,d)=>(S(),N(o(R),{"form-schema":t.value,loading:l.value,onSubmit:n},null,8,["form-schema","loading"]))}});export{q as default};
