(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4225],{85508:function(e,t,r){Promise.resolve().then(r.t.bind(r,231,23)),Promise.resolve().then(r.bind(r,8520))},87138:function(e,t,r){"use strict";r.d(t,{default:function(){return s.a}});var i=r(231),s=r.n(i)},76575:function(e,t,r){"use strict";var i=r(57437),s=r(2248),a=r(2265);t.Z=e=>{let{content:t,isOpen:r,duration:n=4e3}=e,{closeSnackBar:l}=(0,s.SE)();return(0,a.useEffect)(()=>{if(r){let e=setTimeout(()=>{l()},n);return()=>clearTimeout(e)}},[r,n]),(0,i.jsxs)("div",{className:"fixed w-[30rem] md:w-auto top-4 left-1/2 transform -translate-x-1/2 z-50 transition-all duration-200 ".concat(r?"opacity-100 translate-y-0":"opacity-0 translate-y-4"," capitalize text-sm font-medium bg-").concat(t.bg," border border-gray-300 alert ").concat(t.txt," flex items-center justify-between gap-2"),role:"alert",children:[(0,i.jsxs)("div",{children:["text-success"===t.txt&&(0,i.jsx)("i",{className:"ri-checkbox-circle-fill"})," "," ",t.message]}),(0,i.jsx)("button",{onClick:l,children:(0,i.jsx)("i",{className:"ri-close-line text-gray-600"})})]})}},8520:function(e,t,r){"use strict";var i=r(57437),s=r(2265),a=r(87138),n=r(2248),l=r(57643),o=r(76575);t.default=()=>{let e=(0,s.useRef)(),{openSnack:t,snackMessage:r,openSnackBar:c,handleSnackMessage:d}=(0,n.SE)(),[m,u]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),h=async e=>{if(e.preventDefault(),x(!0),m){if(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(m))try{await (0,l.Jr)({email:m})&&(c(),d("Password reset link sent to your email. Check inbox/spam.","white","text-success"),x(!1))}catch(e){var t,r,i;c(),(null===(i=e.response)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:null===(t=r.errors)||void 0===t?void 0:t.email)==="email not valid"?d("Email is not registered yet!","white","text-danger"):d("Something went wrong please try after some time!","white","text-danger")}finally{x(!1)}else c(),d("Invalid email address!","white","text-danger")}else c(),d("Please enter your email!","white","text-danger")};return(0,s.useEffect)(()=>{e.current.focus()},[]),(0,i.jsxs)("div",{className:"mt-5",children:[t&&(0,i.jsx)(o.Z,{isOpen:t,content:r}),(0,i.jsx)("form",{onSubmit:h,children:(0,i.jsxs)("div",{className:"grid gap-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"email",className:"block text-sm mb-2 dark:text-white",children:"Email address"}),(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)("input",{type:"email",id:"email",ref:e,name:"email",value:m,onChange:e=>u(e.target.value),className:"py-2 px-3 block w-full border-gray-200 rounded-sm text-sm focus:border-primary focus:ring-primary dark:bg-bgdark dark:border-white/10 dark:text-white/70",placeholder:"Enter email",required:!0})})]}),(0,i.jsx)("button",{type:"submit",className:"py-2 px-3 inline-flex justify-center items-center gap-2 rounded-sm border border-transparent font-semibold bg-primary text-white hover:bg-primary focus:outline-none focus:ring-0 focus:ring-primary focus:ring-offset-0 transition-all text-sm dark:focus:ring-offset-white/10 ".concat(f?"opacity-[0.6]":""),children:f?(0,i.jsx)("span",{className:"animate-pulse",children:"Please wait..."}):"Send link"}),(0,i.jsxs)("p",{className:"text-center text-sm text-gray-600 dark:text-white/70",children:["Remember your password?",(0,i.jsx)(a.default,{className:"text-primary decoration-2 hover:underline font-medium ms-1 inline-flex",href:"/",children:"Sign in here"})]})]})})]})}}},function(e){e.O(0,[5907,231,2248,2971,7023,1744],function(){return e(e.s=85508)}),_N_E=e.O()}]);