PageSourceSearch

https://kalpi.ai/_next/static/chunks/0adgf8xs_gzux.js

js kalpi.ai collected 2026-10-05 12:08:05 UTC 37,416 bytes, 10 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="3198317f-98fb-cc50-590b-a9a73f38f029")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,418633,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(776639),r=e.i(438847),o=e.i(618566),i=e.i(286536),n=e.i(77705),l=e.i(598925),d=e.i(519455),c=e.i(903133),m=e.i(975157),x=e.i(465468),u=e.i(887652),p=e.i(846932);let h=s.forwardRef(({className:e,type:a,...r},o)=>{let[i,n]=s.useState(!1),l=(0,u.useMotionValue)(0),d=(0,u.useMotionValue)(0);return(0,t.jsx)(p.motion.div,{style:{background:x.useMotionTemplate`
3        radial-gradient(
4          ${i?"100px":"0px"} circle at ${l}px ${d}px,
5          #00b14d,
6          transparent 80%
7        )
8      `},onMouseMove:function({currentTarget:e,clientX:t,clientY:s}){let{left:a,top:r}=e.getBoundingClientRect();l.set(t-a),d.set(s-r)},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"group/input rounded-lg p-[2px] transition duration-300",children:(0,t.jsx)("input",{type:a,className:(0,m.cn)("shadow-input dark:placeholder-text-neutral-600 flex h-10 w-full rounded-md border-none bg-gray-50 px-3 py-2 text-sm text-black transition duration-400 group-hover/input:shadow-none file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-neutral-400 focus-visible:ring-[2px] focus-visible:ring-neutral-400 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-zinc-800 dark:text-white dark:shadow-[0px_0px_1px_1px_#404040] dark:focus-visible:ring-neutral-600",e),ref:o,...r})})});h.displayName="InputAccertinity";var f=e.i(973741);let g=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(f.Root,{ref:a,className:(0,m.cn)("text-sm font-medium text-black dark:text-white leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...s}));g.displayName=f.Root.displayName;var b=e.i(50270),j=e.i(824574);let w=b.z.object({email:b.z.string().min(1,"Email is required").email("Invalid email address").refine(e=>!/[A-Z]/.test(e),{message:"Email cannot contain capital letters. Please use lowercase."}),first_name:b.z.string().min(1,"First name is required").min(2,"First name must be at least 2 characters").max(255,"First name must be less than 255 characters").regex(/^[a-zA-Z\s]+$/,"First name can only contain letters and spaces"),last_name:b.z.string().min(1,"Last name is required").min(2,"Last name must be at least 2 characters").max(255,"Last name must be less than 255 characters").regex(/^[a-zA-Z\s]+$/,"Last name can only contain letters and spaces"),phone_no:b.z.string().min(1,"Phone number is required").refine(e=>{try{return(0,j.isValidPhoneNumber)(e)}catch{return!1}},"Invalid phone number for the selected country"),user_type:b.z.enum(["individual","corporate"],{errorMap:()=>({message:"User type must be either 'individual' or 'corporate'"})}),password:b.z.string().min(8,"Password must be at least 8 characters"),confirm_password:b.z.string()}).refine(e=>e.password===e.confirm_password,{message:"Passwords don't match",path:["confirm_password"]}),y=b.z.object({username:b.z.string().min(1,"Username is required").email("Please enter a valid email address"),password:b.z.string().min(8,"Password must be at least 8 characters")});b.z.object({email:b.z.string().email("Invalid email address"),otp_code:b.z.string().min(6,"OTP must be 6 digits").max(6,"OTP must be 6 digits").regex(/^\d{6}$/,"OTP must contain only numbers")}),b.z.object({email:b.z.string().email("Invalid email address"),type:b.z.enum(["email","phone","all"])}),b.z.object({email:b.z.string().email("Invalid email address"),email_code:b.z.string().length(6,"Code must be 6 digits").optional(),phone_code:b.z.string().length(6,"Code must be 6 digits").optional()});let v=b.z.object({email:b.z.string().email("Invalid email address")}),N=b.z.object({email:b.z.string().email("Invalid email address"),code:b.z.string().length(6,"Code must be 6 digits"),new_password:b.z.string().min(8,"Password must be at least 8 characters"),confirm_password:b.z.string()}).refine(e=>e.new_password===e.confirm_password,{message:"Passwords don't match",path:["confirm_password"]});var _=e.i(309657),k=e.i(994814),C=e.i(653145),F=e.i(954616),S=e.i(940141);function E(e){return(0,S.GenIcon)({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackgroun
8d:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r\n	c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r\n	c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r\n	C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r\n	c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"},child:[]},{tag:"path",attr:{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r\n	c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"},child:[]}]})(e)}var P=e.i(657688),A=e.i(846696),z=e.i(375679),R=e.i(605966),V=e.i(321887),M=e.i(974918);let L=({children:e,className:s})=>(0,t.jsx)("div",{className:(0,m.cn)("flex w-full flex-col space-y-1",s),children:e}),O=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inset-x-0 -bottom-px block h-px w-full bg-linear-to-r from-transparent via-primary to-transparent opacity-0 transition duration-500 group-hover/btn:opacity-100"}),(0,t.jsx)("span",{className:"absolute inset-x-10 -bottom-px mx-auto block h-px w-1/2 bg-linear-to-r from-transparent via-primary/60 to-transparent opacity-0 blur-sm transition duration-500 group-hover/btn:opacity-100"})]});function I({onAuthChange:e,redirectPath:a}){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{children:"Loading..."}),children:(0,t.jsx)(B,{onAuthChange:e,redirectPath:a})})}function B({onAuthChange:e,redirectPath:a}){let{setAuthData:x}=(0,_.useAuthStore)(),u=(0,o.useRouter)(),[p,f]=(0,s.useState)(null),[b,j]=(0,s.useState)(!1),[w,v]=(0,s.useState)(!1),N=(0,s.useRef)(null),{mutate:S,isPending:I,reset:D}=(0,F.useMutation)({mutationFn:l.AuthActions.login,onSuccess:t=>{t.data&&(x(t.data),(0,z.trackEvent)("Login Success",{method:"email_password",email:t.data.user?.email||T.getValues().username,description:"User successfully logged in using email and password"}),A.toast.success("Login successful!"),e(""),a&&setTimeout(()=>{u.push(a)},100))},onError:async e=>{let t=(0,m.formatErrorMessage)(e),s=e?.detail?.toLowerCase().includes("not verified")||t.toLowerCase().includes("not verified");if((0,z.trackEvent)("Login Failed",{method:"email_password",error:t,is_unverified:s,description:"User login attempt failed"}),s){let e=T.getValues().username;f(e);try{await l.AuthActions.resendCode({email:e,type:"email"}),j(!0)}catch(e){"RATE_LIMIT_ERROR"===(e?.errorCode||e?.data?.error_code||e?.error_code)?j(!0):A.toast.error("Could not send verification email. Please try again.")}return}A.toast.error("Login Failed",{description:t})}}),T=(0,C.useForm)({resolver:(0,k.zodResolver)(y),defaultValues:{username:"",password:""}}),[U,K]=(0,r.useQueryState)("action",{defaultValue:""}),$=async()=>{let e=a||"/";if(U){let t=new URL(e,window.location.origin);t.searchParams.set("action",U),e=t.pathname+t.search}(0,z.trackGoogleSignupClicked)({source:"auth_modal_login",redirect_to:e}),l.AuthActions.googleLogin(e,(0,M.storedRef)()??void 0)},[G,H]=(0,r.useQueryState)("auth",{defaultValue:"",parse:e=>e}),[q,Q]=(0,s.useState)(!1);return b&&p?(0,t.jsx)("div",{className:"mx-auto w-full",children:(0,t.jsx)(V.EmailVerificationDialog,{open:b,onOpenChange:e=>{j(e),e||f(null)},defaultEmail:p,defaultCodeSent:!0,onSuccess:()=>{p&&S(T.getValues())}})}):(0,t.jsxs)("div",{className:"mx-auto w-full",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center mb-4 sm:mb-8",children:[(0,t.jsxs)("div",{className:"mb-2 sm:mb-3",children:[(0,t.jsx)(P.default,{src:"/logo/logo.png",alt:"KalpiCapital",width:50,height:20,priority:!0,style:{height:"auto"},className:"drop-shadow-sm object-contain sm:w-[70px] dark:hidden"}),(0,t.jsx)(P.default,{src:"/logo/dark.png",alt:"KalpiCapital",width:50,height:20,priority:!0,style:{height:"auto"},className:"drop-shadow-sm object-contain sm:w-[70px] hidden dark:block"})]}),(0,t.jsxs)("div",{className:"text-center space-y-1 sm:space-y-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Welcome back"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs sm:text-sm",children:"Please sign in to your account"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("button",{className:"group/btn relative flex h-10 sm:h-12 w-full items-center justify-center space-x-3 rounded-md bg-card border border-border px-4 font-medium text-card-foreground hover:bg-muted transition-all duration-200",type:"button",onClick:$,children:[(0,t.jsx)(E,{className:"h-4 w-4 sm:h-5 sm:w-5"}),(0,t.jsx)("span",{className:"text-xs sm:text-sm",children:"Continue with Google"}),(0,t.jsx)(O,{})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 my-2",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"text-[10px] sm:text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"OR"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-border"})]})]}),(0,t.jsx)(c.Form,{...T,children:(0,t.jsxs)("form",{ref:N,onSubmit:T.handleSubmit(e=>{S(e)}
8),className:"space-y-4 sm:space-y-6",children:[(0,t.jsx)(c.FormField,{control:T.control,name:"username",render:({field:e})=>(0,t.jsxs)(L,{children:[(0,t.jsx)(g,{htmlFor:"username",className:"text-xs sm:text-sm",children:"Email Address"}),(0,t.jsx)(h,{id:"username",placeholder:"[email protected]",type:"email",...e}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})}),(0,t.jsx)(c.FormField,{control:T.control,name:"password",render:({field:s})=>(0,t.jsxs)(L,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(g,{htmlFor:"password",className:"text-xs sm:text-sm",children:"Password"}),(0,t.jsx)(d.Button,{variant:"link",type:"button",className:"p-0 h-auto text-primary hover:text-primary/80 text-[10px] sm:text-xs",onClick:()=>e("forgot-password"),children:"Forgot Password?"})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h,{id:"password",type:w?"text":"password",...s}),(0,t.jsx)("button",{type:"button",onClick:()=>v(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1",children:w?(0,t.jsx)(n.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(i.Eye,{className:"h-4 w-4"})})]}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})}),(0,t.jsxs)("button",{className:"group/btn relative block h-10 sm:h-12 w-full rounded-md bg-linear-to-br from-primary to-primary/80 font-medium text-primary-foreground shadow-[0px_1px_0px_0px_#ffffff40_inset,0px_-1px_0px_0px_#ffffff40_inset] dark:shadow-[0px_1px_0px_0px_#27272a_inset,0px_-1px_0px_0px_#27272a_inset] disabled:opacity-50 transition-all duration-200 hover:shadow-lg text-sm sm:text-base",type:"submit",disabled:I,children:[I?"Signing in...":"Sign in →",(0,t.jsx)(O,{})]}),(0,t.jsxs)("div",{className:"text-center text-xs sm:text-sm",children:["Don't have an account?"," ",(0,t.jsx)(d.Button,{variant:"link",className:"p-0 h-auto text-primary hover:text-primary/80 text-xs sm:text-sm",onClick:()=>{(0,z.trackCreateAccountClicked)({source:"login_modal"}),e("register")},children:"Create an account"})]})]})}),(0,t.jsx)(R.BrokerSelectionDialog,{open:q,onOpenChange:Q,title:"Login with Broker",showConnectedStatus:!1,allowedBrokerIds:["indiabullssecurities"],hideVirtual:!0,redirectOnSelect:!1,hideUniversalUpload:!0})]})}var D=e.i(560132),T=e.i(871689),U=e.i(972520),K=e.i(531278),$=e.i(168148),G=e.i(730699),H=e.i(643531),q=e.i(37727),Q=e.i(400035);function Y({className:e}){let[a,r]=(0,s.useState)(""),[o,i]=(0,s.useState)(!1),[n,l]=(0,s.useState)(null),c=(0,s.useRef)(null),{mutate:x,data:u,isPending:p}=(0,Q.useValidateReferralCode)(),h=u?.data,f=!!h?.valid,g=!!(h&&!h.valid),b=e=>{let t=e.trim();t&&t!==c.current&&(c.current=t,l(t),x(t))};if((0,s.useEffect)(()=>{h&&n&&(h.valid?((0,M.saveRef)(n),i(!1)):(0,M.clearRef)())},[h,n]),(0,s.useEffect)(()=>{let e=(0,M.storedRef)();e&&(r(e),b(e))},[]),f){let s=h?.referrer_first_name?.trim();return(0,t.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2.5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5",e),children:[(0,t.jsx)(G.Gift,{className:"h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400"}),(0,t.jsx)("p",{className:"flex-1 text-xs font-semibold text-emerald-700 dark:text-emerald-300",children:s?`${s} invited you to Kalpi`:"You were invited to Kalpi"}),(0,t.jsx)(H.Check,{className:"h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400"})]})}return p&&!o?(0,t.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2",e),children:[(0,t.jsx)(K.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Checking referral code…"})]}):o?(0,t.jsxs)("div",{className:(0,m.cn)("flex w-full flex-col gap-1.5",e),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{value:a,onChange:e=>r(e.target.value),onBlur:e=>b(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),b(a))},placeholder:"Referral code (optional)",autoComplete:"off",spellCheck:!1,className:(0,m.cn)("h-10 flex-1 rounded-md border bg-background px-3 text-sm uppercase placeholder:normal-case placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-emerald-500",g?"border-amber-500/60":"border-input")}),p?(0,t.jsx)(K.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):(0,t.jsx)(d.Button,{type:"button",variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{r(""),l(null),c.current=null,(0,M.clearRef)(),i(!1)},children:(0,t.jsx)(q.X,{className:"h-4 w-4 text-muted-foreground"})})]}
8),g&&(0,t.jsx)("p",{className:"text-[11px] text-amber-600 dark:text-amber-400",children:"We couldn't find that code. You can still create your account."})]}):(0,t.jsx)("button",{type:"button",onClick:()=>i(!0),className:(0,m.cn)("text-xs font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",e),children:"Have a referral code?"})}let Z=({children:e,className:s})=>(0,t.jsx)("div",{className:(0,m.cn)("flex w-full flex-col space-y-1",s),children:e}),J=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inset-x-0 -bottom-px block h-px w-full bg-linear-to-r from-transparent via-primary to-transparent opacity-0 transition duration-500 group-hover/btn:opacity-100"}),(0,t.jsx)("span",{className:"absolute inset-x-10 -bottom-px mx-auto block h-px w-1/2 bg-linear-to-r from-transparent via-primary/60 to-transparent opacity-0 blur-sm transition duration-500 group-hover/btn:opacity-100"})]});function W({onAuthChange:e,redirectPath:a}){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{children:"Loading..."}),children:(0,t.jsx)(X,{onAuthChange:e,redirectPath:a})})}function X({onAuthChange:e,redirectPath:a}){let[x,u]=(0,s.useState)(1),{setAuthData:p}=(0,_.useAuthStore)(),{mutate:f}=(0,F.useMutation)({mutationFn:l.AuthActions.login,onSuccess:t=>{t?.data&&(p(t.data),a?b.push(a):b.push("/"),e(""))},onError:()=>{e("login")}}),b=(0,o.useRouter)(),[j,y]=(0,s.useState)(!1),[v,N]=(0,s.useState)(""),[S,L]=(0,s.useState)(!1),[O,I]=(0,s.use
8State)(!1),[B,G]=(0,s.useState)(!1),{isPending:H,mutate:q}=(0,F.useMutation)({mutationFn:l.AuthActions.registerUser,onSuccess:e=>{e?.data&&((0,M.clearRef)(),(0,z.trackEmailOtpSent)({email:e.data.email,source:"registration_flow"}),A.toast.success("Registration successful!",{description:"Please check your email for the verification code."}),N(e.data.email),y(!0))},onError:t=>{let s="Registration failed. Please try again.";if(t?.response?.data?.details?.validation_errors){var a;let e,r=t.response.data.details.validation_errors;r.length>0&&((e=(e=(e=(e=a=r[0].msg).replace(/^Value error,?\s*/i,"")).replace(/^ValueError,?\s*/i,"")).replace(/^value_error,?\s*/i,"")).length>0&&(e=e.charAt(0).toUpperCase()+e.slice(1)),s=e||a)}else s=t?.response?.data?.message?t.response.data.message:(0,m.formatErrorMessage)(t);s.toLowerCase().includes("already exists")?A.toast.error("Account already exists",{description:"This email is already registered. If you haven't verified your account, please try logging in to receive a new code.",action:{label:"Sign In",onClick:()=>e("login")}}):A.toast.error("Registration Failed",{description:s})}}),Q=(0,C.useForm)({resolver:(0,k.zodResolver)(w),mode:"onTouched",defaultValues:{first_name:"",last_name:"",email:"",phone_no:"",user_type:"individual",password:"",confirm_password:""}}),W=e=>{let t=(0,M.storedRef)(),s={...e,email:e.email.toLowerCase().trim()};q(t?{...s,referral_code:t}:s)},ee=async()=>{let e=!1;if(1===x){let t=await Q.trigger("first_name"),s=await Q.trigger("last_name"),a=await Q.trigger("email");(e=t&&s&&a)&&(0,z.trackPersonalInfoSubmitted)({first_name:Q.getValues("first_name"),last_name:Q.getValues("last_name"),email:Q.getValues("email")})}else if(2===x)(e=await Q.trigger("phone_no"))&&(0,z.trackContactDetailsSubmitted)({phone_no:Q.getValues("phone_no"),email:Q.getValues("email")});else if(3===x){let t=await Q.trigger("password"),s=await Q.trigger("confirm_password");(e=t&&s)&&((0,z.trackSetPasswordSubmitted)({email:Q.getValues("email")}),Q.handleSubmit(W)(),e=!1)}e&&x<3&&u(x+1)},[et]=(0,r.useQueryState)("action",{defaultValue:""}),es=async()=>{let e=a||"/";if(et){let t=new URL(e,window.location.origin);t.searchParams.set("action",et),e=t.pathname+t.search}(0,z.trackGoogleSignupClicked)({source:"auth_modal_register",redirect_to:e}),l.AuthActions.googleLogin(e,(0,M.storedRef)()??void 0)};return(0,s.useEffect)(()=>{let e=e=>{if(!j&&!S&&"Enter"===e.key){let t=document.activeElement;t?.tagName!=="BUTTON"&&t?.tagName!=="A"&&(e.preventDefault(),x<3?ee():Q.handleSubmit(W)())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x,3,j,S,ee,Q]),(0,t.jsxs)("div",{className:"mx-auto w-full",children:[(0,t.jsx)(V.EmailVerificationDialog,{open:j,onOpenChange:y,defaultEmail:v,defaultCodeSent:!0,onSuccess:()=>{(0,z.trackSignUpCompleted)({method:"email_otp",email:v||Q.getValues().email}),A.toast.success("Email verified! Logging you in…");let{email:e,password:t}=Q.getValues();f({username:e,password:t})}}),(0,t.jsxs)("div",{className:"flex flex-col items-center mb-4 sm:mb-6",children:[(0,t.jsxs)("div",{className:"mb-2 sm:mb-3",children:[(0,t.jsx)(P.default,{src:"/logo/logo.png",alt:"KalpiCapital",width:50,height:20,priority:!0,className:"drop-shadow-sm object-contain sm:w-[70px] dark:hidden"}),(0,t.jsx)(P.default,{src:"/logo/dark.png",alt:"KalpiCapital",width:50,height:20,priority:!0,className:"drop-shadow-sm object-contain sm:w-[70px] hidden dark:block"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("h2",{className:"text-base sm:text-lg font-semibold text-foreground leading-snug",children:"Create your account"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Join thousands of investors today"})]})]}),(0,t.jsxs)("div",{className:"mb-4 sm:mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted",onClick:()=>{x>1&&u(x-1)},disabled:1===x,children:(0,t.jsx)(T.ArrowLeft,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"text-xs sm:text-sm font-medium text-foreground",children:(()=>{switch(x){case 1:return"Personal Information";case 2:return"Contact Details";case 3:return"Set Password";default:return"Create Account"}})()}),(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted",onClick:ee,disabled:3===x,children:(0,t.jsx)(U.ArrowRight,{className:"h-4 w-4"})})]}),(0,t.jsx)($.Progress,{value:x/3*100,className:"h-1.5 sm:h-2"})]}),1===x&&(0,t.jsxs)("div",{className:"flex flex-col space-y-4 mb-4 sm:mb-6",children:[(0,t.jsx)(Y,{className:"w-full text-left"}),(0,t.jsxs)("button",{className:"group/btn relative flex h-10 sm:h-12 w-full items-center justify-center space-x-3 rounded-md bg-card border border-border px-4 font-medium text-card-foreground hover:bg-muted transition-all duration-200",type:"button",onClick:es,children:[(0,t.jsx)(E,{className:"h-4 w-4 sm:h-5 sm:w-5"}),(0,t.jsx)("span",{className:"text-xs sm:text-sm",children:"Continue with Google"}),(0,t.jsx)(J,{})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 my-0.5",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"text-[10px] sm:text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"OR"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-border"})]})]}),(0,t.jsx)(c.Form,{...Q,children:(0,t.jsxs)("form",{onSubmit:Q.handleSubmit(W),className:"space-y-2.5 sm:space-y-3",children:[1===x&&(0,t.jsxs)("div",{className:"space-y-2 sm:space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-col space-y-2 md:flex-row md:space-y-0 md:space-x-3",children:[(0,t.jsx)(c.FormField,{control:Q.control,name:"first_name",render:({field:e})=>(0,t.jsxs)(Z,{className:"flex-1",children:[(0,t.jsx)(g,{htmlFor:"firstname",className:"text-xs sm:text-sm",children:"First name"}),(0,t.jsx)(h,{id:"firstname",placeholder:"John",type:"text",...e}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})}),(0,t.jsx)(c.FormField,{control:Q.control,name:"last_name",render:({field:e})=>(0,t.jsxs)(Z,{className:"flex-1",children:[(0,t.jsx)(g,{htmlFor:"lastname",className:"text-xs sm:text-sm",children:"Last name"}),(0,t.jsx)(h,{id:"lastname",placeholder:"Doe",type:"text",...e}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})})]}),(0,t.jsx)(c.FormField,{control:Q.control,name:"email",render:({field:e})=>(0,t.jsxs)(Z,{children:[(0,t.jsx)(g,{htmlFor:"email",className:"text-xs sm:text-sm",children:"Email Address"}),(0,t.jsx)(h,{id:"email",placeholder:"[email protected]",type:"email",...e}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})})]}),2===x&&(0,t.jsx)("div",{className:"space-y-2 sm:space-y-2.5",children:(0,t.jsx)(c.FormField,{control:Q.control,name:"phone_no",render:({field:e})=>(0,t.jsxs)(Z,{children:[(0,t.jsx)(g,{htmlFor:"phone",className:"text-xs sm:text-sm",children:"Phone Number"}),(0,t.jsx)(D.PhoneInput,{value:e.value,onChange:t=>e.onChange(t??""),defaultCountry:"IN",placeholder:"Phone number"}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})})}),3===x&&(0,t.jsxs)("div",{className:"space-y-2 sm:space-y-2.5",children:[(0,t.jsx)(c.FormField,{control:Q.control,name:"password",render:({field:e})=>(0,t.jsxs)(Z,{children:[(0,t.jsx)(g,{htmlFor:"password",className:"text-xs sm:text-sm",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h,{id:"password",type:O?"text":"password",placeholder:"Enter a secure password",...e}),(0,t.jsx)("button",{type:"button",onClick:()=>I(!O),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1",children:O?(0,t.jsx)(n.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(i.Eye,{className:"h-4 w-4"})})]}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})}),(0,t.jsx)(c.FormField,{control:Q.control,name:"confirm_password",render:({field:e})=>(0,t.jsxs)(Z,{children:[(0,t.jsx)(g,{htmlFor:"confirm_password",className:"text-xs sm:text-sm",children:"Confirm Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h,{id:"confirm_password",type:B?"text":"password",placeholder:"Confirm your password",...e}),(0,t.jsx)("button",{type:"button",onClick:()=>G(!B),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1",children:B?(0,t.jsx)(n.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(i.Eye,{className:"h-4 w-4"})})]}),(0,t.jsx)(c.FormMessage,{className:"text-[11px] font-medium text-destructive leading-tight mt-0.5"})]})})]}),(0,t.jsxs)("button",{type:3===x?"submit":"button",onClick:3!==x?e=>{e.preventDefault(),ee()}:void 0,className:"group/btn relative flex items-center justify-center h-9 sm:h-10 w-full rounded-md bg-linear-to-br from-primary to-primary/80 font-medium text-primary-foreground shadow-[0px_1px_0px_0px_#ffffff40_inset,0px_-1px_0px_0px_#ffffff40_inset] dar
8k:shadow-[0px_1px_0px_0px_#27272a_inset,0px_-1px_0px_0px_#27272a_inset] disabled:opacity-50 transition-all duration-200 hover:shadow-lg text-xs sm:text-sm",disabled:H,children:[H?(0,t.jsxs)("div",{className:"flex items-center justify-center",children:[(0,t.jsx)(K.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),(0,t.jsx)("span",{children:3===x?"Creating account...":"Processing..."})]}):3===x?"Create account →":"Next step →",(0,t.jsx)(J,{})]}),(0,t.jsxs)("div",{className:"text-center text-xs pt-0.5",children:["Already have an account?"," ",(0,t.jsx)(d.Button,{variant:"link",type:"button",className:"p-0 h-auto text-primary hover:text-primary/80 text-xs",onClick:()=>e("login"),children:"Sign in"})]})]})}),(0,t.jsx)(R.BrokerSelectionDialog,{open:S,onOpenChange:L,title:"Login with Broker",showConnectedStatus:!1,allowedBrokerIds:["indiabullssecurities"],hideVirtual:!0,redirectOnSelect:!1,hideUniversalUpload:!0})]})}var ee=e.i(373375);let et=({children:e,className:s})=>(0,t.jsx)("div",{className:(0,m.cn)("flex w-full flex-col space-y-2",s),children:e}),es=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inset-x-0 -bottom-px block h-px w-full bg-linear-to-r from-transparent via-primary to-transparent opacity-0 transition duration-500 group-hover/btn:opacity-100"}),(0,t.jsx)("span",{className:"absolute inset-x-10 -bottom-px mx-auto block h-px w-1/2 bg-linear-to-r from-transparent via-primary/60 to-transparent opacity-0 blur-sm transition duration-500 group-hover/btn:opacity-100"})]});function ea({onAuthChange:e,onEmailSent:s}){let{mutate:a,isPending:r}=(0,F.useMutation)({mutationFn:l.AuthActions.forgotPassword,onSuccess:e=>{A.toast.success("Success",{description:e.message||"Reset code sent to your email."}),s(o.getValues().email)},onError:e=>{A.toast.error("Failed",{description:(0,m.formatErrorMessage)(e)})}}),o=(0,C.useForm)({resolver:(0,k.zodResolver)(v),defaultValues:{email:""}});return(0,t.jsxs)("div",{className:"mx-auto w-full",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center mb-4 sm:mb-8",children:[(0,t.jsxs)("div",{className:"mb-2 sm:mb-3",children:[(0,t.jsx)(P.default,{src:"/logo/logo.png",alt:"KalpiCapital",width:70,height:20,style:{height:"auto"},className:"drop-shadow-sm object-contain dark:hidden"}),(0,t.jsx)(P.default,{src:"/logo/dark.png",alt:"KalpiCapital",width:70,height:20,priority:!0,className:"drop-shadow-sm object-contain hidden dark:block"})]}),(0,t.jsxs)("div",{className:"text-center space-y-1 sm:space-y-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Forgot Password"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs sm:text-sm max-w-[250px] mx-auto",children:"Enter your email and we'll send you a code to reset your password"})]})]}),(0,t.jsx)(c.Form,{...o,children:(0,t.jsxs)("form",{onSubmit:o.handleSubmit(e=>{a(e)}),className:"space-y-4 sm:space-y-6",children:[(0,t.jsx)(c.FormField,{control:o.control,name:"email",render:({field:e})=>(0,t.jsxs)(et,{children:[(0,t.jsx)(g,{htmlFor:"email",className:"text-xs sm:text-sm",children:"Email Address"}),(0,t.jsx)(h,{id:"email",placeholder:"[email protected]",type:"email",...e}),(0,t.jsx)(c.FormMessage,{})]})}),(0,t.jsxs)("button",{className:"group/btn relative block h-10 sm:h-12 w-full rounded-md bg-linear-to-br from-primary to-primary/80 font-medium text-primary-foreground shadow-[0px_1px_0px_0px_#ffffff40_inset,0px_-1px_0px_0px_#ffffff40_inset] dark:shadow-[0px_1px_0px_0px_#27272a_inset,0px_-1px_0px_0px_#27272a_inset] disabled:opacity-50 transition-all duration-200 hover:shadow-lg text-sm sm:text-base",type:"submit",disabled:r,children:[r?"Sending...":"Send Reset Code →",(0,t.jsx)(es,{})]}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsxs)(d.Button,{variant:"link",type:"button",className:"p-0 h-auto text-muted-foreground hover:text-foreground text-xs sm:text-sm flex items-center gap-1",onClick:()=>e("login"),children:[(0,t.jsx)(ee.ChevronLeft,{className:"h-4 w-4"}),"Back to Sign In"]})})]})})]})}var er=e.i(595468),eo=e.i(458887);let ei=({children:e,className:s})=>(0,t.jsx)("div",{className:(0,m.cn)("flex w-full flex-col space-y-2",s),children:e}),en=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inset-x-0 -bottom-px block h-px w-full bg-linear-to-r from-transparent via-primary to-transparent opacity-0 transition duration-500 group-hover/btn:opacity-100"}),(0,t.jsx)("span",{className:"absolute inset-x-10 -bottom-px mx-auto block h-px w-1/2 bg-linear-to-r from-transparent via-primary/60 to-transparent opacity-0 blur-sm transition duration-500 group-hover/btn:opacity-100"})]});function el({onAuthChange:e,email:a}
8){let[r,o]=(0,s.useState)(!1),[x,u]=(0,s.useState)(!1),[p,f]=(0,s.useState)(!1),{mutate:b,isPending:j}=(0,F.useMutation)({mutationFn:l.AuthActions.verifyResetCode,onSuccess:e=>{A.toast.success("Code Verified",{description:"Please set your new password now."}),f(!0)},onError:e=>{A.toast.error("Verification Failed",{description:(0,m.formatErrorMessage)(e)})}}),{mutate:w,isPending:y}=(0,F.useMutation)({mutationFn:l.AuthActions.resetPassword,onSuccess:t=>{A.toast.success("Success",{description:t.message||"Password has been reset successfully."}),e("login")},onError:e=>{A.toast.error("Failed",{description:(0,m.formatErrorMessage)(e)})}}),v=(0,C.useForm)({resolver:(0,k.zodResolver)(N),defaultValues:{email:a,code:"",new_password:"",confirm_password:""}}),{watch:_,getValues:S,setError:E,handleSubmit:z,control:R}=v,V=_("code")||"";return(0,t.jsxs)("div",{className:"mx-auto w-full",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center mb-4 sm:mb-8",children:[(0,t.jsxs)("div",{className:"mb-2 sm:mb-3",children:[(0,t.jsx)(P.default,{src:"/logo/logo.png",alt:"KalpiCapital",width:70,height:20,style:{height:"auto"},className:"drop-shadow-sm object-contain dark:hidden"}),(0,t.jsx)(P.default,{src:"/logo/dark.png",alt:"KalpiCapital",width:70,height:20,priority:!0,className:"drop-shadow-sm object-contain hidden dark:block"})]}),(0,t.jsxs)("div",{className:"text-center space-y-1 sm:space-y-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:p?"Create New Password":"Verify Reset Code"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs sm:text-sm max-w-[250px] mx-auto",children:p?"Your code is verified! Now enter your new secure password.":`Enter the 6-digit code sent to ${a}`})]})]}),(0,t.jsx)(c.Form,{...v,children:(0,t.jsxs)("form",{onSubmit:z(e=>{w(e)}),className:"space-y-4 sm:space-y-6",children:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg mb-4",children:[(0,t.jsx)(er.CheckCircle2,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium text-primary",children:"Code Verified Successfully"})]}),(0,t.jsx)(c.FormField,{control:R,name:"new_password",render:({field:e})=>(0,t.jsxs)(ei,{children:[(0,t.jsx)(g,{htmlFor:"new_password",className:"text-xs sm:text-sm",children:"New Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h,{id:"new_password",type:r?"text":"password",placeholder:"••••••••",...e}),(0,t.jsx)("button",{type:"button",onClick:()=>o(!r),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1",children:r?(0,t.jsx)(n.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(i.Eye,{className:"h-4 w-4"})})]}),(0,t.jsx)(c.FormMessage,{})]})}),(0,t.jsx)(c.FormField,{control:R,name:"confirm_password",render:({field:e})=>(0,t.jsxs)(ei,{children:[(0,t.jsx)(g,{htmlFor:"confirm_password",className:"text-xs sm:text-sm",children:"Confirm Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h,{id:"confirm_password",type:x?"text":"password",placeholder:"••••••••",...e}),(0,t.jsx)("button",{type:"button",onClick:()=>u(!x),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1",children:x?(0,t.jsx)(n.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(i.Eye,{className:"h-4 w-4"})})]}),(0,t.jsx)(c.FormMessage,{})]})}),(0,t.jsxs)("button",{className:"group/btn relative block h-10 sm:h-12 w-full rounded-md bg-linear-to-br from-primary to-primary/80 font-medium text-primary-foreground shadow-[0px_1px_0px_0px_#ffffff40_inset,0px_-1px_0px_0px_#ffffff40_inset] dark:shadow-[0px_1px_0px_0px_#27272a_inset,0px_-1px_0px_0px_#27272a_inset] disabled:opacity-50 transition-all duration-200 hover:shadow-lg text-sm sm:text-base",type:"submit",disabled:y,children:[y?"Resetting...":"Reset Password →",(0,t.jsx)(en,{})]})]}):(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(c.FormField,{control:R,name:"code",render:({field:e})=>(0,t.jsxs)(ei,{className:"items-center",children:[(0,t.jsx)(g,{htmlFor:"code",className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Verification Code"}),(0,t.jsx)(eo.InputOTP,{maxLength:6,value:e.value,onChange:t=>{let s=t.replace(/\D/g,"");e.onChange(s)},disabled:j,children:(0,t.jsx)(eo.InputOTPGroup,{className:"gap-2",children:[0,1,2,3,4,5].map(e=>(0,t.jsx)(eo.InputOTPSlot,{index:e,className:"h-12 w-10 sm:w-12 text-lg font-bold rounded-xl border-zinc-200 dark:border-zinc-800 focus:ring-primary/20 data-[active=true]:border-primary data-[active=true]:ring-primary/20"},e))})}),(0,t.jsx)(c.FormMessage,{})]})}),(0,t.jsxs)("button",{className:"group/btn relative block h-10 sm:h-12 w-full rounded-md bg-linear-to-br from-primary to-primary/80 font-medium text-primary-foreground shadow-[0px_1px_0px_0px_#ffffff40_inset,0px_-1px_0px_0px_#ffffff40_inset] dar
8k:shadow-[0px_1px_0px_0px_#27272a_inset,0px_-1px_0px_0px_#27272a_inset] disabled:opacity-50 transition-all duration-200 hover:shadow-lg text-sm sm:text-base",type:"button",onClick:()=>{let e=S("code");6!==e.length?E("code",{message:"Code must be 6 digits"}):b({email:a,code:e})},disabled:j||6!==V.length,children:[j?"Verifying...":"Verify Code →",(0,t.jsx)(en,{})]})]}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsxs)(d.Button,{variant:"link",type:"button",className:"p-0 h-auto text-muted-foreground hover:text-foreground text-xs sm:text-sm flex items-center gap-1",onClick:()=>e("login"),children:[(0,t.jsx)(ee.ChevronLeft,{className:"h-4 w-4"}),"Back to Sign In"]})})]})})]})}function ed({children:e,redirectPath:i}){let n=(0,o.usePathname)(),[l,d]=(0,r.useQueryState)("auth",{defaultValue:"",parse:e=>e}),[c,m]=(0,s.useState)(""),[x,u]=(0,r.useQueryState)("redirect",{defaultValue:""});(0,s.useEffect)(()=>{"login"===l&&(0,z.trackLoginAuthViewed)({source:n||"web",redirect_path:x||i||""})},[l,n,x,i]);let p={auth:l,onAuthChange:d,redirectPath:x||i||""};return(0,t.jsxs)(a.Dialog,{open:!!l,onOpenChange:e=>{e||("login"===l&&(0,z.trackEvent)("MF Onboarding Exited",{location:"sign_in_modal",exit_method:"close"}),d(""),u(""))},children:[e&&(0,t.jsx)(a.DialogTrigger,{asChild:!0,onClick:()=>{var e;"login"==(e="login")&&(0,z.trackLoginAuthViewed)({source:n||"web",redirect_path:i||""}),i?u(i):!x&&n&&"/"!==n&&u(n),d(e)},children:e}),(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-md p-0 overflow-y-auto max-h-[88vh] bg-background border border-border rounded-2xl shadow-2xl z-[100]",children:[(0,t.jsx)(a.DialogHeader,{className:"sr-only",children:(0,t.jsx)(a.DialogTitle,{children:"Authentication"})}),(0,t.jsx)("div",{className:"p-4 sm:p-5",children:"login"===l?(0,t.jsx)(I,{...p}):"register"===l?(0,t.jsx)(W,{...p}):"forgot-password"===l?(0,t.jsx)(ea,{onAuthChange:d,onEmailSent:e=>{m(e),d("reset-password")}}):"reset-password"===l?(0,t.jsx)(el,{onAuthChange:d,email:c}):(0,t.jsx)(I,{...p})})]})]})}e.s(["default",0,function({children:e,redirectPath:a}){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{children:"Loading..."}),children:(0,t.jsx)(ed,{redirectPath:a,children:e})})}],418633)}]);
9
10//# debugId=3198317f-98fb-cc50-590b-a9a73f38f029

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.