1import{u as v,r as f,e as F,be as I,b as _,j as e,T as x,B as n,bw as k,bt as L,bu as O,bv as A}from"./vendor-BX9phdei.js";import{b6 as E,r as l,h as V,b5 as M,b7 as g,k as q,a as b}from"./index-0M-ldFa9.js";import{L as B}from"./arrow_left_icon-YWvm9Omw.js";import{a as C}from"./auth.validation-BMalyq8r.js";const z=E.injectEndpoints({endpoints:r=>({signIn:r.mutation({query:({email:s,password:o,terms_condition:i})=>({url:l.auth.signIn,method:"POST",body:{email:s,password:o,terms_condition:i}})}),signUp:r.mutation({query:({full_name:s,email:o,phone_number:i,company_name:m,password:u,terms_condition:c,country:d})=>({url:l.auth.register,method:"POST",body:{full_name:s,email:o,phone_number:i,company_name:m,password:u,terms_condition:c,country:d}})}),forgotPassword:r.mutation({query:({email:s})=>({url:l.auth.forgotpassword,method:"POST",body:{email:s}})}),setpassword:r.mutation({query:({token:s,newPassword:o})=>({url:l.auth.setpassword,method:"POST",body:{token:s,newPassword:o}})})})}),{useSignInMutation:H,useSignUpMutation:W,useForgotPasswordMutation:G,useSetpasswordMutation:J}=z,K=()=>{const r=v(),[s,o]=f.useState([]),{register:i,handleSubmit:m,formState:{errors:u},setValue:c}=F({resolver:I(C.forgotPassword())}),[d,{isLoading:j}]=G(),y=V();f.useMemo(()=>[{fieldName:"email",fieldType:"email",fieldLabel:"Email Address"}],[]);const{supportNumber1:w,supportNumber2:S}=_(M);f.useEffect(()=>{if(Object.keys(g)?.length){const a=g.fields?.filter(t=>t.name==="email"&&t.show_in_form).map(t=>({fieldName:t.name,fieldType:t.type,defaultValue:t.default_value||"",mandatory:t.mandatory,label:t.label}));o(a)}},[]);const N=async a=>{const t=await d({email:a.email});t?.data&&(r(b.auth.otpgenerate,{state:{email:a.email}}),y(`OTP Re-Generated. Please check ${a?.email}`,"success")),t?.error&&y("invalid email","error")},P=(a,t,p)=>{o(T=>T.map(h=>h.fieldName===a?{...h,defaultValue:p}:h))};return e.jsxs(e.Fragment,{children:[e.jsx(x,{className:"text-xs text-gray-500 text-center mb-6",children:"Enter your email address to get the instructions to reset password"}),e.jsxs("form",{onSubmit:m(N),children:[s.map((a,t)=>e.jsx(n,{className:"mb-6",children:e.jsx(q,{formDetails:g,register:i,errors:u,defaultValues:a.defaultValue,formInfo:s,field:a,setValue:c,onChange:p=>P(a.fieldName,a.fieldType,p.target.value)},t)})),e.jsx(k,{size:"small",type:"submit",loading:j,loadingPosition:"end",variant:"contained",sx:{textTransform:"none"},fullWidth:!0,className:"text-white bgcolor-2",children:"Get OTP"}),e.jsx(n,{className:"flex justify-center mt-4",children:e.jsx(x,{variant:"body2",children:e.jsxs(L,{to:b.auth.login,className:"flex items-center text-blue-500",children:[e.jsx("img",{src:B,alt:"left_arrow_icon",className:"mr-1"}),"Back to Login"]})})}),e.jsx(n,{className:"flex justify-center mt-1",children:e.jsxs(x,{fontSize:12,children:[e.jsx(n,{component:"span",sx:{color:"error.main"},children:"Customer Support:Â "}),e.jsx(O,{sx:{width:18,verticalAlign:"middle",mr:.5,color:"error.main"}}),e.jsx(n,{component:"span",sx:{color:"primary.main",display:"inline"},children:w}),"Â ",e.jsx(A,{sx:{rotate:"90deg",width:"20px",height:"60px"}}),"Â ",e.jsx(n,{component:"span",sx:{color:"primary.main",display:"inline"},children:S})]})})]})]})};export{K as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.