"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([[3977],{99679:(e,t,a)=>{a.d(t,{A:()=>s});a(65043);var n=a(70579);const s=()=>(0,n.jsx)("div",{class:"w-4 h-4 border-2 border-t-transparent border-white rounded-full animate-spin"})},78091:(e,t,a)=>{a.d(t,{A:()=>n});const n=()=>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))}},3977:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});a(96166);var n=a(82806),s=a(65043),r=a(78091),l=a(66580),i=a(9435),o=a(1880),c=a(6720),x=a(99679),u=a(70579);const d=()=>{var e;const[t,a]=(0,s.useState)([]),d=(0,r.A)(),g=(0,l.Zp)(),m=(0,i.A)(),h=null===(e=(0,l.zy)().state)||void 0===e?void 0:e.email,[p,f]=(0,s.useState)(!1);return(0,u.jsxs)("main",{className:"login__main",children:[(0,u.jsx)("img",{src:n,alt:"Logo.png",className:"mb-5"}),(0,u.jsxs)("div",{className:"login__box flex flex-col",id:"loginBox",children:[(0,u.jsx)("div",{className:"w-[50px] h-[50px] bg-[#0000001e] text-blue-500 rounded-full flex justify-center items-center mx-auto",children:(0,u.jsx)(c.mm2,{className:"text-2xl"})}),(0,u.jsx)("p",{className:"text-2xl font-bold text-center",children:"OTP Verification"}),(0,u.jsxs)("p",{className:"mb-8 text-center",children:["Please enter your verification code we sent ",(0,u.jsx)("br",{}),"to ",(0,u.jsx)("i",{children:h})]}),(0,u.jsxs)("form",{className:"flex gap-4 justify-center items-center",children:[(0,u.jsx)("input",{type:"text",name:"text",value:t[0],onChange:e=>{const n=[...t];n[0]=e.target.value,a(n),e.target.value&&e.target.nextSibling&&e.target.nextSibling.focus()},className:"otp__field",maxLength:"1"}),(0,u.jsx)("input",{type:"text",name:"text",value:t[1],onChange:e=>{const n=[...t];n[1]=e.target.value,a(n),e.target.value&&e.target.nextSibling&&e.target.nextSibling.focus()},className:"otp__field",maxLength:"1"}),(0,u.jsx)("input",{type:"text",name:"text",value:t[2],onChange:e=>{const n=[...t];n[2]=e.target.value,a(n),e.target.value&&e.target.nextSibling&&e.target.nextSibling.focus()},className:"otp__field",maxLength:"1"}),(0,u.jsx)("input",{type:"text",name:"text",value:t[3],onChange:e=>{const n=[...t];n[3]=e.target.value,a(n),e.target.value&&e.target.nextSibling&&e.target.nextSibling.focus()},className:"otp__field",maxLength:"1"})]}),(0,u.jsx)("div",{className:"flex justify-center",children:(0,u.jsx)("button",{className:"bg-[#003E32] p-3 rounded mt-7 text-white flex justify-center",onClick:async()=>{if(0===t.length)return d(),void m("Invalid OTP","error");try{f(!0);const e="https://ezybill.ureshiiweightloss.com/api/v1/user/verify-otp",a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otp:t.join(""),token:o.A.get("user-token")})}),n=await a.json();if(f(!1),200!==a.status||n.err)return m(n.err,"error");g("/admin/change-password")}catch(e){return f(!1),console.log(e),m("Something went wrong","error")}},children:p?(0,u.jsx)(x.A,{}):"Verify OTP"})})]})]})}},96166:()=>{},82806:(e,t,a)=>{e.exports=a.p+"static/media/logo.fad19e63cefd8737e978.png"}}]);
//# sourceMappingURL=3977.3108d31e.chunk.js.map