1import{j as e}from"./ui-vendor-v1v5o04c.js";import{r as i}from"./react-vendor-BgFDGfxp.js";import{b as P,t as R,E as L,d as f,e as H,m as o,C as y,f as B,A as F,g as G,h as K,n as V,j as X,l as Q,k as Z}from"./index-CXkW90Zn.js";import"./chart-vendor-C5w2S9VQ.js";import"./supabase-vendor-C29GuXw3.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"48f2183ca960a15bb918d895f10e0282e2ced28f"};var m=new s.Error().stack;m&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[m]="476a4e0a-12cd-44b0-8830-2cb8977d159e",s._sentryDebugIdIdentifier="sentry-dbid-476a4e0a-12cd-44b0-8830-2cb8977d159e")}catch{}})();const ee=s=>`trade-journal-onboarding-complete-${s}`,te=[{id:"stocks",label:"Stocks",icon:"ð"},{id:"options",label:"Options",icon:"ð"},{id:"futures",label:"Futures",icon:"ð"},{id:"forex",label:"Forex",icon:"ð±"},{id:"crypto",label:"Crypto",icon:"â¿"}],re=[{id:"consistency",label:"Build consistency",icon:"ð¯"},{id:"profitability",label:"Improve profitability",icon:"ð°"},{id:"discipline",label:"Strengthen discipline",icon:"ð§ "},{id:"analysis",label:"Better trade analysis",icon:"ð"},{id:"tracking",label:"Just track my trades",icon:"ð"}],se=[{id:"new",label:"New to trading",icon:"ð±"},{id:"intermediate",label:"Some experience",icon:"ð"},{id:"experienced",label:"Experienced",icon:"ð"}],ne=[{id:"search",label:"Search / Google",icon:"ð"},{id:"twitter",label:"X / Twitter",icon:"ð¦"},{id:"reddit",label:"Reddit",icon:"ð½"},{id:"youtube",label:"YouTube",icon:"ðº"},{id:"friend",label:"Friend / word of mouth",icon:"ð¥"},{id:"discord",label:"Discord",icon:"ð¬"},{id:"other",label:"Other",icon:"â¨"}],oe=["welcome","name","profile","goals","ready"],j={initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:-24},transition:{duration:.4,ease:[.25,.1,.25,1]}},u=s=>({initial:{opacity:0,y:16},animate:{opacity:1,y:0,transition:{delay:.08*s,duration:.35}}}),ue=({open:s,onComplete:m})=>{const{setLocalUsername:C,email:k,name:g,userId:x}=P(),I=(()=>{try{const t=localStorage.getItem("trade-journal-trial-end");return t?new Date(t)>new Date:!1}catch{return!1}})(),[a,T]=i.useState(0),[d,O]=i.useState(g||""),[l,U]=i.useState([]),[c,W]=i.useState([]),[S,h]=i.useState(!1),[N,Y]=i.useState(!1),[p,$]=i.useState(null),[E,J]=i.useState(null);if(i.useEffect(()=>{s&&R(L.ONBOARDING_STEP_VIEWED,{step:a,name:oe[a]})},[s,a]),!s)return null;const v=d||g||(k==null?void 0:k.split("@")[0])||"",M=t=>U(r=>r.includes(t)?r.filter(n=>n!==t):[...r,t]),q=t=>W(r=>r.includes(t)?r.filter(n=>n!==t):[...r,t]),z=async()=>{if(!N){if(Y(!0),d.trim()&&(C(d.trim()),P.setState({name:d.trim()}),x&&B(`${F}/auth/user/${x}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.trim()})}).catch(()=>{})),l.length>0)try{G("trade-journal-asset-preferences",JSON.stringify(l))}catch{}if(c.length>0)try{G("trade-journal-goal-preferences",JSON.stringify(c))}catch{}localStorage.setItem(ee(x),"true"),x&&B(`${F}/auth/user/${x}/onboarding`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferred_assets:l,trading_goals:c,experience_level:p,acquisition_source:E,...K(),completedNow:!0})}).catch(()=>{}),R(L.COMPLETED_ONBOARDING,{selectedAssets:l,selectedGoals:c,experienceLevel:p,acquisitionSource:E}),V(),X({signup_day:Q(),onboarding_assets:l,onboarding_primary_asset:l[0]??null,onboarding_goals:c,onboarding_primary_goal:c[0]??null,experience_level:p,completed_onboarding:!0});try{await Z.getState().enterDemoAccount(x)}catch(t){console.warn("Onboarding: could not enter demo account:",t)}m==null||m()}},A=!!(g&&g.trim()),b=()=>T(t=>{const r=t+1;return r===1&&A?(O(g),2):r}),w=()=>T(t=>{const r=t-1;return r===1&&A?0:Math.max(0,r)}),D=A?[2,3,4]:[1,2,3,4],_=D.indexOf(a);return e.jsxs("div",{"data-ph-unmask":!0,"data-modal":"",className:"dark fixed inset-0 z-overlay flex items-center justify-center max-md:overflow-y-auto max-md:overscroll-contain",children:[e.jsx("div",{className:"absolute max-md:fixed inset-0 bg-cover bg-center",style:{backgroundImage:"url(/images/authentication-bg.webp)"}}),e.jsx("div",{className:"absolute max-md:fixed inset-0 bg-black/80 backdrop-blur-2xl"}),e.jsx("div",{className:"absolute top-8 left-8 max-md:top-[max(1.5rem,env(safe-area-inset-top))] max-md:left-6 z-10",children:e.jsx("img",{src:"/images/logo-full-light.svg",alt:"TradeRitual",className:"h-7 w-auto"})}),e.jsxs("div",{className:"relative w-full max-w-xl mx-auto px-6 max-md:my-auto max-md:pt-24 max-md:pb-[max(2.5rem,env(safe-area-inset-bottom))]",children:[_>=0&&e.jsx("div",{className:"flex items-center gap-1.5 mb-8","aria-hidden":"true",children:D.map((t,r)=>e.jsx("div",{className:f("h-1 rounded-full transition-all duration-300",r<=_?"bg-foreground":"bg-foreground
1/15",r===_?"w-6":"w-4")},t))}),e.jsxs(H,{mode:"wait",children:[a===0&&e.jsxs(o.div,{...j,className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-serif font-medium tracking-tight text-foreground",children:"Welcome to TradeRitual."}),e.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed max-w-md",children:"Your trading journal - built for serious traders who want to improve through reflection and data."})]}),e.jsx("div",{className:"space-y-5 pt-2",children:[{title:"Track every trade",desc:"Log entries, exits, and notes. See your performance over time."},{title:"Spot patterns",desc:"Analytics and charts reveal what's working and what isn't."},{title:"Always backed up",desc:"Your data is saved locally and synced to the cloud automatically."}].map((t,r)=>e.jsxs(o.div,{...u(r),className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-1 w-5 h-5 rounded-full border border-foreground/20 flex items-center justify-center flex-shrink-0",children:e.jsx(y,{className:"w-3 h-3 text-foreground/60"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]})]},t.title))}),I&&e.jsxs(o.div,{...u(3),className:"rounded-lg border border-primary/20 bg-primary/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Your 14-day Growth trial is active"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:"The full analytics suite, intraday charts, and multi-device sync are unlocked. After 14 days you'll go back to the free Starter journal - no charges, no card on file."})]}),e.jsx(o.button,{...u(I?4:3),onClick:b,className:"inline-flex items-center justify-center px-6 py-2.5 max-md:min-h-11 rounded-full bg-foreground text-background text-sm font-medium hover:bg-foreground
1/90 transition-colors",children:"Get started"})]},"welcome"),a===1&&e.jsxs(o.div,{...j,className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-serif font-medium tracking-tight text-foreground",children:"Before we start, what's your name?"}),e.jsx("p",{className:"text-base text-muted-foreground",children:"We'll use this to personalize your journal."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("input",{type:"text",value:d,onChange:t=>{O(t.target.value),S&&t.target.value.trim()&&h(!1)},onKeyDown:t=>{if(t.key==="Enter"){if(!d.trim()){h(!0);return}h(!1),b()}},placeholder:"Enter your name",autoFocus:!0,className:f("w-full bg-muted/50 border rounded-lg px-4 py-3.5 text-base text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 transition-all",S?"border-destructive focus:ring-destructive/20":"border-border focus:ring-foreground/20")}),S&&e.jsx("p",{className:"text-xs text-destructive",children:"Please enter your name to continue"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>{if(!d.trim()){h(!0);return}h(!1),b()},className:"inline-flex items-center justify-center px-6 py-2.5 max-md:min-h-11 rounded-full bg-foreground text-background text-sm font-medium hover:bg-foreground
1/90 transition-colors",children:"Continue"}),e.jsx("button",{onClick:w,className:"text-sm max-md:min-h-11 max-md:px-2 text-muted-foreground hover:text-foreground transition-colors",children:"Back"})]})]},"name"),a===2&&e.jsxs(o.div,{...j,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-serif font-medium tracking-tight text-foreground",children:v?`A bit about your trading, ${v}`:"A bit about your trading"}),e.jsx("p",{className:"text-base text-muted-foreground",children:"We'll tailor tips and defaults to you."})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"What do you trade?"}),e.jsx("div",{className:"flex flex-wrap gap-2.5",children:te.map((t,r)=>{const n=l.includes(t.id);return e.jsxs(o.button,{...u(r),onClick:()=>M(t.id),className:f("inline-flex items-center gap-2 px-4 py-2.5 rounded-full border text-sm font-medium transition-all duration-150",n?"border-foreground/40 bg-foreground
1/[0.08] text-foreground":"border-border hover:border-foreground/20 text-muted-foreground hover:text-foreground"),children:[n?e.jsx("div",{className:"w-5 h-5 rounded-full bg-foreground flex items-center justify-center",children:e.jsx(y,{className:"w-2.5 h-2.5 text-background"})}):e.jsx("div",{className:"w-5 h-5 rounded-full border border-foreground/20"}),e.jsx("span",{className:"text-sm",children:t.icon}),t.label]},t.id)})})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"How experienced are you?"}),e.jsx("div",{className:"flex flex-wrap gap-2.5",children:se.map((t,r)=>{const n=p===t.id;return e.jsxs(o.button,{...u(r),onClick:()=>$(n?null:t.id),className:f("inline-flex items-center gap-2 px-4 py-2.5 rounded-full border text-sm font-medium transition-all duration-150",n?"border-foreground/40 bg-foreground/[0.08] text-foreground":"border-border hover:border-foreground/20 text-muted-foreground hover:text-foreground"),children:[n?e.jsx("div",{className:"w-5 h-5 rounded-full bg-foreground flex items-center justify-center",children:e.jsx(y,{className:"w-2.5 h-2.5 text-background"})}):e.jsx("div",{className:"w-5 h-5 rounded-full border border-foreground
1/20"}),e.jsx("span",{className:"text-sm",children:t.icon}),t.label]},t.id)})})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[e.jsx("button",{onClick:b,className:"inline-flex items-center justify-center px-6 py-2.5 max-md:min-h-11 rounded-full bg-foreground text-background text-sm font-medium hover:bg-foreground/90 transition-colors",children:l.length>0||p?"Continue":"Skip"}),e.jsx("button",{onClick:w,className:"text-sm max-md:min-h-11 max-md:px-2 text-muted-foreground hover:text-foreground transition-colors",children:"Back"})]})]},"profile"),a===3&&e.jsxs(o.div,{...j,className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-serif font-medium tracking-tight text-foreground",children:"What's your main goal?"}),e.jsx("p",{className:"text-base text-muted-foreground",children:"Pick what matters most. We'll tailor your experience."})]}),e.jsx("div",{className:"flex flex-wrap gap-2.5",children:re.map((t,r)=>{const n=c.includes(t.id);return e.jsxs(o.button,{...u(r),onClick:()=>q(t.id),className:f("inline-flex items-center gap-2 px-4 py-2.5 rounded-full border text-sm font-medium transition-all duration-150",n?"border-foreground
1/40 bg-foreground/[0.08] text-foreground":"border-border hover:border-foreground/20 text-muted-foreground hover:text-foreground"),children:[n?e.jsx("div",{className:"w-5 h-5 rounded-full bg-foreground flex items-center justify-center",children:e.jsx(y,{className:"w-2.5 h-2.5 text-background"})}):e.jsx("div",{className:"w-5 h-5 rounded-full border border-foreground/20"}),e.jsx("span",{className:"text-sm",children:t.icon}),t.label]},t.id)})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:b,className:"inline-flex items-center justify-center px-6 py-2.5 max-md:min-h-11 rounded-full bg-foreground text-background text-sm font-medium hover:bg-foreground/90 transition-colors",children:c.length>0?"Continue":"Skip"}),e.jsx("button",{onClick:w,className:"text-sm max-md:min-h-11 max-md:px-2 text-muted-foreground hover:text-foreground transition-colors",children:"Back"})]})]},"goals"),a===4&&e.jsxs(o.div,{...j,className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-serif font-medium tracking-tight text-foreground",children:v?`You're all set, ${v}!`:"You're all set!"}),e.jsxs("p",{className:"text-lg text-muted-foreground leading-relaxed max-w-md",children:["We've set up a"," ",e.jsx("span",{className:"text-foreground font-medium",children:"Demo Account"})," ","with realistic sample trades so you can explore the analytics, charts, and journal right away."]})]}),e.jsx("div",{className:"space-y-5 pt-2",children:[{title:"It's sample data",desc:"Everything you'll see is a demo - clearly labeled, and your own account stays empty until you add real trades."},{title:"Add your own anytime",desc:"Hit Add Trade or Import and we'll switch you straight to your own journal."},{title:"Remove it in one click",desc:"Done exploring? Clear the demo from the banner whenever you like."}].map((t,r)=>e.jsxs(o.div,{...u(r),className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-1 w-5 h-5 rounded-full border border-foreground
1/20 flex items-center justify-center flex-shrink-0",children:e.jsx(y,{className:"w-3 h-3 text-foreground/60"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]})]},t.title))}),e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"One optional thing â how did you hear about us?"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ne.map(t=>{const r=E===t.id;return e.jsxs("button",{onClick:()=>J(r?null:t.id),className:f("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-medium transition-all duration-150",r?"border-foreground/40 bg-foreground/[0.08] text-foreground":"border-border hover:border-foreground/20 text-muted-foreground hover:text-foreground"),children:[e.jsx("span",{children:t.icon}),t.label]},t.id)})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o.button,{...u(3),onClick:()=>z(),disabled:N,className:"inline-flex items-center justify-center px-6 py-2.5 max-md:min-h-11 rounded-full bg-foreground text-background text-sm font-medium hover:bg-foreground
1/90 transition-colors disabled:opacity-60",children:N?"Setting upâ¦":"Explore the demo â"}),!N&&e.jsx("button",{onClick:w,className:"text-sm max-md:min-h-11 max-md:px-2 text-muted-foreground hover:text-foreground transition-colors",children:"Back"})]})]},"ready")]})]})]})};export{ue 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.