import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{ct as t,ot as n}from"./vendor-primevue-DGevbYGF.js";import"./vendor-firebase-yTFzdAQf.js";import{A as r,F as i,I as a,O as o,R as s,Rt as c,Ut as l,_t as u,b as d,et as f,j as p,k as m,kt as h,o as g}from"./vendor-vue-core-BdhYaYlO.js";import"./vendor-other-D9HJWI2D.js";import"./useFeatureFlags-DLStzqlx.js";import"./api-C1WIrB4Z.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-DJbZtU1U.js";import{n as _}from"./vendor-i18n-JubCsGQ_.js";import"./i18n-DKtnmyh4.js";import"./vendor-reka-ui-CSo89nDv.js";import{t as v}from"./Button-DHxPjNdi.js";import{Jr as y}from"./dialogService-CwVeD8j9.js";import"./extensionStore-By6c6sCD.js";import{t as b}from"./_plugin-vue_export-helper-BwIhnXfq.js";import"./userStore-ChcnLOkA.js";import"./useErrorHandling-CWU_3R6Y.js";import"./useExternalLink-DZBh_BZs.js";import"./vendor-tiptap-BZHcjrm1.js";import"./markdownRendererUtil-J4WlXR5e.js";import"./Popover-_oREh-V5.js";var x={class:`flex h-full items-center justify-center p-8`},S={class:`max-w-[100vw] p-2 lg:w-96`},C={class:`mb-8 flex flex-col gap-4`},w={class:`my-0 text-xl leading-normal font-medium`},T={class:`my-0 text-base text-muted`},E={class:`flex flex-col gap-2`},D={class:`mb-2 text-base font-medium opacity-80`,for:`reset-email`},O={key:0,class:`text-red-500`},k={class:`flex flex-col gap-4`},A={class:`mt-5 text-sm text-gray-600`},j=b(s({__name:`CloudForgotPasswordView`,setup(e){let{t:s}=_(),b=g(),j=y(),M=h(``),N=h(!1),P=h(``),F=h(``),navigateToLogin=()=>{b.push({name:`cloud-login`})},handleSubmit=async()=>{if(!M.value){P.value=s(`cloudForgotPassword_emailRequired`);return}N.value=!0,P.value=``,F.value=``;try{await j.sendPasswordReset(M.value),F.value=s(`cloudForgotPassword_passwordResetSent`),setTimeout(()=>{navigateToLogin()},3e3)}catch(e){console.error(`Password reset error:`,e),P.value=s(`cloudForgotPassword_passwordResetError`)}finally{N.value=!1}};return(e,h)=>(f(),p(`div`,x,[o(`div`,S,[o(`div`,C,[o(`h1`,w,l(c(s)(`cloudForgotPassword_title`)),1),o(`p`,T,l(c(s)(`cloudForgotPassword_instructions`)),1)]),o(`form`,{class:`flex flex-col gap-6`,onSubmit:d(handleSubmit,[`prevent`])},[o(`div`,E,[o(`label`,D,l(c(s)(`cloudForgotPassword_emailLabel`)),1),a(c(n),{id:`reset-email`,modelValue:M.value,"onUpdate:modelValue":h[0]||=e=>M.value=e,type:`email`,placeholder:c(s)(`cloudForgotPassword_emailPlaceholder`),class:`h-10`,invalid:!!P.value&&!M.value,autocomplete:`email`,required:``},null,8,[`modelValue`,`placeholder`,`invalid`]),P.value?(f(),p(`small`,O,l(P.value),1)):r(``,!0)]),F.value?(f(),m(c(t),{key:0,severity:`success`},{default:u(()=>[i(l(F.value),1)]),_:1})):r(``,!0),o(`div`,k,[a(v,{type:`submit`,loading:N.value,disabled:!M.value||N.value,class:`h-10 font-medium text-white`},{default:u(()=>[i(l(c(s)(`cloudForgotPassword_sendResetLink`)),1)]),_:1},8,[`loading`,`disabled`]),a(v,{type:`button`,variant:`secondary`,class:`h-10 bg-[#2d2e32]`,onClick:navigateToLogin},{default:u(()=>[i(l(c(s)(`cloudForgotPassword_backToLogin`)),1)]),_:1})])],32),o(`p`,A,l(c(s)(`cloudForgotPassword_didntReceiveEmail`)),1)])]))}}),[[`__scopeId`,`data-v-127dc072`]]);export{j as default};
//# sourceMappingURL=CloudForgotPasswordView-C0WrKO3H.js.map