1import{dj as L,z as F,r as S,gI as m,gJ as y,dp as I,dA as k,j as e,L as f,w as j,N as l,aA as i,bA as v,aq as D,gK as E,dH as P,B as b}from"./index-Dut0JDN-.js";import{A as M,a as T,b as G,c as _,d as H}from"./auth-card-Y09jOCQ-.js";import{M as w}from"./mail-6u3E5FaA.js";import{A as O}from"./AuthLayout-D6TlWuk1.js";try{let s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="ec50c444-95e3-49ef-b04d-4d4eb4af1006",s._sentryDebugIdIdentifier="sentry-dbid-ec50c444-95e3-49ef-b04d-4d4eb4af1006")}catch{}const B=P({email:b().email("Please enter a valid email"),password:b().min(6,"Password must be at least 6 characters")});function R({university:s}){const{isLoading:r,error:h,handleLogin:N,handleSocialLogin:d}=L(),{user:g,loading:u}=F(),o=r;S.useEffect(()=>{var p;u||g||!m.currentUser||(p=m.currentUser.providerData)!=null&&p.some(c=>["google.com","github.com","microsoft.com"].includes(c.providerId))||y(m).catch(c=>{console.warn("Failed to clear stale Firebase session on login page:",c)})},[u,g]);const a=((s==null?void 0:s.loginConfig)||{}).allowedMethods||{},{register:x,handleSubmit:C,formState:{errors:t}}=I({resolver:k(B),defaultValues:{email:"",password:""}}),A=async n=>{await N(n.email,n.password)};return e.jsxs(M,{children:[e.jsxs(T,{children:[(s==null?void 0:s.icon)&&e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:s.icon,alt:s.name,className:"object-contain w-auto h-16 rounded-lg"})}),e.jsx(G,{children:s!=null&&s.name?`Get Started with ${s.name}`:"Welcome back"}),e.jsx(_,{children:"Sign in to your account to continue"})]}),a.email&&e.jsxs("div",{children:[e.jsxs("form",{onSubmit:C(A),className:"pt-4 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"email",children:"Email"}),e.jsx(j,{id:"email",type:"email",placeholder:"[email protected]",...x("email"),disabled:o,"aria-invalid":t.email?"true":"false"}),t.email&&e.jsx("p",{className:"text-sm text-destructive",children:t.email.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"password",children:"Password"}),e.jsx(j,{id:"password",type:"password",...x("password"),disabled:o,"aria-invalid":t.password?"true":"false"}),t.password&&e.jsx("p",{className:"text-sm text-destructive",children:t.password.message})]}),h&&e.jsx("div",{className:"p-3 rounded-md bg-destructive/15",children:e.jsx("p",{className:"text-sm text-destructive",children:h||"An error occurred during login"})}),e.jsx(l,{type:"submit",className:"w-full",disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"w-4 h-4 mr-2 animate-spin"}),"Signing in..."]}):"Sign in"})]}),e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:e.jsx(v,{to:"/forgot-password",className:"underline underline-offset-4 hover:text-primary",children:"Forgot your password?"})})]}),a.email&&(a.google||a.github||a.microsoft)&&e.jsxs("div",{className:"relative my-4",children:[e.jsx(D,{}),e.jsx("span",{className:"absolute px-2 text-sm -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 bg-background text-muted-foreground",children:"OR"})]}),(a.google||a.github||a.microsoft)&&e.jsxs("div",{className:"grid gap-2",children:[a.google&&e.jsxs(l,{variant:"outline",onClick:()=>d("google"),disabled:o,className:"w-full",children:[o?e.jsx(i,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(E,{className:"w-4 h-4 mr-2"}),"Continue with Google"]}),a.github&&e.jsxs(l,{variant:"outline",onClick:()=>d("github"),disabled:o,className:"w-full",children:[o?e.jsx(i,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(w,{className:"w-4 h-4 mr-2"}),"Continue with GitHub"]}),a.microsoft&&e.jsxs(l,{variant:"outline",onClick:()=>d("microsoft"),disabled:o,className:"w-full",children:[o?e.jsx(i,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(w,{className:"w-4 h-4 mr-2"}),"Continue with Microsoft"]})]}),e.jsx(H,{})]})}function V({university:s}){return e.jsx(O,{university:s,children:e.jsx(R,{university:s})})}export{V as default}; 2//# sourceMappingURL=Login-C7zEvUAC.js.map
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.