1import{f as w,b as a,j as e,L as r}from"./vendor-De2NIrSl.js";import{k as y,B as u,S as k,ac as S,x as C,j as P}from"./index-BNKu6i1-.js";import{P as E,S as L}from"./SsoButtons-CS2YAzDV.js";import{I as m}from"./input-C8mcHA4N.js";function R({email:l}){const[i,s]=a.useState("idle");async function o(){s("sending");try{await P.post("/auth/verification/resend-request",{email:l}),s("sent")}catch{s("idle")}}return e.jsx("div",{className:"bloom-reveal w-full max-w-sm",children:e.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/80 p-8 text-center shadow-lg backdrop-blur-xl sm:p-10",children:[e.jsx("div",{className:"bloom-fill mx-auto grid size-14 place-items-center rounded-full shadow-lg",children:e.jsx(S,{className:"size-7"})}),e.jsx("h1",{className:"font-display mt-5 text-2xl font-extrabold tracking-tight",children:"Thanks for signing up!"}),e.jsxs("p",{className:"mt-3 text-muted-foreground",children:["We sent a confirmation link to ",e.jsx("span",{className:"font-semibold text-foreground",children:l}),". Click it to activate your account, then log in."]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Don't see it after a minute or two? Check your spam folder."}),e.jsx(u,{asChild:!0,size:"lg",className:"mt-6 w-full",children:e.jsx(r,{to:"/login",children:"Go to log in"})}),i==="sent"?e.jsx("p",{role:"status",className:"mt-3 text-sm text-muted-foreground",children:"If that address is waiting to be confirmed, a new link is on its way. It can take a minute, and it may land in spam."}):e.jsx(u,{variant:"ghost",size:"sm",className:"mt-3 w-full text-muted-foreground",disabled:i==="sending",onClick:()=>void o(),children:"Resend confirmation email"}),e.jsx("p",{className:"mt-4 text-sm",children:e.jsx(r,{to:"/",className:"text-muted-foreground underline-offset-4 hover:underline",children:"Back to home"})})]})})}function A(){const{register:l}=y(),i=w(),[s,o]=a.useState(""),[c,j]=a.useState(""),[x,v]=a.useState(""),[h,d]=a.useState(null),[p,f]=a.useState(!1),[g,b]=a.useState(null);async function N(t){if(t.preventDefault(),d(null),c!==x){d("Passwords do not match");return}f(!0);try{const{confirmationRequired:n}=await l(s,c);n?b(s):i("/feed",{replace:!0})}catch(n){d(n instanceof C?n.message:"Unable to create account")}finally{f(!1)}}return g?e.jsx("div",{className:"full-bleed overflow-x-clip",children:e.jsx("div",{className:"bloom-mesh bloom-grain relative grid min-h-[calc(100svh-4rem)] place-items-center px-6 py-12",children:e.jsx(R,{email:g})})}):e.jsx("div",{className:"full-bleed overflow-x-clip",children:e.jsx("div",{className:"bloom-mesh bloom-grain relative grid min-h-[calc(100svh-4rem)] place-items-center px-6 py-12",children:e.jsxs("div",{className:"bloom-reveal w-full max-w-sm",children:[e.jsxs("p",{className:"mb-6 text-center text-sm text-muted-foreground",children:["Already have an account?"," ",e.jsx(r,{to:"/login",className:"font-medium text-primary hover:underline",children:"Log in"})]}),e.jsxs("div",{className:"mb-7 text-center",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.2em] text-primary",children:"Join The Vibe Network"}),e.jsxs("h1",{className:"font-display mt-3 text-3xl font-extrabold tracking-tight sm:text-4xl",children:["Letâs ",e.jsx("span",{className:"bloom-text",children:"build"})," something."]}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(E,{})})]}),e.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/80 p-8 shadow-lg backdrop-blur-xl sm:p-10",children:[e.jsxs("form",{onSubmit:N,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),e.jsx(m,{id:"email",type:"email",autoComplete:"email",value:s,onChange:t=>o(t.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),e.jsx(m,{id:"password",type:"password",autoComplete:"new-password",minLength:8,value:c,onChange:t=>j(t.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"confirm-password",className:"text-sm font-medium",children:"Confirm Password"}),e.jsx(m,{id:"confirm-password",type:"password",autoComplete:"new-password",minLength:8,value:x,onChange:t=>v(t.target.value),required:!0})]}),h&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:h}),e.jsx(u,{type:"submit",size:"lg",className:"w-full",disabled:p,children:p?e.jsx(k,{}):"Sign up"})]}),e.jsx("div",{className:"mt-4",children:e.jsx(L,{})}),e.jsxs("p",{className:"mt-5 text-center text-xs text-muted-foreground",children:["By creating an account you agree to the"," ",e.jsx(r,{to:"/terms",className:"underline hover:text-foreground",children:"Terms of Service"})," ","and"," ",e.jsx(r,{to:"/privacy",className:"underline hover:text-foreground",children:"Privacy Policy"}),"."]})]})]})})})}export{A as RegisterPage};
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.