"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([[681],{99679:(e,t,s)=>{s.d(t,{A:()=>r});s(65043);var o=s(70579);const r=()=>(0,o.jsx)("div",{class:"w-4 h-4 border-2 border-t-transparent border-white rounded-full animate-spin"})},78091:(e,t,s)=>{s.d(t,{A:()=>o});const o=()=>e=>{const t=document.getElementById(e);t&&(t.classList.add("shake"),t.querySelectorAll("input").forEach((e=>e.style.borderColor="red")),setTimeout((()=>{t.classList.remove("shake"),t.querySelectorAll("input").forEach((e=>e.style.borderColor="#ccc"))}),1e3))}},40681:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var o=s(89379),r=(s(96166),s(82806)),a=s(65043),n=s(78091),l=s(66580),i=s(9435),c=s(1880),d=s(99679),m=s(70579);const u=()=>{const[e,t]=(0,a.useState)({email:""}),s=(0,n.A)(),u=(0,l.Zp)(),h=(0,i.A)(),[p,b]=(0,a.useState)(!1);return(0,m.jsxs)("main",{className:"login__main",children:[(0,m.jsx)("img",{src:r,alt:"Logo.png",className:"mb-5"}),(0,m.jsxs)("div",{className:"login__box flex flex-col",id:"loginBox",children:[(0,m.jsx)("p",{className:"text-2xl font-bold",children:"Forgot Your Password"}),(0,m.jsxs)("p",{className:"mb-10",children:["Please enter the email address you'd like your password",(0,m.jsx)("br",{}),"reset information sent to."]}),(0,m.jsxs)("form",{onSubmit:async t=>{t.preventDefault();const o=Object.fromEntries(new FormData(t.target));for(let e of Object.keys(o))if(""===o[e]||void 0===o[e]||null===o[e])return void s("loginBox");try{const t="https://ezybill.ureshiiweightloss.com/api/v1/user/forgot";b(!0);const s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await s.json();if(b(!1),200!==s.status||o.err)return h(o.err,"error");c.A.set("user-token",o.token,{secure:!0}),u("/admin/otp",{state:{email:e.email}})}catch(r){return console.log(r),h("Something went wrong","error")}},children:[(0,m.jsx)("input",{type:"emial",name:"email",value:e.email,onChange:s=>t((0,o.A)((0,o.A)({},e),{},{email:s.target.value})),className:"input_style",placeholder:"Enter email"}),(0,m.jsx)("button",{className:"button_style",type:"submit",children:p?(0,m.jsx)(d.A,{}):"Send"}),(0,m.jsx)("div",{className:"text-center my-2",children:(0,m.jsx)("button",{type:"button",onClick:()=>u("/admin"),className:"text-blue-500 font-bold",children:"Back To Login"})})]})]})]})}},96166:()=>{},82806:(e,t,s)=>{e.exports=s.p+"static/media/logo.fad19e63cefd8737e978.png"}}]);
//# sourceMappingURL=681.8546dcc6.chunk.js.map