PageSourceSearch

https://tradeintelx.com/assets/index-DeISjUgD.js

js tradeintelx.com collected 2026-10-02 01:46:30 UTC 465,009 bytes, 286 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/market-core-B8Bfud51.js","assets/chartjs-vendor-CJ58C3gX.js","assets/rolldown-runtime-ChpBd9eV.js","assets/chat-page-C-flp553.js","assets/chat-page-BXqTKTIP.css","assets/firebase-messaging-CsDg6nnc.js","assets/firebase-core-BBMsJHd4.js","assets/education-page-Buqr-MLV.js","assets/community-page-dub7UFXa.js","assets/community-page-zj3fMWjX.css","assets/dashboard-page-BSnUBMUY.js","assets/markdown-vendor-BgBZRf5M.js","assets/market-core-15RKgApK.css","assets/WaveBackground-C4BlsBTe.js","assets/OnboardingFlow-CzkwiWyl.js","assets/OnboardingBrokerStep-B3jBJy5l.js","assets/esm-BFtmY71Z.js","assets/OnboardingV2-Ct1Ue_Oz.js","assets/market-utils-Cr7j4rnq.js","assets/SkipFrictionModal-DijuatrX.js","assets/OnboardingV3-CYEauCLq.js","assets/motion-vendor-KILcgk2q.js","assets/react-icons-vendor-Cpb90wOl.js","assets/ForPropFirms-Cu07cm1q.js","assets/SolutionPageShell-_HaSJFyF.js","assets/ForCoaches-CVRxdAVI.js","assets/SignUp-D1INrYwO.js","assets/PhoneAuth-Bm9eF1Mm.js","assets/SignIn-ldd7uD4g.js","assets/icons-vendor-DpKLKbbD.js","assets/ForgotPassword-Bsr6c5Rq.js","assets/CompleteProfile-xD1GLxjJ.js","assets/PrivacyPolicy-DhEhF4Tl.js","assets/LegalDocument-CSnl9wOo.js","assets/TermsOfService-BWO1O7H3.js","assets/CookiePolicyPage-BO5gWtRk.js","assets/DPAPage-alNBeVlh.js","assets/ProvisioningPage-D55X_jKw.js","assets/NotificationsPage-CTk8Hnya.js","assets/NotificationSettingsPage-MMENT5Ov.js","assets/NotificationSettingsPanel-CqGbaaEM.js","assets/Dashboard-DwQu51WR.js","assets/news-page-D8qM5-AC.js","assets/lwcharts-vendor-C-uNSiLH.js","assets/news-page-DgF3EPhA.css","assets/GettingStartedWidget-nYAyJWCX.js","assets/SymbolSearchInput-LlpvwwZS.js","assets/TodayPage-Bl1dxYuv.js","assets/trading-charts-uBzRtfFs.js","assets/EmptyStateCard-5omhNgM0.js","assets/RuleSuggestion-BT4YQyLo.js","assets/InsightCard-CbSYsRiV.js","assets/DailyWatchlistEnhanced-cXoV-7jq.js","assets/EndOfDaySummary-BuE4gnWP.js","assets/CouncilChatPanel-BrbnSO-e.js","assets/AgentDashboard-CupzoTLH.js","assets/RecentDeviations-DqHgThR8.js","assets/ApiKeyManager-B1c7Nd4i.js","assets/StrategyLab-DVOy8Ten.js","assets/ApiDocs-DmzII-h6.js","assets/CoursePlayer-C9jPLAYF.js","assets/edu-DTZkNTDx.js","assets/CourseStudio-DC202MFH.js","assets/CommandPalette-BEddz9kT.js","assets/MainSettingsModal-BWETMcpT.js","assets/BrokerConnectionPanel-BX7F78fU.js","assets/BehaviorClearedCelebration-Bw9ci3ZJ.js","assets/EnforcementAuthorizationModal-L6OXFcTg.js","assets/esm-CDfoBdmC.js","assets/agentRepository-BrIFKQub.js","assets/esm-CVfcfslk.js"])))=>i.map(i=>d[i]);
2import{o as Xt}from"./rolldown-runtime-ChpBd9eV.js";import{An as qs,Ar as tt,B as Qa,Ba as fe,C as Dt,Cn as Ja,Cr as Ks,D as ca,Di as Xs,Dn as Qs,E as Js,F as Za,Fa as Zs,Ga as er,Gt as tr,Ha as ar,Ht as sr,Ia as q,In as Ut,Ka as rr,La as Re,Mr as nr,Ni as ir,Nt as or,P as lr,Pa as cr,Ra as _,Rn as da,Rr as dr,S as mr,Sr as xr,Tr as Ne,U as Vt,U
2a as es,Va as me,Vi as at,Vn as $e,W as ts,Wa as $,Wi as as,Xr as Ft,Yt as Qt,_r as pr,_t as wt,at as Jt,ba as f,br as Ce,ca as Ct,cn as ur,da as Tt,dt as hr,et as st,fn as jt,fr as gr,ga as ye,gt as ma,ir as br,ji as ss,jt as Zt,k as fr,kr as ge,ln as rs,lr as yr,ma as vr,mr as wr,mt as rt,nn as kt,nt as jr,on as ns,pa as kr,pn as Rt,pr as Nr,qn as xa,rn as Sr,st as is,ti as Cr,tn as os,tt as qe,un as Tr,va as Rr,vn as ea,vr as Er,w as pa,wa as se,wi as Ar,x as Ir,xr as Be,xt as _r,ya as ua,yn as Pr,yr as Lr,za as Mr}from"./chat-page-C-flp553.js";import{t as Dr}from"./react-vendor-C5Xd5nER.js";import{a as ha,i as _e,r as Fr}from"./motion-vendor-KILcgk2q.js";import{$l as Ot,$s as Or,As as $r,Au as Br,Bs as zr,Bu as Wr,Cs as Ur,Ds as Vr,Du as Hr,El as Gr,Es as Yr,Fl as qr,Fs as Kr,Fu as Xr,Gs as Qr,Hs as Jr,Is as Zr,Iu as en,Jl as Et,Js as tn,Ks as an,Ls as sn,Lu as rn,Ml as ga,Ms as nn,Mu as on,Ns as ln,Nu as cn,Ol as dn,Os as ba,Ou as mn,Ps as xn,Pu as pn,Ql as un,Rs as hn,Ss as gn,Ts as bn,Us as fn,Vs as yn,Vu as ls,Ws as vn,Xl as wn,Yl as jn,Ys as W,Zl as kn,_s as Nn,as as Sn,bl as ta,bs as Cn,cs as Tn,ds as Rn,ec as En,es as An,eu as In,fs as _n,gl as Pn,gs as Ln,hs as Mn,ic as Dn,is as Fn,js as On,ju as $n,ks as Bn,ls as zn,lu as cs,ms as ze,mu as Wn,nu as Un,os as Vn,pu as Hn,qs as Gn,rc as Yn,rs as qn,ru as fa,ss as Kn,tc as Xn,ts as Qn,tu as Jn,vs as Zn,ws as ei,xs as ti,ys as ai,zl as At,zs as si}from"./market-core-B8Bfud51.js";import{t as ri}from"./query-vendor-C5De9gV6.js";import{C as ds,D as ni,E as ii,O as oi,S as li,T as ci,_ as di,b as ya,g as mi,k as xi,x as pi}from"./market-utils-Cr7j4rnq.js";import{Bt as va,Hn as ui,Hr as hi,It as gi,J as bi,Jn as Nt,Jr as It,Kn as ms,Ln as Ae,R as fi,Un as yi,Vn as vi,Vr as wi,Xr as wa,Y as ji,bn as ki,cn as Ni,hn as Si,ir as ve,nr as Ci,rn as ja,rr as Ti,sr as aa,xt as ka,zn as Ri,zr as Ke}from"./community-page-dub7UFXa.js";import{A as xs,At as Ei,Ft as Ht,Gt as Ai,J as Ii,Nt as _i,Q as sa,Qt as Pi,R as Li,St as Mi,Tt as Di,Ut as ps,Vt as Fi,Xt as Oi,Y as $i,Zt as nt,b as ra,en as Bi,et as us,j as zi,m as Wi,n as Ui,o as Vi,qt as $t,t as Hi,tt as Gi,x as Yi,xt as qi}from"./react-icons-vendor-Cpb90wOl.js";import{Ct as na,Dt as Ki,Et as Xi,Nt as hs,Qt as gs,Yt as Qi,en as Ji,kt as Zi,nn as eo,qt as to,rn as ao,yt as bs}from"./education-page-Buqr-MLV.js";import{$ as so,D as fs,P as ro,R as ys,U as vs,Y as ws,Z as js,_ as ks,a as Ns,at as no,dt as io,et as oo,l as lo,lt as co,mt as mo,q as xo,tt as po,ut as uo,x as ho}from"./icons-vendor-DpKLKbbD.js";import{_ as Ie}from"./chartjs-vendor-CJ58C3gX.js";import{k as go}from"./dashboard-page-BSnUBMUY.js";import"./news-page-D8qM5-AC.js";import{c as bo,s as fo}from"./trading-charts-uBzRtfFs.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();var yo=Xt(Dr(),1),o=Xt(rr(),1),e=cr();function vo(){const[t,a]=(0,o.useState)(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,o.useEffect)(()=>{const s=window.matchMedia("(prefers-reduced-motion: reduce)"),n=r=>a(r.matches);return s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),t}var St=({size:t=100,flipped:a=!1})=>{const s=a?"ql-hg-b":"ql-hg-a";return(0,e.jsxs)("svg",{width:t,height:t*1.4,viewBox:"-32 -45 64 90",style:{transform:a?"scaleX(-1)":"none",overflow:"visible",display:"block"},children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("radialGradient",{id:s,cx:"35%",cy:"30%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(160,210,255,0.7)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(30,80,180,0.15)"})]})}),(0,e.jsx)("path",{d:"M 8 30 Q 40 5 55 -35",stroke:"rgba(255,255,255,0.12)",strokeWidth:"1",fill:"none",strokeDasharray:"3,5"}),(0,e.jsx)("rect",{x:"-14",y:"-2",width:"7",height:"15",rx:"2.5",fill:"rgba(220,38,38,0.35)",stroke:"rgba(255,120,120,0.5)",strokeWidth:"1"}),(0,e.jsx)("ellipse",{cx:"-10.5",cy:"16",rx:"3",ry:"5",fill:"rgba(255,140,40,0.25)"}),(0,e.jsx)("ellipse",{cx:"-10.5",cy:"18",rx:"1.5",ry:"3",fill:"rgba(255,220,80,0.35)"}),(0,e.jsx)("rect",{x:"-11",y:"-4",width:"22",height:"21",rx:"7",fill:"rgba(255,255,255,0.07)",stroke:"rgba(255,255,255,0.32)",strokeWidth:"1.5"}),(0,e.jsx)("rect",{x:"-5",y:"3",width:"10",height:"7",rx:"2",fill:"rgba(220,38,38,0.35)",stroke:"rgba(220,38,38,0.65)",strokeWidth:"1"}),(0,e.jsx)("circle",{cx:"-2",cy:"6.5",r:"1.2",fill:"#22c55e",opacity:"0.9"}),(0,e.jsx)("circle",{cx:"2",cy:"6.5",r:"1.2",fill:"#f59e0b",opacity:"0.8"}),(0,e.jsx)("path",{d:"M -11 3 Q -22 7 -24 16",stroke:"rgba(255,255,255,0.28)",strokeWidth:"5.5",strokeLinecap:"round",fill:"none"}),(0,e.jsx)("circle",{cx:"-24",cy:"17",r:"4",fill:"rgba(255,255,255,0.2)",stroke:"rgba(255,255,255,0.45)",strokeWidth:"1"}),(0,e.jsx)("path",{d:"M 11 3 Q 20 1 21 -9",stroke:"rgba(255,255,255,0.28)",strokeWidth:"5.5",strokeLinecap:"round",fill:"none"}),(0,e.jsx)("rect",{x:"18",y:"-20",width:"18",height:"13",rx:"2.5",fill:"rgba(5,10,20,0.9)",stroke:"rgba(80,180,255,0.55)",strokeWidth:"1"}),(0,e.jsx)("polyline",{points:"20,-13 22,-10 24,-14 26,-9 28,-11 34,-6",stroke:"#22c55e",strokeWidth:"0.9",fill:"none"}),(0,e.jsx)("path",{d:"M -5 17 Q -8 24 -7 32",stroke:"rgba(255,255,255,0.28)",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),(0,e.jsx)("ellipse",{cx:"-7",cy:"34",rx:"5.5",ry:"3",fill:"rgba(255,255,255,0.18)",stroke:"rgba(255,255,255,0.38)",strokeWidth:"1"}),(0,e.jsx)("path",{d:"M 5 17 Q 8 24 7 32",stroke:"rgba(255,255,255,0.28)",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),(0,e.jsx)("ellipse",{cx:"7",cy:"34",rx:"5.5",ry:"3",fill:"rgba(255,255,255,0.18)",stroke:"rgba(255,255,255,0.38)",strokeWidth:"1"}),(0,e.jsx)("circle",{cx:"0",cy:"-23",r:"18",fill:"rgba(200,225,255,0.06)",stroke:"rgba(255,255,255,0.38)",strokeWidth:"1.8"}),(0,e.jsx)("ellipse",{cx:"0",cy:"-22",rx:"12",ry:"10",fill:`url(#${s})`,stroke:"rgba(120,200,255,0.55)",strokeWidth:"1.2"}),(0,e.jsx)("ellipse",{cx:"-4",cy:"-27",rx:"4",ry:"2.2",fill:"rgba(255,255,255,0.38)",transform:"rotate(-18,-4,-27)"}),(0,e.jsx)("ellipse",{cx:"-2",cy:"-29",rx:"1.8",ry:"0.9",fill:"rgba(255,255,255,0.55)"}),(0,e.jsx)("ellipse",{cx:"0",cy:"-5",rx:"11",ry:"3.5",fill:"rgba(255,255,255,0.1)",stroke:"rgba(255,255,255,0.28)",strokeWidth:"1"}),(0,e.jsx)("line",{x1:"9",y1:"-39",x2:"9",y2:"-31",stroke:"rgba(255,255,255,0.38)",strokeWidth:"1.2"}),(0,e.jsx)("circle",{cx:"9",cy:"-40",r:"2",fill:"rgba(220,38,38,0.85)"})]})},bt=["Linking market data feed","Synchronizing order book","Loading account ledger","Calibrating risk engine","Arming execution gate","Rendering analytics surface"],wo=()=>{const[t,a]=(0,o.useState)(4);(0,o.useEffect)(()=>{const n=setInterval(()=>a(r=>Math.min(99.4,r+(100-r)*.055+Math.random()*.9)),150);return()=>clearInterval(n)},[]);const s=Math.min(bt.length-1,Math.floor(t/100*bt.length));return(0,e.jsxs)("div",{style:{width:252,marginTop:20,fontFamily:"monospace",pointerEvents:"none"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:13},children:[(0,e.jsxs)("div",{style:{flex:1,height:3,background:"rgba(255,255,255,0.08)",borderRadius:3,overflow:"hidden",position:"relative"},children:[(0,e.jsx)(f.div,{style:{position:"absolute",inset:0,transformOrigin:"left",borderRadius:3,background:"linear-gradient(90deg, #dc2626, #f87171)",boxShadow:"0 0 10px rgba(220,38,38,0.6)"},animate:{scaleX:t/100},transition:{ease:"easeOut",duration:.35}}),(0,e.jsx)(f.div,{style:{position:"absolute",top:0,bottom:0,width:"28%",background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent)"},animate:{x:["-28%","360%"]},transition:{duration:1.4,repeat:1/0,ease:"easeInOut"}})]}),(0,e.jsxs)("span",{style:{fontSize:10,fontWeight:700,color:"rgba(255,255,255,0.72)",minWidth:30,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:[Math.round(t),"%"]})]}),(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:5},children:bt.map((n,r)=>{const i=r<s,c=r===s;return(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:8.5,letterSpacing:"0.09em",textTransform:"uppercase",opacity:i?.5:c?1:.22,transition:"opacity 0.4s"},children:[i?(0,e.jsx)("span",{style:{color:"#22c55e",fontSize:9,width:9,textAlign:"center"},children:"✓"}):c?(0,e.jsx)(f.span,{style:{width:8,height:8,borderRadius:"50%",border:"1.5px solid #f87171",borderTopColor:"transparent",display:"inline-block"},animate:{rotate:360},transition:{duration:.7,repeat:1/0,ease:"linear"}}):(0,e.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.22)",display:"inline-block"}}),(0,e.jsxs)("span",{style:{color:c?"rgba(255,255,255,0.92)":"rgba(255,255,255,0.55)",whiteSpace:"nowrap"},children:[n,c?"…":""]}),c&&(0,e.jsx)(f.span,{style:{marginLeft:"auto",fontSize:7.5,color:"rgba(248,113,113,0.8)",letterSpacing:"0.1em"}
2,animate:{opacity:[.3,1,.3]},transition:{duration:1.1,repeat:1/0,ease:"easeInOut"},children:"BUSY"})]},n)})})]})},jo=()=>{const[t,a]=(0,o.useState)(()=>new Date);(0,o.useEffect)(()=>{const d=setInterval(()=>a(new Date),1e3);return()=>clearInterval(d)},[]);const s=t.toLocaleTimeString("en-US",{timeZone:"America/New_York",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),n=String(t.getMilliseconds()).padStart(3,"0").slice(0,2),r=[t.getUTCFullYear(),String(t.getUTCMonth()+1).padStart(2,"0"),String(t.getUTCDate()).padStart(2,"0")].join("."),i={fontFamily:"monospace",fontSize:10,fontWeight:600,letterSpacing:"0.22em",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",pointerEvents:"none"},c={color:"rgba(255,255,255,0.78)"};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"absolute",style:{left:24,top:22,zIndex:12,...i,display:"flex",alignItems:"center",gap:8},children:[(0,e.jsx)("span",{style:{width:7,height:7,borderRadius:4,background:"#22c55e",boxShadow:"0 0 10px #22c55e"}}),(0,e.jsxs)("span",{children:["SYS · ",(0,e.jsx)("span",{style:c,children:"ONLINE"})]})]}),(0,e.jsxs)("div",{className:"absolute",style:{right:24,top:22,zIndex:12,...i},children:["ET · ",(0,e.jsxs)("span",{style:c,children:[s,".",n]})]}),(0,e.jsxs)("div",{className:"absolute",style:{left:24,bottom:40,zIndex:12,...i,lineHeight:1.7},children:[(0,e.jsxs)("div",{children:["LAT ",(0,e.jsx)("span",{style:c,children:"28.5729° N"})]}),(0,e.jsxs)("div",{children:["LON ",(0,e.jsx)("span",{style:c,children:"80.6490° W"})]}),(0,e.jsxs)("div",{children:["STATION · ",(0,e.jsx)("span",{style:c,children:"KSC-39A"})]})]}),(0,e.jsxs)("div",{className:"absolute",style:{right:24,bottom:40,zIndex:12,...i,textAlign:"right",lineHeight:1.7},children:[(0,e.jsxs)("div",{children:["BUILD ",(0,e.jsx)("span",{style:c,children:r})]}),(0,e.jsx)("div",{children:"TRADEINTELX.COM"})]})]})},Gt=[["SPY","587.34","+0.82%",!0],["QQQ","472.18","+1.05%",!0],["NVDA","138.76","+2.31%",!0],["BTC","94,250","-1.24%",!1],["TSLA","312.45","-0.68%",!1],["AAPL","229.10","+0.44%",!0],["ETH","5,180","+3.12%",!0],["MSFT","451.22","-0.21%",!1],["META","612.40","+1.77%",!0],["GLD","241.55","+0.33%",!0]],ko=()=>{const t=[...Gt,...Gt];return(0,e.jsx)("div",{style:{position:"absolute",left:0,right:0,bottom:0,height:28,zIndex:11,overflow:"hidden",display:"flex",alignItems:"center",pointerEvents:"none",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(3,6,9,0.62)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)"},children:(0,e.jsx)(f.div,{style:{display:"flex",gap:26,whiteSpace:"nowrap",fontFamily:"monospace",fontSize:10,paddingLeft:26},animate:{x:["0%","-50%"]},transition:{duration:34,repeat:1/0,ease:"linear"},children:t.map(([a,s,n,r],i)=>(0,e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7},children:[(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.5)",fontWeight:700,letterSpacing:"0.1em"},children:a}),(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.85)",fontWeight:700},children:s}),(0,e.jsxs)("span",{style:{color:r?"#22c55e":"#ef4444",fontWeight:600},children:[r?"▲":"▼"," ",n]}),(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.12)",marginLeft:4},children:"|"})]},i))})})},No=Array.from({length:180},(t,a)=>({cx:(a*137.508+60)%1440,cy:(a*97.233+a*1.618+30)%900,r:.3+a%5*.28,opacity:.25+a%8*.065,bright:a%9===0})),dt=Array.from({length:48},(t,a)=>{const s=450+Math.sin(a*.65)*22+Math.sin(a*.2)*35,n=s+Math.sin(a*2.71+.8)*9;return{o:s,c:n,h:Math.max(s,n)+Math.abs(Math.sin(a*3.1))*4,l:Math.min(s,n)-Math.abs(Math.sin(a*1.9))*4}}),So=()=>{const t=Math.max(...dt.map(l=>l.h)),a=Math.min(...dt.map(l=>l.l)),s=504,n=333,r=27,i=l=>837-(l-a)/(t-a+.01)*n,c={fontFamily:"monospace",fontSize:10,fontWeight:600,letterSpacing:"0.22em",color:"rgba(255,255,255,0.4)",textTransform:"uppercase",pointerEvents:"none"},d={color:"rgba(255,255,255,0.78)"};return(0,e.jsxs)("div",{style:{background:"#030609",position:"fixed",inset:0,zIndex:9999,overflow:"hidden"},children:[(0,e.jsxs)("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",zIndex:1},viewBox:"0 0 1440 900",preserveAspectRatio:"xMidYMid slice",children:[(0,e.jsxs)("defs",{children:[(0,e.jsxs)("radialGradient",{id:"qls-neb1",cx:"75%",cy:"18%",r:"38%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(139,92,246,0.055)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(0,0,0,0)"})]}),(0,e.jsxs)("radialGradient",{id:"qls-neb2",cx:"15%",cy:"72%",r:"30%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(220,38,38,0.045)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(0,0,0,0)"})]}),(0,e.jsxs)("radialGradient",{id:"qls-neb3",cx:"50%",cy:"50%",r:"22%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(59,130,246,0.032)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(0,0,0,0)"})]}),(0,e.jsxs)("radialGradient",{id:"qls-planetCore",cx:"38%",cy:"35%",r:"60%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#4a1520"}),(0,e.jsx)("stop",{offset:"45%",stopColor:"#2a0810"}),(0,e.jsx)("stop",{offset:"80%",stopColor:"#1a0508"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#080208"})]}),(0,e.jsxs)("radialGradient",{id:"qls-planetAtmo",cx:"50%",cy:"50%",r:"50%",children:[(0,e.jsx)("stop",{offset:"78%",stopColor:"rgba(0,0,0,0)"}),(0,e.jsx)("stop",{offset:"90%",stopColor:"rgba(180,20,30,0.13)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(220,38,38,0.06)"})]}),(0,e.jsxs)("linearGradient",{id:"qls-ringGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(220,38,38,0)"}),(0,e.jsx)("stop",{offset:"35%",stopColor:"rgba(220,38,38,0.55)"}),(0,e.jsx)("stop",{offset:"65%",stopColor:"rgba(180,30,30,0.7)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(139,92,246,0)"})]}),(0,e.jsxs)("linearGradient",{id:"qls-sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(34,197,94,0.22)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(34,197,94,0)"})]}),(0,e.jsxs)("linearGradient",{id:"qls-chartFade",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(3,6,9,1)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(3,6,9,0)"})]}),(0,e.jsxs)("radialGradient",{id:"qls-vignette",cx:"50%",cy:"50%",r:"55%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(3,6,9,0)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(3,6,9,0.88)"})]})]}),(0,e.jsx)("rect",{width:"1440",height:"900",fill:"#030609"}),(0,e.jsx)("rect",{width:"1440",height:"900",fill:"url(#qls-neb1)"}),(0,e.jsx)("rect",{width:"1440",height:"900",fill:"url(#qls-neb2)"}),(0,e.jsx)("rect",{width:"1440",height:"900",fill:"url(#qls-neb3)"}),Array.from({length:15},(l,x)=>(0,e.jsx)("line",{x1:x*1440/14,y1:"0",x2:x*1440/14,y2:"900",stroke:"rgba(255,255,255,0.028)",strokeWidth:"1"},`vg${x}`)),Array.from({length:10},(l,x)=>(0,e.jsx)("line",{x1:"0",y1:x*900/9,x2:"1440",y2:x*900/9,stroke:"rgba(255,255,255,0.028)",strokeWidth:"1"},`hg${x}`)),No.map((l,x)=>l.bright?(0,e.jsx)("circle",{cx:l.cx,cy:l.cy,r:l.r+.6,fill:`rgba(200,230,255,${(l.opacity+.18).toFixed(2)})`,style:{filter:"blur(1px)"}},x):(0,e.jsx)("circle",{cx:l.cx,cy:l.cy,r:l.r,fill:`rgba(220,235,255,${l.opacity.toFixed(2)})`},x)),dt.slice(0,38).map((l,x)=>{const h=l.c>=l.o,m=x*36,p=i(Math.max(l.o,l.c)),g=Math.max(2,Math.abs(i(l.o)-i(l.c)));return(0,e.jsxs)("g",{children:[(0,e.jsx)("line",{x1:m+r/2,y1:i(l.h),x2:m+r/2,y2:i(l.l),stroke:h?"#22c55e":"#ef4444",strokeWidth:"1.3"}),(0,e.jsx)("rect",{x:m,y:p,width:r,height:g,fill:h?"rgba(34,197,94,0.22)":"rgba(239,68,68,0.22)",stroke:h?"#22c55e":"#ef4444",strokeWidth:"1.3"})]},x)}),(0,e.jsx)("polyline",{points:dt.slice(0,38).map((l,x)=>`${x*36+r/2},${i(l.c)}`).join(" "),stroke:"#dc2626",strokeWidth:"2",fill:"none",style:{filter:"drop-shadow(0 0 6px #dc2626)"}}),(0,e.jsx)("rect",{x:"0",y:s-40,width:"1440",height:"110",fill:"url(#qls-chartFade)"}),(0,e.jsx)("rect",{width:"1440",height:"900",fill:"url(#qls-vignette)"})]}),[{sym:"SPY",price:"587.34",chg:"+0.82%",up:!0,pos:{left:"3%",top:"14%"}},{sym:"BTC",price:"94,250",chg:"-1.24%",up:!1,pos:{left:"3%",top:"55%"}}
2,{sym:"QQQ",price:"472.18",chg:"+1.05%",up:!0,pos:{right:"3%",top:"10%"}},{sym:"NVDA",price:"138.76",chg:"+2.31%",up:!0,pos:{right:"3%",top:"50%"}},{sym:"TSLA",price:"312.45",chg:"-0.68%",up:!1,pos:{right:"3%",top:"65%"}}].map(l=>(0,e.jsx)("div",{style:{position:"absolute",...l.pos,zIndex:4},children:(0,e.jsxs)("div",{style:{background:"rgba(255,255,255,0.042)",border:"1px solid rgba(255,255,255,0.09)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderRadius:10,padding:"7px 13px",minWidth:82},children:[(0,e.jsx)("div",{style:{fontSize:8,fontWeight:700,letterSpacing:"0.15em",color:"rgba(255,255,255,0.4)",fontFamily:"monospace",marginBottom:2},children:l.sym}),(0,e.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#fff",fontFamily:"monospace",marginBottom:2},children:l.price}),(0,e.jsx)("div",{style:{fontSize:8,fontWeight:600,color:l.up?"#22c55e":"#ef4444",fontFamily:"monospace"},children:l.chg})]})},l.sym)),(0,e.jsx)("div",{style:{position:"absolute",left:"2%",top:"18%",zIndex:3},children:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsx)(St,{size:105}),(0,e.jsxs)("div",{style:{position:"absolute",top:"15%",left:"108%",background:"rgba(8,12,24,0.82)",border:"1px solid rgba(220,38,38,0.22)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:10,padding:"8px 12px",minWidth:112,boxShadow:"0 4px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(220,38,38,0.08)"},children:[(0,e.jsx)("div",{style:{fontSize:7,fontWeight:700,letterSpacing:"0.18em",color:"rgba(255,255,255,0.35)",fontFamily:"monospace",marginBottom:3},children:"SPX"}),(0,e.jsx)("div",{style:{fontSize:14,fontWeight:800,color:"#fff",fontFamily:"monospace",marginBottom:5,letterSpacing:"-0.01em"},children:"587.99"}),(0,e.jsxs)("svg",{width:"84",height:"24",viewBox:"0 0 84 24",style:{display:"block",marginBottom:4},children:[(0,e.jsx)("polyline",{points:"0,20 14,17 28,12 42,15 56,8 70,5 84,2 84,24 0,24",fill:"url(#qls-sparkGrad)",stroke:"none"}),(0,e.jsx)("polyline",{points:"0,20 14,17 28,12 42,15 56,8 70,5 84,2",stroke:"#22c55e",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("div",{style:{fontSize:8,fontWeight:600,color:"#22c55e",fontFamily:"monospace",letterSpacing:"0.05em"},children:"▲ +0.82%"})]})]})}),(0,e.jsx)("div",{style:{position:"absolute",right:"2%",top:"28%",zIndex:3},children:(0,e.jsx)(St,{size:68,flipped:!0})}),(0,e.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,pointerEvents:"none"},children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,e.jsxs)("div",{style:{position:"relative",width:120,height:120,marginBottom:16},children:[(0,e.jsxs)("svg",{style:{position:"absolute",inset:0,overflow:"visible"},width:"120",height:"120",viewBox:"0 0 120 120",children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(220,38,38,0.38)",strokeWidth:"1.5",strokeDasharray:"9,7",transform:"rotate(-25,60,60)"}),(0,e.jsx)("circle",{cx:"113",cy:"60",r:"4.5",fill:"rgba(220,38,38,0.9)",transform:"rotate(-25,60,60)"})]}),(0,e.jsxs)("svg",{style:{position:"absolute",inset:0,overflow:"visible"},width:"120",height:"120",viewBox:"0 0 120 120",children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(255,255,255,0.12)",strokeWidth:"1",strokeDasharray:"5,9",transform:"rotate(35,60,60)"}),(0,e.jsx)("circle",{cx:"7",cy:"60",r:"3",fill:"rgba(255,255,255,0.5)",transform:"rotate(35,60,60)"})]}),(0,e.jsxs)("svg",{style:{position:"absolute",inset:0,overflow:"visible"},width:"120",height:"120",viewBox:"0 0 120 120",children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(139,92,246,0.25)",strokeWidth:"1",strokeDasharray:"3,13",transform:"rotate(70,60,60)"}),(0,e.jsx)("circle",{cx:"60",cy:"7",r:"2.5",fill:"rgba(139,92,246,0.75)",transform:"rotate(70,60,60)"})]}),(0,e.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,e.jsx)("img",{src:"/RedlineOS_AppIcon_1024x1024.png",alt:"Redline",style:{width:76,height:76,borderRadius:17,boxSh
2adow:"0 0 55px rgba(220,38,38,0.45), 0 0 22px rgba(220,38,38,0.2), 0 8px 32px rgba(0,0,0,0.75)"}})})]}),(0,e.jsx)("div",{style:{fontSize:27,fontWeight:900,letterSpacing:"0.12em",color:"#fff",fontFamily:"sans-serif",textShadow:"0 0 45px rgba(220,38,38,0.65), 0 0 90px rgba(220,38,38,0.2)"},children:"REDLINE"}),(0,e.jsxs)("div",{style:{fontSize:9,fontWeight:600,letterSpacing:"0.28em",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",marginTop:5,marginBottom:10,display:"flex",alignItems:"center",gap:8},children:[(0,e.jsx)("span",{style:{height:1,width:24,background:"linear-gradient(90deg, transparent, rgba(220,38,38,0.85))"}}),(0,e.jsx)("span",{children:"Trading OS · v3.0"}),(0,e.jsx)("span",{style:{height:1,width:24,background:"linear-gradient(270deg, transparent, rgba(220,38,38,0.85))"}})]}),(0,e.jsxs)("div",{style:{width:252,marginTop:20,fontFamily:"monospace",pointerEvents:"none"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:13},children:[(0,e.jsx)("div",{style:{flex:1,height:3,background:"rgba(255,255,255,0.08)",borderRadius:3,overflow:"hidden"},children:(0,e.jsx)("div",{style:{width:"65%",height:"100%",background:"linear-gradient(90deg, #dc2626, #f87171)",borderRadius:3,boxShadow:"0 0 10px rgba(220,38,38,0.6)"}})}),(0,e.jsx)("span",{style:{fontSize:10,fontWeight:700,color:"rgba(255,255,255,0.72)",minWidth:30,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:"65%"})]}),(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:5},children:bt.map((l,x)=>{const h=x<3,m=x===3;return(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:8.5,letterSpacing:"0.09em",textTransform:"uppercase",opacity:h?.5:m?1:.22},children:[h?(0,e.jsx)("span",{style:{color:"#22c55e",fontSize:9,width:9,textAlign:"center"},children:"✓"}):m?(0,e.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",border:"1.5px solid #f87171",display:"inline-block"}}):(0,e.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.22)",display:"inline-block"}}),(0,e.jsx)("span",{style:{color:m?"rgba(255,255,255,0.92)":"rgba(255,255,255,0.55)",whiteSpace:"nowrap"},children:l})]},l)})})]})]})}),(0,e.jsxs)("div",{style:{position:"absolute",left:24,top:22,zIndex:12,...c,display:"flex",alignItems:"center",gap:8},children:[(0,e.jsx)("span",{style:{width:7,height:7,borderRadius:4,background:"#22c55e",boxShadow:"0 0 10px #22c55e"}}),(0,e.jsxs)("span",{children:["SYS · ",(0,e.jsx)("span",{style:d,children:"ONLINE"})]})]}),(0,e.jsxs)("div",{style:{position:"absolute",right:24,top:22,zIndex:12,...c},children:["ET · ",(0,e.jsx)("span",{style:d,children:"STANDBY"})]}),(0,e.jsxs)("div",{style:{position:"absolute",left:24,bottom:40,zIndex:12,...c,lineHeight:1.7},children:[(0,e.jsxs)("div",{children:["LAT ",(0,e.jsx)("span",{style:d,children:"28.5729° N"})]}),(0,e.jsxs)("div",{children:["LON ",(0,e.jsx)("span",{style:d,children:"80.6490° W"})]}),(0,e.jsxs)("div",{children:["STATION · ",(0,e.jsx)("span",{style:d,children:"KSC-39A"})]})]}),(0,e.jsxs)("div",{style:{position:"absolute",right:24,bottom:40,zIndex:12,...c,textAlign:"right",lineHeight:1.7},children:[(0,e.jsxs)("div",{children:["BUILD ",(0,e.jsx)("span",{style:d,children:"2026.06.25"})]}),(0,e.jsx)("div",{children:"TRADEINTELX.COM"})]}),(0,e.jsxs)("div",{style:{position:"absolute",left:"50%",bottom:"-18%",transform:"translateX(-50%)",zIndex:2,pointerEvents:"none"},children:[(0,e.jsx)("div",{style:{position:"absolute",inset:"-28px",background:"radial-gradient(ellipse at center, rgba(180,20,20,0.2) 0%, rgba(100,10,10,0.09) 42%, transparent 68%)",filter:"blur(22px)",borderRadius:"50%",pointerEvents:"none"}}),(0,e.jsxs)("svg",{width:"520",height:"520",viewBox:"0 0 520 520",style:{overflow:"visible"},children:[(0,e.jsx)("ellipse",{cx:"260",cy:"260",rx:"240",ry:"64",fill:"none",stroke:"url(#qls-ringGrad)",strokeWidth:"1.5",transform:"rotate(-22 260 260)"}),(0,e.jsx)("ellipse",{cx:"260",cy:"260",rx:"218",ry:"57",fill:"none",stroke:"rgba(220,38,38,0.14)",strokeWidth:"1",transform:"rotate(-22 260 260)"}),(0,e.jsx)("circle",{cx:"260",cy:"260",r:"155",fill:"url(#qls-planetCore)"}),(0,e.jsx)("circle",{cx:"260",cy:"260",r:"155",fill:"url(#qls-planetAtmo)"}),(0,e.jsx)("ellipse",{cx:"232",cy:"240",rx:"58",ry:"13",fill:"rgba(100,20,20,0.1)",transform:"rotate(-12, 232, 240)"}),(0,e.jsx)("ellipse",{cx:"288",cy:"278",rx:"46",ry:"11",fill:"rgba(80,15,15,0.07)",transform:"rotate(9, 288, 278)"})]})]}),(0,e.jsx)("div",{style:{position:"absolute",left:0,right:0,bottom:0,height:28,zIndex:11,overflow:"hidden",display:"flex",alignItems:"center",pointerEvents:"none",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(3,6,9,0.62)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)"},children:(0,e.jsx)("div",{style:{display:"flex",gap:26,whiteSpace:"nowrap",fontFamily:"monospace",fontSize:10,paddingLeft:26},children:Gt.map(([l,x,h,m],p)=>(0,e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7},children:[(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.5)",fontWeight:700,letterSpacing:"0.1em"},children:l}),(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.85)",fontWeight:700},children:x}),(0,e.jsxs)("span",{style:{color:m?"#22c55e":"#ef4444",fontWeight:600},children:[m?"▲":"▼"," ",h]}),(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.12)",marginLeft:4},children:"|"})]},p))})})]})};function Co(){const t=vo(),a=(0,o.useRef)(null),s=(0,o.useRef)({x:.5,y:.5}),[n,r]=(0,o.useState)(0);(0,o.useEffect)(()=>
2{if(t)return;const d=l=>{s.current={x:l.clientX/window.innerWidth,y:l.clientY/window.innerHeight}};return window.addEventListener("mousemove",d,{passive:!0}),()=>window.removeEventListener("mousemove",d)},[t]),(0,o.useEffect)(()=>{if(t)return;const d=setInterval(()=>r(l=>l+1),180);return()=>clearInterval(d)},[t]),(0,o.useEffect)(()=>{if(t)return;const d=a.current;if(!d)return;const l=d.getContext("2d");let x;const h=()=>{d.width=window.innerWidth,d.height=window.innerHeight};h(),window.addEventListener("resize",h);const m=Array.from({length:220},()=>({x:Math.random(),y:Math.random(),r:Math.random()*1.6+.2,phase:Math.random()*Math.PI*2,speed:Math.random()*.025+.006,bright:Math.random()>.85,depth:Math.random()*.85+.15})),p=[],g=[];let k=450;for(let b=0;b<120;b++){const j=k,T=j+(Math.random()-.46)*9;g.push({o:j,c:T,h:Math.max(j,T)+Math.random()*4.5,l:Math.min(j,T)-Math.random()*4.5,vol:.3+Math.random()*.7}),k=T}const v=22,u=Math.ceil((d.width||400)/v),E=Array.from({length:u},(b,j)=>({x:j*v,y:Math.random()*(d.height||800),speed:1.5+Math.random()*2.5,chars:Array.from({length:18},()=>Math.random()>.5?Math.random().toFixed(1):["↑","↓","$","%","₿","▲","▼"][Math.floor(Math.random()*7)]),alpha:.025+Math.random()*.04}));let C=0,y=0,w=0;const N=()=>{const b=d.width,j=d.height,T=s.current.x,z=s.current.y,O=(T-.5)*20,P=(z-.5)*14;l.fillStyle="#030609",l.fillRect(0,0,b,j),[[b*.75,j*.18,b*.38,"rgba(139,92,246,0.055)"],[b*.15,j*.72,b*.3,"rgba(220,38,38,0.045)"],[b*.5,j*.5,b*.22,"rgba(59,130,246,0.032)"]].forEach(([R,Y,ee,re])=>{const le=l.createRadialGradient(R,Y,0,R,Y,ee);le.addColorStop(0,re),le.addColorStop(1,"rgba(0,0,0,0)"),l.fillStyle=le,l.fillRect(0,0,b,j)}),l.strokeStyle="rgba(255,255,255,0.028)",l.lineWidth=1;for(let R=0;R<=14;R++)l.beginPath(),l.moveTo(R*b/14,0),l.lineTo(R*b/14,j),l.stroke();for(let R=0;R<=9;R++)l.beginPath(),l.moveTo(0,R*j/9),l.lineTo(b,R*j/9),l.stroke();l.font="10px monospace",E.forEach(R=>{R.chars.forEach((Y,ee)=>{l.fillStyle=`rgba(34,197,94,${Math.max(0,R.alpha-ee*.003)})`,l.fillText(Y,R.x,((R.y-ee*16)%j+j)%j)}),R.y=(R.y+R.speed)%j}),m.forEach(R=>{const Y=.35+.65*Math.abs(Math.sin(y*R.speed+R.phase)),ee=R.x*b+O*R.depth,re=R.y*j+P*R.depth;R.bright&&(l.save(),l.shadowColor="#cce8ff",l.shadowBlur=8),l.fillStyle=`rgba(220,235,255,${Y})`,l.beginPath(),l.arc(ee,re,R.r,0,Math.PI*2),l.fill(),R.bright&&l.restore()}),w++,w>90&&Math.random()<.015&&(p.push({x:Math.random()*b*.8,y:Math.random()*j*.4,len:90+Math.random()*110,angle:Math.PI/5+(Math.random()-.5)*.4,life:1}),w=0),p.forEach((R,Y)=>{const ee=Math.cos(R.angle)*R.len*R.life,re=Math.sin(R.angle)*R.len*R.life,le=l.createLinearGradient(R.x,R.y,R.x+ee,R.y+re);le.addColorStop(0,`rgba(255,255,255,${R.life*.85})`),le.addColorStop(1,"rgba(255,255,255,0)"),l.strokeStyle=le,l.lineWidth=1.5,l.beginPath(),l.moveTo(R.x,R.y),l.lineTo(R.x+ee,R.y+re),l.stroke(),R.x+=Math.cos(R.angle)*6,R.y+=Math.sin(R.angle)*6,R.life-=.038,R.life<=0&&p.splice(Y,1)});const U=j*.56,Z=j*.37,I=Math.max(7,b/52),M=I*.32,K=g.slice(0,Math.floor(b/(I+M))+2),D=Math.max(...K.map(R=>R.h)),Q=Math.min(...K.map(R=>R.l)),V=R=>U+Z-(R-Q)/(D-Q+.01)*Z;if(K.forEach((R,Y)=>{const ee=Y*(I+M)-C%(I+M),re=R.c>=R.o;l.strokeStyle=re?"#22c55e":"#ef4444",l.fillStyle=re?"rgba(34,197,94,0.22)":"rgba(239,68,68,0.22)",l.lineWidth=1.3,l.beginPath(),l.moveTo(ee+I/2,V(R.h)),l.lineTo(ee+I/2,V(R.l)),l.stroke();const le=V(Math.max(R.o,R.c)),Ee=Math.max(2,Math.abs(V(R.o)-V(R.c)));l.fillRect(ee,le,I,Ee),l.strokeRect(ee,le,I,Ee),l.fillStyle=re?"rgba(34,197,94,0.12)":"rgba(239,68,68,0.12)",l.fillRect(ee,j-R.vol*j*.07,I,R.vol*j*.07)}),K.length>1){const R=K.map((Y,ee)=>({x:ee*(I+M)-C%(I+M)+I/2,y:V(Y.c)}));l.save(),l.shadowColor="#dc2626",l.shadowBlur=16,l.strokeStyle="#dc2626",l.lineWidth=2,l.beginPath(),R.forEach((Y,ee)=>ee===0?l.moveTo(Y.x,Y.y):l.lineTo(Y.x,Y.y)),l.stroke(),l.restore()}const G=l.createLinearGradient(0,U-40,0,U+70);G.addColorStop(0,"rgba(3,6,9,1)"),G.addColorStop(1,"rgba(3,6,9,0)"),l.fillStyle=G,l.fillRect(0,U-40,b,110);const H=l.createRadialGradient(b/2,j/2,j*.08,b/2,j/2,j*.8);H.addColorStop(0,"rgba(3,6,9,0)"),H.addColorStop(1,"rgba(3,6,9,0.88)"),l.fillStyle=H,l.fillRect(0,0,b,j),C+=.45,y++,x=requestAnimationFrame(N)};return N(),()=>{cancelAnimationFrame(x),window.removeEventListener("resize",h)}},[t]);const i=(d,l)=>{const x=Math.sin(n*.28+l*2.7)*.0018;return d>1e3?(d*(1+x)).toFixed(0):(d*(1+x)).toFixed(2)},c=[{sym:"SPY",base:587.34,chg:"+0.82%",up:!0,pos:{left:"3%",top:"14%"}}
2,{sym:"BTC",base:94250,chg:"-1.24%",up:!1,pos:{left:"3%",top:"55%"}},{sym:"QQQ",base:472.18,chg:"+1.05%",up:!0,pos:{right:"3%",top:"10%"}},{sym:"NVDA",base:138.76,chg:"+2.31%",up:!0,pos:{right:"3%",top:"50%"}},{sym:"TSLA",base:312.45,chg:"-0.68%",up:!1,pos:{right:"3%",top:"65%"}}];return t?(0,e.jsx)(So,{}):(0,e.jsxs)("div",{className:"fixed inset-0 overflow-hidden",style:{background:"#030609",zIndex:9999},children:[(0,e.jsx)("canvas",{ref:a,style:{position:"absolute",inset:0,width:"100%",height:"100%"}}),c.map((d,l)=>(0,e.jsx)(f.div,{className:"absolute",style:{...d.pos,zIndex:4},initial:{opacity:0,y:16},animate:{opacity:1,y:[0,-7,0]},transition:{opacity:{delay:l*.25+.4,duration:.6},y:{duration:4+l*.7,repeat:1/0,ease:"easeInOut",delay:l*.55}},children:(0,e.jsxs)("div",{style:{background:"rgba(255,255,255,0.042)",border:"1px solid rgba(255,255,255,0.09)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderRadius:10,padding:"7px 13px",minWidth:82},children:[(0,e.jsx)("div",{style:{fontSize:8,fontWeight:700,letterSpacing:"0.15em",color:"rgba(255,255,255,0.4)",fontFamily:"monospace",marginBottom:2},children:d.sym}),(0,e.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#fff",fontFamily:"monospace",marginBottom:2},children:i(d.base,l)}),(0,e.jsx)("div",{style:{fontSize:8,fontWeight:600,color:d.up?"#22c55e":"#ef4444",fontFamily:"monospace"},children:d.chg})]})},d.sym)),(0,e.jsx)(f.div,{className:"absolute",style:{left:"2%",top:"18%",zIndex:3},animate:{y:[-14,14,-14],rotate:[-4,4,-4]},transition:{duration:7,repeat:1/0,ease:"easeInOut"},children:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsx)(St,{size:105}),(0,e.jsxs)(f.div,{style:{position:"absolute",top:"15%",left:"108%",background:"rgba(8,12,24,0.82)",border:"1px solid rgba(220,38,38,0.22)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:10,padding:"8px 12px",minWidth:112,boxShadow:"0 4px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(220,38,38,0.08)"},initial:{opacity:0,x:-8},animate:{opacity:1,x:0,y:[0,-5,0]},transition:{opacity:{delay:1.2,duration:.6},x:{delay:1.2,duration:.5},y:{duration:3.5,repeat:1/0,ease:"easeInOut",delay:1.5}},children:[(0,e.jsx)("div",{style:{fontSize:7,fontWeight:700,letterSpacing:"0.18em",color:"rgba(255,255,255,0.35)",fontFamily:"monospace",marginBottom:3},children:"SPX"}),(0,e.jsx)("div",{style:{fontSize:14,fontWeight:800,color:"#fff",fontFamily:"monospace",marginBottom:5,letterSpacing:"-0.01em"},children:"587.99"}),(0,e.jsxs)("svg",{width:"84",height:"24",viewBox:"0 0 84 24",style:{display:"block",marginBottom:4},children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"ql-sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(34,197,94,0.22)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(34,197,94,0)"})]})}),(0,e.jsx)("polyline",{points:"0,20 14,17 28,12 42,15 56,8 70,5 84,2 84,24 0,24",fill:"url(#ql-sparkGrad)",stroke:"none"}),(0,e.jsx)("polyline",{points:"0,20 14,17 28,12 42,15 56,8 70,5 84,2",stroke:"#22c55e",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("div",{style:{fontSize:8,fontWeight:600,color:"#22c55e",fontFamily:"monospace",letterSpacing:"0.05em"},children:"▲ +0.82%"})]})]})}),(0,e.jsx)(f.div,{className:"absolute",style:{right:"2%",top:"28%",zIndex:3},animate:{y:[10,-14,10],rotate:[5,-5,5]},transition:{duration:9,repeat:1/0,ease:"easeInOut",delay:1.8},children:(0,e.jsx)(St,{size:68,flipped:!0})}),(0,e.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",style:{zIndex:10,pointerEvents:"none"},children:(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsxs)("div",{style:{position:"relative",width:120,height:120,marginBottom:16},children:[(0,e.jsx)(f.div,{style:{position:"absolute",inset:4,borderRadius:"50%",background:"conic-gradient(from 0deg, rgba(220,38,38,0.28), rgba(220,38,38,0) 40%)",WebkitMaskImage:"radial-gradient(circle, #000 56%, transparent 72%)",maskImage:"radial-gradient(circle, #000 56%, transparent 72%)"},animate:{rotate:360},transition:{duration:3.6,repeat:1/0,ease:"linear"}}),(0,e.jsx)(f.div,{style:{position:"absolute",inset:0},animate:{rotate:360},transition:{duration:7,repeat:1/0,ease:"linear"},children:(0,e.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",style:{overflow:"visible"},children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(220,38,38,0.38)",strokeWidth:"1.5",strokeDasharray:"9,7",transform:"rotate(-25,60,60)"}),(0,e.jsx)("circle",{cx:"113",cy:"60",r:"4.5",fill:"rgba(220,38,38,0.9)",transform:"rotate(-25,60,60)"})]})}),(0,e.jsx)(f.div,{style:{position:"absolute",inset:0},animate:{rotate:-360},transition:{duration:11,repeat:1/0,ease:"linear"},children:(0,e.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",style:{overflow:"visible"},children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(255,255,255,0.12)",strokeWidth:"1",strokeDasharray:"5,9",transform:"rotate(35,60,60)"}),(0,e.jsx)("circle",{cx:"7",cy:"60",r:"3",fill:"rgba(255,255,255,0.5)",transform:"rotate(35,60,60)"})]})}),(0,e.jsx)(f.div,{style:{position:"absolute",inset:0},animate:{rotate:360},transition:{duration:4.5,repeat:1/0,ease:"linear"},children:(0,e.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",style:{overflow:"visible"},children:[(0,e.jsx)("ellipse",{cx:"60",cy:"60",rx:"54",ry:"18",fill:"none",stroke:"rgba(139,92,246,0.25)",strokeWidth:"1",strokeDasharray:"3,13",transform:"rotate(70,60,60)"}),(0,e.jsx)("circle",{cx:"60",cy:"7",r:"2.5",fill:"rgba(139,92,246,0.75)",transform:"rotate(70,60,60)"})]})}),[0,1,2].map(d=>(0,e.jsx)(f.div,{style:{position:"absolute",inset:18,borderRadius:"50%",border:"1px solid rgba(220,38,38,0.45)"}
2,initial:{scale:.5,opacity:.55},animate:{scale:2.1,opacity:0},transition:{duration:3,repeat:1/0,ease:"easeOut",delay:d*1}},`pulse${d}`)),[{r:64,dur:5,color:"#f87171",size:5,reverse:!1,delay:0},{r:52,dur:8,color:"#8b5cf6",size:4,reverse:!0,delay:-2},{r:70,dur:6.5,color:"#22d3ee",size:3.5,reverse:!1,delay:-1}].map((d,l)=>(0,e.jsx)(f.div,{style:{position:"absolute",inset:0},animate:{rotate:d.reverse?-360:360},transition:{duration:d.dur,repeat:1/0,ease:"linear",delay:d.delay},children:(0,e.jsx)("div",{style:{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%, -50%) translateY(-${d.r}px)`,width:d.size,height:d.size,borderRadius:"50%",background:d.color,boxShadow:`0 0 8px ${d.color}`}})},`sat${l}`)),(0,e.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,e.jsx)(f.img,{src:"/RedlineOS_AppIcon_1024x1024.png",alt:"Redline",style:{width:76,height:76,borderRadius:17,boxShadow:"0 0 55px rgba(220,38,38,0.45), 0 0 22px rgba(220,38,38,0.2), 0 8px 32px rgba(0,0,0,0.75)"},animate:{scale:[.97,1.03,.97],opacity:[.88,1,.88]},transition:{duration:3.2,repeat:1/0,ease:"easeInOut"}})})]}),(0,e.jsx)(f.div,{style:{fontSize:27,fontWeight:900,letterSpacing:"0.12em",color:"#fff",fontFamily:"sans-serif",textShadow:"0 0 45px rgba(220,38,38,0.65), 0 0 90px rgba(220,38,38,0.2)"},animate:{opacity:[.88,1,.88]},transition:{duration:2.8,repeat:1/0,ease:"easeInOut"},children:"REDLINE"}),(0,e.jsxs)("div",{style:{fontSize:9,fontWeight:600,letterSpacing:"0.28em",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",marginTop:5,marginBottom:10,display:"flex",alignItems:"center",gap:8},children:[(0,e.jsx)("span",{style:{height:1,width:24,background:"linear-gradient(90deg, transparent, rgba(220,38,38,0.85))"}}),(0,e.jsx)("span",{children:"Trading OS · v3.0"}),(0,e.jsx)("span",{style:{height:1,width:24,background:"linear-gradient(270deg, transparent, rgba(220,38,38,0.85))"}})]}),(0,e.jsx)(wo,{})]})}),(0,e.jsx)(jo,{}),(0,e.jsx)(ko,{}),(0,e.jsxs)("div",{className:"absolute",style:{left:"50%",bottom:"-18%",transform:"translateX(-50%)",zIndex:2,pointerEvents:"none"},children:[(0,e.jsx)("div",{style:{position:"absolute",inset:"-28px",background:"radial-gradient(ellipse at center, rgba(180,20,20,0.2) 0%, rgba(100,10,10,0.09) 42%, transparent 68%)",filter:"blur(22px)",borderRadius:"50%",pointerEvents:"none"}}),(0,e.jsx)(f.div,{animate:{rotate:[0,360]},transition:{duration:240,repeat:1/0,ease:"linear"},children:(0,e.jsxs)("svg",{width:"520",height:"520",viewBox:"0 0 520 520",style:{overflow:"visible"},children:[(0,e.jsxs)("defs",{children:[(0,e.jsxs)("radialGradient",{id:"ql-planetCore",cx:"38%",cy:"35%",r:"60%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#4a1520"}),(0,e.jsx)("stop",{offset:"45%",stopColor:"#2a0810"}),(0,e.jsx)("stop",{offset:"80%",stopColor:"#1a0508"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#080208"})]}),(0,e.jsxs)("radialGradient",{id:"ql-planetAtmo",cx:"50%",cy:"50%",r:"50%",children:[(0,e.jsx)("stop",{offset:"78%",stopColor:"rgba(0,0,0,0)"}),(0,e.jsx)("stop",{offset:"90%",stopColor:"rgba(180,20,30,0.13)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(220,38,38,0.06)"})]}),(0,e.jsxs)("linearGradient",{id:"ql-ringGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"rgba(220,38,38,0)"}),(0,e.jsx)("stop",{offset:"35%",stopColor:"rgba(220,38,38,0.55)"}),(0,e.jsx)("stop",{offset:"65%",stopColor:"rgba(180,30,30,0.7)"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"rgba(139,92,246,0)"})]})]}),(0,e.jsx)("ellipse",{cx:"260",cy:"260",rx:"240",ry:"64",fill:"none",stroke:"url(#ql-ringGrad)",strokeWidth:"1.5",transform:"rotate(-22 260 260)"}),(0,e.jsx)("ellipse",{cx:"260",cy:"260",rx:"218",ry:"57",fill:"none",stroke:"rgba(220,38,38,0.14)",strokeWidth:"1",transform:"rotate(-22 260 260)"}),(0,e.jsx)("circle",{cx:"260",cy:"260",r:"155",fill:"url(#ql-planetCore)"}),(0,e.jsx)("circle",{cx:"260",cy:"260",r:"155",fill:"url(#ql-planetAtmo)"}),(0,e.jsx)("ellipse",{cx:"232",cy:"240",rx:"58",ry:"13",fill:"rgba(100,20,20,0.1)",transform:"rotate(-12, 232, 240)"}),(0,e.jsx)("ellipse",{cx:"288",cy:"278",rx:"46",ry:"11",fill:"rgba(80,15,15,0.07)",transform:"rotate(9, 288, 278)"})]})})]})]})}Tt();
2var To="https://apps.apple.com/app/redlineos/id6762072730",Na="rdl_appstore_banner_dismissed",Ro=30,Eo=()=>Ct.isNativePlatform()||typeof window>"u"||window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone?!1:/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function Ao(){const[t,a]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!Eo())return;const r=localStorage.getItem(Na);if(r&&Date.now()<parseInt(r,10))return;const i=setTimeout(()=>a(!0),2e3);return()=>clearTimeout(i)},[]);const s=()=>{a(!1);const r=Date.now()+Ro*24*60*60*1e3;localStorage.setItem(Na,r.toString())},n=()=>{window.open(To,"_blank","noopener,noreferrer"),s()};return t?(0,e.jsx)("div",{className:"fixed left-3 right-3 z-[89] md:left-auto md:right-4 md:max-w-sm",style:{bottom:"calc(70px + max(env(safe-area-inset-bottom, 0px), 0px))"},children:(0,e.jsxs)("div",{className:"bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl p-4 text-white relative",children:[(0,e.jsx)("button",{onClick:s,className:"absolute top-3 right-3 p-1 text-slate-400 hover:text-white rounded-lg hover:bg-slate-700 transition-colors","aria-label":"Dismiss",children:(0,e.jsx)(Ke,{className:"w-4 h-4"})}),(0,e.jsxs)("div",{className:"flex items-start gap-3 pr-6",children:[(0,e.jsx)("div",{className:"w-11 h-11 bg-gradient-to-br from-blue-500 via-purple-500 to-cyan-400 rounded-xl flex items-center justify-center shadow-lg flex-shrink-0",children:(0,e.jsx)("span",{className:"text-white font-bold text-sm",children:"RDL"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("h3",{className:"font-bold text-base text-white",children:"Download Redline on the App Store"}),(0,e.jsx)("p",{className:"text-slate-400 text-sm mt-0.5",children:"Get the full native experience — faster, smoother, and built for traders."})]})]}),(0,e.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,e.jsxs)("button",{onClick:n,className:"flex-1 flex items-center justify-center gap-2 bg-black border border-slate-600 px-4 py-2.5 rounded-xl font-semibold text-sm hover:bg-slate-900 transition-all active:scale-[0.98]",children:[(0,e.jsx)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 814 1000",fill:"currentColor",children:(0,e.jsx)("path",{d:"M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76 0-103.7 40.8-165.9 40.8s-105-57.8-155.5-127.4C46 346.6 0 239.1 0 136.3c0-53.4 9.3-105.8 27.8-155.4C72.5-12.5 160.2-52.5 222.5-52.5c54.7 0 101.1 37.6 136.7 37.6 34.4 0 88.2-39.7 151.2-39.7 24.3 0 108.4 2.9 159.4 80.4zm-99.9-234.9c30.9-36.8 51.2-87.6 51.2-138.4 0-7.1-.6-14.3-1.9-20.1-48.3 1.9-106.3 32.2-141.2 75.8-28.6 32.8-54.8 83.5-54.8 135 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 43.4 0 98.3-29 131.2-71.7z"})}),"Download on the App Store"]}),(0,e.jsx)("button",{onClick:s,className:"px-4 py-2.5 text-slate-400 hover:text-white text-sm rounded-xl hover:bg-slate-700 transition-colors",children:"Later"})]})]})}):null}var Io="pwa_active_sw_url",mt="pwa_update_cooldown",xt="pwa_dismissed_sw_url",Bt=60*1e3;function _o(){const[t,a]=(0,o.useState)(!1),[s,n]=(0,o.useState)(!1),r=(0,o.useRef)(null),i=(0,o.useCallback)(m=>(m.active?.scriptURL||m.installing?.scriptURL||"").includes("sw-advanced")&&m.scope.endsWith("/"),[]),c=(0,o.useCallback)(()=>{const m=parseInt(localStorage.getItem(mt)||"0",10);return Date.now()<m},[]),d=(0,o.useCallback)(m=>{if(!m)return!1;const p=localStorage.getItem(xt);return p&&p===m.scriptURL},[]),l=(0,o.useCallback)(()=>{const m=navigator.serviceWorker?.controller;m?.scriptURL&&localStorage.setItem(Io,m.scriptURL)},[]);(0,o.useEffect)(()=>{if(!("serviceWorker"in navigator)||(l(),c()))return;let m=!1;const p=()=>{m||(m=!0,l(),localStorage.setItem(mt,String(Date.now()+Bt)),localStorage.removeItem(xt),window.location.reload())};return(async()=>{try{const k=(await navigator.serviceWorker.getRegistrations()).find(v=>i(v));if(!k)return;k.waiting&&!d(k.waiting)&&(r.current=k.waiting,a(!0)),k.addEventListener("updatefound",()=>{const v=k.installing;v&&v.addEventListener("statechange",()=>{v.state==="installed"&&navigator.serviceWorker.controller&&!c()&&!d(v)&&(r.current=v,a(!0))})})}catch(k){console.warn("[PWAUpdateBanner] Error checking registration:",k)}})(),navigator.serviceWorker.addEventListener("controllerchange",p),()=>{navigator.serviceWorker.removeEventListener("controllerchange",p)}},[i,c,d,l]);const x=async()=>{n(!0),localStorage.setItem(mt,String(Date.now()+Bt)),localStorage.removeItem(xt);const m=r.current;if(m)try{m.postMessage({type:"SKIP_WAITING"})}catch{}setTimeout(()=>{window.location.reload()},2e3)},h=()=>{a(!1);const m=r.current;m?.scriptURL&&localStorage.setItem(xt,m.scriptURL),localStorage.setItem(mt,String(Date.now()+Bt))};return t?(0,e.jsx)("div",{className:"fixed top-0 left-0 right-0 z-[200] bg-gradient-to-r from-blue-600 to-purple-600 text-white shadow-lg safe-area-top",children:(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 max-w-lg mx-auto",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,e.jsx)(xs,{className:`w-4 h-4 flex-shrink-0 ${s?"animate-spin":""}`}),(0,e.jsx)("span",{className:"text-sm font-medium truncate",children:s?"Updating...":"A new version is available"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-2",children:[(0,e.jsx)("button",{onClick:x,disabled:s,className:"px-3 py-1.5 bg-white text-blue-600 rounded-lg text-xs font-bold hover:bg-blue-50 transition-colors active:scale-95 disabled:opacity-70",children:s?"Updating":"Update"}),!s&&(0,e.jsx)("button",{onClick:h,className:"p-1 text-white/70 hover:text-white transition-colors","aria-label":"Dismiss",children:(0,e.jsx)(Ke,{className:"w-4 h-4"})})]})]})}):null}function Po(){const[t,a]=(0,o.useState)({isOnline:navigator.onLine,isReconnecting:!1,showIndicator:!1,lastOfflineTime:null}),[s,n]=(0,o.useState)(!1),r=(0,o.useCallback)(async()=>{try{const p=new AbortController,g=setTimeout(()=>p.abort(),5e3);return await fetch("/favicon.ico",{method:"HEAD",cache:"no-store",signal:p.signal}),clearTimeout(g),!0}catch{return!1}},[]);(0,o.useEffect)(()=>{let p,g;const k=async()=>{a(u=>({...u,isReconnecting:!0,showIndicator:!0})),await r()?(a(u=>({...u,isOnline:!0,isReconnecting:!1,showIndicator:!0})),g=setTimeout(()=>{a(u=>({...u,showIndicator:!1}))},3e3)):a(u=>({...u,isOnline:!1,isReconnecting:!1,showIndicator:!0}))},v=()=>{n(!0),a({isOnline:!1,isReconnecting:!1,showIndicator:!0,lastOfflineTime:Date.now()})};return window.addEventListener("online",k),window.addEventListener("offline",v),navigator.onLine||v(),()=>{window.removeEventListener("online",k),window.removeEventListener("offline",v),clearTimeout(p),clearTimeout(g)}},[r]);const i=()=>
2{if(!t.lastOfflineTime)return null;const p=Date.now()-t.lastOfflineTime,g=Math.floor(p/6e4);return g<1?"Just now":g===1?"1 min ago":g<60?`${g} mins ago`:`${Math.floor(g/60)}h ago`};if(!t.showIndicator&&!s)return null;const{isOnline:c,isReconnecting:d,showIndicator:l}=t,x=()=>{let p="offline-indicator";return l&&(p+=" offline-indicator--visible"),!c&&!d&&(p+=" offline-indicator--offline"),d&&(p+=" offline-indicator--reconnecting"),c&&!d&&(p+=" offline-indicator--online"),p},h=()=>d?(0,e.jsx)(xs,{className:"offline-indicator__icon offline-indicator__icon--reconnecting animate-spin"}):c?(0,e.jsx)(Hi,{className:"offline-indicator__icon offline-indicator__icon--online"}):(0,e.jsx)(Ui,{className:"offline-indicator__icon offline-indicator__icon--offline"}),m=()=>d?"Reconnecting...":c?"Back online!":"You're offline";return(0,e.jsxs)("div",{className:x(),children:[h(),(0,e.jsx)("span",{className:"offline-indicator__text",children:m()}),!c&&!d&&t.lastOfflineTime&&(0,e.jsx)("span",{className:"offline-indicator__status",children:i()})]})}Tt();function Lo(){const t=Ne(b=>b.user),a=fe(),[s,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),[l,x]=(0,o.useState)(Be.getSnapshot()),[h,m]=(0,o.useState)(null),p=(0,o.useRef)(a.pathname.startsWith("/onboarding")),g=(0,o.useRef)(t?.uid||null),k=Ct.isNativePlatform();(0,o.useEffect)(()=>{g.current!==(t?.uid||null)&&(g.current=t?.uid||null,p.current=a.pathname.startsWith("/onboarding"),d(!1),n(!1))},[a.pathname,t?.uid]),(0,o.useEffect)(()=>{a.pathname.startsWith("/onboarding")&&(p.current=!0,n(!1))},[a.pathname]),(0,o.useEffect)(()=>{let b=!1;return m(null),t?.uid?(br(t.uid).then(j=>{b||m(j)}).catch(j=>{console.error("[NotificationPermission] Could not read account delivery preference:",j),b||m({enabled:!1,preferenceReadFailed:!0})}),()=>{b=!0}):()=>{b=!0}},[t?.uid]),(0,o.useEffect)(()=>{let b=!1,j;const T=()=>{const O=Be.getSnapshot();if(!b){if(x(O),O.phase===Ce.UNAVAILABLE){n(!1);return}if(c||p.current||a.pathname.startsWith("/onboarding")){n(!1);return}rn({phase:O.phase,accountPreferencesLoaded:h!==null,accountDeliveryEnabled:h?.enabled,dismissedForLaunch:c,sawOnboardingThisLaunch:p.current,isOnboardingRoute:a.pathname.startsWith("/onboarding"),userId:t?.uid})&&!j&&(j=setTimeout(()=>{b||n(!0)},1200))}},z=Be.subscribe(T);return T(),t?.uid&&Be.start(t.uid).then(T).catch(O=>{console.error("[NotificationPermission] Runtime start failed:",O),T()}),()=>{b=!0,j&&clearTimeout(j),z()}},[h,c,a.pathname,t?.uid]);const v=async()=>{if(!(!t?.uid||r)){i(!0);try{const b=l.phase===Ce.READY?l:await Be.enable(t.uid);x(b),(b.permission==="granted"||b.phase===Ce.READY||b.phase===Ce.REGISTERING)&&(m(await yr(t.uid,{...h||{},enabled:!0})),n(!1))}catch(b){console.error("Error requesting notification permission:",b)}finally{i(!1)}}},u=async()=>{if(!(!k||r)){i(!0);try{await Be.openSettings(),n(!1)}catch(b){console.error("[NotificationPermission] Could not open notification settings:",b)}finally{i(!1)}}},E=()=>{n(!1),d(!0)},C=l.phase===Ce.DENIED,y=l.phase===Ce.ERROR,w=l.unsupportedReason==="ios_requires_home_screen",N=(l.phase===Ce.READY||l.phase===Ce.REGISTERING)&&h?.enabled!==!0;return!(l.phase===Ce.NEEDS_PERMISSION||C||y||w||N)||!s?null:(0,e.jsx)(se,{children:(0,e.jsx)(f.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 flex items-center justify-center p-4 overflow-y-auto",onClick:E,children:(0,e.jsxs)(f.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},transition:{type:"spring",damping:20},className:"bg-gradient-to-br from-slate-900 to-slate-800 rounded-2xl shadow-2xl max-w-md w-full border border-slate-700 max-h-[90vh] overflow-y-auto my-4",onClick:b=>b.stopPropagation(),children:[(0,e.jsxs)("div",{className:"relative p-4 pb-3",children:[(0,e.jsx)("button",{onClick:E,className:"absolute top-3 right-3 text-slate-400 hover:text-white transition-colors","aria-label":"Close",children:(0,e.jsx)(Ke,{className:"w-5 h-5"})}),(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,e.jsx)("div",{className:"bg-gradient-to-br from-blue-500 to-purple-500 rounded-full p-2.5",children:(0,e.jsx)($t,{className:"w-6 h-6 text-white"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-bold text-white",children:w?"Add RedlineOS to Your Home Screen":C?"Allow Notifications in Settings":N?"Turn On Alerts for This Account":"Allow Notifications"}),(0,e.jsx)("p",{className:"text-slate-400 text-xs",children:w?"iPhone only delivers alerts to installed apps":C?"Apple needs you to re-enable access":N?"Apple permission is already allowed on this device":"Never miss an important guardrail"})]})]})]}),(0,e.jsxs)("div",{className:"px-4 pb-4",children:[(0,e.jsx)("p",{className:"text-slate-300 text-sm mb-4",children:w?"iPhone and iPad only deliver push alerts to apps installed on the Home Screen — not to Safari tabs. Install RedlineOS once and your guardrail alerts start working.":C?"Notifications were previously blocked. Open iOS Settings to allow Redline alerts on this device.":N?"This Redline account has not opted in to delivery yet. Turn it on for this account without changing Apple’s device permission.":y?"Notification permission is available, but this device still needs to reconnect securely.":"Get timely alerts about risk limits, cooldowns, trading performance, and important account activity."}),w&&(0,e.jsxs)("ol",{className:"mb-4 space-y-2 rounded-xl border border-blue-500/25 bg-blue-500/10 p-3 text-sm text-blue-100",children:[(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"font-bold",children:"1."})," Tap the ",(0,e.jsx)("span",{className:"font-bold",children:"Share"})," button in Safari’s toolbar."]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"font-bold",children:"2."})," Choose ",(0,e.jsx)("span",{className:"font-bold",children:"Add to Home Screen"}),"."]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"font-bold",children:"3."})," Open RedlineOS from your Home Screen, then tap ",(0,e.jsx)("span",{className:"font-bold",children:"Allow"})," when it asks about notifications."]})]}),(0,e.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 bg-slate-800/50 rounded-lg p-2.5 border border-slate-700/50",children:[(0,e.jsx)("div",{className:"bg-green-500/20 rounded-lg p-1.5 flex-shrink-0",children:(0,e.jsx)(wi,{className:"w-3.5 h-3.5 text-green-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-white",children:"Trade Alert"}),(0,e.jsx)("div",{className:"text-[10px] text-slate-400",children:"Your AAPL trade hit target!"})]})]}),(0,e.jsxs)("div",{className:"flex items-start gap-2 bg-slate-800/50 rounded-lg p-2.5 border border-slate-700/50",children:[(0,e.jsx)("div",{className:"bg-purple-500/20 rounded-lg p-1.5 flex-shrink-0",children:(0,e.jsx)(ps,{className:"w-3.5 h-3.5 text-purple-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-white",children:"AI Insight"}),(0,e.jsx)("div",{className:"text-[10px] text-slate-400",children:"3 winning trades in a row"})]})]}),(0,e.jsxs)("div",{className:"flex items-start gap-2 bg-slate-800/50 rounded-lg p-2.5 border border-slate-700/50",children:[(0,e.jsx)("div",{className:"bg-yellow-500/20 rounded-lg p-1.5 flex-shrink-0",children:(0,e.jsx)(Oi,{className:"w-3.5 h-3.5 text-yellow-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-white",children:"Achievement"}),(0,e.jsx)("div",{className:"text-[10px] text-slate-400",children:"7-Day Streak! 🔥"})]})]}),(0,e.jsxs)("div",{className:"flex items-start gap-2 bg-slate-800/50 rounded-lg p-2.5 border border-slate-700/50",children:[(0,e.jsx)("div",{className:"bg-orange-500/20 rounded-lg p-1.5 flex-shrink-0",children:(0,e.jsx)(Wi,{className:"w-4 h-4 text-orange-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-white",children:"Streak Reminder"}),(0,e.jsx)("div",{className:"text-xs text-slate-400",children:"Don't break your 5-day streak! Log today's trade."})]})]}),(0,e.jsxs)("div",{className:"flex items-start gap-3 bg-slate-800/50 rounded-xl p-3 border border-slate-700/50",children:[(0,e.jsx)("div",{className:"bg-cyan-500/20 rounded-lg p-2 flex-shrink-0",children:(0,e.jsx)(Qi,{className:"w-4 h-4 text-cyan-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-white",children:"Pattern Alert"}),(0,e.jsx)("div",{className:"text-xs text-slate-400",children:"Your risk/reward ratio improved by 15%!"})]})]})]}),(0,e.jsxs)("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-xl p-4 mb-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-blue-300 font-medium mb-2",children:[(0,e.jsx)($t,{className:"w-4 h-4"}),"Why enable notifications?"]}),(0,e.jsxs)("ul",{className:"space-y-1 text-xs text-slate-300",children:[(0,e.jsx)("li",{children:"• Get real-time alerts for important trade events"}),(0,e.jsx)("li",{children:"• Receive AI-powered insights about your trading patterns"}
2),(0,e.jsx)("li",{children:"• Stay motivated with achievement and streak notifications"}),(0,e.jsx)("li",{children:"• Customize notification types and timing in settings"}),(0,e.jsx)("li",{children:"• Works even when the app is closed"})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)("button",{onClick:C?u:v,disabled:r,hidden:w,className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-blue-600 to-purple-600 text-white px-4 py-2.5 rounded-lg font-medium hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg disabled:opacity-50 disabled:cursor-not-allowed text-sm",children:r?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),"Enabling..."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($t,{className:"w-4 h-4"}),C?"Open iOS Settings":N?"Turn On for This Account":y?"Reconnect Device":"Allow Notifications"]})}),(0,e.jsx)("button",{onClick:E,className:"w-full px-3 py-2 text-slate-400 hover:text-white transition-colors text-xs",children:"Not Now"})]})]})]})})})}var _t=Xt(er(),1);function Mo({open:t,onClose:a,trigger:s="unknown"}){const[n,r]=(0,o.useState)(1),[i,c]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(t){r(1),c(null),cn();try{window.dispatchEvent(new CustomEvent("redline:review-prompt-shown",{detail:{trigger:s}}))}catch{}}},[t,s]),!t)return null;const d=()=>{on(),a?.()},l=()=>{c(!0),r(2)},x=()=>{c(!1),r(2)},h=async()=>{await Xr(),a?.()},m=async()=>{await pn(),a?.()},p=()=>{en(!0),a?.()};return(0,_t.createPortal)((0,e.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-end sm:items-center justify-center bg-black/70 backdrop-blur-sm p-4",role:"dialog","aria-modal":"true","aria-labelledby":"review-prompt-title",children:(0,e.jsxs)("div",{className:"relative w-full max-w-md bg-slate-900 border border-slate-700 rounded-2xl shadow-2xl overflow-hidden",children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"absolute top-3 right-3 p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition","aria-label":"Close",children:(0,e.jsx)(so,{className:"w-5 h-5"})}),(0,e.jsxs)("div",{className:"p-6 sm:p-8",children:[n===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-center gap-1 mb-4",children:[0,1,2,3,4].map(g=>(0,e.jsx)(xa,{className:"w-7 h-7 text-amber-400"},g))}),(0,e.jsx)("h2",{id:"review-prompt-title",className:"text-xl sm:text-2xl font-bold text-white text-center mb-2",children:"Enjoying Redline?"}),(0,e.jsx)("p",{className:"text-sm text-slate-400 text-center mb-6",children:"We're a small team building discipline tools for serious traders. Your feedback shapes what ships next."}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,e.jsx)("button",{type:"button",onClick:x,className:"px-4 py-3 rounded-xl bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 font-medium text-sm transition",children:"Not really"}),(0,e.jsx)("button",{type:"button",onClick:l,className:"px-4 py-3 rounded-xl bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white font-semibold text-sm transition shadow-lg shadow-purple-500/20",children:"Yes, love it"})]}),(0,e.jsx)("button",{type:"button",onClick:p,className:"mt-4 w-full text-xs text-slate-500 hover:text-slate-300 transition",children:"Don't ask me again"})]}),n===2&&i===!0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-center gap-1 mb-4",children:[0,1,2,3,4].map(g=>(0,e.jsx)(xa,{className:"w-8 h-8 text-amber-400 drop-shadow"},g))}),(0,e.jsx)("h2",{className:"text-xl sm:text-2xl font-bold text-white text-center mb-2",children:"Mind leaving a review?"}),(0,e.jsx)("p",{className:"text-sm text-slate-400 text-center mb-6",children:"A quick App Store rating helps other traders find Redline. It takes 10 seconds and means the world to us."}),(0,e.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"px-4 py-3 rounded-xl bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 font-medium text-sm transition",children:"Maybe later"}),(0,e.jsx)("button",{type:"button",onClick:h,className:"px-4 py-3 rounded-xl bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 text-white font-semibold text-sm transition shadow-lg shadow-amber-500/20",children:"Rate Redline"})]})]}),n===2&&i===!1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h2",{className:"text-xl sm:text-2xl font-bold text-white text-center mb-2",children:"Tell us what's wrong"}),(0,e.jsx)("p",{className:"text-sm text-slate-400 text-center mb-6",children:"We read every message. Send us a note and we'll make it right — often within a day."}),(0,e.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"px-4 py-3 rounded-xl bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 font-medium text-sm transition",children:"Maybe later"}),(0,e.jsx)("button",{type:"button",onClick:m,className:"px-4 py-3 rounded-xl bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white font-semibold text-sm transition shadow-lg shadow-purple-500/20",children:"Send feedback"})]})]})]})]})}),document.body)}var Do=({enabled:t=!0,maxRestoreTime:a=1440*60*1e3,restoreDelay:s=1500,excludedPaths:n=["/signin","/signup","/logout","/error","/callback"],fallbackPath:r="/dashboard"})=>{const i=me(),c=fe(),[d,l]=(0,o.useState)(!1),{lastVisitedPage:x,navigationHistory:h,isAuthenticated:m,authLoading:p}=Nt(),g=u=>!u||u==="/"?!0:n.some(E=>u.startsWith(E)||u.includes(E)),k=u=>({"/dashboard":"Dashboard","/trade-logger":"Ledger","/analytics":"Analytics","/community":"Community","/portfolio":"Portfolio","/settings":"Settings","/profile":"Profile","/education":"Education","/news":"Market News","/alerts":"Alerts"})[u]||u.split("/").pop()?.replace(/-/g," ")||"Previous Page",v=()=>{if(!t||!x||d)return;const u=window.location.pathname,E=window.location.search;if(u!=="/"){l(!0);return}if(u==="/callback"||u==="/auth/callback"||E.includes("code=")&&E.includes("state=")){console.log("[PageRestorationManager] OAuth callback detected — skipping restoration"),l(!0);return}if(u.startsWith("/invite")||u.includes("accept-invite")||u.startsWith("/org")){console.log("[PageRestorationManager] Invite page detected — skipping restoration"),l(!0);return}
2if(c.pathname===x){l(!0);return}if(g(x)){l(!0);return}const C=h.find(y=>y.path===x);if(C){const y=Date.now()-new Date(C.timestamp).getTime();if(y>a){console.log("⏰ Last page visit too old for restoration:",{lastVisited:x,timeSince:Math.round(y/(1e3*60))+" minutes ago"}),l(!0);return}}console.log("🔄 Attempting page restoration:",{from:c.pathname,to:x,title:k(x)});try{i(x,{replace:!0}),setTimeout(()=>{},500)}catch(y){console.error("Failed to restore page:",y),c.pathname==="/"&&r!=="/"&&i(r,{replace:!0})}l(!0)};return(0,o.useEffect)(()=>{if(!t||d||p)return;if(!m()){l(!0);return}const u=setTimeout(v,s);return()=>clearTimeout(u)},[t,d,p,m,x,c.pathname]),(0,o.useEffect)(()=>{d&&c.pathname!==x&&console.log("📍 Navigation occurred after restoration attempt")},[c.pathname,x,d]),null},he=40,Yt=2,qt=(he-Yt)/2,Sa=2*Math.PI*qt,Fo=({threshold:t=320,className:a="",ariaLabel:s="Back to top"})=>{const{y:n,percentage:r}=Jn(60),{scrollToTop:i}=In(),c=_e(),[d,l]=(0,o.useState)(!1),[x,h]=(0,o.useState)(!1);(0,o.useEffect)(()=>{n>t&&!x?h(!0):n<t-60&&x&&h(!1)},[n,t,x]);const m=(0,o.useCallback)(()=>{try{ui.light?.()}catch{}i()},[i]),p=Sa*(1-Math.min(100,r)/100);return(0,e.jsx)(se,{children:x&&(0,e.jsxs)(f.div,{initial:c?{opacity:0}:{opacity:0,y:24,scale:.85},animate:c?{opacity:1}:{opacity:1,y:0,scale:1},exit:c?{opacity:0}:{opacity:0,y:24,scale:.85},transition:{type:"spring",stiffness:380,damping:28},className:`scroll-to-top-fab ${a}`,style:{position:"fixed",zIndex:50,right:"max(20px, env(safe-area-inset-right))",bottom:"calc(max(20px, env(safe-area-inset-bottom)) + 8px)",width:he,height:he,pointerEvents:"auto"},children:[(0,e.jsxs)("svg",{width:he,height:he,viewBox:`0 0 ${he} ${he}`,style:{position:"absolute",inset:0,transform:"rotate(-90deg)",pointerEvents:"none"},"aria-hidden":"true",children:[(0,e.jsx)("circle",{cx:he/2,cy:he/2,r:qt,fill:"none",stroke:"rgba(148,163,184,0.18)",strokeWidth:Yt}),(0,e.jsx)("circle",{cx:he/2,cy:he/2,r:qt,fill:"none",stroke:"rgba(148,163,184,0.85)",strokeWidth:Yt,strokeLinecap:"round",strokeDasharray:Sa,strokeDashoffset:p,style:{transition:c?"none":"stroke-dashoffset 120ms linear"}})]}),(0,e.jsx)(f.button,{type:"button",onClick:m,onPointerDown:()=>l(!0),onPointerUp:()=>l(!1),onPointerLeave:()=>l(!1),whileHover:c?void 0:{scale:1.04},whileTap:c?void 0:{scale:.92},transition:{type:"spring",stiffness:500,damping:30},"aria-label":s,title:s,style:{position:"absolute",inset:3,borderRadius:"50%",border:"1px solid rgba(148,163,184,0.18)",background:"rgba(15,23,42,0.85)",backdropFilter:"blur(12px) saturate(140%)",WebkitBackdropFilter:"blur(12px) saturate(140%)",boxShadow:d?"inset 0 1px 2px rgba(0,0,0,0.4)":"0 4px 14px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},onFocus:g=>{g.currentTarget.style.boxShadow="0 0 0 2px rgba(148,163,184,0.4), 0 4px 14px rgba(0,0,0,0.35)"},onBlur:g=>{g.currentTarget.style.boxShadow="0 4px 14px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset"},children:(0,e.jsx)(co,{style:{width:16,height:16,color:"rgba(226,232,240,0.95)",strokeWidth:3},"aria-hidden":"true"})})]})})},Oo=()=>{const{pathname:t}=fe();return(0,o.useEffect)(()=>{window.scrollTo(0,0);const a=document.querySelector(".main-content-scroll");a&&(a.scrollTop=0);const s=document.querySelector(".dashboard-scroll");s&&(s.scrollTop=0),document.querySelectorAll('[class*="overflow-y-auto"], [class*="overflow-auto"]').forEach(n=>{n.scrollTop=0})},[t]),null};function $o(t){return t>=85?{text:"text-emerald-400",bg:"bg-emerald-500/15",border:"border-emerald-500/30",dot:"bg-emerald-400"}:t>=70?{text:"text-lime-400",bg:"bg-lime-500/15",border:"border-lime-500/30",dot:"bg-lime-400"}:t>=55?{text:"text-amber-400",bg:"bg-amber-500/15",border:"border-amber-500/30",dot:"bg-amber-400"}:t>=40?{text:"text-orange-400",bg:"bg-orange-500/15",border:"border-orange-500/30",dot:"bg-orange-400"}:{text:"text-red-400",bg:"bg-red-500/15",border:"border-red-500/30",dot:"bg-red-400"}}var Bo=[{name:"Stop Loss Adherence",weight:"25 pts",description:"Did 
2you set a stop loss on every trade? Traders who always define their max loss before entry earn the full 25 points."},{name:"Rule Adherence",weight:"25 pts",description:"Are you following your own trading rules? Points deducted for violations (no stop loss, overtrading, revenge trades, etc.)."},{name:"Risk Management",weight:"20 pts",description:"Are your position sizes within your committed plan? Oversized positions and ignoring daily loss caps cost points here."},{name:"Journaling Quality",weight:"15 pts",description:"Are you documenting entries, emotions, and post-trade notes? Consistent journaling builds the data needed to improve."},{name:"Consistency",weight:"15 pts",description:"Avoiding revenge trading and erratic behavior. Clean streaks between violations push this component higher."}],zo=[{icon:"🛡️",tip:"Set a stop loss on every trade — it's the single highest-impact action (25 pts)."},{icon:"📋",tip:"Log notes and tags immediately after closing a trade to boost journaling quality."},{icon:"⏸️",tip:"After a loss, wait at least 5 minutes before placing the next trade to avoid revenge-trading deductions."}];function Wo({onClose:t}){return(0,e.jsx)(f.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] flex items-end sm:items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:(0,e.jsxs)(f.div,{initial:{y:40,opacity:0},animate:{y:0,opacity:1},exit:{y:40,opacity:0},transition:{type:"spring",stiffness:340,damping:30},onClick:a=>a.stopPropagation(),className:"w-full sm:max-w-md bg-slate-900 border border-slate-700 rounded-t-2xl sm:rounded-2xl p-5 shadow-2xl max-h-[80vh] overflow-y-auto",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsx)("h3",{className:"text-base font-semibold text-white",children:"How is this calculated?"}),(0,e.jsx)("button",{onClick:t,className:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 flex items-center justify-center text-slate-400 transition-colors","aria-label":"Close",children:"✕"})]}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mb-4",children:"Your Discipline Score is computed from 5 behavioral components, each updated after every trade you log."}),(0,e.jsx)("div",{className:"space-y-3",children:Bo.map(a=>(0,e.jsxs)("div",{className:"rounded-xl bg-slate-800/60 border border-slate-700/50 p-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,e.jsx)("span",{className:"text-xs font-semibold text-white",children:a.name}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-indigo-400 bg-indigo-500/15 border border-indigo-500/25 px-2 py-0.5 rounded-full",children:a.weight})]}),(0,e.jsx)("p",{className:"text-[11px] text-slate-400 leading-relaxed",children:a.description})]},a.name))}),(0,e.jsx)("p",{className:"text-[10px] text-slate-500 mt-4 text-center",children:"Score range: 0–100 · Updated in real time · Stored server-side"})]})})}function Ss({accountId:t=null,variant:a="pill",linkTo:s=null,className:n=""}){const r=Ne(H=>H.user),i=Ae(H=>H.score),c=Ae(H=>H.band),d=Ae(H=>H.loading),l=Ae(H=>H.scoreStatus),x=Ae(H=>H.closedTrades),h=Ae(H=>H.neededTrades),m=Ae(H=>H.initialize),p=Ae(H=>H.userId),[g,k]=(0,o.useState)(!1),[v,u]=(0,o.useState)(null),[E,C]=(0,o.useState)(!1);(0,o.useEffect)(()=>{r?.uid&&p!==r.uid&&m(r.uid)},[r?.uid,p,m]),(0,o.useEffect)(()=>{if(!r?.uid||!t){u(null),C(!1);return}return C(!0),Xs(at(tt,"users",r.uid,"disciplineScore",`account_${t}`),H=>{u(H.exists()?H.data():null),C(!1)},()=>{u(null),C(!1)})},[r?.uid,t]);const y=v?.meta?.closedTrades??0,w=v?.score??null,N=t?w:i,b=t?w!=null?Ri(w):null:c,j=t?E:d,T=t?v?.status||(w!=null&&y>=10?"scored":y>0?"building":"no_trades"):l,z=t?y:x,O=t?v?.meta?.needed??10:h;if(!r?.uid)return null;const P=j||T==="loading",U=T==="scored"&&N!=null,Z=T==="building",I=T==="no_trades",M=U?$o(N):{text:"text-slate-400",bg:"bg-slate-500/10",border:"border-slate-600/30",dot:"bg-slate-400"},K=U?b?.label||"":Z?"Building…":P?"…":"—",D=P?"—":U?Math.round(N):Z?`${z}/${O}`:"—",Q=U&&(b?.label==="Account Under Review"||N<40),V=U&&N<50,G=(()=>{if(a==="card"){if(!P&&I)return(0,e.jsxs)("div",{className:`rounded-xl border border-slate-700/50 bg-slate-800/40 p-4 ${n}`,children:[(0,e.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-slate-400 block mb-2",children:"Discipline Score"}),(0,e.jsx)("p",{className:"text-sm text-slate-400",children:"Your profile and guardrails are ready. A discipline score needs 10 closed trades."})]});if(!P&&Z){const H=Math.round(z/O*100);return(0,e.jsxs)("div",{className:`rounded-xl border border-indigo-500/25 bg-indigo-500/10 p-4 ${n}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,e.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:"Discipline Score"}),(0,e.jsx)("span",{className:"text-[11px] font-semibold text-indigo-400",children:"Building…"})]}),(0,e.jsxs)("p",{className:"text-xs text-slate-400 mb-2",children:[z," / ",O," trades logged"]}),(0,e.jsx)("div",{className:"h-1.5 rounded-full bg-slate-700 overflow-hidden",children:(0,e.jsx)("div",{className:"h-full rounded-full bg-indigo-500 transition-all duration-700",style:{width:`${H}%`}})})]})}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:`rounded-xl border ${M.border} ${M.bg} p-4 ${n}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,e.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:"Discipline Score"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[U&&(0,e.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[11px] font-semibold ${M.text}`,children:[(0,e.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${M.dot}`}),K]}),Q&&(0,e.jsx)(q,{to:"/analytics?tab=violations",className:"text-[10px] px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition-colors font-medium",title:"Account Under Review — click to see details",children:"Under Review"})]})]}),(0,e.jsxs)("div",{className:"flex items-baseline gap-1 mb-2",children:[(0,e.jsx)("span",{className:`text-3xl font-bold ${M.text}`,children:U?Math.round(N):"—"}),U&&(0,e.jsx)("span",{className:"text-sm text-slate-500",children:"/ 100"})]}),U&&(0,e.jsx)("button",{onClick:()=>k(!0),className:"text-[11px] text-slate-500 hover:text-slate-300 underline underline-offset-2 transition-colors",children:"How is this calculated?"})]}),V&&(0,e.jsxs)("div",{className:"mt-2 rounded-xl border border-slate-700/50 bg-slate-800/40 p-3",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-slate-300 mb-2",children:"3 ways to improve your score today:"}),(0,e.jsx)("ul",{className:"space-y-1.5",children:zo.map(H=>(0,e.jsxs)("li",{className:"flex items-start gap-2 text-[11px] text-slate-400",children:[(0,e.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:H.icon}),(0,e.jsx)("span",{children:H.tip})]},H.icon))})]}),(0,e.jsx)(se,{children:g&&(0,e.jsx)(Wo,{onClose:()=>k(!1)})})]})}return a==="inline"?!P&&I?(0,e.jsxs)("div",{className:`flex items-center gap-2 ${n}`,children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-600"}),(0,e.jsx)("span",{className:"text-xs text-slate-400",children:"Discipline"}),(0,e.jsx)("span",{className:"text-xs text-slate-500",children:"10 closed trades needed"})]}):!P&&Z?(0,e.jsxs)("div",{className:`flex items-center gap-2 ${n}`,children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-400"}),(0,e.jsx)("span",{className:"text-xs text-slate-400",children:"Discipline"}),(0,e.jsxs)("span",{className:"text-xs font-semibold text-indigo-400",children:["Building… ",z,"/",O]})]}):(0,e.jsxs)("div",{className:`flex items-center gap-2 ${n}`,children:[(0,e.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${M.dot}`}),(0,e.jsx)("span",{className:"text-xs text-slate-400",children:"Discipline"}),(0,e.jsxs)("span",{className:`text-xs font-semibold ${M.text}`,children:[D," ",U&&(0,e.jsxs)("span",{className:"opacity-70",children:["(",K,")"]})]})]}):!P&&I?(0,e.jsxs)("div",{className:`inline-flex items-center gap-2 px-2.5 py-1 rounded-md border border-slate-700/40 bg-slate-800/40 ${n}`,children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-600"}),(0,e.jsx)("span",{className:"text-[11px] text-slate-500",children:"10 closed trades needed"})]}):!P&&Z?(0,e.jsxs)("div",{className:`inline-flex items-center gap-2 px-2.5 py-1 rounded-md border border-indigo-500/25 bg-indigo-500/10 ${n}`,children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-400"}),(0,e.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:"Discipline"}),(0,e.jsx)("span",{className:"text-xs font-bold text-indigo-400",children:"Building…"}),(0,e.jsxs)("span",{className:"text-[10px] text-slate-500",children:[z,"/",O]})]}):(0,e.jsxs)("div",{className:`inline-flex items-center gap-2 px-2.5 py-1 rounded-md border ${M.border} ${M.bg} ${n}`,children:[(0,e.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${M.dot}`}),(0,e.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:"Discipline"}),(0,e.jsx)("span",{className:`text-xs font-bold ${M.text}`,children:U?Math.round(N):"—"}),U&&(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:K})]})})();return s?(0,e.jsx)(q,{to:s,className:"block hover:opacity-90 transition-opacity",children:G}):G}var Uo={messages:jt,ai_insights:rt,trading:Pr,news:Zt,achievements:Xi,social:is,system:hs},Ca={critical:"bg-red-500/15 text-red-300 ring-red-500/30",warning:"bg-amber-500/15 text-amber-300 ring-amber-500/30",success:"bg-emerald-500/15 text-emerald-300 ring-emerald-500/30",info:"bg-blue-500/15 text-blue-300 ring-blue-500/30"};function Vo(t){const a=Math.max(0,Math.floor((Date.now()-t.getTime())/6e4));if(a<1)return"now";if(a<60)return`${a}m`;const s=Math.floor(a/60);if(s<24)return`${s}h`;const n=Math.floor(s/24);
2return n<7?`${n}d`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ho({notification:t,onOpen:a,onArchive:s,compact:n=!1}){const r=t.severity==="critical"?Qt:Uo[t.category]||hs,i=t.displayLabel||"Update";return(0,e.jsxs)("article",{className:`group relative border-b border-white/[0.07] ${t.read?"bg-transparent":"bg-red-500/[0.045]"}`,children:[(0,e.jsxs)("button",{type:"button",onClick:a,className:`flex w-full gap-3 text-left hover:bg-white/[0.035] ${n?"p-4 pr-12":"p-5 pr-14"}`,children:[(0,e.jsx)("span",{className:`mt-0.5 flex shrink-0 items-center justify-center rounded-xl ring-1 ${n?"h-9 w-9":"h-11 w-11"} ${Ca[t.severity]||Ca.info}`,children:(0,e.jsx)(r,{className:"h-5 w-5"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.12em] text-slate-500",children:[(0,e.jsx)("span",{children:i}),(0,e.jsx)("span",{"aria-hidden":"true",children:"•"}),(0,e.jsx)("time",{dateTime:t.createdAt.toISOString(),children:Vo(t.createdAt)}),!t.read&&(0,e.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-red-400","aria-label":"Unread"})]}),(0,e.jsx)("span",{className:"mt-1 block font-semibold text-slate-100",children:t.title}),t.body&&(0,e.jsx)("span",{className:`mt-1 block text-sm leading-5 text-slate-400 ${n?"line-clamp-2":""}`,children:t.body}),!n&&t.deepLink&&(0,e.jsx)("span",{className:"mt-2 block text-xs font-semibold text-red-300",children:"View details →"})]})]}),(0,e.jsx)("button",{type:"button",onClick:c=>{c.stopPropagation(),s()},className:"absolute right-3 top-4 rounded-lg p-2 text-slate-600 opacity-70 hover:bg-white/10 hover:text-slate-200 group-hover:opacity-100","aria-label":`Archive ${t.title}`,title:t.isRedlineEvent?"Archive notification (event history is preserved)":"Archive notification",children:(0,e.jsx)(js,{className:"h-4 w-4"})})]})}function Cs({isOpen:t,onClose:a,currentUser:s}){const n=me(),r=s?.uid||ge.currentUser?.uid,[i,c]=(0,o.useState)([]),[d,l]=(0,o.useState)("all"),[x,h]=(0,o.useState)(!1),[m,p]=(0,o.useState)(""),g=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!(!t||!r))return h(!0),p(""),Lr(r,y=>{c(y),h(!1)},y=>{h(!1),y?.code!=="permission-denied"&&p("Could not load notifications. Try again.")})},[t,r]);const k=(0,o.useMemo)(()=>d==="all"?i:i.filter(y=>y.category===d),[d,i]),v=i.filter(y=>!y.read).length,u=(0,o.useCallback)((y,w)=>{l(y),requestAnimationFrame(()=>{const N=g.current;if(!N||!w)return;const b=w.offsetLeft-(N.clientWidth-w.offsetWidth)/2;N.scrollTo({left:Math.max(0,b),behavior:"smooth"})})},[]),E=async y=>{y.read||await Er(y.id),a(),n(y.deepLink)},C=y=>{a(),n(y)};return(0,e.jsx)(se,{children:t&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(f.button,{type:"button","aria-label":"Close notifications",initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},onClick:a,className:"fixed inset-0 z-[90] cursor-default bg-black/50 backdrop-blur-sm"}),(0,e.jsxs)(f.aside,{role:"dialog","aria-modal":"true","aria-labelledby":"quick-notifications-title",initial:{opacity:0,x:24,y:-8},animate:{opacity:1,x:0,y:0},exit:{opacity:0,x:24,y:-8},className:"fixed right-3 top-20 z-[100] flex max-h-[min(760px,calc(100dvh-6rem))] w-[min(430px,calc(100vw-1.5rem))] transform-gpu flex-col isolate overflow-hidden rounded-2xl border border-slate-700/70 bg-slate-950 shadow-2xl shadow-black/50",children:[(0,e.jsxs)("header",{className:"border-b border-white/10 px-4 py-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{id:"quick-notifications-title",className:"text-base font-semibold text-white",children:"Quick Notifications"}),(0,e.jsx)("p",{className:"text-xs text-slate-400",children:v?`${v} unread in your latest alerts`:"You’re caught up"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("button",{type:"button",onClick:()=>C("/notifications/settings"),className:"rounded-lg p-2 text-slate-400 hover:bg-white/10 hover:text-white","aria-label":"Notification settings",children:(0,e.jsx)(kt,{className:"h-5 w-5"})}),(0,e.jsx)("button",{type:"button",onClick:a,className:"rounded-lg p-2 text-slate-400 hover:bg-white/10 hover:text-white","aria-label":"Close",children:(0,e.jsx)(qe,{className:"h-5 w-5"})})]})]}),(0,e.jsxs)("div",{className:"mt-3 flex min-w-0 items-center gap-2",children:[(0,e.jsx)("span",{className:"flex h-11 w-8 shrink-0 items-center justify-center","aria-hidden":"true",children:(0,e.jsx)(sr,{className:"h-4 w-4 text-slate-500"})}),(0,e.jsx)("div",{ref:g,role:"tablist","aria-label":"Filter notifications",className:"flex min-w-0 flex-1 snap-x snap-mandatory gap-2 overflow-x-auto overscroll-x-contain py-1 [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden",children:Object.entries(gr).map(([y,w])=>{const N=d===y;return(0,e.jsx)("button",{type:"button",role:"tab","aria-selected":N,onClick:b=>u(y,b.currentTarget),className:`min-h-11 shrink-0 snap-center touch-manipulation whitespace-nowrap rounded-full border px-4 py-2 text-sm font-semibold transition-[color,background-color,border-color,box-shadow,transform] duration-150 active:scale-[0.97] ${N?"border-red-400 bg-red-500 text-white shadow-md shadow-red-950/30 ring-2 ring-red-400/25":"border-white/10 bg-white/[0.06] text-slate-300 hover:bg-white/10"}`,children:w},y)})})]})]}),(0,e.jsxs)("div",{className:"min-h-40 flex-1 overflow-y-auto",children:[x&&(0,e.jsx)("div",{className:"p-8 text-center text-sm text-slate-400",children:"Loading notifications…"}),m&&(0,e.jsx)("div",{role:"alert",className:"m-4 rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-200",children:m}),!x&&!m&&k.length===0&&(0,e.jsxs)("div",{className:"flex flex-col items-center px-6 py-12 text-center",children:[(0,e.jsx)(ea,{className:"h-8 w-8 text-slate-600"}),(0,e.jsx)("p",{className:"mt-3 text-sm font-medium text-slate-300",children:"No notifications here"}),(0,e.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:"New activity will appear here."})]}),k.map(y=>(0,e.jsx)(Ho,{notification:y,compact:!0,onOpen:()=>E(y),onArchive:()=>wr(y.id)},y.id))]}),(0,e.jsxs)("footer",{className:"border-t border-white/10 bg-slate-950/95 p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:[(0,e.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,e.jsxs)("button",{type:"button",disabled:!v,onClick:()=>pr(r),className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs text-slate-300 hover:bg-white/10 disabled:opacity-40",children:[(0,e.jsx)(rs,{className:"h-4 w-4"})," Mark all read"]}),(0,e.jsxs)("button",{type:"button",disabled:!i.length,onClick:()=>Nr(r),className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs text-slate-400 hover:bg-white/10 disabled:opacity-40",children:[(0,e.jsx)(js,{className:"h-4 w-4"})," Clear all"]})]}),(0,e.jsx)("button",{type:"button",onClick:()=>C("/notifications"),className:"min-h-11 w-full touch-manipulation rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-semibold text-slate-950 shadow-sm transition-colors hover:bg-slate-100 active:bg-slate-200 dark:border-white/10 dark:bg-slate-900 dark:text-white dark:shadow-black/30 dark:hover:bg-slate-800 dark:active:bg-slate-700",children:"View all notifications"})]})]})]})})}var We=[{path:"/trade-logger",labelKey:"nav.ledger",shortLabelKey:"nav.ledger",icon:Ja,priority:1,group:"core",description:"Log & review all trades"},{path:"/today",labelKey:"nav.today",shortLabelKey:"nav.today",icon:Ns,priority:2,group:"core",description:"Daily trading dashboard"},{path:"/trade-analytics",labelKey:"nav.analytics",shortLabelKey:"nav.analytics",icon:Rt,priority:3,group:"core",description:"Performance metrics & charts"},{path:"/agent",labelKey:"nav.agentStudio",shortLabelKey:"nav.agent",icon:fs,priority:4,group:"core",description:"Build & deploy your trading agent"},{path:"/strategy-lab",labelKey:"nav.strategyLab",shortLabelKey:"nav.lab",icon:vs,priority:5,group:"core",description:"Backtest, paper trade & build bots"},{path:"/education",labelKey:"nav.learn",shortLabelKey:"nav.learn",icon:rt,priority:5,group:"learn",description:"Courses, lessons & AI coaching"},{path:"/chat",labelKey:"nav.chat",shortLabelKey:"nav.chat",icon:jt,priority:6,group:"community",description:"Real-time trader chat"},{path:"/community",labelKey:"nav.community",shortLabelKey:"nav.community",icon:Jt,priority:7,group:"community",description:"Trade ideas & social feed"},{path:"/news",labelKey:"nav.tradingContext",shortLabelKey:"nav.tradingContext",icon:Zt,priority:8,group:"learn",description:"Market news & earnings"},{path:"/feedback",labelKey:"nav.feedback",shortLabelKey:"nav.feedback",icon:ro,priority:9,group:"community",description:"Share ideas & report bugs"}],Go=(0,o.memo)(()=>{const{branding:t}=At(),a=ve(i=>i.isDark()),s=t?.logoUrl||t?.logoUrlDark,[n,r]=(0,o.useState)(!1);return(0,e.jsx)("div",{className:"relative w-9 h-9 sm:w-10 sm:h-10 rounded-xl overflow-hidden flex-shrink-0",children:(0,e.jsx)("div",{className:`w-full h-full flex items-center justify-center ${a?"bg-slate-900":"bg-white"}`,children:s&&!n?(0,e.jsx)("img",{src:s,alt:"App Logo",className:"w-full h-full object-cover",onError:()=>r(!0)}):(0,e.jsx)("span",{className:"text-transparent bg-clip-text bg-gradient-to-br from-red-400 via-orange-400 to-red-500 font-black text-base tracking-tight",children:"RDL"})})})}),Yo=(0,o.memo)(()=>{const{branding:t}=At(),a=ve(n=>n.isDark()),s=t?.appName||"Redline";return(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("h1",{className:`text-base sm:text-lg font-extrabold leading-none tracking-tight ${a?"text-white":"text-slate-900"}`,children:s}),(0,e.jsx)("span",{className:"text-[9px] sm:text-[10px] font-semibold text-red-500/80 tracking-wider up
2percase leading-tight",children:"Trading OS"})]})}),qo=(0,o.memo)(({item:t,isActive:a,useShortLabel:s,onNavigate:n,onPrefetch:r})=>{const i=t.icon,c=t.path==="/trade-logger",d=s?t.shortLabel:t.label,l=ve(m=>m.isDark()),x=l?"bg-slate-800/60 text-slate-300 hover:bg-slate-700/80 hover:text-white border border-transparent":"bg-slate-100 text-slate-600 hover:bg-slate-200 hover:text-slate-900 border border-slate-200/60",h=l?"bg-gradient-to-r from-green-600/20 to-emerald-600/20 text-green-300 hover:from-green-600/30 hover:to-emerald-600/30 hover:text-green-200 border border-green-500/30":"bg-gradient-to-r from-green-500/10 to-emerald-500/10 text-green-700 hover:from-green-500/20 hover:to-emerald-500/20 hover:text-green-800 border border-green-500/30";return(0,e.jsxs)(q,{to:t.path,onClick:m=>n(m,t.path),onMouseEnter:()=>r(t.path),onTouchStart:()=>r(t.path),className:`nav-link-item flex items-center gap-1.5 lg:gap-2 px-3 lg:px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-100 whitespace-nowrap flex-shrink-0 active:scale-[0.97] touch-manipulation ${a?"bg-gradient-to-r from-sky-500 via-blue-600 to-blue-600 text-white shadow-lg shadow-blue-500/25 border border-blue-400/30":c?h:x}`,style:{WebkitTapHighlightColor:"transparent"},title:t.label,children:[(0,e.jsx)(i,{className:"w-4 h-4 lg:w-[18px] lg:h-[18px] flex-shrink-0"}),(0,e.jsx)("span",{className:"text-xs lg:text-sm",translate:"no",children:d})]})}),Ko=(0,o.memo)(({item:t,isActive:a,isFocused:s,index:n,onNavigate:r,onPrefetch:i,onClose:c,itemRef:d})=>{const l=t.icon,x=ve(h=>h.isDark());return(0,e.jsxs)(q,{ref:d,to:t.path,role:"menuitem",tabIndex:s?0:-1,"data-index":n,onClick:h=>{c(),r(h,t.path)},onMouseEnter:()=>i(t.path),className:`group flex items-center gap-3 px-3 py-2.5 text-sm transition-all duration-100 rounded-xl mx-1.5 my-0.5 outline-none ${a?"bg-gradient-to-r from-sky-500/25 to-blue-600/20 text-white ring-1 ring-blue-500/40 shadow-sm shadow-blue-500/10":s?x?"bg-slate-700/70 text-white ring-1 ring-slate-500/40":"bg-slate-100 text-slate-900 ring-1 ring-slate-300/60":x?"text-slate-300 hover:bg-slate-700/50 hover:text-white":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[(0,e.jsx)("div",{className:`flex items-center justify-center w-8 h-8 rounded-lg flex-shrink-0 transition-colors ${a?"bg-blue-500/20 text-blue-300":x?"bg-slate-700/60 text-slate-400 group-hover:bg-slate-600/60 group-hover:text-slate-200":"bg-slate-100 text-slate-500 group-hover:bg-slate-200 group-hover:text-slate-700"}`,children:(0,e.jsx)(l,{className:"w-4 h-4"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium truncate",translate:"no",children:t.label}),a&&(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 flex-shrink-0 animate-pulse"})]}),t.description&&(0,e.jsx)("p",{className:`text-[11px] leading-tight mt-0.5 truncate ${a?"text-blue-300/70":x?"text-slate-500 group-hover:text-slate-400":"text-slate-400 group-hover:text-slate-500"}`,children:t.description})]})]})}),Xo=(0,o.memo)(({label:t,isDark:a})=>(0,e.jsxs)("div",{className:"px-4 pt-2.5 pb-1 flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-[10px] font-bold uppercase tracking-widest ${a?"text-slate-500":"text-slate-400"}`,children:t}),(0,e.jsx)("div",{className:`flex-1 h-px ${a?"bg-slate-700/50":"bg-slate-200/80"}`})]})),Qo=(0,o.memo)(o.forwardRef(({items:t,isOpen:a,isOverflowActive:s,onToggle:n,onClose:r,isPathActive:i,onNavigate:c,onPrefetch:d},l)=>{const{t:x}=ye(),h={core:x("nav.groups.core","Core Tools"),learn:x("nav.groups.learn","Learn"),community:x("nav.groups.community","Community")},[m,p]=(0,o.useState)(-1),g=(0,o.useRef)([]),k=(0,o.useRef)(null),v=(0,o.useRef)(null);(0,o.useEffect)(()=>{p(a?0:-1)},[a]),(0,o.useEffect)(()=>{a&&m>=0&&g.current[m]&&g.current[m].focus()},[m,a]);const u=(0,o.useCallback)(y=>{if(!a){(y.key==="Enter"||y.key===" "||y.key==="ArrowDown")&&(y.preventDefault(),n());return}switch(y.key){case"ArrowDown":y.preventDefault(),p(w=>(w+1)%t.length);break;case"ArrowUp":y.preventDefault(),p(w=>(w-1+t.length)%t.length);break;case"Home":y.preventDefault(),p(0);break;case"End":y.preventDefault(),p(t.length-1);break;case"Escape":y.preventDefault(),r(),v.current?.focus();break;case"Tab":r();break;default:break}},[a,t.length,n,r]),E=(0,o.useMemo)(()=>{const y=[];let w=null,N=0;const b=new Set;return t.forEach(j=>
2{j.group&&j.group!==w&&(new Set(t.map(T=>T.group)).size>1&&!b.has(j.group)&&(y.push({type:"divider",key:`grp-${j.group}-${N}`,label:h[j.group]||j.group}),b.add(j.group)),w=j.group),y.push({type:"item",key:j.path,item:j,itemIndex:N}),N++}),y},[t]),C=ve(y=>y.isDark());return(0,e.jsxs)("div",{className:"relative flex-shrink-0",ref:l,onKeyDown:u,children:[(0,e.jsxs)("button",{ref:v,onClick:n,className:`flex items-center gap-1.5 px-3 lg:px-3.5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-100 whitespace-nowrap active:scale-[0.97] touch-manipulation border ${a||s?C?"bg-slate-700 text-white border-slate-600":"bg-slate-200 text-slate-900 border-slate-300":C?"bg-slate-800/60 text-slate-400 hover:bg-slate-700/80 hover:text-white border-transparent":"bg-slate-100 text-slate-500 hover:bg-slate-200 hover:text-slate-800 border-slate-200/60"}`,title:x("nav.morePages","More pages"),"aria-expanded":a,"aria-haspopup":"menu","aria-controls":"overflow-menu",children:[(0,e.jsx)(ho,{className:"w-4 h-4 lg:w-[18px] lg:h-[18px]"}),(0,e.jsx)("span",{className:"text-xs lg:text-sm",translate:"no",children:x("nav.more","More")}),s&&!a&&(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-purple-400 flex-shrink-0 animate-pulse"})]}),(0,e.jsx)(se,{children:a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(f.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},className:"fixed inset-0 z-[59] sm:hidden",onClick:r,"aria-hidden":"true"}),(0,e.jsxs)(f.div,{ref:k,id:"overflow-menu",role:"menu","aria-label":x("nav.moreNavigation","More navigation"),initial:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-6,scale:.97},transition:{duration:.18,ease:[.22,1,.36,1]},className:`absolute left-0 sm:left-auto sm:right-0 mt-2 w-[calc(100vw-2rem)] sm:w-72 max-h-[70vh] overflow-y-auto overscroll-contain backdrop-blur-xl rounded-2xl shadow-2xl z-[60] ${C?"bg-slate-800/95 border border-slate-700/80 shadow-black/30 ring-1 ring-white/5":"bg-white/97 border border-slate-200/80 shadow-slate-300/30 ring-1 ring-black/5"}`,style:{scrollbarWidth:"thin",scrollbarColor:C?"#475569 transparent":"#cbd5e1 transparent"},children:[(0,e.jsx)("div",{className:`px-4 pt-3.5 pb-2 border-b ${C?"border-slate-700/50":"border-slate-200/70"}`,children:(0,e.jsx)("p",{className:`text-[11px] font-bold uppercase tracking-widest ${C?"text-slate-500":"text-slate-400"}`,children:x("nav.navigateTo","Navigate to")})}),(0,e.jsx)("div",{className:"py-1.5",children:E.map(y=>y.type==="divider"?(0,e.jsx)(Xo,{label:y.label,isDark:C},y.key):(0,e.jsx)(Ko,{item:y.item,index:y.itemIndex,isActive:i(y.item.path),isFocused:m===y.itemIndex,onNavigate:c,onPrefetch:d,onClose:r,itemRef:w=>{g.current[y.itemIndex]=w}},y.key))}),(0,e.jsx)("div",{className:`px-4 py-2 border-t ${C?"border-slate-700/50":"border-slate-200/70"}`,children:(0,e.jsxs)("p",{className:`text-[10px] flex items-center gap-1.5 ${C?"text-slate-600":"text-slate-400"}`,children:[(0,e.jsx)("kbd",{className:`px-1 py-0.5 rounded text-[9px] font-mono ${C?"bg-slate-700/80 text-slate-400":"bg-slate-100 text-slate-500"}`,children:"↑↓"}),(0,e.jsx)("span",{children:"navigate"}),(0,e.jsx)("kbd",{className:`px-1 py-0.5 rounded text-[9px] font-mono ${C?"bg-slate-700/80 text-slate-400":"bg-slate-100 text-slate-500"}`,children:"esc"}),(0,e.jsx)("span",{children:"close"})]})})]})]})})]})})),Jo=({user:t,_theme:a,_onCommandPalette:s,onOpenSettings:n})=>{const r=F=>{n?.(F)},i=ve(F=>F.isDark()),c=fe(),d=me(),l=Nt(F=>F.user?.avatar||F.user?.photoURL||null),x=Nt(F=>F.user?.username||null),[h,m]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(!t?.uid){m(null);return}const F=jn(t.uid,m);return()=>F()},[t?.uid]);const p=l||h?.avatar||h?.photoURL||h?.profilePicture||t?.photoURL||null,g=x||h?.username||h?.displayName||t?.username||t?.displayName||null,k=t&&{...t,...p?{avatar:p,photoURL:p}:{},...g?{username:g,displayName:t.displayName||g}:{}},[v,u]=(0,o.useState)(!1),[E,C]=(0,o.useState)(!1),[y,w]=(0,o.useState)(!1),[N,b]=(0,o.useState)(!1),[j,T]=(0,o.useState)(We.length),[z,O]=(0,o.useState)(!1),P=(0,o.useRef)(null),U=(0,o.useRef)(null),Z=(0,o.useRef)(null),I=(0,o.useRef)(null),M=(0,o.useRef)(null),K=Et(F=>F.unreadNotifications);(0,o.useEffect)(()=>{k?.uid?cs(k.uid).then(b).catch(()=>b(!1)):b(!1)},[k?.uid]);const{t:D,i18n:Q}=ye(),V=(0,o.useMemo)(()=>We.map(F=>({...F,label:D(F.labelKey),shortLabel:D(F.shortLabelKey)})),[D,Q.language]),G=(0,o.useMemo)(()=>V.slice(0,j),[V,j]),H=(0,o.useMemo)(()=>V.slice(j),[V,j]),R=(0,o.useRef)(null),Y=(0,o.useCallback)(()=>{const F=Z.current,te=R.current,we=M.current;if(!F||!te||!we)return;const Se=F.getBoundingClientRect().width;if(Se<120)return;const Pe=88,ue=8;function ot(De){const Fe=De.children;if(!Fe.length)return 0;let lt=0,ct=0;for(let Oe=0;Oe<Fe.length;Oe++){const Le=Fe[Oe].getBoundingClientRect().width+ue,Mt=Oe<Fe.length-1?Se-Pe:Se;if(lt+Le<=Mt)lt+=Le,ct++;else break}return Math.max(2,ct)}if(ot(te)>=We.length)T(We.length),O(!1);else{const De=ot(we);De>=We.length?(T(We.length),O(!0)):(T(De),O(!0))}},[]);(0,o.useEffect)(()=>{const F=Z.current;if(!F)return;const te=new ResizeObserver(()=>{I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(Y)});te.observe(F),requestAnimationFrame(Y);const we=[setTimeout(Y,150),setTimeout(Y,400),setTimeout(Y,900)];let Se=!1;document?.fonts?.ready&&document.fonts.ready.then(()=>{Se||Y()}).catch(()=>{});const Pe=()=>Y();return window.addEventListener("load",Pe),()=>{Se=!0,te.disconnect(),I.current&&cancelAnimationFrame(I.current),we.forEach(clearTimeout),window.removeEventListener("load",Pe)}},[Y]),(0,o.useEffect)(()=>{const F=te=>{P.current&&!P.current.contains(te.target)&&u(!1),U.current&&!U.current.contains(te.target)&&C(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]),(0,o.useEffect)(()=>{C(!1),u(!1)},[c.pathname]);const{setUserOnline:ee,cleanup:re}=ts(),le=(0,o.useCallback)((F,te)=>{F.preventDefault(),(0,o.startTransition)(()=>{d(te)})},[d]),Ee=(0,o.useCallback)(F=>{ds(F)},[]),Lt=(0,o.useCallback)(async()=>{try{k?.uid&&(ee(k.uid,!1).catch(()=>{}),re());try{const{clearUserLocalData:F}=await $(async()=>{const{clearUserLocalData:te}=await import("./market-core-B8Bfud51.js").then(we=>we.ps);return{clearUserLocalData:te}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));F()}catch{}await ge.signOut()}catch(F){console.error("Sign out error:",F)}finally{window.location.replace("/signin")}},[k?.uid,ee,re]),it=(0,o.useCallback)(F=>c.pathname===F,[c.pathname]),Qe=(0,o.useMemo)(()=>H.some(F=>c.pathname===F.path),[H,c.pathname]);return(0,e.jsxs)("header",{className:`top-nav-header sticky top-0 z-50 border-b backdrop-blur-xl shadow-lg pointer-events-auto transition-colors duration-200 ${i?"bg-slate-900/[0.98] border-slate-700/50 shadow-black/10":"bg-white/[0.98] border-slate-200/70 shadow-slate-200/20"}`,children:[(0,e.jsx)("div",{className:"w-full px-4 sm:px-6 lg:px-8",children:(0,e.jsxs)("div",{className:"flex items-center justify-between h-20 min-w-0 gap-2",children:[(0,e.jsx)(q,{to:"/",className:"flex items-center gap-2 md:gap-3 group flex-shrink-0",title:"Go to Dashboard (Home)","aria-label":"Home - Go to Dashboard",children:(0,e.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,e.jsx)(Go,{}),(0,e.jsx)(Yo,{})]})}),(0,e.jsxs)("div",{ref:Z,className:"flex-1 min-w-0 mx-1 sm:mx-2 lg:mx-4 relative",children:[(0,e.jsx)("div",{ref:R,"aria-hidden":"true",className:"flex items-center gap-1.5 absolute top-0 left-0 pointer-events-none",style:{visibility:"hidden",height:0,overflow:"hidden",
2whiteSpace:"nowrap"},children:V.map(F=>{const te=F.icon;return(0,e.jsxs)("span",{className:"flex items-center gap-1.5 lg:gap-2 px-3 lg:px-4 py-2.5 rounded-xl text-sm font-semibold whitespace-nowrap",children:[(0,e.jsx)(te,{className:"w-4 h-4 lg:w-[18px] lg:h-[18px]"}),(0,e.jsx)("span",{className:"text-xs lg:text-sm",children:F.label})]},F.path)})}),(0,e.jsx)("div",{ref:M,"aria-hidden":"true",className:"flex items-center gap-1.5 absolute top-0 left-0 pointer-events-none",style:{visibility:"hidden",height:0,overflow:"hidden",whiteSpace:"nowrap"},children:V.map(F=>{const te=F.icon;return(0,e.jsxs)("span",{className:"flex items-center gap-1.5 lg:gap-2 px-3 lg:px-4 py-2.5 rounded-xl text-sm font-semibold whitespace-nowrap",children:[(0,e.jsx)(te,{className:"w-4 h-4 lg:w-[18px] lg:h-[18px]"}),(0,e.jsx)("span",{className:"text-xs lg:text-sm",children:F.shortLabel})]},F.path)})}),(0,e.jsxs)("nav",{className:"flex items-center gap-2",role:"navigation","aria-label":"Main navigation",children:[G.map(F=>(0,e.jsx)(qo,{item:F,isActive:it(F.path),useShortLabel:z,onNavigate:le,onPrefetch:Ee},F.path)),H.length>0&&(0,e.jsx)(Qo,{ref:U,items:H,isOpen:E,isOverflowActive:Qe,onToggle:()=>C(F=>!F),onClose:()=>C(!1),isPathActive:it,onNavigate:le,onPrefetch:Ee})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[k&&(0,e.jsxs)("button",{onClick:()=>w(!0),className:`relative p-2 rounded-lg transition-all touch-manipulation ${i?"text-slate-400 hover:text-white hover:bg-slate-700/50":"text-slate-500 hover:text-slate-900 hover:bg-slate-100"}`,title:"Notifications","aria-label":`Notifications${K>0?` (${K} unread)`:""}`,children:[(0,e.jsx)(ea,{className:"w-5 h-5"}),K>0&&(0,e.jsx)(f.span,{initial:{scale:0},animate:{scale:1},className:"absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-red-500 rounded-full text-[9px] font-bold flex items-center justify-center text-white shadow-lg",children:K>9?"9+":K})]}),k&&(0,e.jsxs)("div",{className:"relative",ref:P,children:[(0,e.jsxs)("button",{onClick:F=>{F.preventDefault(),F.stopPropagation(),u(te=>!te)},className:`flex items-center gap-2 p-1 sm:p-1.5 rounded-lg transition-colors group touch-manipulation ${i?"hover:bg-slate-700/50":"hover:bg-slate-100"}`,"aria-label":"User menu","aria-expanded":v,"aria-haspopup":"true",children:[(0,e.jsx)("div",{className:"relative flex-shrink-0",children:(0,e.jsx)(Vt,{user:k,size:"md",showRing:!0,ringColor:i?"ring-slate-400":"ring-slate-600",className:"rounded-lg"})}),(0,e.jsx)("span",{className:`hidden xl:block text-sm font-medium max-w-[140px] 2xl:max-w-[200px] truncate transition-colors ${i?"text-slate-200 group-hover:text-white":"text-slate-700 group-hover:text-slate-900"}`,children:k.username||k.displayName||(k.email?k.email.split("@")[0]:"Trader")})]}),(0,e.jsx)(se,{children:v&&(0,e.jsxs)(f.div,{initial:{opacity:0,y:-8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.96},transition:{duration:.15,ease:[.22,1,.36,1]},className:`user-menu-dropdown absolute right-0 mt-2 w-64 rounded-xl shadow-2xl overflow-hidden z-[60] ${i?"bg-slate-800 border border-slate-700":"bg-white border border-slate-200"}`,children:[(0,e.jsxs)("div",{className:`p-4 border-b ${i?"border-slate-700":"border-slate-200"}`,children:[(0,e.jsx)("p",{className:`text-base font-semibold truncate ${i?"text-white":"text-slate-900"}`,children:k.username||k.displayName||(k.email?k.email.split("@")[0]:"Trader")}),(0,e.jsx)("p",{className:`text-sm truncate ${i?"text-slate-400":"text-slate-500"}`,children:k.email}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(Ss,{variant:"pill",linkTo:"/analytics?tab=discipline"})})]}),(0,e.jsxs)("div",{className:"py-2",children:[(0,e.jsxs)(q,{to:`/user/${k.uid}`,onClick:()=>u(!1),className:`flex items-center gap-3 px-4 py-2.5 text-sm transition-all ${i?"text-slate-300 hover:bg-slate-700/50 hover:text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"}`,children:[(0,e.jsx)(Jt,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"My Profile"})]}),(0,e.jsxs)(q,{to:"/pricing",onClick:()=>u(!1),className:"flex items-center gap-3 px-4 py-2.5 text-sm text-emerald-400 hover:bg-emerald-500/10 hover:text-emerald-300 transition-all",children:[(0,e.jsx)(os,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"💎 Upgrade Plan"})]}),(0,e.jsxs)(q,{to:"/org/browse",onClick:()=>u(!1),className:"flex items-center gap-3 px-4 py-2.5 text-sm text-blue-400 hover:bg-blue-500/10 hover:text-blue-300 transition-all",children:[(0,e.jsx)(ys,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"Browse Firms"})]}),(0,e.jsx)("hr",{className:`my-2 ${i?"border-slate-700":"border-slate-200"}`}),N&&(0,e.jsxs)(q,{to:"/admin",onClick:()=>u(!1),className:"flex items-center gap-3 px-4 py-2.5 text-sm text-orange-400 hover:bg-orange-500/10 hover:text-orange-300 transition-all",children:[(0,e.jsx)(kt,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"Admin Panel"})]}),(0,e.jsxs)("button",{onClick:()=>{u(!1),r("appearance")},className:`flex items-center gap-3 px-4 py-2.5 text-sm transition-all w-full touch-manipulation ${i?"text-slate-300 hover:bg-slate-700/50 hover:text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"}`,children:[(0,e.jsx)(kt,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"Settings"})]}),(0,e.jsxs)("button",{onClick:()=>{u(!1),d("/support")},className:`flex items-center gap-3 px-4 py-2.5 text-sm transition-all w-full touch-manipulation ${i?"text-slate-300 hover:bg-slate-700/50 hover:text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"}`,children:[(0,e.jsx)(ks,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"Support"})]}),(0,e.jsx)("hr",{className:`my-2 ${i?"border-slate-700":"border-slate-200"}`}),(0,e.jsxs)("button",{onClick:()=>{u(!1),Lt()},className:"flex items-center gap-3 px-4 py-2.5 text-sm text-red-500 hover:bg-red-500/10 hover:text-red-600 transition-all w-full touch-manipulation",children:[(0,e.jsx)(ws,{className:"w-5 h-5"})," ",(0,e.jsx)("span",{children:"Sign Out"})]})]})]})})]})]})]})}),(0,e.jsx)(Cs,{isOpen:y,onClose:()=>w(!1),currentUser:k})]})},Zo=(0,o.memo)(Jo),ia=t=>({headerBg:t?"rgba(15, 17, 26, 0.82)":"rgba(255, 255, 255, 0.88)",hairline:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",titleColor:t?"rgba(255,255,255,0.92)":"rgba(15,23,42,0.92)",logoBg:t?"#0f172a":"#ffffff",brandGradient:t?"linear-gradient(90deg, #fff, #e2e8f0)":"linear-gradient(90deg, #1e293b, #334155)",btnBg:t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",btnBgActive:t?"rgba(14,165,233,0.2)":"rgba(14,165,233,0.12)",iconMuted:t?"#94a3b8":"#64748b",avatarBg:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)",dropdownBg:t?"rgba(18,21,35,0.98)":"rgba(255,255,255,0.98)",dropdownBorder:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)",dropdownShadow:t?"0 20px 60px rgba(0,0,0,0.55)":"0 20px 60px rgba(0,0,0,0.15)",profileBg:t?"linear-gradient(135deg, rgba(14,165,233,0.1), rgba(6,182,212,0.08))":"linear-gradient(135deg, rgba(14,165,233,0.06), rgba(6,182,212,0.04))",profileBorder:t?"1px solid rgba(255,255,255,0.06)":"1px solid rgba(0,0,0,0.06)",textPrimary:t?"#fff":"#0f172a",textSecondary:t?"#94a3b8":"#64748b",textMenu:t?"#cbd5e1":"#334155",separator:t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",hoverBg:t?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)"}),el=()=>{const{branding:t}=At(),a=ve(j=>j.isDark()),s=ia(a),n=t?.logoUrl||t?.logoUrlDark,r=t?.appName||"Redline",[i,c]=(0,o.useState)(!1),d=ua(0),l=ua(0),x=ha(d,{stiffness:260,damping:22,mass:.6}),h=ha(l,{stiffness:260,damping:22,mass:.6}),m=Rr(x,[-12,12],[-3,3]),p=(0,o.useRef)(null),g=(0,o.useRef)(!1),k=.42,v=12,u=7,E=(j,T)=>{if(!p.current)return;const z=p.current.getBoundingClientRect(),O=z.left+z.width/2,P=z.top+z.height/2,U=Math.max(-12,Math.min(v,(j-O)*k)),Z=Math.max(-7,Math.min(u,(T-P)*k));d.set(U),l.set(Z)},C=()=>{g.current=!1,d.set(0),l.set(0)},y=j=>{j.pointerType!=="touch"&&E(j.clientX,j.clientY)},w=j=>{g.current=!0;const T=j.touches[0];E(T.clientX,T.clientY)},N=j=>{if(!g.current)return;const T=j.touches[0];E(T.clientX,T.clientY)},b=()=>C();return(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",justifySelf:"start"},children:(0,e.jsx)(q,{to:"/",className:"flex items-center touch-manipulation",style:{WebkitTapHighlightColor:"transparent"},children:(0,e.jsxs)(f.div,{ref:p,style:{display:"flex",alignItems:"center",gap:10,x,y:h,rotateZ:m,transformOrigin:"center center",willChange:"transform"},onPointerEnter:()=>{},onPointerMove:y,onPointerLeave:C,onTouchStart:w,onTouchMove:N,onTouchEnd:b,onTouchCancel:b,children:[(0,e.jsx)("div",{style:{position:"relative",width:36,height:36,flexShrink:0,borderRadius:9,background:s.logoBg,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:n&&!i?(0,e.jsx)("img",{src:n,alt:"App Logo",style:{width:"100%",height:"100%",objectFit:"cover"},onError:()=>c(!0)}):(0,e.jsx)("span",{style:{background:"linear-gradient(135deg, #f87171, #fb923c)",WebkitBackgroun
2dClip:"text",WebkitTextFillColor:"transparent",fontWeight:900,fontSize:12,letterSpacing:"-0.02em"},children:"RDL"})}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:1},children:[(0,e.jsx)("span",{style:a?{fontSize:16,fontWeight:800,letterSpacing:"0.01em",background:s.brandGradient,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",lineHeight:1}:{fontSize:16,fontWeight:800,letterSpacing:"0.01em",color:"#0f172a",lineHeight:1},children:r}),(0,e.jsx)("span",{style:{fontSize:8,fontWeight:500,letterSpacing:"0.15em",color:"rgba(248, 113, 113, 0.8)",textTransform:"uppercase"},children:"Trading OS"})]})]})})})},tl=({user:t,onOpenSettings:a})=>{const s=fe(),n=me(),r=ia(ve(T=>T.isDark())),[i,c]=(0,o.useState)(!1),d=Nt(T=>T.user?.uid===t?.uid?T.user:null),l=d?.avatar||d?.photoURL||null,x=t?.avatar||t?.photoURL||l||null,h=t?.username||d?.username||t?.displayName||d?.displayName||null,m=t&&{...t,...x?{avatar:x,photoURL:x}:{},...h?{displayName:h}:{}},[p,g]=(0,o.useState)(!1),k=Et(T=>T.unreadNotifications),[v,u]=(0,o.useState)(!1),E=(0,o.useRef)(null),C=(0,o.useRef)(null),y=()=>{const T=s.pathname,z={"/":"Dashboard","/trade-logger":"Ledger","/trade-analytics":"Analytics","/chat":"Chat","/news":"Trading Context","/education":"Learn","/community":"Idea Hub","/feedback":"Feedback","/admin":"Admin","/today":"Today","/pricing":"Upgrade"};return T.startsWith("/user/")?"Profile":T.startsWith("/learn/")?"Learning":z[T]||"Redline"};(0,o.useEffect)(()=>{m?.uid&&cs(m.uid).then(u)},[m?.uid]),(0,o.useEffect)(()=>{const T=z=>{E.current&&!E.current.contains(z.target)&&c(!1),C.current&&!C.current.contains(z.target)&&g(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const{setUserOnline:w,cleanup:N}=ts(),b=async()=>{try{m?.uid&&(w(m.uid,!1).catch(()=>{}),N());try{const{clearUserLocalData:T}=await $(async()=>{const{clearUserLocalData:z}=await import("./market-core-B8Bfud51.js").then(O=>O.ps);return{clearUserLocalData:z}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));T()}catch{}await ge.signOut()}catch(T){console.error("Sign out error:",T)}finally{window.location.replace("/signin")}},j=y();return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("header",{className:"ios-header sticky top-0 z-[100]",style:{background:r.headerBg,backdropFilter:"blur(40px) saturate(180%)",WebkitBackdropFilter:"blur(40px) saturate(180%)"},children:[(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr auto 1fr",alignItems:"center",height:"48px",padding:"0 16px"},children:[(0,e.jsx)(el,{}),(0,e.jsx)("div",{style:{textAlign:"center",overflow:"hidden"},children:(0,e.jsx)(se,{mode:"wait",children:(0,e.jsx)(f.span,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},style:{fontSize:16,fontWeight:600,color:r.titleColor,whiteSpace:"nowrap",display:"inline-block",maxWidth:170,overflow:"hidden",textOverflow:"ellipsis"},children:j},j)})}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,justifySelf:"end"},children:[m&&(0,e.jsxs)("div",{ref:C,style:{position:"relative"},children:[(0,e.jsxs)("button",{onClick:()=>{g(T=>!T),c(!1)},style:{width:38,height:38,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",background:p?r.btnBgActive:r.btnBg,border:"none",cursor:"pointer",WebkitTapHighlightColor:"transparent",transition:"background 0.15s"},"aria-label":"Notifications",children:[k>0?(0,e.jsx)(io,{style:{width:20,height:20,color:"#facc15"}}):(0,e.jsx)(ea,{style:{width:20,height:20,color:r.iconMuted}}),k>0&&(0,e.jsx)(f.span,{initial:{scale:0},animate:{scale:1},style:{position:"absolute",top:2,right:2,minWidth:16,height:16,padding:"0 3px",borderRadius:8,fontSize:9,fontWeight:700,background:"#ef4444",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 0 6px rgba(239,68,68,0.6)"},children:k>9?"9+":k})]}),(0,e.jsx)(Cs,{isOpen:p,onClose:()=>g(!1),currentUser:m})]}),m&&(0,e.jsxs)("div",{ref:E,style:{position:"relative"},children:[(0,e.jsx)("button",{onClick:()=>{c(T=>!T),g(!1)},style:{width:34,height:34,borderRadius:"50%",padding:2,cursor:"pointer",background:i?"linear-gradient(135deg, #0ea5e9, #06b6d4)":r.avatarBg,border:"none",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:i?"0 0 0 2px rgba(6,182,212,0.45)":"none",transition:"all 0.15s",WebkitTapHighlightColor:"transparent"},"aria-label":"User menu",children:(0,e.jsx)("div",{style:{borderRadius:"50%",overflow:"hidden",width:30,height:30},children:(0,e.jsx)(Vt,{user:m,size:"sm",showRing:!1})})}),(0,e.jsx)(se,{children:i&&(0,e.jsxs)(f.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.14,ease:[.22,1,.36,1]},style:{position:"absolute",right:0,top:"100%",marginTop:8,width:240,borderRadius:16,overflow:"hidden",zIndex:9999,background:r.dropdownBg,border:`1px solid ${r.dropdownBorder}`,boxShadow:r.dropdownShadow,backdropFilter:"blur(32px)",WebkitBackdropFilter:"blur(32px)"},children:[(0,e.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10,background:r.profileBg,borderBottom:r.profileBorder},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,e.jsx)(Vt,{user:m,size:"md",showRing:!1}),(0,e.jsxs)("div",{style:{minWidth:0},children:[(0,e.jsx)("p",{style:{fontSize:14,fontWeight:700,color:r.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.displayName||"Trader"}),(0,e.jsx)("p",{style:{fontSize:11,color:r.textSecondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.email}),v&&(0,e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,marginTop:4,padding:"2px 6px",borderRadius:5,fontSize:10,fontWeight:600,background:"rgba(249,115,22,0.15)",color:"#fb923c",border:"1px solid rgba(249,115,22,0.2)"},children:[(0,e.jsx)(wt,{style:{width:10,height:10}})," Admin"]})]})]}),(0,e.jsx)(Ss,{variant:"pill",linkTo:"/analytics?tab=discipline"})]}),(0,e.jsxs)("div",{style:{padding:"6px 0"},children:[(0,e.jsx)(Je,{icon:(0,e.jsx)(Jt,{className:"w-4 h-4"}),label:"My Profile",onClick:()=>{c(!1),n(`/user/${m.uid}`)}}),v&&(0,e.jsx)(Je,{icon:(0,e.jsx)(wt,{className:"w-4 h-4"}),label:"Admin Panel",accent:"orange",onClick:()=>{c(!1),n("/admin")}}),(0,e.jsx)(Je,{icon:(0,e.jsx)(kt,{className:"w-4 h-4"}),label:"Settings",onClick:()=>{c(!1),a?.("appearance")}}),(0,e.jsx)(Je,{icon:(0,e.jsx)(ks,{className:"w-4 h-4"}),label:"Support",onClick:()=>{c(!1),n("/support")}}),(0,e.jsx)("div",{style:{margin:"4px 14px",borderTop:`1px solid ${r.separator}`}}),(0,e.jsx)(Je,{icon:(0,e.jsx)(ws,{className:"w-4 h-4"}),label:"Sign Out",accent:"red",onClick:()=>{c(!1),b()}})]})]})})]})]})]}),(0,e.jsx)("div",{style:{height:.5,background:r.hairline}})]})})},Je=({icon:t,label:a,onClick:s,accent:n})=>{const r=ia(ve(i=>i.isDark()));return(0,e.jsxs)("button",{onClick:s,className:"touch-manipulation",style:{width:"100%",display:"flex",alignItems:"center",gap:12,padding:"10px 16px",border:"none",background:"transparent",curs
2or:"pointer",color:n==="red"?"#f87171":n==="orange"?"#fb923c":r.textMenu,fontSize:14,fontWeight:500,WebkitTapHighlightColor:"transparent",transition:"background 0.12s"},onMouseEnter:i=>i.currentTarget.style.background=r.hoverBg,onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[(0,e.jsx)("span",{style:{flexShrink:0,display:"flex"},children:t}),(0,e.jsx)("span",{style:{flex:1,textAlign:"left"},children:a}),(0,e.jsx)(ns,{style:{width:14,height:14,opacity:.25}})]})},ft="[email protected]";function Ts({isOpen:t,onClose:a,audience:s="general"}){const[n,r]=(0,o.useState)(""),[i,c]=(0,o.useState)(""),[d,l]=(0,o.useState)(""),[x,h]=(0,o.useState)(""),[m,p]=(0,o.useState)(""),[g,k]=(0,o.useState)(""),[v,u]=(0,o.useState)(""),[E,C]=(0,o.useState)(""),[y,w]=(0,o.useState)(""),[N,b]=(0,o.useState)(!1),[j,T]=(0,o.useState)(!1);(0,o.useEffect)(()=>{t&&(r(""),c(""),l(""),h(""),p(""),k(""),u(""),C(""),w(""),b(!1),T(!1))},[t,s]),(0,o.useEffect)(()=>{if(!t)return;const D=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=D}},[t]),(0,o.useEffect)(()=>{if(!t)return;const D=Q=>{Q.key==="Escape"&&a?.()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[t,a]);const z={prop_firm:"Prop Firm Inquiry",coach:"Coach / Educator Inquiry",general:"General Inquiry"}[s]||"General Inquiry",O=s==="prop_firm"||s==="coach",P=Ta[s]||Ta.general,U=P.challenges.find(D=>D.value===m),Z=U?.followUp;P.icon;const I=()=>{const D=`Redline ${z}${d?` — ${d}`:""}`,Q=O?[`Name: ${n||"(not provided)"}`,`Best email: ${i||"(not provided)"}`,`${P.orgLabel}: ${d||"(not provided)"}`,`${P.countLabel}: ${x||"(not provided)"}`,"",`${P.challengeQuestion}`,U?U.label:"(not provided)",m==="other"?`Other: ${g||"(not provided)"}`:null,"","What have you tried so far?",v||"(not provided)","","What would success look like in 6 months?",E||"(not provided)","","Additional context:",y||"(none)"].filter(Boolean).join(`
3`):[`Name: ${n||"(not provided)"}`,`Email: ${i||"(not provided)"}`,`Company / Brand: ${d||"(not provided)"}`,"","Message:",y||"(no message)"].filter(Boolean).join(`
4`);return`mailto:${ft}?subject=${encodeURIComponent(D)}&body=${encodeURIComponent(Q)}`},M=D=>{D.preventDefault();const Q=I();window.open(Q,"_blank","noopener,noreferrer"),T(!0)},K=async()=>{try{await navigator.clipboard.writeText(ft),b(!0),setTimeout(()=>b(!1),1800)}catch{}};return t?(0,_t.createPortal)((0,e.jsx)(se,{children:(0,e.jsx)(f.div,{initial:{opacity:0}
4,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[200] flex items-center justify-center bg-[#020308]/88 p-3 sm:p-5",onClick:a,children:(0,e.jsxs)(f.div,{initial:{opacity:0,scale:.96,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:12},transition:{duration:.25,ease:"easeOut"},onClick:D=>D.stopPropagation(),className:"relative flex max-h-[calc(100dvh-1.5rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[34px] border border-[#f8faf9] bg-[#ecefed] text-slate-950 shadow-[22px_22px_70px_rgba(0,0,0,0.46),-12px_-12px_42px_rgba(255,255,255,0.16)]",children:[(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_18%_0%,rgba(255,255,255,0.9),transparent_26%),radial-gradient(circle_at_88%_18%,rgba(255,255,255,0.55),transparent_28%)]"}),(0,e.jsx)("button",{type:"button",onClick:a,"aria-label":"Close contact form",className:"absolute right-4 top-4 z-30 rounded-full border border-[#f8faf9] bg-[#ecefed] p-2 text-slate-500 shadow-[7px_7px_18px_rgba(148,163,184,0.42),-7px_-7px_18px_rgba(255,255,255,0.9)] transition-colors hover:text-slate-950",children:(0,e.jsx)(Ke,{className:"h-5 w-5"})}),j?(0,e.jsxs)("div",{className:"relative flex min-h-[520px] flex-col justify-center p-5 text-center sm:p-8",children:[(0,e.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-emerald-400 text-[#06100c]",children:(0,e.jsx)(Ht,{className:"h-7 w-7"})}),(0,e.jsx)("h4",{className:"mt-5 text-3xl font-black text-slate-950",children:"Demo request ready."}),(0,e.jsx)("p",{className:"mx-auto mt-3 max-w-md text-sm leading-relaxed text-slate-600",children:"Your email app should open with the request filled in. If it did not open, use the direct email below."}),(0,e.jsxs)("div",{className:"mt-7 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[(0,e.jsxs)("a",{href:I(),className:"inline-flex items-center justify-center gap-2 rounded-2xl bg-slate-950 px-5 py-3 text-sm font-bold text-white shadow-[9px_9px_22px_rgba(100,116,139,0.35),-9px_-9px_22px_rgba(255,255,255,0.75)] transition hover:bg-slate-800",children:["Open email again",(0,e.jsx)(nt,{className:"h-4 w-4"})]}),(0,e.jsxs)("button",{type:"button",onClick:K,className:"inline-flex items-center justify-center gap-2 rounded-2xl border border-[#f8faf9] bg-[#ecefed] px-5 py-3 text-sm font-bold text-slate-700 shadow-[inset_3px_3px_7px_rgba(148,163,184,0.28),inset_-3px_-3px_7px_rgba(255,255,255,0.85)] transition hover:text-slate-950",children:[(0,e.jsx)(sa,{className:"h-4 w-4"}),N?"Email copied":ft]})]}),(0,e.jsx)("button",{type:"button",onClick:a,className:"mx-auto mt-5 text-sm font-semibold text-slate-500 transition hover:text-slate-950",children:"Close"})]}):(0,e.jsxs)("form",{onSubmit:M,className:"relative z-10 flex min-h-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"flex-shrink-0 border-b border-slate-300/70 px-5 py-5 pr-14 sm:px-7",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-200 bg-emerald-100 px-2.5 py-1 text-[10px] font-black uppercase text-emerald-700 shadow-[inset_2px_2px_5px_rgba(16,185,129,0.12),inset_-2px_-2px_5px_rgba(255,255,255,0.9)]",children:[(0,e.jsx)(ra,{className:"h-3 w-3"}),"20-minute fit call"]}),(0,e.jsx)("h4",{className:"mt-3 max-w-2xl text-3xl font-black leading-tight tracking-normal text-slate-950 sm:text-4xl",children:P.formTitle}),(0,e.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-slate-600",children:P.formSubtitle})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5 sm:px-7",children:[(0,e.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,e.jsx)(je,{label:"Your name",required:!0,children:(0,e.jsx)("input",{type:"text",required:!0,value:n,onChange:D=>r(D.target.value),className:Te,placeholder:"Jane Smith"})}),(0,e.jsx)(je,{label:"Email",required:!0,children:(0,e.jsx)("input",{type:"email",required:!0,value:i,onChange:D=>c(D.target.value),className:Te,placeholder:"[email protected]"})})]}),(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(je,{label:O?P.orgLabel:"Company / brand",required:O,children:(0,e.jsx)("input",{type:"text",required:O,value:d,onChange:D=>l(D.target.value),className:Te,placeholder:O?P.orgPlaceholder:"Your company"})})}),O?(0,e.jsxs)("div",{className:"mt-5 space-y-5",children:[(0,e.jsx)(je,{label:P.challengeQuestion,required:!0,children:(0,e.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:P.challenges.map(D=>(0,e.jsxs)("label",{className:`flex min-h-[96px] cursor-pointer items-start gap-3 rounded-xl border px-3.5 py-3 transition-all ${m===D.value?"border-rose-300 bg-rose-50 shadow-[inset_4px_4px_10px_rgba(244,63,94,0.12),inset_-4px_-4px_10px_rgba(255,255,255,0.9)] ring-2 ring-rose-200/70":"border-[#f8faf9] bg-[#ecefed] shadow-[8px_8px_18px_rgba(148,163,184,0.34),-8px_-8px_18px_rgba(255,255,255,0.9)] hover:text-slate-950"}`,children:[(0,e.jsx)("input",{type:"radio",name:"challenge",required:!0,value:D.value,checked:m===D.value,onChange:Q=>p(Q.target.value),className:"mt-0.5 accent-[#da0b3f]"}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-sm font-black text-slate-950",children:D.label}),(0,e.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-slate-500",children:D.hint})]})]},D.value))})}),m==="other"&&(0,e.jsx)(je,{label:"Tell us the challenge",required:!0,children:(0,e.jsx)("input",{type:"text",required:!0,value:g,onChange:D=>k(D.target.value),className:Te,placeholder:"What are you trying to fix?"})}),Z&&(0,e.jsxs)("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-4 shadow-[inset_4px_4px_10px_rgba(16,185,129,0.10),inset_-4px_-4px_10px_rgba(255,255,255,0.9)]",children:[(0,e.jsxs)("p",{className:"flex items-center gap-2 text-xs font-black uppercase text-emerald-700",children:[(0,e.jsx)(hi,{className:"h-3.5 w-3.5"}),"How Redline would frame the demo"]}),(0,e.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-slate-700",children:Z})]}),(0,e.jsx)(je,{label:"What have you tried so far to fix this?",required:!0,children:(0,e.jsx)("textarea",{required:!0,rows:3,value:v,onCh
4ange:D=>u(D.target.value),className:`${Te} resize-none`,placeholder:P.triedPlaceholder})}),(0,e.jsx)(je,{label:"What would success look like in 6 months?",required:!0,children:(0,e.jsx)("textarea",{required:!0,rows:3,value:E,onChange:D=>C(D.target.value),className:`${Te} resize-none`,placeholder:P.successPlaceholder})}),(0,e.jsx)(je,{label:P.countLabel,required:!0,children:(0,e.jsx)("input",{type:"text",required:!0,value:x,onChange:D=>h(D.target.value),className:Te,placeholder:P.countPlaceholder})}),(0,e.jsx)(je,{label:"Anything else we should know?",children:(0,e.jsx)("textarea",{rows:3,value:y,onChange:D=>w(D.target.value),className:`${Te} resize-none`,placeholder:"Optional context: broker stack, timeline, team size, current process..."})})]}):(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(je,{label:"How can we help?",required:!0,children:(0,e.jsx)("textarea",{required:!0,rows:4,value:y,onChange:D=>w(D.target.value),className:`${Te} resize-none`,placeholder:"Tell us a bit about what you're trying to do."})})})]}),(0,e.jsx)("div",{className:"flex-shrink-0 border-t border-slate-300/70 bg-[#ecefed] px-5 py-4 shadow-[0_-18px_42px_rgba(100,116,139,0.18)] sm:px-7",children:(0,e.jsx)(al,{isDiagnostic:O,copied:N,copyEmail:K})})]})]},"contact-panel")},"contact-backdrop")}),document.body):null}function al({isDiagnostic:t,copied:a,copyEmail:s}){return(0,e.jsxs)("div",{className:"rounded-[26px] border border-[#f8faf9] bg-[#ecefed] p-3 shadow-[10px_10px_26px_rgba(148,163,184,0.34),-10px_-10px_26px_rgba(255,255,255,0.9)]",children:[(0,e.jsxs)("button",{type:"submit",className:"group relative flex w-full items-center justify-center gap-2 overflow-hidden rounded-[22px] bg-[linear-gradient(135deg,#ff335f_0%,#ff6b35_48%,#facc15_100%)] px-5 py-4 text-sm font-black text-white shadow-[9px_9px_22px_rgba(148,163,184,0.42),-9px_-9px_22px_rgba(255,255,255,0.86),inset_0_1px_0_rgba(255,255,255,0.34)] transition-all hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[#ff6b35]/70 focus:ring-offset-2 focus:ring-offset-[#ecefed]",children:[(0,e.jsx)("span",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(255,255,255,0.35),transparent_26%)] opacity-80"}),(0,e.jsx)("span",{className:"absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/35 to-transparent transition-transform duration-700 group-hover:translate-x-full"}),(0,e.jsx)("span",{className:"relative",children:t?"Send demo request":"Send message"}),(0,e.jsx)(nt,{className:"relative h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 text-xs text-slate-500",children:[(0,e.jsx)("span",{children:"Or email us directly:"}),(0,e.jsxs)("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 rounded-full border border-[#f8faf9] bg-[#ecefed] px-3 py-1.5 font-mono text-slate-700 shadow-[inset_3px_3px_7px_rgba(148,163,184,0.28),inset_-3px_-3px_7px_rgba(255,255,255,0.85)] transition-colors hover:text-slate-950",children:[(0,e.jsx)(sa,{className:"h-3 w-3"}),ft,a?(0,e.jsx)("span",{className:"text-emerald-300 text-[10px]",children:"copied"}):(0,e.jsx)(Di,{className:"h-3 w-3"})]})]})]})}var Te="w-full rounded-[22px] border border-[#f8faf9] bg-[#ecefed] px-4 py-3 text-sm font-semibold text-slate-950 shadow-[inset_5px_5px_11px_rgba(148,163,184,0.35),inset_-5px_-5px_11px_rgba(255,255,255,0.92)] transition-colors placeholder:text-slate-400 focus:border-rose-200 focus:bg-[#f2f4f3] focus:outline-none focus:ring-2 focus:ring-rose-200/70",Ta={prop_firm:{icon:Fi,title:"Book a prop firm demo",formTitle:"Show us the risk problem first.",formSubtitle:"We will shape the walkthrough around your trader volume, rule stack, and biggest retention leak.",intro:"A useful demo should not start with features. It should start with the breach, churn, or onboarding problem your team is already paying for.",promises:["Pain-specific walkthrough, not a generic sales deck.","Live enforcement flow across funded accounts and rule profiles.","Clear pilot recommendation for your broker and challenge structure."],demoFrames:[{label:"Route",value:"Risk ops"},{label:"Focus",value:"Breach pattern"},{label:"Output",value:"Pilot plan"}],nextSteps:["You send the diagnostic.","We reply with the tightest demo agenda for your firm.","On the call, we map Redline to one real trader lifecycle."],orgLabel:"Firm / company name",orgPlaceholder:"Your prop firm",countLabel:"How many funded traders do you have?",countPlaceholder:"Example: 300 funded traders",challengeQuestion:"What's your main challenge with trader retention right now?",triedPlaceholder:"Example: stricter rules, manual reviews, Discord coaching, warning emails...",successPlaceholder:"Example: 30% lower churn, fewer daily loss breaches, faster onboarding...",challenges:[{value:"churn",label:"High churn",hint:"Traders quit or fail after losses.",followUp:"Most firms lose traders in the first 90 days. Redline helps reduce churn by enforcing the rules traders agreed to in real time. No surprise blowups, fewer emotional spirals, and a clearer path from funded trader to consistent trader."},{value:"performance",label:"Inconsistent performance",hint:"Traders can't stick to the process.",followUp:"Inconsistency is usually behavioral, not strategic. Redline gives every trader the same operating layer: sessions, rule checks, lockouts, coaching, and remediation tied to their actual trades."},{value:"compliance",label:"Compliance / rule violations",hint:"Traders break drawdown, sizing, or daily limits.",followUp:"When a trader breaks position sizing or daily loss rules, Redline can trigger immediate consequences. Your team stops firefighting after the breach and your traders stop treating limits like suggestions."},{value:"onboarding",label:"New trader onboarding",hint:"High wash-out rate before habits form.",followUp:"New traders fail because they do not get behavioral feedback while the mistake is happening. Redline gives them consistent rules, session guidance, and AI coaching from day one."},{value:"other",label:"Other",hint:"A different retention, risk, or scaling problem.",followUp:"The useful starting point is the operating constraint: where traders break down, what it costs the firm, and what behavior needs to change before the next funded account is at risk."}]},coach:{icon:Ji,title:"Book a coach demo",formTitle:"Tell us where students break down.",formSubtitle:"We will tailor the walkthrough around your cohort, rule framework, and coaching bottleneck.",intro:"For educators, the demo should feel like seeing your coaching system operationalized: rules, accountability, interventions, and proof that students are improving.",promises:["Cohort-specific workflow instead of a generic platform tour.","Student accountability, rule enforcement, and AI coaching examples.","A realistic rollout path for your program or community."],demoFrames:[{label:"Route",value:"Education"},{label:"Focus",value:"Student behavior"},{label:"Output",value:"Cohort rollout"}],nextSteps:["You send the diagnostic.","We reply with a demo agenda around your student outcome.","On the call, we map Redline to your program delivery model."],orgLabel:"Program / brand name",orgPlaceholder:"Your trading program",countLabel:"How many active students do you have?",countPlaceholder:"Example: 80 students across 3 cohorts",challengeQuestion:"What's your main challenge with student performance right now?",triedPlaceholder:"Example: weekly reviews, Discord accountability, worksheets, replay sessions...",successPlaceholder:"Example: higher completion, fewer repeat mistakes, better funded-pass rate...",challenges:[{value:"churn",label:"Low completion / high churn",hint:"Students disappear after losses or over
4whelm.",followUp:"Students stick longer when the system catches mistakes early and gives them a next step. Redline turns your rules into live feedback so students feel guided between coaching calls."},{value:"performance",label:"Inconsistent execution",hint:"Students understand the lesson but do not follow it live.",followUp:"The gap is not more content. It is live behavior. Redline tracks sessions, rule breaks, and emotional patterns so your coaching targets the exact behavior costing each student money."},{value:"compliance",label:"Rule-breaking students",hint:"Students ignore sizing, stops, or daily limits.",followUp:"Redline gives your program a real discipline layer: violations, consequences, and remediation tied to the rules you teach. Students stop hearing rules as theory and start trading with accountability."},{value:"onboarding",label:"New student onboarding",hint:"Beginners wash out before habits form.",followUp:"New students need immediate feedback loops. Redline gives them session structure, rule checks, and coaching notes from the first logged trade so good habits form earlier."},{value:"other",label:"Other",hint:"A different coaching, cohort, or accountability problem.",followUp:"The best coaching systems make the invisible visible: what students do live, where they repeat mistakes, and which behavior needs intervention before the next lesson."}]},general:{icon:Ei,title:"Talk to Redline",formTitle:"Tell us what you are building.",formSubtitle:"Send the essentials and we will route it to the right person.",intro:"Tell us about your operation and we will get back to you within 1 business day.",promises:["Fast routing to the right person.","No pressure, just a clear next step.","Useful reply within 1 business day."],demoFrames:[],nextSteps:[],challenges:[]}};function je({label:t,required:a,children:s}){return(0,e.jsxs)("label",{className:"block",children:[(0,e.jsxs)("span",{className:"mb-1.5 block text-[11px] font-black uppercase tracking-normal text-slate-500",children:[t,a&&(0,e.jsx)("span",{className:"text-[#da0b3f] ml-0.5",children:"*"})]}),s]})}function Rs(){const{t}=ye(),[a,s]=(0,o.useState)(!1),[n,r]=(0,o.useState)(!1),[i,c]=(0,o.useState)(!1),[d,l]=(0,o.useState)(!1),x=(0,o.useRef)(null);(0,o.useEffect)(()=>{const m=()=>s(window.scrollY>20);return window.addEventListener("scroll",m,{passive:!0}),()=>window.removeEventListener("scroll",m)},[]),(0,o.useEffect)(()=>{if(!n)return;const m=p=>{x.current&&!x.current.contains(p.target)&&r(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[n]);const h=()=>{r(!1),c(!1)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("nav",{className:`fixed left-0 right-0 z-50 transition-all duration-300 ${a?"bg-[#09090b]/80 backdrop-blur-xl border-b border-white/[0.06]":"bg-transparent"}`,style:{paddingTop:"env(safe-area-inset-top, 0px)",top:"var(--banner-h, 0px)",transition:"top 0.25s ease"},children:[(0,e.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-4 flex justify-between items-center",children:[(0,e.jsxs)(q,{to:"/",className:"flex items-center gap-2.5 group",onClick:h,children:[(0,e.jsx)("img",{src:"/RedlineOS_AppIcon_1024x1024.png",alt:"Redline",className:"w-8 h-8 rounded-lg object-contain"}),(0,e.jsx)("span",{className:"font-semibold text-[15px] text-white/90",children:"Redline"})]}),(0,e.jsxs)("div",{className:"hidden md:flex items-center gap-1",children:[(0,e.jsxs)("div",{className:"relative",ref:x,children:[(0,e.jsxs)("button",{type:"button",onClick:()=>r(m=>!m),className:"inline-flex items-center gap-1 px-4 py-2 text-sm text-white/50 hover:text-white transition-colors rounded-lg hover:bg-white/[0.04]",children:[t("publicChrome.solutions"),(0,e.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${n?"rotate-180":""}`,children:(0,e.jsx)("path",{d:"M5 8l5 5 5-5"})})]}),n&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 w-72 rounded-xl border border-white/[0.08] bg-[#0c0d12] backdrop-blur-xl shadow-2xl overflow-hidden",children:[(0,e.jsxs)(q,{to:"/for-prop-firms",onClick:h,className:"flex items-start gap-3 px-4 py-3.5 hover:bg-white/[0.04] transition-colors border-b border-white/[0.04]",children:[(0,e.jsx)("span",{className:"mt-0.5 flex-shrink-0 w-9 h-9 rounded-lg bg-purple-500/10 border border-purple-500/20 flex items-center justify-center text-base",children:"🏢"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-white/90",children:t("publicChrome.propFirms")}),(0,e.jsx)("div",{className:"text-xs text-white/40 mt-0.5",children:t("publicChrome.propFirmsDesc")})]})]}),(0,e.jsxs)(q,{to:"/for-coaches",onClick:h,className:"flex items-start gap-3 px-4 py-3.5 hover:bg-white/[0.04] transition-colors",children:[(0,e.jsx)("span",{className:"mt-0.5 flex-shrink-0 w-9 h-9 rounded-lg bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-base",children:"🧑‍🏫"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-white/90",children:t("publicChrome.educators")}),(0,e.jsx)("div",{className:"text-xs text-white/40 mt-0.5",children:t("publicChrome.educatorsDesc")})]})]})]})]}),(0,e.jsx)(q,{to:"/pricing",className:"px-4 py-2 text-sm text-white/50 hover:text-white transition-colors rounded-lg hover:bg-white/[0.04]",children:t("publicChrome.pricing")}),(0,e.jsxs)(q,{to:"/rsvp",className:"px-4 py-2 text-sm text-white/50 hover:text-white transition-colors rounded-lg hover:bg-white/[0.04] flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"inline-flex items-center justify-center w-1.5 h-1.5 rounded-full bg-[#da0b3f]"}),t("publicChrome.liveClass")]}),(0,e.jsx)("button",{type:"button",onClick:()=>l(!0),className:"px-4 py-2 text-sm text-white/50 hover:text-white transition-colors rounded-lg hover:bg-white/[0.04]",children:t("publicChrome.contact")}),(0,e.jsx)("div",{className:"w-px h-5 bg-white/[0.08] mx-1.5"}),(0,e.jsx)(q,{to:"/signin",className:"px-4 py-2 text-sm text-white/50 hover:text-white transition-colors rounded-lg hover:bg-white/[0.04]",children:t("publicChrome.login")}),(0,e.jsxs)(q,{to:"/signup",className:"group inline-flex items-center gap-2 rounded-lg border border-[#ff4d6d]/30 bg-[#da0b3f] px-4 py-2 text-sm font-semibold text-white shadow-[0_0_24px_rgba(218,11,63,0.28)] transition-all hover:-translate-y-0.5 hover:bg-[#f0164b] hover:shadow-[0_0_34px_rgba(218,11,63,0.42)] focus:outline-none focus:ring-2 focus:ring-[#ff4d6d]/60 focus:ring-offset-2 focus:ring-offset-[#09090b]",children:[(0,e.jsx)("span",{children:t("publicChrome.getStarted")}),(0,e.jsx)("span",{className:"text-white/80 transition-transform group-hover:translate-x-0.5",children:"→"})]})]}),(0,e.jsx)("div",{className:"flex md:hidden items-center gap-2",children:(0,e.jsx)("button",{type:"button",onClick:()=>c(m=>!m),"aria-label":t("publicChrome.toggleNavigation"),className:"p-2 text-white/70 hover:text-white",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("path",{d:"M5 5L15 15"}),(0,e.jsx)("path",{d:"M15 5L5 15"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("path",{d:"M3 6h14"}),(0,e.jsx)("path",{d:"M3 10h14"}),(0,e.jsx)("path",{d:"M3 14h14"})]})})})})]}),i&&(0,e.jsx)("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-xl",children:(0,e.jsxs)("div",{className:"px-6 py-4 space-y-1",children:[(0,e.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-white/30 px-3 pt-2 pb-1.5",children:t("publicChrome.solutions")}),(0,e.jsx)(q,{to:"/for-prop-firms",onClick:h,className:"block px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/[0.04] rounded-lg",children:t("publicChrome.propFirms")}),(0,e.jsx)(q,{to:"/for-coaches",onClick:h,className:"block px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/[0.04] rounded-lg",children:t("publicChrome.educators")}),(0,e.jsx)("div",{className:"h-px bg-white/[0.06] my-2"}),(0,e.jsx)(q,{to:"/pricing",onClick:h,className:"block px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/[0.04] rounded-lg",children:t("publicChrome.pricing")}),(0,e.jsxs)(q,{to:"/rsvp",onClick:h,className:"flex items-center gap-2 px-3 py-2.5 text-sm text-white hover:bg-white/[0.04] rounded-lg font-medium",children:[(0,e.jsx)("span",{className:"inline-flex items-center justify-center w-1.5 h-1.5 rounded-full bg-[#da0b3f] flex-shrink-0"}),t("publicChrome.liveClass")]}),(0,e.jsx)("button",{type:"button",onClick:()=>{c(!1),l(!0)},className:"block w-full text-left px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/[0.04] rounded-lg",children:t("publicChrome.contact")}),(0,e.jsx)(q,{to:"/signin",onClick:h,className:"block px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/[0.04] rounded-lg",children:t("publicChrome.login")}),(0,e.jsxs)(q,{to:"/signup",onClick:h,className:"mt-3 flex items-center justify-center gap-2 rounded-lg border border-[#ff4d6d]/30 bg-[#da0b3f] px-3 py-3 text-center text-sm font-semibold text-white shadow-[0_0_24px_rgba(218,11,63,0.25)] hover:bg-[#f0164b]",children:[(0,e.jsx)("span",{children:t("publicChrome.getStarted")}),(0,e.jsx)("span",{className:"text-white/80",children:"→"})]})]})})]}),(0,e.jsx)(Ts,{isOpen:d,onClose:()=>l(!1),audience:"general"})]})}var sl=t=>({barBg:t?"rgba(15, 17, 26, 0.82)":"rgba(255, 255, 255, 0.88)",hairline:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",overlayBg:t?"rgba(0,0,0,0.7)":"rgba(0,0,0,0.3)",sheetBg:t?"rgba(15,17,26,0.98)":"rgba(255,255,255,0.98)",sheetBorder:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)",sheetSideBorder:t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",sheetShadow:t?"0 -40px 100px rgba(0,0,0,0.8)":"0 -40px 100px rgba(0,0,0,0.12)",dragHandle:t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)",titleColor:t?"#fff":"#0f172a",chipBg:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)",chipBorder:t?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.08)",chipText:t?"#94a3b8":"#64748b",subtitle:t?"#4b5563":"#9ca3af",closeBtnBg:t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",closeBtnBorder:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)",closeIcon:t?"#64748b":"#9ca3af",itemBg:t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",itemBgActive:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)",itemBorder:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",itemBorderActive:t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.12)",iconBubbleBg:t?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.04)",iconBubbleBorder:t?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.08)",iconInactive:t?"#94a3b8":"#6b7280",labelActive:t?"#fff":"#0f172a",labelInactive:t?"#8b95a8":"#6b7280",badgeBorder:t?"rgba(15,17,26,0.98)":"rgba(255,255,255,0.98)",tabIconInactive:t?"#64748b":"#9ca3af",tabLabelActive:t?"#fff":"#0f172a",tabLabelInactive:t?"#64748b":"#9ca3af"}),rl=({user:t})=>{const a=fe(),s=me(),{t:n}=ye(),r=sl(ve(u=>u.effectiveTheme==="dark")),[i,c]=(0,o.useState)(!1),d=Et(u=>u.unreadMessages),[l,x]=(0,o.useState)(null),h=[{path:"/",label:n("nav.home"),icon:ms,active:no,color:"#60a5fa"},{path:"/today",label:n("nav.today"),icon:Ns,active:oo,color:"#fbbf24"},{path:"/trade-logger",label:n("nav.ledger"),icon:Ja,active:mo,color:"#34d399"},{path:"/trade-analytics",label:n("nav.analytics"),icon:Rt,active:uo,color:"#a78bfa"}
4,{path:"more",label:n("nav.more"),icon:hr,active:po,color:"#94a3b8",isMenu:!0}],m=[{path:"/strategy-lab",label:n("nav.strategyLab","Strategy Lab"),icon:vs,color:"#a78bfa"},{path:"/agent",label:n("nav.agentStudio"),icon:fs,color:"#818cf8"},{path:"/chat",label:n("nav.chat"),icon:jt,color:"#22d3ee",badge:d},{path:"/news",label:n("nav.tradingContext"),icon:Zt,color:"#fb7185"},{path:"/education",label:n("nav.learn"),icon:qs,color:"#fbbf24"},{path:"/community",label:n("nav.community"),icon:is,color:"#818cf8"},{path:"/feedback",label:n("nav.feedback"),icon:jt,color:"#f472b6"},{path:"/org/browse",label:n("nav.browseFirms"),icon:ys,color:"#60a5fa"},{path:"/pricing",label:n("nav.upgrade"),icon:os,color:"#34d399"}],p=u=>u==="/"?a.pathname==="/":a.pathname.startsWith(u),g=m.some(u=>p(u.path)),k=(0,o.useCallback)(u=>{u&&u!=="more"&&ds(u)},[]);(0,o.useEffect)(()=>{x(null)},[a.pathname]);const v=(u,E)=>{if(di(),u.isMenu){c(C=>!C);return}x(u.path),c(!1),E.preventDefault(),(0,o.startTransition)(()=>s(u.path))};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(se,{children:i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(f.div,{initial:{opacity:0}
4,animate:{opacity:1},exit:{opacity:0,transition:{duration:0}},transition:{duration:.22},onClick:()=>c(!1),style:{position:"fixed",inset:0,zIndex:90,background:r.overlayBg,backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"}}),(0,e.jsxs)(f.div,{drag:"y",dragConstraints:{top:0},dragElastic:{top:0,bottom:.4},onDragEnd:(u,E)=>{(E.offset.y>80||E.velocity.y>400)&&c(!1)},initial:{y:"100%"},animate:{y:0},exit:{y:"100%",transition:{duration:0}},transition:{type:"spring",stiffness:300,damping:30,mass:.95},style:{position:"fixed",left:0,right:0,zIndex:95,bottom:"calc(64px + max(env(safe-area-inset-bottom, 0px), 0px))",borderRadius:"28px 28px 0 0",overflow:"hidden",background:r.sheetBg,borderTop:`1px solid ${r.sheetBorder}`,borderLeft:`1px solid ${r.sheetSideBorder}`,borderRight:`1px solid ${r.sheetSideBorder}`,boxShadow:r.sheetShadow,cursor:"grab",touchAction:"none"},children:[(0,e.jsx)("div",{style:{display:"flex",justifyContent:"center",paddingTop:16,paddingBottom:4},children:(0,e.jsx)("div",{style:{width:40,height:4,borderRadius:3,background:r.dragHandle}})}),(0,e.jsxs)("div",{style:{padding:"10px 20px 16px",display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,e.jsx)("span",{style:{fontSize:22,fontWeight:800,letterSpacing:"-0.02em",color:r.titleColor},children:"Quick Nav"}),(0,e.jsx)("div",{style:{padding:"2px 8px",borderRadius:20,background:r.chipBg,border:`1px solid ${r.chipBorder}`},children:(0,e.jsxs)("span",{style:{fontSize:10,fontWeight:700,color:r.chipText,letterSpacing:"0.06em"},children:[m.length," PAGES"]})})]}),(0,e.jsx)("p",{style:{fontSize:12,color:r.subtitle,marginTop:3,fontWeight:500},children:"Jump anywhere instantly"})]}),(0,e.jsx)(f.button,{whileTap:{scale:.88},onClick:()=>c(!1),style:{width:34,height:34,borderRadius:12,cursor:"pointer",background:r.closeBtnBg,border:`1px solid ${r.closeBtnBorder}`,display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:(0,e.jsx)(qe,{style:{width:17,height:17,color:r.closeIcon}})})]}),(0,e.jsx)("div",{style:{padding:"0 14px 32px",display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:10},children:m.map((u,E)=>{const C=u.icon,y=p(u.path);return(0,e.jsx)(f.div,{initial:{opacity:0,scale:.7,y:30},animate:{opacity:1,scale:1,y:0},transition:{delay:E*.055,type:"spring",stiffness:380,damping:22},whileTap:{scale:.92},children:(0,e.jsx)(f.div,{animate:{y:[0,-6,0]},transition:{duration:2.4+E*.28,repeat:1/0,ease:"easeInOut",delay:E*.22},children:(0,e.jsxs)(q,{to:u.path,onClick:()=>c(!1),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:9,padding:"16px 6px 14px",borderRadius:20,textDecoration:"none",background:y?r.itemBgActive:r.itemBg,border:y?`1px solid ${r.itemBorderActive}`:`1px solid ${r.itemBorder}`,WebkitTapHighlightColor:"transparent"},children:[(0,e.jsxs)("div",{style:{position:"relative",width:54,height:54,borderRadius:17,display:"flex",alignItems:"center",justifyContent:"center",background:r.iconBubbleBg,border:`1px solid ${r.iconBubbleBorder}`},children:[(0,e.jsx)(C,{style:{width:26,height:26,color:y?r.labelActive:r.iconInactive}}),u.badge>0&&(0,e.jsx)("span",{style:{position:"absolute",top:-5,right:-5,minWidth:19,height:19,padding:"0 5px",borderRadius:10,background:"#ef4444",color:"#fff",fontSize:10,fontWeight:800,display:"flex",alignItems:"center",justifyContent:"center",border:`2px solid ${r.badgeBorder}`},children:u.badge>9?"9+":u.badge})]}),(0,e.jsx)("span",{style:{fontSize:11.5,fontWeight:y?700:500,color:y?r.labelActive:r.labelInactive,textAlign:"center",lineHeight:1.25,letterSpacing:"0.01em"},children:u.label})]})})},u.path)})})]})]})}),(0,e.jsxs)("nav",{className:"mobile-bottom-nav",style:{position:"fixed",bottom:0,left:0,right:0,zIndex:"var(--z-bottom-nav, 70)",paddingBottom:"max(env(safe-area-inset-bottom, 0px), 0px)",paddingLeft:0,paddingRight:0,paddingTop:0,background:r.barBg,backdropFilter:"blur(40px) saturate(180%)",WebkitBackdropFilter:"blur(40px) saturate(180%)",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",willChange:"transform",contain:"layout style paint"},children:[(0,e.jsx)("div",{style:{height:.5,background:r.hairline}}),(0,e.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",height:64,width:"100%",padding:0,margin:0},children:h.map((u,E)=>{const C=u.isMenu?i||g:p(u.path),y=l===u.path,w=C||y?u.active:u.icon,N=(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",width:"100%",opacity:y?.6:1,transition:"opacity 0.12s",position:"relative"},children:[(0,e.jsx)(w,{style:{width:24,height:24,color:C?u.color:r.tabIconInactive,transition:"color 0.15s"}}),(0,e.jsx)("span",{style:{fontSize:11,fontWeight:C?600:500,marginTop:4,color:C?r.tabLabelActive:r.tabLabelInactive,transition:"color 0.15s",letterSpacing:"0.02em"},children:u.label}
4),C&&(0,e.jsx)(f.div,{layoutId:"activeTabDot",transition:{type:"spring",stiffness:400,damping:30},style:{position:"absolute",bottom:2,width:4,height:4,borderRadius:"50%",background:u.color,boxShadow:`0 0 6px ${u.color}88`}})]});return u.isMenu?(0,e.jsx)("button",{onClick:b=>v(u,b),style:{border:"none",background:"transparent",cursor:"pointer",WebkitTapHighlightColor:"transparent",padding:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",touchAction:"manipulation"},"aria-label":"More",children:N},"more"):(0,e.jsx)(q,{to:u.path,onClick:b=>v(u,b),onTouchStart:()=>k(u.path),onMouseEnter:()=>k(u.path),style:{textDecoration:"none",WebkitTapHighlightColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",padding:0,touchAction:"manipulation"},"aria-label":u.label,children:N},u.path)})})]})]})};function nl({onEndSession:t}){const a=me(),s=fe(),{user:n}=Ne(),{trades:r}=aa(),{risk:i}=go(),[c,d]=(0,o.useState)(!1),[l,x]=(0,o.useState)({x:window.innerWidth-70,y:window.innerHeight-180}),[h,m]=(0,o.useState)(!1),p=(0,o.useRef)(null),g=(0,o.useRef)({x:0,y:0,posX:0,posY:0}),{isActive:k,session:v,stats:u,getFormattedElapsed:E,endSession:C,loading:y,openQuickTrade:w,dailyRiskPercent:N,dailyRiskUsed:b,maxDrawdownPercent:j,consecutiveLosses:T,tradesPerHour:z,updateDailyRisk:O,riskWarningShown:P,lossPerTradeViolation:U,sessionLimitHit:Z}=na();(0,o.useEffect)(()=>{s.pathname==="/chat"&&window.innerWidth<768&&d(!0)},[s.pathname]),(0,o.useEffect)(()=>{const V=(Y,ee)=>{if(!h)return;const re=Y-g.current.x,le=ee-g.current.y;x({x:Math.max(10,Math.min(window.innerWidth-60,g.current.posX+re)),y:Math.max(60,Math.min(window.innerHeight-60,g.current.posY+le))})},G=Y=>V(Y.clientX,Y.clientY),H=Y=>{Y.touches.length===1&&V(Y.touches[0].clientX,Y.touches[0].clientY)},R=()=>m(!1);return h&&(window.addEventListener("mousemove",G),window.addEventListener("mouseup",R),window.addEventListener("touchmove",H,{passive:!0}),window.addEventListener("touchend",R)),()=>{window.removeEventListener("mousemove",G),window.removeEventListener("mouseup",R),window.removeEventListener("touchmove",H),window.removeEventListener("touchend",R)}},[h]);const I=(V,G)=>{g.current={x:V,y:G,posX:l.x,posY:l.y},m(!0)};(0,o.useEffect)(()=>{const V=k&&(v?.accountSize||v?.tradingRules?.accountSize)?v.accountSize||v.tradingRules.accountSize:i?.accountSize;k&&r?.length>0&&V&&O(r,V)},[r,k,v?.accountSize,v?.tradingRules?.accountSize,i?.accountSize,O]);const M=async()=>{if(t)t();else{const V=JSON.parse(JSON.stringify(u||{}));console.log("[GlobalBanner] PRE-endSession liveStats snapshot:",V);const G=await C(n?.uid);if(console.log("[GlobalBanner] endSession result:",{success:G.success,resultStats:G.stats,resultTradesCount:G.stats?.tradesCount}),G.success){const H=G.stats&&(G.stats.tradesCount>0||G.stats.wins>0||G.stats.losses>0),R=V&&(V.tradesCount>0||V.wins>0||V.losses>0),Y=H?G.stats:R?V:G.stats;console.log("[GlobalBanner] finalStats chosen:",Y,"firestoreHasTrades:",H,"liveHasTrades:",R),a("/today",{state:{showEndSummary:!0,sessionData:{stats:Y,sessionStart:G.sessionStart,durationMinutes:G.durationMinutes,sessionId:G.sessionId,tradingRules:G.tradingRules||{},playbookSetups:G.playbookSetups||[],mantras:G.mantras||[],marketContext:G.marketContext||{},preMarketChecklist:G.preMarketChecklist||{}}}})}}},K=()=>{w()};if(!k)return null;const D=E(),Q=Z||U||N>=3||j>=5||T>=4?"danger":N>=2||T>=3||z>6?"warning":"safe";return c?(0,e.jsxs)(f.div,{ref:p,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},style:{position:"fixed",left:l.x,top:l.y,zIndex:9999,touchAction:"none"},className:`w-14 h-14 rounded-full shadow-lg border-2 flex items-center justify-center overflow-visible
5                    ${h?"cursor-grabbing scale-110":"cursor-grab"}
6                    ${u?.totalPL>=0?"border-green-400/70 shadow-green-500/50":"border-red-400/70 shadow-red-500/50"}`,onMouseDown:V=>{V.preventDefault(),I(V.clientX,V.clientY)},onTouchStart:V=>{V.touches.length===1&&I(V.touches[0].clientX,V.touches[0].clientY)},onClick:V=>{h||d(!1)},children:[(0,e.jsx)("span",{className:`absolute inset-0 rounded-full animate-ping opacity-60 ${u?.totalPL>=0?"bg-green-400/30":"bg-red-400/30"}`}),(0,e.jsx)("img",{src:"/mascots/coach-copilot.png",alt:"Redline C
6opilot — session active, tap to expand",title:"Redline Copilot — session active",draggable:!1,className:"relative w-full h-full rounded-full object-cover select-none"}),(0,e.jsxs)("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center",children:[(0,e.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-60 animate-ping"}),(0,e.jsx)("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-green-500 border border-slate-900"})]})]}):(0,e.jsx)(se,{children:(0,e.jsxs)(f.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:`sticky top-0 z-50 backdrop-blur-md border-b ${Q==="danger"?"bg-gradient-to-r from-red-900/40 via-red-800/30 to-red-900/40 border-red-500/40":Q==="warning"?"bg-gradient-to-r from-amber-900/30 via-amber-800/25 to-amber-900/30 border-amber-500/30":"bg-gradient-to-r from-green-600/30 via-emerald-600/25 to-green-600/30 border-green-500/30"}`,children:[(0,e.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-2.5 flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("span",{className:"relative flex h-2.5 w-2.5",children:[(0,e.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-green-500"})]}),(0,e.jsx)("span",{className:"text-green-400 font-semibold text-xs sm:text-sm hidden sm:inline",children:"LIVE SESSION"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-white bg-black/20 px-2.5 py-1 rounded-lg",children:[(0,e.jsx)(Sr,{className:"w-4 h-4 text-gray-400"}),(0,e.jsx)("span",{className:"font-mono text-sm",children:D})]}),(0,e.jsxs)("div",{className:"hidden md:flex items-center gap-4",children:[u?.tradesCount>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-300 text-sm",children:[(0,e.jsx)(Rt,{className:"w-4 h-4 text-blue-400"}),(0,e.jsx)("span",{className:"font-medium text-white",children:u.tradesCount}),(0,e.jsx)("span",{children:"trades"})]}),(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsxs)("span",{className:"text-green-400 font-medium",children:[u.wins||0,"W"]}),(0,e.jsx)("span",{className:"text-gray-500 mx-1",children:"/"}),(0,e.jsxs)("span",{className:"text-red-400 font-medium",children:[u.losses||0,"L"]})]})]}),u?.totalPL!==void 0&&(0,e.jsxs)("div",{className:`flex items-center gap-1 font-semibold text-sm ${u.totalPL>=0?"text-green-400":"text-red-400"}`,children:[u.totalPL>=0&&(0,e.jsx)(tr,{className:"w-4 h-4"}),u.totalPL>=0?"+":"","$",Math.abs(u.totalPL).toFixed(2)]}),(0,e.jsxs)("div",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium ${Q==="danger"?"bg-red-500/20 text-red-400 border border-red-500/30":Q==="warning"?"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30":"bg-gray-500/20 text-gray-400 border border-gray-500/30"}`,children:[Q==="danger"&&(0,e.jsx)(ma,{className:"w-3.5 h-3.5"}),Q==="warning"&&(0,e.jsx)(Qt,{className:"w-3.5 h-3.5"}),(0,e.jsxs)("span",{children:["Risk: ",N.toFixed(1),"%"]})]}),Z&&(0,e.jsx)("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs font-bold bg-red-600/30 text-red-300 border border-red-500/40",children:(0,e.jsx)("span",{children:"⛔ SESSION LIMIT"})}),U&&!Z&&(0,e.jsx)("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs font-bold bg-orange-600/30 text-orange-300 border border-orange-500/40",children:(0,e.jsx)("span",{children:"⚠️ LOSS/TRADE"})})]}),(0,e.jsxs)("div",{className:"flex md:hidden items-center gap-2",children:[u?.tradesCount>0&&(0,e.jsxs)("span",{className:"text-gray-300 text-xs",children:[(0,e.jsx)("span",{className:"text-white font-medium",children:u.tradesCount})," trades"]}),u?.totalPL!==void 0&&u?.totalPL!==0&&(0,e.jsxs)("span",{className:`font-semibold text-xs ${u.totalPL>=0?"text-green-400":"text-red-400"}`,children:[u.totalPL>=0?"+":"","$",Math.abs(u.totalPL).toFixed(0)]}),N>=2&&(0,e.jsxs)("span",{className:`text-xs ${Q==="danger"?"text-red-400":"text-yellow-400"}`,children:["⚠️ ",N.toFixed(0),"%"]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{onClick:()=>d(!0),className:`md:hidden flex items-center justify-center w-8 h-8 bg-slate-800/60 hover:bg-slate-700/60 
7                         text-slate-400 hover:text-white rounded-lg transition-all border border-slate-700/50`,title:"Minimize session banner",children:(0,e.jsx)(ur,{className:"w-4 h-4"})}),(0,e.jsxs)("button",{onClick:K,className:`flex items-center gap-1.5 px-3 py-1.5 bg-green-500/20 hover:bg-green-500/30 
8                         text-green-400 rounded-lg transition-all text-sm font-medium`,children:[(0,e.jsx)(_r,{className:"w-4 h-4"}),(0,e.jsx)("span",{className:"hidden sm:inline",children:"Log Trade"}),(0,e.jsx)("span",{className:"sm:hidden",children:"Log"})]}),(0,e.jsxs)("button",{onClick:M,disabled:y,className:`flex items-center gap-1.5 px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 
9                         text-red-400 rounded-lg transition-all text-sm border border-red-500/30
10                         disabled:opacity-50`,children:[(0,e.jsx)(Ki,{className:"w-4 h-4"}),(0,e.jsx)("span",{className:"hidden sm:inline",children:"End Session"}),(0,e.jsx)("span",{className:"sm:hidden",children:"End"})]})]})]}),Q==="danger"&&(0,e.jsx)(f.div,{initial:{height:0,opacity:0}
10,animate:{height:"auto",opacity:1},className:"bg-red-500/20 border-t border-red-500/30 px-4 py-2",children:(0,e.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-center gap-2 text-red-400 text-sm",children:[(0,e.jsx)(ma,{className:"w-4 h-4"}),(0,e.jsx)("span",{className:"font-medium",children:Z?"Daily loss limit reached — consider ending your session.":U?"Loss-per-trade limit exceeded — review before your next entry.":`Daily risk limit exceeded (${N.toFixed(1)}% / 3%). Consider ending session.`})]})})]})})}var zt="rdl_cookie_consent",Wt="rdl_analytics_opt_out";function il({uid:t}){const[a,s]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let r=!1;return(async()=>{let c=null;try{c=localStorage.getItem(zt)}catch{return}if(!c){if(t)try{const d=await Ar(at(tt,"users",t,"consents","cookies"));if(d.exists()){const l=d.data()?.choice==="essential"?"essential":"all";try{localStorage.setItem(zt,l),l==="essential"&&localStorage.setItem(Wt,"1")}catch{}return}}catch{}r||s(!0)}})(),()=>{r=!0}},[t]);const n=async r=>{const i=r==="essential";try{localStorage.setItem(zt,r),i?localStorage.setItem(Wt,"1"):localStorage.removeItem(Wt)}catch{}if(t)try{await ss(at(tt,"users",t,"consents","cookies"),{choice:r,analyticsOptOut:i,acceptedAt:as(),userAgent:navigator?.userAgent??""}),await ir(at(tt,"users",t),{analyticsOptOut:i})}catch{}s(!1)};return(0,e.jsx)(se,{children:a&&(0,e.jsx)(f.div,{initial:{y:80,opacity:0},animate:{y:0,opacity:1},exit:{y:80,opacity:0},transition:{type:"spring",stiffness:280,damping:28},role:"dialog","aria-label":"Cookie consent","aria-live":"polite",className:"fixed bottom-4 left-4 right-4 z-[9999] sm:left-auto sm:right-6 sm:max-w-md",children:(0,e.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-2xl shadow-2xl p-5",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[(0,e.jsx)(wt,{className:"w-5 h-5 text-emerald-400 flex-shrink-0 mt-0.5"}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"font-semibold text-white text-sm",children:"We use cookies"}),(0,e.jsxs)("p",{className:"text-gray-400 text-xs mt-1 leading-relaxed",children:["Essential cookies keep the app running. Analytics cookies (PostHog) help us improve the product. You can choose below — or change your preference anytime in"," ",(0,e.jsx)(q,{to:"/settings",className:"text-emerald-400 hover:underline",children:"Privacy Settings"}),"."," ",(0,e.jsx)(q,{to:"/cookies",className:"text-emerald-400 hover:underline",children:"Learn more"}),"."]})]}),(0,e.jsx)("button",{onClick:()=>n("essential"),className:"p-1 rounded-lg text-gray-500 hover:text-gray-300 transition-colors flex-shrink-0","aria-label":"Dismiss — accept essential only",children:(0,e.jsx)(qe,{className:"w-4 h-4"})})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("button",{onClick:()=>n("essential"),className:"flex-1 py-2 px-3 rounded-lg border border-gray-600 text-gray-300 text-xs font-medium hover:bg-gray-800 transition-colors",children:"Essential only"}),(0,e.jsx)("button",{onClick:()=>n("all"),className:"flex-1 py-2 px-3 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-xs font-bold transition-colors",children:"Accept all"})]})]})})})}var Ra="__rdl_auth_action_processed__";function ol(){const[t,a]=(0,o.useState)(null),s=Ne(r=>r.setUser);if((0,o.useEffect)(()=>{if(window[Ra])return;const r=new URLSearchParams(window.location.search),i=r.get("mode"),c=r.get("oobCode");if(!i||!c)return;window[Ra]=!0;const d=window.location.origin+window.location.pathname+window.location.hash;window.history.replaceState({},document.title,d),(async()=>{try{if(i==="verifyEmail"){await Ft(ge,c);try{await ge.currentUser?.reload()}catch{}try{const l=ge.currentUser;if(l?.emailVerified){const x=Ne.getState().user;s({...x||{},uid:l.uid,email:l.email,emailVerified:!0})}}catch{}a({kind:"success",message:"Email verified. Welcome aboard."}),setTimeout(()=>a(null),4e3)}else if(i==="recoverEmail"){const l=await Cr(ge,c);await Ft(ge,c),a({kind:"success",message:`Email change reverted. Your email is back to ${l?.data?.email||"the original address"}.`})}else if(i==="verifyAndChangeEmail"){await Ft(ge,c);try{await ge.currentUser?.reload()}catch{}a({kind:"success",message:"Email updated and verified."}),setTimeout(()=>a(null),4e3)}else i==="resetPassword"&&window.location.replace(`/reset-password?oobCode=${encodeURIComponent(c)}`)}catch(l){const x=l?.code||"";a({kind:"error",message:x==="auth/expired-action-code"?"This link has expired. Request a new one.":x==="auth/invalid-action-code"?"This link is no longer valid (already used or malformed).":x==="auth/user-disabled"?"This account is disabled. Contact support.":"Could not complete that action. Try again or request a new link."})}})()},[]),!t)return null;const n=t.kind==="success";return(0,e.jsxs)("div",{role:"status",className:`fixed top-4 left-1/2 -translate-x-1/2 z-[9999] max-w-md w-[calc(100%-2rem)] rounded-xl border backdrop-blur-md shadow-2xl px-4 py-3 flex items-start gap-3 ${n?"bg-emerald-500/15 border-emerald-500/40 text-emerald-50":"bg-rose-500/15 border-rose-500/40 text-rose-50"}`,children:[(0,e.jsx)(n?Tr:jr,{className:`w-5 h-5 flex-shrink-0 mt-0.5 ${n?"text-emerald-300":"text-rose-300"}`,"aria-hidden":"true"}),(0,e.jsx)("div",{className:"flex-1 text-sm leading-relaxed",children:t.message}),(0,e.jsx)("button",{type:"button",onClick:()=>a(null),className:"text-xs opacity-70 hover:opacity-100 flex-shrink-0","aria-label":"Dismiss",children:"✕"})]})}var ll=["/","/signin","/signup","/onboarding","/landing"];function cl(){const t=fe(),a=ve(c=>c.isDark());if(ll.includes(t.pathname))return null;const s=qr(t.pathname);if(!s.length||s.length<2)return null;const n=a?"text-slate-600":"text-slate-300",r=a?"text-slate-400 hover:text-slate-200 transition-colors":"text-slate-500 hover:text-slate-700 transition-colors",i=a?"text-slate-200 font-medium":"text-slate-800 font-medium";return(0,e.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden md:flex items-center gap-1.5 text-xs px-4 py-1.5 max-w-7xl mx-auto",children:(0,e.jsx)("ol",{className:"flex items-center gap-1.5 min-w-0 truncate",children:s.map((c,d)=>{const l=d===s.length-1;return(0,e.jsxs)("li",{className:"flex items-center gap-1.5 min-w-0",children:[d>0&&(0,e.jsx)(ns,{className:`w-3 h-3 flex-shrink-0 ${n}`,"aria-hidden":"true"}),l||c.current?(0,e.jsx)("span",{className:`truncate ${i}`,"aria-current":"page",children:c.name}):(0,e.jsx)(q,{to:c.path,className:`truncate ${r}`,children:c.name})]},`${c.path}-${d}`)}
10)})})}var dl=(0,o.memo)(cl);function ml(){const t=st(s=>s.data.ackRequiredFor),a=st(s=>s.acknowledgeWarn);return t!=="WARN_25"?null:(0,e.jsx)(se,{children:(0,e.jsx)(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:(0,e.jsxs)(f.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"max-w-md w-full bg-zinc-900 border border-amber-500/40 rounded-2xl p-6 shadow-2xl",role:"dialog","aria-modal":"true",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,e.jsx)(Qt,{className:"w-7 h-7 text-amber-400"}),(0,e.jsx)("h2",{className:"text-lg font-semibold text-amber-300",children:"25% daily loss reached"})]}),(0,e.jsx)("p",{className:"text-sm text-zinc-300 leading-relaxed",children:"You've used 25% of today's max loss. The next two thresholds are cooldowns: 30 min at 50%, 1 hour at 75%, and a session lock at 100%."}),(0,e.jsx)("p",{className:"text-sm text-zinc-400 mt-3",children:"Acknowledge to keep trading."}),(0,e.jsx)("div",{className:"mt-5 flex justify-end",children:(0,e.jsx)("button",{type:"button",onClick:a,className:"px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-black font-semibold text-sm",children:"I understand"})})]})})})}var Es=(0,o.forwardRef)(({children:t,variant:a="primary",size:s="md",fullWidth:n=!1,disabled:r=!1,loading:i=!1,leftIcon:c=null,rightIcon:d=null,onClick:l,type:x="button",className:h="",animate:m=!0,...p},g)=>{const k=`
11    inline-flex items-center justify-center gap-2
12    font-semibold rounded-lg
13    transition-all duration-fast ease-out
14    focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-surface
15    disabled:opacity-50 disabled:cursor-not-allowed
16    active:scale-95
17  `,v={primary:`
18      bg-brand-primary text-brand-primary-foreground
19      hover:bg-brand-primary-dark
20      shadow-sm hover:shadow-md
21      border border-brand-primary/20
22    `,secondary:`
23      bg-transparent text-brand-primary
24      border border-brand-primary/50
25      hover:bg-brand-primary/10 hover:border-brand-primary
26      shadow-sm hover:shadow-md
27    `,success:`
28      bg-state-success text-state-success-foreground
29      hover:bg-state-success-dark
30      shadow-sm hover:shadow-md
31      border border-state-success/20
32    `,danger:`
33      bg-state-danger text-state-danger-foreground
34      hover:bg-state-danger-dark
35      shadow-sm hover:shadow-md
36      border border-state-danger/20
37    `,warning:`
38      bg-state-warning text-state-warning-foreground
39      hover:bg-state-warning-dark
40      shadow-sm hover:shadow-md
41      border border-state-warning/20
42    `,ghost:`
43      bg-transparent text-text-primary
44      hover:bg-surface-hover
45      border border-transparent
46    `,outline:`
47      bg-transparent text-text-primary
48      border border-border-default
49      hover:bg-surface-hover hover:border-border-strong
50    `},u={xs:"px-3 py-1.5 text-xs",sm:"px-4 py-2 text-sm",md:"px-6 py-2.5 text-base",lg:"px-8 py-3 text-lg",xl:"px-10 py-4 text-xl"},E=n?"w-full":"",C=`
51    ${k}
52    ${v[a]||v.primary}
53    ${u[s]||u.md}
54    ${E}
55    ${h}
56  `.trim().replace(/\s+/g," "),y=()=>(0,e.jsxs)(e.Fragment,{children:[i&&(0,e.jsxs)("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,e.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,e.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!i&&c&&(0,e.jsx)("span",{className:"flex-shrink-0",children:c}),(0,e.jsx)("span",{children:t}),!i&&d&&(0,e.jsx)("span",{className:"flex-shrink-0",children:d})]}),w=N=>{if(r||i){N.preventDefault();return}l?.(N)};return m?(0,e.jsx)(f.button,{ref:g,type:x,className:C,onClick:w,disabled:r||i,whileHover:!r&&!i?{scale:1.02}:{},whileTap:!r&&!i?{scale:.98}:{},"aria-disabled":r||i,"aria-busy":i,...p,children:(0,e.jsx)(y,{})}):(0,e.jsx)("button",{ref:g,type:x,className:C,onClick:w,disabled:r||i,"aria-disabled":r||i,"aria-busy":i,...p,children:(0,e.jsx)(y,{})})});Es.displayName="Button";var Xe=(0,o.forwardRef)(({children:t,variant:a="default",padding:s="md",hoverable:n=!1,clickable:r=!1,animate:i=!0,className:c="",onClick:d,...l},x)=>{const h=`
57    rounded-lg
58    border border-border-default
59    transition-all duration-normal ease-out
60    ${r||d?"cursor-pointer":""}
61  `,m={default:`
62      bg-surface-elevated
63      shadow-sm
64    `,elevated:`
65      bg-surface-elevated
66      shadow-md
67      hover:shadow-lg
68    `,flat:`
69      bg-surface-muted
70      shadow-none
71    `,outline:`
72      bg-transparent
73      border-2 border-border-strong
74      shadow-none
75    `,glass:`
76      bg-surface-elevated/80
77      backdrop-blur-md
78      shadow-lg
79      border-border-subtle
80    `}
80,p={none:"p-0",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"},g=n?`
81    hover:shadow-lg
82    hover:border-border-strong
83    hover:-translate-y-1
84  `:"",k=`
85    ${h}
86    ${m[a]||m.default}
87    ${p[s]||p.md}
88    ${g}
89    ${c}
90  `.trim().replace(/\s+/g," "),v=u=>{(r||d)&&d?.(u)};return i?(0,e.jsx)(f.div,{ref:x,className:k,onClick:v,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},whileHover:n?{scale:1.02}:{},...l,children:t}):(0,e.jsx)("div",{ref:x,className:k,onClick:v,...l,children:t})});Xe.displayName="Card";var As=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`card-header border-b border-border-subtle pb-4 mb-4 ${a}`,...s,children:t}));As.displayName="Card.Header";var Is=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`card-body ${a}`,...s,children:t}));Is.displayName="Card.Body";var _s=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`card-footer border-t border-border-subtle pt-4 mt-4 flex items-center gap-2 ${a}`,...s,children:t}));_s.displayName="Card.Footer";var Ps=(0,o.forwardRef)(({children:t,className:a="",as:s="h3",...n},r)=>(0,e.jsx)(s,{ref:r,className:`text-xl font-semibold text-text-primary ${a}`,...n,children:t}));Ps.displayName="Card.Title";var Ls=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("p",{ref:n,className:`text-sm text-text-secondary mt-1 ${a}`,...s,children:t}));Ls.displayName="Card.Description";Xe.Header=As;Xe.Body=Is;Xe.Footer=_s;Xe.Title=Ps;Xe.Description=Ls;var Pt=(0,o.forwardRef)(({isOpen:t=!1,onClose:a,title:s,children:n,size:r="md",showCloseButton:i=!0,closeOnBackdrop:c=!0,closeOnEscape:d=!0,className:l="",...x},h)=>{const m=(0,o.useRef)(null),p=(0,o.useRef)(null),g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl",full:"max-w-full mx-4"};(0,o.useEffect)(()=>{const v=u=>{d&&u.key==="Escape"&&t&&a?.()};if(t)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,d,a]),(0,o.useEffect)(()=>{if(t)return p.current=document.activeElement,m.current?.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="",p.current?.focus()}},[t]);const k=v=>{c&&v.target===v.currentTarget&&a?.()};return(0,e.jsx)(se,{mode:"wait",children:t&&(0,e.jsxs)("div",{className:"fixed inset-0 z-modal",role:"dialog","aria-modal":"true",children:[(0,e.jsx)(f.div,{className:"fixed inset-0 bg-surface-overlay backdrop-blur-sm",variants:{hidden:{opacity:0},visible:{opacity:1}},initial:"hidden",animate:"visible",exit:"hidden",onClick:k,transition:{duration:.2}}),(0,e.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,e.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,e.jsxs)(f.div,{ref:h||m,className:`
91                  relative w-full ${g[r]||g.md}
92                  bg-surface-elevated
93                  border border-border-default
94                  rounded-xl shadow-xl
95                  ${l}
96                `,variants:{hidden:{opacity:0,scale:.95,y:20},visible:{opacity:1,scale:1,y:0,transition:{type:"spring",damping:25,stiffness:300}},exit:{opacity:0,scale:.95,y:20,transition:{duration:.2}}},initial:"hidden",animate:"visible",exit:"exit",tabIndex:-1,...x,children:[(s||i)&&(0,e.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border-subtle",children:[s&&(0,e.jsx)("h2",{className:"text-xl font-semibold text-text-primary",children:s}),i&&(0,e.jsx)("button",{onClick:a,className:`\r
97                          ml-auto p-2 rounded-lg\r
98                          text-text-secondary hover:text-text-primary\r
99                          hover:bg-surface-hover\r
100                          transition-colors duration-fast\r
101                          focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2\r
102                        `,"aria-label":"Close modal",children:(0,e.jsx)(Ke,{className:"w-5 h-5"})})]}),(0,e.jsx)("div",{className:"px-6 py-4",children:n})]})})})]})})});Pt.displayName="Modal";var Ms=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`px-6 py-4 border-b border-border-subtle ${a}`,...s,children:t}));Ms.displayName="Modal.Header";var Ds=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`px-6 py-4 ${a}`,...s,children:t}));Ds.displayName="Modal.Body";var Fs=(0,o.forwardRef)(({children:t,className:a="",...s},n)=>(0,e.jsx)("div",{ref:n,className:`px-6 py-4 border-t border-border-subtle flex items-center justify-end gap-3 ${a}`,...s,children:t}));Fs.displayName="Modal.Footer";Pt.Header=Ms;Pt.Body=Ds;Pt.Footer=Fs;var pe=(0,o.forwardRef)(({label:t,type:a="text",error:s,success:n,helperText:r,helpText:i,leftIcon:c,rightIcon:d,fullWidth:l=!0,disabled:x=!1,required:h=!1,className:m="",containerClassName:p="",labelClassName:g="",...k},v)=>{const[u,E]=(0,o.useState)(!1),[C,y]=(0,o.useState)(!1),w=k.id||`input-${Math.random().toString(36).substr(2,9)}`,N=a==="password",b=N&&u?"text":a,j=i||r,T=!!s,z=!!n,O=`
103    
104    w-full px-4 py-2.5
105    text-base text-text-primary
106    bg-surface-hover/80
107    border rounded-lg
108    transition-all duration-fast ease-out
109    placeholder:text-text-subtle
110    focus:outline-none
111    disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-hover/30
112  
113    ${T?"border-state-danger focus:border-state-danger focus:ring-2 focus:ring-state-danger/20":z?"border-state-success focus:border-state-success focus:ring-2 focus:ring-state-success/20":C?"border-brand-primary ring-2 ring-brand-primary/20":"border-border-subtle hover:border-border-default"}
114    ${c?"pl-10":d||N?"pr-10":""}
115    ${m}
116  `.trim().replace(/\s+/g," ");return(0,e.jsxs)("div",{className:`${l?"w-full":""} ${p}`,children:[t&&(0,e.jsxs)("label",{htmlFor:w,className:`
117            block text-sm font-medium text-text-primary mb-1.5
118            ${x?"opacity-50":""}
119            ${g}
120          `,children:[t,h&&(0,e.jsx)("span",{className:"text-state-danger ml-1",children:"*"})]}),(0,e.jsxs)("div",{className:"relative",children:[c&&(0,e.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:c}),b==="number"?(0,e.jsx)(lr,{ref:v,id:w,disabled:x,required:h,className:O,onFocus:()=>y(!0),onBlur:()=>y(!1),"aria-invalid":T,"aria-describedby":s?`${w}-error`:n?`${w}-success`:j?`${w}-helper`:void 0,...k}):(0,e.jsx)("input",{ref:v,id:w,type:b,disabled:x,required:h,className:O,onFocus:()=>y(!0),onBlur:()=>y(!1),"aria-invalid":T,"aria-describedby":s?`${w}-error`:n?`${w}-success`:j?`${w}-helper`:void 0,...k}),(0,e.jsxs)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[T&&!N&&(0,e.jsx)(wa,{className:"w-5 h-5 text-state-danger","aria-hidden":"true"}),z&&!N&&(0,e.jsx)(Ht,{className:"w-5 h-5 text-state-success","aria-hidden":"true"}),d&&!N&&(0,e.jsx)("div",{className:"text-text-muted",children:d}),N&&(0,e.jsx)("button",{type:"button",onClick:()=>E(!u),className:`\r
121                text-text-muted hover:text-text-primary\r
122                transition-colors duration-fast\r
123                focus:outline-none focus:ring-2 focus:ring-brand rounded\r
124                p-1\r
125              `,"aria-label":u?"Hide password":"Show password",tabIndex:-1,children:u?(0,e.jsx)(Mi,{className:"w-5 h-5"}):(0,e.jsx)(qi,{className:"w-5 h-5"})})]})]}),s&&(0,e.jsxs)("p",{id:`${w}-error`,className:"mt-1.5 text-sm text-state-danger flex items-center gap-1",role:"alert",children:[(0,e.jsx)(wa,{className:"w-4 h-4 flex-shrink-0"}),s]}),n&&!s&&(0,e.jsxs)("p",{id:`${w}-success`,className:"mt-1.5 text-sm text-state-success flex items-center gap-1",children:[(0,e.jsx)(Ht,{className:"w-4 h-4 flex-shrink-0"}),n]}),j&&!s&&!n&&(0,e.jsx)("p",{id:`${w}-helper`,className:"mt-1.5 text-sm text-text-secondary",children:j})]})});pe.displayName="Input";var xl=(0,o.forwardRef)(({label:t,checked:a=!1,onChange:s,disabled:n=!1,required:r=!1,error:i,helperText:c,className:d="",labelClassName:l="",...x},h)=>{const m=x.id||`checkbox-${Math.random().toString(36).substr(2,9)}`,p=g=>{n||s?.(g.target.checked,g)};return(0,e.jsxs)("div",{className:`flex items-start gap-3 ${d}`,children:[(0,e.jsxs)("div",{className:"flex items-center h-6",children:[(0,e.jsx)("input",{ref:h,id:m,type:"checkbox",checked:a,onChange:p,disabled:n,required:r,className:"sr-only peer","aria-invalid":!!i,"aria-describedby":i?`${m}-error`:c?`${m}-helper`:void 0,...x}),(0,e.jsx)("label",{htmlFor:m,className:`
126            relative flex items-center justify-center
127            w-5 h-5 rounded border-2
128            transition-all duration-fast cursor-pointer
129            ${a?"bg-brand-primary border-brand-primary":"bg-surface-elevated border-border-default hover:border-border-strong"}
130            ${n?"opacity-50 cursor-not-allowed":""}
131            ${i?"border-state-danger":""}
132            peer-focus:ring-2 peer-focus:ring-brand peer-focus:ring-offset-2
133          `,children:a&&(0,e.jsx)(It,{className:"w-3.5 h-3.5 text-brand-primary-foreground",strokeWidth:3})})]}),(t||c||i)&&(0,e.jsxs)("div",{className:"flex-1",children:[t&&(0,e.jsxs)("label",{htmlFor:m,className:`
134                block text-sm font-medium text-text-primary cursor-pointer
135                ${n?"opacity-50":""}
136                ${l}
137              `,children:[t,r&&(0,e.jsx)("span",{className:"text-state-danger ml-1",children:"*"})]}),i&&(0,e.jsx)("p",{id:`${m}-error`,className:"mt-1 text-sm text-state-danger",role:"alert",children:i}),c&&!i&&(0,e.jsx)("p",{id:`${m}-helper`,className:"mt-1 text-sm text-text-secondary",children:c})]})]})});xl.displayName="Checkbox";var He=(0,o.forwardRef)(({label:t,options:a=[],value:s,onChange:n,placeholder:r="Select an option",error:i,success:c,helperText:d,helpText:l,disabled:x=!1,required:h=!1,fullWidth:m=!0,className:p="",containerClassName:g="",labelClassName:k="",...v},u)=>{const E=v.id||`select-${Math.random().toString(36).substr(2,9)}`,C=d??l,y=!!i,w=!!c,N=`
138    
139    w-full px-4 py-2.5 pr-10
140    text-base text-text-primary
141    bg-surface-hover/80
142    border rounded-lg
143    appearance-none
144    transition-all duration-fast ease-out
145    focus:outline-none
146    disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-hover/30
147    cursor-pointer
148    dark-select
149  
150    ${y?"border-state-danger focus:border-state-danger focus:ring-2 focus:ring-state-danger/20":w?"border-state-success focus:border-state-success focus:ring-2 focus:ring-state-success/20":"border-border-subtle hover:border-border-default focus:border-brand-primary focus:ring-2 focus:ring-brand-primary/20"}
151    ${p}
152  `.trim().replace(/\s+/g," "),b=m?"w-full":"",j=T=>{const z=T.target.value,O=a.find(P=>(typeof P=="object"?P.value:P)===z);n?.(z,O,T)};return(0,e.jsxs)("div",{className:`${b} ${g}`,children:[t&&(0,e.jsxs)("label",{htmlFor:E,className:`
153            block text-sm font-medium text-text-primary mb-1.5
154            ${x?"opacity-50":""}
155            ${k}
156          `,children:[t,h&&(0,e.jsx)("span",{className:"text-state-danger ml-1",children:"*"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("select",{ref:u,id:E,value:s,onChange:j,disabled:x,required:h,className:N,"aria-invalid":y,"aria-describedby":i?`${E}-error`:c?`${E}-success`:C?`${E}-helper`:void 0,...v,children:[r&&(0,e.jsx)("option",{value:"",disabled:!0,children:r}),a.map((T,z)=>{const O=typeof T=="object"?T.value:T,P=typeof T=="object"?T.label:T;return(0,e.jsx)("option",{value:O,disabled:typeof T=="object"?T.disabled:!1,children:P},O||z)})]}),(0,e.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",children:(0,e.jsx)(_i,{className:`w-5 h-5 transition-colors ${y?"text-state-danger":w?"text-state-success":"text-text-muted"}`})})]}),i&&(0,e.jsx)("p",{id:`${E}-error`,className:"mt-1.5 text-sm text-state-danger",role:"alert",children:i}),c&&!i&&(0,e.jsx)("p",{id:`${E}-success`,className:"mt-1.5 text-sm text-state-success",children:c}),C&&!i&&!c&&(0,e.jsx)("p",{id:`${E}-helper`,className:"mt-1.5 text-sm text-text-secondary",children:C})]})});He.displayName="Select";var Kd=()=>{const t=()=>{};return{toasts:[],showToast:t,removeToast:()=>{},success:t,error:t,warning:t,info:t}},Xd=({children:t,content:a,position:s="top",delay:n=200,maxWidth:r=250,disabled:i=!1,className:c=""})=>{const[d,l]=(0,o.useState)(!1),[x,h]=(0,o.useState)({top:0,left:0}),[m,p]=(0,o.useState)(s),g=(0,o.useRef)(null),k=(0,o.useRef)(null),v=(0,o.useRef)(null),u=(0,o.useRef)(`tooltip-${Math.random().toString(36).substr(2,9)}`).current,E=()=>{if(!g.current||!k.current)return;const b=g.current.getBoundingClientRect(),j=k.current.getBoundingClientRect(),T=8,z={top:{top:b.top-j.height-T,left:b.left+(b.width-j.width)/2},bottom:{top:b.bottom+T,left:b.left+(b.width-j.width)/2},left:{top:b.top+(b.height-j.height)/2,left:b.left-j.width-T},right:{top:b.top+(b.height-j.height)/2,left:b.right+T}};let O=s,P=z[s];const U={width:window.innerWidth,height:window.innerHeight},Z=P.top>=0,I=P.top+j.height<=U.height,M=P.left>=0,K=P.left+j.width<=U.width;!Z&&s==="top"?(O="bottom",P=z.bottom):!I&&s==="bottom"?(O="top",P=z.top):!M&&s==="left"?(O="right",P=z.right):!K&&s==="right"&&(O="left",P=z.left),P.left<0?P.left=T:P.left+j.width>U.width&&(P.left=U.width-j.width-T),P.top<0?P.top=T:P.top+j.height>U.height&&(P.top=U.height-j.height-T),p(O),h(P)},C=()=>{i||(v.current=setTimeout(()=>{l(!0)},n))},y=()=>{v.current&&clearTimeout(v.current),l(!1)},w=()=>{i||l(!0)},N=()=>{l(!1)};return(0,o.useEffect)(()=>{if(d){E();const b=()=>E();return window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}}},[d]),(0,o.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{ref:g,onMouseEnter:C,onMouseLeave:y,onFocus:w,onBlur:N,"aria-describedby":d?u:void 0,className:"inline-block",children:t}),d&&(0,_t.createPortal)((0,e.jsx)(se,{children:(0,e.jsxs)(f.div,{ref:k,id:u,role:"tooltip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},style:{position:"fixed",top:x.top,left:x.left,maxWidth:r,zIndex:9999},className:`
157              px-3 py-2
158              bg-surface-elevated
159              border border-border-subtle
160              rounded-lg shadow-lg
161              text-sm text-text-primary
162              pointer-events-none
163              ${c}
164            `,children:[a,(0,e.jsx)("div",{className:`
165                absolute w-0 h-0
166                border-4 border-surface-elevated
167                ${{top:"bottom-[-4px] left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"top-[-4px] left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"r
167ight-[-4px] top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"left-[-4px] top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"}[m]}
168              `})]})}),document.body)]})},Ea={sm:"h-1.5",md:"h-2",lg:"h-3"},Os=(0,o.forwardRef)(({value:t=0,max:a=100,size:s="md",label:n=null,showValue:r=!1,className:i="",indicatorClassName:c="",...d},l)=>{const x=_e(),h=Math.min(Math.max(t,0),a),m=a>0?h/a*100:0;return(0,e.jsxs)("div",{ref:l,className:`w-full ${i}`,...d,children:[(n||r)&&(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[n&&(0,e.jsx)("span",{className:"text-xs font-medium text-text-secondary",children:n}),r&&(0,e.jsxs)("span",{className:"text-xs font-semibold tabular-nums text-text-primary",children:[h," / ",a]})]}),(0,e.jsx)("div",{role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":a,"aria-label":n||void 0,className:`
169          w-full overflow-hidden rounded-full
170          bg-surface-muted border border-border-subtle
171          ${Ea[s]||Ea.md}
172        `,children:(0,e.jsx)(f.div,{className:`h-full rounded-full bg-brand-primary ${c}`,initial:x?!1:{width:0},animate:{width:`${m}%`},transition:x?{duration:0}:{type:"spring",stiffness:120,damping:22}})})]})});Os.displayName="Progress";function Qd({featureKey:t,title:a,description:s,count:n=0,threshold:r=10,ctaLabel:i="Log a trade",ctaTo:c="/trade-logger",onCta:d,className:l=""}){const x=me(),h=_e(),m=Math.max(0,r-n);(0,o.useEffect)(()=>{Pn(t,n,r)},[t,n,r]);const p=()=>{if(d)return d();x(c)};return(0,e.jsxs)(f.div,{initial:h?!1:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,ease:"easeOut"},className:`
173        mx-auto my-10 w-full max-w-md
174        rounded-2xl border border-border-default
175        bg-surface-elevated/80 backdrop-blur-sm
176        p-8 text-center shadow-sm
177        ${l}
178      `,children:[(0,e.jsx)("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-gradient-to-br from-brand-primary/25 to-brand-primary/5 ring-1 ring-brand-primary/30",children:(0,e.jsx)(us,{size:22,className:"text-brand-primary","aria-hidden":"true"})}),(0,e.jsxs)("h3",{className:"text-base font-semibold text-text-primary",children:[a," unlocks at ",r," closed trades"]}),(0,e.jsx)("p",{className:"mt-1.5 text-xs leading-relaxed text-text-muted",children:"Your profile, guardrails, and session tools are available now. This advanced view needs a larger sample of closed trades."}),s&&(0,e.jsx)("p",{className:"mt-1.5 text-sm leading-relaxed text-text-secondary",children:s}),(0,e.jsxs)("div",{className:"mt-6",children:[(0,e.jsx)(Os,{value:n,max:r,size:"lg",showValue:!0,label:"Closed trades"}),(0,e.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:m===r?"Connect an account or record a trade. Closed trades count toward this sample.":`${m} more closed trade${m!==1?"s":""} to go — you're ${Math.round(n/r*100)}% there.`})]}),(0,e.jsx)(Es,{variant:"primary",size:"md",className:"mt-6",onClick:p,children:i})]})}var pl=(0,o.forwardRef)(({steps:t=[],currentIndex:a=0,showLabels:s=!1,size:n="md",className:r="",...i},c)=>{const d=_e(),l=n==="sm"?"h-6 w-6 text-[10px]":"h-7 w-7 text-xs";return(0,e.jsx)("div",{ref:c,role:"progressbar","aria-valuenow":a+1,"aria-valuemin":1,"aria-valuemax":t.length,"aria-label":`Step ${a+1} of ${t.length}`,className:`flex items-center ${r}`,...i,children:t.map((x,h)=>{const m=h<a,p=h===a;return(0,e.jsxs)(o.Fragment,{children:[h>0&&(0,e.jsx)("div",{className:"relative mx-1 h-0.5 flex-1 min-w-3 overflow-hidden rounded-full bg-border-subtle",children:(0,e.jsx)(f.div,{className:"absolute inset-y-0 left-0 rounded-full bg-brand-primary",initial:d?!1:{width:0},animate:{width:h<=a?"100%":"0%"},transition:d?{duration:0}:{duration:.35,ease:"easeOut"}})}),(0,e.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,e.jsx)(f.div,{initial:!1,animate:p&&!d?{scale:[1,1.12,1]}:{scale:1},transition:{duration:.3},className:`
179                  flex items-center justify-center rounded-full font-semibold ${l}
180                  ${m?"bg-brand-primary text-brand-primary-foreground":p?"bg-brand-primary/15 text-brand-primary ring-2 ring-brand-primary":"bg-surface-muted text-text-muted border border-border-subtle"}
181                `,children:m?(0,e.jsx)(It,{size:n==="sm"?12:14,strokeWidth:3}):h+1}),s&&x.label&&(0,e.jsx)("span",{className:`text-[10px] font-medium whitespace-nowrap ${p?"text-text-primary":"text-text-muted"}`,children:x.label})]})]},x.id||h)})})});pl.displayName="Stepper";var ul=(0,o.forwardRef)(({icon:t=null,title:a,description:s=null,selected:n=!1,disabled:r=!1,onSelect:i,multi:c=!1,size:d="md",className:l="",children:x,...h},m)=>{const p=_e(),{select:g}=yi(),k=d==="sm"?"p-3":"p-4",v=(...u)=>{r||g(),i?.(...u)};return(0,e.jsxs)(f.button,{ref:m,type:"button",role:c?"checkbox":"radio","aria-checked":n,disabled:r,onClick:v,whileTap:p||r?void 0:{scale:.98},animate:p||r?void 0:{scale:n?[1,1.06,1]:1},transition:{duration:.25},className:`
182        relative w-full text-left rounded-xl ${k}
183        border transition-colors duration-fast
184        focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary
185        disabled:opacity-50 disabled:cursor-not-allowed
186        ${n?"border-brand-primary bg-brand-primary/10 ring-1 ring-brand-primary shadow-[0_0_0_1px_hsl(var(--color-brand-primary)/0.3),0_2px_8px_hsl(var(--color-brand-primary)/0.25)]":"border-border-default bg-surface-elevated hover:border-border-strong hover:bg-surface-hover"}
187        ${l}
188      `,...h,children:[n&&(0,e.jsx)(f.span,{initial:p?!1:{scale:0,opacity:0}
188,animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:20},className:"absolute top-2.5 right-2.5 flex h-5 w-5 items-center justify-center rounded-full bg-brand-primary text-brand-primary-foreground",children:(0,e.jsx)(It,{size:12,strokeWidth:3})}),(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[t&&(0,e.jsx)("span",{className:`
189            mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg
190            ${n?"bg-brand-primary/20 text-brand-primary":"bg-surface-muted text-text-secondary"}
191          `,children:t}),(0,e.jsxs)("span",{className:"min-w-0 pr-6",children:[(0,e.jsx)("span",{className:"block text-sm font-semibold text-text-primary",children:a}),x||s&&(0,e.jsx)("span",{className:"mt-0.5 block text-xs leading-relaxed text-text-secondary",children:s})]})]})]})});ul.displayName="ChoiceCard";var hl=(0,o.forwardRef)(({options:t=[],value:a,onChange:s,multi:n=!1,size:r="md",className:i="",...c},d)=>{const l=_e(),x=new Set(n?a||[]:a!=null?[a]:[]),h=r==="sm"?"px-3 py-1.5 text-xs":"px-4 py-2 text-sm",m=p=>{if(s)if(n){const g=new Set(x);g.has(p)?g.delete(p):g.add(p),s([...g])}else s(p)};return(0,e.jsx)("div",{ref:d,role:n?"group":"radiogroup",className:`flex flex-wrap gap-2 ${i}`,...c,children:t.map(p=>{const g=x.has(p.id);return(0,e.jsx)(f.button,{type:"button",role:n?"checkbox":"radio","aria-checked":g,onClick:()=>m(p.id),whileTap:l?void 0:{scale:.95},title:p.desc||void 0,className:`
192              rounded-full font-medium ${h}
193              border transition-colors duration-fast
194              focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary
195              ${g?"border-brand-primary bg-brand-primary text-brand-primary-foreground shadow-sm":"border-border-default bg-surface-elevated text-text-secondary hover:border-border-strong hover:text-text-primary"}
196            `,children:p.label},p.id)})})});hl.displayName="ChipGroup";var gl=(0,o.forwardRef)(({value:t=0,max:a=10,milestones:s=[],className:n="",...r},i)=>{const c=_e(),d=Math.min(Math.max(t,0),a),l=a>0?d/a*100:0;return(0,e.jsxs)("div",{ref:i,className:`w-full ${n}`,...r,children:[(0,e.jsxs)("div",{className:"relative h-2 w-full rounded-full bg-surface-muted border border-border-subtle",children:[(0,e.jsx)(f.div,{className:"absolute inset-y-0 left-0 rounded-full bg-gradient-to-r from-brand-primary/70 to-brand-primary",initial:c?!1:{width:0},animate:{width:`${l}%`},transition:c?{duration:0}:{type:"spring",stiffness:100,damping:24}}),s.map(x=>{const h=a>0?Math.min(x.at,a)/a*100:0,m=d>=x.at;return(0,e.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2",style:{left:`${h}%`},children:(0,e.jsx)(f.div,{initial:!1,animate:m&&!c?{scale:[1,1.25,1]}:{scale:1},transition:{duration:.35},className:`
197                  flex h-6 w-6 items-center justify-center rounded-full border-2
198                  ${m?"border-brand-primary bg-brand-primary text-brand-primary-foreground":"border-border-strong bg-surface-elevated text-text-muted"}
199                `,"aria-label":`${x.label} — ${m?"reached":`at ${x.at} of ${a}`}`,children:m?(0,e.jsx)(It,{size:12,strokeWidth:3}):x.locked?(0,e.jsx)(us,{size:10}):(0,e.jsx)("span",{className:"text-[9px] font-bold",children:x.at})})},x.at)})]}),s.length>0&&(0,e.jsx)("div",{className:"relative mt-3 h-8 w-full",children:s.map(x=>{const h=a>0?Math.min(x.at,a)/a*100:0,m=d>=x.at;return(0,e.jsx)("span",{className:`absolute top-0 max-w-[8rem] text-[10px] font-medium leading-tight ${h<=8?"translate-x-0 text-left":h>=92?"-translate-x-full text-right":"-translate-x-1/2 text-center"} ${m?"text-text-primary":"text-text-muted"}`,style:{left:`${h}%`},children:x.label},x.at)})})]})});gl.displayName="MilestoneTrack";var pt=new Map,oa=[{ticker:"AAPL",name:"Apple Inc.",market:"stocks"},{ticker:"MSFT",name:"Microsoft Corporation",market:"stocks"},{ticker:"GOOGL",name:"Alphabet Inc. Class A",market:"stocks"},{ticker:"GOOG",name:"Alphabet Inc. Class C",market:"stocks"},{ticker:"AMZN",name:"Amazon.com Inc.",market:"stocks"},{ticker:"NVDA",name:"NVIDIA Corporation",market:"stocks"},{ticker:"META",name:"Meta Platforms Inc.",market:"stocks"},{ticker:"TSLA",name:"Tesla Inc.",market:"stocks"},{ticker:"AMD",name:"Advanced Micro Devices",market:"stocks"},{ticker:"INTC",name:"Intel Corporation",market:"stocks"},{ticker:"CRM",name:"Salesforce Inc.",market:"stocks"},{ticker:"ORCL",name:"Oracle Corporation",market:"stocks"},{ticker:"ADBE",name:"Adobe Inc.",market:"stocks"},{ticker:"NFLX",name:"Netflix Inc.",market:"stocks"},{ticker:"DIS",name:"Walt Disney Company",market:"stocks"},{ticker:"CMCSA",name:"Comcast Corporation",market:"stocks"},{ticker:"SPY",name:"SPDR S&P 500 ETF Trust",market:"stocks"},{ticker:"QQQ",name:"Invesco QQQ Trust",market:"stocks"},{ticker:"IWM",name:"iShares Russell 2000 ETF",market:"stocks"},{ticker:"DIA",name:"SPDR Dow Jones Industrial Average ETF",market:"stocks"},{ticker:"VOO",name:"Vanguard S&P 500 ETF",market:"stocks"},{ticker:"VTI",name:"Vanguard Total Stock Market ETF",market:"stocks"},{ticker:"ARKK",name:"ARK Innovation ETF",market:"stocks"},{ticker:"XLF",name:"Financial Select Sector SPDR Fund",market:"stocks"},{ticker:"XLE",name:"Energy Select Sector SPDR Fund",market:"stocks"},{ticker:"XLK",name:"Technology Select Sector SPDR Fund",market:"stocks"},{ticker:"TQQQ",name:"ProShares UltraPro QQQ",market:"stocks"},{ticker:"SQQQ",name:"ProShares UltraPro Short QQQ",market:"stocks"},{ticker:"SPXS",name:"Direxion Daily S&P 500 Bear 3X",market:"stocks"},{ticker:"SPXL",name:"Direxion Daily S&P 500 Bull 3X",market:"stocks"},{ticker:"JPM",name:"JPMorgan Chase & Co.",market:"stocks"},{ticker:"BAC",name:"Bank of America Corp.",market:"stocks"}
199,{ticker:"WFC",name:"Wells Fargo & Company",market:"stocks"},{ticker:"GS",name:"Goldman Sachs Group Inc.",market:"stocks"},{ticker:"MS",name:"Morgan Stanley",market:"stocks"},{ticker:"C",name:"Citigroup Inc.",market:"stocks"},{ticker:"V",name:"Visa Inc.",market:"stocks"},{ticker:"MA",name:"Mastercard Inc.",market:"stocks"},{ticker:"PYPL",name:"PayPal Holdings Inc.",market:"stocks"},{ticker:"SQ",name:"Block Inc.",market:"stocks"},{ticker:"COIN",name:"Coinbase Global Inc.",market:"stocks"},{ticker:"HOOD",name:"Robinhood Markets Inc.",market:"stocks"},{ticker:"JNJ",name:"Johnson & Johnson",market:"stocks"},{ticker:"UNH",name:"UnitedHealth Group Inc.",market:"stocks"},{ticker:"PFE",name:"Pfizer Inc.",market:"stocks"},{ticker:"ABBV",name:"AbbVie Inc.",market:"stocks"},{ticker:"MRK",name:"Merck & Co. Inc.",market:"stocks"},{ticker:"LLY",name:"Eli Lilly and Company",market:"stocks"},{ticker:"TMO",name:"Thermo Fisher Scientific",market:"stocks"},{ticker:"ABT",name:"Abbott Laboratories",market:"stocks"},{ticker:"BMY",name:"Bristol-Myers Squibb",market:"stocks"},{ticker:"MRNA",name:"Moderna Inc.",market:"stocks"},{ticker:"WMT",name:"Walmart Inc.",market:"stocks"},{ticker:"COST",name:"Costco Wholesale Corp.",market:"stocks"},{ticker:"HD",name:"Home Depot Inc.",market:"stocks"},{ticker:"TGT",name:"Target Corporation",market:"stocks"},{ticker:"LOW",name:"Lowe's Companies Inc.",market:"stocks"},{ticker:"NKE",name:"Nike Inc.",market:"stocks"},{ticker:"SBUX",name:"Starbucks Corporation",market:"stocks"},{ticker:"MCD",name:"McDonald's Corporation",market:"stocks"},{ticker:"KO",name:"Coca-Cola Company",market:"stocks"},{ticker:"PEP",name:"PepsiCo Inc.",market:"stocks"},{ticker:"PG",name:"Procter & Gamble Co.",market:"stocks"},{ticker:"XOM",name:"Exxon Mobil Corporation",market:"stocks"},{ticker:"CVX",name:"Chevron Corporation",market:"stocks"},{ticker:"COP",name:"ConocoPhillips",market:"stocks"},{ticker:"OXY",name:"Occidental Petroleum",market:"stocks"},{ticker:"SLB",name:"Schlumberger Limited",market:"stocks"},{ticker:"PLTR",name:"Palantir Technologies",market:"stocks"},{ticker:"SNOW",name:"Snowflake Inc.",market:"stocks"},{ticker:"NET",name:"Cloudflare Inc.",market:"stocks"},{ticker:"DDOG",name:"Datadog Inc.",market:"stocks"},{ticker:"ZS",name:"Zscaler Inc.",market:"stocks"},{ticker:"CRWD",name:"CrowdStrike Holdings",market:"stocks"},{ticker:"PANW",name:"Palo Alto Networks",market:"stocks"},{ticker:"SHOP",name:"Shopify Inc.",market:"stocks"},{ticker:"UBER",name:"Uber Technologies Inc.",market:"stocks"},{ticker:"LYFT",name:"Lyft Inc.",market:"stocks"},{ticker:"ABNB",name:"Airbnb Inc.",market:"stocks"},{ticker:"RBLX",name:"Roblox Corporation",market:"stocks"},{ticker:"U",name:"Unity Software Inc.",market:"stocks"},{ticker:"RIVN",name:"Rivian Automotive Inc.",market:"stocks"},{ticker:"LCID",name:"Lucid Group Inc.",market:"stocks"},{ticker:"NIO",name:"NIO Inc.",market:"stocks"},{ticker:"XPEV",name:"XPeng Inc.",market:"stocks"},{ticker:"F",name:"Ford Motor Company",market:"stocks"},{ticker:"GM",name:"General Motors Company",market:"stocks"},{ticker:"TSM",name:"Taiwan Semiconductor Manufacturing",market:"stocks"},{ticker:"AVGO",name:"Broadcom Inc.",market:"stocks"},{ticker:"QCOM",name:"Qualcomm Inc.",market:"stocks"},{ticker:"MU",name:"Micron Technology Inc.",market:"stocks"},{ticker:"MRVL",name:"Marvell Technology Inc.",market:"stocks"},{ticker:"ASML",name:"ASML Holding NV",market:"stocks"},{ticker:"LRCX",name:"Lam Research Corporation",market:"stocks"},{ticker:"AMAT",name:"Applied Materials Inc.",market:"stocks"},{ticker:"KLAC",name:"KLA Corporation",market:"stocks"},{ticker:"ON",name:"ON Semiconductor",market:"stocks"},{ticker:"T",name:"AT&T Inc.",market:"stocks"},{ticker:"VZ",name:"Verizon Communications",market:"stocks"},{ticker:"TMUS",name:"T-Mobile US Inc.",market:"stocks"},{ticker:"DAL",name:"Delta Air Lines Inc.",market:"stocks"},{ticker:"UAL",name:"United Airlines Holdings",market:"stocks"},{ticker:"AAL",name:"American Airlines Group",market:"stocks"},{ticker:"LUV",name:"Southwest Airlines Co.",market:"stocks"},{ticker:"BA",name:"Boeing Company",market:"stocks"},{ticker:"GME",name:"GameStop Corp.",market:"stocks"}
199,{ticker:"AMC",name:"AMC Entertainment Holdings",market:"stocks"},{ticker:"BBBY",name:"Bed Bath & Beyond Inc.",market:"stocks"},{ticker:"BB",name:"BlackBerry Limited",market:"stocks"},{ticker:"SOFI",name:"SoFi Technologies Inc.",market:"stocks"},{ticker:"BTC",name:"Bitcoin",market:"crypto"},{ticker:"BTCUSD",name:"Bitcoin / US Dollar",market:"crypto"},{ticker:"ETH",name:"Ethereum",market:"crypto"},{ticker:"ETHUSD",name:"Ethereum / US Dollar",market:"crypto"},{ticker:"SOL",name:"Solana",market:"crypto"},{ticker:"SOLUSD",name:"Solana / US Dollar",market:"crypto"},{ticker:"XRP",name:"Ripple",market:"crypto"},{ticker:"DOGE",name:"Dogecoin",market:"crypto"},{ticker:"ADA",name:"Cardano",market:"crypto"},{ticker:"AVAX",name:"Avalanche",market:"crypto"},{ticker:"DOT",name:"Polkadot",market:"crypto"},{ticker:"LINK",name:"Chainlink",market:"crypto"},{ticker:"MATIC",name:"Polygon",market:"crypto"},{ticker:"LTC",name:"Litecoin",market:"crypto"},{ticker:"UNI",name:"Uniswap",market:"crypto"},{ticker:"ATOM",name:"Cosmos",market:"crypto"},{ticker:"FTM",name:"Fantom",market:"crypto"},{ticker:"NEAR",name:"NEAR Protocol",market:"crypto"},{ticker:"APE",name:"ApeCoin",market:"crypto"},{ticker:"SHIB",name:"Shiba Inu",market:"crypto"},{ticker:"EUR/USD",name:"Euro / US Dollar",market:"forex"},{ticker:"EURUSD",name:"Euro / US Dollar",market:"forex"},{ticker:"GBP/USD",name:"British Pound / US Dollar",market:"forex"},{ticker:"GBPUSD",name:"British Pound / US Dollar",market:"forex"},{ticker:"USD/JPY",name:"US Dollar / Japanese Yen",market:"forex"},{ticker:"USDJPY",name:"US Dollar / Japanese Yen",market:"forex"},{ticker:"AUD/USD",name:"Australian Dollar / US Dollar",market:"forex"},{ticker:"AUDUSD",name:"Australian Dollar / US Dollar",market:"forex"},{ticker:"USD/CAD",name:"US Dollar / Canadian Dollar",market:"forex"},{ticker:"USDCAD",name:"US Dollar / Canadian Dollar",market:"forex"},{ticker:"USD/CHF",name:"US Dollar / Swiss Franc",market:"forex"},{ticker:"USDCHF",name:"US Dollar / Swiss Franc",market:"forex"},{ticker:"NZD/USD",name:"New Zealand Dollar / US Dollar",market:"forex"},{ticker:"NZDUSD",name:"New Zealand Dollar / US Dollar",market:"forex"},{ticker:"EUR/GBP",name:"Euro / British Pound",market:"forex"},{ticker:"EURGBP",name:"Euro / British Pound",market:"forex"},{ticker:"EUR/JPY",name:"Euro / Japanese Yen",market:"forex"},{ticker:"EURJPY",name:"Euro / Japanese Yen",market:"forex"},{ticker:"GBP/JPY",name:"British Pound / Japanese Yen",market:"forex"},{ticker:"GBPJPY",name:"British Pound / Japanese Yen",market:"forex"},{ticker:"XAU/USD",name:"Gold / US Dollar",market:"forex"},{ticker:"XAUUSD",name:"Gold Spot / US Dollar",market:"forex"},{ticker:"XAG/USD",name:"Silver / US Dollar",market:"forex"},{ticker:"XAGUSD",name:"Silver Spot / US Dollar",market:"forex"},{ticker:"ES",name:"E-mini S&P 500 Futures",market:"futures"},{ticker:"MES",name:"Micro E-mini S&P 500 Futures",market:"futures"},{ticker:"NQ",name:"E-mini NASDAQ-100 Futures",market:"futures"},{ticker:"MNQ",name:"Micro E-mini NASDAQ-100 Futures",market:"futures"},{ticker:"RTY",name:"E-mini Russell 2000 Futures",market:"futures"},{ticker:"M2K",name:"Micro E-mini Russell 2000 Futures",market:"futures"},{ticker:"YM",name:"E-mini Dow Futures",market:"futures"},{ticker:"MYM",name:"Micro E-mini Dow Futures",market:"futures"},{ticker:"CL",name:"Crude Oil Futures",market:"futures"},{ticker:"MCL",name:"Micro Crude Oil Futures",market:"futures"},{ticker:"GC",name:"Gold Futures",market:"futures"},{ticker:"MGC",name:"Micro Gold Futures",market:"futures"},{ticker:"SI",name:"Silver Futures",market:"futures"},{ticker:"SIL",name:"Micro Silver Futures",market:"futures"},{ticker:"NG",name:"Natural Gas Futures",market:"futures"},{ticker:"ZB",name:"30-Year T-Bond Futures",market:"futures"},{ticker:"ZN",name:"10-Year T-Note Futures",market:"futures"},{ticker:"ZC",name:"Corn Futures",market:"futures"},{ticker:"ZS",name:"Soybean Futures",market:"futures"},{ticker:"ZW",name:"Wheat Futures",market:"futures"},{ticker:"6E",name:"Euro FX Futures",market:"futures"},{ticker:"6B",name:"British Pound Futures",market:"futures"},{ticker:"6J",name:"Japanese Yen Futures",market:"futures"},{ticker:"VIX",name:"CBOE Volatility Index Futures",market:"futures"}],bl=async(t,a="stocks")=>{if(!t)return null;const s=t.toUpperCase().trim(),n=`${s}_${a}`;if(pt.has(n))return pt.get(n);const r=oa.find(i=>i.ticker.toUpperCase()===s);if(r)return pt.set(n,r),r;try{const i=await bs.getCompanyInfo(s);if(i?.data?.results){const c=i.data.results,d={ticker:c.ticker||s,name:c.name||s,market:c.market||a,locale:c.locale,type:c.type,currency:c.currency_name,primaryExchange:c.primary_exchange};return pt.set(n,d),d}}catch(i){console.warn(`[TickerSearch] Failed to lookup ${s}:`,i.message)}return{ticker:s,name:s,market:a}},Jd=async(t,a="stocks")=>{const s={},n=t.map(async r=>{const i=await bl(r,a);s[r.toUpperCase()]=i});return await Promise.all(n),s},fl=async(t,a="stocks")=>{if(!t||t.length<1)return[];const s=t.toUpperCase().trim(),n=a?.toLowerCase()||"stocks",r=oa.filter(i=>{const c=i.ticker.toUpperCase().startsWith(s)||i.ticker.toUpperCase().includes(s)||i.name.toUpperCase().includes(s);if(n!=="stocks"){const d=i.market===n||n==="forex"&&i.market==="fx"||n==="fx"&&i.market==="forex";return c&&d}return c});if(r.sort((i,c)=>{const d=i.ticker.toUpperCase().startsWith(s),l=c.ticker.toUpperCase().startsWith(s);return d&&!l?-1:!d&&l?1:i.ticker.length-c.ticker.length}),r.length>=3||s.length<2)return r.slice(0,10);if(n==="stocks"&&s.length>=2)try{const i=bs.searchTickers(s,"stocks"),c=new Promise((l,x)=>setTimeout(()=>x(new Error("API timeout")),1500)),d=await Promise.race([i,c]);if(d?.data?.results&&Array.isArray(d.data.results)){const l=d.data.results.slice(0,10).map(m=>({ticker:m.ticker,name:m.name||m.ticker,market:m.market||"stocks",locale:m.locale,type:m.type,primaryExchange:m.primary_exchange})),x=[...r],h=new Set(r.map(m=>m.ticker));return l.forEach(m=>{h.has(m.ticker)||(x.push(m),h.add(m.ticker))}),x.slice(0,10)}}catch(i){console.debug("[TickerSearch] Using local results:",i.message)}return r.slice(0,10)},yl=t=>{switch(t?.toLowerCase()){case"crypto":return(0,e.jsx)(fi,{className:"text-orange-400"});case"fx":case"forex":return(0,e.jsx)(gi,{className:"text-blue-400"});case"futures":return(0,e.jsx)(bi,{className:"text-purple-400"});default:return(0,e.jsx)(ji,{className:"text-green-400"})}},vl=({value:t="",onChange:a,onSelect:s,placeholder:n="Search ticker or company...",market:r="stocks",className:i="",disabled:c=!1,required:d=!1,label:l=null,helperText:x=null,autoFocus:h=!1})=>{const[m,p]=(0,o.useState)(t),[g,k]=(0,o.useState)([]),[v,u]=(0,o.useState)(!1),[E,C]=(0,o.useState)(!1),[y,w]=(0,o.useState)(-1),N=(0,o.useRef)(null),b=(0,o.useRef)(null),j=(0,o.useRef)(null);(0,o.useEffect)(()=>{t!==m&&p(t)},[t]);const T=(0,o.useCallback)(async I=>{if(!I||I.length<1){k([]),C(!1);return}u(!0);try{const M=await fl(I,r);k(M),C(M.length>0),w(-1)}catch(M){console.error("[TickerSearch] Search error:",M),k([])}finally{u(!1)}},[r]),z=I=>{const M=I.target.value.toUpperCase();p(M),a?.(M),j.current&&clearTimeout(j.current);const K=oa.filter(D=>D.ticker.toUpperCase().startsWith(M)||D.ticker.toUpperCase().includes(M)).slice(0,5);K.length>0&&M.length>0&&(k(K),C(!0)),j.current=setTimeout(()=>{T(M)},200)},O=I=>{console.log("[TickerSearch] Selected item:",I),p(I.ticker),C(!1),k([]),s&&(console.log("[TickerSearch] Calling onSelect with:",{ticker:I.ticker,name:I.name,market:I.market}),s(I)),a?.(I.ticker)},P=I=>{if(!(!E||g.length===0))switch(I.key){case"ArrowDown":I.preventDefault(),w(M=>M<g.length-1?M+1:M);break;case"ArrowUp":I.preventDefault(),w(M=>M>0?M-1:-1);break;case"Enter":I.preventDefault(),y>=0&&g[y]&&O(g[y]);break;case"Escape":C(!1);break}},U=()=>{setTimeout(()=>{C(!1)},200)},Z=()=>{p(""),k([]),C(!1),a?.(""),N.current?.focus()};return(0,o.useEffect)(()=>{const I=M=>{b.current&&!b.current.contains(M.target)&&N.current&&!N.current.contains(M.target)&&C(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]),(0,e.jsxs)("div",{className:`relative ${i}`,children:[l&&(0,e.jsxs)("label",{className:"block text-xs sm:text-sm font-medium text-gray-300 mb-1.5",children:[l,d&&(0,e.jsx)("span",{className:"text-red-400 ml-1",children:"*"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:v?(0,e.jsx)(Si,{className:"text-gray-400 animate-spin w-4 h-4"}):(0,e.jsx)(Ni,{className:"text-gray-400 w-4 h-4"})}),(0,e.jsx)("input",{ref:N,type:"text",value:m,onChange:z,onFocus:()=>m&&g.length>0&&C(!0),onBlur:U,onKeyDown:P,placeholder:n,disabled:c,autoFocus:h,className:`
200            w-full pl-10 pr-10 py-2.5 
201            bg-gray-800/80 border border-gray-700 rounded-xl
202            text-white font-mono uppercase text-base
203            placeholder:text-gray-500 placeholder:normal-case placeholder:font-sans
204            focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20
205            disabled:opacity-50 disabled:cursor-not-allowed
206            transition-all duration-200
207            touch-manipulation
208          `}),m&&(0,e.jsx)("button",{type:"button",onClick:Z,className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-white transition-colors",children:(0,e.jsx)(ki,{className:"w-4 h-4"})})]}),x&&(0,e.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:x}),E&&g.length>0&&(0,e.jsx)("div",{ref:b,className:"absolute z-50 w-full mt-1 bg-gray-800 border border-gray-700 rounded-xl shadow-xl max-h-64 overflow-y-auto",children:g.map((I,M)=>(0,e.jsxs)("button",{type:"button",onClick:()=>O(I),className:`
209                w-full flex items-center gap-3 px-4 py-3 text-left
210                transition-colors duration-150
211                ${y===M?"bg-blue-600/30 text-white":"hover:bg-gray-700/50 text-gray-200"}
212                ${M===0?"rounded-t-xl":""}
213                ${M===g.length-1?"rounded-b-xl":""}
214                border-b border-gray-700/50 last:border-0
215              `,children:[(0,e.jsx)("div",{className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg bg-gray-700/50",children:yl(I.market)}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"font-mono font-bold text-white",children:I.ticker}),I.primaryExchange&&(0,e.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-gray-700 rounded text-gray-400",children:I.primaryExchange})]}),(0,e.jsx)("p",{className:"text-sm text-gray-400 truncate",children:I.name})]}),I.type&&(0,e.jsx)("span",{className:"text-[10px] text-gray-500 uppercase",children:I.type})]},`${I.ticker}-${M}`))}),E&&g.length===0&&m.length>=2&&!v&&(0,e.jsxs)("div",{className:"absolute z-50 w-full mt-1 bg-gray-800 border border-gray-700 rounded-xl shadow-xl p-4 text-center",children:[(0,e.jsxs)("p",{className:"text-gray-400 text-sm",children:['No results for "',m,'"']}),(0,e.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:"Try a different ticker or company name"})]})]})},wl=[{value:"A+",label:"A+ (Elite)"},{value:"A",label:"A (Excellent)"},{value:"B+",label:"B+ (Great)"},{value:"B",label:"B (Good)"},{value:"C+",label:"C+ (Fair)"},{value:"C",label:"C (Needs Work)"},{value:"D",label:"D (Struggling)"},{value:"F",label:"F (Fail)"}],Zd=(t,a)=>{if(!t&&!a){console.warn("[calculateTradingSession] No date or time provided, using current time");const i=new Date,c=i.getHours(),d=i.getMinutes(),l=c*60+d;return l>=240&&l<570?"pre-market":l>=570&&l<630?"open":l>=630&&l<840?"mid-day":l>=840&&l<960?"afternoon":l>=960&&l<1200?"after-hours":"overnight"}let s=0,n=0;if(a&&a.trim())try{const i=a.trim().split(":");s=parseInt(i[0],10)||0,n=parseInt(i[1],10)||0}catch(i){console.warn("[calculateTradingSession] Failed to parse entryTime:",a,i)}else if(t)try{const i=new Date(t);if(isNaN(i.getTime()))return console.warn("[calculateTradingSession] Invalid date:",t),"";s=i.getHours(),n=i.getMinutes()}catch(i){return console.warn("[calculateTradingSession] Error parsing date:",t,i),""}const r=s*60+n;return r>=240&&r<570?"pre-market":r>=570&&r<630?"open":r>=630&&r<840?"mid-day":r>=840&&r<960?"afternoon":r>=960&&r<1200?"after-hours":"overnight"},e0=(t,a)=>{const s=parseFloat(t.entryPrice)||0,n=parseFloat(t.stopLoss)||0,r=parseFloat(t.takeProfit)||0,i=parseFloat(t.exitPrice)||0,c=parseFloat(t.quantity)||parseFloat(t.contracts)||parseFloat(t.lots)||1,d=t.tradeType==="long",l=n?Math.abs(s-n):0,x=l*c,h=a>0?x/a*100:0;let m=0;l>0&&r&&(m=(d?r-s:s-r)/l);let p=0;return l>0&&i&&(p=(d?i-s:s-i)/l),{riskAmount:x.toFixed(2),riskPercent:h.toFixed(2),plannedRR:m.toFixed(2),actualRR:p.toFixed(2),riskPerUnit:l.toFixed(4)}},t0=(t,a=!1)=>{const s=t?.toString().toLowerCase().trim();return s==="options"||s==="futures"?a?"contract":"contracts":s==="forex"?a?"lot":"lots":a?"share":"shares"},Aa={ticker:"",securityName:"",marketType:"Stocks",tradeType:"long",tradeStatus:"closed",entryPrice:"",exitPrice:"",quantity:"",contracts:"",lots:"",currencyPair:"",accountCurrency:"USD",optionType:"Call",optionStrike:"",optionExpiry:"",setup:"",notes:"",accountId:"",setupValidationSetupScore:"",setupValidationExecutionScore:"",setupValidationDisciplineScore:"",setupValidationGrade:"",entryEmotion:"",exitEmotion:""};function jl(){const{showQuickTradeModal:t,closeQuickTrade:a,quickTradeContext:s,isActive:n,sessionId:r}=na(),{user:i}=Ne(),{createTrade:c}=dn(),{fetchTrades:d}=aa(),[l,x]=(0,o.useState)({...Aa}),[h,m]=(0,o.useState)(!1),[p,g]=(0,o.useState)(0),[k,v]=(0,o.useState)(null);(0,o.useEffect)(()=>{t&&(x({...Aa,ticker:s?.symbol||"",securityName:s?.symbol||"",tradeType:s?.direction||"long"}),g(0),v(null))},[t,s]),(0,o.useEffect)(()=>
215{if(l.entryPrice&&l.exitPrice){const N=parseFloat(l.entryPrice),b=parseFloat(l.exitPrice),j=ga({marketType:l.marketType,tradeType:l.tradeType==="long"?"Long":"Short",entryPrice:N,exitPrice:b,quantity:parseFloat(l.quantity)||0,contracts:parseFloat(l.contracts)||0,lots:parseFloat(l.lots)||0,currencyPair:l.currencyPair,symbol:l.ticker});g(typeof j=="object"?j.pl||0:j||0)}else g(0)},[l.entryPrice,l.exitPrice,l.quantity,l.contracts,l.lots,l.marketType,l.tradeType,l.currencyPair,l.ticker]),(0,o.useEffect)(()=>{const N=b=>{b.key==="Escape"&&t&&a()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[t,a]);const u=(0,o.useCallback)(N=>{const{name:b,value:j}=N.target;x(T=>({...T,[b]:b==="ticker"?j.toUpperCase():j}))},[]),E=()=>l.marketType==="Forex"||l.marketType==="Crypto"?1:l.marketType==="Futures"||l.marketType==="Options"?Math.abs(parseFloat(l.contracts||1)):Math.abs(parseFloat(l.quantity||1)),C=async N=>{if(N.preventDefault(),!!i?.uid&&l.ticker.trim()&&l.entryPrice){m(!0);try{const b=new Date,j=`${b.getFullYear()}-${String(b.getMonth()+1).padStart(2,"0")}-${String(b.getDate()).padStart(2,"0")}`,T=`${String(b.getHours()).padStart(2,"0")}:${String(b.getMinutes()).padStart(2,"0")}`,z=l.tradeStatus==="closed"&&l.exitPrice,O=parseFloat(l.entryPrice),P=l.exitPrice?parseFloat(l.exitPrice):null,U=l.marketType==="Forex"||l.marketType==="Crypto",Z=P!=null?ga({marketType:l.marketType,tradeType:l.tradeType==="long"?"Long":"Short",entryPrice:O,exitPrice:P,quantity:parseFloat(l.quantity)||0,contracts:parseFloat(l.contracts)||0,lots:parseFloat(l.lots)||0,currencyPair:l.currencyPair,symbol:l.ticker}).pl:null,I={symbol:l.ticker.toUpperCase(),ticker:l.ticker.toUpperCase(),securityName:l.securityName||l.ticker.toUpperCase(),marketType:l.marketType,tradeType:l.tradeType==="long"?"Long":"Short",tradeStatus:l.tradeStatus||"closed",entryPrice:O,exitPrice:P,quantity:E(),contracts:l.contracts?parseFloat(l.contracts):null,lots:U?1:l.lots?parseFloat(l.lots):null,currencyPair:l.marketType==="Forex"?l.ticker.toUpperCase():l.currencyPair||null,accountCurrency:l.accountCurrency||"USD",...Z!=null?{pl:Z}:{},optionType:l.marketType==="Options"?l.optionType:null,optionStrike:l.optionStrike?parseFloat(l.optionStrike):null,optionExpiry:l.optionExpiry||null,setup:l.setup||null,notes:l.notes||"",accountId:l.accountId||null,setupValidation:{setupScore:l.setupValidationSetupScore?parseInt(l.setupValidationSetupScore):null,executionScore:l.setupValidationExecutionScore?parseInt(l.setupValidationExecutionScore):null,disciplineScore:l.setupValidationDisciplineScore?parseInt(l.setupValidationDisciplineScore):null,grade:l.setupValidationGrade||null},entryEmotion:l.entryEmotion||null,exitEmotion:l.exitEmotion||null,entryDate:j,entryTimeOnly:T,exitDate:z?j:null,exitTimeOnly:z?T:null,userId:i.uid,source:"quick_trade",sessionId:r||null},M=new FormData;if(Object.entries(I).forEach(([K,D])=>{D!=null&&(K==="setupValidation"?Object.entries(D).forEach(([Q,V])=>{V!=null&&M.set(`setupValidation${Q.charAt(0).toUpperCase()+Q.slice(1)}`,String(V))}):M.set(K,String(D)))}),!await c(M)){v("Trade could not be saved. Please check your inputs and try again.");return}vr.success("✓ Trade logged",{autoClose:2e3,hideProgressBar:!0}),a()}catch(b){console.error("[QuickTrade] Save error:",b),v(b.message||"Failed to save trade.")}finally{m(!1)}}};if(!t)return null;const y="w-full px-3 py-2 bg-slate-800 border border-slate-600 rounded-lg text-white text-base placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-green-500/50 focus:border-green-500/50",w="block text-xs font-medium text-slate-400 mb-1";return(0,_t.createPortal)((0,e.jsx)(se,{children:(0,e.jsx)(f.div,{initial:{opacity:0}
215,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:a,children:(0,e.jsxs)(f.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},transition:{type:"spring",damping:25,stiffness:300},className:"relative bg-slate-900 border border-slate-700 rounded-2xl shadow-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto",onClick:N=>N.stopPropagation(),children:[(0,e.jsxs)("div",{className:"sticky top-0 z-10 bg-slate-900/95 backdrop-blur-sm border-b border-slate-700 px-5 py-3.5 flex items-center justify-between rounded-t-2xl",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("h2",{className:"text-lg font-bold text-white",children:"Log Trade"}),n&&(0,e.jsxs)("span",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-green-500/15 border border-green-500/30 rounded-full",children:[(0,e.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,e.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-green-500"})]}),(0,e.jsx)("span",{className:"text-green-400 text-[10px] font-semibold",children:"LIVE"})]})]}),(0,e.jsx)("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-800 text-slate-400 hover:text-white transition-colors",children:(0,e.jsx)(qe,{className:"w-5 h-5"})})]}),(0,e.jsxs)("form",{onSubmit:C,className:"p-5 space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:w,children:"Trading Account"}),(0,e.jsx)(bo,{selectedAccountId:l.accountId,onSelect:N=>x(b=>({...b,accountId:N})),showCreateOption:!1})]}),(0,e.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,e.jsx)("div",{className:"col-span-3",children:(0,e.jsx)(vl,{label:(0,e.jsxs)("span",{className:w,children:["Symbol ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),value:l.ticker,onChange:N=>u({target:{name:"ticker",value:N}}),onSelect:N=>{x(b=>({...b,ticker:N.ticker,securityName:N.name||N.ticker,...N.market==="crypto"?{marketType:"Crypto"}:{},...N.market==="forex"||N.market==="fx"?{marketType:"Forex"}:{},...N.market==="futures"?{marketType:"Futures"}:{}}))},market:l.marketType?.toLowerCase()||"stocks",placeholder:"AAPL, BTC, EUR/USD...",required:!0})}),(0,e.jsx)("div",{className:"col-span-2",children:(0,e.jsx)(He,{label:(0,e.jsx)("span",{className:w,children:"Market"}),name:"marketType",value:l.marketType,onChange:N=>x(b=>({...b,marketType:N})),options:[{value:"Stocks",label:"📈 Stocks"},{value:"Options",label:"📊 Options"},{value:"Forex",label:"💱 Forex"},{value:"Crypto",label:"₿ Crypto"},{value:"Futures",label:"📊 Futures"}]})})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,e.jsx)(He,{label:(0,e.jsxs)("span",{className:w,children:["Direction ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"tradeType",value:l.tradeType,onChange:N=>x(b=>({...b,tradeType:N})),options:l.marketType==="Options"?[{value:"long",label:"📞 Call"},{value:"short",label:"📉 Put"}]:[{value:"long",label:"📈 Long"},{value:"short",label:"📉 Short"}]}),(0,e.jsx)(He,{label:(0,e.jsx)("span",{className:w,children:"Status"}),name:"tradeStatus",value:l.tradeStatus,onChange:N=>x(b=>({...b,tradeStatus:N})),options:[{value:"open",label:"🟢 Open"},{value:"closed",label:"🔴 Closed"}]})]}),(0,e.jsxs)("div",{className:`grid ${l.tradeStatus==="closed"?"grid-cols-2":"grid-cols-1"} gap-3`,children:[(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Entry Price ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"entryPrice",type:"number",step:"0.0001",inputMode:"decimal",required:!0,value:l.entryPrice,onChange:u,placeholder:"0.00",leftIcon:(0,e.jsx)("span",{className:"text-slate-500 text-xs",children:"$"})}),l.tradeStatus==="closed"&&(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Exit Price ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"exitPrice",type:"number",step:"0.0001",inputMode:"decimal",required:!0,value:l.exitPrice,onChange:u,placeholder:"0.00",leftIcon:(0,e.jsx)("span",{className:"text-slate-500 text-xs",children:"$"})})]}),l.marketType==="Forex"||l.marketType==="Crypto"?null:l.marketType==="Futures"?(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Contracts ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"contracts",type:"number",step:"1",required:!0,value:l.contracts,onChange:u,placeholder:"1"}):l.marketType==="Options"?(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Contracts ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"contracts",type:"number",step:"1",required:!0,value:l.contracts,onChange:u,placeholder:"1",helpText:"1 contract = 100 shares"}),(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Strike Price ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"optionStrike",type:"number",step:"0.01",required:!0,value:l.optionStrike,onChange:u,placeholder:"150.00",leftIcon:(0,e.jsx)("span",{className:"text-slate-500 text-xs",children:"$"})})]}):(0,e.jsx)(pe,{label:(0,e.jsxs)("span",{className:w,children:["Shares ",(0,e.jsx)("span",{className:"text-red-400",children:"*"})]}),name:"quantity",type:"number",step:"1",required:!0,value:l.quantity,onChange:u,placeholder:"100"}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,e.jsx)(He,{label:(0,e.jsx)("span",{className:w,children:"Setup"}),name:"setup",value:l.setup,onChange:N=>x(b=>({...b,setup:N})),options:[{value:"",label:"Select..."},{value:"Breakout",label:"Breakout"},{value:"Breakdown",label:"Breakdown"},{value:"Support Bounce",label:"Support Bounce"},{value:"Resistance Rejection",label:"Resistance Rejection"},{value:"Pullback",label:"Pullback"},{value:"Reversal",label:"Reversal"},{value:"Continuation",label:"Continuation"},{value:"Momentum",label:"Momentum"},{value:"Scalp",label:"Scalp"},{value:"Gap Fill",label:"Gap Fill"}],placeholder:"Select setup"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:w,children:"Notes"}),(0,e.jsx)("input",{name:"notes",value:l.notes,onChange:u,placeholder:"Quick note...",className:y})]})]}),(0,e.jsxs)("div",{className:"border border-slate-700 rounded-xl p-4 space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("h3",{className:"text-sm font-bold text-indigo-300 flex items-center gap-2",children:"⚖️ Performance Review"}),(0,e.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 bg-indigo-500/30 text-indigo-200 rounded-full font-bold",children:"JUDGMENT"})]}),(0,e.jsx)("p",{className:"text-[11px] text-slate-500",children:"Grade setup quality, execution, and discipline. Feeds your AI coach."}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,e.jsx)(pe,{label:(0,e.jsx)("span",{className:w,children:"Setup"}),name:"setupValidationSetupScore",type:"number",min:"0",max:"100",value:l.setupValidationSetupScore,onChange:u,placeholder:"85",helpText:"0-100"}),(0,e.jsx)(pe,{label:(0,e.jsx)("span",{className:w,children:"Execution"}),name:"setupValidationExecutionScore",type:"number",min:"0",max:"100",value:l.setupValidationExecutionScore,onChange:u,placeholder:"78",helpText:"0-100"}),(0,e.jsx)(pe,{label:(0,e.jsx)("span",{className:w,children:"Discipline"}),name:"setupValidationDisciplineScore",type:"number",min:"0",max:"100",value:l.setupValidationDisciplineScore,onChange:u,placeholder:"70",helpText:"0-100"})]}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,e.jsx)(He,{label:(0,e.jsx)("span",{className:w,children:"Grade"}
215),name:"setupValidationGrade",value:l.setupValidationGrade,onChange:N=>x(b=>({...b,setupValidationGrade:N})),options:wl,placeholder:"Grade"}),(0,e.jsx)(pe,{label:(0,e.jsx)("span",{className:w,children:"Entry Emotion"}),name:"entryEmotion",type:"text",value:l.entryEmotion,onChange:u,placeholder:"Calm..."}),(0,e.jsx)(pe,{label:(0,e.jsx)("span",{className:w,children:"Exit Emotion"}),name:"exitEmotion",type:"text",value:l.exitEmotion,onChange:u,placeholder:"Relieved..."})]})]}),l.tradeStatus==="closed"&&l.entryPrice&&l.exitPrice&&(0,e.jsxs)("div",{className:`flex items-center justify-between px-4 py-2.5 rounded-xl border ${p>0?"bg-green-500/10 border-green-500/30":p<0?"bg-red-500/10 border-red-500/30":"bg-slate-800 border-slate-700"}`,children:[(0,e.jsx)("span",{className:"text-xs text-slate-400 font-medium",children:"Estimated P/L"}),(0,e.jsxs)("span",{className:`text-lg font-bold ${p>0?"text-green-400":p<0?"text-red-400":"text-slate-300"}`,children:[p>=0?"+":"","$",p.toFixed(2)]})]}),k&&(0,e.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2.5 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,e.jsx)("span",{className:"text-red-400 text-xs mt-0.5",children:"⛔"}),(0,e.jsx)("p",{className:"text-red-300 text-xs leading-relaxed",children:k})]}),(0,e.jsx)("button",{type:"submit",disabled:h||!l.ticker.trim()||!l.entryPrice,className:`w-full flex items-center justify-center gap-2 px-6 py-3 
216                       bg-gradient-to-r from-green-600 to-emerald-600 
217                       hover:from-green-500 hover:to-emerald-500
218                       disabled:from-slate-700 disabled:to-slate-700 disabled:text-slate-500
219                       text-white font-semibold rounded-xl 
220                       transition-all duration-200 shadow-lg hover:shadow-green-500/25
221                       disabled:shadow-none disabled:cursor-not-allowed`,children:h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),(0,e.jsx)("span",{children:"Saving..."})]}):(0,e.jsx)("span",{children:"Log Trade"})})]})]})})}),document.body)}var kl=()=>null,Nl=class extends o.Component{constructor(t){super(t),Ie(this,"handleRetry",()=>{this.setState({hasError:!1,error:null,errorInfo:null,errorCount:0,lastErrorTime:null})}),Ie(this,"handleReload",()=>{window.location.reload()}),Ie(this,"handleNavigateHome",()=>{this.props.navigate?this.props.navigate("/"):window.location.href="/"}),this.state={hasError:!1,error:null,errorInfo:null,errorCount:0,lastErrorTime:null}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,a){const s=Date.now(),{lastErrorTime:n,errorCount:r}=this.state,i=n&&s-n<1e4&&r>=2;this.setState({error:t,errorInfo:a,errorCount:i?r+1:1,lastErrorTime:s}),console.error("Error Boundary caught an error:",{error:t.message,stack:t.stack,componentStack:a.componentStack,errorCount:r+1,isErrorLoop:i,componentName:this.props.componentName||"Unknown",timestamp:new Date().toISOString()}),xr(t,{componentStack:a.componentStack,errorCount:r+1,isErrorLoop:i,componentName:this.props.componentName||"Unknown"})}render(){if(this.state.hasError){const{error:t,errorInfo:a,errorCount:s}=this.state,{componentName:n="Component",theme:r="dark",showDetails:i=!1,customFallback:c}=this.props;return c?c({error:t,errorInfo:a,errorCount:s,onRetry:this.handleRetry,onReload:this.handleReload,onNavigateHome:this.handleNavigateHome}):s>=3?(0,e.jsx)("div",{className:`min-h-[400px] flex items-center justify-center p-6 ${r==="dark"?"bg-gray-900":"bg-gray-50"}`,children:(0,e.jsxs)("div",{className:`max-w-xl w-full p-8 rounded-xl border-2 ${r==="dark"?"bg-red-950/30 border-red-500/50":"bg-red-50 border-red-300"}`,children:[(0,e.jsxs)("div",{className:`flex items-center mb-4 ${r==="dark"?"text-red-400":"text-red-600"}`,children:[(0,e.jsx)(ka,{className:"text-3xl mr-3"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-bold",children:"Critical Error Detected"}),(0,e.jsxs)("p",{className:"text-sm opacity-80",children:["Error loop in ",n]})]})]}),(0,e.jsxs)("p",{className:`mb-6 ${r==="dark"?"text-gray-300":"text-gray-700"}`,children:["This component has encountered ",s," consecutive errors. To prevent infinite loops, automatic retry has been disabled."]}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,e.jsxs)("button",{onClick:this.handleNavigateHome,className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-colors ${r==="dark"?"bg-blue-600 hover:bg-blue-500 text-white":"bg-blue-500 hover:bg-blue-600 text-white"}`,children:[(0,e.jsx)(va,{})," Go to Dashboard"]}),(0,e.jsxs)("button",{onClick:this.handleReload,className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-colors ${r==="dark"?"bg-gray-700 hover:bg-gray-600 text-white":"bg-gray-200 hover:bg-gray-300 text-gray-800"}`,children:[(0,e.jsx)(ja,{})," Reload App"]})]})]})}):(0,e.jsx)("div",{className:`min-h-[400px] flex items-center justify-center p-6 ${r==="dark"?"bg-gray-900":"bg-gray-50"}`,children:(0,e.jsxs)("div",{className:`max-w-xl w-full p-8 rounded-xl border ${r==="dark"?"bg-gray-800/50 border-gray-700/50":"bg-white border-gray-200"}`,children:[(0,e.jsxs)("div",{className:`flex items-center mb-4 ${r==="dark"?"text-yellow-400":"text-yellow-600"}`,children:[(0,e.jsx)(ka,{className:"text-2xl mr-3"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-bold",children:"Something Went Wrong"}),(0,e.jsxs)("p",{className:"text-sm opacity-80",children:[n," encountered an error"]})]})]}),(0,e.jsx)("p",{className:`mb-6 ${r==="dark"?"text-gray-300":"text-gray-700"}`,children:"We're sorry for the inconvenience. You can try again or navigate to another section."}),i&&t&&(0,e.jsxs)("details",{className:`mb-6 p-4 rounded-lg border ${r==="dark"?"bg-gray-900/50 border-gray-700":"bg-gray-50 border-gray-200"}`,children:[(0,e.jsx)("summary",{className:"cursor-pointer font-medium text-sm mb-2",children:"Error Details (Development Mode)"}),(0,e.jsxs)("div",{className:"text-xs font-mono space-y-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:"Error:"}),(0,e.jsx)("pre",{className:`mt-1 p-2 rounded overflow-x-auto ${r==="dark"?"bg-gray-950":"bg-white"}`,children:t.toString()})]}),a&&a.componentStack&&(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:"Component Stack:"}),(0,e.jsx)("pre",{className:`mt-1 p-2 rounded overflow-x-auto max-h-40 ${r==="dark"?"bg-gray-950":"bg-white"}`,children:a.componentStack})]})]})]}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,e.jsxs)("button",{onClick:this.handleRetry,className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-colors ${r==="dark"?"bg-blue-600 hover:bg-blue-500 text-white":"bg-blue-500 hover:bg-blue-600 text-white"}`,children:[(0,e.jsx)(ja,{})," Try Again"]}),(0,e.jsxs)("button",{onClick:this.handleNavigateHome,className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-colors ${r==="dark"?"bg-gray-700 hover:bg-gray-600 text-white":"bg-gray-200 hover:bg-gray-300 text-gray-800"}`,children:[(0,e.jsx)(va,{})," Go to Dashboard"]})]})]})})}return this.props.children}};function B(t){const a=me();return(0,e.jsx)(Nl,{...t,navigate:a})}var Ia=class extends o.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null,errorCount:0,lastErrorTime:null},this.resetError=this.resetError.bind(this),this.handleRetry=this.handleRetry.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){const s=Date.now(),n=this.state.lastErrorTime,r=n&&s-n<5e3?this.state.errorCount+1:1;console.error("🚨 Dashboard Error Boundary caught an error:",{error:t.toString(),errorInfo:a.componentStack,errorCount:r,timestamp:new Date().toISOString(),userAgent:navigator.userAgent,url:window.location.href}),this.setState({error:t,errorInfo:a,errorCount:r,lastErrorTime:s}),this.props.onError&&this.props.onError(t,a),this.logErrorToService(t,a)}logErrorToService(t,a){console.log("📊 Error would be sent to monitoring service:",{message:t.message,stack:t.stack,componentStack:a.componentStack,timestamp:new Date().toISOString()})}resetError(){this.setState({hasError:!1,error:null,errorInfo:null,errorCount:0,lastErrorTime:null})}handleRetry(){this.resetError()}
221render(){if(this.state.hasError){const{error:t,errorInfo:a,errorCount:s}=this.state,{navigate:n,theme:r="dark"}=this.props,i=s>3;return(0,e.jsx)("div",{className:`min-h-screen flex items-center justify-center p-6 ${r==="dark"?"bg-gray-900":"bg-gray-50"}`,children:(0,e.jsxs)("div",{className:`max-w-2xl w-full rounded-2xl shadow-2xl overflow-hidden ${r==="dark"?"bg-gray-800":"bg-white"}`,children:[(0,e.jsx)("div",{className:`p-6 border-b ${r==="dark"?"bg-red-900/20 border-red-800/50":"bg-red-50 border-red-200"}`,children:(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:`w-12 h-12 rounded-full flex items-center justify-center ${r==="dark"?"bg-red-900/50":"bg-red-100"}`,children:(0,e.jsx)(rt,{className:`w-6 h-6 ${r==="dark"?"text-red-400":"text-red-600"}`})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:`text-xl font-bold ${r==="dark"?"text-white":"text-gray-900"}`,children:i?"Persistent Dashboard Error":"Dashboard Temporarily Unavailable"}),(0,e.jsx)("p",{className:`text-sm ${r==="dark"?"text-gray-400":"text-gray-600"}`,children:i?"Multiple errors detected - please try alternative navigation":"We encountered an issue loading the dashboard"})]})]})}),!1,(0,e.jsxs)("div",{className:"p-6",children:[(0,e.jsxs)("div",{className:`mb-6 ${r==="dark"?"text-gray-300":"text-gray-700"}`,children:[(0,e.jsx)("h3",{className:"font-semibold mb-2",children:"What you can do:"}),(0,e.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,e.jsxs)("li",{className:"flex items-start gap-2",children:[(0,e.jsx)("span",{className:"mt-1",children:"•"}),(0,e.jsx)("span",{children:"Try refreshing the dashboard using the button below"})]}),(0,e.jsxs)("li",{className:"flex items-start gap-2",children:[(0,e.jsx)("span",{className:"mt-1",children:"•"}),(0,e.jsx)("span",{children:"Navigate to other sections like Trade Logger or Analytics"})]}),(0,e.jsxs)("li",{className:"flex items-start gap-2",children:[(0,e.jsx)("span",{className:"mt-1",children:"•"}),(0,e.jsx)("span",{children:"Check your internet connection"})]}),(0,e.jsxs)("li",{className:"flex items-start gap-2",children:[(0,e.jsx)("span",{className:"mt-1",children:"•"}),(0,e.jsx)("span",{children:"Clear your browser cache and reload"})]})]})]}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[!i&&(0,e.jsxs)("button",{onClick:this.handleRetry,className:`flex-1 flex items-center justify-center gap-2 px-6 py-3 rounded-lg font-semibold transition-all ${r==="dark"?"bg-blue-600 hover:bg-blue-700 text-white":"bg-blue-500 hover:bg-blue-600 text-white"}`,children:[(0,e.jsx)(Qs,{className:"w-5 h-5"}),(0,e.jsx)("span",{children:"Try Again"})]}),(0,e.jsxs)("button",{onClick:()=>n&&n("/trade-logger"),className:`flex-1 flex items-center justify-center gap-2 px-6 py-3 rounded-lg font-semibold transition-all ${r==="dark"?"bg-gray-700 hover:bg-gray-600 text-white":"bg-gray-200 hover:bg-gray-300 text-gray-900"}`,children:[(0,e.jsx)(Rt,{className:"w-5 h-5"}),(0,e.jsx)("span",{children:"Trade Logger"})]}),(0,e.jsxs)("button",{onClick:()=>{this.resetError(),n&&n("/trade-analytics")},className:`flex-1 flex items-center justify-center gap-2 px-6 py-3 rounded-lg font-semibold transition-all ${r==="dark"?"bg-gray-700 hover:bg-gray-600 text-white":"bg-gray-200 hover:bg-gray-300 text-gray-900"}`,children:[(0,e.jsx)(ms,{className:"w-5 h-5"}),(0,e.jsx)("span",{children:"Analytics"})]})]}),(0,e.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-700",children:(0,e.jsx)("button",{onClick:()=>window.location.reload(),className:`w-full px-6 py-2 rounded-lg text-sm font-medium transition-all ${r==="dark"?"bg-gray-900 hover:bg-gray-800 text-gray-300":"bg-gray-100 hover:bg-gray-200 text-gray-700"}`,children:"Reload Entire Application"})})]}),(0,e.jsx)("div",{className:`px-6 py-4 text-xs text-center ${r==="dark"?"bg-gray-900 text-gray-500":"bg-gray-50 text-gray-600"}`,children:"If the problem persists, please contact support or check the console for details."})]})})}return this.props.children}};function ke({children:t,className:a="",delay:s=0}){return(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.5,delay:s},className:`group relative ${a}`,children:[(0,e.jsx)("div",{className:"absolute -inset-[1px] rounded-2xl bg-gradient-to-r from-blue-500/20 via-purple-500/20 to-pink-500/20 opacity-0 group-hover:opacity-100 blur-sm transition-opacity duration-500"}),(0,e.jsx)("div",{className:"relative rounded-2xl border border-white/[0.06] bg-white/[0.02] backdrop-blur-xl p-6 h-full transition-all duration-300 group-hover:border-white/[0.12] group-hover:bg-white/[0.04]",children:t})]})}function Sl({children:t,className:a=""}){return(0,e.jsxs)("div",{className:`relative overflow-hidden rounded-2xl ${a}`,children:[(0,e.jsx)("div",{className:"beam-border absolute inset-0 rounded-2xl"}),(0,e.jsx)("div",{className:"relative rounded-2xl border border-white/[0.06] bg-black/60 backdrop-blur-xl p-8",children:t})]})}function be({children:t,variant:a="default"}){const s={default:"bg-white/[0.06] text-white/60 border-white/[0.08]",green:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",blue:"bg-blue-500/10 text-blue-400 border-blue-500/20",purple:"bg-purple-500/10 text-purple-400 border-purple-500/20",red:"bg-red-500/10 text-red-400 border-red-500/20",orange:"bg-orange-500/10 text-orange-400 border-orange-500/20",emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",pink:"bg-pink-500/10 text-pink-400 border-pink-500/20"};return(0,e.jsx)("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${s[a]||s.default}`,children:t})}function $s({children:t,color:a="blue"}){const s={blue:"from-blue-500/20 to-blue-600/5 text-blue-400 shadow-blue-500/10",purple:"from-purple-500/20 to-purple-600/5 text-purple-400 shadow-purple-500/10",emerald:"from-emerald-500/20 to-emerald-600/5 text-emerald-400 shadow-emerald-500/10",orange:"from-orange-500/20 to-orange-600/5 text-orange-400 shadow-orange-500/10",red:"from-red-500/20 to-red-600/5 text-red-400 shadow-red-500/10",pink:"from-pink-500/20 to-pink-600/5 text-pink-400 shadow-pink-500/10"};return(0,e.jsx)("div",{className:`w-10 h-10 rounded-xl bg-gradient-to-b ${s[a]||s.blue} flex items-center justify-center text-lg shadow-lg`,children:t})}function xe({badge:t,badgeVariant:a,title:s,subtitle:n,children:r}){return(0,e.jsxs)(f.div,{className:"text-center mb-16",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[t&&(0,e.jsx)(be,{variant:a,children:t}),(0,e.jsx)("h2",{className:"text-3xl sm:text-4xl font-bold mt-4 mb-4",children:s}),n&&(0,e.jsx)("p",{className:"text-white/40 max-w-xl mx-auto",children:n}),r]})}
221var Cl=[{id:"signal",icon:"📡",name:"Signal Agent",tagline:"Spots setups in your style",color:"blue",ring:"border-blue-500/30",glow:"bg-blue-500/[0.06]",accent:"text-blue-400",badge:"border-blue-500/30 bg-blue-500/10 text-blue-400",dotBg:"bg-blue-500",description:"Trained on your personal trading fingerprint — your best patterns, timeframes, and setups — the Signal Agent surfaces opportunities that match YOUR edge, not generic stock picks.",capabilities:["Analyzes your last 90 days of trades to map your patterns","Watches your live watchlist for pattern matches in real time","Flags setups before they trigger so you can prepare, not react","Learns from every trade you take and adjusts its filter"],sample:`"Based on your 67% win rate on morning breakouts above VWAP, NVDA's 9:45 consolidation looks like your A+ setup. Vol at 1.8× avg. Risk $240, target $720."`},{id:"execution",icon:"⚡",name:"Execution Agent",tagline:"Live data · Paper trades · Precision entries",color:"emerald",ring:"border-violet-500/30",glow:"bg-violet-500/[0.06]",accent:"text-violet-400",badge:"border-violet-500/30 bg-violet-500/10 text-violet-400",dotBg:"bg-violet-500",description:"Your real-time trade desk. Pulls live Schwab market data on your entire watchlist, plans and tracks paper trades, reviews your entries after the fact, and optimizes position sizing.",capabilities:["Live quotes, bid/ask, volume, and news for your watchlist","Plans paper trades with entry, stop, target, and R-ratio","Reviews any trade you took: was entry optimal? Where did you leave money?","Calculates correct position size based on your risk % and account size"],sample:`"Your stop was 12 cents too wide on AAPL — that turned a 2.3R trade into 1.6R. Here's where the structural stop should have been, and what sizing that implies."`},{id:"coach",icon:"🧠",name:"Coach Agent",tagline:"Builds your mental edge",color:"amber",ring:"border-amber-500/30",glow:"bg-amber-500/[0.06]",accent:"text-amber-400",badge:"border-amber-500/30 bg-amber-500/10 text-amber-400",dotBg:"bg-amber-500",description:"A 29-year trading veteran distilled into an always-on behavioral coach. Identifies the psychological patterns costing you money — revenge trading, FOMO, overtrading — and gives you a concrete plan.",capabilities:["Reads your trade log to identify repeat behavioral mistakes","Detects if you are currently in a losing streak and intervenes","Provides structured mindset resets before and after tough sessions","Tracks your consistency score and discipline grade over time"],sample:`"You've entered 6 trades in the last 90 minutes — all losers. This is your classic revenge pattern. Close the platform for 45 minutes. Here's your reset protocol."`}],_a=[{step:1,icon:"🔗",label:"Connect your broker",detail:"Link MT4/MT5, Schwab, or any prop firm in under 60 seconds. Your live trades, account stats, and P&L flow in automatically.",color:"blue"},{step:2,icon:"🧬",label:"Your fingerprint is built",detail:"The platform analyses every trade you've ever taken — win rates by setup, time of day, risk patterns, behavioral tendencies — and builds your personal trading DNA.",color:"emerald"},{step:3,icon:"🤖",label:"Agents go to work",detail:"All three agents run 24/7 in the background. They read your fingerprint, live market data, and community intel to stay context-aware and ready to respond instantly.",color:"emerald"},{step:4,icon:"📈",label:"You trade smarter",detail:"Ask any question, get a chart reviewed, request a paper trade, or check your discipline score. The agents remember every conversation and keep improving.",color:"amber"}],Tl=[{icon:"🏦",label:"Live Schwab API",desc:"Real-time market data, not delayed"},{icon:"🧠",label:"Claude AI (Anthropic)",desc:"Industry-leading reasoning model"},{icon:"📰",label:"Live news intelligence",desc:"MarketAux + multi-source aggregation"},{icon:"🔐",label:"Zero data sharing",desc:"Your trades never leave your account"},{icon:"⚡",label:"Sub-2s responses",desc:"Always-on, never a wait screen"},{icon:"🌐",label:"Works on any device",desc:"Mobile-first, full desktop power"}],Pa={blue:{border:"border-blue-500/30",bg:"bg-blue-500/10",text:"text-blue-400",num:"bg-blue-600"},violet:{border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400",num:"bg-violet-600"},emerald:{border:"border-emerald-500/30",bg:"bg-emerald-500/10",text:"text-emerald-400",num:"bg-emerald-600"},amber:{border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400",num:"bg-
221amber-600"}};function Rl({agent:t,index:a}){const[s,n]=(0,o.useState)(!1);return(0,e.jsxs)(f.div,{initial:{opacity:0,y:28},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.55,delay:a*.12},className:`relative rounded-2xl border ${t.ring} ${t.glow} p-6 flex flex-col gap-4 cursor-pointer hover:border-opacity-60 transition-all duration-300`,onClick:()=>n(r=>!r),children:[(0,e.jsx)("div",{className:`absolute -top-8 -right-8 w-40 h-40 ${t.glow} rounded-full blur-3xl pointer-events-none`}),(0,e.jsxs)("div",{className:"flex items-start gap-4 relative",children:[(0,e.jsx)("div",{className:`w-12 h-12 rounded-2xl border ${t.ring} flex items-center justify-center text-2xl flex-shrink-0`,children:t.icon}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,e.jsx)("h3",{className:"text-base font-bold text-white",children:t.name}),(0,e.jsx)("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full border ${t.badge}`,children:"AI Agent"})]}),(0,e.jsx)("p",{className:`text-xs font-medium mt-0.5 ${t.accent}`,children:t.tagline})]}),(0,e.jsx)("svg",{className:`w-4 h-4 text-white/30 flex-shrink-0 mt-1 transition-transform duration-200 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]}),(0,e.jsx)("p",{className:"text-sm text-white/55 leading-relaxed relative",children:t.description}),(0,e.jsx)("ul",{className:`flex flex-col gap-2 relative overflow-hidden transition-all duration-300 ${s?"max-h-96":"max-h-0 sm:max-h-96"}`,children:t.capabilities.map(r=>(0,e.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,e.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${t.dotBg} mt-1.5 flex-shrink-0`}),(0,e.jsx)("span",{className:"text-xs text-white/55 leading-snug",children:r})]},r))}),(0,e.jsxs)("div",{className:`relative rounded-xl border ${t.ring} bg-black/30 p-3`,children:[(0,e.jsx)("p",{className:"text-[10px] text-white/30 uppercase tracking-widest font-semibold mb-1.5",children:"Sample response"}),(0,e.jsx)("p",{className:`text-xs ${t.accent} leading-relaxed italic`,children:t.sample})]}),(0,e.jsx)("p",{className:"text-[10px] text-white/20 text-right sm:hidden",children:s?"Tap to collapse":"Tap to see capabilities"})]})}function El(){return(0,e.jsxs)("section",{className:"relative z-10 px-6 py-24 overflow-hidden",id:"ai-agents",children:[(0,e.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[900px] h-[500px] bg-gradient-to-b from-blue-600/[0.04] via-violet-600/[0.03] to-transparent rounded-full blur-[160px] pointer-events-none"}),(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"AI Trading Agents",badgeVariant:"blue",title:(0,e.jsxs)(e.Fragment,{children:["Three agents. One system. ",(0,e.jsx)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-violet-400 to-amber-400",children:"All trained on you."})]}),subtitle:"Signal, Execution, and Coach read the same behavioral layer: your trades, rules, violations, best setups, worst habits, live market data, and current session state."}),(0,e.jsx)(f.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.1},className:"mt-10 mb-16 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:Tl.map(t=>(0,e.jsxs)("div",{className:"flex flex-col items-center text-center gap-1 px-3 py-3 rounded-xl border border-white/[0.06] bg-white/[0.02]",children:[(0,e.jsx)("span",{className:"text-lg",children:t.icon}),(0,e.jsx)("p",{className:"text-[11px] font-semibold text-white/80 leading-tight",children:t.label}),(0,e.jsx)("p",{className:"text-[10px] text-white/35 leading-tight",children:t.desc})]},t.label))}),(0,e.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5 mb-20",children:Cl.map((t,a)=>(0,e.jsx)(Rl,{agent:t,index:a},t.id))}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"mb-20",children:[(0,e.jsx)("p",{className:"text-center text-xs text-white/30 uppercase tracking-widest font-medium mb-8",children:"How it works — from signup to smarter trading"}),(0,e.jsxs)("div",{className:"hidden sm:grid grid-cols-4 gap-4 relative",children:[(0,e.jsx)("div",{className:"absolute top-7 left-[12.5%] right-[12.5%] h-px bg-gradient-to-r from-blue-500/20 via-violet-500/20 to-amber-500/20 pointer-events-none"}),_a.map(t=>{const a=Pa[t.color];return(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:t.step*.1},className:"flex flex-col items-center text-center gap-3",children:[(0,e.jsxs)("div",{className:`relative w-14 h-14 roun
221ded-2xl border ${a.border} ${a.bg} flex items-center justify-center text-2xl`,children:[t.icon,(0,e.jsx)("span",{className:`absolute -top-2 -right-2 w-5 h-5 rounded-full ${a.num} flex items-center justify-center text-[9px] font-bold text-white`,children:t.step})]}),(0,e.jsx)("p",{className:`text-sm font-semibold ${a.text}`,children:t.label}),(0,e.jsx)("p",{className:"text-[11px] text-white/40 leading-relaxed",children:t.detail})]},t.step)})]}),(0,e.jsx)("div",{className:"flex flex-col gap-4 sm:hidden",children:_a.map(t=>{const a=Pa[t.color];return(0,e.jsxs)(f.div,{initial:{opacity:0,x:-16},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{delay:t.step*.08},className:`flex items-start gap-4 p-4 rounded-xl border ${a.border} ${a.bg}`,children:[(0,e.jsxs)("div",{className:`relative w-12 h-12 rounded-xl border ${a.border} flex items-center justify-center text-xl flex-shrink-0`,children:[t.icon,(0,e.jsx)("span",{className:`absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full ${a.num} flex items-center justify-center text-[9px] font-bold text-white`,children:t.step})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:`text-sm font-semibold ${a.text} mb-1`,children:t.label}),(0,e.jsx)("p",{className:"text-xs text-white/45 leading-relaxed",children:t.detail})]})]},t.step)})})]}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"relative overflow-hidden rounded-2xl border border-white/[0.08] bg-gradient-to-br from-[#0e0f18] via-[#0c0e14] to-[#0a0b12] p-8",children:[(0,e.jsx)("div",{className:"absolute -top-16 -left-16 w-64 h-64 bg-blue-600/[0.06] rounded-full blur-3xl pointer-events-none"}),(0,e.jsx)("div",{className:"absolute -bottom-16 -right-16 w-64 h-64 bg-amber-500/[0.05] rounded-full blur-3xl pointer-events-none"}),(0,e.jsxs)("div",{className:"relative flex flex-col lg:flex-row items-center gap-8 justify-between",children:[(0,e.jsxs)("div",{className:"flex-1 text-center lg:text-left",children:[(0,e.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 mb-4",children:[(0,e.jsx)("span",{className:"text-emerald-400 text-xs font-semibold",children:"Agent Council Mode"}),(0,e.jsx)("span",{className:"text-[10px] text-emerald-400/60 bg-emerald-500/20 px-1.5 py-0.5 rounded-full font-medium",children:"New"})]}),(0,e.jsxs)("h3",{className:"text-2xl font-bold text-white mb-3",children:["Ask all three agents at once — ",(0,e.jsx)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-emerald-300",children:"get a unified verdict"})]}),(0,e.jsx)("p",{className:"text-sm text-white/50 leading-relaxed max-w-lg",children:"Council Mode sends your question to all three agents simultaneously. The Signal Agent reads the chart, the Execution Agent plans the trade, and the Coach Agent checks your psychology — then all three respond in sequence so you see every angle before you pull the trigger."})]}),(0,e.jsx)("div",{className:"flex flex-col gap-2 flex-shrink-0 w-full lg:w-72",children:[{icon:"📡",name:"Signal Agent",color:"text-blue-400",ring:"border-blue-500/30",bg:"bg-blue-500/[0.06]",msg:'"Pattern match confirmed. 68% historical win rate on this setup."'},{icon:"⚡",name:"Execution Agent",color:"text-violet-400",ring:"border-violet-500/30",bg:"bg-violet-500/[0.06]",msg:'"Entry: $182.40, Stop: $180.80, Target: $186.20. R-ratio: 2.4."'},{icon:"🧠",name:"Coach Agent",color:"text-amber-400",ring:"border-amber-500/30",bg:"bg-amber-500/[0.06]",msg:`"You're 2/3 on the week. This fits your plan. Trust the process."`}].map(t=>(0,e.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-xl border ${t.ring} ${t.bg}`,children:[(0,e.jsx)("span",{className:"text-base flex-shrink-0",children:t.icon}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:`text-[10px] font-bold ${t.color} mb-0.5`,children:t.name}),(0,e.jsx)("p",{className:"text-[11px] text-white/55 leading-snug italic",children:t.msg})]})]},t.name))})]}),(0,e.jsxs)("div",{className:"relative mt-6 flex flex-col sm:flex-row items-center gap-3 justify-center lg:justify-start",children:[(0,e.jsxs)(q,{to:"/signup",className:"inline-flex items-center gap-2 px-6 py-3 rounded-xl text-sm font-semibold text-white transition-all hover:opacity-90",style:{background:"#da0b3f",boxShadow:"0 8px 20px rgba(218,11,63,.3)"},children:["Get started — meet your agents",(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"})})]}),(0,e.jsx)("p",{className:"text-[11px] text-white/30",children:"Works on any broker · Cancel anytime"})]})]}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"mt-6",children:[(0,e.jsxs)("div",{className:"text-center mb-6",children:[(0,e.jsx)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-sky-500/30 bg-sky-500/10 mb-3",children:(0,e.jsx)("span",{className:"text-sky-400 text-xs font-semibold",children:"Two modes. Same intelligence layer."})}),(0,e.jsxs)("h3",{className:"text-2xl font-bold text-white",children:["The Signal Agent works ",(0,e.jsx)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-sky-400",children:"two ways"})]}),(0,e.jsx)("p",{className:"text-sm text-white/50 mt-2 max-w-2xl mx-auto leading-relaxed",children:"Run on autopilot every 30 minutes — or pull it up the moment you spot a ticker. Same Claude-powered brain, two completely different products."})]}),(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-blue-500/20 bg-gradient-to-br from-blue-500/[0.06] via-[#0c0e14] to-[#0a0b12] p-6",children:[(0,e.jsx)("div",{className:"absolute -top-12 -right-12 w-48 h-48 bg-blue-600/[0.08] rounded-full blur-3xl pointer-events-none"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,e.jsx)("span",{className:"text-lg",children:"🤖"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-widest",children:"Pipeline Mode"}),(0,e.jsx)("span",{className:"text-[10px] text-blue-300/70 bg-blue-500/15 px-2 py-0.5 rounded-full",children:"Auto · 30 min"})]}),(0,e.jsx)("h4",{className:"text-lg font-bold text-white mb-2",children:"Autonomous Signal → Execution → Coach"}),(0,e.jsx)("p",{className:"text-xs text-white/55 leading-relaxed mb-4",children:"The Signal Agent scans your watchlist, fingerprint, and live news every 30 minutes, generates a structured trade signal, the Execution Agent reviews against your open positions and sectors, then drops it into your paper account with bracket orders. Coach reviews every fill."}),(0,e.jsxs)("ul",{className:"space-y-1.5 text-[11px] text-white/45",children:[(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-blue-400",children:"▸"})," Hands-free signals every 30 min"]}),(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-blue-400",children:"▸"})," Auto paper-trade with stop + target"]}),(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-blue-400",children:"▸"})," Coach review on every trade"]})]})]})]}),(0,e.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-violet-500/20 bg-gradient-to-br from-violet-500/[0.06] via-[#0c0e14] to-[#0a0b12] p-6",children:[(0,e.jsx)("div",{className:"absolute -top-12 -right-12 w-48 h-48 bg-violet-600/[0.08] rounded-full blur-3xl pointer-events-none"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,e.jsx)("span",{className:"text-lg",children:"⚡"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-violet-400 uppercase tracking-widest",children:"On-Demand Mode"}),(0,e.jsx)("span",{className:"text-[10px] text-violet-300/70 bg-vi
221olet-500/15 px-2 py-0.5 rounded-full",children:"Instant"})]}),(0,e.jsx)("h4",{className:"text-lg font-bold text-white mb-2",children:"Search a ticker. Get instant Claude analysis."}),(0,e.jsx)("p",{className:"text-xs text-white/55 leading-relaxed mb-4",children:"Tap any symbol on the Market or News page and a full AI analysis modal opens — sentiment, action bias, confidence score, key risks, near-term outlook — plus a chat interface to dig deeper. Real-time quotes, real-time news, real-time reasoning."}),(0,e.jsxs)("ul",{className:"space-y-1.5 text-[11px] text-white/45",children:[(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-violet-400",children:"▸"})," Instant ticker analysis (any symbol)"]}),(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-violet-400",children:"▸"})," Tiered confidence score (red→amber→green)"]}),(0,e.jsxs)("li",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-violet-400",children:"▸"})," Follow-up chat — ask anything"]})]})]})]})]}),(0,e.jsx)("p",{className:"text-[11px] text-white/30 text-center mt-4",children:"One intelligence layer. Two complete products. Both included in every paid tier."})]})]})]})}function Kt({src:t,glow:a="#e84040",alt:s="App screen",style:n={}}){const r=typeof n.width=="number"?n.width:280,i=r/280,c=574*i;return(0,e.jsxs)("div",{style:{position:"relative",flexShrink:0,...n,width:r},children:[(0,e.jsxs)("div",{style:{width:r,height:c,background:"#0a0a0f",borderRadius:40*i,border:"2px solid rgba(255,255,255,0.12)",overflow:"hidden",position:"relative",boxShadow:"0 0 0 1px rgba(0,0,0,.8), 0 40px 80px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.04)"},children:[(0,e.jsx)("div",{style:{position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:100*i,height:28*i,background:"#0a0a0f",borderRadius:`0 0 ${20*i}px ${20*i}px`,zIndex:10}}),(0,e.jsx)("img",{src:t,alt:s,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top center",display:"block"}}),(0,e.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 40%)",pointerEvents:"none",zIndex:5}})]}),(0,e.jsx)("div",{style:{position:"absolute",bottom:-60*i,left:"50%",transform:"translateX(-50%)",width:200*i,height:120*i,background:a,filter:"blur(50px)",pointerEvents:"none",zIndex:-1,opacity:.6,transition:"background 0.5s ease"}})]})}function Al({to:t,children:a}){const[s,n]=(0,o.useState)({x:0,y:0}),r=(0,o.useMemo)(()=>Array.from({length:10},(i,c)=>c),[]);return(0,e.jsxs)(f.div,{className:"relative inline-flex",onMouseMove:i=>{const c=i.currentTarget.getBoundingClientRect();n({x:(i.clientX-c.left-c.width/2)*.16,y:(i.clientY-c.top-c.height/2)*.16})},onMouseLeave:()=>n({x:0,y:0}),animate:{x:s.x,y:s.y},transition:{type:"spring",stiffness:160,damping:18,mass:.35},children:[r.map(i=>(0,e.jsx)(f.span,{className:"pointer-events-none absolute h-1 w-1 rounded-full bg-white/70",style:{left:`${8+i*17%84}%`,top:`${12+i*23%72}%`},animate:{opacity:[0,.65,0],scale:[.4,1,.4],x:[0,(i%2?1:-1)*(10+i)],y:[0,(i%3?-1:1)*(8+i)]},transition:{duration:2.2+i*.06,repeat:1/0,delay:i*.12,ease:"easeInOut"}},i)),(0,e.jsxs)(q,{to:t,className:"group relative inline-flex items-center gap-2 overflow-hidden rounded-2xl border border-white/15 bg-[#f3f4f6] px-7 py-4 text-sm font-bold text-[#08090d] shadow-[0_20px_60px_rgba(210,218,230,0.22)] transition hover:border-white/30",children:[(0,e.jsx)("span",{className:"absolute inset-0 translate-x-[-110%] bg-gradient-to-r from-transparent via-white/70 to-transparent transition-transform duration-700 group-hover:translate-x-[110%]"}),(0,e.jsx)("span",{className:"relative",children:a}),(0,e.jsx)(nt,{className:"relative h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})]})}function yt({className:t="",children:a,delay:s=0}){return(0,e.jsxs)(f.div,{className:`absolute overflow-hidden rounded-[24px] border border-white/[0.12] bg-[#0c0f14]/85 shadow-[0_30px_90px_rgba(0,0,0,0.52)] backdrop-blur-xl ${t}`,initial:{opacity:0,y:24,scale:.96}
221,animate:{opacity:1,y:0,scale:1},transition:{duration:.7,delay:s,ease:[.22,1,.36,1]},children:[(0,e.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/50 to-transparent"}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(135deg,rgba(255,255,255,0.10),transparent_32%,rgba(255,255,255,0.04)_68%,transparent)]"}),a]})}function La({src:t,alt:a,className:s="",imageClassName:n="",delay:r=0}){return(0,e.jsx)(yt,{className:`p-2 ${s}`,delay:r,children:(0,e.jsx)("img",{src:t,alt:a,className:`relative h-full w-full rounded-[18px] object-cover ${n}`})})}var Ma=[{label:"Technical Analysis",file:"technical-analysis.pdf"},{label:"Candlestick Execution",file:"candlestick-execution.pdf"},{label:"Complete Trading Plan",file:"complete-trading-plan.pdf"},{label:"Daily Coaching",file:"daily-coaching.pdf"},{label:"Mental Game",file:"mental-game.pdf"},{label:"Trading Psychology",file:"trading-psychology.pdf"},{label:"Supply & Demand Zones",file:"supply-demand-zones.pdf"},{label:"Options Fundamentals",file:"options-fundamentals.pdf"}];async function Il(t,a){try{const s=await fetch(t);if(!s.ok)throw new Error(`HTTP ${s.status}`);const n=await s.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=a,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),1500)}catch{window.open(t,"_blank","noopener,noreferrer")}}function _l({guide:t,onClose:a,t:s}){const n=()=>{window.open(t.url,"_blank","noopener,noreferrer"),a()},r=async()=>{await Il(t.url,t.filename),a()};return(0,e.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":s("landingHero.guideDialogLabel",{label:t.label}),onClick:a,className:"fixed inset-0 z-[120] flex items-end justify-center bg-black/70 p-0 backdrop-blur-sm sm:items-center sm:p-4",children:(0,e.jsxs)("div",{onClick:i=>i.stopPropagation(),className:"w-full max-w-sm rounded-t-3xl border border-white/10 bg-[#11141a] p-5 shadow-[0_-20px_60px_rgba(0,0,0,0.5)] sm:rounded-3xl",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 20px)"},children:[(0,e.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"text-[9px] font-bold uppercase tracking-wide text-[#ff9a8e]",children:s("landingHero.fieldLibrary")}),(0,e.jsx)("h3",{className:"mt-1 truncate text-base font-black text-white",children:t.label}),(0,e.jsx)("p",{className:"mt-0.5 text-[11px] text-white/40",children:s("landingHero.freePdfNoEmail")})]}),(0,e.jsx)("button",{type:"button",onClick:a,"aria-label":s("landingHero.close"),className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full border border-white/10 bg-white/[0.06] text-white/60 transition-colors hover:bg-white/10 hover:text-white",children:(0,e.jsx)(Ke,{className:"h-4 w-4"})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,e.jsxs)("button",{type:"button",onClick:n,className:"inline-flex items-center justify-center gap-2 rounded-2xl border border-white/[0.12] bg-white/[0.05] px-4 py-3.5 text-sm font-bold text-white transition-all hover:border-white/25 hover:bg-white/[0.09]",children:[(0,e.jsx)(Wr,{className:"h-4 w-4"}),s("landingHero.openNewTab")]}),(0,e.jsxs)("button",{type:"button",onClick:r,className:"inline-flex items-center justify-center gap-2 rounded-2xl border border-[#ff5a46]/40 bg-[#ff5a46]/15 px-4 py-3.5 text-sm font-bold text-white transition-all hover:border-[#ff5a46]/70 hover:bg-[#ff5a46]/25",children:[(0,e.jsx)(ls,{className:"h-4 w-4"}),s("landingHero.downloadPdf")]})]})]})})}function Da({icon:t,label:a,value:s,tone:n}){return(0,e.jsxs)("div",{className:"rounded-2xl border border-white/[0.08] bg-white/[0.035] p-4",children:[(0,e.jsx)("div",{className:"mb-3 flex h-9 w-9 items-center justify-center rounded-xl border border-white/10",style:{color:n},children:(0,e.jsx)(t,{className:"h-4 w-4"})}),(0,e.jsx)("div",{className:"text-[11px] font-semibold uppercase text-white/35",children:a}),(0,e.jsx)("div",{className:"mt-1 text-2xl font-black text-white",children:s})]})}function Pl(){return(0,e.jsxs)(f.div,{className:"relative mx-auto h-[520px] w-full max-w-[620px] lg:h-[660px]",initial:{opacity:0}
221,animate:{opacity:1},transition:{duration:.7,delay:.35},"aria-hidden":"true",children:[(0,e.jsx)(La,{src:"/screens/landing-lockdown-desktop.jpg",alt:"Redline lockdown enforcement on a live trading chart",className:"left-[2%] top-[4%] h-[185px] w-[66%]",imageClassName:"object-left-top",delay:.45}),(0,e.jsxs)(yt,{className:"right-[3%] top-[2%] hidden h-[170px] w-[30%] p-4 sm:block",delay:.55,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-[10px] font-bold uppercase text-white/35",children:"Rules engine"}),(0,e.jsx)("div",{className:"mt-1 text-2xl font-black leading-tight text-white",children:"Trade blocked"})]}),(0,e.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl bg-emerald-400/15 text-emerald-300",children:(0,e.jsx)(ra,{className:"h-5 w-5"})})]}),(0,e.jsx)("div",{className:"mt-5 h-2 rounded-full bg-white/[0.08]",children:(0,e.jsx)(f.div,{className:"h-full rounded-full bg-gradient-to-r from-emerald-300 to-white",initial:{width:"18%"},animate:{width:["18%","76%","42%","88%"]},transition:{duration:7,repeat:1/0,ease:"easeInOut"}})}),(0,e.jsxs)("div",{className:"mt-5 grid grid-cols-3 gap-2 text-center text-[10px] font-semibold uppercase text-white/40",children:[(0,e.jsx)("span",{children:"Plan"}),(0,e.jsx)("span",{children:"Risk"}),(0,e.jsx)("span",{children:"Session"})]})]}),(0,e.jsx)(La,{src:"/screens/landing-analytics-rules.jpg",alt:"Redline analytics what-if rules",className:"bottom-[8%] left-[2%] hidden h-[250px] w-[34%] sm:block",imageClassName:"object-top",delay:.65}),(0,e.jsx)(yt,{className:"bottom-[4%] right-[2%] h-[250px] w-[42%] p-4",delay:.75,children:(0,e.jsxs)("div",{className:"grid grid-cols-1 gap-3",children:[(0,e.jsx)(Da,{icon:Gi,label:"Risk controls",value:"Limits loaded",tone:"#86efac"}),(0,e.jsx)(Da,{icon:Bi,label:"Audit trail",value:"Receipt saved",tone:"#d9e2ec"})]})}),(0,e.jsxs)(yt,{className:"left-[35%] bottom-[2%] hidden h-[132px] w-[28%] p-4 lg:block",delay:.72,children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[10px] font-bold uppercase text-white/35",children:[(0,e.jsx)(zi,{className:"h-3.5 w-3.5 text-[#dfe7f0]"}),"Rooms live"]}),(0,e.jsx)("p",{className:"mt-3 text-xl font-black leading-tight text-white",children:"Market hours. Voice rooms. Real traders."})]}),(0,e.jsx)(f.div,{className:"absolute left-1/2 top-[21%] z-10",style:{marginLeft:-125},initial:{opacity:0,y:30,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{duration:.8,delay:.7,ease:[.22,1,.36,1]},children:(0,e.jsx)(Kt,{src:"/screens/landing-agent-pipeline.jpg",glow:"rgba(215,225,236,0.72)",style:{width:250}})}),(0,e.jsx)(f.div,{className:"absolute right-[11%] top-[40%] z-[9] hidden sm:block",initial:{opacity:0,y:28,scale:.95},animate:{opacity:.82,y:0,scale:.82},transition:{duration:.75,delay:.85,ease:[.22,1,.36,1]},children:(0,e.jsx)(Kt,{src:"/screens/landing-trading-rooms.jpg",glow:"rgba(168,85,247,0.42)",style:{width:206}})})]})}function Ll(){const{t}=ye(),[a,s]=(0,o.useState)(null);return(0,e.jsxs)(e.Fragment,{children:[a&&(0,e.jsx)(_l,{guide:a,onClose:()=>s(null),t}),(0,e.jsx)("div",{className:"relative z-10 flex justify-center px-4",style:{paddingTop:"calc(env(safe-area-inset-top, 0px) + 80px)"},children:(0,e.jsx)(f.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},children:(0,e.jsx)(fo,{})})}),(0,e.jsx)("section",{className:"relative z-10 px-5 pb-20 pt-10 sm:px-6 lg:pb-28",children:(0,e.jsxs)("div",{className:"mx-auto grid max-w-7xl grid-cols-1 items-center gap-12 lg:grid-cols-[0.92fr_1.08fr] lg:gap-8",children:[(0,e.jsxs)("div",{className:"max-w-2xl",children:[(0,e.jsxs)(f.div,{className:"mb-7 inline-flex items-center gap-2 rounded-full border border-white/15 bg-white/[0.055] px-3 py-1.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.12)] backdrop-blur",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.25},children:[(0,e.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,e.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-400"})]}),(0,e.jsx)("span",{className:"text-[11px] font-semibold uppercase text-[#dfe7f0]",children:t("landingHero.marketBadge")})]}),(0,e.jsxs)(f.h1,{className:"mb-7 text-5xl font-black leading-[1.02] tracking-normal text-white sm:text-6xl lg:text-[72px]",initial:{opacity:0,y:20}
221,animate:{opacity:1,y:0},transition:{duration:.7,delay:.3},children:[t("landingHero.headlineBroker"),(0,e.jsx)("br",{}),t("landingHero.headlineExecutes"),(0,e.jsx)("br",{}),(0,e.jsx)("span",{className:"bg-gradient-to-r from-[#ff5a46] via-[#f1f5f9] to-[#71f0a1] bg-clip-text text-transparent",children:t("landingHero.headlineControl")})]}),(0,e.jsx)(f.p,{className:"mb-10 max-w-xl text-lg leading-relaxed text-white/58 sm:text-xl",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,delay:.45},children:t("landingHero.subtitle")}),(0,e.jsxs)(f.div,{className:"mb-6 flex flex-col items-start gap-3 sm:flex-row sm:items-center",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,delay:.6},children:[(0,e.jsx)(Al,{to:"/signup",children:"See last month’s violations — free"}),(0,e.jsxs)("a",{href:"#features",className:"inline-flex items-center gap-2 rounded-2xl border border-white/[0.10] px-7 py-4 text-sm font-semibold text-white/70 transition-all hover:border-white/[0.20] hover:bg-white/[0.04] hover:text-white",children:[(0,e.jsx)(gs,{className:"h-3.5 w-3.5 fill-current"}),t("landingHero.seePlatform")]})]}),(0,e.jsxs)(f.div,{className:"mb-5 grid w-full max-w-2xl grid-cols-1 gap-3 sm:grid-cols-2",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.6,delay:.75},children:[(0,e.jsxs)("button",{type:"button",onClick:()=>s({label:t("landingHero.blueprintTitle"),url:"/redline-trading-blueprint.pdf",filename:"Redline-Trading-Blueprint.pdf"}),className:"group relative min-h-[104px] overflow-hidden rounded-2xl border border-white/[0.12] bg-white/[0.045] p-4 text-left transition-all hover:border-white/25 hover:bg-white/[0.07]",children:[(0,e.jsx)("span",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_20%_0%,rgba(255,255,255,0.12),transparent_34%)]"}),(0,e.jsxs)("span",{className:"relative flex items-start gap-3",children:[(0,e.jsx)("span",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl border border-white/15 bg-white/10 text-[#dfe7f0]",children:(0,e.jsx)(nt,{className:"h-4 w-4 -rotate-45"})}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-col items-start leading-tight",children:[(0,e.jsx)("span",{className:"text-[9px] font-bold uppercase text-white/45",children:t("landingHero.freePdfNoEmail")}),(0,e.jsx)("span",{className:"mt-1 text-sm font-semibold text-white transition-colors group-hover:text-[#e9eef4]",children:t("landingHero.blueprintTitle")}),(0,e.jsx)("span",{className:"mt-2 text-xs leading-relaxed text-white/42",children:t("landingHero.blueprintDescription")})]})]})]}),(0,e.jsxs)("div",{className:"group relative overflow-hidden rounded-2xl border border-[#ff5a46]/35 bg-[#11141a] text-white shadow-[0_22px_70px_rgba(0,0,0,0.35),0_0_42px_rgba(218,11,63,0.10)] transition-all hover:border-[#ff7a66]/55 hover:bg-[#151922]",children:[(0,e.jsx)("span",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_16%_0%,rgba(255,90,70,0.22),transparent_34%),linear-gradient(135deg,rgba(255,255,255,0.08),transparent_42%)]"}),(0,e.jsxs)(q,{to:"/education",className:"relative flex items-start gap-3 p-4",children:[(0,e.jsx)("span",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl border border-white/10 bg-white/[0.08] text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.10)]",children:(0,e.jsx)(eo,{className:"h-4 w-4"})}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-col items-start leading-tight",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-[9px] font-black uppercase text-white/55",children:[(0,e.jsx)(ps,{className:"h-3 w-3 text-[#da0b3f]"}),t("landingHero.educationTag")]}),(0,e.jsx)("span",{className:"mt-1 text-sm font-black text-white",children:t("landingHero.fieldLibrary")}),(0,e.jsx)("span",{className:"mt-2 flex flex-wrap gap-1.5",children:Ma.slice(0,4).map(n=>(0,e.jsx)("span",{className:"rounded-full border border-white/[0.08] bg-white/[0.07] px-2 py-1 text-[9px] font-bold text-white/72",children:n.label},n.label))})]})]}),(0,e.jsxs)("div",{className:"relative border-t border-white/[0.07] px-4 py-3",children:[(0,e.jsx)("p",{className:"mb-2 text-[9px] font-bold uppercase text-white/35",children:t("landingHero.openOrDownload")}),(0,e.jsx)("div",{className:"flex flex-wrap gap-1.5",children:Ma.map(n=>(0,e.jsxs)("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),s({label:n.label,url:`/library/${n.file}`,filename:n.file})},className:"inline-flex items-center gap-1 rounded-full border border-[#ff5a46]/30 bg-[#ff5a46]/10 px-2.5 py-1 text-[9px] font-bold text-[#ff9a8e] transition-all hover:border-[#ff5a46]/60 hover:bg-[#ff5a46]/20 hover:text-white",children:[(0,e.jsx)(ls,{className:"h-2.5 w-2.5"}),n.label]},n.file))})]})]})]}),(0,e.jsx)(f.p,{className:"text-xs text-white/28",initial:{opacity:0}
221,animate:{opacity:1},transition:{duration:.6,delay:.85},children:t("landingHero.platformAvailability")}),(0,e.jsx)(f.div,{className:"mt-10 flex flex-wrap items-center gap-7",initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,delay:.9},children:[["30-day broker sync","Import the trades you already made"],["Free violation report","See which rules you broke and when"],["Upgrade for live enforcement","Pay only when Redline acts in real time"]].map(([n,r])=>(0,e.jsxs)("div",{className:"max-w-[180px] text-left",children:[(0,e.jsx)("div",{className:"text-sm font-extrabold text-white sm:text-base",children:n}),(0,e.jsx)("div",{className:"mt-1 text-[11px] leading-relaxed text-white/38",children:r})]},n))})]}),(0,e.jsx)(Pl,{})]})})]})}var Fa=[{tab:"Today",img:"/screens/screen-today.png",glow:"#10b981",title:"One directive before you trade",body:"Every morning, Redline analyzes your history and surfaces the single most important focus for the session — biggest leak, optimal time, and behavioral context.",chips:["Today's Focus","Discipline Score","Quick Session Start","AI Coaching"]},{tab:"Session Setup",img:"/screens/screen-session.png",glow:"#6366f1",title:"Launch your session in 60 seconds",body:"Choose Conservative, Normal, or Aggressive profiles. Set max trades, risk per trade, and daily loss limits. Redline enforces every parameter automatically.",chips:["Risk Profiles","Max Trades","Max Loss Limit","Session Objective"]},{tab:"Ledger",img:"/screens/screen-ledger.png",glow:"#16c784",title:"Every trade tracked, every metric live",body:"Balance, Total P&L, Win Rate, Profit Factor, Avg R:R, Drawdown — all calculated in real-time, synced from TradeLocker, MT4/MT5, or manually logged.",chips:["Total P&L","Win Rate","Profit Factor","Max Drawdown"]},{tab:"Analytics",img:"/screens/screen-analytics.png",glow:"#3b82f6",title:"Your deterministic trading profile",body:"Trade DNA maps your behavioral patterns across every trade — by setup, session, instrument, and emotional state. See exactly where consistency breaks down.",chips:["Equity Curve","P&L by Setup","Win Rate Trends","Trade DNA"]},{tab:"Trade Detail",img:"/screens/screen-trade.png",glow:"#da0b3f",title:"Full context on every trade",body:"Each trade shows entry, exit, lots, rules followed, and whether it was a clean trade — synced live from TradeLocker. One-tap AI analysis tells you what to improve.",chips:["Rules Followed","Clean Trade","AI Analysis","TradeLocker Synced"]},{tab:"Community",img:"/screens/screen-community.png",glow:"#0ea5e9",title:"Trade insights, not noise",body:"Share recaps, follow mentors, join challenges. The Idea Hub keeps community discussion anchored to actual trade logs — not speculation or hot takes.",chips:["Idea Hub","Trade Recaps","Mentors","Challenges"]},{tab:"TickerX",img:"/screens/screen-chat.png",glow:"#16c784",title:"Market intelligence by ticker",body:"TickerX organizes market discussion by ticker so $SPY stays separate from $XAUUSD. Filter by asset class, join rooms, and get AI-curated sentiment before you trade.",chips:["Ticker Rooms","Market Sentiment","News Intelligence","Trading Rooms"]}];function Ml(){const[t,a]=(0,o.useState)(0),s=Fa[t];return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",id:"features",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"The Platform",badgeVariant:"red",title:"Built for how traders actually break down",subtitle:"Not a journal. Not education. A live OS that monitors, enforces, and remediates — session by session."}),(0,e.jsx)("div",{className:"flex gap-2 flex-wrap mb-12",children:Fa.map((n,r)=>(0,e.jsx)("button",{onClick:()=>a(r),className:`px-4 py-2 rounded-xl text-sm font-semibold border transition-all ${t===r?"text-white border-transparent":"text-white/40 border-white/[0.07] bg-transparent hover:text-white/70 hover:border-white/[0.12]"}`,style:t===r?{background:s.glow,borderColor:s.glow}:{},children:n.tab},r))}),(0,e.jsx)(se,{mode:"wait",children:(0,e.jsxs)(f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-3xl font-bold tracking-tight mb-5 leading-tight",children:s.title}),(0,e.jsx)("p",{className:"text-white/50 text-lg leading-relaxed mb-8",children:s.body}),(0,e.jsx)("div",{className:"flex flex-wrap gap-2 mb-10",children:s.chips.map(n=>(0,e.jsx)("span",{className:"px-3 py-1.5 rounded-full text-xs font-semibold border border-white/[0.08] bg-white/[0.03] text-white/50",children:n},n))}),(0,e.jsxs)(q,{to:"/signup",className:"inline-flex items-center gap-2 px-7 py-3.5 rounded-xl text-sm font-semibold text-white transition-all hover:opacity-90",style:{background:s.glow},children:["Get Started",(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(Kt,{src:s.img,glow:s.glow})})]},t)})]})})}function Dl({src:t=null,poster:a,aspectRatio:s="16/9",label:n,className:r=""}){const i=(0,o.useRef)(null);return(0,o.useEffect)(()=>
221{if(!t)return;const c=i.current;if(!c)return;const d=()=>{!document.hidden&&c.paused&&c.play().catch(()=>{})};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[t]),t?(0,e.jsxs)(f.div,{className:`relative w-full overflow-hidden rounded-2xl border border-white/[0.07] bg-black/40 shadow-2xl shadow-black/60 ${r}`,style:{aspectRatio:s},initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.7,ease:"easeOut"},children:[(0,e.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.08) 60%, transparent)"}}),(0,e.jsxs)("video",{ref:i,className:"absolute inset-0 w-full h-full object-cover",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:a,preload:"metadata",children:[(0,e.jsx)("source",{src:`${t}.webm`,type:"video/webm"}),(0,e.jsx)("source",{src:`${t}.mp4`,type:"video/mp4"})]}),n&&(0,e.jsx)("div",{className:"absolute top-3 left-3 z-10",children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-semibold tracking-wider uppercase bg-black/60 border border-white/[0.12] text-white/60 backdrop-blur-sm",children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 animate-pulse"}),n]})})]}):null}var Oa=[null,null,null];function Fl(){return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"How it works",badgeVariant:"blue",title:"From trade to consequence, automatically",subtitle:"Most tools show you what went wrong after. Redline catches it the moment it happens — and won't let you do it again."}),(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[{icon:"⚡",color:"blue",title:"Real-Time Analysis",description:"Every trade is analyzed the moment it's logged — violations detected instantly, not hours later.",badge:"Instant"},{icon:"🛡️",color:"purple",title:"Escalating Enforcement",description:"5min cooldown → 30min lock → session halt → day lock. Consequences escalate with repeated violations.",badge:"6 Levels"},{icon:"📚",color:"emerald",title:"Required Remediation",description:"Locked out? Complete targeted education modules to unlock — building understanding, not just penalty.",badge:"Learn & Unlock"}].map((t,a)=>(0,e.jsxs)(ke,{delay:a*.1,children:[(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)($s,{color:t.color,children:t.icon}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,e.jsx)("h3",{className:"font-semibold text-white/90",children:t.title})}),(0,e.jsx)(be,{variant:t.color,children:t.badge}),(0,e.jsx)("p",{className:"text-sm text-white/40 mt-3 leading-relaxed",children:t.description})]})]}),Oa[a]&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(Dl,{src:Oa[a],aspectRatio:"4/3"})})]},a))}),(0,e.jsx)("div",{className:"mt-12 hidden md:flex items-center justify-center gap-2 text-xs text-white/20",children:["Trade Logged","→","Rule Check","→","Violation?","→","Consequence","→","Remediation","→","Unlocked"].map((t,a)=>(0,e.jsx)("span",{className:t==="→"?"text-blue-500/40":"bg-white/[0.04] px-3 py-1.5 rounded-lg border border-white/[0.06]",children:t},a))})]})})}var Ol=7e3,Ue=[{eyebrow:"Live enforcement",shortLabel:"Enforce",title:"The guardrail intervenes on the chart",description:"RedlineOS sees the active restriction, locks execution controls, and keeps one chart-aware agent available to explain what is happening.",image:"/screens/landing-discipline-01-enforce.jpg",alt:"A live XAUUSD chart with trading locked and the RedlineOS chart assistant explaining the visible market structure.",icon:Yi,accent:"#f05252"},{eyebrow:"Behavior diagnosed",shortLabel:"Diagnose",title:"The breach becomes a specific coaching plan",description:"The system connects the trade to the trader's own risk cap, scores the behavior, and creates a clear path back instead of showing a vague cooldown.",image:"/screens/landing-discipline-02-diagnose.jpg",alt:"The Redline Learn page showing a discipline score, three open coaching items, and a position-size breach for XAUUSD.",icon:Ii,accent:"#f59e0b"},{eyebrow:"Personalized remediation",shortLabel:"Coach",title:"The exact trade becomes the lesson",description:"Entry, loss, risk limit, and behavioral context are turned into practical education and a focused reflection tied to the trade that caused the breach.",image:"/screens/landing-discipline-03-coach.jpg",alt:"A personalized position-sizing lesson explaining an XAUUSD loss and offering a generated coaching course for that trade.",icon:Ai,accent:"#818cf8"},{eyebrow:"Accountability across the OS",shortLabel:"Recover",title:"Recovery follows proof, not just a timer",description:"Coaching mode follows the trader across RedlineOS. Restricted actions stay paused until the required review is complete and the next decision is intentional.",image:"/screens/landing-discipline-04-recover.jpg",alt:"The Redline trading community with coaching mode active and posting paused until the trader finishes coaching.",icon:Vi,accent:"#34d399"}];function $l(){const t=(0,o.useRef)(null),a=_e(),[s,n]=(0,o.useState)(0),[r,i]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),l=Ue[s],x=l.icon;(0,o.useEffect)(()=>{const p=t.current;
221if(!p||typeof IntersectionObserver>"u"){d(!0);return}const g=new IntersectionObserver(([k])=>d(k.isIntersecting),{threshold:.3});return g.observe(p),()=>g.disconnect()},[]),(0,o.useEffect)(()=>{if(!c||r||a)return;const p=window.setInterval(()=>{n(g=>(g+1)%Ue.length)},Ol);return()=>window.clearInterval(p)},[r,c,a]);const h=p=>{n(p),i(!0)},m=p=>{n(g=>(g+p+Ue.length)%Ue.length),i(!0)};return(0,e.jsx)("section",{ref:t,className:"relative z-10 border-y border-white/[0.06] bg-[#0b0d12] px-4 py-20 sm:px-6 sm:py-24",children:(0,e.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,e.jsx)(xe,{badge:"The discipline loop",badgeVariant:"red",title:"See the system intervene, teach, and restore",subtitle:"Connected activity can inform alerts, reviews, and coaching. Any live monitoring or broker action depends on account support and authorization."}),(0,e.jsxs)("div",{className:"mb-5 flex items-center justify-between gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[11px] font-semibold uppercase text-white/45",children:[(0,e.jsx)("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l.accent}}),r||a?"Manual playback":"Auto playing"]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:()=>m(-1),className:"flex h-10 w-10 items-center justify-center rounded-full border border-white/10 text-white/65 transition hover:border-white/25 hover:text-white","aria-label":"Previous product screen",title:"Previous screen",children:(0,e.jsx)(Pi,{className:"h-4 w-4"})}
221),!a&&(0,e.jsx)("button",{type:"button",onClick:()=>i(p=>!p),className:"flex h-10 w-10 items-center justify-center rounded-full border border-white/10 text-white/65 transition hover:border-white/25 hover:text-white","aria-label":r?"Play product walkthrough":"Pause product walkthrough",title:r?"Play walkthrough":"Pause walkthrough",children:r?(0,e.jsx)(gs,{className:"h-4 w-4"}):(0,e.jsx)(Li,{className:"h-4 w-4"})}),(0,e.jsx)("button",{type:"button",onClick:()=>m(1),className:"flex h-10 w-10 items-center justify-center rounded-full border border-white/10 text-white/65 transition hover:border-white/25 hover:text-white","aria-label":"Next product screen",title:"Next screen",children:(0,e.jsx)(nt,{className:"h-4 w-4"})})]})]}),(0,e.jsxs)("div",{className:"overflow-hidden rounded-lg border border-white/10 bg-black shadow-[0_32px_100px_rgba(0,0,0,0.5)]",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 border-b border-white/[0.06] bg-[#11141a] px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex gap-1.5","aria-hidden":"true",children:[(0,e.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[#ff5f57]"}),(0,e.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[#febc2e]"}),(0,e.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[#28c840]"})]}),(0,e.jsx)("div",{className:"min-w-0 flex-1 truncate text-center text-[10px] font-medium text-white/35 sm:text-xs",children:"RedlineOS · live discipline workflow"}),(0,e.jsxs)("div",{className:"text-[10px] font-semibold tabular-nums text-white/40",children:[String(s+1).padStart(2,"0")," / ",String(Ue.length).padStart(2,"0")]})]}),(0,e.jsx)("div",{className:"relative aspect-[16/10] overflow-hidden bg-[#050609] lg:aspect-[16/9]",children:(0,e.jsx)(se,{mode:"wait",initial:!1,children:(0,e.jsx)(f.img,{src:l.image,alt:l.alt,loading:s===0?"eager":"lazy",decoding:"async",className:"absolute inset-0 h-full w-full object-contain",initial:a?!1:{opacity:0,scale:.992},animate:{opacity:1,scale:1},exit:a?void 0:{opacity:0,scale:1.006},transition:{duration:a?0:.45,ease:"easeOut"}},l.image)})}),(0,e.jsxs)("div",{className:"grid gap-5 border-t border-white/[0.06] bg-[#10131a] p-5 sm:p-6 lg:grid-cols-[0.35fr_0.65fr] lg:items-center",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full border",style:{color:l.accent,borderColor:`${l.accent}55`,backgroundColor:`${l.accent}14`},children:(0,e.jsx)(x,{className:"h-5 w-5"})}),(0,e.jsx)("div",{className:"text-xs font-bold uppercase text-white/45",children:l.eyebrow})]}),(0,e.jsx)(se,{mode:"wait",initial:!1,children:(0,e.jsxs)(f.div,{initial:a?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:a?void 0:{opacity:0,y:-6},transition:{duration:a?0:.3},"aria-live":"polite",children:[(0,e.jsx)("h3",{className:"text-xl font-bold text-white sm:text-2xl",children:l.title}),(0,e.jsx)("p",{className:"mt-2 max-w-3xl text-sm leading-relaxed text-white/55 sm:text-base",children:l.description})]},l.title)})]})]}),(0,e.jsx)("div",{className:"mt-5 grid grid-cols-2 gap-2 sm:grid-cols-4",role:"tablist","aria-label":"Product walkthrough steps",children:Ue.map((p,g)=>{const k=p.icon,v=g===s;return(0,e.jsxs)("button",{type:"button",role:"tab","aria-selected":v,onClick:()=>h(g),className:`flex min-h-14 items-center gap-3 rounded-md border px-3 py-3 text-left transition ${v?"border-white/25 bg-white/[0.07] text-white":"border-white/[0.06] text-white/40 hover:border-white/15 hover:text-white/70"}`,children:[(0,e.jsx)(k,{className:"h-4 w-4 shrink-0",style:v?{color:p.accent}:void 0}),(0,e.jsxs)("span",{className:"min-w-0",children:[(0,e.jsxs)("span",{className:"block text-[9px] font-semibold uppercase text-white/30",children:["Step ",g+1]}),(0,e.jsx)("span",{className:"block text-sm font-semibold",children:p.shortLabel})]})]},p.shortLabel)})})]})})}function Bl(){return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Chrome extension",badgeVariant:"purple",title:"Your AI council, pinned to every chart",subtitle:"The three agents above, docked to whatever chart you already use. One-click install on TradingView, TradeLocker, Schwab, MetaTrader web — no app switching, no copy-
221paste, no second screen."}),(0,e.jsxs)("div",{className:"relative mt-12 group",children:[(0,e.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-r from-purple-500/40 via-pink-500/30 to-blue-500/30 rounded-2xl blur-2xl opacity-50 group-hover:opacity-75 transition-opacity duration-500 pointer-events-none"}),(0,e.jsxs)("div",{className:"relative rounded-2xl overflow-hidden border border-white/10 bg-[#0a0b10] shadow-2xl",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#0f1117] border-b border-white/5",children:[(0,e.jsxs)("div",{className:"flex gap-1.5",children:[(0,e.jsx)("span",{className:"w-3 h-3 rounded-full bg-[#ff5f57]"}),(0,e.jsx)("span",{className:"w-3 h-3 rounded-full bg-[#febc2e]"}),(0,e.jsx)("span",{className:"w-3 h-3 rounded-full bg-[#28c840]"})]}),(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center gap-2",children:(0,e.jsx)("span",{className:"px-3 py-1 rounded-md bg-white/[0.04] border border-white/5 text-xs font-mono text-white/40 truncate max-w-md",children:"chart.tradingview.com — RedlineOS extension active"})}),(0,e.jsx)("span",{className:"text-[10px] font-semibold tracking-wider text-purple-400/80",children:"● COUNCIL"})]}),(0,e.jsx)("img",{src:"/screenshots/redline-chrome-extension.jpg",alt:"RedlineOS Chrome extension side-panel docked to a XAUUSD chart. The Council AI tab shows a structured Read / Plan / Check analysis with specific entry triggers, stop losses, position sizing, and a disciplined-entry verdict.",loading:"lazy",decoding:"async",className:"w-full h-auto block"})]}),(0,e.jsxs)("div",{className:"mt-6 grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,e.jsxs)("div",{className:"rounded-xl border border-purple-500/20 bg-purple-500/[0.04] p-4",children:[(0,e.jsx)("div",{className:"text-xs font-semibold text-purple-400 uppercase tracking-wider mb-1",children:"The Read"}),(0,e.jsx)("div",{className:"text-sm text-white/70",children:"Council names the setup, support/resistance, and confirmation rules before you trade."})]}),(0,e.jsxs)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/[0.04] p-4",children:[(0,e.jsx)("div",{className:"text-xs font-semibold text-blue-400 uppercase tracking-wider mb-1",children:"The Plan"}),(0,e.jsx)("div",{className:"text-sm text-white/70",children:"Exact entry trigger, stop, target, position size — sized to your daily-loss limit."})]}),(0,e.jsxs)("div",{className:"rounded-xl border border-emerald-500/20 bg-emerald-500/[0.04] p-4",children:[(0,e.jsx)("div",{className:"text-xs font-semibold text-emerald-400 uppercase tracking-wider mb-1",children:"The Check"}),(0,e.jsx)("div",{className:"text-sm text-white/70",children:"Is this disciplined or revenge? Council checks today's P&L and your recent behavior."})]}),(0,e.jsxs)("div",{className:"rounded-xl border border-pink-500/20 bg-pink-500/[0.04] p-4",children:[(0,e.jsx)("div",{className:"text-xs font-semibold text-pink-400 uppercase tracking-wider mb-1",children:"One-Tap Tools"}),(0,e.jsx)("div",{className:"text-sm text-white/70",children:"Signal, Execute, Coach, Rules, Stats, Risk Calc, Note, Lock — all from the side panel."})]})]}),(0,e.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,e.jsxs)("a",{href:Rn.webStoreUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-6 py-3 rounded-xl bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-500 hover:to-pink-500 text-white font-semibold text-sm shadow-lg shadow-purple-500/20 transition",children:[(0,e.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 48 48",fill:"currentColor",children:(0,e.jsx)("path",{d:"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 6a14 14 0 0 1 12.12 7H24a7 7 0 0 0-6.84 5.55L11.7 13.2A13.95 13.95 0 0 1 24 10zm-14 14a14 14 0 0 1 1.7-6.7l5.45 9.45A7 7 0 0 0 24 31l-3.1 5.4A14 14 0 0 1 10 24zm14 14l5.45-9.45A7 7 0 0 0 31 24a7 7 0 0 0-1-3.55h11.4A14 14 0 0 1 24 38z"})}),"Install from Chrome Web Store"]}),(0,e.jsx)("a",{href:"/signup",className:"text-sm text-white/60 hover:text-white transition-colors",children:"Or get started in the app →"})]}),(0,e.jsx)("p",{className:"mt-4 text-center text-sm text-white/40",children:"Pictured: live XAUUSD setup with Council delivering a full Read / Plan / Check on a 10-minute chart."})]})]})})}var $a=[{label:"Broker trade",detail:"Any connected broker or manual log",color:"blue"}
221,{label:"Canonical schema",detail:"One normalized record for every trade",color:"purple"},{label:"Rule engine",detail:"Risk, behavior, timing, and session checks",color:"emerald"},{label:"Response",detail:"Alert, review, or supported account action",color:"orange"},{label:"Learning",detail:"Use recorded evidence to adjust your plan",color:"red"}];function zl(){return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"mx-auto max-w-6xl",children:[(0,e.jsx)(xe,{badge:"Core Engine",badgeVariant:"red",title:"Bring your trading activity into one workflow",subtitle:"Connected and manually recorded trades can inform your reviews and guardrails. Available data, monitoring, and account actions depend on the source and its capabilities."}),(0,e.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-white/[0.08] bg-white/[0.025] p-5 sm:p-7",children:[(0,e.jsx)("div",{className:"absolute inset-x-8 top-1/2 hidden h-px -translate-y-1/2 bg-gradient-to-r from-blue-500/30 via-emerald-500/30 to-[#da0b3f]/30 lg:block"}),(0,e.jsx)("div",{className:"relative grid grid-cols-1 gap-3 lg:grid-cols-5",children:$a.map((t,a)=>(0,e.jsx)(f.div,{initial:{opacity:0,y:18},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.45,delay:a*.06},className:"relative",children:(0,e.jsxs)(ke,{className:"h-full",children:[(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,e.jsxs)(be,{variant:t.color,children:["0",a+1]}),a<$a.length-1&&(0,e.jsx)("span",{className:"hidden text-white/25 lg:inline",children:"→"})]}),(0,e.jsx)("h3",{className:"text-base font-bold text-white",children:t.label}),(0,e.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-white/45",children:t.detail})]})},t.label))})]}),(0,e.jsx)("div",{className:"mt-6 grid grid-cols-1 gap-3 md:grid-cols-3",children:[["One source of truth","Trades, sessions, violations, coaching notes, and account context stay connected."],["Behavior before analytics","Redline does not only explain mistakes later. It intervenes while they can still be stopped."],["Portable across brokers","Your rules and discipline layer follow you even when your execution venue changes."]].map(([t,a],s)=>(0,e.jsxs)(f.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:s*.05},className:"rounded-2xl border border-white/[0.06] bg-black/20 p-4",children:[(0,e.jsx)("p",{className:"text-sm font-semibold text-white/85",children:t}),(0,e.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-white/40",children:a})]},t))})]})})}function Wl(){const t=[{trigger:"Trader hits 2% daily loss limit",action:"Redline locks new trades for the day",result:"Account protected. No revenge trading possible.",color:"emerald",icon:"🔒",state:"LOCKED"},{trigger:"New trade entered within 5 min of a loss",action:"Revenge-trade detected, 30-minute cooldown",result:"Forces reflection. Breaks the tilt loop.",color:"orange",icon:"⏱️",state:"COOLDOWN"},{trigger:"Trade entered without stop loss set",action:"Violation flagged, discipline score drops",result:"Pattern tracked. Education module assigned.",color:"red",icon:"⚠️",state:"AT_RISK"},{trigger:"4th violation in single session",action:"Session terminated, rest-of-day lock",result:"Recovery mode: complete remediation to resume.",color:"purple",icon:"🛑",state:"RESTRICTED"}],a={emerald:"text-emerald-400",orange:"text-orange-400",red:"text-red-400",purple:"text-purple-400"};return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Consequences",badgeVariant:"orange",title:"Keep your personal guardrails in view",subtitle:"You define the risk, sessions, and limits. Redline can surface relevant alerts and review steps; cooldowns or account restrictions depend on the active session, account permissions, and platform support."}),(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t.map((s,n)=>(0,e.jsx)(ke,{delay:n*.08,children:(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)("div",{className:"text-2xl mt-0.5",children:s.icon}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,e.jsx)(be,{variant:s.color,children:s.state})}),(0,e.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("span",{className:"text-white/30 shrink-0",children:"Trigger:"}),(0,e.jsx)("span",{className:"text-white/70",children:s.trigger})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("span",{className:"text-white/30 shrink-0",children:"Action:"}),(0,e.jsx)("span",{className:"text-white/70",children:s.action})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("span",{className:"text-white/30 shrink-0",children:"Result:"}
221),(0,e.jsx)("span",{className:a[s.color],children:s.result})]})]})]})]})},n))})]})})}function Ul(){return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Platform",title:"Everything you need to trade with discipline",subtitle:"Built for serious traders who want to protect their capital and build consistent habits."}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[{icon:"📊",color:"blue",title:"Trade Analytics",desc:"Deep breakdowns by setup, session, time of day. Equity curves, drawdown tracking, and custom KPIs."},{icon:"🎙️",color:"purple",title:"Voice Journaling",desc:"Talk through your trades — voice notes are auto-transcribed, tagged to the trade, and searchable across every session."},{icon:"📈",color:"emerald",title:"Session Management",desc:"Start/end sessions with pre-trade checklists, live risk tracking, and automatic post-session reviews."},{icon:"🔗",color:"blue",title:"Broker Sync",desc:"Connect supported TradeLocker, Schwab, and SnapTrade institutions to review available account history and activity."},{icon:"🏫",color:"pink",title:"Education Hub",desc:'Video curriculum, pattern libraries, and violation-specific remediation — "The Treatment Room."'},{icon:"👥",color:"orange",title:"Trading Community",desc:"Share setups, compete on discipline scores, join trading rooms with voice/video calls."},{icon:"📰",color:"blue",title:"News Intelligence",desc:"Multi-source aggregated news with AI sentiment analysis, economic calendar, and ticker-specific feeds."},{icon:"🏢",color:"purple",title:"Prop Firm Dashboard",desc:"Manage trader access, review available activity, configure guardrails, and use organization reporting where supported."},{icon:"🎮",color:"emerald",title:"Gamification & XP",desc:"Earn XP for disciplined trading. Achievements, skill trees, leaderboards, and weekly missions."}].map((t,a)=>(0,e.jsxs)(ke,{delay:a*.05,children:[(0,e.jsx)($s,{color:t.color,children:t.icon}),(0,e.jsx)("h3",{className:"font-semibold text-white/90 mt-4 mb-2",children:t.title}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:t.desc})]},a))})]})})}var Ze=[0,2,-1,4,7,5,9,12,10,14,11,16,20,18,23,21,25,28,26,30,27,32,36,34,38,35,40,44,41,46,43,48,52,50,55,53,57,54,59,63,60,65,62,67,64,70,68,72],Vl=[{index:3,side:"long",win:!0},{index:9,side:"long",win:!0},{index:15,side:"short",win:!1},{index:22,side:"long",win:!0},{index:29,side:"long",win:!0},{index:35,side:"short",win:!1},{index:41,side:"long",win:!0},{index:46,side:"long",win:!0}],Hl=[{o:142.2,h:143.5,l:141.8,c:143.1},{o:143.1,h:144,l:142.6,c:143.8},{o:143.8,h:144.6,l:143,c:143.3},{o:143.3,h:143.9,l:142.5,c:142.7},{o:142.7,h:143.5,l:142,c:143.2},{o:143.2,h:145.1,l:143,c:144.8},{o:144.8,h:145.6,l:144.3,c:145.2},{o:145.2,h:146,l:144.8,c:145.7},{o:145.7,h:146.4,l:145.1,c:145.9},{o:145.9,h:147.2,l:145.6,c:146.8},{o:146.8,h:147.5,l:146.2,c:147.1},{o:147.1,h:148,l:146.5,c:147.6},{o:147.6,h:148.3,l:147,c:147.9},{o:147.9,h:148.8,l:147.4,c:148.4},{o:148.4,h:149.2,l:147.8,c:148.9},{o:148.9,h:149.8,l:148.2,c:149.3}],Gl=[{label:"Win Rate",value:"68%",accent:"emerald",icon:"🎯"},{label:"Total P&L",value:"+$14,320",accent:"emerald",icon:"💰"},{label:"Profit Factor",value:"2.14",accent:"blue",icon:"📊"},{label:"Sharpe Ratio",value:"1.87",accent:"emerald",icon:"⚡"},{label:"Max Drawdown",value:"-4.3%",accent:"red",icon:"📉"},{label:"Trades Taken",value:"47",accent:"amber",icon:"🔢"}],Yl=[{icon:"⏪",title:"Bar-by-bar replay",desc:"Step through any historical chart one candle at a time — exactly like live trading, without the risk."},{icon:"📍",title:"Mark entries & exits",desc:"Click to enter long or short, set stops and targets. The engine instantly calculates your real P&L."},{icon:"📐",title:"Strategy validation",desc:"Test your rules across months of data. Measure your edge before risking a dollar of real capital."},{icon:"🔧",title:"Full indicator suite",desc:"VWAP, SMA/EMA, Bollinger Bands, Opening Range Breakout — toggle them live as you replay."}
221,{icon:"💾",title:"Save & compare sessions",desc:"Save every backtesting session by name. Load and compare strategies side by side over time."},{icon:"📤",title:"Export to CSV",desc:"Download your full trade log with entry, exit, P&L, hold time, and reason for post-analysis."}],ql=["SPY","QQQ","AAPL","NVDA","TSLA"],Kl=["1m","5m","15m","30m","1D"];function Xl({animate:t}){const r=Math.min(...Ze),i=Math.max(...Ze)-r||1,c=Ze.length,d=p=>8+p/(c-1)*464,l=p=>112-(p-r)/i*104,x=Ze.map((p,g)=>`${g===0?"M":"L"}${d(g).toFixed(1)},${l(p).toFixed(1)}`).join(" "),h=`${x} L${d(c-1).toFixed(1)},120 L${d(0).toFixed(1)},120 Z`,m=l(0).toFixed(1);return(0,e.jsxs)("svg",{viewBox:"0 0 480 120",className:"w-full",style:{height:120},children:[(0,e.jsx)("line",{x1:8,y1:m,x2:472,y2:m,stroke:"rgba(148,163,184,0.25)",strokeWidth:"1",strokeDasharray:"4 3"}),(0,e.jsx)(f.path,{d:h,fill:"url(#eqGrad)",initial:{opacity:0},animate:{opacity:t?1:0},transition:{duration:.8,delay:.3}}),(0,e.jsx)(f.path,{d:x,fill:"none",stroke:"#10b981",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:t?1:0,opacity:1},transition:{duration:1.4,ease:"easeInOut",delay:.2}}),Vl.map((p,g)=>(0,e.jsx)(f.circle,{cx:d(p.index).toFixed(1),cy:l(Ze[p.index]).toFixed(1),r:"4",fill:p.win?"#10b981":"#ef4444",stroke:p.win?"#064e3b":"#7f1d1d",strokeWidth:"1.5",initial:{scale:0,opacity:0},animate:{scale:t?1:0,opacity:t?1:0},transition:{duration:.3,delay:.6+g*.07}},g)),(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"eqGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#10b981",stopOpacity:"0.18"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.01"})]})})]})}function Ql({activeIndex:t=10}){const n=Hl,r=n.map(p=>p.h),i=n.map(p=>p.l),c=Math.min(...i),d=Math.max(...r)-c||1,l=280/n.length*.6,x=280/n.length,h=p=>76-(p-c)/d*72,m=p=>x*p+x/2;return(0,e.jsxs)("svg",{viewBox:"0 0 280 80",className:"w-full",style:{height:80},children:[n.map((p,g)=>{const k=p.c>=p.o,v=m(g),u=h(Math.max(p.o,p.c)),E=h(Math.min(p.o,p.c)),C=Math.max(E-u,1),y=k?"#10b981":"#ef4444",w=g===t;return(0,e.jsxs)("g",{opacity:g>t?.2:1,children:[(0,e.jsx)("line",{x1:v,y1:h(p.h),x2:v,y2:h(p.l),stroke:y,strokeWidth:w?2:1}),(0,e.jsx)("rect",{x:v-l/2,y:u,width:l,height:C,fill:y,opacity:w?1:.85,rx:"0.5"}),w&&(0,e.jsx)("line",{x1:v,y1:0,x2:v,y2:80,stroke:"rgba(255,255,255,0.15)",strokeWidth:"1",strokeDasharray:"3 2"})]},g)}),(0,e.jsx)("polyline",{points:n.map((p,g)=>`${m(g)},${h((p.h+p.l+p.c)/3)}`).join(" "),fill:"none",stroke:"#818cf8",strokeWidth:"1",strokeDasharray:"2 1",opacity:"0.7"})]})}function Jl(){const[t,a]=(0,o.useState)(!1),[s,n]=(0,o.useState)(68);return(0,o.useEffect)(()=>{if(!t)return;const r=setInterval(()=>{n(i=>i>=100?(a(!1),100):i+.5)},80);return()=>clearInterval(r)},[t]),(0,e.jsxs)("div",{className:"rounded-xl bg-white/[0.03] border border-white/[0.07] p-3 space-y-3",children:[(0,e.jsxs)("div",{className:"relative h-1.5 bg-white/10 rounded-full overflow-hidden",children:[(0,e.jsx)(f.div,{className:"absolute inset-y-0 left-0 bg-emerald-500 rounded-full",animate:{width:`${s}%`},transition:{duration:.08}}),(0,e.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-3 h-3 bg-white rounded-full shadow border border-white/30",style:{left:`calc(${s}% - 6px)`}})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{className:"p-1.5 rounded-lg bg-white/[0.05] hover:bg-white/[0.1] text-white/60 hover:text-white/90 transition text-xs",title:"Restart",children:"⟳"}),(0,e.jsx)("button",{className:"p-1.5 rounded-lg bg-white/[0.05] hover:bg-white/[0.1] text-white/60 hover:text-white/90 transition text-xs",title:"Step back",children:"◀"}),(0,e.jsx)("button",{onClick:()=>a(r=>!r),className:`px-3 py-1.5 rounded-lg text-xs font-semibold transition ${t?"bg-amber-600/80 hover:bg-amber-500 text-white":"bg-emerald-600/80 hover:bg-emerald-500 text-white"}`,children:t?"⏸ Pause":"▶ Play"}),(0,e.jsx)("button",{className:"p-1.5 rounded-lg bg-white/[0.05] hover:bg-white/[0.1] text-white/60 hover:text-white/90 transition text-xs",title:"Step forward",children:"▶"})]}),(0,e.jsx)("div",{className:"flex items-center gap-1",children:["1×","5×","10×"].map(r=>(0,e.jsx)("button",{className:"px-2 py-1 rounded text-[10px] bg-white/[0.04] hover:bg-white/[0.08] text-white/50 hover:text-white/80 transition",children:r},r))})]})]})}var Zl={emerald:"text-emerald-400",blue:"text-blue-400",violet:"text-violet-400",red:"text-red-400",amber:"text-amber-400"},ec=[{step:"01",icon:"🧪",title:"Run a backtest",desc:"Replay any chart bar-by-bar. Mark entries, stops, and targets. The engine measures your real edge across months of data.",accent:"emerald"},{step:"02",icon:"🤖",title:"Initialize a Bot",desc:"One click on a winning report turns your strategy into a trained bot — stop %, target %, position size, and setup pattern baked in. A bot-scoped API key is issued automatically.",accent:"red"}
221,{step:"03",icon:"🧠",title:"Talk to it via the Council",desc:"Open Agents → My Bots → Chat. The 3-agent Council (Signal · Execution · Coach) is briefed on your bot’s parameters AND your trader fingerprint. Approve, reject, or modify each signal it surfaces — feedback is used to self-calibrate.",accent:"emerald"}],tc=[{name:"Signal",desc:"Surfaces setups that match your bot’s training",color:"from-blue-500 to-cyan-500",icon:"⚡"},{name:"Execution",desc:"Sizes the trade against your account + risk rules",color:"from-violet-500 to-fuchsia-500",icon:"🎯"},{name:"Coach",desc:"Critiques performance vs. your fingerprint",color:"from-amber-500 to-orange-500",icon:"🧭"}],ac={emerald:"bg-emerald-500/15 border-emerald-500/30 text-emerald-300",red:"bg-red-500/15 border-red-500/30 text-red-300",violet:"bg-violet-500/15 border-violet-500/30 text-violet-300"};function sc({isInView:t}){return(0,e.jsxs)("div",{className:"mt-20",children:[(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},animate:t?{opacity:1,y:0}:{},transition:{duration:.5},className:"text-center max-w-2xl mx-auto mb-10",children:[(0,e.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-red-500/10 border border-red-500/20 text-[11px] font-semibold text-red-300 uppercase tracking-widest mb-4",children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"}),"From Backtest → Bot → Council"]}),(0,e.jsx)("h3",{className:"text-2xl sm:text-3xl font-bold text-white mb-3",children:"Your strategy doesn’t stop at a chart"}),(0,e.jsx)("p",{className:"text-white/50 leading-relaxed",children:"Every winning backtest can be deployed as an AI trading bot — and that bot is wired straight into the 3-agent Council so you can chat with it, teach it, and approve every signal before it goes live."})]}),(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-10 relative",children:[(0,e.jsx)("div",{className:"hidden md:block absolute top-12 left-[16.66%] right-[16.66%] h-px bg-gradient-to-r from-emerald-500/40 via-red-500/40 to-violet-500/40 pointer-events-none"}),ec.map((a,s)=>(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},animate:t?{opacity:1,y:0}:{},transition:{duration:.5,delay:.15+s*.1},className:"relative rounded-2xl border border-white/[0.07] bg-white/[0.02] backdrop-blur-xl p-6 hover:bg-white/[0.035] transition",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,e.jsx)("div",{className:`w-12 h-12 rounded-xl border flex items-center justify-center text-2xl ${ac[a.accent]}`,children:a.icon}),(0,e.jsxs)("span",{className:"text-[10px] font-mono text-white/30 tracking-widest",children:["STEP ",a.step]})]}),(0,e.jsx)("h4",{className:"text-base font-semibold text-white/90 mb-2",children:a.title}),(0,e.jsx)("p",{className:"text-sm text-white/45 leading-relaxed",children:a.desc})]},a.step))]}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},animate:t?{opacity:1,y:0}:{},transition:{duration:.5,delay:.4},className:"relative rounded-2xl border border-white/[0.07] bg-gradient-to-br from-violet-500/[0.04] via-white/[0.02] to-blue-500/[0.04] backdrop-blur-xl p-6 sm:p-8 overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute -top-20 -right-20 w-60 h-60 bg-violet-500/10 rounded-full blur-3xl pointer-events-none"}),(0,e.jsx)("div",{className:"absolute -bottom-20 -left-20 w-60 h-60 bg-blue-500/10 rounded-full blur-3xl pointer-events-none"}),(0,e.jsxs)("div",{className:"relative grid grid-cols-1 lg:grid-cols-5 gap-6 items-center",children:[(0,e.jsxs)("div",{className:"lg:col-span-2",children:[(0,e.jsx)("div",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md bg-violet-500/15 border border-violet-500/30 text-[10px] font-semibold text-violet-300 uppercase tracking-wider mb-3",children:(0,e.jsx)("span",{children:"Council Agent"})}),(0,e.jsx)("h4",{className:"text-xl font-bold text-white mb-3",children:"Three specialists. One trained bot. Zero handoff loss."}),(0,e.jsxs)("p",{className:"text-sm text-white/50 leading-relaxed mb-4",children:["When you chat with your bot, the Council sees both sides at once: your bot’s",(0,e.jsx)("span",{className:"text-white/80",children:" trained parameters"})," from the backtest, and your",(0,e.jsx)("span",{className:"text-white/80",children:" trading fingerprint"})," — style, top setups, leaks, peak hours. Every response is calibrated to you, not a generic model."]}),(0,e.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,e.jsxs)("li",{className:"flex items-start gap-2 text-white/60",children:[(0,e.jsx)("span",{className:"text-emerald-400 mt-0.5",children:"✓"}),(0,e.jsxs)("span",{children:["Bot pushes signals via the ",(0,e.jsx)("code",{className:"text-[11px] font-mono text-blue-300 bg-blue-500/10 px-1 py-0.5 rounded",children:"/v1/bot/signal"})," endpoint"]})]}),(0,e.jsxs)("li",{className:"flex items-start gap-2 text-white/60",children:[(0,e.jsx)("span",{className:"text-emerald-400 mt-0.5",children:"✓"}),(0,e.jsx)("span",{children:"You approve, reject, or modify — feedback aggregates into a rolling approval rate"})]}),(0,e.jsxs)("li",{className:"flex items-start gap-2 text-white/60",children:[(0,e.jsx)("span",{className:"text-emerald-400 mt-0.5",children:"✓"}),(0,e.jsxs)("span",{children:["Three modes: ",(0,e.jsx)("span",{className:"text-white/80",children:"Signal"})," (alerts only), ",(0,e.jsx)("span",{className:"text-white/80",children:"Paper"}),", ",(0,e.jsx)("span",{className:"text-white/80",children:"Live"})]})]})]})]}),(0,e.jsxs)("div",{className:"lg:col-span-3 space-y-2.5",children:[tc.map((a,s)=>(0,e.jsxs)(f.div,{initial:{opacity:0,x:20},animate:t?{opacity:1,x:0}:{},transition:{duration:.4,delay:.5+s*.08},className:"flex items-center gap-3 rounded-xl border border-white/[0.06] bg-white/[0.02] p-3",children:[(0,e.jsx)("div",{className:`w-10 h-10 rounded-lg bg-gradient-to-br ${a.color} flex items-center justify-center text-lg shrink-0 shadow-lg`,children:a.icon}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"text-sm font-semibold text-white/90",children:[a.name," Agent"]}),(0,e.jsx)("div",{className:"text-xs text-white/45 truncate",children:a.desc})]}),(0,e.jsxs)("div",{className:"hidden sm:flex items-center gap-1 text-[10px] font-mono text-white/30",children:[(0,e.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"briefed"]})]},a.name)),(0,e.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-black/30 p-3 mt-3",children:[(0,e.jsx)("div",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-2",children:"Live preview · You chatting with your bot"}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)("div",{className:"px-3 py-1.5 rounded-2xl rounded-tr-sm bg-red-600/80 text-white text-xs max-w-[80%]",children:"What setups match my fingerprint right now?"})}),(0,e.jsx)("div",{className:"flex gap-2",children:(0,e.jsxs)("div",{className:"px-3 py-1.5 rounded-2xl rounded-tl-sm bg-white/[0.05] text-white/80 text-xs max-w-[80%]",children:[(0,e.jsx)("span",{className:"text-blue-400 font-semibold",children:"Signal:"})," NVDA bull-flag on 5m, entry $925.5–927, stop $921, target $938. Matches your top setup (71% WR). Confidence 72%."]})})]})]})]})]})]}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:12},animate:t?{opacity:1,y:0}:{},transition:{duration:.5,delay:.65},className:"mt-6 flex flex-wrap items-center justify-center gap-3 text-xs",children:[(0,e.jsx)(q,{to:"/app/agents",className:"px-4 py-2 rounded-full bg-white/[0.04] hover:bg-white/[0.08] border border-white/[0.08] text-white/70 hover:text-white transition",children:"Open Agents Studio →"}),(0,e.jsx)(q,{to:"/docs",className:"px-4 py-2 rounded-full bg-white/[0.04] hover:bg-white/[0.08] border border-white/[0.08] text-white/70 hover:text-white transition",children:"Read API Docs →"}),(0,e.jsx)("span",{className:"text-white/30",children:"11 REST endpoints · MCP server · JS SDK"})]})]})}function rc(){const t=(0,o.useRef)(null),a=Fr(t,{once:!0,margin:"-80px"}),[s,n]=(0,o.useState)("SPY"),[r,i]=(0,o.useState)("5m");return(0,e.jsxs)("section",{ref:t,className:"relative z-10 px-6 py-24 overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[600px] bg-emerald-500/[0.03] rounded-full blur-[140px] pointer-events-none"}),(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Backtesting",title:"Validate your strategy before risking a dollar",subtitle:"Replay any historical chart bar-by-bar, mark your entries and exits exactly as you would live, and instantly measure your real edge — win rate, profit factor, Sharpe, and drawdown."}),(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 ga
221p-4 mb-12",children:[(0,e.jsxs)(f.div,{initial:{opacity:0,y:24},animate:a?{opacity:1,y:0}:{},transition:{duration:.6},className:"lg:col-span-3 rounded-2xl border border-white/[0.07] bg-white/[0.02] backdrop-blur-xl p-4 space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,e.jsx)("div",{className:"flex items-center gap-1",children:ql.map(c=>(0,e.jsx)("button",{onClick:()=>n(c),className:`px-2.5 py-1 rounded-lg text-xs font-mono font-semibold transition ${s===c?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-white/[0.04] text-white/40 hover:text-white/70"}`,children:c},c))}),(0,e.jsx)("div",{className:"flex items-center gap-1",children:Kl.map(c=>(0,e.jsx)("button",{onClick:()=>i(c),className:`px-2 py-1 rounded text-[11px] transition ${r===c?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-white/[0.03] text-white/30 hover:text-white/60"}`,children:c},c))})]}),(0,e.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,e.jsx)("span",{className:"font-mono text-lg font-bold text-white/90",children:"$148.92"}),(0,e.jsx)("span",{className:"text-emerald-400 text-xs font-mono",children:"+1.24 (+0.84%)"}),(0,e.jsx)("span",{className:"text-white/20 text-[10px] ml-auto",children:"Candle 11 / 16"})]}),(0,e.jsxs)("div",{className:"rounded-xl bg-black/30 border border-white/[0.04] px-2 pt-2 pb-1",children:[(0,e.jsx)(Ql,{activeIndex:10}),(0,e.jsxs)("div",{className:"flex items-center gap-3 mt-1 px-1",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-indigo-400",children:[(0,e.jsx)("span",{className:"w-3 border-t border-dashed border-indigo-400"})," VWAP"]}),(0,e.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400/60",children:[(0,e.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"})," Long entry"]}),(0,e.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-red-400/60",children:[(0,e.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-red-500"})," Exit/Stop"]})]})]}),(0,e.jsx)(Jl,{}),(0,e.jsxs)("div",{className:"flex items-center gap-3 flex-wrap text-[11px] text-white/30 border-t border-white/[0.04] pt-2",children:[(0,e.jsxs)("span",{children:["Account: ",(0,e.jsx)("span",{className:"text-white/60 font-mono",children:"$100,000"})]}),(0,e.jsxs)("span",{children:["Commission: ",(0,e.jsx)("span",{className:"text-white/60",children:"$0"})]}),(0,e.jsxs)("span",{children:["Slippage: ",(0,e.jsx)("span",{className:"text-white/60",children:"0 bps"})]})]})]}),(0,e.jsxs)("div",{className:"lg:col-span-2 flex flex-col gap-3",children:[(0,e.jsx)(f.div,{initial:{opacity:0,x:20},animate:a?{opacity:1,x:0}:{},transition:{duration:.6,delay:.1},className:"grid grid-cols-2 gap-2",children:Gl.map((c,d)=>(0,e.jsxs)(f.div,{initial:{opacity:0,scale:.92},animate:a?{opacity:1,scale:1}:{},transition:{duration:.4,delay:.15+d*.07},className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-3",children:[(0,e.jsx)("div",{className:"text-[10px] text-white/30 uppercase tracking-wide mb-1",children:c.label}),(0,e.jsx)("div",{className:`text-base font-bold font-mono ${Zl[c.accent]}`,children:c.value})]},c.label))}),(0,e.jsxs)(f.div,{initial:{opacity:0,x:20},animate:a?{opacity:1,x:0}:{},transition:{duration:.6,delay:.25},className:"rounded-2xl border border-white/[0.07] bg-white/[0.02] backdrop-blur-xl p-4 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,e.jsx)("span",{className:"text-[11px] text-white/40 uppercase tracking-wide",children:"Equity Curve"}),(0,e.jsx)("span",{className:"text-[11px] font-mono text-emerald-400",children:"+14.3%"})]}),(0,e.jsx)(Xl,{animate:a}),(0,e.jsxs)("div",{className:"flex items-center justify-between mt-2 text-[10px] text-white/20",children:[(0,e.jsx)("span",{children:"Start: $100k"}),(0,e.jsx)("span",{children:"End: $114.3k"})]})]}),(0,e.jsxs)(f.div,{initial:{opacity:0,x:20},animate:a?{opacity:1,x:0}:{},transition:{duration:.6,delay:.35},className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-3 flex items-center gap-3",children:[(0,e.jsx)("span",{className:"text-lg",children:"💾"}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-xs text-white/60 font-medium truncate",children:"SPY 5m — VWAP Breakout v2"}),(0,e.jsx)("div",{className:"text-[10px] text-white/25 mt-0.5",children:"Saved · 47 trades · May 9"})]}),(0,e.jsx)("span",{className:"text-[10px] text-emerald-400 font-mono shrink-0",children:"+14.3%"})]})]})]}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Yl.map((c,d)=>(0,e.jsxs)(ke,{delay:d*.05,children:[(0,e.jsx)("div",{className:"text-2xl mb-3",children:c.icon}),(0,e.jsx)("h3",{className:"font-semibold text-white/90 mb-1.5",children:c.title}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:c.desc})]},d))}),(0,e.jsx)(sc,{isInView:a}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},animate:a?{opacity:1,y:0}:{},transition:{duration:.5,delay:.5},className:"mt-12 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,e.jsx)(q,{to:"/app/analytics?tab=backtest",className:"px-8 py-3.5 rounded-full bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-sm transition shadow-lg shadow-emerald-900/30",children:"Try Backtesting →"}),(0,e.jsx)("p",{className:"text-white/30 text-sm",children:"Works with any broker data"})]})]})]})}function nc({code:t,language:a="json"}){const[s,n]=(0,o.useState)(!1),r=()=>{navigator.clipboard.writeText(t).catch(()=>{}),n(!0),setTimeout(()=>n(!1),1800)};return(0,e.jsxs)("div",{className:"relative rounded-xl overflow-hidden border border-white/[0.07] bg-[#0c0e14]",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/[0.06] bg-white/[0.02]",children:[(0,e.jsxs)("div",{className:"flex gap-1.5",children:[(0,e.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-[#da0b3f]/60"}),(0,e.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/40"}),(0,e.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/40"})]}),(0,e.jsx)("span",{className:"text-[10px] text-white/30 font-mono uppercase tracking-widest",children:a}),(0,e.jsx)("button",{onClick:r,className:"text-[10px] text-white/40 hover:text-white/80 transition-colors font-mono",children:s?"✓ copied":"copy"})]}),(0,e.jsx)("pre",{className:"p-4 text-xs font-mono leading-relaxed text-white/70 overflow-x-auto whitespace-pre",children:t})]})}function ic({step:t,icon:a,label:s,sublabel:n,color:r,last:i=!1}){const c={blue:{ring:"border-blue-500/40",bg:"bg-blue-500/10",text:"text-blue-400",dot:"bg-blue-500"},purple:{ring:"border-purple-500/40",bg:"bg-purple-500/10",text:"text-purple-400",dot:"bg-purple-500"},emerald:{ring:"border-emerald-500/40",bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"bg-emerald-500"},pink:{ring:"border-pink-500/40",bg:"bg-pink-500/10",text:"text-pink-400",dot:"bg-pink-500"}},d=c[r]||c.blue;return(0,e.jsxs)("div",{className:"flex flex-col items-center flex-1 min-w-0",children:[(0,e.jsxs)(f.div,{initial:{opacity:0,scale:.8},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{delay:t*.12}
221,className:`relative w-14 h-14 rounded-2xl border ${d.ring} ${d.bg} flex items-center justify-center text-2xl shadow-lg`,children:[a,(0,e.jsx)("span",{className:`absolute -top-2 -right-2 w-5 h-5 rounded-full ${d.dot} flex items-center justify-center text-[9px] font-bold text-white`,children:t+1})]}),!i&&(0,e.jsx)("div",{className:"hidden sm:flex items-center absolute",style:{display:"none"}}),(0,e.jsx)("p",{className:`mt-3 text-sm font-semibold ${d.text}`,children:s}),(0,e.jsx)("p",{className:"mt-1 text-[11px] text-white/40 text-center leading-tight max-w-[100px]",children:n})]})}function oc({icon:t,title:a,desc:s,badge:n,delay:r}){return(0,e.jsx)(ke,{delay:r,className:"h-full",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("span",{className:"text-2xl flex-shrink-0",children:t}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[(0,e.jsx)("h4",{className:"text-sm font-semibold text-white",children:a}),n&&(0,e.jsx)("span",{className:"text-[9px] font-medium px-2 py-0.5 rounded-full bg-[#da0b3f]/20 text-[#da0b3f] border border-[#da0b3f]/30",children:n})]}),(0,e.jsx)("p",{className:"text-xs text-white/50 leading-relaxed",children:s})]})]})})}function lc(){const t=[{icon:"🔑",label:"Authenticate",sublabel:"Generate an API key in Settings",color:"blue"},{icon:"📡",label:"Query Data",sublabel:"Pull trades, stats & signals",color:"purple"},{icon:"🤖",label:"Run Your Bot",sublabel:"Feed AI agents your live data",color:"emerald"},{icon:"⚡",label:"Automate",sublabel:"Triggers, alerts & execution",color:"pink"}];return(0,e.jsxs)("section",{className:"relative z-10 px-6 py-28 overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[400px] bg-purple-600/[0.04] rounded-full blur-[120px] pointer-events-none"}),(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Programmable System",badgeVariant:"purple",title:"Your trading system is programmable",subtitle:"Every trade, decision, violation, session, and coaching note is available as structured data — ready for AI, bots, dashboards, and automation."}),(0,e.jsx)(f.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"relative mt-16 mb-20",children:(0,e.jsxs)("div",{className:"relative flex items-start justify-between gap-2 sm:gap-4",children:[(0,e.jsx)("div",{className:"absolute top-7 left-7 right-7 h-px bg-gradient-to-r from-blue-500/30 via-purple-500/30 to-pink-500/30 pointer-events-none hidden sm:block"}),t.map((a,s)=>(0,e.jsx)(ic,{step:s,last:s===t.length-1,...a},s))]})}),(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-20 items-start",children:[(0,e.jsx)(f.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5},children:(0,e.jsx)(nc,{code:`// 1. Authenticate — get your key from Settings → API Keys
222const headers = {
223  'Authorization': 'Bearer rl_live_your_key_here',
224  'Content-Type': 'application/json',
225};
226
227// 2. Pull your last 50 closed trades
228const BASE = 'https://us-central1-tradeintexd.cloudfunctions.net';
229const res = await fetch(\`\${BASE}/redlineApiTradeLog?limit=50\`, {
230  headers,
231});
232const { trades } = await res.json();
233
234// 3. Feed to your AI agent / strategy bot
235const winRate = trades.filter(t => t.pnl > 0).length / trades.length;
236console.log(\`Win rate: \${(winRate * 100).toFixed(1)}%\`);
237// → "Win rate: 62.3%"`,language:"javascript"})}),(0,e.jsxs)(f.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5,delay:.1},className:"flex flex-col gap-5",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(be,{variant:"purple",children:"How it works"}),(0,e.jsx)("h3",{className:"mt-3 text-2xl font-bold text-white leading-snug",children:"One key. Full access to your trading data."}),(0,e.jsxs)("p",{className:"mt-3 text-sm text-white/50 leading-relaxed",children:["Generate an ",(0,e.jsx)("span",{className:"text-white/80",children:"API key"})," from Settings in under 30 seconds. Your behavioral layer becomes structured JSON — clean enough for custom dashboards, strategy bots, AI agents, and firm-level automation."]})]}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[{label:"REST API",icon:"🔗",desc:"11 endpoints — works with any language or framework"},{label:"Bot-Scoped Keys",icon:"🔑",desc:"Issue a key tied to one bot, with auto-resolved botId"},{label:"Fingerprint Endpoint",icon:"🤖",desc:"GET /v1/fingerprint returns LLM-ready trader DNA"},{label:"Rate: 100 req/min",icon:"🚀",desc:"Per API key. 429 with X-RateLimit headers when exceeded"}].map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-2.5 p-3 rounded-xl border border-white/[0.06] bg-white/[0.02]",children:[(0,e.jsx)("span",{className:"text-base flex-shrink-0 mt-0.5",children:a.icon}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-xs font-semibold text-white/80",children:a.label}),(0,e.jsx)("p",{className:"text-[11px] text-white/40 leading-tight mt-0.5",children:a.desc})]})]},a.label))}),(0,e.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-xl border border-[#da0b3f]/20 bg-[#da0b3f]/[0.05]",children:[(0,e.jsx)("span",{className:"text-base",children:"🔐"}),(0,e.jsxs)("p",{className:"text-[11px] text-white/50 leading-snug",children:[(0,e.jsx)("span",{className:"text-white/80 font-medium",children:"Security first."})," Keys are SHA-256 hashed at rest. Raw key shown only once — never stored. Revoke any key instantly."]})]})]})]}),(0,e.jsxs)("div",{className:"mb-14",children:[(0,e.jsx)("p",{className:"text-center text-xs text-white/30 uppercase tracking-widest font-medium mb-8",children:"What traders build with the API"}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[{icon:"📊",title:"Performance Dashboards",badge:"Data",desc:"Pull your full trade history into your own dashboard, Excel model, or Notion database. Updated 
237in real time."},{icon:"🔔",title:"Custom Alert Bots",badge:"Automation",desc:"Webhook your P&L and drawdown metrics into Telegram or Discord. Get pinged when you hit a daily loss limit before the market does it for you."},{icon:"🧠",title:"AI Agent Integration",badge:"AI",desc:'Connect your trade stream to GPT-4 or your own models. Ask "why did I lose today?" and get data-backed answers, not guesses.'},{icon:"📈",title:"Strategy Backtesting",badge:"Research",desc:"Export clean OHLCV + trade overlay data into QuantConnect, Backtrader, or your own Python environment."},{icon:"🛡️",title:"Prop Firm Compliance",badge:"Risk",desc:"Programmatically enforce your own rules — max daily loss, position size limits, news blackouts — before orders hit the market."},{icon:"🤝",title:"Copy & Social Trading",badge:"Community",desc:"Build follower bots that mirror your setups in real time. Publish your signal feed with full transparency — win rate, risk metrics, full history."}].map((a,s)=>(0,e.jsx)(oc,{...a,delay:s*.06},a.title))})]}),(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"relative overflow-hidden rounded-2xl border border-purple-500/20 bg-gradient-to-r from-purple-900/20 via-[#0c0e14] to-blue-900/20 p-8 flex flex-col sm:flex-row items-center justify-between gap-6",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-600/[0.04] to-blue-600/[0.04] pointer-events-none"}),(0,e.jsxs)("div",{className:"relative text-center sm:text-left",children:[(0,e.jsx)("h4",{className:"text-lg font-bold text-white",children:"API access is included with Pro & Elite"}),(0,e.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Generate your first key in Settings → API Keys. Docs are live at ",(0,e.jsx)("span",{className:"text-purple-400 font-mono text-xs",children:"/api-docs"}),"."]})]}),(0,e.jsxs)("div",{className:"relative flex items-center gap-3 flex-shrink-0",children:[(0,e.jsx)("a",{href:"/login",className:"px-5 py-2.5 rounded-xl bg-gradient-to-r from-purple-600 to-purple-500 text-white text-sm font-semibold hover:from-purple-500 hover:to-purple-400 transition-all shadow-lg shadow-purple-500/25",children:"Get API Access"}),(0,e.jsx)("a",{href:"/api-docs",className:"px-5 py-2.5 rounded-xl border border-white/10 text-white/70 text-sm font-medium hover:border-white/20 hover:text-white transition-all",children:"View Docs"})]})]})]})]})}var cc=null,ae=t=>`https://www.google.com/s2/favicons?domain=${t}&sz=128`;ae("tdameritrade.com"),ae("merrilledge.com"),ae("m1.com"),ae("moomoo.com"),ae("sofi.com"),ae("etoro.com"),ae("ninjatrader.com"),ae("tradovate.com"),ae("ally.com"),ae("webull.com"),ae("firstrade.com"),ae("vanguard.com"),ae("jpmorgan.com"),ae("wealthsimple.com"),ae("home.saxo"),ae("plus500.com"),ae("ig.com"),ae("cmcmarkets.com"),ae("exness.com"),ae("forex.com");var ut=["FTMO","The5%ers","Funded Trading Plus","True Forex Funds","E8 Funding","Goat Funded Trader","Alpha Capital","Funding Pips","Blue Guardian","FundedNext","Apex Trader Funding","TopStep","Earn2Trade","Audacity Capital","City Traders Imperium","Lux Trading Firm","Fidelcrest","Maven Trading","My Funded FX","The Trading Pit","Funded Engineer","Ment Funding","Skilled Funded Traders","Smart Funded Trader","Traders Launch","FundYourFX","Finotive Funding","Bespoke Funding","Traders With Edge","Nordic Funder","Bulenox","Breakout Prop","FastTrack Trading","The Funded Trader","FX2 Funding","Hola Prime","OFP Funding","Tradeify","Uprofit","AquaFunded","My Funded Trader","Funded Academy","Funded Peaks","Sabio Trade","Leveled Up Trader","Monevis","Axi Select","Phidias Funding","Prop Firm Match","Rebels Funding","DT4X Trader","FundedNext Elite","Trade The Pool","FunderPro","Ftuk","Blueberry Funded","PropTF","Zoom Trader","ThinkCapital","Swift Fun
237ding","Falcon Funding","Elite Trader Funding","Forex Prop Firm","Instant Funding","OANDA Prop","Galaxy Funded","TradeFunder","Apex Pro Funding"];function dc(){const t=ut.slice(0,Math.ceil(ut.length/2)),a=ut.slice(Math.ceil(ut.length/2));return(0,e.jsxs)("div",{className:"overflow-hidden py-2 mask-fade-x",children:[(0,e.jsx)("div",{className:"flex gap-2 mb-2 animate-ticker-left",style:{width:"max-content"},children:[...t,...t].map((s,n)=>(0,e.jsx)("span",{className:"px-3 py-1 rounded-full border border-white/[0.07] bg-white/[0.03] text-xs text-white/40 whitespace-nowrap",children:s},n))}),(0,e.jsx)("div",{className:"flex gap-2 animate-ticker-right",style:{width:"max-content"},children:[...a,...a].map((s,n)=>(0,e.jsx)("span",{className:"px-3 py-1 rounded-full border border-white/[0.07] bg-white/[0.03] text-xs text-white/40 whitespace-nowrap",children:s},n))})]})}function mc(){return(0,e.jsxs)("section",{className:"relative z-10 px-6 py-24",children:[(0,e.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Integrations",badgeVariant:"green",title:"Works with your broker",subtitle:"Connect eligible retail and prop accounts through SnapTrade, MetaAPI, TradeLocker, or Schwab. Provider coverage, available history, refresh timing, and account actions vary."}),(0,e.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[(0,e.jsxs)(ke,{delay:0,children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,e.jsx)("img",{src:"/assets/brokers/metatrader.png",alt:"MetaTrader",className:"w-12 h-12 rounded-xl object-contain"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"font-semibold text-white/90",children:"MetaTrader MT4/MT5"}),(0,e.jsx)(be,{variant:"green",children:"Live"})]})]}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:"Connect supported MT4/MT5 accounts through MetaAPI to access the history and account data the provider makes available. Update timing and monitoring depend on provider coverage and permissions."}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-1.5",children:["Forex","CFDs","Prop Firms","Futures"].map(t=>(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-teal-500/10 text-teal-400 border border-teal-500/20",children:t},t))})]}),(0,e.jsxs)(ke,{delay:.1,children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,e.jsx)("img",{src:"/assets/brokers/tradelocker.png",alt:"TradeLocker",className:"w-12 h-12 rounded-xl object-contain"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"font-semibold text-white/90",children:"TradeLocker"}),(0,e.jsx)(be,{variant:"green",children:"Live"})]})]}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:"TradeLocker connections can provide account activity for review. Monitoring cadence and any available broker actions depend on the account, permissions, and supported integration path."}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-1.5",children:["Forex","CFDs","Stocks"].map(t=>(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:t},t))})]}),(0,e.jsxs)(ke,{delay:.2,children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,e.jsx)("img",{src:"/assets/brokers/schwab.png",alt:"Charles Schwab",className:"w-12 h-12 rounded-xl object-contain"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"font-semibold text-white/90",children:"Charles Schwab"}),(0,e.jsx)(be,{variant:"blue",children:"Live"})]})]}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:"OAuth connection for eligible Schwab accounts. Review the history and account data the connection makes available; refresh timing and supported actions vary."}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-1.5",children:["Stocks","Options","ETFs"].map(t=>(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-blue-500/10 text-blue-400 border border-blue-500/20",children:t},t))})]}),(0,e.jsxs)(ke,{delay:.3,children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,e.jsx)("div",{className:"w-12 h-12 rounded-xl bg-violet-500/15 border border-violet-500/25 flex items-center justify-center flex-shrink-0",children:(0,e.jsx)("span",{className:"text-violet-400 font-bold text-sm tracking-tight",children:"ST"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"font-semibold text-white/90",children:"SnapTrade"}),(0,e.jsx)(be,{variant:"green",children:"Live"})]})]}),(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed",children:"Connect retail brokerages via OAuth — IBKR, Robinhood, Fidelity, tastytrade, Webull, TradeStation, Alpaca, and more."}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-1.5",children:["Stocks","Options","Crypto","ETFs"].map(t=>(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-violet-500/10 text-violet-400 border border-violet-500/20",children:t},t))})]})]}),cc,(0,e.jsx)(f.div,{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.15},children:[{label:"Forex / CFD Brokers",examples:"OANDA, IC Markets, Pepperstone, XM, Exness, Tickmill…",color:"teal"},{label:"Prop Firms",examples:"FTMO, The5%ers, FundedNext, E8 Fun
237ding, Blue Guardian…",color:"purple"},{label:"Futures Platforms",examples:"NinjaTrader, Tradovate, AMP Futures…",color:"orange"},{label:"Crypto CFDs",examples:"Offshore MT5 brokers with crypto instruments",color:"pink"}].map((t,a)=>(0,e.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-4",children:[(0,e.jsx)("p",{className:"text-xs font-semibold text-white/70 mb-1",children:t.label}),(0,e.jsx)("p",{className:"text-[11px] text-white/30 leading-relaxed",children:t.examples})]},a))}),(0,e.jsxs)(f.div,{className:"mt-4 rounded-2xl border border-white/[0.06] bg-white/[0.02] p-6 overflow-hidden",initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.3},children:[(0,e.jsxs)("p",{className:"text-xs text-white/30 text-center mb-4",children:["Also compatible with MT4/MT5 — works with ",(0,e.jsx)("span",{className:"text-white/60 font-medium",children:"50+ prop firms"})," via MetaAPI"]}),(0,e.jsx)(dc,{}),(0,e.jsx)("p",{className:"text-[10px] text-white/20 text-center mt-3",children:"Compatibility via MetaAPI cloud bridge. Redline is not affiliated with or endorsed by any firm listed above."})]}),(0,e.jsxs)(f.div,{className:"mt-4 rounded-2xl border border-white/[0.06] bg-white/[0.02] p-4 flex items-center justify-between flex-wrap gap-3",initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.35},children:[(0,e.jsx)("p",{className:"text-xs text-white/30",children:"More direct integrations coming soon"}),(0,e.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:["ThinkorSwim","NinjaTrader","Tradovate","Bybit"].map(t=>(0,e.jsx)(be,{children:t},t))})]})]}),(0,e.jsx)("style",{children:`
238        @keyframes ticker-left {
239          0% { transform: translateX(0); }
240          100% { transform: translateX(-50%); }
241        }
242        @keyframes ticker-right {
243          0% { transform: translateX(-50%); }
244          100% { transform: translateX(0); }
245        }
246        .animate-ticker-left { animation: ticker-left 40s linear infinite; }
247        .animate-ticker-right { animation: ticker-right 40s linear infinite; }
248        .mask-fade-x {
249          mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
250          -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
251        }
252      `})]})}var Ba=["NinjaTrader","Tradovate","TD Ameritrade","Moomoo","eToro","M1 Finance","SoFi Invest","Firstrade","Vanguard","Ally Invest","Merrill Edge","JP Morgan","Robinhood","Webull","E*TRADE","Fidelity","TradeStation","Tradier","tastytrade","Alpaca","Public.com","Saxo Bank","IG Group","CMC Markets","Plus500","Exness","Forex.com","Questrade","Wealthsimple","Trading 212","Coinbase","Binance","Kraken"],xc=[{name:"MetaTrader",domain:"metaquotes.net",label:"MT4 / MT5"},{name:"TradeLocker",domain:"tradelocker.com",label:"TradeLocker"},{name:"Charles Schwab",domain:"schwab.com",label:"Schwab"},{name:"SnapTrade",domain:"snaptrade.com",label:"SnapTrade"},{name:"FTMO",domain:"ftmo.com",label:"FTMO"},{name:"The5%ers",domain:"the5ers.com",label:"The5%ers"},{name:"FundedNext",domain:"fundednext.com",label:"FundedNext"},{name:"E8 Funding",domain:"e8funding.com",label:"E8 Funding"},{name:"MetaAPI",domain:"metaapi.cloud",label:"MetaAPI"},{name:"IC Markets",domain:"icmarkets.com",label:"IC Markets"},{name:"OANDA",domain:"oanda.com",label:"OANDA"},{name:"Pepperstone",domain:"pepperstone.com",label:"Pepperstone"},{name:"XM",domain:"xm.com",label:"XM"}],za=["#3b82f6","#6366f1","#da0b3f","#22c55e","#f59e0b","#0ea5e9","#a855f7","#14b8a6","#f97316","#ec4899","#84cc16","#06b6d4"];function pc({broker:t,index:a}){const[s,n]=(0,o.useState)(!1),r=`https://www.google.com/s2/favicons?domain=${t.domain}&sz=128`,i=za[a%za.length];return(0,e.jsxs)(f.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:a*.04},className:"flex flex-col items-center gap-2 px-5 py-4 rounded-xl border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.12] hover:bg-white/[0.04] transition-all cursor-default",style:{minWidth:96},children:[s?(0,e.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-sm font-bold text-white",style:{background:`linear-gradient(135deg, ${i}, ${i}99)`},children:t.label.charAt(0)}):(0,e.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{background:"rgba(255,255,255,0.07)"},children:(0,e.jsx)("img",{src:r,alt:t.name,onError:()=>n(!0),className:"w-7 h-7 object-contain"})}),(0,e.jsx)("span",{className:"text-[11px] font-semibold text-white/30 whitespace-nowrap tracking-wide",children:t.label})]})}function uc(){return(0,e.jsx)("section",{className:"relative z-10 border-t border-b border-white/[0.06] py-12 px-6",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)("p",{className:"text-center text-[11px] font-bold tracking-[.1em] uppercase text-white/20 mb-7",children:"Connect your broker in 60 seconds — MT4/MT5, TradeLocker, Schwab, and SnapTrade"}),(0,e.jsxs)("div",{className:"flex flex-wrap justify-center gap-3 mb-8",children:[xc.map((t,a)=>(0,e.jsx)(pc,{broker:t,index:a},t.domain)),(0,e.jsxs)("div",{className:"flex flex-col items-center gap-2 px-5 py-4 rounded-xl border border-dashed border-white/[0.06] min-w-[96px]",children:[(0,e.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-xl text-white/20 bg-white/[0.03]",children:"+"}),(0,e.jsx)("span",{className:"text-[11px] font-semibold text-white/20 whitespace-nowrap",children:"via SnapTrade"})]})]}),(0,e.jsx)("div",{className:"overflow-hidden",style:{maskImage:"linear-gradient(to right, transparent, black 8%, black 92%, transparent)"},children:(0,e.jsx)("div",{className:"flex gap-3 whitespace-nowrap",style:{width:"max-content",animation:"broker-scroll 35s linear infinite"},children:[...Ba,...Ba].map((t,a)=>(0,e.jsx)("span",{className:"inline-block px-3 py-1.5 rounded-full border border-white/[0.06] bg-white/[0.02] text-[11px] font-medium text-white/25 tracking-wide",children:t},a))})}),(0,e.jsx)("style",{children:`
253          @keyframes broker-scroll {
254            from { transform: translateX(0); }
255            to   { transform: translateX(-50%); }
256          }
257        `})]})})}var hc=[{title:"Every trade, checked",sub:"Each trade is evaluated against the rules you pre-commit every morning."},{title:"Real consequences",sub:"Break a rule and the account cools down, locks, or flattens — then you remediate."},{title:"Synced to your broker",sub:"Schwab, MT4/MT5, TradeLocker, and SnapTrade connections import your real fills."},{title:"Coaching from your trades",sub:"Education and AI feedback are generated from your actual mistakes, not templates."}];function gc(){return(0,e.jsx)("section",{className:"relative py-16 sm:py-20 px-4 z-10 border-y border-white/[0.04] bg-gradient-to-b from-transparent via-emerald-500/[0.015] to-transparent",children:(0,e.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,e.jsx)(f.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.5},className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-px rounded-2xl overflow-hidden bg-white/[0.04] border border-white/[0.06]",children:hc.map(t=>(0,e.jsxs)("div",{className:"relative bg-[#0a0b12] px-5 py-7 sm:px-7 sm:py-9 flex flex-col items-start justify-center group",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-emerald-500/[0.04] to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"text-lg sm:text-xl font-bold tracking-tight text-white",children:t.title}),(0,e.jsx)("div",{className:"mt-2 text-xs sm:text-sm font-medium text-white/60 leading-relaxed",children:t.sub})]})]},t.title))})})})}var bc=[{q:"How is Redline different from a trading journal?",a:"Trading journals record activity. Redline adds personal guardrails, account activity views, session workflows, and behavioral analysis. Alerts and any broker actions depend on the connected account, its supported capabilities, and the permissions granted."},{q:"What happens when I violate a trading rule?",a:"When a configured limit is reached, Redline can surface the event and available response options. Cooldowns, account restrictions, or order actions are only available where the active session and connected platform support them; they are not guaranteed for every account."},{q:"Which brokers are supported?",a:"Connection options include MetaTrader MT4/MT5 via MetaAPI, TradeLocker, Charles Schwab, and eligible SnapTrade institutions. Available history, refresh timing, and account actions vary by provider and account. Manual logging is available for other workflows."},{q:"Does it work with my prop firm account?",a:"If your prop firm account is available through a supported connection, you can review the history and account data that provider exposes. Redline can help you track firm-published rules alongside your personal guardrails; it cannot guarantee an account lockout or prevent a breach."},{q:"Can I use Redline for my prop firm or trading group?",a:"Organization features can help teams review connected trader activity, configured rules, and reports. Account coverage and update timing depend on each trader's provider and permissions; verify current plan availability in the product before relying on a specific organization feature."},{q:"Is there a free plan?",a:"The free plan includes a historical report covering the last 30 days of available trade history. Live enforcement features are part of paid plans where supported, and remain subject to account permissions and platform capabilities. Check current plan details for connection and analytics limits."},{q:"How does the AI coaching work?",a:"Redline uses Gemini and Claude AI to analyze your trading patterns — including setups, timing, emotional indicators, and violation history. After each session, you receive personalized insights and improvement recommendations. Pro plans get 100 AI calls/month, Elite gets 300."},{q:"Does Redline work on mobile?",a:"Yes. Redline is a Progressive Web App that works on any device. It's also available as a native iOS and Android app via Capacitor, with offline support, push notifications, and optimized mobile interfaces."},{q:"Can I cancel my subscription anytime?",a:"Yes. Paid subscriptions are month-to-month with 
257no long-term contracts. Cancel anytime from your account settings; your historical report remains available on the free plan."}];function fc({item:t,isOpen:a,onToggle:s}){return(0,e.jsxs)("div",{className:"border-b border-white/[0.06] last:border-0",children:[(0,e.jsxs)("button",{onClick:s,className:"w-full flex items-center justify-between py-5 text-left group",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-white/80 group-hover:text-white transition-colors pr-4",children:t.q}),(0,e.jsx)("span",{className:`text-white/30 shrink-0 transition-transform duration-200 ${a?"rotate-45":""}`,children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]}),(0,e.jsx)(se,{initial:!1,children:a&&(0,e.jsx)(f.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25},className:"overflow-hidden",children:(0,e.jsx)("p",{className:"text-sm text-white/40 leading-relaxed pb-5",children:t.a})})})]})}function yc(){const[t,a]=(0,o.useState)(null);return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,e.jsx)(xe,{badge:"FAQ",title:"Frequently asked questions",subtitle:"Everything you need to know about Redline."}),(0,e.jsx)("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] backdrop-blur-xl px-6",children:bc.map((s,n)=>(0,e.jsx)(fc,{item:s,isOpen:t===n,onToggle:()=>a(t===n?null:n)},n))})]})})}var vc="";function wc(){return(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsx)(xe,{badge:"Pricing",badgeVariant:"blue",title:"Simple, transparent pricing",subtitle:"Pick the plan that fits how you trade. Cancel anytime."}),(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:[{name:"Free Report",price:"$0",period:" forever",description:"Connect one broker and find the rules you broke last month. No card and no live intervention.",features:["30-day historical broker sync","Free violation report","Historical trade log","Core performance analytics","No live enforcement"],cta:"Get My Free Report",ctaLink:"/signup",variant:"default"},{name:"Pro",price:"$39",period:"/month",description:"Turn the free report into a live discipline system that intervenes while you trade.",features:["Live rule enforcement + cooldowns","Unlimited trade logging","Full analytics suite + equity curve","AI coaching (up to 100 calls/mo)","All violation types + remediation","Broker sync (TradeLocker, Schwab, SnapTrade)","Signal, Execution & Coach AI agents","Community + XP & gamification"],cta:"Get Started",ctaLink:"/signup",variant:"featured",badge:"Most Popular"},{name:"Elite",price:"$70",period:"/month",description:"For mentors, desks, and high-volume traders who need more.",features:["Everything in Pro","300 AI calls/month + priority processing","Mentor mode — up to 20 mentees","Violation rollup + cohort analytics","One private org with evaluation rules","PDF reports + data exports","Priority email support"],cta:"Get Elite",ctaLink:"/pricing?plan=elite",external:!!vc,variant:"default"},{name:"Mentor",price:"$150",period:"/month",description:"Run a paid trading group on top of the full platform.",features:["Everything in Elite","Mentor dashboard + member roster","Set your own group price","Private chat for paying members","Up to 250 mentees","Churn + revenue analytics","Automatic access control"],cta:"Get Started",ctaLink:"/signup",variant:"default"}].map((t,a)=>(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:a*.1},className:`relative group rounded-2xl border p-6 transition-all duration-300 ${t.variant==="featured"?"border-blue-500/30 bg-blue-500/[0.04] shadow-lg shadow-blue-500/10":"border-white/[0.06] bg-white/[0.02] hover:border-white/[0.12]"}`,children:[t.badge&&(0,e.jsx)("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:(0,e.jsx)(be,{variant:"blue",children:t.badge})}),(0,e.jsxs)("div",{className:"mb-6",children:[(0,e.jsx)("h3",{className:"text-lg font-semibold text-white/90 mb-1",children:t.name}),(0,e.jsx)("p",{className:"text-xs text-white/30 mb-4",children:t.description}),(0,e.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,e.jsx)("span",{className:"text-4xl font-bold text-white",children:t.price}),(0,e.jsx)("span",{className:"text-sm text-white/30",children:t.period})]})]}),(0,e.jsx)("ul",{className:"space-y-3 mb-8",children:t.features.map(s=>(0,e.jsxs)("li",{className:"flex items-center gap-2.5 text-sm text-white/50",children:[(0,e.jsx)("svg",{className:"w-4 h-4 text-emerald-400 shrink-0",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s]},s))}),t.external?(0,e.jsx)("a",{href:t.ctaLink,target:"_blank",rel:"noopener noreferrer",className:`block w-full text-center py-2.5 rounded-xl text-sm font-medium transition-all ${t.variant==="featured"?"bg-white text-black hover:bg-white/90":"bg-white/[0.06] text-white/70 hover:bg-white/[0.1] hover:text-white border border-white/[0.08]"}`,children:t.cta}):(0,e.jsx)(q,{to:t.ctaLink,className:`block w-full text-center py-2.5 rounded-xl text-sm font-medium transition-all ${t.variant==="featured"?"bg-white text-black hover:bg-white/90":"bg-white/[0.06] text-white/70 hover:bg-white/[0.1] hover:text-white border border-white/[0.08]"}`,children:t.cta})]},t.name))})]})})}function jc(){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsxs)(f.div,{className:"max-w-3xl mx-auto text-center",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.7},children:[(0,e.jsx)("div",{className:"text-5xl mb-6 opacity-20",children:"“"}),(0,e.jsxs)("blockquote",{className:"text-2xl sm:text-3xl font-medium text-white/60 leading-relaxed mb-6",children:["Most traders don't fail from bad strategies.",(0,e.jsx)("br",{}),(0,e.jsx)("span",{className:"text-white/90",children:"They fail from rules they don't follow."})]}),(0,e.jsx)("p",{className:"text-sm text-white/20",children:"This is why Redline exists."})]})}),(0,e.jsx)("section",{className:"relative z-10 px-6 py-24",children:(0,e.jsx)(f.div,{className:"max-w-3xl mx-auto",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:(0,e.jsx)(Sl,{children:(0,e.jsxs)("div",{className:"text-center py-8",children:[(0,e.jsx)("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Ready to protect your capital?"}),(0,e.jsx)("p",{className:"text-white/40 mb-8 max-w-md mx-auto",children:"Join traders using the operating system built for trading discipline. Pick a plan and enforce your rules from day one."}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[(0,e.jsxs)(q,{to:"/signup",className:"group px-8 py-3.5 bg-white text-black font-medium rounded-xl hover:bg-white/90 transition-all text-sm inline-flex items-center gap-2 shadow-lg shadow-white/10",children:["Get Started",(0,e.jsx)("svg",{className:"w-4 h-4 group-hover:translate-x-0.5 transition-transform",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"})})]}),(0,e.jsx)(q,{to:"/pricing",className:"px-8 py-3.5 text-white/50 font-medium rounded-xl border border-white/[0.08] hover:border-white/[0.15] hover:text-white/80 hover:bg-white/[0.03] transition-all text-sm",children:"Compare Plans"})]})]})})})})]})}var kc=[{headingKey:"product",links:[{to:"/pricing",labelKey:"pricing"},{to:"/signup",labelKey:"signUp"},{to:"/signin",labelKey:"login"}]},{headingKey:"solutionsHeading",links:[{to:"/for-prop-firms",labelKey:"propFirms"},{to:"/for-coaches",labelKey:"educators"},{action:"contact",labelKey:"contactSales"}]},{headingKey:"resources",links:[{href:"https://discord.gg/redline",label:"Discord Community",external:!0},{to:"/education",labelKey:"educationHub"},{to:"/support",labelKey:"support"},{to:"/feedback",labelKey:"giveFeedback"}]},{headingKey:"legal",links:[{to:"/privacy",labelKey:"privacyPolicy"},{to:"/terms",labelKey:"terms"}]}],Nc=[{href:"https://discord.gg/redline",label:"Discord",Icon:$i},{href:"mailto:[email protected]",label:"Email",Icon:sa}];function Sc({link:t,onContact:a,t:s}){const n="group inline-flex items-center gap-1 text-sm text-white/35 transition-colors hover:text-white",r=t.labelKey?s(`publicChrome.${t.labelKey}`):t.label;return t.action==="contact"?(0,e.jsx)("button",{type:"button",onClick:a,className:`${n} text-left`,children:r}):t.external||t.href?(0,e.jsxs)("a",{href:t.href,target:t.external?"_blank":void 0,rel:t.external?"noopener noreferrer":void 0,className:n,children:[r,t.external&&(0,e.jsx)(ao,{className:"h-3 w-3 opacity-0 -translate-y-
257px transition group-hover:opacity-60"})]}):(0,e.jsx)(q,{to:t.to,className:n,children:r})}function Cc(){const{t}=ye(),[a,s]=(0,o.useState)(!1);return(0,e.jsxs)("footer",{className:"relative z-10 overflow-hidden border-t border-white/[0.07]",role:"contentinfo",children:[(0,e.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#da0b3f]/40 to-transparent"}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-40 bg-[radial-gradient(60%_100%_at_50%_0%,rgba(218,11,63,0.06),transparent_70%)]"}),(0,e.jsxs)("div",{className:"relative mx-auto max-w-7xl px-6 pt-16 pb-10",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-10 md:grid-cols-6 md:gap-8",children:[(0,e.jsxs)("div",{className:"col-span-2 md:col-span-2",children:[(0,e.jsxs)("div",{className:"mb-4 flex items-center gap-2.5",children:[(0,e.jsx)("img",{src:"/RedlineOS_AppIcon_1024x1024.png",alt:"Redline",className:"h-7 w-7 rounded-lg object-contain"}),(0,e.jsx)("span",{className:"text-base font-bold tracking-tight text-white",children:"Redline"})]}),(0,e.jsx)("p",{className:"max-w-[260px] text-sm leading-relaxed text-white/40",children:t("publicChrome.footerSummary")}),(0,e.jsxs)("div",{className:"mt-5 inline-flex items-center gap-2 rounded-full border border-white/12 bg-white/[0.04] px-3 py-1.5",children:[(0,e.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,e.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-400"})]}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-[#dfe7f0]",children:[(0,e.jsx)(ra,{className:"h-3.5 w-3.5 text-emerald-300"}),t("publicChrome.enforcementOn")]})]}),(0,e.jsx)("div",{className:"mt-6 flex items-center gap-2.5",children:Nc.map(({href:n,label:r,Icon:i})=>(0,e.jsx)("a",{href:n,target:n.startsWith("http")?"_blank":void 0,rel:n.startsWith("http")?"noopener noreferrer":void 0,"aria-label":r==="Discord"?"Discord":t("publicChrome.contact"),className:"flex h-9 w-9 items-center justify-center rounded-xl border border-white/10 bg-white/[0.03] text-white/45 transition-all hover:border-white/25 hover:bg-white/[0.07] hover:text-white",children:(0,e.jsx)(i,{className:"h-4 w-4"})},r))})]}),kc.map(n=>(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"mb-4 text-[11px] font-bold uppercase tracking-[0.16em] text-white/45",children:t(`publicChrome.${n.headingKey}`)}),(0,e.jsx)("nav",{className:"flex flex-col gap-2.5","aria-label":`${t(`publicChrome.${n.headingKey}`)} links`,children:n.links.map(r=>(0,e.jsx)(Sc,{link:r,t,onContact:()=>s(!0)},r.labelKey||r.label))})]},n.headingKey))]}),(0,e.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none relative mt-14 select-none",children:(0,e.jsx)("div",{className:"bg-gradient-to-b from-white/[0.055] to-transparent bg-clip-text text-center text-[clamp(3rem,17vw,13rem)] font-black leading-none tracking-tighter text-transparent",children:"REDLINE"})}),(0,e.jsxs)("div",{className:"mt-4 flex flex-col gap-4 border-t border-white/[0.06] pt-6 md:flex-row md:items-center md:justify-between",children:[(0,e.jsxs)("p",{className:"text-[11px] text-white/20",children:["© ",new Date().getFullYear()," Redline Trading OS. ",t("publicChrome.rights")]}),(0,e.jsx)("p",{className:"max-w-2xl text-[11px] leading-relaxed text-white/18 md:text-right",children:t("publicChrome.disclaimer")})]})]}),(0,e.jsx)(Ts,{isOpen:a,onClose:()=>s(!1),audience:"general"})]})}var Tc=(0,o.lazy)(()=>$(()=>import("./WaveBackground-C4BlsBTe.js").then(t=>t.t).then(t=>({default:t.WaveBackground})),__vite__mapDeps([13,2,3,1,4])));function Rc({t}){return(0,e.jsx)("div",{className:"relative z-10 mx-auto max-w-7xl px-6 pt-24 pb-2 sm:pt-28",children:(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-white/12"}),(0,e.jsx)("span",{className:"text-center text-[11px] font-semibold uppercase tracking-[0.22em] text-white/38",children:t("landingPage.supportDivider")}),(0,e.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-white/12"})]})})}function Wa(){const{t}=ye();return(0,o.useEffect)(()=>{window.trackdesk?.("redlineos","click")},[]),(0,e.jsxs)("div",{className:"public-page landing-21st min-h-screen bg-[#08090d] text-white selection:bg-[#da0b3f]/30 selection:text-white",children:[(0,e.jsx)("div",{className:"fixed inset-0 z-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px)",backgroundSize:"28px 28px"}}),(0,e.jsx)("div",{className:"fixed inset-x-0 top-0 h-[70vh] pointer-events-none z-0",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(146,155,170,0.035) 42%, rgba(8,9,13,0) 100%)"}}),(0,e.jsx)("div",{className:"fixed inset-0 pointer-events-none z-0 opacity-70",style:{background:"linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.035) 31%, transparent 48%, rgba(173,185,199,0.035) 66%, transparent 100%)"}}),(0,e.jsx)("div",{className:"fixed bottom-0 inset-x-0 h-[44vh] pointer-events-none z-0 opacity-90","aria-hidden":"true",children:(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(Tc,{className:"w-full h-full",color:"rgba(188,198,210,",edgeColor:"rgba(255,255,255,0.16)",lineCount:9,amplitude:28,speed:.8})})}),(0,e.jsx)(Rs,{}),(0,e.jsx)(Ll,{}),(0,e.jsx)(uc,{}),(0,e.jsx)(Wl,{}),(0,e.jsx)($l,{}),(0,e.jsx)(Fl,{}),(0,e.jsx)(zl,{}),(0,e.jsx)(Rc,{t}),(0,e.jsx)(El,{}),(0,e.jsx)(lc,{}),(0,e.jsx)(Bl,{}),(0,e.jsx)(Ml,{}),(0,e.jsx)(rc,{}),(0,e.jsx)(mc,{}),(0,e.jsx)(Ul,{}),(0,e.jsx)(gc,{}),(0,e.jsx)(wc,{}),(0,e.jsx)(yc,{}),(0,e.jsx)(jc,{}),(0,e.jsx)(Cc,{}),(0,e.jsx)("style",{children:`
258        @property --beam-angle {
259          syntax: '<angle>';
260          initial-value: 0deg;
261          inherits: false;
262        }
263        .beam-border::before {
264          content: '';
265          position: absolute;
266          inset: 0;
267          border-radius: inherit;
268          padding: 1px;
269          background: conic-gradient(
270            from var(--beam-angle, 0deg),
271            transparent 0%,
272            rgba(218,11,63,0.3) 10%,
273            rgba(168,85,247,0.2) 20%,
274            transparent 30%
275          );
276          -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
277          -webkit-mask-composite: xor;
278          mask-composite: exclude;
279          animation: beam-rotate 4s linear infinite;
280        }
281        @keyframes beam-rotate { to { --beam-angle: 360deg; } }
282        .landing-21st {
283          -webkit-font-smoothing: antialiased;
284          -moz-osx-font-smoothing: grayscale;
285        }
286      `})]})}var Ge=!1,Bs=[{value:"Complete Beginner",key:"beginner"},{value:"Some Knowledge",key:"someKnowledge"},{value:"Intermediate",key:"intermediate"}],Ec="/redline-trading-blueprint.pdf",Ac=Ge?new Date(null).getTime():null;function Ua(){const t=Ac-Date.now();return t<=0?null:{days:Math.floor(t/864e5),hours:Math.floor(t%864e5/36e5),minutes:Math.floor(t%36e5/6e4),seconds:Math.floor(t%6e4/1e3),diff:t}}function Ic({c:t,t:a}){if(!t)return(0,e.jsxs)("div",{style:Me.wrap,children:[(0,e.jsx)("div",{style:{fontSize:11,letterSpacing:"0.2em",color:"#22C55E",marginBottom:4},children:a("classRsvp.happeningNow")}),(0,e.jsx)("div",{style:{fontSize:13,color:"#aaa"},children:a("classRsvp.classLive")})]});const s=t.diff<36e5,n=t.diff<6e5;return(0,e.jsxs)("div",{style:{...Me.wrap,borderColor:n?"#EF4444":s?"#f97316":"#1E2328",boxShadow:n?"0 0 24px rgba(239,68,68,0.25)":s?"0 0 16px rgba(249,115,22,0.15)":"none",transition:"all 0.5s ease"},children:[(0,e.jsx)("div",{style:{fontSize:9,letterSpacing:"0.22em",color:n?"#EF4444":s?"#f97316":"#da0b3f",marginBottom:10},children:a(n?"classRsvp.startingSoon":s?"classRsvp.lastChance":"classRsvp.beginsIn")}),(0,e.jsxs)("div",{style:Me.grid,children:[t.days>0&&(0,e.jsx)(ht,{n:t.days,label:a("classRsvp.days"),urgent:s}),(0,e.jsx)(ht,{n:t.hours,label:a("classRsvp.hours"),urgent:s}),(0,e.jsx)(ht,{n:t.minutes,label:a("classRsvp.minutesShort"),urgent:s}),(0,e.jsx)(ht,{n:t.seconds,label:a("classRsvp.seconds"),urgent:s,blink:!0})]}
286),t.days===0&&t.hours===0&&(0,e.jsx)("div",{style:{fontSize:10,color:"#EF4444",marginTop:8,letterSpacing:"0.1em",animation:"pulse 1s infinite"},children:a("classRsvp.hurry")})]})}function ht({n:t,label:a,urgent:s,blink:n}){return(0,e.jsxs)("div",{style:Me.unit,children:[(0,e.jsx)("div",{style:{...Me.num,color:s?n?"#EF4444":"#f97316":"#F0F0F0",transition:"color 0.3s"},children:String(t).padStart(2,"0")}),(0,e.jsx)("div",{style:Me.label,children:a})]})}var Me={wrap:{background:"#0A0C0F",border:"1px solid #1E2328",padding:"16px 18px",marginBottom:24,textAlign:"center"},grid:{display:"flex",justifyContent:"center",gap:12},unit:{display:"flex",flexDirection:"column",alignItems:"center",minWidth:48},num:{fontSize:"clamp(22px, 6vw, 32px)",fontWeight:"bold",fontFamily:"'SF Mono', 'Fira Code', monospace",lineHeight:1},label:{fontSize:8,letterSpacing:"0.2em",color:"#444",marginTop:4}},_c=6;function Pc(){const{t,i18n:a}=ye(),s=t("classRsvp.modules",{returnObjects:!0}),[n,r]=(0,o.useState)({name:"",email:"",experience:""}),[i,c]=(0,o.useState)(!1),[d,l]=(0,o.useState)(""),[x,h]=(0,o.useState)(!1),[m,p]=(0,o.useState)(!1),[g,k]=(0,o.useState)(null),[v,u]=(0,o.useState)(Ua()),[E,C]=(0,o.useState)(()=>window.innerWidth<768);(0,o.useEffect)(()=>{const w=setInterval(()=>u(Ua()),1e3);return()=>clearInterval(w)},[]),(0,o.useEffect)(()=>{const w=()=>C(window.innerWidth<768);return window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);async function y(){if(!n.name.trim()){l(t("classRsvp.enterName"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.email)){l(t("classRsvp.validEmail"));return}if(!n.experience){l(t("classRsvp.chooseExperience"));return}l(""),c(!0);try{const{data:w}=await dr(nr,"submitClassRsvp")({name:n.name.trim(),email:n.email.trim(),experience:n.experience});w.alreadyRegistered&&p(!0),h(!0)}catch(w){console.error("[ClassRsvpPage] RSVP submission failed",w),l(t("classRsvp.submitFailed"))}finally{c(!1)}}return(0,e.jsxs)("div",{style:L.root,children:[(0,e.jsxs)("div",{style:L.topBar,children:[(0,e.jsxs)("div",{style:L.topLeft,children:[(0,e.jsx)("img",{src:"/RedlineOS_AppIcon_1024x1024.png",alt:"Redline",style:{width:22,height:22,borderRadius:4}}),(0,e.jsx)("span",{style:L.appName,children:"RedlineOS"}),!E&&(0,e.jsx)("span",{style:L.appSub,children:"Behavioral Enforcement"})]}),(0,e.jsxs)("div",{style:L.statusPill,children:[(0,e.jsx)("div",{style:L.statusDot}),t("classRsvp.liveClass")]})]}),(0,e.jsxs)("div",{style:{...L.body,gridTemplateColumns:E?"1fr":"1fr 340px"},children:[E&&(0,e.jsxs)("div",{style:{...L.rightPanel,borderLeft:"none",borderBottom:"1px solid #1E2328"},children:[(0,e.jsx)("div",{style:L.panelHeader,children:(0,e.jsx)("span",{style:L.panelTitle,children:t("classRsvp.reserveTitle")})}),x?(0,e.jsx)(Va,{email:n.email,alreadyReg:m}):(0,e.jsx)(Lc,{form:n,setForm:r,loading:i,error:d,handleSubmit:y,t})]}),(0,e.jsxs)("div",{style:{...L.leftPanel,padding:E?"24px 18px":"32px 28px",borderRight:E?"none":"1px solid #1E2328"},children:[(0,e.jsx)("div",{style:L.sectionLabel,children:t("classRsvp.virtualClass")}),(0,e.jsxs)("div",{style:{...L.classTitle,fontSize:E?28:34},children:[t("classRsvp.headline"),(0,e.jsx)("br",{}),(0,e.jsx)("span",{style:L.classTitleRed,children:t("classRsvp.headlineAccent")})]}),(0,e.jsx)("div",{style:L.classDesc,children:t("classRsvp.intro")}),(0,e.jsxs)("div",{style:L.metaBlock,children:[(0,e.jsxs)("div",{style:L.metaRow,children:[(0,e.jsx)("span",{style:L.metaKey,children:t("classRsvp.date")}),"     ",(0,e.jsx)("span",{style:L.metaVal,children:t("classRsvp.nextTba")})]}),(0,e.jsxs)("div",{style:L.metaRow,children:[(0,e.jsx)("span",{style:L.metaKey,children:t("classRsvp.format")}),"   ",(0,e.jsx)("span",{style:L.metaVal,children:t("classRsvp.virtualLive")})]}),(0,e.jsxs)("div",{style:L.metaRow,children:[(0,e.jsx)("span",{style:L.metaKey,children:t("classRsvp.duration")})," ",(0,e.jsx)("span",{style:L.metaVal,children:t("classRsvp.minutes",{count:40})})]}),(0,e.jsxs)("div",{style:L.metaRow,children:[(0,e.jsx)("span",{style:L.metaKey,children:t("classRsvp.cost")}),"     ",(0,e.jsx)("span",{style:{...L.metaVal,color:"#22C55E"},children:t("classRsvp.free")})]})]}),Ge?(0,e.jsx)(Ic,{c:v,t}):(0,e.jsxs)("div",{style:{...Me.wrap},children:[(0,e.jsx)("div",{style:{fontSize:11,letterSpacing:"0.2em",color:"#da0b3f",marginBottom:4},children:t("classRsvp.nextTba")}),(0,e.jsx)("div",{style:{fontSize:13,color:"#aaa"},children:t("classRsvp.nextTbaBody")})]}),(0,e.jsx)("div",{style:L.sectionLabel,children:t("classRsvp.curriculum")}),s.slice(0,_c).map((w,N)=>{const b=String(N+1).padStart(2,"0"),j=g===N;return(0,e.jsxs)("div",{style:{...L.currItem,flexDirection:"column",gap:0,paddingBottom:0},children:[(0,e.jsxs)("button",{onClick:()=>k(j?null:N),style:L.currHeader,children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
286p:14,flex:1,textAlign:"left"},children:[(0,e.jsx)("span",{style:L.currNum,children:b}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{style:L.currTitle,children:w.title}),(0,e.jsx)("div",{style:L.currDesc,children:w.desc})]})]}),(0,e.jsx)("span",{style:{color:"#da0b3f",fontSize:14,marginLeft:8,flexShrink:0},children:j?"▲":"▼"})]}),j&&(0,e.jsx)("div",{style:L.currDrawer,children:w.chapters.map((T,z)=>(0,e.jsxs)("div",{style:L.currChapter,children:[(0,e.jsx)("span",{style:L.currChapterDot}),T]},z))})]},b)}),(0,e.jsx)("a",{href:Ec,download:"Redline-Trading-Blueprint.pdf",style:L.downloadBtn,children:t("classRsvp.downloadBlueprint")})]}),!E&&(0,e.jsxs)("div",{style:L.rightPanel,children:[(0,e.jsx)("div",{style:L.panelHeader,children:(0,e.jsx)("span",{style:L.panelTitle,children:t("classRsvp.reserveTitle")})}),x?(0,e.jsx)(Va,{email:n.email,alreadyReg:m}):(0,e.jsxs)("div",{style:L.formBody,children:[(0,e.jsx)(Ye,{label:t("classRsvp.fullName"),children:(0,e.jsx)("input",{style:L.input,placeholder:t("classRsvp.namePlaceholder"),value:n.name,disabled:i,onChange:w=>r(N=>({...N,name:w.target.value}))})}),(0,e.jsx)(Ye,{label:t("classRsvp.emailAddress"),children:(0,e.jsx)("input",{style:L.input,type:"email",placeholder:t("classRsvp.emailPlaceholder"),value:n.email,disabled:i,onChange:w=>r(N=>({...N,email:w.target.value}))})}),(0,e.jsx)(Ye,{label:t("classRsvp.experienceLevel"),children:(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:Bs.map(({value:w,key:N})=>(0,e.jsx)("button",{disabled:i,onClick:()=>r(b=>({...b,experience:w})),style:n.experience===w?L.pillOn:L.pillOff,children:t(`classRsvp.${N}`)}
286,w))})}),d&&(0,e.jsx)("div",{style:L.error,children:d}),(0,e.jsx)("button",{onClick:y,disabled:i,style:i?L.btnDisabled:L.btnGreen,children:t(i?"classRsvp.reserveLoading":"classRsvp.reserveAction")}),(0,e.jsx)("div",{style:L.divider}),(0,e.jsxs)("div",{style:L.footerRow,children:[(0,e.jsx)("div",{style:L.footerDot}),(0,e.jsx)("span",{style:L.footerText,children:t("classRsvp.footer")})]}),(0,e.jsx)("div",{style:{fontSize:10,color:"#333",marginTop:4},children:t("classRsvp.confirmationSent")})]})]})]})]})}function Lc({form:t,setForm:a,loading:s,error:n,handleSubmit:r,t:i}){return(0,e.jsxs)("div",{style:{padding:"16px 18px 24px"},children:[(0,e.jsx)(Ye,{label:i("classRsvp.fullName"),children:(0,e.jsx)("input",{style:L.input,placeholder:i("classRsvp.namePlaceholder"),value:t.name,disabled:s,onChange:c=>a(d=>({...d,name:c.target.value}))})}),(0,e.jsx)(Ye,{label:i("classRsvp.emailAddress"),children:(0,e.jsx)("input",{style:L.input,type:"email",placeholder:i("classRsvp.emailPlaceholder"),value:t.email,disabled:s,onChange:c=>a(d=>({...d,email:c.target.value}))})}),(0,e.jsx)(Ye,{label:i("classRsvp.experienceLevel"),children:(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:Bs.map(({value:c,key:d})=>(0,e.jsx)("button",{disabled:s,onClick:()=>a(l=>({...l,experience:c})),style:t.experience===c?L.pillOn:L.pillOff,children:i(`classRsvp.${d}`)},c))})}),n&&(0,e.jsx)("div",{style:L.error,children:n}),(0,e.jsx)("button",{onClick:r,disabled:s,style:s?L.btnDisabled:L.btnGreen,children:i(s?"classRsvp.reserveLoading":"classRsvp.reserveAction")}),(0,e.jsx)("div",{style:{fontSize:10,color:"#333",marginTop:8,textAlign:"center"},children:i("classRsvp.confirmationSent")})]})}function Ye({label:t,children:a}){return(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsx)("div",{style:L.fieldLabel,children:t}),a]})}function Va({email:t,alreadyReg:a}){const{t:s}=ye();return(0,e.jsxs)("div",{style:L.successWrap,children:[(0,e.jsx)("div",{style:L.successCheck,children:"✓"}),(0,e.jsx)("div",{style:L.successTitle,children:s(a?"classRsvp.alreadyRegistered":"classRsvp.registered")}),(0,e.jsx)("div",{style:{fontSize:12,color:"#888",marginBottom:6},children:t}),(0,e.jsx)("div",{style:{fontSize:11,color:"#555",marginBottom:24,lineHeight:1.6},children:s("classRsvp.checkInbox",{calendar:Ge?s("classRsvp.calendarInvite"):""})}),!Ge&&(0,e.jsx)("div",{style:{fontSize:11,color:"#888",marginBottom:24,lineHeight:1.6},children:s("classRsvp.noSession")}),Ge&&(0,e.jsxs)("div",{style:L.zoomCard,children:[(0,e.jsx)("div",{style:{fontSize:9,letterSpacing:"0.18em",color:"#da0b3f",marginBottom:12},children:s("classRsvp.zoomDetails")}),(0,e.jsx)("a",{href:"",target:"_blank",rel:"noopener noreferrer",style:L.zoomBtn,children:s("classRsvp.joinZoom")}),(0,e.jsxs)("div",{style:{fontSize:11,color:"#666",marginTop:14},children:[s("classRsvp.meetingId")," ",(0,e.jsx)("span",{style:{color:"#aaa",fontFamily:"monospace"},children:""})]}),!1]}),Ge&&(0,e.jsx)("div",{style:{fontSize:10,color:"#444",marginTop:20},children:s("classRsvp.reminder")})]})}var L={root:{minHeight:"100vh",background:"#0D0F12",color:"#E8E8E8",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace",display:"flex",flexDirection:"column"},topBar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px",background:"#111418",borderBottom:"1px solid #1E2328",position:"sticky",top:0,zIndex:10},topLeft:{display:"flex",alignItems:"center",gap:10},appName:{fontSize:13,fontWeight:"bold",letterSpacing:"0.08em",color:"#F0F0F0"},appSub:{fontSize:11,color:"#555",marginLeft:4},statusPill:{display:"flex",alignItems:"center",gap:6,background:"rgba(218,11,63,0.12)",border:"1px solid rgba(218,11,63,0.3)",borderRadius:4,padding:"3px 10px",fontSize:10,color:"#da0b3f",letterSpacing:"0.12em"},statusDot:{width:6,height:6,borderRadius:"50%",background:"#da0b3f"},body:{display:"grid",gridTemplateColumns:"1fr 340px",flex:1},leftPanel:{padding:"32px 28px",borderRight:"1px solid #1E2328",overflowY:"auto"},sectionLabel:{fontSize:10,letterSpacing:"0.2em",color:"#da0b3f",marginBottom:12,marginTop:8},classTitle:{fontSize:34,fontWeight:"bold",lineHeight:1.2,marginBottom:12,color:"#F8F8F8",fontFamily:"'SF Pro Display', 'Georgia', serif"},classTitleRed:{color:"#da0b3f"},classDesc:{fontSize:13,color:"#888",lineHeight:1.7,marginBottom:24,maxWidth:520},metaBlock:{background:"#111418",border:"1px solid #1E2328",padding:"14px 18px",marginBottom:28},metaRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 0",borderBottom:"1px solid #1A1E24"},metaKey:{fontSize:10,letterSpacing:"0.15em",color:"#555"},metaVal:{fontSize:12,color:"#C0C0C0",fontWeight:"bold"},currItem:{display:"flex",gap:14,marginBottom:8,paddingBottom:8,borderBottom:"1px solid #1A1E24"},currHeader:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",background:"transparent",border:"none",color:"inherit",curs
286or:"pointer",padding:"10px 0",width:"100%",fontFamily:"inherit"},currDrawer:{paddingLeft:38,paddingBottom:12,display:"flex",flexDirection:"column",gap:8},currChapter:{display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:"#888",lineHeight:1.5},currChapterDot:{width:4,height:4,borderRadius:"50%",background:"#da0b3f",marginTop:6,flexShrink:0},downloadBtn:{display:"block",marginTop:20,marginBottom:8,background:"#0D0F12",border:"1px solid #da0b3f",color:"#da0b3f",padding:"11px 16px",fontSize:11,fontWeight:"bold",letterSpacing:"0.08em",textDecoration:"none",textAlign:"center",cursor:"pointer"},currNum:{fontSize:10,color:"#da0b3f",minWidth:24,paddingTop:2},currTitle:{fontSize:13,fontWeight:"bold",color:"#E0E0E0",marginBottom:3},currDesc:{fontSize:12,color:"#666",lineHeight:1.5},rightPanel:{background:"#111418",borderLeft:"1px solid #1E2328",display:"flex",flexDirection:"column"},panelHeader:{padding:"14px 18px",borderBottom:"1px solid #1E2328"},panelTitle:{fontSize:10,letterSpacing:"0.2em",color:"#da0b3f"},formBody:{padding:"18px",display:"flex",flexDirection:"column",flex:1},fieldLabel:{fontSize:9,letterSpacing:"0.18em",color:"#555",marginBottom:6},input:{width:"100%",background:"#0D0F12",border:"1px solid #1E2328",color:"#E0E0E0",padding:"10px 12px",fontSize:12,outline:"none",boxSizing:"border-box",fontFamily:"inherit"},pillOff:{background:"transparent",border:"1px solid #1E2328",color:"#666",padding:"8px 12px",fontSize:11,cursor:"pointer",textAlign:"left",fontFamily:"inherit",letterSpacing:"0.05em",width:"100%"},pillOn:{background:"rgba(218,11,63,0.12)",border:"1px solid #da0b3f",color:"#F0F0F0",padding:"8px 12px",fontSize:11,cursor:"pointer",textAlign:"left",fontFamily:"inherit",letterSpacing:"0.05em",width:"100%"},error:{color:"#da0b3f",fontSize:11,marginBottom:12,letterSpacing:"0.05em"},btnGreen:{width:"100%",background:"#22C55E",color:"#000",border:"none",padding:"12px",fontSize:11,fontWeight:"bold",letterSpacing:"0.15em",cursor:"pointer",marginBottom:10,fontFamily:"inherit"},btnDisabled:{width:"100%",background:"#1A2A1A",color:"#555",border:"none",padding:"12px",fontSize:11,letterSpacing:"0.15em",cursor:"not-allowed",marginBottom:10,fontFamily:"inherit"},divider:{height:1,background:"#1E2328",margin:"8px 0 14px"},footerRow:{display:"flex",alignItems:"center",gap:6,marginBottom:4},footerDot:{width:6,height:6,borderRadius:"50%",background:"#da0b3f"},footerText:{fontSize:10,color:"#444",letterSpacing:"0.08em"},successWrap:{padding:"32px 18px",flex:1,display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},successCheck:{width:48,height:48,borderRadius:"50%",background:"#22C55E",color:"#000",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,fontWeight:"bold",margin:"0 auto 16px"},successTitle:{fontSize:18,fontWeight:"bold",color:"#F0F0F0",marginBottom:8},zoomCard:{background:"#0D0F12",border:"1px solid #1E2328",padding:"16px 20px",width:"100%",textAlign:"left"},zoomBtn:{display:"block",background:"#da0b3f",color:"#fff",padding:"10px 16px",fontSize:11,fontWeight:"bold",letterSpacing:"0.12em",textDecoration:"none",textAlign:"center"}},Mc=typeof window<"u"&&window.Capacitor?.isNativePlatform?.(),zs="https://us-central1-tradeintexd.cloudfunctions.net",Dc=Mc?`${zs}/schwabToken`:"/schwab/token",Ha=()=>{const{t}=ye(),a=me(),[s]=es(),[n,r]=(0,o.useState)("processing"),[i,c]=(0,o.useState)(""),d=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(d.current)return;d.current=!0;const x=s.get("code"),h=s.get("state");if(console.log("[AuthCallback] Params:",{code:x?`${x.slice(0,10)}…`:null,state:h?`${h.slice(0,10)}…`:null}),!x||!h){r("error"),c("schwabCallbackPage.missingCode");return}l(x,h)},[]);const l=async(x,h)=>{try{r("processing"),console.log("[AuthCallback] Calling schwabToken via same-origin rewrite…");const m=await fetch(Dc,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:x,state:h})});console.log("[AuthCallback] Response status:",m.status);const p=await m.json();if(!m.ok||!p.success)throw new Error(p.error||p.details||"Token exchange failed");r("success");try{Ne.getState().updateBrokerageConnection?.("schwab",{connected:!0,accountId:p.accountId||p.accountNumber||null})}catch(v){console.warn("[AuthCallback] authStore sync error (non-fatal):",v)}Za.brokerConnected("schwab"),localStorage.removeItem("schwabOAuthPending"),localStorage.setItem("openSettingsForBroker","schwab");const g=(()=>{try{return localStorage.getItem("redline_onboarding_pending_oauth")}catch{return null}})();try{const v=localStorage.getItem("redline_onboarding_lookback_days");if(localStorage.getItem("redline_onboarding_broker")==="schwab"&&v!=null&&v!==""){const u=Math.max(0,parseInt(v,10)||0),E=p.brokerAccountId||p.accountId||p.accountNumber||null;E&&u>0&&fetch(`${zs}/schwabSyncTrades`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({brokerAccountId:E,days:u})}).catch(C=>console.warn("[AuthCallback] onboarding sync override failed:",C?.message))}}catch(v){console.warn("[AuthCallback] onboarding lookback handling error (non-fatal):",v)}finally{try{localStorage.removeItem("redline_onboarding_lookback_days"),localStorage.removeItem("redline_onboarding_broker"),localStorage.removeItem("redline_onboarding_pending_oauth")}catch{}}const k=g==="1";setTimeout(()=>{k?a("/onboarding?brokerConnected=schwab",{replace:!0}):a("/community",{replace:!0})},1500)}catch(m){console.error("[AuthCallback] Token exchange error:",m),localStorage.removeItem("schwabOAuthPending"),r("error"),c("schwabCallbackPage.exchangeFailed")}};return(0,e.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 px-4 safe-area-bottom",children:(0,e.jsxs)(f.div,{initial:{opacity:0,y:20}
286,animate:{opacity:1,y:0},className:"text-center w-full max-w-sm mx-auto",children:[(0,e.jsxs)("div",{className:"mb-8",children:[(0,e.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-blue-500 to-cyan-400 rounded-xl flex items-center justify-center mx-auto mb-4",children:(0,e.jsx)("span",{className:"text-white text-2xl font-bold",children:"TX"})}),(0,e.jsx)("h2",{className:"text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-cyan-300",children:"TradeIntelX"})]}),(0,e.jsxs)("div",{className:"bg-slate-800/50 border border-blue-500/20 p-8 rounded-xl shadow-xl w-full",children:[n==="processing"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 border-4 border-emerald-500/30 border-t-emerald-500 rounded-full animate-spin mb-4"}),(0,e.jsx)("h3",{className:"text-emerald-400 font-semibold text-lg mb-2",children:t("schwabCallbackPage.connecting")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm",children:t("schwabCallbackPage.importing")})]}),n==="success"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-emerald-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("svg",{className:"w-7 h-7 text-emerald-400",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,e.jsx)("h3",{className:"text-emerald-400 font-semibold text-lg mb-2",children:t("schwabCallbackPage.connected")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm",children:t("schwabCallbackPage.importingBackgroun
286d")})]}),n==="error"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-red-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("svg",{className:"w-7 h-7 text-red-400",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,e.jsx)("h3",{className:"text-red-400 font-semibold text-lg mb-2",children:t("schwabCallbackPage.failed")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:t(i,{defaultValue:i})}),(0,e.jsxs)("div",{className:"flex gap-3 w-full",children:[(0,e.jsx)("button",{onClick:()=>a("/",{replace:!0}),className:"flex-1 py-3 bg-slate-700 hover:bg-slate-600 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:t("schwabCallbackPage.goHome")}),(0,e.jsx)("button",{onClick:()=>a("/settings",{replace:!0}),className:"flex-1 py-3 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:t("schwabCallbackPage.tryAgain")})]})]})]})]})})},Fc=()=>{const t=me(),{t:a}=ye(),[s]=es(),[n,r]=(0,o.useState)("processing"),i=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(i.current)return;i.current=!0;const c=s.get("code"),d=s.get("state"),l=s.get("error");if(console.log("[WebullCallback] Params:",{hasCode:!!c,hasState:!!d,hasError:!!l}),l){r("denied");return}if(!c||!d){r("missing");return}(async()=>{try{r((await fetch("/webull/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:c,state:d})})).ok?"received":"error")}catch{r("error")}})()},[s]),(0,e.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 px-4 safe-area-bottom",children:(0,e.jsxs)(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center w-full max-w-sm mx-auto",children:[(0,e.jsxs)("div",{className:"mb-8",children:[(0,e.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-blue-500 to-cyan-400 rounded-xl flex items-center justify-center mx-auto mb-4",children:(0,e.jsx)("span",{className:"text-white text-2xl font-bold",children:"TX"})}),(0,e.jsx)("h2",{className:"text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-cyan-300",children:"TradeIntelX"})]}),(0,e.jsxs)("div",{className:"bg-slate-800/50 border border-blue-500/20 p-8 rounded-xl shadow-xl w-full",children:[n==="processing"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 border-4 border-emerald-500/30 border-t-emerald-500 rounded-full animate-spin mb-4"}),(0,e.jsx)("h3",{className:"text-emerald-400 font-semibold text-lg mb-2",children:"Webull"}),(0,e.jsx)("p",{className:"text-gray-400 text-sm",children:a("webullCallbackPage.processing")})]}),n==="received"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-emerald-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("svg",{className:"w-7 h-7 text-emerald-400",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,e.jsx)("h3",{className:"text-emerald-400 font-semibold text-lg mb-2",children:a("webullCallbackPage.received")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:a("webullCallbackPage.receivedMessage")}),(0,e.jsx)("button",{onClick:()=>t("/settings",{replace:!0}),className:"w-full py-3 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:a("webullCallbackPage.returnSettings")})]}),n==="missing"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-amber-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("svg",{className:"w-7 h-7 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}),(0,e.jsx)("h3",{className:"text-amber-400 font-semibold text-lg mb-2",children:a("webullCallbackPage.missing")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:a("webullCallbackPage.missingMessage")}),(0,e.jsx)("button",{onClick:()=>t("/settings",{replace:!0}),className:"w-full py-3 bg-slate-700 hover:bg-slate-600 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:a("webullCallbackPage.goSettings")})]}),n==="error"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-amber-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("span",{className:"text-amber-400 text-2xl","aria-hidden":"true",children:"!"})}),(0,e.jsx)("h3",{className:"text-amber-400 font-semibold text-lg mb-2",children:a("webullCallbackPage.error")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:a("webullCallbackPage.errorMessage")}),(0,e.jsx)("button",{onClick:()=>t("/settings",{replace:!0}),className:"w-full py-3 bg-slate-700 hover:bg-slate-600 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:a("webullCallbackPage.returnSettings")})]}),n==="denied"&&(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"w-12 h-12 bg-amber-500/20 rounded-full flex items-center justify-center mb-4",children:(0,e.jsx)("span",{className:"text-amber-400 text-2xl","aria-hidden":"true",children:"!"})}),(0,e.jsx)("h3",{className:"text-amber-400 font-semibold text-lg mb-2",children:a("webullCallbackPage.denied")}),(0,e.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:a("webullCallbackPage.deniedMessage")}),(0,e.jsx)("button",{onClick:()=>t("/settings",{replace:!0}),className:"w-full py-3 bg-slate-700 hover:bg-slate-600 text-white rounded-xl text-sm font-medium transition-colors min-h-[48px]",children:a("webullCallbackPage.returnSettings")})]})]})]})})},Oc={"/chat":"Chat & Messaging","/news":"News Intelligence","/admin":"Admin Panel","/trade-analytics":"Full Analytics Suite","/ai-copilot":"AI Coaching","/mentor":"Mentor Dashboard","/organization":"Organization Tools","/reports":"PDF Reports","/education/simulation":"Trading Simulation"},gt={none:{name:"Free Report",icon:"📋",price:"$0"},free:{name:"Free Report",icon:"📋",price:"$0"},pro:{name:"Pro",icon:"🚀",price:"$39/mo"},elite:{name:"Elite",icon:"👑",price:"$70/mo"},mentor:{name:"Mentor",icon:"🏆",price:null}},Ve={none:"text-slate-400",pro:"text-blue-400",elite:"text-purple-400",mentor:"text-amber-400"},$c=({requiredTier:t,currentTier:a,pageName:s,onClose:n})=>{const r=me(),[i,c]=(0,o.useState)(!1),d=gt[t]||gt.pro,l=gt[a]||gt.none,x=da[t]||da.pro;(0,o.useEffect)(()=>{const m=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${m}px`,document.body.style.width="100%",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,m)}},[]);const h=()=>{try{navigator.clipboard?.writeText("REDLINE26")}catch{}c(!0),setTimeout(()=>c(!1),2e3)};return(0,e.jsx)(f.div,{initial:{opacity:0}
286,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-black/70 backdrop-blur-sm",children:(0,e.jsxs)(f.div,{initial:{y:60,opacity:0},animate:{y:0,opacity:1},exit:{y:60,opacity:0},transition:{type:"spring",damping:28,stiffness:350},className:"relative w-full sm:max-w-lg bg-gradient-to-b from-slate-800 to-slate-900 rounded-t-2xl sm:rounded-2xl border border-slate-700/50 shadow-2xl max-h-[90dvh] flex flex-col overflow-hidden",children:[(0,e.jsx)("button",{onClick:n,className:"absolute top-4 right-4 p-2 rounded-full hover:bg-slate-700/50 transition-colors z-10",children:(0,e.jsx)(qe,{className:"w-5 h-5 text-slate-400"})}),(0,e.jsxs)("div",{className:"overflow-y-auto overscroll-contain flex-1",children:[(0,e.jsx)("div",{className:"sm:hidden w-10 h-1 bg-slate-600 rounded-full mx-auto mt-3 mb-1"}),(0,e.jsxs)("div",{className:"relative px-6 pt-6 pb-5 text-center",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-blue-500/10 to-transparent"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"w-14 h-14 mx-auto mb-3 rounded-2xl bg-gradient-to-br from-blue-500/20 to-purple-500/20 border border-blue-500/30 flex items-center justify-center",children:(0,e.jsx)(or,{className:"w-7 h-7 text-blue-400"})}),(0,e.jsx)("h2",{className:"text-xl font-bold text-white mb-1",children:"Upgrade Required"}),(0,e.jsxs)("p",{className:"text-slate-400 text-sm",children:[(0,e.jsx)("span",{className:"text-white font-semibold",children:s})," requires"," ",(0,e.jsx)("span",{className:`font-semibold ${Ve[t]||Ve.pro}`,children:d.name})," ","tier or higher"]})]})]}),(0,e.jsx)("div",{className:"px-6 pb-4",children:(0,e.jsxs)("div",{className:"flex items-center justify-center gap-4 p-4 rounded-xl bg-slate-800/50 border border-slate-700/50",children:[(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-2xl mb-1",children:l.icon}),(0,e.jsx)("div",{className:"text-xs text-slate-400",children:"Current"}),(0,e.jsx)("div",{className:`font-semibold text-sm ${Ve[a]||Ve.none}`,children:l.name})]}),(0,e.jsx)(xo,{className:"w-5 h-5 text-slate-500"}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-2xl mb-1",children:d.icon}),(0,e.jsx)("div",{className:"text-xs text-slate-400",children:"Required"}),(0,e.jsx)("div",{className:`font-semibold text-sm ${Ve[t]||Ve.pro}`,children:d.name})]})]})}),(0,e.jsxs)("div",{className:"px-6 pb-4",children:[(0,e.jsxs)("h3",{className:"text-xs font-semibold text-slate-300 mb-2 flex items-center gap-2",children:[(0,e.jsx)(rt,{className:"w-3.5 h-3.5 text-yellow-400"}),"What you'll unlock with ",d.name,":"]}),(0,e.jsx)("div",{className:"space-y-1.5",children:x.features?.slice(0,5).map((m,p)=>{const g=typeof m=="object"&&m!==null,k=g?m.name:m,v=g?m.included!==!1:!0,u=g?m.limit:null;return(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[v?(0,e.jsx)(rs,{className:"w-4 h-4 text-green-400 flex-shrink-0"}):(0,e.jsx)(qe,{className:"w-4 h-4 text-slate-500 flex-shrink-0"}),(0,e.jsxs)("span",{className:v?"text-slate-200":"text-slate-500",children:[k,u&&(0,e.jsxs)("span",{className:"text-slate-400 text-xs ml-1",children:["(",u,")"]})]})]},p)})})]}),(0,e.jsx)("div",{className:"px-6 pb-5",children:(0,e.jsxs)("div",{className:"p-4 rounded-xl bg-gradient-to-r from-emerald-500/10 to-green-500/10 border border-green-500/30",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,e.jsx)(Zi,{className:"w-4 h-4 text-green-400 flex-shrink-0"}),(0,e.jsx)("span",{className:"text-sm font-bold text-green-400",children:"🎉 Limited-Time Offer: 20% OFF"})]}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mb-3",children:"Enter code at checkout — 20% off your first month"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"flex-1 px-3 py-2 rounded-lg bg-slate-800 border border-slate-600 font-mono text-sm text-white text-center tracking-widest select-all",children:"REDLINE26"}),(0,e.jsx)("button",{onClick:h,className:"px-3 py-2 rounded-lg bg-green-500/20 border border-green-500/40 text-green-400 text-sm font-semibold hover:bg-green-500/30 active:scale-95 transition-all whitespace-nowrap min-w-[72px]",children:i?"✓ Copied":"Copy"})]})]})})]}),(0,e.jsxs)("div",{className:"flex-shrink-0 px-6 pt-4 space-y-3 border-t border-slate-700/50 bg-slate-900/90 backdrop-blur-sm",style:{paddingBottom:"max(1.5rem, env(safe-area-inset-bottom))"},children:[(0,e.jsxs)("button",{onClick:()=>
286r("/pricing?promo=REDLINE26"),className:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-blue-500 to-purple-500 text-white font-semibold hover:from-blue-600 hover:to-purple-600 active:scale-[0.98] transition-all flex items-center justify-center gap-2 shadow-lg shadow-blue-500/25",children:[(0,e.jsx)(lo,{className:"w-5 h-5"}),"Upgrade to ",d.name," — Save 20%"]}),(0,e.jsx)("button",{onClick:n,className:"w-full py-3 px-4 rounded-xl bg-slate-700/50 text-slate-300 font-medium hover:bg-slate-700 active:scale-[0.98] transition-all",children:"Go Back"}),(0,e.jsxs)("div",{className:"flex items-center justify-center gap-4 text-xs text-slate-500 pb-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(wt,{className:"w-3.5 h-3.5"}),(0,e.jsx)("span",{children:"Cancel anytime"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(rt,{className:"w-3.5 h-3.5"}),(0,e.jsx)("span",{children:"Instant access"})]})]})]})]})})},Bc=({children:t})=>{const a=fe(),s=me(),{pathname:n}=a,{user:r,loading:i}=Ne(),{tier:c,status:d,loading:l,isAdmin:x,subscribeToSubscription:h}=Ut(),[m,p]=(0,o.useState)(!1),g=n==="/"&&r?"/dashboard":zn(n),k=Sn(n,!!r);if((0,o.useEffect)(()=>{if(r?.uid){const C=h(r.uid);return()=>{typeof C=="function"&&C()}}},[r?.uid,h]),(0,o.useEffect)(()=>{if(l&&r){const C=setTimeout(()=>{console.warn("⚠️ Subscription loading timeout - treating as no subscription"),p(!0)},5e3);return()=>clearTimeout(C)}},[l,r]),k)return t;if(i)return null;if(!r)return t;if(l&&!m)return(0,e.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,e.jsx)("p",{className:"text-slate-400",children:"Loading your subscription..."})]})});if(x)return t;const v=Fn(c,d),u=Kn(v,g),E=Tn(g);if(console.log("🔒 SubscriptionGate Check:",{pathname:n,normalizedPath:g,effectiveTier:v,canAccess:u,requiredTier:E,isAdmin:x,subLoading:l,loadingTimeout:m,rawTier:c,status:d}),!u){const C=Oc[g]||"This feature";return Vn("upgrade_wall_hit",{feature:C,requiredTier:E,currentTier:v,path:g}),Za.upgradeModalShown(C,v),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-h-screen bg-slate-900 opacity-20 pointer-events-none",children:(0,e.jsxs)("div",{className:"max-w-7xl mx-auto p-6",children:[(0,e.jsx)("div",{className:"h-8 w-48 bg-slate-800 rounded mb-6 animate-pulse"}),(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3].map(y=>(0,e.jsx)("div",{className:"h-32 bg-slate-800 rounded-xl animate-pulse"},y))}),(0,e.jsx)("div",{className:"h-64 bg-slate-800 rounded-xl mt-6 animate-pulse"})]})}),(0,e.jsx)($c,{requiredTier:E,currentTier:v,pageName:C,onClose:()=>s("/pricing")})]})}return t};Tt();var zc=o.lazy(()=>$(()=>import("./OnboardingFlow-CzkwiWyl.js"),__vite__mapDeps([14,2,3,1,4,7,8,9,10,15,16]))),Wc=o.lazy(()=>$(()=>import("./OnboardingV2-Ct1Ue_Oz.js"),__vite__mapDeps([17,0,1,2,3,4,5,6,7,8,9,10,11,12,18,15,16,19]))),Uc=o.lazy(()=>$(()=>import("./OnboardingV3-CYEauCLq.js"),__vite__mapDeps([20,0,1,2,3,4,5,6,7,8,9,10,11,12,21,18,22,15,16,19]))),Vc=()=>{try{if(typeof window<"u"&&localStorage.getItem("rdl_onboarding_v2")==="off")return!1}catch{}return!0},Hc=()=>{try{if(typeof window<"u"&&localStorage.getItem("rdl_onboarding_v3")==="off")return!1}catch{}return!0},Gc=o.lazy(()=>$(()=>import("./ForPropFirms-Cu07cm1q.js"),__vite__mapDeps([23,2,3,1,4,24,7,8,9,10,22,13]))),Yc=o.lazy(()=>$(()=>import("./ForCoaches-CVRxdAVI.js"),__vite__mapDeps([25,2,3,1,4,24,7,8,9,10,22,13]))),qc=o.lazy(()=>$(()=>import("./SignUp-D1INrYwO.js"),__vite__mapDeps([26,0,1,2,3,4,5,6,7,8,9,10,11,12,27]))),Kc=o.lazy(()=>$(()=>import("./SignIn-ldd7uD4g.js"),__vite__mapDeps([28,0,1,2,3,4,5,6,7,8,9,10,11,12,29,18,27]))),Xc=o.lazy(()=>$(()=>import("./ForgotPassword-Bsr6c5Rq.js"),__vite__mapDeps([30,2,3,1,4,8,9]))),Qc=o.lazy(()=>$(()=>import("./CompleteProfile-xD1GLxjJ.js"),__vite__mapDeps([31,0,1,2,3,4,5,6,7,8,9,10,11,12,22]))),Jc=o.lazy(()=>$(()=>import("./PrivacyPolicy-DhEhF4Tl.js"),__vite__mapDeps([32,0,1,2,3,4,5,6,7,8,9,10,11,12,29,33]))),Zc=o.lazy(()=>$(()=>import("./TermsOfService-BWO1O7H3.js"),__vite__mapDeps([34,0,1,2,3,4,5,6,7,8,9,10,11,12,29,33]))),ed=o.lazy(()=>$(()=>import("./CookiePolicyPage-BO5gWtRk.js"),__vite__mapDeps([35,2,3,1,4,33]))),td=o.lazy(()=>$(()=>import("./DPAPage-alNBeVlh.js"),__vite__mapDeps([36,2,3,1,4,29,33]))),ad=o.lazy(()=>$(()=>import("./ProvisioningPage-D55X_jKw.js"),__vite__mapDeps([37,0,1,2,3,4,5,6,7,8,9,10,11,12]))),sd=o.lazy(()=>$(()=>import("./NotificationsPage-CTk8Hnya.js"),__vite__mapDeps([38,0,1,2,3,4,5,6,7,8,9,10,11,12]))),rd=o.lazy(()=>$(()=>import("./NotificationSettingsPage-MMENT5Ov.js"),__vite__mapDeps([39,2,3,1,4,40,29,7,8,9,10]))),Ga=o.lazy(()=>$(()=>import("./Dashboard-DwQu51WR.js"),__vite__mapDeps([41,0,1,2,3,4,5,6,7,8,9,10,11,12,29,22,42,43,18,44,45,46]))),nd=o.lazy(()=>$(()=>import("./TodayPage-Bl1dxYuv.js"),__vite__mapDeps([47,0,1,2,3,4,5,6,7,8,9,10,11,12,29,18,48,49,50,51,45,22,52,42,43,44,46,53,54]))),id=o.lazy(()=>$(()=>import("./EnforcementDashboard-Cb1wn-Ax.js"),[])),od=o.lazy(()=>$(()=>import("./AgentDashboard-CupzoTLH.js"),__vite__mapDeps([55,0,1,2,3,4,5,6,7,8,9,10,11,12,29,22,49,56,5
2867]))),ld=o.lazy(()=>$(()=>import("./StrategyLab-DVOy8Ten.js"),__vite__mapDeps([58,0,1,2,3,4,5,6,7,8,9,10,11,12,22,55,29,49,56,57]))),cd=o.lazy(()=>$(()=>import("./ApiDocs-DmzII-h6.js"),__vite__mapDeps([59,0,1,2,3,4,5,6,7,8,9,10,11,12,22]))),Ya=o.lazy(()=>$(()=>import("./CoursePlayer-C9jPLAYF.js"),__vite__mapDeps([60,0,1,2,3,4,5,6,7,8,9,10,11,12,22,61]))),dd=o.lazy(()=>$(()=>import("./CourseStudio-DC202MFH.js"),__vite__mapDeps([62,0,1,2,3,4,5,6,7,8,9,10,11,12,21,22,61]))),md=()=>{const{conversationId:t}=ar();return(0,e.jsx)(Re,{to:`/chat?conversation=${t}`,replace:!0})},xd=6;function Ws(t){if(!t?.uid)return!1;const a=`rdl_ob_${t.uid}`,s=(()=>{try{return localStorage.getItem(a)==="1"}catch{return!1}})(),n=t.onboardingCompleted===!0,r=Number(t.onboardingSkipCount||0)>=xd,i=t.onboarding||{},c=t.guardrails||{},d=!!i.completedAt||!!i.path||!!i.traderType||!!i.planId||!!c.dailyLossLimitPct;return s||n||r||d}var et=({user:t,children:a})=>{const s=Ne(i=>i.firestoreProfileLoaded);if(!t)return a;const n=`rdl_ob_skip_${t.uid}`,r=(()=>{try{return sessionStorage.getItem(n)==="1"}catch{return!1}})();return Ws(t)||r?a:s?(0,e.jsx)(Re,{to:"/onboarding",replace:!0}):(0,e.jsx)(W,{})},pd=({user:t,effectiveTheme:a})=>{const s=fe(),n=new URLSearchParams(s.search).get("force")==="1";return t?!n&&Ws(t)?(0,e.jsx)(Re,{to:"/dashboard",replace:!0}):(0,e.jsx)(B,{componentName:"Onboarding",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:Hc()?(0,e.jsx)(Uc,{}):Vc()?(0,e.jsx)(Wc,{}):(0,e.jsx)(zc,{})})}):(0,e.jsx)(Re,{to:"/signin",replace:!0})},ud=ta(Mn),hd=ta(Bn),qa=ta(dd),gd=({user:t,effectiveTheme:a,navigate:s})=>(0,e.jsx)(Bc,{children:(0,e.jsxs)(Mr,{children:[(0,e.jsx)(_,{path:"/onboarding",element:(0,e.jsx)(pd,{user:t,effectiveTheme:a})}),(0,e.jsx)(_,{path:"/",element:t?(0,e.jsx)(et,{user:t,children:(0,e.jsx)(Ia,{navigate:s,theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Ga,{user:t,theme:a})})})}):(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Wa,{})})}),(0,e.jsx)(_,{path:"/signup",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(qc,{})})}),(0,e.jsx)(_,{path:"/signin",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Kc,{})})}),(0,e.jsx)(_,{path:"/rsvp",element:(0,e.jsx)(Pc,{})}),(0,e.jsx)(_,{path:"/complete-profile",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Qc,{})})}),(0,e.jsx)(_,{path:"/forgot-password",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Xc,{})})}),(0,e.jsx)(_,{path:"/auth/callback",element:(0,e.jsx)(Ha,{})}),(0,e.jsx)(_,{path:"/callback",element:(0,e.jsx)(Ha,{})}),(0,e.jsx)(_,{path:"/webull/callback",element:(0,e.jsx)(Fc,{})}),(0,e.jsx)(_,{path:"/auth-action",element:t?(0,e.jsx)(Ia,{navigate:s,theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Ga,{user:t,theme:a})})}):(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Wa,{})})}),(0,e.jsx)(_,{path:"/privacy",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Jc,{})})}),(0,e.jsx)(_,{path:"/terms",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Zc,{})})}),(0,e.jsx)(_,{path:"/cookies",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ed,{})})}),(0,e.jsx)(_,{path:"/dpa",element:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(td,{})})}),(0,e.jsx)(_,{path:"/today",element:(0,e.jsx)(et,{user:t,children:(0,e.jsx)(B,{componentName:"TodayPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(nd,{})})})})}),(0,e.jsx)(_,{path:"/trade-logger",element:(0,e.jsx)(et,{user:t,children:(0,e.jsx)(B,{componentName:"TradeLogger",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ca,{}),children:(0,e.jsx)(hn,{})})})})}),(0,e.jsx)(_,{path:"/trade-analytics",element:(0,e.jsx)(B,{componentName:"TradeAnalytics",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(Ir,{}),children:(0,e.jsx)(sn,{})})})}),(0,e.jsx)(_,{path:"/user/:userId",element:(0,e.jsx)(B,{componentName:"UserProfile",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(Qr,{})})})}),(0,e.jsx)(_,{path:"/chat",element:(0,e.jsx)(B,{componentName:"Chat",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(mr,{}),children:(0,e.jsx)(Zn,{})})})}),(0,e.jsx)(_,{path:"/chat/:conversationId",element:(0,e.jsx)(md,{})}),(0,e.jsx)(_,{path:"/news",element:(0,e.jsx)(B,{componentName:"NewsIntelligence",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(Js,{}),children:(0,e.jsx)($r,{})})})}),(0,e.jsx)(_,{path:"/notifications",element:(0,e.jsx)(B,{componentName:"Notifications",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(sd,{})})})}),(0,e.jsx)(_,{path:"/notifications/settings",element:(0,e.jsx)(B,{componentName:"NotificationSettings",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(rd,{})})})}),(0,e.jsx)(_,{path:"/watchlist",element:(0,e.jsx)(B,{componentName:"WatchlistHub",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(tn,{})})})}),(0,e.jsx)(_,{path:"/education",element:(0,e.jsx)(B,{componentName:"EducationHub",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(pa,{}),children:(0,e.jsx)(gn,{})})})}),(0,e.jsx)(_,{path:"/learn/:videoId",element:(0,e.jsx)(B,{componentName:"VideoViewPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(an,{})})})}),(0,e.jsx)(_,{path:"/community",element:(0,e.jsx)(B,{componentName:"TradingCommunity",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(Dt,{}),children:(0,e.jsx)(zr,{})})})}),(0,e.jsx)(_,{path:"/community/leaderboard",element:(0,e.jsx)(B,{componentName:"CommunityLeaderboard",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(Dt,{}),children:(0,e.jsx)(ai,{})})})}),(0,e.jsx)(_,{path:"/education/hub",element:(0,e.jsx)(B,{componentName:"EducationHubNew",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(pa,{}),children:(0,e.jsx)(Ur,{})})})}),(0,e.jsx)(_,{path:"/education/video/:videoId",element:(0,e.jsx)(B,{componentName:"VideoViewPageWrapper",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(Gn,{})})})}),(0,e.jsx)(_,{path:"/education/tradingtube",element:(0,e.jsx)(B,{componentName:"TradingTubePlayer",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(Jr,{})})})}),(0,e.jsx)(_,{path:"/community/feed",element:(0,e.jsx)(B,{componentName:"UnifiedCommunityFeed",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(fn,{})})})}),(0,e.jsx)(_,{path:"/profile/verification/:userId",element:(0,e.jsx)(B,{componentName:"ProfileVerification",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ze,{}),children:(0,e.jsx)(xn,{})})})}),(0,e.jsx)(_,{path:"/admin",element:(0,e.jsx)(B,{componentName:"AdminPanel",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ud,{})})})}),(0,e.jsx)(_,{path:"/admin/landing-editor",element:(0,e.jsx)(B,{componentName:"LandingEditor",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(hd,{})})})}),(0,e.jsx)(_,{path:"/admin/courses",element:(0,e.jsx)(B,{componentName:"CourseStudio",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(qa,{})})})}),(0,e.jsx)(_,{path:"/admin/courses/:courseId",element:(0,e.jsx)(B,{componentName:"CourseStudio",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(qa,{})})})}),(0,e.jsx)(_,{path:"/education/course/:courseId",element:(0,e.jsx)(B,{componentName:"CoursePlayer",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Ya,{})})})}),(0,e.jsx)(_,{path:"/education/course/:courseId/:lessonId",element:(0,e.jsx)(B,{componentName:"CoursePlayer",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Ya,{})})})}),(0,e.jsx)(_,{path:"/feedback",element:(0,e.jsx)(B,{componentName:"FeedbackPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ei,{})})})}),(0,e.jsx)(_,{path:"/support",element:(0,e.jsx)(B,{componentName:"SupportPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Zr,{})})})}),(0,e.jsx)(_,{path:"/help",element:(0,e.jsx)(Re,{to:"/support",replace:!0})}),(0,e.jsx)(_,{path:"/enforcement",element:(0,e.jsx)(B,{componentName:"EnforcementDashboard",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(id,{})})})}),(0,e.jsx)(_,{path:"/pricing",element:(0,e.jsx)(B,{componentName:"PricingPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ln,{})})})}),(0,e.jsx)(_,{path:"/for-prop-firms",element:(0,e.jsx)(B,{componentName:"ForPropFirms",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Gc,{})})})}),(0,e.jsx)(_,{path:"/for-coaches",element:(0,e.jsx)(B,{componentName:"ForCoaches",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Yc,{})})})}),(0,e.jsx)(_,{path:"/for-educators",element:(0,e.jsx)(Re,{to:"/for-coaches",replace:!0})}),(0,e.jsx)(_,{path:"/redeem",element:Ct.isNativePlatform()?(0,e.jsx)(Re,{to:"/pricing",replace:!0}):(0,e.jsx)(B,{componentName:"RedeemPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Kr,{})})})}),(0,e.jsx)(_,{path:"/trading",element:(0,e.jsx)(B,{componentName:"TradingPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(ca,{}),children:(0,e.jsx)(yn,{})})})}),(0,e.jsx)(_,{path:"/social",element:(0,e.jsx)(B,{componentName:"CommunityPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(Dt,{}),children:(0,e.jsx)(Cn,{})})})}),(0,e.jsx)(_,{path:"/dashboard",element:(0,e.jsx)(B,{componentName:"UnifiedDashboard",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(vn,{})})})}),(0,e.jsx)(_,{path:"/org/dashboard",element:(0,e.jsx)(B,{componentName:"OrgDashboard",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(On,{})})})}),(0,e.jsx)(_,{path:"/org/create",element:(0,e.jsx)(B,{componentName:"CreateOrganization",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ti,{})})})}),(0,e.jsx)(_,{path:"/org/traders/:traderId",element:(0,e.jsx)(B,{componentName:"TraderProfilePage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(si,{})})})}),(0,e.jsx)(_,{path:"/org/audit",element:(0,e.jsx)(B,{componentName:"AuditLogViewer",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Ln,{})})})}),(0,e.jsx)(_,{path:"/org/settings",element:(0,e.jsx)(B,{componentName:"OrgSettings",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(nn,{})})})}),(0,e.jsx)(_,{path:"/org/invite-links",element:(0,e.jsx)(B,{componentName:"InviteLinks",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Yr,{})})})}),(0,e.jsx)(_,{path:"/org/join",element:(0,e.jsx)(B,{componentName:"JoinOrganization",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ba,{})})})}),(0,e.jsx)(_,{path:"/org/join/:orgId",element:(0,e.jsx)(B,{componentName:"JoinOrganization",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ba,{})})})}),(0,e.jsx)(_,{path:"/org/browse",element:(0,e.jsx)(B,{componentName:"BrowseOrganizations",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Nn,{})})})}),(0,e.jsx)(_,{path:"/invite/:token",element:(0,e.jsx)(B,{componentName:"InviteResolver",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(Vr,{})})})}),(0,e.jsx)(_,{path:"/org/:orgId/accept-invite",element:(0,e.jsx)(B,{componentName:"InviteAcceptance",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(bn,{})})})}),(0,e.jsx)(_,{path:"/api-docs",element:(0,e.jsx)(B,{componentName:"ApiDocs",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(cd,{})})})}),(0,e.jsx)(_,{path:"/agent",element:(0,e.jsx)(et,{user:t,children:(0,e.jsx)(B,{componentName:"AgentDashboard",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(od,{})})})})}),(0,e.jsx)(_,{path:"/strategy-lab",element:(0,e.jsx)(et,{user:t,children:(0,e.jsx)(B,{componentName:"StrategyLab",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ld,{})})})})}),(0,e.jsx)(_,{path:"/provision",element:(0,e.jsx)(B,{componentName:"ProvisioningPage",theme:a,children:(0,e.jsx)(o.Suspense,{fallback:(0,e.jsx)(W,{}),children:(0,e.jsx)(ad,{})})})}),(0,e.jsx)(_,{path:"*",element:(0,e.jsx)(Re,{to:t?"/":"/signin",replace:!0})})]})}),bd=o.lazy(()=>$(()=>import("./CommandPalette-BEddz9kT.js"),__vite__mapDeps([63,0,1,2,3,4,5,6,7,8,9,10,11,12,22]))),fd=o.lazy(()=>$(()=>import("./MainSettingsModal-BWETMcpT.js"),__vite__mapDeps([64,0,1,2,3,4,5,6,7,8,9,10,11,12,29,18,65,16,40,56]
286)));function yd({user:t,visible:a,onDismiss:s}){if(!a||!t?.uid||t.defaultRulesPromptPending!==!0)return null;const n=async()=>{try{await ss(at(tt,"users",t.uid),{defaultRulesPromptPending:!1,defaultRulesPromptDismissedAt:as()},{merge:!0})}catch(r){console.warn("[Onboarding] Could not persist default rules prompt dismissal:",r?.message);try{localStorage.setItem(`rdl_rules_prompt_dismissed_${t.uid}`,"1")}catch{}}s()};return(0,e.jsx)("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-black/70 p-4",role:"presentation",children:(0,e.jsxs)("section",{"aria-labelledby":"default-rules-prompt-title","aria-modal":"true",className:"w-full max-w-md rounded-2xl border border-white/10 bg-slate-950 p-6 text-white shadow-2xl",role:"dialog",children:[(0,e.jsx)("div",{className:"mb-3 text-3xl","aria-hidden":"true",children:"🛡️"}),(0,e.jsx)("h2",{id:"default-rules-prompt-title",className:"text-xl font-semibold",children:"Set your default trading rules"}),(0,e.jsxs)("p",{className:"mt-2 text-sm leading-6 text-slate-300",children:["Make your risk limits yours. Click your profile picture in the top right, open ",(0,e.jsx)("strong",{className:"text-white",children:"Settings"}),", then choose ",(0,e.jsx)("strong",{className:"text-white",children:"Risk Rules"})," to review your defaults."]}),(0,e.jsx)("button",{className:"mt-6 w-full rounded-xl bg-cyan-400 px-4 py-3 font-semibold text-slate-950 transition hover:bg-cyan-300 focus:outline-none focus:ring-2 focus:ring-cyan-200 focus:ring-offset-2 focus:ring-offset-slate-950",onClick:n,type:"button",children:"Got it"})]})})}var vd=o.lazy(()=>$(()=>import("./EndOfDaySummary-BuE4gnWP.js"),__vite__mapDeps([53,0,1,2,3,4,5,6,7,8,9,10,11,12]))),wd=o.lazy(()=>$(()=>import("./BehaviorClearedCelebration-Bw9ci3ZJ.js").then(t=>({default:function(){const s=t.default,n=t.CelebrationStyles;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n,{}),(0,e.jsx)(s,{})]})}})),__vite__mapDeps([66,0,1,2,3,4,5,6,7,8,9,10,11,12]))),jd=o.lazy(()=>$(()=>import("./EnforcementAuthorizationModal-L6OXFcTg.js"),__vite__mapDeps([67,0,1,2,3,4,5,6,7,8,9,10,11,12])));function kd(){const{showPrompt:t,dismiss:a,trigger:s}=$n();return(0,e.jsx)(Mo,{open:t,onClose:a,trigger:s})}function Nd(){const t=fe(),a=me(),[s,n]=(0,o.useState)(navigator.onLine),r=(0,o.useRef)(null),{user:i}=Ne(),c=Ut(S=>S.tier),d=Ut(S=>S.status),l=["pro","elite","mentor"].includes(c)&&["active","trialing"].includes(d);qn(),An(),kn(),wn(i?.uid),Yn(),(0,o.useEffect)(()=>{if(!i?.uid){delete window.__redlineResetCompliance;return}return window.__redlineResetCompliance=async()=>{try{const{ViolationService:S}=await $(async()=>{const{ViolationService:A}=await import("./market-core-B8Bfud51.js").then(X=>X.do);return{ViolationService:A}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return await S.setAccountStateToNormal(i.uid),console.log("[Redline] ✅ Compliance state reset to NORMAL for",i.uid),!0}catch(S){return console.error("[Redline] Reset failed:",S),!1}},()=>{delete window.__redlineResetCompliance}},[i?.uid]),(0,o.useEffect)(()=>{!window.Capacitor?.isNativePlatform?.()||!i?.uid||$(async()=>{const{rcIdentify:S}=await import("./market-core-B8Bfud51.js").then(A=>A.Rt);return{rcIdentify:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({rcIdentify:S})=>{S(i.uid).catch(()=>{})}).catch(()=>{})},[i?.uid]),(0,o.useEffect)(()=>{if(!i?.uid){st.getState().unsubscribeUser(),$(async()=>{const{useViolationEnforcementStore:S}=await import("./chat-page-C-flp553.js").then(A=>A.Q);return{useViolationEnforcementStore:S}},__vite__mapDeps([3,1,2,4])).then(({useViolationEnforcementStore:S})=>{S.getState().cleanup()}).catch(()=>{}),$(async()=>{const{useDisciplineScoreStore:S}=await import("./community-page-dub7UFXa.js").then(A=>A.Pn);return{useDisciplineScoreStore:S}},__vite__mapDeps([8,2,3,1,4,9])).then(({useDisciplineScoreStore:S})=>{S.getState().cleanup()}).catch(()=>{});return}return st.getState().subscribe(i.uid),$(async()=>{const{useViolationEnforcementStore:S}=await import("./chat-page-C-flp553.js").then(A=>A.Q);return{useViolationEnforcementStore:S}},__vite__mapDeps([3,1,2,4])).then(({useViolationEnforcementStore:S})=>{S.getState().initialize(i.uid)}).catch(()=>{}),$(async()=>{const{useDisciplineScoreStore:S}=await import("./community-page-dub7UFXa.js").then(A=>A.Pn);return{useDisciplineScoreStore:S}},__vite__mapDeps([8,2,3,1,4,9])).then(({useDisciplineScoreStore:S})=>{S.getState().initialize(i.uid)}).catch(()=>{}),$(async()=>{const{default:S}=await import("./dashboard-page-BSnUBMUY.js").then(A=>A.A);return{default:S}},__vite__mapDeps([10,2,3,1,4,8,9])).then(({default:S})=>{S.getState().loadViolationTogglesFromFirestore(i.uid).catch(()=>{})}).catch(()=>{}),()=>{st.getState().unsubscribeUser(),$(async()=>{const{useViolationEnforcementStore:S}=await import("./chat-page-C-flp553.js").then(A=>A.Q);return{useViolationEnforcementStore:S}},__vite__mapDeps([3,1,2,4])).then(({useViolationEnforcementStore:S})=>{S.getState().cleanup()}).catch(()=>{}),$(async()=>{const{useDisciplineScoreStore:S}=await import("./community-page-dub7UFXa.js").then(A=>A.Pn);return{useDisciplineScoreStore:S}},__vite__mapDeps([8,2,3,1,4,9])).then(({useDisciplineScoreStore:S})=>{S.getState().cleanup()}).catch(()=>{})}},[i?.uid]),(0,o.useEffect)(()=>
286{if(!i?.uid)return;let S=!1,A=null;return $(async()=>{const{initExtensionListener:X,sendAuthToExtension:ne,sendWatchlistToExtension:oe}=await import("./market-core-B8Bfud51.js").then(ie=>ie.To);return{initExtensionListener:X,sendAuthToExtension:ne,sendWatchlistToExtension:oe}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({initExtensionListener:X,sendAuthToExtension:ne,sendWatchlistToExtension:oe})=>{if(S)return;X(()=>{},i),ne(i).catch(()=>{}),A=setInterval(()=>{ne(i).catch(()=>{})},2700*1e3);const ie=window.__TRADEINTEL_WATCHLIST_SYMBOLS__;ie?.length&&oe(ie)}).catch(()=>{}),()=>{S=!0,A&&clearInterval(A)}},[i?.uid]);const{isActive:x,session:h,initializeSession:m,endSession:p,stats:g,updateStats:k}=na();(0,o.useEffect)(()=>{if(!i?.uid)return;if(!(x&&h&&h.status==="active")){$(async()=>{const{clearSessionContextInExtension:A}=await import("./market-core-B8Bfud51.js").then(X=>X.To);return{clearSessionContextInExtension:A}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({clearSessionContextInExtension:A})=>{A?.()}).catch(()=>{}),window.__TRADEINTEL_SESSION__=null;return}const S={maxDailyLossPercent:h.maxDailyLossPercent??null,plannedDailyMaxLoss:h.plannedDailyMaxLoss??null,maxLossPerTrade:h.maxLossPerTrade??null,plannedMaxTrades:h.plannedMaxTrades??null,accountBalance:h.accountBalance??null,instrument:h.instrument??null,bias:h.bias??null,sessionActive:!0,tradesCount:g?.tradesCount??0,totalPL:g?.totalPL??0};$(async()=>{const{sendSessionRulesToExtension:A,sendSessionMetricsToExtension:X}=await import("./market-core-B8Bfud51.js").then(ne=>ne.To);return{sendSessionRulesToExtension:A,sendSessionMetricsToExtension:X}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({sendSessionRulesToExtension:A,sendSessionMetricsToExtension:X})=>{A?.(S),X?.({equity:h.accountBalance??null,realizedPnLToday:g?.totalPL??0,openPnL:g?.openPnL??null,tradesToday:g?.tradesCount??0,consecutiveLosses:g?.consecutiveLosses??null,drawdownPct:g?.drawdownPct??null,winRate:g?.winRate??null,violationsToday:g?.violationsToday??null,streakDays:g?.streakDays??null})}).catch(()=>{}),window.__REDLINE_SESSION_RULES__=S,window.__TRADEINTEL_SESSION__={...h,stats:g}},[i?.uid,h?.id,h?.status,x,g?.tradesCount,g?.totalPL]),(0,o.useEffect)(()=>{if(!i?.uid)return;let S=()=>{},A=!1;return Promise.all([$(()=>import("./dashboard-page-BSnUBMUY.js").then(X=>X.A),__vite__mapDeps([10,2,3,1,4,8,9])),$(()=>import("./market-core-B8Bfud51.js").then(X=>X.To),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))]).then(([{default:X},{sendSettingsToExtension:ne}])=>{if(A)return;const oe=ie=>{try{ne?.({riskProfile:ie?.risk?.profile??ie?.risk?.riskProfile??null,autoLogTrades:ie?.trading?.autoLogTrades??null,autoLockOnViolation:ie?.risk?.autoLockOnViolation??ie?.trading?.autoLockOnViolation??null,notificationsEnabled:ie?.notifications?.enabled??null,brokers:Array.isArray(ie?.trading?.brokers)?ie.trading.brokers:[],defaultWatchlist:ie?.trading?.defaultWatchlist??null})}catch{}};oe(X.getState()),S=X.subscribe(oe)}).catch(()=>{}),()=>{A=!0;try{S()}catch{}}},[i?.uid]),(0,o.useEffect)(()=>{const S=A=>{A.detail?.url&&(A.preventDefault(),a(A.detail.url))};return window.addEventListener("notification-navigate",S),()=>window.removeEventListener("notification-navigate",S)},[a]),(0,o.useEffect)(()=>{if(!window.Capacitor?.isNativePlatform?.())return;let S;const A={trade:"/education?section=paper-trading&source=quick-action",watchlist:"/watchlist?source=quick-action",vega:"/agent?source=quick-action",journal:"/education?section=notes&source=quick-action",performance:"/trade-analytics?source=quick-action","risk-rules":"/enforcement?source=quick-action"},X=ne=>{const oe=new URL(ne);return oe.protocol==="redline:"?oe.hostname==="quick-action"?A[oe.pathname.replace(/^\/+/,"")]||"/today":`${`${oe.hostname?`/${oe.hostname}`:""}${oe.pathname||""}`||"/"}${oe.search||""}`:`${oe.pathname||"/"}${oe.search||""}`};return $(async()=>{const{App:ne}=await import("./esm-CDfoBdmC.js");return{App:ne}},__vite__mapDeps([68,3,1,2,4])).then(({App:ne})=>{const oe=ne.addListener("appUrlOpen",ie=>{try{a(X(ie.url),{replace:!0})}catch(la){console.warn("[DeepLink] Failed to parse URL:",ie.url,la)}});S=()=>oe.then(ie=>ie.remove())}).catch(()=>{}),()=>S?.()},[a]);const{loading:v,hasAuthFired:u}=_n(),[E,C]=(0,o.useState)(!1);(0,o.useEffect)(()=>{const S=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:4e3,A=setTimeout(()=>C(!0),S);return()=>clearTimeout(A)},[]),mn();const{initializeListeners:y,cleanup:w}=Et(),{initialize:N}=At();(0,o.useEffect)(()=>{N()},[N]),(0,o.useEffect)(()=>(i?.uid&&!v&&y(i.uid),()=>{i||w()}),[i?.uid,v,y,w]),(0,o.useEffect)(()=>ni(),[]);const b=(0,o.useRef)(t.pathname);(0,o.useEffect)(()=>
286{if(b.current!==t.pathname){oi(),ci(),b.current=t.pathname;const S=setTimeout(ii,500);return()=>clearTimeout(S)}},[t.pathname]);const[j,T]=(0,o.useState)(!1),[z,O]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(i?.uid){const S=setTimeout(()=>{m(i.uid)},500);return()=>clearTimeout(S)}},[i?.uid,m]);const{trades:P}=aa();(0,o.useEffect)(()=>{x&&P?.length>0&&k(P)},[P,x,k]);const U=o.useRef(!1),Z=async()=>{if(!U.current){U.current=!0;try{const S=await p(i?.uid);S.success&&(O({stats:S.stats,sessionStart:S.sessionStart,durationMinutes:S.durationMinutes,sessionId:S.sessionId,tradingRules:S.tradingRules||{},playbookSetups:S.playbookSetups||[],mantras:S.mantras||[],marketContext:S.marketContext||{},preMarketChecklist:S.preMarketChecklist||{}}),T(!0))}catch(S){console.error("[App] handleEndSessionFromBanner crashed:",S)}finally{U.current=!1}}},{effectiveTheme:I}=Ti(),{deviceInfo:M}=un();(0,o.useEffect)(()=>{M?.isLowEnd&&document.documentElement.style.setProperty("--animation-duration","0s")},[M]);const K=vi();(0,o.useEffect)(()=>{xi().isValid||console.warn("⚠️ Some API integrations may not work properly without proper API keys")},[]),(0,o.useEffect)(()=>{const S=window.innerWidth<640||/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);$(async()=>{const{prefetchAllRoutes:A,setupLinkPrefetching:X}=await import("./market-utils-Cr7j4rnq.js").then(ne=>ne.w);return{prefetchAllRoutes:A,setupLinkPrefetching:X}},__vite__mapDeps([18,0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({prefetchAllRoutes:A,setupLinkPrefetching:X})=>{S||A(),X()}).catch(A=>{console.warn("Route prefetching failed:",A)})},[]),(0,o.useEffect)(()=>{const S=()=>n(!0),A=()=>n(!1);return window.addEventListener("online",S),window.addEventListener("offline",A),()=>{window.removeEventListener("online",S),window.removeEventListener("offline",A)}},[]);const[D,Q]=(0,o.useState)(!1),[V,G]=(0,o.useState)(!1),[H,R]=(0,o.useState)("appearance"),[Y,ee]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(ee(!1),!!i?.uid)try{ee(localStorage.getItem(`rdl_rules_prompt_dismissed_${i.uid}`)==="1")}catch{}},[i?.uid]),(0,o.useEffect)(()=>{localStorage.getItem("openSettingsForPasswordSetup")==="true"&&i&&setTimeout(()=>{R("security"),G(!0),localStorage.removeItem("openSettingsForPasswordSetup")},500)},[i]),(0,o.useEffect)(()=>{localStorage.getItem("openSettingsForBroker")&&i&&setTimeout(()=>{R("integrations"),G(!0),localStorage.removeItem("openSettingsForBroker")},800)},[i]),(0,o.useEffect)(()=>{const S=A=>{R(A.detail?.tab||"appearance"),G(!0)};return window.addEventListener("open-main-settings",S),()=>window.removeEventListener("open-main-settings",S)},[]),(0,o.useEffect)(()=>{const S=new URLSearchParams(window.location.search).get("settings");if(S&&["appearance","integrations","notifications","security","support"].includes(S)&&i){R(S),G(!0);const A=new URL(window.location.href);A.searchParams.delete("settings"),window.history.replaceState({},"",A.toString())}},[i]),(0,o.useEffect)(()=>{if(localStorage.getItem("schwabOAuthPending")&&i){const S=window.location.pathname;if(S!=="/callback"&&S!=="/auth/callback"){const A=setTimeout(()=>{localStorage.getItem("schwabOAuthPending")&&(console.warn("[App] schwabOAuthPending detected but not on callback route — OAuth redirect may have been lost"),localStorage.removeItem("schwabOAuthPending"))},5e3);return()=>clearTimeout(A)}}},[i]),Or(a,Q,G,()=>K.toggleTheme?.());const[re,le]=(0,o.useState)(typeof window<"u"?window.innerWidth:1024),Ee=re<640,Lt=Ee?"mobile":re>768&&re<=1024?"tablet":"desktop",it=typeof window<"u"&&window.innerHeight>window.innerWidth?"portrait":"landscape";(0,o.useEffect)(()=>{let S;const A=()=>{clearTimeout(S),S=setTimeout(()=>le(window.innerWidth),250)};if(typeof window<"u")return window.addEventListener("resize",A),()=>{clearTimeout(S),window.removeEventListener("resize",A)}},[]),(0,o.useEffect)(()=>{const S=Ci();return Un(),fa.addScrollProgressIndicator({backgroundColor:"linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(99, 102, 241, 0.8))",height:"2px"}),S},[]),(0,o.useEffect)(()=>{const S=A=>{const X=A.target;if(!X||X.tagName!=="INPUT")return;const ne=(X.getAttribute("inputmode")||"").toLowerCase();(X.type==="number"||ne==="numeric"||ne==="decimal")&&requestAnimationFrame(()=>{try{X.select()}catch{}})};return document.addEventListener("focusin",S),()=>document.removeEventListener("focusin",S)},[]);const Qe=Hr((0,o.useMemo)(()=>({enableAnalytics:!0,enablePageRestoration:!0,maxHistorySize:50,excludedPaths:["/signin","/signup","/logout","/auth/callback","/callback","/webull/callback","/forgot-password","/pricing","/redeem","/invite","/accept-invite","/org","/rsvp","/for-prop-firms","/for-coaches","/for-educators","/support","/help"]}),[]));Wn({enabled:!!i&&!v}),Hn();const F=["/signin","/signup","/forgot-password","/complete-profile"].includes(t.pathname),te=Xn({enabled:Ee&&!F&&!!i,threshold:80,edgeZone:25,velocityThreshold:.4,navigate:a,location:t}),we=Qe.currentPath,Se=Qe.getNavigationInsights,Pe=Qe.currentPageTitle;(0,o.useEffect)(()=>
286{if(i&&we){fa.saveScrollPosition(we);const S=Se();console.log("📊 Navigation Insights:",{currentPage:Pe,totalViews:S.totalPageViews,uniquePages:S.uniquePages,sessionTime:S.sessionDuration})}},[i,we,Pe,Se]),(0,o.useEffect)(()=>{const S=A=>{(A.metaKey||A.ctrlKey)&&A.key==="k"&&(A.preventDefault(),Q(!0)),A.key==="Escape"&&Q(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[]),(0,o.useEffect)(()=>{if(i&&!v){console.log("🚀 Initializing real-time market data service...");const A=setTimeout(async()=>{try{await Ot.startRealTimeUpdates(),console.log("✅ Real-time market data service started")}catch(X){console.error("❌ Failed to start real-time market data:",X)}},3e3);return()=>{clearTimeout(A),Ot.isRunning&&(Ot.stopRealTimeUpdates(),console.log("⏹️ Real-time market data service stopped"))}}},[i,v]);const ue=["/signin","/signup","/forgot-password"].includes(t.pathname),ot=["/privacy","/terms","/cookies","/dpa"].includes(t.pathname),De=t.pathname==="/"||t.pathname==="/for-prop-firms"||t.pathname==="/for-coaches"||t.pathname==="/for-educators",Fe=t.pathname.startsWith("/org/join"),lt=t.pathname==="/pricing",ct=t.pathname==="/redeem",Oe=t.pathname==="/rsvp",Le=t.pathname==="/onboarding",Mt=t.pathname==="/support"||t.pathname==="/help",Hs=t.pathname==="/webull/callback",Gs=t.pathname.startsWith("/invite")||t.pathname.includes("accept-invite")||t.pathname.match(/^\/org\/[^/]+\/accept-invite/),Ys=!ue&&!ot&&!De&&!Fe&&!lt&&!ct&&!Oe&&!Mt&&!Gs&&!Hs;return v||!E?(0,e.jsx)(Co,{}):Ys&&!i&&!v&&u&&!ge?.currentUser?(console.log("[App] Redirecting to signin - protected route without auth:",t.pathname),(0,e.jsx)(Re,{to:"/signin",replace:!0})):(0,e.jsx)(ri,{client:Br,children:(0,e.jsx)(fr,{children:(0,e.jsx)(Dn,{children:(0,e.jsxs)(to,{children:[(0,e.jsx)(_o,{}),(0,e.jsx)(Po,{}),(0,e.jsx)(Lo,{}),(0,e.jsx)(Ao,{}),(0,e.jsx)(kd,{}),(0,e.jsx)(kr,{newestOnTop:!0,limit:3,closeButton:!0,draggable:!0,pauseOnFocusLoss:!0,role:"status",theme:"dark"}),(0,e.jsxs)("div",{ref:r,className:`min-h-screen quantum-app consciousness-aware touch-gesture-container scroll-smooth ${K.getPageBackground()}`,style:K.cssVars,"data-theme":K.theme||"dark","data-device-type":Lt,"data-orientation":it,"data-touch-active":"false","data-swipe-direction":"none",...te.handlers,children:[(0,e.jsx)(En,{swipeState:te.swipeState}),(0,e.jsx)(Do,{enabled:!!i&&!ue,maxRestoreTime:1440*60*1e3,restoreDelay:1500,excludedPaths:["/signin","/signup","/logout","/auth/callback","/callback","/webull/callback","/forgot-password","/pricing","/redeem","/invite","/accept-invite","/org","/rsvp","/for-prop-firms","/for-coaches","/for-educators","/support","/help"],fallbackPath:"/"}),D&&(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(bd,{isOpen:D,onClose:()=>Q(!1)})}),(0,e.jsxs)("div",{className:"flex flex-col min-h-screen relative",children:[!s&&(0,e.jsx)("div",{className:"bg-red-600 text-white text-center py-2 text-sm font-medium z-50",children:"⚠️ You're offline. Some features may not work properly."}),ya({user:i,pathname:t.pathname})!=="none"&&(0,e.jsxs)(e.Fragment,{children:[ya({user:i,pathname:t.pathname})==="marketing"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Rs,{}),(0,e.jsx)("div",{"aria-hidden":"true",style:{height:"calc(4rem + env(safe-area-inset-top, 0px))"}})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"hidden sm:block",children:(0,e.jsx)(Zo,{user:i,theme:I,onCommandPalette:()=>Q(!0),onOpenSettings:(S="appearance")=>{R(S),G(!0)},isOnline:s})}),(0,e.jsx)("div",{className:"block sm:hidden",children:(0,e.jsx)(tl,{user:i,onOpenSettings:(S="appearance")=>{R(S),G(!0)}})})]}),i&&(0,e.jsx)(dl,{}),(0,e.jsx)(ol,{}),i&&x&&(0,e.jsx)(nl,{onEndSession:Z}),i&&(0,e.jsx)(jl,{})]}),(0,e.jsx)("main",{className:"flex-1 relative bg-transparent text-text-primary pwa-main-content",children:(0,e.jsxs)("div",{className:"pwa-content-area",children:[(0,e.jsx)(Oo,{}),(0,e.jsx)(gd,{user:i,effectiveTheme:I,navigate:a})]})}),!ue&&!Le&&i&&(0,e.jsx)("div",{className:"block sm:hidden",children:(0,e.jsx)(rl,{user:i})})]}),j&&(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(vd,{isOpen:j,onClose:()=>{T(!1),O(null)},sessionData:z})}),!ue&&i&&(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(wd,{})}),i&&(0,e.jsx)(ml,{}),!ue&&!Le&&i&&u&&l&&(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(jd,{userId:i.uid})}),!ue&&i&&V&&(0,e.jsx)(o.Suspense,{fallback:null,children:(0,e.jsx)(fd,{isOpen:V,onClose:()=>{G(!1),R("appearance")},currentUser:i,defaultTab:H})}),!ue&&!Le&&i&&(0,e.jsx)(yd,{user:i,visible:!Y,onDismiss:()=>ee(!0)}),!ue&&!Le&&(0,e.jsx)(Fo,{threshold:300,theme:I,offset:{bottom:"24px",right:"24px"}}),i&&!ue&&(0,e.jsx)(kl,{}),(0,e.jsx)(il,{uid:i?.uid}),i&&(0,e.jsx)(Qn,{})]})]})})})})}var J=(function(t){return t.MARKET_ANALYSIS="market_analysis",t.TRADE_ANALYTICS="trade_analytics",t.RISK_ASSESSMENT="risk_assessment",t.PORTFOLIO_OPTIMIZATION="portfolio_optimization",t.CONTENT_CREATION="content_creation",t.EDUCATION_CURATION="education_curation",t.MENTORSHIP_MATCHING="mentorship_matching",t.TRADE_EXECUTION="trade_execution",t.ORDER_MANAGEMENT="order_management",t.POSITION_MONITORING="position_monitoring",t.COMMUNITY_MODERATION="community_moderation",t.NEWS_AGGREGATION="news_aggregation",t.ALERT_GENERATION="alert_generation",t.CHAT_ASSISTANCE="chat_assistance",t.DATA_VALIDATION="data_validation",t.BACKUP_MANAGEMENT="backup_management",t.PERFORMANCE_MONITORING="performance_monitoring",t.SECURITY_SCANNING="security_scanning",t.WORKFLOW_ORCHESTRATION="workflow_orchestration",t.MACHINE_LEARNING="machine_learning",t})({}),ce=(function(t){return t.READ_ONLY="read_only",t.READ_WRITE="read_write",t.EXECUTE="execute",t.ADMIN="admin",t.RESTRICTED="restricted",t})({}),vt=(function(t){return t.IDLE="idle",t.RUNNING="running",t.PAUSED="paused",t.ERROR="error",t.COMPLETED="completed",t.TERMINATED="terminated",t})({});function Sd(t){return t&&typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.capabilities)&&Object.values(ce).includes(t.permissionLevel)&&Object.values(vt).includes(t.status)}var de={maxExecutionTime:3e5,maxMemoryUsage:512,maxConcurrentTasks:3,retryAttempts:3,timeoutMs:3e4,priority:"normal",enableLogging:!0,customSettings:{}},Cd=class{constructor(){Ie(this,"agents",new Map),Ie(this,"capabilities",new Map),Ie(this,"categories",new Map),Ie(this,"healthChecks",new Map),Ie(this,"isInitialized",!1),this.initializeCapabilityIndex(),this.setupPerformanceMonitoring()}async initialize(){if(!this.isInitialized)try{await this.loadPersistedAgents(),this.startHealthMonitoring(),this.isInitialized=!0,await $e.publish("agent_registry_initialized",{agentCount:this.agents.size,timestamp:new Date},{source:"AgentRegistry"}),console.log(`[AgentRegistry] Initialized with ${this.agents.size} agents`)}catch(t){throw console.error("[AgentRegistry] Initialization failed:",t),new Error(`Agent registry initialization failed: ${t.message}`)}}async registerAgent(t){try{this.validateRegistrationRequest(t);const a=this.findAgentByName(t.name);if(a)return console.warn(`[AgentRegistry] Agent with name "${t.name}" already exists. Returning existing agent.`),a;const s=this.generateAgentId(),n=new Date,r={id:s,registrationId:`reg_${s}`,name:t.name,description:t.description,version:t.version,author:t.author,capabilities:[...t.capabilities],permissionLevel:t.permissionLevel,requiredCapabilities:[],configuration:{...de,...t.configuration},status:vt.IDLE,isActive:!0,createdAt:n,updatedAt:n,tags:[...t.tags],category:t.category,documentation:t.documentation,dependencies:[...t.dependencies],isVerified:!1,downloadCount:0,rating:0,reviews:[],updateHistory:[{version:t.version,releaseDate:n,changeLog:"Initial registration",author:t.author,isBreaking:!1,deprecated:!1}],healthStatus:"healthy",maintenanceMode:!1};return this.agents.set(s,r),this.updateCapabilityIndex(s,t.capabilities),this.updateCategoryIndex(s,t.category),this.initializeHealthCheck(s),await this.persistAgent(r),$e.emit("agent_registered",{agentId:s,name:r.name,capabilities:r.capabilities,timestamp:n}),console.log(`[AgentRegistry] Registered agent: ${r.name} (${s})`),r}catch(a){throw console.error("[AgentRegistry] Registration failed:",a),new Error(`Agent registration failed: ${a.message}`)}}async unregisterAgent(t){try{const a=this.agents.get(t);if(!a)throw new Error(`Agent ${t} not found`);if(a.status===vt.RUNNING)throw new Error(`Cannot unregister agent ${t}: currently running`);return this.removeFromCapabilityIndex(t,a.capabilities),this.removeFromCategoryIndex(t,a.category),this.healthChecks.delete(t),this.agents.delete(t),await this.removePersistedAgent(t),$e.emit("agent_unregistered",{agentId:t,name:a.name,timestamp:new Date}),console.log(`[AgentRegistry] Unregistered agent: ${a.name} (${t})`),!0}catch(a){throw console.error("[AgentRegistry] Unregistration failed:",a),new Error(`Agent unregistration failed: ${a.message}`)}}searchAgents(t={}){const a=performance.now();let s=Array.from(this.agents.values());if(t.capabilities?.length>0&&(s=s.filter(r=>t.capabilities.every(i=>r.capabilities.includes(i)))),t.permissionLevel&&(s=s.filter(r=>r.permissionLevel===t.permissionLevel)),t.category&&(s=s.filter(r=>r.category===t.category)),t.tags?.length>0&&(s=s.filter(r=>t.tags.some(i=>r.tags.includes(i)))),t.isActive!==void 0&&(s=s.filter(r=>r.isActive===t.isActive)),t.minSuccessRate!==void 0&&(s=s.filter(r=>(r.successRate||0)>=t.minSuccessRate)),t.maxExecutionTime!==void 0&&(s=s.filter(r=>(r.averageExecutionTime||0)<=t.maxExecutionTime)),t.textSearch){const r=t.textSearch.toLowerCase();s=s.filter(i=>i.name.toLowerCase().includes(r)||i.description.toLowerCase().includes(r)||i.tags.some(c=>c.toLowerCase().includes(r)))}t.author&&(s=s.filter(r=>r.author===t.author)),s.sort((r,i)=>r.rating!==i.rating?i.rating-r.rating:(r.successRate||0)!==(i.successRate||0)?(i.successRate||0)-(r.successRate||0):i.downloadCount-r.downloadCount);const n=performance.now()-a;return{agents:s,totalCount:s.length,page:1,pageSize:s.length,hasMore:!1,searchTime:n}}getAgent(t){return this.agents.get(t)||null}getAgentsByCapability(t){return(this.capabilities.get(t)||[]).map(a=>
286this.agents.get(a)).filter(Boolean)}getAgentsByCategory(t){return(this.categories.get(t)||[]).map(a=>this.agents.get(a)).filter(Boolean)}async updateAgentStatus(t,a){const s=this.agents.get(t);if(!s)throw new Error(`Agent ${t} not found`);const n=s.status;s.status=a,s.updatedAt=new Date,await this.persistAgent(s),$e.emit("agent_status_changed",{agentId:t,oldStatus:n,newStatus:a,timestamp:new Date}),console.log(`[AgentRegistry] Agent ${s.name} status: ${n} → ${a}`)}async updateAgentMetrics(t,a,s){const n=this.agents.get(t);if(!n)return;const r=n.downloadCount,i=n.averageExecutionTime||0,c=n.successRate||100;n.averageExecutionTime=Math.round((i*r+a)/(r+1)),n.successRate=Math.round((c*r+(s?100:0))/(r+1)),n.downloadCount+=1,n.lastExecuted=new Date,n.updatedAt=new Date,await this.persistAgent(n),console.log(`[AgentRegistry] Updated metrics for ${n.name}: ${a}ms, success: ${s}`)}getAgentHealth(t){return this.healthChecks.get(t)||null}getAllHealthChecks(){return Array.from(this.healthChecks.values())}getRegistryStats(){const t=Array.from(this.agents.values()),a={totalAgents:t.length,activeAgents:t.filter(n=>n.isActive).length,verifiedAgents:t.filter(n=>n.isVerified).length,agentsByCategory:{},agentsByCapability:{},averageRating:0,healthyAgents:0};t.forEach(n=>{a.agentsByCategory[n.category]=(a.agentsByCategory[n.category]||0)+1}),t.forEach(n=>{n.capabilities.forEach(r=>{a.agentsByCapability[r]=(a.agentsByCapability[r]||0)+1})});const s=t.filter(n=>n.rating>0);return s.length>0&&(a.averageRating=Math.round(s.reduce((n,r)=>n+r.rating,0)/s.length*10)/10),a.healthyAgents=Array.from(this.healthChecks.values()).filter(n=>n.isHealthy).length,a}initializeCapabilityIndex(){Object.values(J).forEach(t=>{this.capabilities.set(t,[])})}setupPerformanceMonitoring(){$e.subscribe("agent_task_completed",t=>{t.agentId&&t.executionTimeMs!==void 0&&t.success!==void 0&&this.updateAgentMetrics(t.agentId,t.executionTimeMs,t.success).catch(console.error)})}generateAgentId(){return`agent_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}validateRegistrationRequest(t){if(!t.name?.trim())throw new Error("Agent name is required");if(!t.description?.trim())throw new Error("Agent description is required");if(!t.version?.trim())throw new Error("Agent version is required");if(!Array.isArray(t.capabilities)||t.capabilities.length===0)throw new Error("Agent must have at least one capability");if(!Object.values(ce).includes(t.permissionLevel))throw new Error("Invalid permission level");if(!/^\d+\.\d+\.\d+$/.test(t.version))throw new Error("Version must follow semantic versioning (e.g., 1.0.0)")}findAgentByName(t){for(const a of this.agents.values())if(a.name===t)return a;return null}updateCapabilityIndex(t,a){a.forEach(s=>{const n=this.capabilities.get(s)||[];n.includes(t)||(n.push(t),this.capabilities.set(s,n))})}updateCategoryIndex(t,a){const s=this.categories.get(a)||[];s.includes(t)||(s.push(t),this.categories.set(a,s))}removeFromCapabilityIndex(t,a){a.forEach(s=>{const n=this.capabilities.get(s)||[],r=n.indexOf(t);r>-1&&(n.splice(r,1),this.capabilities.set(s,n))})}removeFromCategoryIndex(t,a){const s=this.categories.get(a)||[],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.categories.set(a,s))}initializeHealthCheck(t){const a={agentId:t,timestamp:new Date,isHealthy:!0,issues:[],resourceUsage:{computeUnits:0,memoryUsage:0,storageOperations:0,networkRequests:0,executionTimeMs:0},averageResponseTime:0,errorRate:0};this.healthChecks.set(t,a)}startHealthMonitoring(){setInterval(()=>{this.performHealthChecks().catch(console.error)},300*1e3)}async performHealthChecks(){for(const[t,a]of this.agents){if(!a.isActive)continue;const s=this.healthChecks.get(t);s&&(s.timestamp=new Date,a.lastExecuted&&Date.now()-a.lastExecuted.getTime()>1800*1e3&&a.status===vt.RUNNING&&(s.isHealthy=!1,s.issues.push("Agent appears stuck - no activity for 30+ minutes")),(a.successRate||100)<80&&(s.isHealthy=!1,s.issues.push(`High error rate: ${100-(a.successRate||100)}%`)),(a.averageExecutionTime||0)>a.configuration.maxExecutionTime*.8&&(s.isHealthy=!1,s.issues.push("Execution time approaching timeout limit")),!s.isHealthy&&s.issues.length>0&&$e.emit("performance_alert",{agentId:t,issues:s.issues,timestamp:new Date}))}}async loadPersistedAgents(){try{const{agentRepository:t}=await $(async()=>{const{agentRepository:s}=await import("./agentRepository-BrIFKQub.js");return{agentRepository:s}},__vite__mapDeps([69,3,1,2,4])),a=await t.getAllAgents();a.forEach(s=>{this.agents.set(s.id,s),this.updateCapabilityIndex(s.id,s.capabilities),this.updateCategoryIndex(s.id,s.category),this.initializeHealthCheck(s.id)}),console.log(`[AgentRegistry] Loaded ${a.length} persisted agents`)}catch(t){console.warn("[AgentRegistry] Could not load persisted agents:",t.message)}}async persistAgent(t){try{if(!Sd(t))throw new Error("Invalid agent structure for persistence");const{auth:a}=await $(async()=>{const{auth:n}=await import("./chat-page-C-flp553.js").then(r=>r.jr);return{auth:n}},__vite__mapDeps([3,1,2,4]));if(!a.currentUser){console.log("[AgentRegistry] Skipping persistence - user not authenticated (agent will work in memory)");return}const{agentRepository:s}=await $(async()=>{const{agentRepository:n}=await import("./agentRepository-BrIFKQub.js");return{agentRepository:n}},__vite__mapDeps([69,3,1,2,4]));if(await s.getAgent(t.id))await s.updateAgent(t.id,t);else{const{id:n,registrationId:r,createdAt:i,updatedAt:c,...d}=t;await s.createAgent(d)}}catch(a){console.error("[AgentRegistry] Failed to persist agent:",a)}}async removePersistedAgent(t){try{const{agentRepository:a}=await $(async()=>{const{agentRepository:s}=await import("./agentRepository-BrIFKQub.js");return{agentRepository:s}},__vite__mapDeps([69,3,1,2,4]));await a.deleteAgent(t),console.log(`[AgentRegistry] Removed persisted agent: ${t}`)}catch(a){console.error(`[AgentRegistry] Failed to remove persisted agent ${t}:`,a)}}},Us=new Cd,Td=()=>Us.initialize(),Rd=[{name:"OnboardingAgent",description:"Welcomes new users, explains platform features, and guides the sign-up flow.",version:"1.0.0",author:"System",category:"User Experience",capabilities:[J.CONTENT_CREATION,J.COMMUNITY_MODERATION],permissionLevel:ce.READ_ONLY,configuration:{...de,priority:"high",customSettings:{tone
286:"welcoming",context:"landing_page"}},tags:["onboarding","guide","welcome"],dependencies:[]},{name:"SystemAdminAgent",description:"Monitors system health, manages user permissions, and handles critical alerts.",version:"1.1.0",author:"System",category:"Administration",capabilities:[J.PERFORMANCE_MONITORING,J.SECURITY_SCANNING,J.DATA_VALIDATION,J.BACKUP_MANAGEMENT],permissionLevel:ce.ADMIN,configuration:{...de,priority:"critical",maxExecutionTime:6e4},tags:["admin","security","system_health"],dependencies:["firebase-admin"]},{name:"CommunicationAgent",description:"Moderates chat, suggests smart replies, and summarizes long conversation threads.",version:"1.0.0",author:"System",category:"Social",capabilities:[J.CHAT_ASSISTANCE,J.COMMUNITY_MODERATION,J.CONTENT_CREATION],permissionLevel:ce.READ_WRITE,configuration:{...de,customSettings:{moderationLevel:"strict",replyStyle:"concise"}},tags:["chat","moderation","social"],dependencies:[]},{name:"CommunityManagerAgent",description:"Facilitates discussions in the Trading Community and connects mentors with mentees.",version:"1.0.0",author:"System",category:"Social",capabilities:[J.COMMUNITY_MODERATION,J.MENTORSHIP_MATCHING,J.EDUCATION_CURATION],permissionLevel:ce.READ_WRITE,configuration:de,tags:["community","mentorship","networking"],dependencies:[]},{name:"SupportAgent",description:"Collects user feedback, categorizes issues, and drafts initial support responses.",version:"1.0.0",author:"System",category:"Support",capabilities:[J.COMMUNITY_MODERATION,J.DATA_VALIDATION],permissionLevel:ce.READ_ONLY,configuration:de,tags:["support","feedback","help"],dependencies:[]},{name:"EducationMentorAgent",description:"Recommends courses based on skill gaps, tracks progress, and answers content questions.",version:"1.2.0",author:"System",category:"Education",capabilities:[J.EDUCATION_CURATION,J.MENTORSHIP_MATCHING,J.CONTENT_CREATION],permissionLevel:ce.READ_ONLY,configuration:{...de,customSettings:{teachingStyle:"socratic"}},tags:["education","mentor","learning"],dependencies:[]},{name:"ContentAssistantAgent",description:"Summarizes video content, extracts key trading lessons, and suggests related videos.",version:"1.0.0",author:"System",category:"Content",capabilities:[J.CONTENT_CREATION,J.EDUCATION_CURATION],permissionLevel:ce.READ_ONLY,configuration:de,tags:["video","summary","content"],dependencies:[]},{name:"NewsAnalystAgent",description:"Aggregates financial news, performs sentiment analysis, and highlights market-moving events.",version:"2.0.0",author:"System",category:"Intelligence",capabilities:[J.NEWS_AGGREGATION,J.MARKET_ANALYSIS,J.ALERT_GENERATION],permissionLevel:ce.READ_ONLY,configuration:{...de,priority:"high",customSettings:{sources:["benzinga","polygon","alpha_vantage"]}},tags:["news","sentiment","market_analysis"],dependencies:["news-api"]},{name:"PerformanceAnalystAgent",description:"Analyzes trade history, calculates advanced metrics (Sharpe, Sortino), and suggests improvements.",version:"1.5.0",author:"System",category:"Analytics",capabilities:[J.TRADE_ANALYTICS,J.RISK_ASSESSMENT,J.PORTFOLIO_OPTIMIZATION],permissionLevel:ce.READ_ONLY,configuration:{...de,maxMemoryUsage:1024},tags:["analytics","performance","stats"],dependencies:[]},{name:"JournalingAssistantAgent",description:"Assists in logging trades, ensures data quality, and prompts for emotional state reflection.",version:"1.0.0",author:"System",category:"Tools",capabilities:[J.DATA_VALIDATION,J.TRADE_ANALYTICS,J.CONTENT_CREATION],permissionLevel:ce.READ_WRITE,configuration:de,tags:["journal","logging","psychology"],dependencies:[]},{name:"ProfileManagerAgent",description:"Helps users update profiles, manages settings, and handles preference synchronization.",version:"1.0.0",author:"System",category:"User Management",capabilities:[J.DATA_VALIDATION],permissionLevel:ce.READ_WRITE,configuration:de,tags:["profile","settings","user"],dependencies:[]},{name:"GamificationAgent",description:"Tracks user achievements, calculates XP, and notifies users of progress and rewards.",version:"1.0.0",author:"System",category:"Gamification",capabilities:[J.CONTENT_CREATION,J.ALERT_GENERATION],permissionLevel:ce.READ_WRITE,configuration:de,tags:["achievements","xp","rewards"],dependencies:[]}],Ka=!1;async function Ed(){if(Ka)return;Ka=!0,console.log("[AgentRegistration] Starting page agent initialization...");let t=0,a=0;for(const s of Rd)try{await Us.registerAgent(s),t++,console.log(`[AgentRegistration] ✅ Registered: ${s.name}`)}catch(n){a++,console.error(`[AgentRegistration] ❌ Failed to register ${s.name}
286:`,n)}console.log(`[AgentRegistration] Completed: ${t} registered, ${a} failed`)}Tt();var Xa="redline_chunk_recovery_at",Ad=t=>/Failed to fetch dynamically imported module|Importing a module script failed|ChunkLoadError/i.test(String(t?.message||t?.reason?.message||t?.reason||t||"")),Vs=()=>{const t=Number(sessionStorage.getItem(Xa)||0);Date.now()-t<3e4||(sessionStorage.setItem(Xa,String(Date.now())),navigator.serviceWorker?.getRegistration?.().then(a=>a?.update()).catch(()=>{}),window.location.reload())};window.addEventListener("vite:preloadError",t=>{t.preventDefault(),Vs()});window.addEventListener("unhandledrejection",t=>{Ad(t)&&(t.preventDefault(),Vs())});Qa.init("phc_vHUP4AhtyuGUdQ2TxcKhwbuXz4rSVQDXBGHVNP67fjcN",{api_host:"https://us.i.posthog.com",defaults:"2026-05-30",autocapture:!1,capture_pageview:!1,persistence:"localStorage+cookie"});Ct.isNativePlatform()&&$(async()=>{const{StatusBar:t,Style:a}=await import("./esm-CVfcfslk.js");return{StatusBar:t,Style:a}},__vite__mapDeps([70,3,1,2,4])).then(({StatusBar:t,Style:a})=>{t.setOverlaysWebView({overlay:!0}),t.setStyle({style:a.Dark})}).catch(()=>{});Ks();Td().then(()=>Ed()).catch(t=>console.error("❌ Agent System initialization failed:",t));requestAnimationFrame(()=>{mi()});window.innerWidth<640||/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?console.log("📱 Mobile detected: Skipping aggressive route prefetch to save memory/data"):requestAnimationFrame(()=>{setTimeout(()=>{li()},2e3)});pi();"serviceWorker"in navigator&&window.addEventListener("load",async()=>{try{const t=await navigator.serviceWorker.getRegistrations();for(const n of t)n.active?.scriptURL?.endsWith("/sw.js")&&(await n.unregister(),console.log("🧹 Unregistered stale sw.js"));const a=await navigator.serviceWorker.register("/sw-advanced.js",{scope:"/",updateViaCache:"none"});console.log("✅ PWA Service Worker registered:",a.scope),setInterval(()=>{a.update().catch(()=>{})},1800*1e3);let s=0;document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&Date.now()-s>6e4&&(s=Date.now(),a.update().catch(()=>{}))})}catch(t){console.error("❌ Service Worker registration failed:",t)}navigator.serviceWorker.addEventListener("message",t=>{t.data?.type==="RELOAD_NEEDED"&&(console.log("🔄 Asset mismatch detected, reloading..."),window.location.reload())})});var Id=()=>(0,e.jsx)(Gr,{client:Qa,children:(0,e.jsx)(Zs,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:(0,e.jsx)(B,{componentName:"AppRoot",children:(0,e.jsx)(Nd,{})})})}),_d=(0,e.jsx)(Id,{});yo.createRoot(document.getElementById("root")).render(_d);export{Ss as S,pe as _,Zd as a,Ts as b,Jd as c,ul as d,pl as f,He as g,Kd as h,e0 as i,bl as l,Xd as m,B as n,t0 as o,Qd as p,wl as r,vl as s,Cc as t,gl as u,Es as v,Ho as x,Rs as y};

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.