1import{j as e}from"./radix-C7m_p3hd.js";import{u as y,a as N,t as a,L as p}from"./index-QwT9_GrP.js";import{a as t}from"./icons-Byb5nA6I.js";import{A as C}from"./AuthLayout-DJ5QCBY8.js";import{B as h}from"./button-aZOsfQvV.js";import{I as x}from"./input-BDda6t1w.js";import{L as g}from"./label-Cywe519D.js";import"./pdf-BQaX5Z90.js";import"./editor-BVBPyX6q.js";import"./charts-CkbpeChh.js";import"./index-DpFz0cJn.js";function S(r){return r.includes("admin")?"/admin":r.includes("operator")?"/operator":"/app"}function P(){const{signIn:r,signInWithGoogle:f,isAuthenticated:i,roles:o}=y(),n=N(),[l,v]=t.useState(""),[c,w]=t.useState(""),[d,m]=t.useState(!1);t.useEffect(()=>{i&&n({to:S(o),replace:!0})},[i,o,n]);async function j(s){s.preventDefault(),m(!0);try{await r(l,c),a.success("Welcome back!")}catch(u){const b=u instanceof Error?u.message:"Sign in failed";a.error(b)}finally{m(!1)}}return e.jsxs(C,{title:"Sign in",description:"Access your client portal and projects.",footer:e.jsxs(e.Fragment,{children:["No account?"," ",e.jsx(p,{to:"/signup",className:"font-medium text-primary-strong hover:underline",children:"Create one"})]}),children:[e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"email",children:"Email"}),e.jsx(x,{id:"email",type:"email",inputMode:"email",required:!0,value:l,onChange:s=>v(s.target.value),autoComplete:"email",className:"h-12 rounded-xl text-base transition-shadow focus:shadow-[var(--shadow-glow-primary)]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"password",children:"Password"}),e.jsx(x,{id:"password",type:"password",required:!0,value:c,onChange:s=>w(s.target.value),autoComplete:"current-password",className:"h-12 rounded-xl text-base transition-shadow focus:shadow-[var(--shadow-glow-primary)]"})]}),e.jsx(h,{type:"submit",disabled:d,className:"tap-press shimmer-sweep h-12 w-full rounded-pill bg-gradient-fire text-base shadow-[var(--shadow-glow-primary)] transition-transform hover:scale-[1.01]",children:d?"Signing in...":"Sign in"})]}),e.jsxs("div",{className:"relative my-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full divider-iridescent"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-card px-3 text-muted-foreground",children:"or"})})]}),e.jsxs(h,{variant:"outline",className:"tap-press h-12 w-full rounded-pill border-border bg-background/60 text-base backdrop-blur-sm transition-colors hover:border-primary hover:bg-background",onClick:async()=>{try{await f()}catch{a.error("Google sign-in failed")}},children:[e.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),e.jsx("div",{className:"mt-4 text-center",children:e.jsx(p,{to:"/forgot-password",className:"text-xs text-muted-foreground hover:text-primary-strong hover:underline",children:"Forgot password?"})})]})}export{P as component};
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.