PageSourceSearch

https://whisperai.com/assets/auth-page-BGZr_4g-.js

js whisperai.com collected 2026-10-01 11:42:36 UTC 34,509 bytes, 1 lines download raw bytes

1import{u as Oe,r as c,j as e,d as _e,L as qe}from"./react-vendor-jUbs3Udp.js";import{e as Ue,g as F,H as De,B as m,C as H,b as V,c as B,f as se,d as z,L as f,I as x,q as R,t as He,h as we,i as ve,j as ye,k as Ve,l as Be,s as ze,m as $e,n as We,r as Ge}from"./index-gcDjpmFZ.js";import{u as Je}from"./query-vendor-DSnlNft5.js";import{S as Ye,a as Qe,b as Ke,c as Xe,d as h}from"./select-DvkV6m6v.js";import{T as Ze,a as et,b as je,c as be}from"./tabs-D9w5CYQh.js";import{M as tt,A as st,L}from"./icons-Cjebwm3l.js";import"./ui-vendor-DDR7ojRs.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"2156d85cf031d709fa1b379f59bedaa6c159aa65"};var C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="12caa510-7d74-4932-9c6d-6ddd12d93bcb",a._sentryDebugIdIdentifier="sentry-dbid-12caa510-7d74-4932-9c6d-6ddd12d93bcb")}catch{}})();function ae(a,C){return a instanceof Error?a.message:C}function re(){return e.jsxs("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 21 21",children:[e.jsx("path",{fill:"#f25022",d:"M1 1h9v9H1z"}),e.jsx("path",{fill:"#7fba00",d:"M11 1h9v9h-9z"}),e.jsx("path",{fill:"#00a4ef",d:"M1 11h9v9H1z"}),e.jsx("path",{fill:"#ffb900",d:"M11 11h9v9h-9z"})]})}function at(){return e.jsxs("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}function ht(){const{toast:a}=Ue(),[,C]=Oe(),[w,u]=c.useState(!1),[ie,A]=c.useState(!1),[$,O]=c.useState("request"),[ne,W]=c.useState(null),[oe,k]=c.useState("register"),[_,G]=c.useState(!1),[q,J]=c.useState(""),[b,Y]=c.useState(null),[le,Ne]=c.useState(null),[M,I]=c.useState(null),[Se,ke]=c.useState(!1),ce=async t=>{const s=Ge(new URLSearchParams(window.location.search)),r=s?`/api/auth/${t}?returnTo=${encodeURIComponent(s)}`:`/api/auth/${t}`,n=ve(),l=ye(),v=l["X-Whisprai-Anon-Id"];if(n||v)try{await Promise.race([fetch("/api/v2/auth/attribution",{method:"POST",headers:{"Content-Type":"application/json",...l},body:JSON.stringify(n??{}),credentials:"include",keepalive:!0}),new Promise(g=>setTimeout(g,800))])}catch{}window.location.href=r},Q=()=>ce("google"),K=()=>ce("microsoft");console.log("Auth page state:",{verificationMode:_,registrationEmail:q,activeTab:oe}),console.log("Form will use handler:",_?"handleVerifyCode":"handleSendVerificationCode");const[rt,it]=c.useState(!1),[Pe,Ce]=c.useState(!1),U=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,de=U.get("firstName")??"",ue=U.get("lastName")??"",me=U.get("email")??"",he=U.get("inviteToken"),[i,pe]=c.useState({firstName:de,lastName:ue,email:me,password:"",confirmPassword:"",industry:"",industryOther:""}),Te=()=>{let t=1;return de.trim().length>=2&&(t=2),t===2&&ue.trim().length>=2&&(t=3),t===3&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(me)&&(t=4),t},[N,ge]=c.useState(Te),S=(t,s)=>{switch(t){case"firstName":case"lastName":return s.trim().length>=2;case"email":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);case"password":return s.length>=6;case"confirmPassword":return s===i.password&&s.length>=6;case"industry":return s!=="";default:return!1}},P=(t,s)=>{const r={...i,[t]:s};if(pe(r),S(t,s)){const n=N+1;n<=6&&setTimeout(()=>ge(n),300)}},fe=c.useCallback(async t=>{try{const s=await fetch("/api/v2/password-reset/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})});if(!s.ok){const r=await s.json();a({title:"Invalid Reset Link",description:r.message||"This reset link is invali
1d or has expired",variant:"destructive"}),A(!1),O("request"),W(null),window.history.pushState({},"","/auth")}}catch{a({title:"Error",description:"Failed to validate reset link",variant:"destructive"})}},[a]);c.useEffect(()=>{const t=new URLSearchParams(window.location.search),s=t.get("reset"),r=t.get("token"),n=t.get("tab"),l=t.get("error"),g=l?{microsoft_account_exists:"A WhisperAI account already uses this email. Sign in with your existing method, then connect Microsoft from Account Settings.",microsoft_email_required:"Microsoft did not provide an email address. Use another sign-in method or add an email to your Microsoft account and try again.",recent_auth_required:"For security, sign out and sign in again before connecting Microsoft.",microsoft_link_session_changed:"Your sign-in session changed while connecting Microsoft. Please try again.",microsoft_identity_mismatch:"Use the Microsoft account already connected to this WhisperAI account.",oauth_failed:"Single sign-on could not be completed. Please try again."}[l]:void 0;if(g){Ne(g),k("login"),a({title:l==="oauth_failed"?"Sign-In Failed":"Microsoft Sign-In Failed",description:g,variant:"destructive"});const d=new URL(window.location.href);d.searchParams.delete("error"),window.history.replaceState({},"",`${d.pathname}${d.search}${d.hash}`)}const y=s||r;y&&(A(!0),O("verify"),W(y),fe(y));const o=window.location.pathname;o==="/signin"||n==="signin"?k("login"):o==="/signup"&&k("register"),t.get("email")&&o==="/signup"&&k("register")},[a,fe]);const{data:Ee}=Je({queryKey:["/api/v2/auth/user"],queryFn:async()=>{const t=await fetch("/api/v2/auth/user",{credentials:"include"});if(t.status===401)return null;if(!t.ok)throw new Error("Failed to get user");return t.json()},retry:!1});if(Ee){const t=new URLSearchParams(window.location.search).get("returnTo"),s=F(t);return e.jsx(_e,{to:s||"/dashboard"})}const Re=async t=>{t.preventDefault(),u(!0),Y(null);const s=new FormData(t.currentTarget),r=s.get("email"),n=s.get("password");console.log("Login attempt:",{email:r,password:"***"});try{const l=await fetch("/api/v2/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r,password:n}),credentials:"include"});if(!l.ok){const o=await l.json(),p=o.error==="google_sso_required"?"google":o.error==="microsoft_sso_required"?"microsoft":o.error==="sso_required"&&(o.provider==="google"||o.provider==="microsoft")?o.provider:null;if(p){Y(p);const d=p==="google"?"Google":"Microsoft";a({title:`Use Continue with ${d}`,description:o.message||`This email is registered with ${d}.`});return}if(o.code==="EMAIL_NOT_VERIFIED"||o.code==="EMAIL_VERIFICATION_REQUIRED"){G(!0),J(r),a({title:"Email Verification Required",description:"Enter your verification code, or request a new one.",variant:"default"});return}if(o.code==="SIGNUP_RESTART_REQUIRED"){k("register"),pe(d=>({...d,email:r})),ge(4),a({title:"Complete Your Signup",description:o.message||"Please enter your account details again to finish signup."});return}throw new Error(o.error||"Login failed")}const v=await l.json();R.setQueryData(["/api/v2/auth/user"],v),He("login_completed",{method:"email"}),a({title:"Success",description:"Welcome back!"});const g=new URLSearchParams(window.location.search),y=g.get("inviteToken");if(y)window.location.href=`/invite/${y}`;else{const o=g.get("returnTo"),p=F(o);C(p||"/dashboard")}}catch(l){a({title:"Login Failed",description:ae(l,"Login failed"),variant:"destructive"})}finally{u(!1)}},Ae=async t=>{t.preventDefault(),u(!0);const s=new FormData(t.currentTarget),r=j=>s.get(j)??"",n=r("email")||i.email,l=r("password")||i.password,v=r("confirmPassword")||i.confirmPassword,g=r("firstName")||i.firstName,y=r("lastName")||i.lastName,o=r("hearAboutUs"),p=r("hearAboutUsOther"),d=r("industry"),T=r("industryOther"),E=o==="other"&&p?`Other: ${p}`:o,D=d==="Other (Please Specify)"&&T?T:d;if(!g.trim()){a({title:"Error",description:"First name is required",variant:"destructive"}),u(!1);return}if(!y.trim()){a({title:"Error",description:"Last name is required",variant:"destructive"}),u(!1);return}if(!n.trim()){a({title:"Error",description:"Email is required",variant:"destructive"}),u(!1);return}if(!d){a({title:"Error",description:"Please select your industry",variant:"destructive"}),u(!1);return}if(l!==v){a({title:"Error",description:"Passwords do not match",variant:"destructive"}),u(!1);return}try{const j=new URLSearchParams(window.location.search),X=j.get("inviteToken"),Z=j.get("claimToken"),ee=F(j.get("returnTo")),Le=X?"invite":Z?"landing_demo":we(ee)?"developer_api":"auth_page",xe=await fetch("/api/v2/auth/register",{method:"POST",headers:{"Content-Type":"application/json",...ye()},body:JSON.stringify({email:n,password:l,firstName:g,lastName:y,hearAboutUs:E,industry:D,attribution:ve()??void 0,signupSource:Le}),credentials:"include"}),te=await xe.json().catch(()=>({}));if(!xe.ok){if(te.code==="USER_EXISTS"){k("login"),a({title:"Account Already Exists",description:"An account with this email already exists. Please sign in instead."});return}throw new Error(te.error||"Failed to start registration")}J(te.email||n),G(!0),a({title:"Verification Code Sent",description:"Please check your email for the verification code"})}catch(j){a({title:"Error",description:ae(j,"An error occurred"),variant:"destructive"})}finally{u(!1)}},Me=async t=>{u(!0);try{const s=await fetch("/api/v2/password-reset/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})}
1),r=await s.json();s.ok?(a({title:"Reset Link Sent",description:r.message}),O("request")):a({title:"Error",description:r.error||"Failed to send reset email",variant:"destructive"})}catch{a({title:"Error",description:"Network error occurred",variant:"destructive"})}finally{u(!1)}},Ie=async t=>{if(ne){u(!0);try{const s=await fetch("/api/v2/password-reset/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:ne,newPassword:t})}),r=await s.json();s.ok?(a({title:"Password Reset Successful",description:"Your password has been updated. You can now sign in."}),A(!1),O("request"),W(null),window.history.pushState({},"","/auth")):a({title:"Error",description:r.error||"Failed to reset password",variant:"destructive"})}catch{a({title:"Error",description:"Network error occurred",variant:"destructive"})}finally{u(!1)}}},Fe=async t=>{t.preventDefault(),u(!0);const r=new FormData(t.currentTarget).get("verificationCode");try{const n=await fetch("/api/v2/account/verify-email-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:q,code:r}),credentials:"include"}),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error||"Verification failed");if(!l.user)throw new Error("Please return to signup and enter your account details again.");const v=new URLSearchParams(window.location.search),g=v.get("inviteToken"),y=v.get("
1claimToken"),o=F(v.get("returnTo")),p=v.get("provider")==="microsoft"?"microsoft":null,d=g?"invite":y?"landing_demo":we(o)?"developer_api":"auth_page",T=l.user;R.setQueryData(["/api/v2/auth/user"],T),R.invalidateQueries({queryKey:["/api/v2/recordings/paginated"]}),R.invalidateQueries({queryKey:["/api/v2/orgs"]}),R.invalidateQueries({queryKey:["/api/v2/account/usage"]}),R.invalidateQueries({queryKey:["/api/v2/auth/user"]}),a({title:"Success",description:"Account created successfully!"});const E=new URLSearchParams(window.location.search),D=E.get("inviteToken"),j=E.get("claimToken"),X=E.get("action")??"",Z=E.get("returnTo"),ee=F(Z);if(Ve({user:T,signUpMethod:p??"email",signupSource:p?"microsoft_oauth":d}),Be(ze(T),"signup_completed",{method:p??"email",surface:p?"oauth_callback":d}),D){window.location.href=`/invite/${D}`;return}if(j&&X!=="longer"){try{await fetch("/api/v2/demo/claim",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j}),credentials:"include"})}catch{}$e()}window.location.href=We(ee)}catch(n){a({title:"Verification Failed",description:ae(n,"Verification failed"),variant:"destructive"})}finally{u(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(De,{children:[e.jsx("title",{children:"Professional Audio Transcription - WhisperAI"}),e.jsx("meta",{name:"description",content:"Sign up for WhisperAI's professional audio transcription service. AI-powered speech-to-text conversion with industry-leading accuracy and lightning-fast turnaround."}),e.jsx("meta",{property:"og:title",content:"Professional Audio Transcription - WhisperAI"}),e.jsx("meta",{property:"og:description",content:"Sign up for WhisperAI's professional audio transcription service. AI-powered speech-to-text conversion with industry-leading accuracy and lightning-fast turnaround."}),e.jsx("meta",{name:"twitter:title",content:"Professional Audio Transcription - WhisperAI"}),e.jsx("meta",{name:"twitter:description",content:"Sign up for WhisperAI's professional audio transcription service. AI-powered speech-to-text conversion with industry-leading accuracy and lightning-fast turnaround."})]}),e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[e.jsx("header",{className:"bg-white/80 backdrop-blur-md border-b border-gray-200 sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16 gap-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-indigo-500 to-violet-500 rounded-lg flex items-center justify-center",children:e.jsx(tt,{className:"text-white text-sm"})}),e.jsx("span",{className:"text-xl font-bold text-gray-900 truncate",children:"WhisperAI"})]}),e.jsx(qe,{href:"/",children:e.jsxs(m,{variant:"ghost",className:"flex items-center space-x-2 text-sm text-gray-600 hover:text-gray-900 shrink-0 px-2 sm:px-4",children:[e.jsx(st,{className:"w-4 h-4"}),e.jsx("span",{children:"Back to Home"})]})})]})})}),e.jsxs("div",{className:"flex-1 flex min-w-0",children:[e.jsx("div",{className:"hidden lg:flex w-2/5 bg-gray-50 dark:bg-gray-900 items-center justify-center p-12","data-testid":"auth-marketing-panel",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("div",{className:"mb-8",children:he?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-indigo-50 dark:bg-indigo-950 px-3 py-1 text-xs font-medium text-indigo-700 dark:text-indigo-300 mb-4",children:"You've been invited to a team"}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4 leading-tight",children:"Join your team on WhisperAI"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-8 leading-relaxed",children:"Create your account to accept the invitation. Your team owner already covers your seat — no plan to choose."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4 leading-tight",children:"Welcome to WhisperAI"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-8 leading-relaxed",children:"Transcribe audio with industry-leading accuracy and lightning-fast turnaround."})]})}),e.jsxs("div",{className:"space-y-4 mb-8",children:[e.jsxs("div",{className:"flex items-center text-gray-800 dark:text-gray-200",children:[e.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-green-600 mr-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e.jsx("span",{className:"font-medium",children:"Professional-grade transcription"})]}),e.jsxs("div",{className:"flex items-center text-gray-800 dark:text-gray-200",children:[e.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-green-600 mr-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e.jsx("span",{className:"font-medium",children:"Speaker labels & timestamps"})]}),e.jsxs("div",{className:"flex items-center text-gray-800 dark:text-gray-200",children:[e.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-green-600 mr-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e.jsx("span",{className:"font-medium",children:"Upload or record live"})]}),e.jsxs("div",{className:"flex items-center text-gray-800 dark:text-gray-200",children:[e.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-green-600 mr-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e.jsx("span",{className:"font-medium",children:"Unlimited Transcription in over 100 languages"})]})]}),e.jsxs("div",{className:"flex items-start text-gray-500 dark:text-gray-400 text-sm pt-6 border-t border-gray-200 dark:border-gray-700",children:[e.jsx("svg",{"aria-hidden":"true",className:"w-4 h-4 text-blue-600 mr-2 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})}),e.jsx("span",{children:"We never sell your data. You control retention."})]})]})}),e.jsx("div",{className:"w-full lg:w-3/5 min-w-0 flex items-center justify-center lg:justify-start px-4 py-8 sm:px-6 lg:pl-8 lg:pr-12 lg:py-12 bg-white dark:bg-gray-900","data-testid":"auth-form-panel",children:e.jsxs("div",{className:"w-full max-w-md min-w-0",children:[he&&!_&&!ie&&e.jsxs("div",{className:"lg:hidden mb-6","data-testid":"auth-invite-banner-mobile",children:[e.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-indigo-50 dark:bg-indigo-950 px-3 py-1 text-xs font-medium text-indigo-700 dark:text-indigo-300 mb-4",children:"You've been invited to a team"}),e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900 dark:text-white mb-4 leading-tight",children:"Join your team on WhisperAI"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:"Create your account to accept the invitation. Your team owner already covers your seat — no plan to choose."})]}
1),_?e.jsxs(H,{children:[e.jsxs(V,{children:[e.jsx(B,{children:"Verify Your Email"}),e.jsxs(se,{className:"break-words","data-testid":"verify-email-description",children:["Enter the 6-digit verification code for ",q]})]}),e.jsx(z,{children:e.jsxs("form",{onSubmit:Fe,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"verificationCode",children:"Verification Code"}),e.jsx(x,{id:"verificationCode",name:"verificationCode",type:"text",placeholder:"Enter 6-digit code",required:!0,maxLength:6,className:"text-center text-xl sm:text-2xl tracking-widest"})]}),e.jsxs(m,{type:"submit",className:"w-full h-auto min-h-[44px] whitespace-normal","data-testid":"button-verify-email",disabled:w,children:[w?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Verify Email & Continue"]}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(m,{type:"button",variant:"ghost",className:"text-sm w-full h-auto min-h-[44px] whitespace-normal",onClick:()=>{G(!1),J("")},children:"Back to Registration"}),e.jsx(m,{type:"button",variant:"outline",className:"text-sm w-full h-auto min-h-[44px] whitespace-normal",onClick:async()=>{try{(await fetch("/api/v2/account/send-verification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:q}),credentials:"include"})).ok?a({title:"Code Resent",description:"New verification code sent to your email"}):a({title:"Error",description:"Failed to resend code",variant:"destructive"})}catch{a({title:"Error",description:"Failed to resend code",variant:"destructive"})}},children:"Resend Code"})]})]})})]}):ie?e.jsxs(H,{children:[e.jsxs(V,{children:[e.jsx(B,{children:$==="request"?"Reset Password":"Set New Password"}),e.jsx(se,{children:$==="request"?"Enter your email to receive a password reset link":"Enter your new password"})]}),e.jsx(z,{children:$==="request"?e.jsxs("form",{onSubmit:t=>{t.preventDefault();const r=new FormData(t.target).get("email");Me(r)},className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"resetEmail",children:"Email"}),e.jsx(x,{id:"resetEmail",name:"email",type:"email",placeholder:"Enter your email",required:!0})]}),e.jsxs(m,{type:"submit",className:"w-full h-auto min-h-[44px] whitespace-normal",disabled:w,children:[w?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Send Reset Link"]}),e.jsx(m,{type:"button",variant:"ghost",className:"w-full h-auto min-h-[44px] whitespace-normal",onClick:()=>A(!1),children:"Back to Sign In"})]}):e.jsxs("form",{onSubmit:t=>{t.preventDefault();const s=new FormData(t.target),r=s.get("newPassword"),n=s.get("confirmPassword");if(r!==n){a({title:"Error",description:"Passwords do not match",variant:"destructive"});return}if(r.length<6){a({title:"Error",description:"Password must be at least 6 characters",variant:"destructive"});return}Ie(r)},className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"newPassword",children:"New Password"}),e.jsx(x,{id:"newPassword",name:"newPassword",type:"password",placeholder:"Enter new password",required:!0,minLength:6})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"confirmPassword",children:"Confirm Password"}),e.jsx(x,{id:"confirmPassword",name:"confirmPassword",type:"password",placeholder:"Confirm new password",required:!0,minLength:6})]}),e.jsxs(m,{type:"submit",className:"w-full h-auto min-h-[44px] whitespace-normal",disabled:w,children:[w?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Reset Password"]})]})})]}):e.jsxs(Ze,{value:oe,onValueChange:k,className:"w-full",children:[e.jsxs(et,{className:"grid w-full grid-cols-2 h-auto min-h-[44px]",children:[e.jsx(je,{value:"register",children:"Sign Up"}),e.jsx(je,{value:"login",children:"Sign In"})]}),e.jsx(be,{value:"login",children:e.jsxs(H,{children:[e.jsxs(V,{children:[e.jsx(B,{children:"Welcome back"}),e.jsx(se,{children:"Sign in to your account"})]}),e.jsxs(z,{children:[le&&e.jsx("div",{className:"mb-4 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-900 dark:border-red-900 dark:bg-red-950/40 dark:text-red-200",role:"alert","aria-live":"assertive","data-testid":"banner-microsoft-oauth-error",children:le}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(m,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2 h-auto min-h-[44px] whitespace-normal px-3 sm:px-4",onClick:()=>void Q(),"data-testid":"button-google-signin",children:[e.jsxs("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e.jsx("span",{children:"Continue with Google"})]}),e.jsxs(m,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2 h-auto min-h-[44px] whitespace-normal px-3 sm:px-4",onClick:()=>void K(),"data-testid":"button-microsoft-signin",children:[e.jsx(re,{}),e.jsx("span",{children:"Sign in with Microsoft"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]})]}),b&&e.jsxs("div",{className:"mb-4 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-900",role:"status","aria-live":"polite","data-testid":`banner-${b}-sso-required`,children:[e.jsxs("p",{className:"mb-2 font-medium",children:["This email is registered with"," ",b==="google"?"Google":"Microsoft","."]}),e.jsxs("p",{className:"mb-3 text-blue-800",children:["Continue with"," ",b==="google"?"Google":"Microsoft"," to sign in. Prefer email and password? Use"," ",e.jsx("a",{href:"/forgot-password",className:"font-medium underline",children:"Forgot password"})," ","to set one for this account."]}),e.jsxs(m,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2 h-auto min-h-[44px] whitespace-normal",onClick:()=>void(b==="google"?Q():K()),"data-testid":`button-${b}-sso-required`,children:[b==="google"?e.jsx(at,{}):e.jsx(re,{}),e.jsxs("span",{children:["Continue with"," ",b==="google"?"Google":"Microsoft"]})]})]}),e.jsxs("form",{onSubmit:Re,className:"space-y-4",children:[(()=>{const t=new URLSearchParams(window.location.search),s=t.get("inviteToken"),r=t.get("email")??"";return s&&r?e.jsxs("div",{className:"text-xs text-indigo-700 bg-indigo-50 rounded-md p-3","data-testid":"banner-invite-signin",children:["Sign in with ",e.jsx("strong",{children:r})," to accept your team invite."]}):null})(),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"loginEmail",children:"Email"}),e.jsx(x,{id:"loginEmail",name:"email",type:"email",placeholder:"Enter your email",required:!0,"aria-describedby":M?"login-email-hint":void 0,defaultValue:new URLSearchParams(window.location.search).get("email")??"",readOnly:!!(new URLSearchParams(window.location.search).get("inviteToken")&&new URLSearchParams(window.location.search).get("email")),"data-testid":"input-signin-email",onChange:()=>{M&&I(null),b&&Y(null)},onBlur:async t=>{ke(!0);const s=t.currentTarget.value.trim();if(!s||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){I(null);return}try{const r=await fetch("/api/v2/auth/login-hint",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s})});if(!r.ok){I(null);return}const n=await r.json();I(n?.provider==="google"||n?.provider==="microsoft"?n.provider:null)}catch{I(null)}}}),Se&&M&&e.jsxs("p",{id:"login-email-hint",role:"note","aria-live":"polite",className:"text-xs text-blue-700 dark:text-blue-300","data-testid":`hint-login-${M}`,children:["You signed in with"," ",M==="google"?"Google":"Microsoft"," last time."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"loginPassword",children:"Password"}),e.jsx(x,{id:"loginPassword",name:"password",type:"password",placeholder:"Enter your password",required:!0})]}),e.jsxs(m,{type:"submit",className:"w-full h-auto min-h-[44px] whitespace-normal",disabled:w,children:[w?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign In"]}),e.jsx(m,{type:"button",variant:"link",className:"w-full p-0 h-auto text-sm",onClick:()=>A(!0),children:"Forgot your password?"})]})]})]})}
1),e.jsx(be,{value:"register",children:e.jsxs(H,{children:[e.jsx(V,{children:e.jsx(B,{children:"Create your account"})}),e.jsxs(z,{children:[e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs(m,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2 h-auto min-h-[44px] whitespace-normal px-3 sm:px-4",onClick:()=>void Q(),"data-testid":"button-google-signup",children:[e.jsxs("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e.jsx("span",{children:"Sign up with Google"})]}),e.jsxs(m,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2 h-auto min-h-[44px] whitespace-normal px-3 sm:px-4",onClick:()=>void K(),"data-testid":"button-microsoft-signup",children:[e.jsx(re,{}),e.jsx("span",{children:"Sign up with Microsoft"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]})]}),e.jsxs("form",{onSubmit:Ae,className:"space-y-4",method:"post",children:[e.jsxs("div",{className:"space-y-4",children:[N>=1&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"firstName",children:"First Name"}),e.jsx(x,{id:"firstName",name:"firstName",type:"text",placeholder:"Enter your first name",value:i.firstName,onChange:t=>P("firstName",t.target.value),required:!0,autoFocus:!0,className:S("firstName",i.firstName)?"border-green-500":""})]}),N>=2&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"lastName",children:"Last Name"}),e.jsx(x,{id:"lastName",name:"lastName",type:"text",placeholder:"Enter your last name",value:i.lastName,onChange:t=>P("lastName",t.target.value),required:!0,className:S("lastName",i.lastName)?"border-green-500":""})]}),N>=3&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"registerEmail",children:"Email"}),e.jsx(x,{id:"registerEmail",name:"email",type:"email",placeholder:"Enter your email address",value:i.email,onChange:t=>P("email",t.target.value),required:!0,className:S("email",i.email)?"border-green-500":""})]}),N>=4&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"registerPassword",children:"Password"}),e.jsx(x,{id:"registerPassword",name:"password",type:"password",placeholder:"Create a secure password (min 6 characters)",value:i.password,onChange:t=>P("password",t.target.value),required:!0,minLength:6,className:S("password",i.password)?"border-green-500":""})]}),N>=5&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"confirmPassword",children:"Confirm Password"}),e.jsx(x,{id:"confirmPassword",name:"confirmPassword",type:"password",placeholder:"Confirm your password",value:i.confirmPassword,onChange:t=>P("confirmPassword",t.target.value),required:!0,minLength:6,className:S("confirmPassword",i.confirmPassword)?"border-green-500":""}),i.confirmPassword&&i.password!==i.confirmPassword&&e.jsx("p",{className:"text-sm text-red-500",children:"Passwords don't match"})]}),N>=6&&e.jsxs("div",{className:"space-y-2 animate-in slide-in-from-bottom-4 duration-300",children:[e.jsx(f,{htmlFor:"industry",children:"Industry"}),e.jsxs(Ye,{name:"industry",required:!0,value:i.industry,onValueChange:t=>{P("industry",t),Ce(t==="Other (Please Specify)")},children:[e.jsx(Qe,{"data-testid":"select-industry-trigger",className:`h-auto min-h-[44px] py-2 text-left [&>span]:line-clamp-2 ${S("industry",i.industry)?"border-green-500":""}`,children:e.jsx(Ke,{placeholder:"Select your industry"})}),e.jsxs(Xe,{className:"max-w-[calc(100vw-2rem)]",children:[e.jsx(h,{value:"Healthcare & Medical",children:"Healthcare & Medical"}),e.jsx(h,{value:"Legal & Compliance",children:"Legal & Compliance"}),e.jsx(h,{value:"Education & Research",children:"Education & Research"}),e.jsx(h,{value:"Media & Entertainment",children:"Media & Entertainment"}),e.jsx(h,{value:"Technology & Software",children:"Technology & Software"}),e.jsx(h,{value:"Consulting & Professional Services",children:"Consulting & Professional Services"}),e.jsx(h,{value:"Financial Services (Banking, Insurance, Accounting)",children:"Financial Services (Banking, Insurance, Accounting)"}),e.jsx(h,{value:"Government & Nonprofit",children:"Government & Nonprofit"}
1),e.jsx(h,{value:"Sales & Marketing / Advertising",children:"Sales & Marketing / Advertising"}),e.jsx(h,{value:"Real Estate & Construction",children:"Real Estate & Construction"}),e.jsx(h,{value:"Manufacturing & Engineering",children:"Manufacturing & Engineering"}),e.jsx(h,{value:"Human Resources & Recruiting",children:"Human Resources & Recruiting"}),e.jsx(h,{value:"Customer Support / Call Centers",children:"Customer Support / Call Centers"}),e.jsx(h,{value:"Student",children:"Student"}),e.jsx(h,{value:"Other (Please Specify)",children:"Other (Please Specify)"})]})]}),Pe&&e.jsx("div",{className:"mt-2 animate-in slide-in-from-bottom-2 duration-200",children:e.jsx(x,{name:"industryOther",type:"text",placeholder:"Please specify your industry...",value:i.industryOther,onChange:t=>P("industryOther",t.target.value),required:!0,className:"w-full"})})]})]}),N>=6&&S("industry",i.industry)&&e.jsx("div",{className:"animate-in slide-in-from-bottom-4 duration-300",children:e.jsxs(m,{type:"submit",className:"w-full h-auto min-h-[44px] whitespace-normal",disabled:w,children:[w?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Create Account"]})}),e.jsx("p",{className:"text-xs text-gray-500 text-center",children:"By creating an account, you agree to our Terms of Service and Privacy Policy."})]})]})]})})]})]})})]})]})]})}export{ht 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.