1import{c as q,r as t,o as v,p as F,A as y,j as e,B as l,b,L as n,t as P,q as _,v as G,w as Y,s as w}from"./index-B9xblx1X.js";import{I as c}from"./input-BgkJCVH0.js";import{L as m}from"./label-pqjvqnDT.js";import{C,a as S}from"./card-CK5sTH4r.js";import{B as D}from"./BrandLogo-CpiTv_d1.js";import{p as O}from"./founder-events-BB-rGoa9.js";import{G as U,A as z}from"./GoogleSignInButton-DWD2Ng8W.js";import{M as K}from"./mail-CduvjoWU.js";import{C as V}from"./circle-alert-CIxqSbDS.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const W=q("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);function ae(){const[d,k]=t.useState(""),[a,A]=t.useState(""),[i,E]=t.useState(""),[u,x]=t.useState(!1),[h,p]=t.useState(!1),[o,L]=t.useState(!1),[f,r]=t.useState(""),[T,g]=t.useState(()=>v()),{toast:N}=F();t.useEffect(()=>{if(!o)return;const s=()=>{g(v()),P("signup")};return s(),window.addEventListener(y,s),()=>window.removeEventListener(y,s)},[o]);const B=()=>{localStorage.setItem(_,"accepted"),G(!0),Y(),g(!0)},I=async s=>{if(s.preventDefault(),r(""),i.length<8){r("Password must be at least 8 characters.");return}x(!0);const{data:R,error:j}=await w.auth.signUp({email:a,password:i,options:{data:{display_name:d},emailRedirectTo:window.location.origin}});x(!1),j?r(j.message):(R.session&&O({event:"signup"}),L(!0))},M=async()=>{p(!0);const{error:s}=await w.auth.resend({type:"signup",email:a});p(!1),N(s?{title:"Failed to resend",description:s.message,variant:"destructive"}:{title:"Email sent",description:"Check your inbox for the confirmation link."})};return o?e.jsxs("div",{className:"min-h-[100dvh] flex items-center justify-center px-4 py-10 bg-background relative",children:[e.jsx("div",{className:"absolute inset-0 gradient-subtle"}),e.jsxs("div",{className:"w-full max-w-sm relative text-center",children:[e.jsx("div",{className:"inline-flex h-14 w-14 rounded-2xl bg-primary/10 items-center justify-center mb-5",children:e.jsx(K,{className:"h-7 w-7 text-primary"})}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Check your email"}),e.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed mb-6",children:["We sent a confirmation link to ",e.jsx("span",{className:"font-medium text-foreground",children:a}),". Click the link to activate your account."]}),e.jsx(C,{className:"border-border/60 shadow-medium",children:e.jsxs(S,{className:"p-6 space-y-4",children:[!T&&e.jsx(l,{type:"button",className:"w-full font-medium h-10",onClick:B,children:"Accept analytics"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Didn't receive the email? Check your spam folder or resend it."}),e.jsxs(l,{variant:"outline",className:"w-full font-medium h-10",onClick:M,disabled:h,children:[h?e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"}):e.jsx(W,{className:"h-4 w-4 mr-2"}),"Resend confirmation email"]}),e.jsx(n,{to:"/auth/signin",className:"block text-sm text-primary hover:underline font-medium",children:"Back to sign in"})]})})]})]}):e.jsxs("div",{className:"min-h-[100dvh] flex items-center justify-center px-4 py-10 bg-background relative",children:[e.jsx("div",{className:"absolute inset-0 gradient-subtle"}),e.jsxs("div",{className:"w-full max-w-sm relative",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(D,{size:44,className:"mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Create your account"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Start building your personal archive"})]}),e.jsx(C,{className:"border-border/60 shadow-medium",children:e.jsxs(S,{className:"p-6",children:[f&&e.jsxs("div",{role:"alert",className:"flex items-start gap-2.5 p-3 mb-4 rounded-lg bg-destructive/10 border border-destructive/20 text-sm text-destructive",children:[e.jsx(V,{className:"h-4 w-4 mt-0.5 shrink-0"}),e.jsx("span",{children:f})]}),e.jsx(U,{onError:r}),e.jsx(z,{}),e.jsxs("form",{onSubmit:I,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"name",className:"text-xs font-medium",children:"Name"}),e.jsx(c,{id:"name",placeholder:"Your name",value:d,onChange:s=>k(s.target.value),required:!0,className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"email",className:"text-xs font-medium",children:"Email"}),e.jsx(c,{id:"email",type:"email",placeholder:"[email protected]",value:a,onChange:s=>A(s.target.value),required:!0,className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"password",className:"text-xs font-medium",children:"Password"}),e.jsx(c,{id:"password",type:"password",placeholder:"Min 8 characters",value:i,onChange:s=>E(s.target.value),required:!0,className:"h-10",minLength:8})]}),e.jsx(l,{type:"submit",className:"w-full font-medium h-10",disabled:u,children:u?e.jsx(b,{className:"h-4 w-4 animate-spin"}):"Create account"})]}),e.jsxs("p",{className:"text-2xs text-center text-muted-foreground mt-4",children:["By creating an account you agree to our"," ",e.jsx(n,{to:"/terms",className:"text-primary hover:underline",children:"Terms"})," and"," ",e.jsx(n,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"})]})]})}),e.jsxs("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Already have an account? ",e.jsx(n,{to:"/auth/signin",className:"text-primary hover:underline font-medium",children:"Sign in"})]})]})]})}export{ae 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.