1import{r as o,u as te,a as se,b as oe,j as e,S as re,Q as ae,A as S,m as r,F as ie,I as le,c as ne,d as O,e as ce,f as B}from"./index-C2Ip-JD6.js";import{L as de}from"./LeftSideContent-g9JPhWi0.js";import{M as xe,a as ue,f as me}from"./MobileLoginPageLeftSide-CpC14F79.js";import"./index-B3xzvdZN.js";import"./index-GLm_3luR.js";function be(){const[p,M]=o.useState(""),[m,E]=o.useState(!1),[k,$]=o.useState(""),[j,q]=o.useState(!1),[F,v]=o.useState(!1),[H,D]=o.useState(!1),[I,g]=o.useState(""),[y,h]=o.useState(""),[W,L]=o.useState(!1),[J,i]=o.useState(30),[K,c]=o.useState(!1),[T,G]=o.useState(""),d=te(),_=o.useRef(null),A=o.useRef(null);let{userDetails:fe,setUserDetails:P,setCreditBal:C,socket:x,setToaster:w,setAppTour:U}=se();const z=()=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(!p){h("Email is required");return}if(!t.test(p)){h("Please enter a valid email address");return}h(!1),E(!0)};o.useEffect(()=>{document.title="Real time Catch all email validation | Gamalogic",window.ztUserData&&window.ztUserData.za_email_id&&window.ztUserData.za_email_id!=""&&(window.ztUserData.za_email_id="",window.ztUserData.user_unique_id="",window.ztUserData.thrive_digest="",window.ztUserData.signUpPage="https://app.gamalogic.com/signup",window.ztUserData.signInPage="https://app.gamalogic.com/signin",window.hideThriveWidget=!0,typeof window.reloadThriveWidget=="function"&&window.reloadThriveWidget())},[]),o.useEffect(()=>{var t,a;m?(t=A.current)==null||t.focus():(a=_.current)==null||a.focus()},[m]);const R=async t=>{var a,u,n,f;t.preventDefault();try{c(!0),i(30);const l=setInterval(()=>{i(s=>s<90?s+4:s)},1e3);let b=await B.post("login",{email:p,password:k});if(i(100),c(!1),((a=b.data)==null?void 0:a.error)=="Blocked")d("/blocked");else{let s=b.data,ee=s.banners;delete s.banners,P(s),C(s.credit),U(s.AppTour||null),localStorage.setItem("Gamalogic_Test_token",JSON.stringify(s)),setTimeout(()=>{w({show:!0,message:"Login Successful",color:"#E9F7E9",type:"success",section:"login"})},1e3),d("/dashboard/onboarding",{})}}catch(l){if((n=(u=l.response)==null?void 0:u.data)!=null&&n.error.includes("blocked")){d("/admin-blocked");return}w({show:!0,message:"Login Failure",color:"#FFEAE5",type:"failure",section:"login"}),l.response.status===500?L(!0):g((f=l.response)==null?void 0:f.data.error),v(!0),Q()}finally{i(100),c(!1)}},Y=async t=>{var a,u,n,f;try{c(!0),i(30);const l=setInterval(()=>{i(N=>N<90?N+4:N)},1e3);let b=await B.post("/googleLogin",{credentialResponse:t});i(100),c(!1);let s=b.data,ee=s.banners;delete s.banners,P(s),C(s.credit),U(s.AppTour||null),localStorage.setItem("Gamalogic_Test_token",JSON.stringify(s)),setTimeout(()=>{w({show:!0,message:"Login Successful",color:"#E9F7E9",type:"success",section:"login"})},1e3),d("/dashboard/onboarding",{})}catch(l){if((u=(a=l.response)==null?void 0:a.data)!=null&&u.error.includes("blocked")){d("/admin-blocked");return}w({show:!0,message:"Login Failure",color:"#FFEAE5",type:"failure",section:"login"}),((n=l==null?void 0:l.response)==null?void 0:n.status)===500?L(!0):G((f=l.response)==null?void 0:f.data.error)}finally{i(100),c(!1)}};o.useEffect(()=>(x&&(x.disconnect(),x.off()),()=>{x&&(x.disconnect(),x.off())}),[x]);const Q=()=>{D(!0),setTimeout(()=>D(!1),1e3)},V=()=>{E(!1),v(!1),g("")},X=oe({onSuccess:async t=>{try{c(!0),i(30);const a=setInterval(()=>{i(n=>n<90?n+4:n)},1e3),u=await me(t.access_token);await Y({token:t.access_token,userInfo:u}),i(100),c(!1),clearInterval(a)}catch(a){console.error("Google login error:",a),g("Failed to login with Google")}},onError:t=>{console.error("Google login error:",t),g("Failed to login with Google")}});let Z=t=>{G(t)};return W?e.jsx(re,{}):e.jsx("div",{className:"bg-bgblue w-full flex justify-center items-center lg:min-h-screen ",children:e.jsxs("div",{className:"lg:flex w-full ",children:[K&&e.jsx(ae,{color:"#C1DB84",height:10,progress:J,onLoaderFinished:()=>{}}),e.jsx(de,{}),e.jsx(xe,{}),e.jsxs("div",{className:"w-full lg:w-8/12 xl:w-6/12 flex flex-col items-center justify-center mt-6 p-5 lg:p-8 relative ",style:{fontFamily:"Inter,sans-serif"},children:[e.jsxs("div",{className:"w-full flex flex-col justify-center items-center ",children:[e.jsx("form",{onSubmit:R,className:"w-full flex flex-col justify-center items-center",children:e.jsx("div",{className:"text-logo-text-color w-full sm:w-8/12 xl:w-8/12 max-w-lg rounded-4xl bg-boxcolor py-4 sm:py-8 px-5 sm:px-9 2xl:px-12 text-[14px] border border-bordercolor flex flex-col justify-center items-center",children:e.jsx(S,{mode:"wait",children:m?e.jsxs(r.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4},className:"w-full",children:[e.jsxs("button",{type:"button",onClick:V,className:"mr-2 mb-4 flex text-[13px] font-[400] justify-center items-center text-logo-text-color hover:text-[#97c763]",children:[e.jsx(ie,{className:"mr-1"})," Go Back"]}),e.jsx("div",{className:"flex items-center mb-4",children:e.jsx(r.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"text-dark-text-color text-[20px] sm:text-[24px]",style:{fontFamily:"Domine,serif"},children:F?"Oops!":"Hello There!"})}),e.jsxs(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},className:"w-full mb-3 mt-5",children:[e.jsx("label",{htmlFor:"password",className:"block mb-3 text-[14px] font-[400] text-gray-700",style:{fontFamily:"Inter,sans-serif"},children:"Enter Your password"}),e.jsx(r.div,{animate:H?{x:[-10,10,-10,10,0],transition:{duration:.5}}:{},children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:j?"text":"password",id:"password",ref:A,autoFocus:m,className:`border ${F?"border-red-500":"border-bordercolor"} rounded-3xl px-4 py-2 w-full text-logo-text-color focus:ring-1 focus:ring-button-color focus:outline-none transition-all duration-200 pr-10`,placeholder:"Enter your password",value:k,onChange:t=>{$(t.target.value),v(!1)},onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),R(t))},required:!0}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-500 hover:text-logo-text-color focus:outline-none",onClick:()=>q(!j),children:j?e.jsx(le,{className:"w-4 h-4"}):e.jsx(ne,{className:"w-4 h-4"})})]})}),I&&e.jsx(r.div,{className:"w-full my-4 text-[#F25325] text-sm",initial:{opacity:0,x:30},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:20},children:I}),e.jsxs(r.button,{whileHover:{scale:1.02},whileTap:{scale:.98},type:"submit",className:"w-2/5 mt-8 text-logo-text-color rounded-3xl px-4 py-2 bg-button-color flex items-center justify-center gap-1",children:[e.jsx("span",{children:"Continue"}),e.jsx(O,{className:"w-4 h-4"})]})]})]},"passwordForm"):e.jsxs(r.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"flex flex-col justify-center items-center w-full",children:[e.jsx("h2",{className:"text-[20px] sm:text-[24px] text-dark-text-color font-[400]",style:{fontFamily:"Domine,serif"},children:"Sign in"}),e.jsxs("div",{className:"flex gap-2 justify-center text-xs items-center my-3 w-full ",children:[e.jsxs(r.button,{whileHover:{scale:1.02,cursor:"pointer"},whileTap:{scale:.98},type:"button",onClick:()=>
1X(),className:"border border-bordercolor rounded-3xl w-2/4 px-2 py-2 flex justify-center items-center gap-2 hover:border-button-color transition-colors duration-200 cursor-pointer",children:[e.jsx("img",{src:"/google.svg",alt:"",className:"w-3 h-3"})," ","Google Sign in"]}),e.jsx(ue,{page:"login",microsoftErrors:Z})]}),T&&e.jsx(r.div,{className:"w-full text-[#F25325] text-xs ml-2 ",initial:{opacity:0,x:30},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:20},children:T}),e.jsxs("div",{className:"relative w-full my-3",children:[e.jsx("div",{className:"absolute inset-0 flex items-center px-2",children:e.jsx("div",{className:"w-full border-t border-bordercolor"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"px-2 bg-boxcolor text-[9px] sm:text-[11px] text-[#78829D]",children:"OR"})})]}),e.jsxs("div",{className:"flex my-3 w-full gap-3 justify-between",children:[e.jsxs("div",{className:"w-5/6 relative",children:[e.jsx(r.input,{ref:_,autoFocus:!m,whileFocus:{scale:1.01},type:"email",className:`border ${y?"border-red-500":"border-bordercolor"} rounded-3xl px-4 py-2 w-full text-logo-text-color bg-boxcolor focus:ring-1 focus:ring-button-color focus:outline-none transition-all duration-200`,placeholder:"Your email address",value:p,onChange:t=>{M(t.target.value),h(!1)},onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),z())},required:!0}),y&&e.jsx(r.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"absolute left-1 mt-1 mb-4 top-full pt-1 text-red-500 text-[10px] md:text-xs",children:"Please enter a valid email address"})]}),e.jsxs(r.button,{whileHover:{scale:1.05},whileTap:{scale:.95},type:"button",onClick:z,className:`rounded-3xl px-2 w-20 py-2 flex items-center justify-center gap-1 transition-colors duration-200 ${y?"bg-gray-300 cursor-not-allowed":"bg-button-color hover:bg-opacity-90 cursor-pointer"}`,disabled:y,children:["Go ",e.jsx(O,{className:"w-4 h-4"})]})]})]},"emailForm")})})}),m?e.jsx(S,{children:e.jsx(r.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"flex justify-center items-center",children:e.jsx("button",{className:"text-logo-text-color text-[14px] my-6 hover:underline cursor-pointer",onClick:()=>d("/forgotpassword"),children:"Forgot Password?"})})}):e.jsx(S,{mode:"wait",children:e.jsxs(r.div,{initial:{opacity:0},animate:{opacity:1},className:"text-logo-text-color w-full sm:w-8/12 xl:w-8/12 flex max-w-lg gap-3 xl:gap-0 rounded-4xl justify-between h-[90px] bg-boxcolor my-4 py-4 sm:py-8 px-5 sm:px-9 2xl:px-12 text-[14px] border border-bordercolor items-center",children:[e.jsxs("p",{className:"text-[15px] sm:text-[19px] text-dark-text-color font-[400]",style:{fontFamily:"Domine,serif"},children:["New to Gamalogic?"," "]}),e.jsx("button",{onClick:()=>d("/signup"),className:"rounded-3xl px-2 w-20 text-[14px] text-logo-text-color py-2 font-[500] cursor-pointer min-w-28 bg-bordercolor hover:bg-[#d8d8d7] flex items-center justify-center gap-1 hover:bg-opacity-90 transition-colors duration-200",children:"Sign Up"})]})})]}),e.jsx("div",{className:"absolute bottom-4 left-0 hidden right-30 lg:flex justify-end space-x-3 lg:pl-[126px]",children:e.jsx(ce,{})})]})]})})}export{be 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.