import{$ as e,C as t,G as n,S as r,Wt as i,dt as a,g as o,h as s,u as c,ut as l,vt as u,y as d,z as f}from"./vue.runtime.esm-bundler-DAWRyTnP.js";import{i as p}from"./vue-router-Bna4o8ws.js";import{n as m}from"./vue-i18n-C4HYJWrq.js";import{K as h,W as g,Z as _,jn as v}from"./main-Gn9UsJwa.js";import{t as y}from"./auth-D-MtTwP6.js";var b={key:0},x={key:1},S={class:`mt-4 mb-4 text-sm`},C={__name:`ForgotPassword`,setup(C){let w=y(),{t:T}=m(),E=p(),D=l({email:``,company:``}),O=a(!1),k=a(!1),A=v(s(()=>({email:{required:g.withMessage(T(`validation.required`),_),email:g.withMessage(T(`validation.email_incorrect`),h)}})),D);function j(e){if(A.value.$touch(),A.value.$invalid)return!0;k.value=!0;let t={...D,company:E.params.company};w.forgotPassword(t).then(e=>{k.value=!1}).catch(e=>{k.value=!1}),O.value=!0}return(a,s)=>{let l=n(`BaseInput`),p=n(`BaseInputGroup`),m=n(`BaseButton`),h=n(`router-link`);return f(),d(`form`,{id:`loginForm`,onSubmit:c(j,[`prevent`])},[t(p,{error:u(A).email.$error&&u(A).email.$errors[0].$message,label:a.$t(`login.enter_email`),class:`mb-4`,required:``},{default:e(()=>[t(l,{modelValue:D.email,"onUpdate:modelValue":s[0]||=e=>D.email=e,type:`email`,name:`email`,invalid:u(A).email.$error,onInput:s[1]||=e=>u(A).email.$touch()},null,8,[`modelValue`,`invalid`])]),_:1},8,[`error`,`label`]),t(m,{loading:k.value,disabled:k.value,type:`submit`,variant:`primary`},{default:e(()=>[O.value?(f(),d(`div`,x,i(a.$t(`validation.not_yet`)),1)):(f(),d(`div`,b,i(a.$t(`validation.send_reset_link`)),1))]),_:1},8,[`loading`,`disabled`]),o(`div`,S,[t(h,{to:`login`,class:`text-sm text-primary-400 hover:text-gray-700`},{default:e(()=>[r(i(a.$t(`general.back_to_login`)),1)]),_:1})])],32)}}};export{C as default};