1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a311df70-313d-4fa9-8a06-57b1959624af",e._sentryDebugIdIdentifier="sentry-dbid-a311df70-313d-4fa9-8a06-57b1959624af")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9420],{9420:(e,a,s)=>{s.r(a),s.d(a,{default:()=>P});var r=s(78568),t=s(90052),n=s(47180),l=s(99634),o=s(11079),i=s(31357),d=s(92806),c=s(72565),m=s(98214),u=s(3477),h=s(6559),x=s(76967),g=s(59232),p=s(54152),f=s(78742),j=s(24997),w=s(50360),y=s(51834),v=s(41052),b=s(65142),N=s(3998),z=s(18332),C=s(32469);let A=n.z.object({name:n.z.string().min(2,"Name must be at least 2 characters"),email:n.z.string().email("Please enter a valid email address"),organization:n.z.string().optional(),password:n.z.string().min(8,"Password must be at least 8 characters").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[a-z]/,"Password must contain at least one lowercase letter").regex(/[0-9]/,"Password must contain at least one number").regex(/[^A-Za-z0-9]/,"Password must contain at least one special character")});function P(e){let{isOpen:a,onClose:s,onSubmit:n,isProcessing:P=!1,course:k}=e,[B,S]=(0,t.useState)(!1),[I,E]=(0,t.useState)(null),[_,M]=(0,t.useState)(!1),[R,D]=(0,t.useState)(0),J=(0,j.useRouter)(),{resolvedTheme:T}=(0,w.D)(),$=(0,o.mN)({resolver:(0,l.u)(A),defaultValues:{name:"",email:"",organization:"",password:""}}),O=e=>{let a=0;return e.length>=8&&(a+=1),/[A-Z]/.test(e)&&(a+=1),/[a-z]/.test(e)&&(a+=1),/[0-9]/.test(e)&&(a+=1),/[^A-Za-z0-9]/.test(e)&&(a+=1),a};(0,t.useEffect)(()=>{let e=$.watch("password");e?D(O(e)):D(0)},[$.watch("password")]);let Z=async e=>{S(!0),E(null);try{let a=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,email:e.email,password:e.password,organization:e.organization?.trim()||void 0})});if(!a.ok){let e=await a.json();throw Error(e.message||e.error||"Something went wrong")}C.oR.success("Account created successfully!");let r=await (0,f.signIn)("credentials",{email:e.email,password:e.password,redirect:!1});if(r?.error){if(r.error.includes("2FA")||r.error.includes("two factor")){J.push(`/auth/2fa?email=${encodeURIComponent(e.email)}&new_user=true`);return}throw Error(`${r.error}`)}n&&await n({name:e.name,email:e.email,organization:e.organization||"",password:e.password}),s(),C.oR.info("Two-factor authentication has been enabled for your account. You will receive a verification code via email when signing in."),J.push("/dashboard"),J.refresh()}catch(e){e instanceof Error?E(e.message):"string"==typeof e?E(e):E("An unexpected error occurred. Please try again.")}finally{S(!1)}},V=()=>{$.reset(),E(null),s()};return(0,r.jsx)(y.lG,{open:a,onOpenChange:e=>{e||V()},children:(0,r.jsx)(y.ZJ,{children:(0,r.jsxs)(y.Cf,{className:"sm:max-w-md z-[9999] dialog-center",children:[(0,r.jsx)(y.c7,{children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"relative w-10 h-10 bg-primary/10 dark:bg-primary/20 rounded-full flex items-center justify-center overflow-hidden border border-primary/30",children:(0,r.jsx)(p.default,{src:"dark"===T?"/images/logo-light.svg":"/images/logo.svg",alt:"DataMasteryLab",width:30,height:30,className:"object-contain"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(y.L3,{className:"text-xl",children:k?`Sign Up for ${k}`:"Join DataMasteryLab"}),(0,r.jsx)(y.rr,{children:"Start your data mastery journey today"})]})]})}),I&&(0,r.jsxs)(z.Fc,{variant:"destructive",className:"mb-4",children:[(0,r.jsx)(i.A,{className:"size-4"}),(0,r.jsx)(z.TN,{children:I})]}),(0,r.jsx)(v.lV,{...$,children:(0,r.jsxs)("form",{onSubmit:$.handleSubmit(Z),className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(v.zB,{control:$.control,name:"name",render:e=>{let{field:a}=e;return(0,r.jsxs)(v.eI,{children:[(0,r.jsx)(v.lR,{children:"Full Name"}),(0,r.jsx)(v.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(d.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,r.jsx)(b.p,{placeholder:"Enter your full name",className:"pl-9",onChange:a.onChange,value:a.value,name:a.name,onBlur:a.onBlur,required:!0})]})}),(0,r.jsx)(v.C5,{})]})}}),(0,r.jsx)(v.zB,{control:$.control,name:"email",render:e=>{let{field:a}=e;return(0,r.jsxs)(v.eI,{children:[(0,r.jsx)(v.lR,{children:"Email Address"}),(0,r.jsx)(v.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,r.jsx)(b.p,{placeholder:"[email protected]",type:"email",className:"pl-9",onChange:a.onChange,value:a.value,name:a.name,onBlur:a.onBlur,required:!0})]})}),(0,r.jsx)(v.C5,{})]})}}),(0,r.jsx)(v.zB,{control:$.control,name:"organization",render:e=>{let{field:a}=e;return(0,r.jsxs)(v.eI,{children:[(0,r.jsx)(v.lR,{children:"Organization (Optional)"}),(0,r.jsx)(v.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(m.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,r.jsx)(b.p,{placeholder:"Your organization name",className:"pl-9",onChange:a.onChange,value:a.value,name:a.name,onBlur:a.onBlur})]})}),(0,r.jsx)(v.C5,{})]})}}),(0,r.jsx)(v.zB,{control:$.control,name:"password",render:e=>{let{field:a}=e;return(0,r.jsxs)(v.eI,{children:[(0,r.jsx)(v.lR,{children:"Password"}),(0,r.jsx)(v.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(u.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,r.jsx)(b.p,{placeholder:"Create a password",type:_?"text":"password",className:"pl-9",onChange:a.onChange,value:a.value,name:a.name,onBlur:a.onBlur,required:!0}),(0,r.jsx)("button",{type:"button",onClick:()=>M(!_),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:_?(0,r.jsx)(h.A,{className:"h-4 w-4"}):(0,r.jsx)(x.A,{className:"h-4 w-4"})})]})}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 mt-1",children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:"Must be at least 8 characters with uppercase, lowercase, number, and special character"}),(0,r.jsx)("div",{className:"w-full flex gap-1",children:[void 0,void 0,void 0,void 0,void 0].map((e,a)=>(0,r.jsx)("div",{className:`h-1.5 rounded-full flex-1 transition-colors ${a<R?1===R?"bg-red-500":2===R?"bg-orange-500":3===R?"bg-yellow-500":4===R?"bg-lime-500":"bg-green-500":"bg-gray-200 dark:bg-gray-700"}`},a))}),(0,r.jsxs)("div",{className:"text-xs",children:[0===R&&"Password strength: None",1===R&&(0,r.jsx)("span",{className:"text-red-500",children:"Password strength: Very weak"}),2===R&&(0,r.jsx)("span",{className:"text-orange-500",children:"Password strength: Weak"}),3===R&&(0,r.jsx)("span",{className:"text-yellow-500",children:"Password strength: Medium"}),4===R&&(0,r.jsx)("span",{className:"text-lime-500",children:"Password strength: Strong"}),5===R&&(0,r.jsx)("span",{className:"text-green-500",children:"Password strength: Very strong"})]})]}),(0,r.jsx)(v.C5,{})]})}})]}),(0,r.jsxs)(y.Es,{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[(0,r.jsx)(N.$,{type:"button",variant:"outline",onClick:V,className:"w-full sm:w-auto",children:"Cancel"}),(0,r.jsx)(N.$,{type:"submit",className:"w-full sm:w-auto group",disabled:B||P,children:B||P?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"size-4 rounded-full border-2 border-primary-foreground border-t-transparent animate-spin"}),"Processing..."]}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[k?"Create Account & Continue":"Create Account",(0,r.jsx)(g.A,{className:"size-4 group-hover:translate-x-1 transition-transform"})]})})]})]})}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground text-center mt-4",children:["By signing up, you agree to our ",(0,r.jsx)("a",{href:"/terms",className:"text-primary hover:underline",children:"Terms of Service"})," and ",(0,r.jsx)("a",{href:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),"."]})]})})})}}}]);
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.