PageSourceSearch

https://zaher.ai/assets/LoginPage-CseSSJzh.js

js zaher.ai collected 2026-10-05 13:21:48 UTC 6,047 bytes, 1 lines download raw bytes

1import{u as B,f as F,e as T,g as S,b as z,ax as $,o as k,r as c,j as e,L,aP as H,q as W}from"./index-BgyAUjrd.js";import{r as a}from"./react-vendor-DMqmElJU.js";import{A as D}from"./AuthLayout-BXrTJeen.js";const V=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4"}),e.jsx("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 009 18z",fill:"#34A853"}),e.jsx("path",{d:"M3.964 10.71A5.41 5.41 0 013.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.997 8.997 0 000 9c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05"}),e.jsx("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 00.957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",fill:"#EA4335"})]}),q=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[e.jsx("rect",{x:"1",y:"1",width:"7.5",height:"7.5",fill:"#F25022"}),e.jsx("rect",{x:"9.5",y:"1",width:"7.5",height:"7.5",fill:"#7FBA00"}),e.jsx("rect",{x:"1",y:"9.5",width:"7.5",height:"7.5",fill:"#00A4EF"}),e.jsx("rect",{x:"9.5",y:"9.5",width:"7.5",height:"7.5",fill:"#FFB900"})]});function Q(){const{t}=B("marketing"),o=F(),m=T(),g=m.pathname.startsWith("/ar")?"/ar":"",d=m.state,n=(d==null?void 0:d.accessToken)||localStorage.getItem("anonymousAuditToken")||"",{login:N,isAuth:p,user:r}=S(),{toast:u}=z(),{googleOAuthEnabled:f,microsoftOAuthEnabled:x}=$(),[j,R]=a.useState(""),[v,I]=a.useState(""),[P,C]=a.useState(!1),[h,E]=a.useState(!1),[w,b]=a.useState(!1),[y,A]=a.useState("");a.useEffect(()=>{if(p&&r){if(k(r)){sessionStorage.setItem("pendingVerifyRedirect",c(r)),o("/verify-email",{replace:!0});return}const s=sessionStorage.getItem("postLoginRedirect");if(s){sessionStorage.removeItem("postLoginRedirect"),o(s,{replace:!0});return}o(c(r),{replace:!0})}},[p,r,o]);const M=async s=>{s.preventDefault(),A(""),b(!0);try{if(await N(H(j),v)){const i=S.getState().user;if(k(i)){sessionStorage.setItem("pendingVerifyRedirect",c(i)),o("/verify-email",{replace:!0});return}if(n&&(i!=null&&i.id))try{(await fetch(`/api/anonymous-audits/claim/${n}`,{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).ok&&(localStorage.removeItem("anonymousAuditToken"),localStorage.removeItem("anonymousAuditDomain"))}catch{}if(W(i))o(c(i)),u({title:"Admin Login Successful",description:"Welcome to the Admin Dashboard"});else{const l=sessionStorage.getItem("postLoginRedirect");l?(sessionStorage.removeItem("postLoginRedirect"),o(l,{replace:!0})):o("/app"),u({title:"Login Successful",description:"Welcome to your Dashboard"})}}else A(t("auth.login.loginError"))}catch{u({title:"Login Error",description:"Something went wrong. Please try again.",variant:"destructive"})}finally{b(!1)}};return e.jsxs(D,{children:[e.jsx("h1",{className:"auth-card-title",children:t("auth.login.title")}),f?e.jsxs("button",{type:"button",className:"btn-google",onClick:()=>{const s=new URLSearchParams({mode:"login"});n&&s.set("accessToken",n),window.location.href=`/api/auth/google?${s.toString()}`},children:[e.jsx(V,{}),t("auth.login.continueGoogle")]}):null,x?e.jsxs("button",{type:"button",className:"btn-google",onClick:()=>{const s=new URLSearchParams({mode:"login"});n&&s.set("accessToken",n),window.location.href=`/api/auth/microsoft?${s.toString()}`},children:[e.jsx(q,{}),t("auth.login.continueMicrosoft")]}):null,f||x?e.jsxs("div",{className:"auth-divider",children:[e.jsx("div",{className:"auth-divider-line"}),e.jsx("span",{className:"auth-divider-text",children:t("auth.login.orContinueEmail")}),e.jsx("div",{className:"auth-divider-line"})]}):null,y&&e.jsx("p",{className:"form-error",style:{marginBottom:16},children:y}),e.jsxs("form",{onSubmit:M,children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"identifier",className:"form-label",children:t("auth.login.emailLabel")}),e.jsx("div",{className:"form-input-wrap",children:e.jsx("input",{id:"identifier",type:"text",className:"form-input",placeholder:t("auth.login.emailPlaceholder"),value:j,onChange:s=>R(s.target.value),required:!0})})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"password",className:"form-label",children:t("auth.login.passwordLabel")}),e.jsxs("div",{className:"form-input-wrap",children:[e.jsx("input",{id:"password",type:h?"text":"password",className:"form-input has-icon-right",placeholder:t("auth.login.passwordPlaceholder"),value:v,onCh
1ange:s=>I(s.target.value),required:!0}),e.jsx("button",{type:"button",className:"input-icon-btn",onClick:()=>E(!h),children:h?e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),e.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]}),e.jsxs("div",{className:"form-row",children:[e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:P,onChange:s=>C(s.target.checked)}),t("auth.login.rememberMe")]}),e.jsx(L,{to:`${g}/forgot-password`,className:"form-link",children:t("auth.login.forgotPassword")})]}),e.jsx("button",{type:"submit",disabled:w,className:"btn-primary",children:w?e.jsx("span",{className:"auth-spinner"}):t("auth.login.submit")})]}),e.jsxs("p",{className:"auth-switch",children:[t("auth.login.noAccount")," ",e.jsx(L,{to:`${g}/signup`,children:t("auth.login.signUp")})]})]})}export{Q 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.