PageSourceSearch

https://thalio.ai/assets/auth-BDVcS-5z.js

js thalio.ai collected 2026-10-04 17:55:38 UTC 8,599 bytes, 1 lines download raw bytes

1import{c as U,u as te,a as ae,b as re,d as ie,e as ne,f as oe,r as t,i as le,R as ce,j as e,g as de,T as ue,B as R,L as _,s as L,t as a}from"./index-B6paN9hX.js";import{C as T,a as P,b as q,c as z,d as A}from"./card-BgSbBE2p.js";import{I as g}from"./input-BZd0Y6Li.js";import{L as h}from"./label-BWzqZyYA.js";import{T as me,a as fe,b as F,c as V}from"./tabs-DXyZAIml.js";import{M}from"./mail-CaXawCu0.js";const ge=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8",key:"1sqzm4"}],["path",{d:"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5",key:"kc0143"}],["rect",{x:"3",y:"7",width:"18",height:"4",rx:"1",key:"1hberx"}]],he=U("gift",ge);const pe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],D=U("lock",pe),B="thalio_referral_code",xe=10080*60*1e3,O="thalio_acquisition_source";function Se(){const{user:p,signIn:Y,signUp:H,resendVerification:W}=te(),{subscription:v,isLoading:b}=ae(),{brand:j,isLoading:y}=re(),l=ie(),i=ne(),[d]=oe(),N=i.state&&typeof i.state=="object"?i.state:void 0,w=d.get("source")||N?.acquisitionSource||(typeof window<"u"?localStorage.getItem(O):null),S=(()=>{const s=d.get("ref");if(s)return s;if(typeof window>"u")return null;try{const r=localStorage.getItem(B);if(!r)return null;const{code:x,ts:se}=JSON.parse(r);return Date.now()-se<xe?x:null}catch{return null}})(),[J,K]=t.useState(d.get("tab")==="sign-up"||w||S?"sign-up":"sign-in"),[n,C]=t.useState(N?.email??""),[u,E]=t.useState(""),[c,o]=t.useState(!1),[m]=t.useState(S),[$,k]=t.useState(!1),[G,I]=t.useState(!1),[f]=t.useState(w);t.useEffect(()=>{if(!p)return;if(le(p.email)){l(ce,{replace:!0});return}if(b||y)return;const s=i.state&&typeof i.state=="object"&&"from"in i.state?i.state.from:void 0;if(s&&typeof s=="string"){l(s,{replace:!0});return}j?.onboarding_complete?v?l("/dashboard",{replace:!0}):l("/onboarding-v2/plan-select",{replace:!0}):l("/onboarding-v2/brand-identity",{replace:!0})},[p,v,j,b,y,l,i.state]),t.useEffect(()=>{f&&localStorage.setItem(O,f)},[f]),t.useEffect(()=>{const s=d.get("ref");s&&localStorage.setItem(B,JSON.stringify({code:s,ts:Date.now()}))},[d]),t.useEffect(()=>{if(!m)return;let s=!1;return(async()=>{try{const{data:x}=await L.rpc("validate_referral_code",{code:m});s||k(!!x)}catch{s||k(!1)}})(),()=>{s=!0}},[m]);const Q=async s=>{s.preventDefault(),o(!0);const{error:r}=await Y(n,u);o(!1),r&&(r.message.includes("Email not confirmed")?(I(!0),a.error("Please verify your email before signing in.")):a.error(r.message))},X=async s=>{if(s.preventDefault(),u.length<6){a.error("Password must be at least 6 characters.");return}o(!0);const{error:r}=await H(n,u,f?{acquisition_source:f}:void 0);if(o(!1),r){a.error(r.message);return}a.success("Check your email for a verification link!"),I(!0)},Z=async()=>{if(!n){a.error("Enter your email address first.");return}o(!0);const{error:s}=await L.auth.resetPasswordForEmail(n,{redirectTo:`${window.location.origin}/auth?tab=reset`});o(!1),s?a.error(s.message):a.success("Password reset email sent! Check your inbox.")},ee=async()=>{if(!n){a.error("Enter your email address first.");return}o(!0);const{error:s}=await W(n);o(!1),s?a.error(s.message):a.success("Verification email sent!")};return e.jsxs("div",{className:"flex min-h-svh",children:[e.jsx("div",{className:"hidden w-1/2 items-center justify-center bg-gradient-to-br from-sand via-secondary to-muted lg:flex",children:e.jsxs("div",{className:"max-w-md space-y-6 p-12",children:[e.jsx(de,{className:"size-14"}),e.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Content that converts, powered by AI."}),e.jsx("p",{className:"text-base leading-relaxed text-muted-foreground",children:"Thalio generates scroll-stopping scripts, renders branded videos, and tracks what resonates — all tailored to your med spa's voice."}),e.jsx("div",{className:"h-1 w-16 rounded-full bg-gradient-to-r from-coral to-jade","aria-hidden":"true"})]})}),e.jsx("div",{className:"flex flex-1 items-center justify-center p-6 md:p-10",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsx("div",{className:"flex items-center gap-2 lg:hidden",children:e.jsx(ue,{size:"lg"})}),$&&m&&e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-jade/30 bg-jade/5 p-3",children:[e.jsx(he,{className:"size-5 text-accent"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"You've been invited!"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sign up with founding access code ",e.jsx("strong",{children:m})]})]})]}),e.jsxs(me,{value:J,onValueChange:K,children:[e.jsxs(fe,{className:"w-full",children:[e.jsx(F,{value:"sign-in",className:"cursor-pointer",children:"Sign In"}),e.jsx(F,{value:"sign-up",className:"cursor-pointer",children:"Sign Up"})]}),e.jsx(V,{value:"sign-in",children:e.jsxs(T,{children:[e.jsxs(P,{children:[e.jsx(q,{children:"Welcome back"}),e.jsx(z,{children:"Sign in to your Thalio account"})]}),e.jsxs(A,{children:[e.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signin-email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(g,{id:"signin-email",type:"email",placeholder:"[email protected]",value:n,onChange:s=>C(s.target.value),className:"pl-9",required:!0,autoComplete:"email"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signin-password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(D,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(g,{id:"signin-password",type:"password",value:u,onChange:s=>E(s.target.value),className:"pl-9",required:!0,autoComplete:"current-password"})]})]}),e.jsxs(R,{type:"submit",className:"w-full cursor-pointer",disabled:c,
1children:[c&&e.jsx(_,{className:"mr-2 size-4 animate-spin"}),"Sign In"]}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:Z,className:"cursor-pointer rounded-sm text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",disabled:c,children:"Forgot your password?"})})]}),G&&e.jsx("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 p-3 text-center",children:e.jsxs("p",{className:"text-sm text-amber-800",children:["Didn't get the email?"," ",e.jsx("button",{type:"button",onClick:ee,className:"cursor-pointer rounded-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",disabled:c,children:"Resend verification"})]})})]})]})}),e.jsx(V,{value:"sign-up",children:e.jsxs(T,{children:[e.jsxs(P,{children:[e.jsx(q,{children:"Create your account"}),e.jsx(z,{children:"Start your free 30-day founding pilot — no card"})]}),e.jsx(A,{children:e.jsxs("form",{onSubmit:X,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signup-email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(g,{id:"signup-email",type:"email",placeholder:"[email protected]",value:n,onChange:s=>C(s.target.value),className:"pl-9",required:!0,autoComplete:"email"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signup-password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(D,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(g,{id:"signup-password",type:"password",placeholder:"6+ characters",value:u,onChange:s=>E(s.target.value),className:"pl-9",required:!0,minLength:6,autoComplete:"new-password"})]})]}),e.jsxs(R,{type:"submit",className:"w-full cursor-pointer",disabled:c,children:[c&&e.jsx(_,{className:"mr-2 size-4 animate-spin"}),"Create Account & Continue"]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["By signing up, you agree to our"," ",e.jsx("a",{href:"/terms",className:"rounded-sm underline underline-offset-4 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:"Terms of Service"})]})]})})]})})]})]})})]})}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.