3 lines
4.9 KiB
JavaScript
3 lines
4.9 KiB
JavaScript
import"../chunks/DsnmJJEf.js";import{p as be,t as _,a as d,b as xe,k as ge,c as u,d as a,$ as Te,r as s,s as o,g as m,i as D,l as V,e as Ne,f as C,j as c}from"../chunks/krC2xWPP.js";import{d as Oe,a as Ee,s as v,e as Ae}from"../chunks/CddAxf8c.js";import{i as T}from"../chunks/DjsWWzyL.js";import{h as De,s as he}from"../chunks/j_DJpx8B.js";import{s as H,r as Ie,B as Re,t as h}from"../chunks/Lvd_r9sp.js";import{b as Me}from"../chunks/ciapVzar.js";import{i}from"../chunks/Cu5ilWky.js";import{b as Se}from"../chunks/BSopV7IU.js";import{f as ye}from"../chunks/CNrnzl73.js";import{D as Ge}from"../chunks/nlum2O0L.js";import{B as Fe,t as W}from"../chunks/BzsopytP.js";import{S as Xe,M as we}from"../chunks/BrVNO555.js";import{M as q}from"../chunks/BwyXqaO5.js";import{L as Le}from"../chunks/C_E2vM9U.js";var ke=u('<p class="text-xs text-red-500"> </p>'),Be=u("<!> ",1),Ce=u("<!> ",1),ze=u('<form class="space-y-4 px-6 py-5" novalidate=""><div class="space-y-1.5"><label for="email" class="text-[0.8125rem] font-medium text-foreground"> </label> <div class="flex rounded-md shadow-sm"><span class="inline-flex items-center rounded-l-md border border-r-0 border-input bg-muted px-3 text-muted-foreground"><!></span> <input id="email" type="email" autocomplete="email"/></div> <!></div> <!></form>'),$e=u('<div class="px-6 py-5 text-center text-[0.8125rem] text-muted-foreground"> </div>'),je=u('<div class="flex min-h-screen items-center justify-center bg-background p-4"><button type="button" class="absolute top-4 right-4 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button> <div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center text-center"><div class="mb-4"><!></div> <h1 class="text-2xl font-semibold tracking-tight text-foreground"> </h1> <p class="mt-1 text-[0.8125rem] text-muted-foreground"><!></p></div> <div class="rounded-lg border border-border bg-card shadow-sm"><!> <div class="border-t border-border px-6 py-3"><a class="flex items-center justify-center gap-1.5 text-[0.75rem] font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </a></div></div></div></div>');function st(J,Q){be(Q,!0);let I=D(""),p=D(!1),R=D(!1),N=D(!1);async function Y(e){e.preventDefault(),c(N,!1);const t=m(I).trim();if(!t||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){c(N,!0);return}c(p,!0);try{const r=await ye(t);c(R,!0),h.success(r.message??"Reset email sent")}catch(r){if(r&&typeof r=="object"&&"status"in r){const n=r;n.status===429?h.error(n.message||"Too many reset requests. Try again later."):h.error(n.message||"Unable to send reset email")}else h.error(i.t("ADMIN_NEXT.FORGOT.UNABLE_TO_CONNECT_TO_SERVER"))}finally{c(p,!1)}}var M=je();De("71rv0w",e=>{ge(t=>{Te.title=t??""},[()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD_GRAV_ADMIN")])});var b=a(M),Z=a(b);{var ee=e=>{Xe(e,{size:16})},te=e=>{we(e,{size:16})};T(Z,e=>{W.isDark?e(ee):e(te,-1)})}s(b);var z=o(b,2),S=a(z),y=a(S),re=a(y);Fe(re,{size:"login"}),s(y);var G=o(y,2),ae=a(G,!0);s(G);var $=o(G,2),se=a($);{var oe=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.CHECK_INBOX")]),d(e,t)},ie=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.SUBTITLE")]),d(e,t)};T(se,e=>{m(R)?e(oe):e(ie,-1)})}s($),s(S);var j=o(S,2),K=a(j);{var ne=e=>{var t=ze(),r=a(t),n=a(r),me=a(n,!0);s(n);var X=o(n,2),w=a(X),ve=a(w);q(ve,{size:13}),s(w);var O=o(w,2);Ie(O),s(X);var _e=o(X,2);{var fe=l=>{var E=ke(),A=a(E,!0);s(E),_(L=>v(A,L),[()=>i.t("ADMIN_NEXT.FORGOT.ENTER_A_VALID_EMAIL_ADDRESS")]),d(l,E)};T(_e,l=>{m(N)&&l(fe)})}s(r);var ce=o(r,2);Re(ce,{type:"submit",class:"w-full",get disabled(){return m(p)},children:(l,E)=>{var A=Ne(),L=C(A);{var ue=f=>{var x=Be(),g=C(x);Le(g,{size:15,class:"animate-spin"});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SENDING")]),d(f,x)},pe=f=>{var x=Ce(),g=C(x);q(g,{size:15});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SEND_RESET_LINK")]),d(f,x)};T(L,f=>{m(p)?f(ue):f(pe,-1)})}d(l,A)},$$slots:{default:!0}}),s(t),_(l=>{v(me,l),he(O,1,`flex h-9 w-full rounded-r-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
|
|
${m(N)?"border-red-500 ring-1 ring-red-500/30 animate-[shake_0.3s_ease-in-out]":"border-input"}`),O.disabled=m(p)},[()=>i.t("ADMIN_NEXT.FORGOT.EMAIL_ADDRESS")]),Ae("submit",t,Y),Me(O,()=>m(I),l=>c(I,l)),d(e,t)},le=e=>{var t=$e(),r=a(t,!0);s(t),_(n=>v(r,n),[()=>i.t("ADMIN_NEXT.FORGOT.IF_AN_ACCOUNT_EXISTS_FOR_THAT_EMAIL_A")]),d(e,t)};T(K,e=>{m(R)?e(le,-1):e(ne)})}var P=o(K,2),F=a(P),U=a(F);Ge(U,{name:"arrow-back",size:12});var de=o(U);s(F),s(P),s(j),s(z),s(M),_((e,t,r)=>{H(b,"aria-label",e),v(ae,t),H(F,"href",`${Se??""}/login`),v(de,` ${r??""}`)},[()=>i.t("ADMIN_NEXT.TOGGLE_DARK_MODE"),()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD"),()=>i.t("ADMIN_NEXT.FORGOT.BACK_TO_SIGN_IN")]),Ee("click",b,()=>W.toggleColorMode()),d(J,M),xe()}Oe(["click"]);export{st as component};
|