1import{u as _,f as q,r as n,j as e,h as j,i as b,B as o,k as C,l as P,m as N,I as y,n as B,G,L as S,g as t}from"./index-DLd_kDlx.js";import{L as h}from"./label-D4-ENrYn.js";import{L}from"./Layout-B4HKaXoo.js";import{I as M,a as U,b as c}from"./input-otp-lmz2zhuN.js";import{A as z}from"./arrow-left-BXtn7MCa.js";import{M as J}from"./mail-BVn2o8AP.js";import{L as k}from"./loader-circle-D2miE2xB.js";import{U as X}from"./users-round-DunEH6L6.js";const se=()=>{_();const{signup:T,verifySignupOtp:O,resendSignupOtp:I}=q(),[l,i]=n.useState(!1),[E,x]=n.useState(!1),[u,F]=n.useState(""),[d,p]=n.useState(""),[m,f]=n.useState(0),[w,V]=n.useState(!1),[r,v]=n.useState({email:"",password:"",confirmPassword:""}),R=async s=>{if(s.preventDefault(),r.password!==r.confirmPassword){t.error("Passwords don't match");return}if(r.password.length<6){t.error("Password must be at least 6 characters");return}i(!0);try{await T(r.email,r.password,"tech_lead"),F(r.email),x(!0),v({email:"",password:"",confirmPassword:""}),t.success("Verification code sent!",{description:"Please check your email for the 6-digit verification code."})}catch(a){console.error("Sign up error:",a),t.error("Sign up failed",{description:a.message||"Please try again."})}finally{i(!1)}},A=async s=>{if(s.preventDefault(),d.length!==6){t.error("Please enter the complete 6-digit code");return}i(!0);try{await O(u,d,"tech_lead"),t.success("Email verified successfully!",{description:"Welcome! Redirecting to your dashboard..."}),x(!1),p("")}catch(a){console.error("OTP verification error:",a),t.error("Verification failed",{description:a.message||"Please check your code and try again."})}finally{i(!1)}},D=async()=>{if(!(m>0)){i(!0);try{await I(u,"tech_lead"),t.success("New code sent!",{description:"Please check your email for a new verification code."}),f(60);const s=setInterval(()=>{f(a=>a<=1?(clearInterval(s),0):a-1)},1e3)}catch(s){console.error("Resend OTP error:",s),t.error("Failed to resend code",{description:s.message||"Please try again."})}finally{i(!1)}}},g=s=>{v(a=>({...a,[s.target.name]:s.target.value}))};return E?e.jsx(L,{children:e.jsx("div",{className:"container max-w-md py-16 md:py-24",children:e.jsxs(j,{className:"shadow-lg border-0 bg-card/95 backdrop-blur-sm",children:[e.jsxs(b,{className:"text-center pb-6",children:[e.jsxs("div",{className:"flex items-center justify-center mb-4",children:[e.jsxs(o,{variant:"ghost",size:"sm",onClick:()=>{x(!1),p(""),f(0)},className:"absolute left-4 top-4",children:[e.jsx(z,{className:"h-4 w-4 mr-2"}),"Back"]}),e.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center",children:e.jsx(J,{className:"h-6 w-6 text-primary"})})]}),e.jsx(C,{className:"text-2xl font-bold",children:"Verify Your Email"}),e.jsxs(P,{children:["Enter the 6-digit code sent to ",u]})]}),e.jsx(N,{children:e.jsxs("form",{onSubmit:A,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"otp",className:"text-sm font-medium",children:"Verification Code"}),e.jsx("div",{className:"flex justify-center",children:e.jsx(M,{value:d,onChange:p,maxLength:6,className:"gap-2",children:e.jsxs(U,{className:"gap-2",children:[e.jsx(c,{index:0,className:"w-12 h-12 text-lg"}),e.jsx(c,{index:1,className:"w-12 h-12 text-lg"}),e.jsx(c,{index:2,className:"w-12 h-12 text-lg"}),e.jsx(c,{index:3,className:"w-12 h-12 text-lg"}),e.jsx(c,{index:4,className:"w-12 h-12 text-lg"}),e.jsx(c,{index:5,className:"w-12 h-12 text-lg"})]})})})]}),e.jsx(o,{type:"submit",className:"w-full h-11 font-medium",disabled:l||d.length!==6,children:l?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):"Verify Email"}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Didn't receive the code?"}),e.jsx(o,{type:"button",variant:"ghost",onClick:D,disabled:m>0||l,className:"text-primary",children:m>0?`Resend in ${m}s`:"Resend Code"})]})]})})]})})}):e.jsx(L,{children:e.jsxs("div",{className:"container max-w-xl py-16 md:py-24",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-slate-100",children:e.jsx(X,{className:"h-8 w-8 text-xterns-navy"})}),e.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Join as a Tech Lead"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Mentor xterns, manage pods, and build the next generation of tech talent through Xterns.ai"})]}),e.jsxs(j,{className:"shadow-lg border-0 bg-card/95 backdrop-blur-sm",children:[e.jsxs(b,{className:"text-center pb-6",children:[e.jsx(C,{className:"text-2xl font-bold",children:"Create Your Tech Lead Account"}),e.jsx(P,{children:"Start mentoring and leading pods"})]}),e.jsxs(N,{className:"space-y-6",children:[e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),e.jsx(y,{id:"email",name:"email",type:"email",placeholder:"Enter your email address",value:r.email,onChange:g,required:!0,className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),e.jsx(y,{id:"password",name:"password",type:"password",placeholder:"Create a password (min. 6 characters)",value:r.password,onChange:g,required:!0,minLength:6,className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"confirmPassword",className:"text-sm font-medium",children:"Confirm Password"}),e.jsx(y,{id:"confirmPassword",name:"confirmPassword",type:"password",placeholder:"Confirm your password",value:r.confirmPassword,onChange:g,required:!0,className:"h-11"})]}),e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(B,{id:"terms",checked:w,onCheckedChange:s=>V(s===!0)}),e.jsxs("label",{htmlFor:"terms",className:"text-sm text-muted-foreground leading-tight cursor-pointer",children:["I agree to the"," ",e.jsx("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline font-medium",children:"Terms of Service"})]})]}),e.jsx(o,{type:"submit",className:"h-11 w-full bg-xterns-navy font-medium hover:bg-xterns-navy2",disabled:l||!w,children:l?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Create Tech Lead Account"})]}),e.jsx(j,{className:"bg-secondary/50 border-primary/20",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx(G,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium text-sm",children:"Looking to learn?"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Join as an xtern to access projects, mentorship, and career opportunities."}),e.jsx(S,{to:"/signup",children:e.jsx(o,{variant:"link",size:"sm",className:"p-0 h-auto text-primary",children:"Sign up as Xtern â"})})]})]})})}),e.jsx("div",{className:"text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Already have an account?"," ",e.jsx(S,{to:"/login",className:"text-primary hover:underline font-medium",children:"Sign in"})]})})]})]})]})})};export{se 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.