1import{f as _,r as c,u as z,j as e,L as w}from"./react-vendor-DwPZuQ7h.js";import{ak as A,aa as E,ab as I,q as F,ad as L,aj as R,a8 as D,e as M,ae as N,af as $,ag as B,al as H,am as T}from"./index-CxzsQ6aB.js";import{A as G}from"./AppleSignInButton-BYNb7L1u.js";import{E as O}from"./eye-off-B6qwzJsN.js";import{E as q}from"./eye-Tjk1bByM.js";import"./i18n-vendor-7j51uk6n.js";const k=["starter","pro","elite"],y=({icon:p,label:r,name:s,type:u="text",placeholder:a,required:v=!0,half:m=!1,formData:l,handleChange:x,focusedField:o,setFocusedField:h,showPassword:n,setShowPassword:g})=>{const i=u==="password",j=i&&n?"text":u;return e.jsxs("div",{className:"",children:[e.jsx("label",{htmlFor:`register-${s}`,className:"block text-[11px] font-semibold mb-1.5 ml-0.5",style:{color:"var(--text-muted)"},children:r}),e.jsxs("div",{className:"relative",children:[e.jsx(p,{size:15,className:"absolute left-3.5 top-1/2 -translate-y-1/2 pointer-events-none transition-colors",style:{color:o===s?"var(--brand-text)":"var(--text-muted)"}}),e.jsx("input",{id:`register-${s}`,type:j,name:s,autoComplete:s==="email"?"email":s==="full_name"?"name":i?"new-password":void 0,value:l[s],onChange:x,onFocus:()=>h(s),onBlur:()=>h(""),className:`w-full pl-10 ${i?"pr-11":"pr-4"} py-3 rounded-xl text-sm outline-none transition-all border`,style:{background:"var(--glass-bg)",borderColor:o===s?"rgba(163,230,53,0.4)":"var(--border-subtle)",color:"var(--text-primary)",boxShadow:o===s?"0 0 0 3px rgba(163,230,53,0.08)":"none"},placeholder:a,required:v}),i&&g&&e.jsx("button",{type:"button",onClick:()=>g(!n),className:"absolute right-3 top-1/2 -translate-y-1/2 p-0.5 rounded transition-colors",style:{color:"var(--text-muted)"},"aria-label":n?"Hide password":"Show password",children:n?e.jsx(O,{size:15}):e.jsx(q,{size:15})})]})]})};function X(){const[p]=_(),r=(p.get("plan")||"").toLowerCase(),s=!!(p.get("ref")||A());c.useEffect(()=>{if(E(),I("/register"),k.includes(r))try{sessionStorage.setItem("mc_selected_plan",r)}catch{}},[r]);const u=()=>{let t=k.includes(r)?r:null;if(!t)try{t=sessionStorage.getItem("mc_selected_plan")}catch{}return t?`/billing?plan=${encodeURIComponent(t)}`:"/dashboard"},[a,v]=c.useState({full_name:"",email:"",password:"",confirmPassword:""}),[m,l]=c.useState(""),[x,o]=c.useState(!1),[h,n]=c.useState(!1),[g,i]=c.useState(""),j=z(),{login:S}=F(),C=t=>{v({...a,[t.target.name]:t.target.value})},P=async t=>{if(t.preventDefault(),l(""),a.password!==a.confirmPassword){l("Passwords do not match");return}if(a.password.length<6){l("Password must be at least 6 characters");return}o(!0);try{const f=await fetch("/api/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({full_name:a.full_name,email:a.email,password:a.password,acquisition_source:T(),attribution:H()})}),d=await f.json();if(!f.ok)throw new Error(d.error||"Registration failed");if(!d.token||!d.user)throw new Error("Registration failed. Please try again.");S(d.token,d.user);try{sessionStorage.setItem("show_newsletter_popup","1")}catch{}j(u())}catch(f){l(f.message)}finally{o(!1)}},b={formData:a,handleChange:C,focusedField:g,setFocusedField:i,showPassword:h,setShowPassword:n};return e.jsxs("div",{className:"min-h-screen relative flex items-center justify-center p-4 md:p-8",style:{background:"var(--bg-deep)"},children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-1/3 -right-1/3 w-2/3 h-2/3 rounded-full opacity-[0.06]",style:{background:"radial-gradient(circle, #a3e635 0%, transparent 70%)",animation:"pulse 10s ease-in-out infinite"}}),e.jsx("div",{className:"absolute -bottom-1/3 -left-1/3 w-2/3 h-2/3 rounded-full opacity-[0.04]",style:{background:"radial-gradient(circle, #a3e635 0%, transparent 70%)",animation:"pulse 14s ease-in-out infinite reverse"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:"linear-gradient(rgba(163,230,53,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(163,230,53,0.3) 1px, transparent 1px)",backgroundSize:"60px 60px"}})]}),e.jsxs("div",{className:"relative z-10 w-full max-w-[420px]",children:[e.jsxs("div",{className:"text-center mb-8 animate-fade-in-up",children:[e.jsx("div",{className:"flex justify-center mb-5",children:e.jsx(L,{size:56,variant:"icon"})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-black tracking-tight mb-1.5",style:{color:"var(--text-primary)"},children:"Create your account"}),e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Free to sign up · run agents from $1 for your first 24 hours"}),s&&e.jsx("p",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-[13px] font-semibold",style:{background:"var(--accent-soft)",color:"var(--accent-text)"},children:"ð A friend invited you: you both get 50 free credits"})]}),e.jsxs("div",{className:"rounded-2xl p-6 md:p-8 border shadow-2xl animate-fade-in-up",style:{background:"var(--bg-elevated)",borderColor:"var(--border-subtle)",animationDelay:"0.1s",boxShadow:"0 25px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle)"},children:[e.jsxs("button",{type:"button",onClick:()=>{R()},className:"w-full flex items-center justify-center gap-3 py-3.5 rounded-xl font-semibold text-sm transition-all border hover:shadow-lg active:scale-[0.98]",style:{background:"var(--glass-bg)",borderColor:"var(--border-subtle)",color:"var(--text-primary)"},children:[e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",children:[e.jsx("path",{d:"M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.874 2.684-6.615z",fill:"#4285f4"}),e.jsx("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z",fill:"#34a853"}),e.jsx("path",{d:"M3.964 10.712c-.18-.54-.282-1.117-.282-1.712s.102-1.172.282-1.712V4.956H.957A8.99
16 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.044l3.007-2.332z",fill:"#fbbc05"}),e.jsx("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.956l3.007 2.332C4.672 5.164 6.656 3.58 9 3.58z",fill:"#ea4335"})]}),"Continue with Google"]}),e.jsx(G,{}),e.jsxs("div",{className:"flex items-center gap-4 my-6",children:[e.jsx("div",{className:"h-px flex-1",style:{background:"var(--border-subtle)"}}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em]",style:{color:"var(--text-muted)"},children:"or"}),e.jsx("div",{className:"h-px flex-1",style:{background:"var(--border-subtle)"}})]}),e.jsxs("form",{onSubmit:P,className:"space-y-4",children:[m&&e.jsxs("div",{role:"alert",className:"flex items-center gap-2 p-3 rounded-xl text-sm font-medium",style:{background:"rgba(239,68,68,0.08)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.15)"},children:[e.jsx("span",{className:"shrink-0 text-xs",children:"â "}),m]}),e.jsx(y,{...b,icon:D,label:"Full Name",name:"full_name",placeholder:"John Doe"}),e.jsx(y,{...b,icon:M,label:"Email",name:"email",type:"email",placeholder:"[email protected]"}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 min-[400px]:grid-cols-2",children:[e.jsx(y,{...b,icon:N,label:"Password",name:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",half:!0}),e.jsx(y,{...b,icon:N,label:"Confirm",name:"confirmPassword",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",half:!0})]}),a.password&&e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsx("div",{className:"flex-1 h-1 rounded-full overflow-hidden",style:{background:"var(--border-subtle)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:a.password.length>=12?"100%":a.password.length>=8?"66%":a.password.length>=6?"33%":"15%",background:a.password.length>=12?"#22c55e":a.password.length>=8?"#eab308":a.password.length>=6?"#f97316":"#ef4444"}})}),e.jsx("span",{className:"text-[10px] font-medium",style:{color:a.password.length>=12?"#22c55e":a.password.length>=8?"#eab308":a.password.length>=6?"#f97316":"#ef4444"},children:a.password.length>=12?"Strong":a.password.length>=8?"Good":a.password.length>=6?"Fair":"Weak"})]}),e.jsx("button",{type:"submit",disabled:x,className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-xl font-bold text-sm text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 mt-2",style:{background:"var(--brand)",boxShadow:"0 4px 20px rgba(163, 230, 53, 0.25)"},children:x?e.jsxs(e.Fragment,{children:[e.jsx($,{size:16,className:"animate-spin","aria-hidden":!0}),e.jsx("span",{className:"sr-only",children:"Creating accountâ¦"})]}):e.jsxs(e.Fragment,{children:["Create account ",e.jsx(B,{size:15})]})}),e.jsxs("p",{className:"text-[10px] text-center leading-relaxed",style:{color:"var(--text-muted)"},children:["By creating an account, you agree to our"," ",e.jsx(w,{to:"/tos",className:"underline hover:no-underline",style:{color:"var(--text-secondary)"},children:"Terms"})," ","and"," ",e.jsx(w,{to:"/privacy",className:"underline hover:no-underline",style:{color:"var(--text-secondary)"},children:"Privacy Policy"}),"."]})]})]}),e.jsx("div",{className:"text-center mt-6 animate-fade-in-up",style:{animationDelay:"0.2s"},children:e.jsxs("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:["Already have an account?"," ",e.jsx(w,{to:"/login",className:"font-semibold hover:underline",style:{color:"var(--brand-text)"},children:"Sign in"})]})})]})]})}export{X 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.