1import{r as p,j as e,a as W,L as K,t as f,s as j}from"./index--omarlck.js";import{d as C,C as O,b as U,I as x,B as w}from"./card-DmB0-T46.js";import{L as h}from"./label-BYfZX4VI.js";import{u as J,P as v,a as Q,c as N,b as X,d as Y}from"./index-B5DiE4w-.js";import{u as Z,R as ee,I as se,c as F,A as ae}from"./index-DOgKq2oP.js";import{S as re}from"./sprout-CApqtmmk.js";import{s as P}from"./types-KBJzO2d1.js";var b="Tabs",[te]=Y(b,[F]),R=F(),[ne,S]=te(b),E=p.forwardRef((s,r)=>{const{__scopeTabs:t,value:o,onValueChange:l,defaultValue:m,orientation:a="horizontal",dir:i,activationMode:d="automatic",...u}=s,n=Z(i),[c,g]=J({prop:o,onChange:l,defaultProp:m??"",caller:b});return e.jsx(ne,{scope:t,baseId:Q(),value:c,onValueChange:g,orientation:a,dir:n,activationMode:d,children:e.jsx(v.div,{dir:n,"data-orientation":a,...u,ref:r})})});E.displayName=b;var M="TabsList",_=p.forwardRef((s,r)=>{const{__scopeTabs:t,loop:o=!0,...l}=s,m=S(M,t),a=R(t);return e.jsx(ee,{asChild:!0,...a,orientation:m.orientation,dir:m.dir,loop:o,children:e.jsx(v.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:r})})});_.displayName=M;var L="TabsTrigger",k=p.forwardRef((s,r)=>{const{__scopeTabs:t,value:o,disabled:l=!1,...m}=s,a=S(L,t),i=R(t),d=$(a.baseId,o),u=V(a.baseId,o),n=o===a.value;return e.jsx(se,{asChild:!0,...i,focusable:!l,active:n,children:e.jsx(v.button,{type:"button",role:"tab","aria-selected":n,"aria-controls":u,"data-state":n?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...m,ref:r,onMouseDown:N(s.onMouseDown,c=>{!l&&c.button===0&&c.ctrlKey===!1?a.onValueChange(o):c.preventDefault()}),onKeyDown:N(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&a.onValueChange(o)}),onFocus:N(s.onFocus,()=>{const c=a.activationMode!=="manual";!n&&!l&&c&&a.onValueChange(o)})})})});k.displayName=L;var D="TabsContent",B=p.forwardRef((s,r)=>{const{__scopeTabs:t,value:o,forceMount:l,children:m,...a}=s,i=S(D,t),d=$(i.baseId,o),u=V(i.baseId,o),n=o===i.value,c=p.useRef(n);return p.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),e.jsx(X,{present:l||n,children:({present:g})=>e.jsx(v.div,{"data-state":n?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:u,tabIndex:0,...a,ref:r,style:{...s.style,animationDuration:c.current?"0s":void 0},children:g&&m})})});B.displayName=D;function $(s,r){return`${s}-trigger-${r}`}function V(s,r){return`${s}-content-${r}`}var oe=E,z=_,G=k,q=B;const ie=oe,H=p.forwardRef(({className:s,...r},t)=>e.jsx(z,{ref:t,className:C("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...r}));H.displayName=z.displayName;const y=p.forwardRef(({className:s,...r},t)=>e.jsx(G,{ref:t,className:C("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...r}));y.displayName=G.displayName;const T=p.forwardRef(({className:s,...r},t)=>e.jsx(q,{ref:t,className:C("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...r}));T.displayName=q.displayName;const I=P().trim().email("Please enter a valid email").max(255),A=P().min(8,"Password must be at least 8 characters").max(128),ce=P().trim().min(1,"Name is required").max(120);function xe(){const s=W(),[r,t]=p.useState(!1);async function o(a){a.preventDefault();const i=new FormData(a.currentTarget),d=I.safeParse(i.get("email")),u=A.safeParse(i.get("password"));if(!d.success)return f.error(d.error.errors[0].message);if(!u.success)return f.error(u.error.errors[0].message);t(!0);const{error:n}=await j.auth.signInWithPassword({email:d.data,password:u.data});if(t(!1),n)return f.error(n.message);f.success("Welcome back!"),s({to:"/apply"})}async function l(a){a.preventDefault();const i=new FormData(a.currentTarget),d=I.safeParse(i.get("email")),u=A.safeParse(i.get("password")),n=ce.safeParse(i.get("name"));if(!n.success)return f.error(n.error.errors[0].message);if(!d.success)return f.error(d.error.errors[0].message);if(!u.success)return f.error(u.error.errors[0].message);t(!0);const{error:c}=await j.auth.signUp({email:d.data,password:u.data,options:{emailRedirectTo:`${window.location.origin}/apply`,data:{full_name:n.data}}});if(t(!1),c)return f.error(c.message);f.success("Account created â you can begin your application."),s({to:"/apply"})}async function m(){const{error:a}=await j.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/apply`}}
1);a&&f.error(a.message)}return e.jsxs("div",{className:"min-h-screen bg-gradient-warmth flex flex-col",children:[e.jsx("div",{className:"p-4 sm:p-6",children:e.jsxs(K,{to:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(ae,{className:"h-4 w-4"})," Back to home"]})}),e.jsx("div",{className:"flex-1 flex items-center justify-center px-4 pb-12",children:e.jsx(O,{className:"w-full max-w-md rounded-3xl border-border/60 shadow-warm",children:e.jsxs(U,{className:"p-8",children:[e.jsxs("div",{className:"text-center mb-7",children:[e.jsx("span",{className:"inline-flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-sage text-primary-foreground shadow-soft",children:e.jsx(re,{className:"h-6 w-6"})}),e.jsx("h1",{className:"mt-4 font-serif text-3xl text-foreground",children:"Welcome"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in or create an account to begin."})]}),e.jsxs(ie,{defaultValue:"signin",children:[e.jsxs(H,{className:"grid w-full grid-cols-2 rounded-full",children:[e.jsx(y,{value:"signin",className:"rounded-full",children:"Sign in"}),e.jsx(y,{value:"signup",className:"rounded-full",children:"Create account"})]}),e.jsx(T,{value:"signin",className:"mt-5",children:e.jsxs("form",{onSubmit:o,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"email",children:"Email"}),e.jsx(x,{id:"email",name:"email",type:"email",required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"password",children:"Password"}),e.jsx(x,{id:"password",name:"password",type:"password",required:!0})]}),e.jsx(w,{type:"submit",disabled:r,className:"w-full rounded-full",size:"lg",children:r?"Signing inâ¦":"Sign in"})]})}),e.jsx(T,{value:"signup",className:"mt-5",children:e.jsxs("form",{onSubmit:l,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"name",children:"Full name"}),e.jsx(x,{id:"name",name:"name",required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"email2",children:"Email"}),e.jsx(x,{id:"email2",name:"email",type:"email",required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"password2",children:"Password"}),e.jsx(x,{id:"password2",name:"password",type:"password",required:!0,minLength:8}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"At least 8 characters"})]}),e.jsx(w,{type:"submit",disabled:r,className:"w-full rounded-full",size:"lg",children:r?"Creating accountâ¦":"Create account"})]})})]}),e.jsxs("div",{className:"mt-6 relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]}),e.jsxs(w,{onClick:m,variant:"outline",className:"w-full mt-4 rounded-full",size:"lg",children:[e.jsxs("svg",{className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",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"}),e.jsx("path",{fill:"#FBBC05",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.93l3.66-2.84z"}),e.jsx("path",{fill:"#EA4335",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"})]}),"Continue with Google"]}),e.jsx("p",{className:"mt-6 text-xs text-center text-muted-foreground",children:"By continuing, you agree to our Terms and acknowledge our Privacy Policy."})]})})})]})}export{xe 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.