1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8254],{1538:(e,t,a)=>{"use strict";a.d(t,{CommandPaletteProvider:()=>A,C:()=>S});var s=a(54568),r=a(7620),n=a(79748),i=a(93171),l=a(60701);let o={"Information Technology":{label:"IT & Technology",color:"#3b82f6",icon:"Cpu"},"Financial Services":{label:"Banking & Finance",color:"#10b981",icon:"Landmark"},Healthcare:{label:"Healthcare & Pharma",color:"#ef4444",icon:"Heart"},"Real Estate":{label:"Real Estate & Realty",color:"#14b8a6",icon:"Building2"},Energy:{label:"Energy & Power",color:"#f59e0b",icon:"Zap"},"Consumer Discretionary":{label:"Consumer Discretionary",color:"#8b5cf6",icon:"ShoppingCart"},Industrials:{label:"Industrials & Manufacturing",color:"#6366f1",icon:"Factory"},Commodities:{label:"Metals & Commodities",color:"#78716c",icon:"Pickaxe"},FMCG:{label:"FMCG & Essentials",color:"#22c55e",icon:"ShoppingBag"},Telecommunication:{label:"Telecom & Media",color:"#06b6d4",icon:"Radio"},Utilities:{label:"Utilities",color:"#eab308",icon:"Plug"},Services:{label:"Services",color:"#a855f7",icon:"Briefcase"},Diversified:{label:"Diversified",color:"#d97706",icon:"Layers"}},c={Technology:"Information Technology","Financial Services":"Financial Services",Healthcare:"Healthcare",Energy:"Energy","Consumer Cyclical":"Consumer Discretionary",Industrials:"Industrials","Basic Materials":"Commodities","Consumer Defensive":"FMCG","Communication Services":"Telecommunication",Utilities:"Utilities","Real Estate":"Real Estate",Realty:"Real Estate",Conglomerate:"Diversified",Power:"Energy","Consumer Goods":"FMCG",Metals:"Commodities","Oil & Gas":"Energy",Pharma:"Healthcare",Automobile:"Consumer Discretionary",Cement:"Commodities",Chemicals:"Commodities",Construction:"Industrials",IT:"Information Technology",Telecom:"Telecommunication",Banking:"Financial Services",Insurance:"Financial Services",Infrastructure:"Industrials",Media:"Telecommunication",Textiles:"Consumer Discretionary","Media & Entertainment":"Telecommunication",Agriculture:"FMCG"},d=function(){let e=new Map,t=new Map,a=[],s=(s,r)=>{let n=s.toLowerCase();if(e.has(n))return;e.set(n,r),a.push(s);let i=t.get(r);i?i.push(s):t.set(r,[s])};for(let e of Object.keys(o))s(e,e);for(let[e,t]of Object.entries(c))t in o&&s(e,t);return{rawToCanonical:e,canonicalToRaws:t,knownValues:a}}();Object.keys(o).map(e=>[e.toLowerCase(),e]),d.knownValues;var p=a(38254),m=a(39511),h=a(90299),f=a(64265),u=a(5646),x=a(98748),b=a(56242),g=a(76541),v=a(62585),y=a(33614),j=a(36488),k=a(78914),N=a(23555),w=a(36645);let C=(0,r.createContext)({open:!1,setOpen:()=>{}});function S(){return(0,r.useContext)(C)}function A({children:e}){let[t,a]=(0,r.useState)(!1),i=(0,n.usePathname)(),l=(0,p.B1)(i);return(0,r.useEffect)(()=>{if(l)return;let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),a(e=>!e))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l]),(0,s.jsxs)(C.Provider,{value:{open:t,setOpen:a},children:[e,!l&&(0,s.jsx)(U,{open:t,onOpenChange:a})]})}let E=[{label:"Start New Analysis",icon:f.A,href:"/analysis"},{label:"Create FIRE Scenario",icon:u.A,href:"/fire"},{label:"Discover Stocks",icon:x.A,href:"/discover"},{label:"Generate AI Strategy",icon:b.A,href:"/strategies"},{label:"Submit Feedback",icon:g.A,href:"/settings?tab=feedback"},{label:"View My Feedback",icon:g.A,href:"/settings?tab=feedback"}],R=["Information Technology","Financial Services","Healthcare","Energy","FMCG","Real Estate"],I=["var(--pop-3)","var(--pop-2)","var(--pop-5)","var(--pop-1)","var(--pop-4)","var(--emerald)"];function M(e){return I[e%I.length]}function U({open:e,onOpenChange:t}){let a=(0,n.useRouter)(),[c,d]=(0,r.useState)(""),{results:f,isSearching:u}=(0,h.t)(c,{kinds:["core","mf"],limit:12}),[x,b]=(0,r.useState)(0),g=(0,r.useRef)(null),C=(0,r.useRef)(null),{flags:S,isLoading:A}=(0,m.h)(),I=E.filter(e=>"/quizzes"!==e.href||!A&&S["/quizzes"]),T=(0,r.useCallback)(e=>{t(!1),a.push(e)},[t,a]);(0,r.useEffect)(()=>{e?setTimeout(()=>g.current?.focus(),10):(d(""),b(0))},[e]);let F=(0,r.useCallback)(e=>{d(e),b(0)},[]),L=r.useMemo(()=>
1{if(c){let e=f.filter(e=>!e.type||"EQUITY"===e.type),t=f.filter(e=>"ETF"===e.type),a=f.filter(e=>"MF"===e.type),s=f.filter(e=>"INDEX"===e.type),r=(e,t,a)=>({id:`${e.symbol}-${e.exchange}-${a}`,label:"MF"===e.type?e.name:e.symbol,sub:"MF"===e.type?e.exchange:e.name,icon:t,iconColor:M(a),onSelect:()=>{T((0,i.y)({symbol:e.symbol,exchange:e.exchange,type:e.type}))}}),n=[];return e.length>0&&n.push({label:"Stocks",items:e.map((e,t)=>r(e,v.A,t))}),t.length>0&&n.push({label:"ETFs",items:t.map((t,a)=>r(t,y.A,e.length+a))}),a.length>0&&n.push({label:"Mutual Funds",items:a.map((a,s)=>r(a,j.A,e.length+t.length+s))}),s.length>0&&n.push({label:"Indices",items:s.map((s,n)=>r(s,k.A,e.length+t.length+a.length+n))}),n}let e=[],t=0;p.TV.forEach(a=>{let s=[];a.items.forEach(e=>{if(e.featureFlag&&(A||!S[e.featureFlag]))return;let a=e.icon;s.push({id:e.href,label:e.label,icon:a,iconColor:M(t++),onSelect:()=>T(e.href)}),e.children?.forEach(e=>{e.featureFlag&&(A||!S[e.featureFlag])||s.push({id:e.href,label:e.label,icon:e.icon,iconColor:M(t++),onSelect:()=>T(e.href)})})}),0!==s.length&&e.push({label:a.label||"Overview",items:s})}),t=0,e.push({label:"Account",items:p.Tt.map((e,t)=>({id:e.href,label:e.label,icon:e.icon,iconColor:M(t+2),onSelect:()=>T(e.href)}))});let a=c.trim().length>0?Object.keys(o):R;return e.push({label:"Browse Sectors",items:a.map((e,t)=>({id:`sector-${e}`,label:e,icon:v.A,iconColor:M(t),onSelect:()=>T(`/discover/markets?sector=${encodeURIComponent((0,l.BG)(e))}`)}))}),e.push({label:"Quick Actions",items:I.map(e=>({id:e.href+e.label,label:e.label,icon:e.icon,iconColor:"var(--emerald)",onSelect:()=>T(e.href)}))}),e},[c,f,T,I,S,A]),D=r.useMemo(()=>L.flatMap(e=>e.items),[L]);if((0,r.useEffect)(()=>{if(!e)return;let a=e=>{if("Escape"===e.key)return void t(!1);if("ArrowDown"===e.key){e.preventDefault(),b(e=>Math.min(e+1,D.length-1));return}if("ArrowUp"===e.key){e.preventDefault(),b(e=>Math.max(e-1,0));return}"Enter"===e.key&&(e.preventDefault(),D[x]?.onSelect())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,D,x,t]),(0,r.useEffect)(()=>{if(!C.current)return;let e=C.current.querySelector(`[data-cmd-index="${x}"]`);e?.scrollIntoView({block:"nearest"})},[x]),!e)return null;let P=D.length;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pf-cmd-scrim",onClick:()=>t(!1),"aria-hidden":!0}),(0,s.jsxs)("div",{className:"pf-cmd-card",role:"dialog","aria-modal":!0,"aria-label":"Command palette",children:[(0,s.jsxs)("div",{className:"pf-cmd-search-row",children:[(0,s.jsx)("div",{className:"pf-cmd-search-icon",children:(0,s.jsx)(N.A,{size:14,strokeWidth:2.25})}),(0,s.jsx)("input",{ref:g,className:"pf-cmd-input",placeholder:"Search stocks, mutual funds, indicesâ¦",value:c,onChange:e=>F(e.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1}),(0,s.jsx)("span",{className:"pf-cmd-esc mono",children:"esc"}),(0,s.jsx)("button",{className:"pf-cmd-close",onClick:()=>t(!1),"aria-label":"Close",children:(0,s.jsx)(w.A,{size:12,strokeWidth:2.25})})]}),(0,s.jsxs)("div",{className:"pf-cmd-list",ref:C,children:[u&&(0,s.jsx)("div",{className:"pf-cmd-empty mono",children:"Searchingâ¦"}),!u&&c.length>=2&&0===P&&(0,s.jsx)("div",{className:"pf-cmd-empty",children:"No results found."}),L.map(e=>(0,s.jsxs)("div",{className:"pf-cmd-group",children:[(0,s.jsx)("div",{className:"pf-cmd-group-label mono",children:e.label}),(0,s.jsx)("div",{className:"pf-cmd-group-items",children:e.items.map(e=>{let t=D.indexOf(e),a=t===x,r=e.icon;return(0,s.jsxs)("button",{"data-cmd-index":t,className:`pf-cmd-item${a?" is-active":""}`,onMouseEnter:()=>b(t),onClick:()=>e.onSelect(),tabIndex:-1,children:[(0,s.jsx)("span",{className:"pf-cmd-item-ic",style:{background:e.iconColor},children:(0,s.jsx)(r,{size:12,strokeWidth:2.25})}),(0,s.jsxs)("span",{className:"pf-cmd-item-body",children:[(0,s.jsx)("span",{className:"pf-cmd-item-label",children:e.label}),e.sub&&(0,s.jsx)("span",{className:"pf-cmd-item-sub ser",children:e.sub})]}),e.kbd&&e.kbd.length>0&&(0,s.jsx)("span",{className:"pf-cmd-item-kbds",children:e.kbd.map((e,t)=>(0,s.jsx)("span",{className:"pf-cmd-kbd mono",children:e},t))})]},e.id)})})]},e.label))]}),(0,s.jsxs)("div",{className:"pf-cmd-footer",children:[(0,s.jsxs)("div",{className:"pf-cmd-legend",children:[(0,s.jsxs)("span",{className:"pf-cmd-legend-item",children:[(0,s.jsx)("span",{className:"pf-cmd-kbd mono",children:"ââ"}),(0,s.jsx)("span",{className:"ser",children:"navigate"})]}),(0,s.jsxs)("span",{className:"pf-cmd-legend-item",children:[(0,s.jsx)("span",{className:"pf-cmd-kbd mono",children:"âµ"}),(0,s.jsx)("span",{className:"ser",children:"open"})]}),(0,s.jsxs)("span",{className:"pf-cmd-legend-item",children:[(0,s.jsx)("span",{className:"pf-cmd-kbd mono",children:"esc"}),(0,s.jsx)("span",{className:"ser",children:"close"})]})]}),(0,s.jsx)("span",{className:"pf-cmd-brand ser",children:"search powered by ⦠StockSage"})]})]}),(0,s.jsx)("style",{children:` 2 /* ââ Command Palette overlay ââââââââââââââââââââââââââââââââ */ 3 .pf-cmd-scrim { 4 position: fixed; 5 inset: 0; 6 z-index: 9998; 7 background: rgba(15, 13, 8, 0.55); 8 backdrop-filter: blur(2px); 9 } 10 html.dark .pf-cmd-scrim { 11 background: rgba(0, 0, 0, 0.65); 12 } 13 14 /* Centered card. NB: no rotate() on this text-bearing panel â 15 rotating the whole container forces every glyph onto a 16 non-pixel-aligned raster and reads as "blurry". The playful 17 tilt lives on the decorative icon tiles instead. */ 18 .pf-cmd-card { 19 position: fixed; 20 top: 12%; 21 left: 50%; 22 z-index: 9999; 23 /* Round the centering translate to whole pixels so an 24 even/odd-width box never lands on a half-pixel (subpixel 25 text blur). */ 26 transform: translateX(-50%); 27 width: min(580px, calc(100vw - 24px)); 28 max-height: min(540px, calc(100vh - 90px)); 29 background: var(--paper); 30 border: 2px solid var(--ink); 31 border-radius: 14px; 32 box-shadow: 8px 8px 0 var(--ink); 33 display: flex; 34 flex-direction: column; 35 overflow: hidden; 36 font-family: "Inter", system-ui, sans-serif; 37 color: var(--ink); 38 } 39 html.dark .pf-cmd-card { 40 box-shadow: 8px 8px 0 #000; 41 } 42 43 /* Search row ââââââââââââââââââââââââââââââââââââââââââââââ */ 44 .pf-cmd-search-row { 45 display: flex; 46 align-items: center; 47 gap: 10px; 48 padding: 14px 18px; 49 border-bottom: 2px solid var(--ink); 50 background: var(--paper); 51 flex-shrink: 0; 52 } 53
54 /* Emerald rotated icon tile */ 55 .pf-cmd-search-icon { 56 width: 28px; 57 height: 28px; 58 border-radius: 7px; 59 background: var(--emerald); 60 border: 1.25px solid var(--ink); 61 display: grid; 62 place-items: center; 63 transform: rotate(-4deg); 64 flex-shrink: 0; 65 color: var(--paper); 66 } 67 68 .pf-cmd-input { 69 flex: 1; 70 background: transparent; 71 border: 0; 72 outline: none; 73 font-size: 15px; 74 font-weight: 600; 75 color: var(--ink); 76 font-family: inherit; 77 min-width: 0; 78 } 79 .pf-cmd-input::placeholder { 80 color: var(--ink-4); 81 font-weight: 400; 82 } 83 84 .pf-cmd-esc { 85 font-size: 10px; 86 padding: 3px 7px; 87 border: 1.25px solid var(--rule-soft); 88 border-radius: 5px; 89 color: var(--ink-3); 90 flex-shrink: 0; 91 } 92 93 .pf-cmd-close { 94 width: 28px; 95 height: 28px; 96 border: 1.5px solid var(--ink); 97 background: var(--paper); 98 border-radius: 7px; 99 display: grid; 100 place-items: center; 101 cursor: pointer; 102 color: var(--ink); 103 flex-shrink: 0; 104 transition: box-shadow 0.1s, transform 0.1s; 105 } 106 .pf-cmd-close:hover { 107 transform: translate(-1px, -1px); 108 box-shadow: 2px 2px 0 var(--ink); 109 } 110 111 /* Results list âââââââââââââââââââââââââââââââââââââââââââ */ 112 .pf-cmd-list { 113 flex: 1; 114 overflow-y: auto; 115 padding: 10px; 116 min-height: 0; 117 scrollbar-width: none; 118 } 119 .pf-cmd-list::-webkit-scrollbar {
120 display: none; 121 } 122 123 .pf-cmd-empty { 124 padding: 24px 12px; 125 text-align: center; 126 font-size: 13px; 127 color: var(--ink-3); 128 } 129 130 /* Group âââââââââââââââââââââââââââââââââââââââââââââââââ */ 131 .pf-cmd-group { 132 margin-bottom: 8px; 133 } 134 .pf-cmd-group:last-child { 135 margin-bottom: 0; 136 } 137 138 .pf-cmd-group-label { 139 padding: 8px 10px 6px; 140 font-size: 10px; 141 font-weight: 700; 142 letter-spacing: 1.3px; 143 color: var(--ink-3); 144 text-transform: uppercase; 145 } 146 147 .pf-cmd-group-items { 148 display: flex; 149 flex-direction: column; 150 gap: 2px; 151 } 152 153 /* Individual result row ââââââââââââââââââââââââââââââââââ */ 154 .pf-cmd-item { 155 display: flex; 156 align-items: center; 157 gap: 10px; 158 padding: 8px 10px; 159 border-radius: 8px; 160 background: transparent; 161 border: 1.5px solid transparent; 162 font-family: inherit; 163 cursor: pointer; 164 text-align: left; 165 color: var(--ink); 166 width: 100%; 167 transition: background 0.08s, border-color 0.08s, box-shadow 0.08s, transform 0.08s; 168 } 169 .pf-cmd-item:hover, 170 .pf-cmd-item.is-active { 171 background: var(--pop-2); 172 border-color: var(--ink); 173 box-shadow: 2px 2px 0 var(--ink); 174 /* Whole-pixel lift only â no rotate() here: rotating the 175 active row blurs its label text on hover/selection. */ 176 transform: translate(-1px, -1px); 177 color: #1d1d1b; 178 } 179 html.dark .pf-cmd-item:hover, 180 html.dark .pf-cmd-item.is-active { 181 /* pop-2 in dark is #fcd34d â keeps dark-ink text readable */ 182 color: #1d1d1b; 183 } 184 185 /* Pop-colored icon tile inside each row */ 186 .pf-cmd-item-ic { 187 width: 26px; 188 height: 26px; 189 border-radius: 6px; 190 border: 1.25px solid var(--ink); 191 display: grid; 192 place-items: center; 193 transform: rotate(-3deg); 194 flex-shrink: 0; 195 color: var(--paper); 196 } 197 .pf-cmd-item.is-active .pf-cmd-item-ic, 198 .pf-cmd-item:hover .pf-cmd-item-ic { 199 border-color: #1d1d1b; 200 } 201 202 .pf-cmd-item-body { 203 flex: 1; 204 min-width: 0; 205 display: flex; 206 flex-direction: column; 207 } 208 209 .pf-cmd-item-label { 210 font-size: 13px; 211 font-weight: 700; 212 white-space: nowrap; 213 overflow: hidden; 214 text-overflow: ellipsis; 215 } 216 217 .pf-cmd-item-sub { 218 font-size: 11.5px; 219 color: var(--ink-3); 220 white-space: nowrap; 221 overflow: hidden; 222 text-overflow: ellipsis;
223 margin-top: 1px; 224 } 225 .pf-cmd-item.is-active .pf-cmd-item-sub, 226 .pf-cmd-item:hover .pf-cmd-item-sub { 227 color: rgba(29, 29, 27, 0.65); 228 } 229 230 /* Keyboard hint badges */ 231 .pf-cmd-item-kbds { 232 display: flex; 233 gap: 4px; 234 flex-shrink: 0; 235 } 236 237 .pf-cmd-kbd { 238 font-size: 10px; 239 padding: 2px 6px; 240 border: 1.25px solid var(--ink); 241 border-radius: 5px; 242 background: var(--paper); 243 color: var(--ink); 244 font-weight: 700; 245 min-width: 18px; 246 text-align: center; 247 display: inline-block; 248 } 249 .pf-cmd-item.is-active .pf-cmd-kbd, 250 .pf-cmd-item:hover .pf-cmd-kbd { 251 background: var(--paper); 252 border-color: var(--ink); 253 color: var(--ink); 254 } 255 256 /* Footer legend âââââââââââââââââââââââââââââââââââââââââââ */ 257 .pf-cmd-footer { 258 padding: 10px 18px; 259 border-top: 1.5px dashed var(--rule-soft); 260 background: var(--paper-2); 261 display: flex; 262 align-items: center; 263 justify-content: space-between; 264 gap: 12px; 265 flex-shrink: 0; 266 } 267 268 .pf-cmd-legend { 269 display: flex; 270 gap: 14px; 271 } 272 273 .pf-cmd-legend-item { 274 display: flex; 275 align-items: center; 276 gap: 5px; 277 font-size: 10.5px; 278 color: var(--ink-3); 279 } 280 .pf-cmd-legend-item .pf-cmd-kbd { 281 border-color: var(--rule-soft); 282 background: transparent; 283 color: var(--ink-2); 284 } 285 286 .pf-cmd-brand { 287 font-size: 12px; 288 color: var(--ink-3); 289 white-space: nowrap; 290 } 291 292 /* Mobile breakpoint â full-width, anchored near top */ 293 @media (max-width: 640px) { 294 .pf-cmd-card { 295 top: 64px; 296 width: calc(100% - 24px); 297 max-height: calc(100vh - 90px); 298 border-radius: 12px; 299 } 300 .pf-cmd-legend-item .ser, 301 .pf-cmd-brand { 302 display: none; 303 } 304 } 305 `})]})}},7330:(e,t,a)=>{"use strict";a.d(t,{TooltipProvider:()=>l,ZI:()=>d,k$:()=>c,m_:()=>o});var s=a(54568),r=a(7620),n=a(78920),i=a(74387);let l=n.Kq,o=n.bL,c=n.l9,d=r.forwardRef(({className:e,sideOffset:t=4,...a},r)=>(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{ref:r,sideOffset:t,className:(0,i.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...a})}));d.displayName=n.UC.displayName},11376:(e,t,a)=>{"use strict";a.d(t,{AM:()=>l,Wv:()=>o,hl:()=>c});var s=a(54568),r=a(7620),n=a(26486),i=a(74387);let l=n.bL,o=n.l9;n.Mz;let c=r.forwardRef(({className:e,align:t="center",sideOffset:a=4,...r},l)=>(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{ref:l,align:t,sideOffset:a,className:(0,i.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));c.displayName=n.UC.displayName},21698:(e,t,a)=>{"use strict";a.d(t,{C:()=>c,J:()=>d});var s=a(54568),r=a(7620),n=a(39182),i=a(87547),l=a(79227),o=a(74387);function c(e,t,a,s=400){let r,n,i=e;"system"===e&&(i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");let l=()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(i),t(e)};if(a){let e=a.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}else r=window.innerWidth/2,n=window.innerHeight/2;
305let o=window.visualViewport?.width??window.innerWidth,d=window.visualViewport?.height??window.innerHeight,p=Math.hypot(Math.max(r,o-r),Math.max(n,d-n)),m=document;m.startViewTransition?m.startViewTransition(l).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${r}px ${n}px)`,`circle(${p}px at ${r}px ${n}px)`]},{duration:s,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})}):l()}let d=({className:e,duration:t=400,iconSize:a="h-4 w-4",...d})=>{let{resolvedTheme:p,setTheme:m}=(0,l.D)(),[h,f]=(0,r.useState)(!1),u=(0,r.useRef)(null);(0,r.useEffect)(()=>f(!0),[]);let x="dark"===p,b=(0,r.useCallback)(()=>{c(x?"light":"dark",m,u.current,t)},[x,t,m]);return h?(0,s.jsxs)("button",{type:"button",ref:u,onClick:b,className:(0,o.cn)(e),...d,children:[x?(0,s.jsx)(i.A,{className:a}):(0,s.jsx)(n.A,{className:a}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]}):(0,s.jsxs)("button",{type:"button",className:(0,o.cn)(e),...d,disabled:!0,children:[(0,s.jsx)(n.A,{className:(0,o.cn)(a,"opacity-0")}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}},34402:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>m,_2:()=>h,rI:()=>d,ty:()=>p});var s=a(54568),r=a(7620),n=a(45492),i=a(76265),l=a(34309),o=a(21411),c=a(74387);let d=n.bL,p=n.l9;n.YJ,n.ZL,n.Pb,n.z6,r.forwardRef(({className:e,inset:t,children:a,...r},l)=>(0,s.jsxs)(n.ZP,{ref:l,className:(0,c.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[a,(0,s.jsx)(i.A,{className:"ml-auto"})]})).displayName=n.ZP.displayName,r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.G5,{ref:a,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t})})).displayName=n.G5.displayName;let m=r.forwardRef(({className:e,sideOffset:t=4,...a},r)=>(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{ref:r,sideOffset:t,className:(0,c.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));m.displayName=n.UC.displayName;let h=r.forwardRef(({className:e,inset:t,...a},r)=>(0,s.jsx)(n.q7,{ref:r,className:(0,c.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));h.displayName=n.q7.displayName,r.forwardRef(({className:e,children:t,checked:a,...r},i)=>(0,s.jsxs)(n.H_,{ref:i,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...r,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.VF,{children:(0,s.jsx)(l.A,{className:"h-4 w-4"})})}),t]})).displayName=n.H_.displayName,r.forwardRef(({className:e,children:t,...a},r)=>
305(0,s.jsxs)(n.hN,{ref:r,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.VF,{children:(0,s.jsx)(o.A,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=n.hN.displayName,r.forwardRef(({className:e,inset:t,...a},r)=>(0,s.jsx)(n.JU,{ref:r,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a})).displayName=n.JU.displayName,r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(n.wv,{ref:a,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=n.wv.displayName},38254:(e,t,a)=>{"use strict";a.d(t,{Tt:()=>eD,default:()=>eZ,B1:()=>eq,TV:()=>eL});var s=a(54568),r=a(7620),n=a(82175),i=a(65587),l=a.n(i),o=a(79748),c=a(79227),d=a(61049),p=a(20217),m=a(48481),h=a(7330),f=a(34703),u=a(91397),x=a(36645),b=a(74387);let g=f.bL,v=f.l9;f.bm;let y=f.ZL,j=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(f.hJ,{className:(0,b.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));j.displayName=f.hJ.displayName;let k=(0,u.F)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),N=r.forwardRef(({side:e="right",className:t,children:a,...r},n)=>(0,s.jsxs)(y,{children:[(0,s.jsx)(j,{}),(0,s.jsxs)(f.UC,{ref:n,className:(0,b.cn)(k({side:e}),t),...r,children:[(0,s.jsxs)(f.bm,{className:"absolute right-4 top-4 roun
305ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(x.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));N.displayName=f.UC.displayName,r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(f.hE,{ref:a,className:(0,b.cn)("text-lg font-semibold text-foreground",e),...t})).displayName=f.hE.displayName,r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(f.VY,{ref:a,className:(0,b.cn)("text-sm text-muted-foreground",e),...t})).displayName=f.VY.displayName;var w=a(12803);let C=w.bL,S=w.R6,A=w.Ke;var E=a(63461),R=a(7920),I=a(46548),M=a(76854),U=a(20732),T=a(69353),F=a(5646),L=a(78914),D=a(23555),P=a(56242),z=a(64265),O=a(13878),$=a(30774),_=a(86511),W=a(21425),B=a(81561),G=a(2939),H=a(68476),V=a(37270),K=a(77542),q=a(34041),Z=a(87547),Y=a(39182),J=a(76710),X=a(17212),Q=a(90466),ee=a(63742),et=a(34402),ea=a(92378),es=a(39511),er=a(63094),en=a(1957),ei=a(1538),el=a(76367),eo=a(21698),ec=a(15334),ed=a(3516),ep=a(70452),em=a(40414),eh=a(46175),ef=a(98044),eu=a(56483),ex=a(28819),eb=a(9901),eg=a(88011),ev=a(13858),ey=a(73012),ej=a(76265),ek=a(76541),eN=a(82323),ew=a(82099),eC=a(62585);a(80584);let eS=[{label:"Account",href:"/settings?tab=account",Icon:ep.A},{label:"Plans",href:"/settings?tab=plans",Icon:em.A},{label:"Billing",href:"/settings?tab=billing",Icon:eh.A},{label:"Usage",href:"/settings?tab=usage",Icon:L.A},{label:"Preferences",href:"/settings?tab=preferences",Icon:ef.A},{label:"Notifications",href:"/settings?tab=notifications",Icon:K.A},{label:"Security",href:"/settings?tab=security",Icon:eu.A},{label:"Integrations",href:"/settings?tab=integrations",Icon:ex.A}],eA=[{label:"Prompts",href:"/help?tab=prompts",Icon:eb.A},{label:"Commands",href:"/help?tab=slash-commands",Icon:eg.A},{label:"Guides",href:"/help?tab=guides",Icon:T.A},{label:"Docs",href:"/help?tab=docs",Icon:G.A},{label:"FAQ",href:"/help?tab=faq",Icon:ev.A},{label:"Glossary",href:"/help?tab=glossary",Icon:ey.A}];function eE({children:e,variant:t="default"}){return(0,s.jsx)("span",{className:`pf-pm-ic${"default"!==t?` ${t}`:""}`,"aria-hidden":!0,children:e})}function eR({icon:e,label:t,right:a,hasChevron:r,expanded:n,onClick:i,onMouseEnter:l,onFocus:o}){return(0,s.jsxs)("button",{type:"button",className:"pf-pm-item",onClick:i,onMouseEnter:l,onFocus:o,"aria-expanded":r?!!n:void 0,children:[(0,s.jsx)(eE,{children:e}),(0,s.jsx)("span",{className:"pf-pm-item-label",children:t}),a,r&&(0,s.jsx)(ej.A,{size:13,style:{color:"var(--ink-3)",flexShrink:0,transition:"transform .15s ease",transform:n?"rotate(90deg)":"none"}})]})}function eI({items:e,onNavigate:t}){return(0,s.jsx)("div",{className:"pf-pm-sub",role:"group",children:e.map(({label:e,href:a,Icon:r})=>(0,s.jsxs)("button",{type:"button",className:"pf-pm-subitem",onClick:()=>t(a),children:[(0,s.jsx)(r,{size:12,className:"pf-pm-sub-ic","aria-hidden":!0}),(0,s.jsx)("span",{children:e})]},a))})}function eM({label:e,items:t,onNavigate:a,onMouseEnter:n}){let i=(0,r.useRef)(null),[l,o]=(0,r.useState)(0);return(0,r.useLayoutEffect)(()=>{let e=i.current;if(!e)return;e.style.top="0px";let t=e.getBoundingClientRect().bottom-(window.innerHeight-16);o(t>0?-t:0)},[]),(0,s.jsxs)("div",{ref:i,className:"pf-pm-flyout","aria-label":e,style:{top:l},onMouseEnter:n,children:[(0,s.jsx)("div",{className:"pf-pm-flyout-head",children:e}),(0,s.jsx)(eI,{items:t,onNavigate:a})]})}function eU({userName:e,userEmail:t,userImage:a,planId:i,creditsLimit:l,creditsUsed:o,creditsResetAt:d,nextBillingDate:p,onFeedback:m,onSubscription:h,onNavigate:f,onTourAgain:u,onHomePage:x,onLogOut:b,logOutLabel:g="Log out"}){let[v,y]=(0,r.useState)(!1);(0,r.useEffect)(()=>y(!0),[]);let[j,k]=(0,r.useState)(null),N=()=>k(null),{theme:w,setTheme:C}=(0,c.D)(),S=v?w??"system":"system",A=e.split(" ").map(e=>e[0]).slice(0,2).join("").toUpperCase()||"U",E=null!=i,R="PRO"===i||"PREMIUM"===i,M=R?`UseMoney ${i}`:"Free Plan",U=function(e){if(!e)return null;try{let t=new Date(e);if(isNaN(t.getTime()))return null;return t.toLocaleDateString("en-IN",{month:"short",day:"numeric"})}catch{return null}}(p??d),T=null;if(R&&"number"==typeof l&&l>0){let e=Math.max(0,l-("number"==typeof o?o:0));T=`${e} / ${l} credits`,U&&(T+=` \xb7 renews ${U}`)}else R&&-1===l&&(T="Unlimited credits",U&&(T+=` \xb7 renews ${U}`));return(0,s.jsxs)("div",{className:"pf-profile-menu",children:[(0,s.jsxs)("div",{className:"pf-pm-header",onMouseEnter:N,
305children:[(0,s.jsx)("div",{className:"pf-pm-av",children:a?(0,s.jsx)(n.default,{src:a,alt:e,width:40,height:40,style:{width:"100%",height:"100%",objectFit:"cover"}}):A}),(0,s.jsxs)("div",{className:"pf-pm-user",children:[(0,s.jsx)("div",{className:"pf-pm-name",children:e}),t&&(0,s.jsx)("div",{className:"pf-pm-email mono",children:t})]})]}),E?(0,s.jsxs)("div",{className:`pf-pm-plan${R?"":" upgrade"}`,onMouseEnter:N,children:[(0,s.jsx)("span",{className:"pf-pm-plan-badge",children:R?i:"FREE"}),(0,s.jsxs)("div",{className:"pf-pm-plan-info",children:[(0,s.jsx)("div",{className:"pf-pm-plan-name",children:M}),T&&(0,s.jsx)("div",{className:"pf-pm-plan-meta mono",children:T}),!R&&(0,s.jsx)("div",{className:"pf-pm-plan-meta mono",children:"Upgrade for full access â"})]}),(0,s.jsx)("button",{type:"button",className:"pf-bs sm",onClick:h,style:{fontSize:11.5,padding:"5px 9px",flexShrink:0},children:R?"Manage":"Go PRO"})]}):(0,s.jsxs)("div",{className:"pf-pm-plan loading","aria-busy":"true",children:[(0,s.jsx)("span",{className:"pf-pm-skel",style:{width:36,height:16,borderRadius:4}}),(0,s.jsxs)("div",{className:"pf-pm-plan-info",children:[(0,s.jsx)("span",{className:"pf-pm-skel",style:{width:92,height:12}}),(0,s.jsx)("span",{className:"pf-pm-skel",style:{width:132,height:10,marginTop:6}})]})]}),(0,s.jsxs)("div",{className:"pf-pm-group",children:[(0,s.jsx)(eR,{icon:(0,s.jsx)(ek.A,{size:13}),label:"Feedback",onClick:m,onMouseEnter:N,onFocus:N}),(0,s.jsx)(eR,{icon:(0,s.jsx)(eN.A,{size:13}),label:"Subscription",onClick:h,onMouseEnter:N,onFocus:N,right:E?(0,s.jsx)("span",{className:"pf-pill outline",style:{fontSize:9.5,flexShrink:0},children:"FREE"===i?"FREE":i}):void 0}),(0,s.jsxs)("div",{className:"pf-pm-theme-row",onMouseEnter:N,children:[(0,s.jsx)(eE,{children:(0,s.jsx)(Z.A,{size:13})}),(0,s.jsx)("span",{className:"pf-pm-theme-label",children:"Theme"}),(0,s.jsx)("div",{className:"pf-pm-theme-seg",role:"group","aria-label":"Theme",children:[{key:"system",Icon:ew.A,title:"System"},{key:"light",Icon:Z.A,title:"Light"},{key:"dark",Icon:Y.A,title:"Dark"}].map(({key:e,Icon:t,title:a})=>(0,s.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),C(e)},title:a,className:`pf-pm-theme-btn${S===e?" active":""}`,"aria-pressed":S===e,children:(0,s.jsx)(t,{size:12})},e))})]})]}),(0,s.jsxs)("div",{className:"pf-pm-group",children:[(0,s.jsxs)("div",{className:"pf-pm-item-wrap",children:[(0,s.jsx)(eR,{icon:(0,s.jsx)(V.A,{size:13}),label:"Settings",hasChevron:!0,expanded:"settings"===j,onMouseEnter:()=>k("settings"),onFocus:()=>k("settings"),onClick:()=>k("settings"===j?null:"settings")}),"settings"===j&&(0,s.jsx)(eM,{label:"Settings",items:[{label:"All settings",href:"/settings",Icon:V.A},...eS],onNavigate:f,onMouseEnter:()=>k("settings")})]}),(0,s.jsxs)("button",{type:"button",className:"pf-pm-item",onClick:u,onMouseEnter:N,onFocus:N,children:[(0,s.jsx)(eE,{variant:"emerald",children:(0,s.jsx)(I.A,{size:13})}),(0,s.jsx)("span",{className:"pf-pm-item-label",children:"Take the tour again"})]}),(0,s.jsx)(eR,{icon:(0,s.jsx)(eC.A,{size:13}),label:"Home Page",onClick:x,onMouseEnter:N,onFocus:N}),(0,s.jsxs)("div",{className:"pf-pm-item-wrap",children:[(0,s.jsx)(eR,{icon:(0,s.jsx)(ey.A,{size:13}),label:"Help",hasChevron:!0,expanded:"help"===j,onMouseEnter:()=>k("help"),onFocus:()=>k("help"),onClick:()=>k("help"===j?null:"help")}),"help"===j&&(0,s.jsx)(eM,{label:"Help",items:[{label:"Help center",href:"/help",Icon:ey.A},...eA],onNavigate:f,onMouseEnter:()=>k("help")})]})]}),(0,s.jsx)("div",{className:"pf-pm-footer",children:(0,s.jsxs)("button",{type:"button",className:"pf-pm-logout",onClick:b,onMouseEnter:N,onFocus:N,children:[(0,s.jsx)(eE,{variant:"coral",children:(0,s.jsx)(J.A,{size:13})}),g]})})]})}var eT=a(67787);function eF(){if((0,ec.E)(ed.oV).catch(()=>{}),"/dashboard"!==window.location.pathname){window.location.href="/dashboard?walkthrough=v1-core";return}window.dispatchEvent(new CustomEvent("walkthrough:restart",{detail:ed.oV}))}let eL=[{label:"WORKSPACE",items:[{href:"/dashboard",label:"Dashboard",icon:R.A},{href:"/stocksage",label:"StockSage",icon:I.A,color:"emerald",badge:"AI"},{href:"/holdings",label:"Holdings",icon:M.A,walkthrough:"nav-holdings"},{href:"/watchlist",label:"Watchlists",icon:U.A},{href:"/tradebook",label:"Tradebook",icon:T.A},{href:"/roast",label:"Portfolio Roast",icon:F.A,color:"pink",walkthrough:"nav-roast"}]},{label:"DISCOVER",items:[{href:"/discover/markets",label:"Markets",icon:L.A,color:"blue"},{href:"/discover/screener",label:"Screener",icon:D.A,walkthrough:"nav-screener"},{href:"/strategies",label:"Strategies",icon:P.A},{href:"/analysis",label:"Research List",icon:z.A},{href:"/discover/news",label:"News & Events",icon:O.A}]},{label:"TOOLS",items:[{href:"/fire",label:"FIRE Calculator",icon:$.A,color:"coral",walkthrough:"nav-fire"},{href:"/calculators",label:"Calculators",icon:_.A},{href:"/risk",label:"Risk Report",icon:W.A,featureFlag:"/risk"},{href:"/tax",label:"Tax Report",icon:B.A,featureFlag:"/tax"},{href:"/documents",label:"Document Vault",icon:G.A}]},{label:"ACCOUNT",items:[{href:"/brokers",label:"Brokers",icon:H.A,walkthrough:"nav-brokers"},{href:"/settings",label:"Settings",icon:V.A},{href:"/notifications",label:"Notifications",icon:K.A}]}],eD=[],eP=new Set(["/dashboard","/settings","/brokers","/stocksage","/holdings","/tradebook","/fire","/discover/screener"]);function ez(){let e=(0,o.useRouter)(),t=(0,r.useRef)(new Set);return(0,r.useCallback)(a=>
305{eP.has(a)||t.current.has(a)||(t.current.add(a),e.prefetch(a))},[e])}var eO=eL;let e$=[];for(let e of eO)for(let t of e.items)if(e$.push(t),t.children)for(let e of t.children)e$.push({...e});function e_({label:e,collapsed:t}){return t?(0,s.jsx)("div",{className:"border-t border-[var(--rule-soft)] my-2"}):(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2.5 pt-4 pb-1.5",children:[(0,s.jsx)("span",{className:"font-mono text-[10.5px] font-bold tracking-[1.8px] text-[var(--ink-3)] uppercase",children:e}),(0,s.jsx)("span",{className:"flex-1 h-[1.5px] bg-[var(--ink)] opacity-25"})]})}function eW({item:e,isActive:t,collapsed:a,onClick:r}){let n=e.icon,i=eP.has(e.href),o=ez(),c=(0,s.jsxs)(l(),{href:e.href,prefetch:!!i&&void 0,onMouseEnter:()=>o(e.href),onFocus:()=>o(e.href),onClick:r,"data-walkthrough":e.walkthrough,className:(0,b.cn)("pf-navi",t&&"is-active",a&&"is-coll"),children:[(0,s.jsx)("span",{className:(0,b.cn)("pf-navi-ic",e.color&&`p-${e.color}`),children:(0,s.jsx)(n,{className:"h-4 w-4"})}),!a&&(0,s.jsx)("span",{className:"pf-navi-l",children:e.label}),!a&&e.badge&&(0,s.jsx)("span",{className:"pf-navi-b",children:e.badge})]});return a?(0,s.jsxs)(h.m_,{children:[(0,s.jsx)(h.k$,{asChild:!0,children:c}),(0,s.jsx)(h.ZI,{side:"right",sideOffset:8,children:e.label})]}):c}function eB({item:e,isActive:t,isChildActive:a,collapsed:r,open:n,onOpenChange:i,onItemClick:o}){let c=e.icon,d=e.children?.some(e=>a(e.href))??!1,p=t||d,m=e.walkthrough,f=ez(),u=eP.has(e.href);return r?(0,s.jsxs)(h.m_,{children:[(0,s.jsx)(h.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button","data-walkthrough":m,className:(0,b.cn)("pf-navi is-coll",p&&"is-active"),children:(0,s.jsx)("span",{className:(0,b.cn)("pf-navi-ic",e.color&&`p-${e.color}`),children:(0,s.jsx)(c,{className:"h-4 w-4"})})})}),(0,s.jsxs)(h.ZI,{side:"right",sideOffset:8,className:"p-2 space-y-1",onPointerDownOutside:e=>e.preventDefault(),children:[(0,s.jsx)("p",{className:"text-xs font-semibold mb-1 px-2",children:e.label}),e.children?.map(e=>{let t=e.icon;return(0,s.jsxs)(l(),{href:e.href,prefetch:!!eP.has(e.href)&&void 0,onMouseEnter:()=>f(e.href),onFocus:()=>f(e.href),onClick:o,className:(0,b.cn)("flex items-center gap-2 px-2 py-1.5 rounded text-xs transition-colors",a(e.href)?"bg-[var(--rule-softer)] text-[var(--ink)] font-semibold":"text-[var(--ink-3)] hover:text-[var(--ink)] hover:bg-[var(--rule-softer)]"),children:[(0,s.jsx)(t,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("span",{children:e.label})]},e.href)})]})]}):(0,s.jsxs)(C,{open:n,onOpenChange:i,children:[(0,s.jsxs)("div",{className:(0,b.cn)("pf-navi",p&&"is-active"),children:[(0,s.jsxs)(l(),{href:e.href,prefetch:!!u&&void 0,onMouseEnter:()=>f(e.href),onFocus:()=>f(e.href),onClick:o,"data-walkthrough":m,className:"flex items-center gap-[11px] flex-1 min-w-0",children:[(0,s.jsx)("span",{className:(0,b.cn)("pf-navi-ic",e.color&&`p-${e.color}`),children:(0,s.jsx)(c,{className:"h-4 w-4"})}),(0,s.jsx)("span",{className:"pf-navi-l",children:e.label})]}),(0,s.jsx)(S,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"pf-navi-chev shrink-0",onClick:e=>e.stopPropagation(),"aria-label":`Toggle ${e.label}`,onKeyDown:e=>{"Enter"!==e.key||n||i(!0)},children:(0,s.jsx)(q.A,{className:(0,b.cn)("h-3 w-3 transition-transform duration-200",n&&"rotate-180")})})})]}),(0,s.jsx)(A,{children:(0,s.jsx)("div",{className:"pf-sub",children:e.children?.map(e=>{let t=e.icon,r=a(e.href);return(0,s.jsxs)(l(),{href:e.href,prefetch:!!eP.has(e.href)&&void 0,onMouseEnter:()=>f(e.href),onFocus:()=>f(e.href),onClick:o,className:r?"is-active":void 0,children:[(0,s.jsx)("span",{className:"sic",children:(0,s.jsx)(t,{className:"h-3 w-3"})}),(0,s.jsx)("span",{children:e.label})]},e.href)})})})]})}function eG({onItemClick:e,collapsed:t=!1}){let a=(0,o.usePathname)(),n=(0,o.useSearchParams)(),{user:i,isLoaded:c}=(0,p.Jd)(),{setOpen:m}=(0,ei.C)(),f=(0,er.Kq)({user:i}),[u,x]=(0,r.useState)(!1),{flags:g,isLoading:v}=(0,es.h)(),{access:y}=(0,en.o7)(),j=f?null:y?.planId??null,[k,N]=(0,r.useState)(()=>({})),w=(0,r.useRef)(!1);(0,r.useEffect)(()=>
305{if(w.current)return;w.current=!0;let e={};for(let t of[...eL.flatMap(e=>e.items),...eD])if(t.children){let s=t.children.some(e=>a===e.href||a?.startsWith(e.href+"/")),r=a===t.href||a?.startsWith(t.href+"/");(s||r)&&(e[t.href]=!0)}Object.keys(e).length>0&&N(t=>({...t,...e}))},[a]),(0,r.useEffect)(()=>{x(!0)},[]);let C=(0,r.useCallback)(e=>{if(e.includes("?")){let t=e.indexOf("?");if(a!==e.slice(0,t))return!1;let s=new URLSearchParams(e.slice(t+1)),r=!0;return s.forEach((e,t)=>{n?.get(t)!==e&&(r=!1)}),r}return a===e||(a?.startsWith(e+"/")??!1)},[a,n]),S=(0,r.useMemo)(()=>{let e=[];for(let t of[...eL.flatMap(e=>e.items),...eD])if(t.children)for(let a of t.children)e.push(a.href);return e},[]),A=(0,r.useCallback)(e=>{if(e.includes("?")){let t=e.indexOf("?"),s=e.slice(0,t),r=e.slice(t+1);if(a!==s)return!1;let n=new URLSearchParams(window.location.search),i=new URLSearchParams(r),l=!0;return i.forEach((e,t)=>{n.get(t)!==e&&(l=!1)}),l}return a===e||!!a?.startsWith(e+"/")&&!S.some(t=>t!==e&&t.startsWith(e+"/")&&(a===t||a?.startsWith(t+"/")))},[a,S]),E=(0,r.useCallback)((e,t)=>{N(a=>({...a,[e]:t}))},[]);return(0,s.jsx)(h.TooltipProvider,{delayDuration:0,children:(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:(0,b.cn)("shrink-0 border-b border-[var(--border-default)]",t?"p-3":"px-[18px] py-4"),children:(0,s.jsx)(l(),{href:"/dashboard",onClick:e,"data-walkthrough":"sidebar-logo",children:(0,s.jsxs)("div",{className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[(0,s.jsx)("div",{className:"w-7 h-7 rounded-[7px] bg-[var(--ink)] -rotate-3 flex items-center justify-center text-[var(--paper)] font-mono font-black text-sm shrink-0",children:"U"}),!t&&(0,s.jsxs)("span",{className:"font-display font-bold text-[15px] tracking-[-0.3px] text-[var(--text-primary)]",children:["UseMoney",(0,s.jsx)("span",{className:"text-[var(--accent-primary)]",children:" AI"})]})]})})}),(0,s.jsx)("div",{className:(0,b.cn)("pf-sb-search",t&&"coll"),children:(0,s.jsxs)("button",{type:"button",onClick:()=>m(!0),"aria-label":"Search markets, stocks, brokers",children:[(0,s.jsx)(D.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("span",{children:"Search marketsâ¦"}),(0,s.jsx)("span",{className:"pf-kbd",children:"âK"})]})}),(0,s.jsxs)("div",{className:(0,b.cn)("flex-1 overflow-y-auto min-h-0 py-2 flex flex-col",t?"px-2":"px-6"),children:[(0,s.jsx)("nav",{className:"space-y-1",children:eL.map((a,r)=>{let n=!f&&v,i=a.items.map(e=>{if(e.hideInDemo&&f||e.featureFlag&&(n||!g[e.featureFlag]))return null;if(e.children){let t=e.children.filter(e=>(!e.hideInDemo||!f)&&(!e.featureFlag||!n&&g[e.featureFlag]));return 0===t.length?null:{...e,children:t}}return e}).filter(e=>null!==e);return 0===i.length?null:(0,s.jsxs)("div",{className:"space-y-0.5",children:[a.label&&(0,s.jsx)(e_,{label:a.label,collapsed:t}),i.map(a=>a.children?(0,s.jsx)(eB,{item:a,isActive:C(a.href),isChildActive:A,collapsed:t,open:!!k[a.href],onOpenChange:e=>E(a.href,e),onItemClick:e},a.href):(0,s.jsx)(eW,{item:a,isActive:C(a.href),collapsed:t,onClick:e},a.href))]},r)})}),u&&!t&&"FREE"===j&&(0,s.jsxs)(l(),{href:"/settings?tab=plans",onClick:e,className:"pf-sticker",style:{display:"block"},children:[(0,s.jsx)("strong",{children:"Upgrade?"}),"Unlock unlimited broker sync & deep research.",(0,s.jsx)("div",{children:(0,s.jsx)("span",{className:"pf-stcta",children:"Go PRO â"})})]})]}),(0,s.jsx)(eH,{collapsed:t,onItemClick:e,isDemoMode:f,handleDemoSignOut:()=>(0,d.UD)(),mounted:u,planId:j})]})})}function eH({collapsed:e,onItemClick:t,isDemoMode:a,handleDemoSignOut:i,mounted:l,planId:m}){let{user:h,isLoaded:f}=(0,p.Jd)(),{signOut:u,openUserProfile:x}=(0,p.ho)(),{resolvedTheme:g,setTheme:v}=(0,c.D)(),y=(0,o.useRouter)(),j=h?.fullName||h?.firstName||h?.username||"Trader",k=h?.imageUrl,N="dark"===g,w=h?.primaryEmailAddress?.emailAddress,{access:C}=(0,en.o7)(),[S,A]=(0,r.useState)(null),E={creditsLimit:C?.creditsLimit??null,creditsUsed:C?.creditsUsed??null,creditsResetAt:S?.creditsResetAt??null,nextBillingDate:S?.nextBillingDate??null};return l&&(f||a)?a?(0,s.jsxs)("div",{className:"pf-sb-foot",children:[(0,s.jsxs)(et.rI,{children:[(0,s.jsx)(et.ty,{asChild:!0,children:(0,s.jsxs)("button",{type:"button","data-walkthrough":"user-menu-trigger",className:(0,b.cn)("pf-user",e&&"coll"),children:[(0,s.jsx)("span",{className:"pf-av",children:"D"}),!e&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pf-uinfo",children:(0,s.jsx)("div",{className:"pf-un",children:(0,s.jsx)("span",{className:"truncate",children:"Demo User"})})}),(0,s.jsx)(q.A,{className:"pf-uchev h-3.5 w-3.5 shrink-0"})]})]})}),(0,s.jsx)(et.SQ,{side:"top",align:e?"center":"start",className:"p-0 border-0 shadow-none bg-transparent roun
305ded-none overflow-visible",style:{width:"auto"},children:(0,s.jsx)(eU,{userName:"Demo User",planId:"FREE",creditsLimit:null,creditsUsed:null,creditsResetAt:null,nextBillingDate:null,onFeedback:()=>{y.push("/settings?tab=feedback"),t?.()},onSubscription:()=>{y.push("/settings?tab=plans"),t?.()},onNavigate:e=>{y.push(e),t?.()},onTourAgain:()=>{eF(),t?.()},onHomePage:()=>{y.push("/home"),t?.()},onLogOut:i,logOutLabel:"End demo"})})]}),!e&&(0,s.jsxs)("div",{className:"pf-sb-foot-row",children:[(0,s.jsxs)("button",{type:"button",className:"pf-ttl",onClick:e=>(0,eo.C)(N?"light":"dark",v,e.currentTarget),children:[N?(0,s.jsx)(Z.A,{className:"h-3 w-3"}):(0,s.jsx)(Y.A,{className:"h-3 w-3"}),"Theme"]}),(0,s.jsxs)("button",{type:"button",className:"pf-sett",onClick:()=>{y.push("/settings"),t?.()},children:[(0,s.jsx)(V.A,{className:"h-3 w-3"})," Settings"]}),(0,s.jsx)("button",{type:"button",className:"pf-help","aria-label":"Help & docs",onClick:()=>{y.push("/help"),t?.()},children:(0,s.jsx)("span",{style:{fontWeight:800,fontSize:13},children:"?"})})]})]}):f&&h?(0,s.jsxs)("div",{className:"pf-sb-foot",children:[(0,s.jsxs)(et.rI,{onOpenChange:e=>{e&&h&&!a&&!S&&(0,en.G3)(h.id).then(e=>e&&A(e))},children:[(0,s.jsx)(et.ty,{asChild:!0,children:(0,s.jsxs)("button",{type:"button","data-walkthrough":"user-menu-trigger",className:(0,b.cn)("pf-user",e&&"coll"),children:[k?(0,s.jsx)(n.default,{src:k,alt:j,width:28,height:28,className:"pf-av",style:{objectFit:"cover"}}):(0,s.jsx)("span",{className:"pf-av",children:j.charAt(0).toUpperCase()}),!e&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"pf-uinfo",children:[(0,s.jsxs)("div",{className:"pf-un",children:[(0,s.jsx)("span",{className:"truncate",children:j}),("PRO"===m||"PREMIUM"===m)&&(0,s.jsx)("span",{className:"pf-tag-pro",children:m})]}),w&&(0,s.jsx)("div",{className:"pf-ue",children:w})]}),(0,s.jsx)(q.A,{className:"pf-uchev h-3.5 w-3.5 shrink-0"})]})]})}),(0,s.jsx)(et.SQ,{side:"top",align:e?"center":"start",className:"p-0 border-0 shadow-none bg-transparent rounded-none overflow-visible",style:{width:"auto"},children:(0,s.jsx)(eU,{userName:j,userEmail:w,userImage:k,planId:m,creditsLimit:E.creditsLimit,creditsUsed:E.creditsUsed,creditsResetAt:E.creditsResetAt,nextBillingDate:E.nextBillingDate,onFeedback:()=>{y.push("/settings?tab=feedback"),t?.()},onSubscription:()=>{y.push("/settings?tab=plans"),t?.()},onNavigate:e=>{y.push(e),t?.()},onTourAgain:()=>{eF(),t?.()},onHomePage:()=>{y.push("/home"),t?.()},onLogOut:()=>(0,d.L1)(u)})})]}),!e&&(0,s.jsxs)("div",{className:"pf-sb-foot-row",children:[(0,s.jsxs)("button",{type:"button",className:"pf-ttl",onClick:e=>(0,eo.C)(N?"light":"dark",v,e.currentTarget),children:[N?(0,s.jsx)(Z.A,{className:"h-3 w-3"}):(0,s.jsx)(Y.A,{className:"h-3 w-3"}),"Theme"]}),(0,s.jsxs)("button",{type:"button",className:"pf-sett",onClick:()=>{y.push("/settings"),t?.()},children:[(0,s.jsx)(V.A,{className:"h-3 w-3"})," Settings"]}),(0,s.jsx)("button",{type:"button",className:"pf-help","aria-label":"Help & docs",onClick:()=>{y.push("/help"),t?.()},children:(0,s.jsx)("span",{style:{fontWeight:800,fontSize:13},children:"?"})})]})]}):null:(0,s.jsx)("div",{className:(0,b.cn)("border-t border-[var(--border-default)] shrink-0",e?"p-2":"p-4"),children:(0,s.jsxs)("div",{className:"flex items-center gap-3 justify-center",children:[(0,s.jsx)("div",{className:"h-8 w-8 rounded-full bg-[var(--bg-card)] animate-pulse"}),!e&&(0,s.jsx)("div",{className:"h-4 w-24 bg-[var(--bg-card)] rounded animate-pulse"})]})})}function eV({onNavigate:e}){let t=(0,o.usePathname)(),a=(0,o.useSearchParams)(),r=(0,o.useRouter)(),{user:i,isLoaded:m}=(0,p.Jd)(),{signOut:h}=(0,p.ho)(),{resolvedTheme:f,setTheme:u}=(0,c.D)(),{flags:x,isLoading:g}=(0,es.h)(),v=(0,er.Kq)({user:i}),{access:y}=(0,en.o7)(),j=y?.planId??"FREE",k=i?.fullName||i?.firstName||i?.username||"Trader",N=i?.primaryEmailAddress?.emailAddress,w=i?.imageUrl,C="dark"===f,S=e=>{if(e.includes("?")){let s=e.indexOf("?");if(t!==e.slice(0,s))return!1;let r=new URLSearchParams(e.slice(s+1)),n=!0;return r.forEach((e,t)=>{a?.get(t)!==e&&(n=!1)}),n}return t===e?"/dashboard"!==e||!a?.get("view"):t?.startsWith(e+"/")??!1},A=!v&&g,E=e=>!(e.hideInDemo&&v)&&!(e.featureFlag&&(A||!x[e.featureFlag])),R=t=>{r.push(t),e()};return(0,s.jsxs)("div",{className:"pf-msheet",children:[(0,s.jsxs)("div",{className:"pf-msheet-top",children:[(0,s.jsxs)(l(),{href:"/dashboard",onClick:e,className:"brand","data-walkthrough":"sidebar-logo",children:[(0,s.jsx)("span",{className:"pf-brand-mark",children:"U"}),(0,s.jsx)("span",{children:"UseMoney"})]}),(0,s.jsx)("button",{type:"button",className:"pf-msheet-x","aria-label":"Close menu",onClick:e,children:(0,s.jsx)("span",{"aria-hidden":!0,style:{fontSize:16,fontWeight:700,lineHeight:1},children:"â"})})]}),!v&&(0,s.jsxs)("div",{className:"pf-msheet-pcard",children:[w?(0,s.jsx)(n.default,{src:w,alt:k,width:42,he
305ight:42,className:"av",style:{objectFit:"cover"}}):(0,s.jsx)("span",{className:"av",children:k.charAt(0).toUpperCase()}),(0,s.jsxs)("div",{className:"pi",children:[(0,s.jsxs)("div",{className:"pn",children:[(0,s.jsx)("span",{className:"truncate",children:k}),(0,s.jsx)("span",{className:"ser",children:"â hey there."})]}),N&&(0,s.jsx)("div",{className:"pe",children:N})]}),("PRO"===j||"PREMIUM"===j)&&(0,s.jsx)("span",{className:"pro",children:j})]}),(0,s.jsx)("div",{className:"pf-msheet-scroll",children:eL.map(e=>{let t=e.items.filter(E);return 0===t.length?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"pf-msheet-grp",children:[(0,s.jsx)("span",{children:e.label}),(0,s.jsx)("span",{className:"r"})]}),t.map(e=>{let t=e.icon,a=e.children?.filter(E)??[];return(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:(0,b.cn)("pf-mitem",S(e.href)&&"active"),onClick:()=>R(e.href),"data-walkthrough":e.walkthrough,children:[(0,s.jsx)("span",{className:(0,b.cn)("ic",e.color),children:(0,s.jsx)(t,{className:"h-[17px] w-[17px]"})}),(0,s.jsx)("span",{className:"lbl",children:e.label}),e.badge&&(0,s.jsx)("span",{className:"badge",children:e.badge})]}),a.map(e=>{let t=e.icon;return(0,s.jsxs)("button",{type:"button",className:(0,b.cn)("pf-mitem sub",S(e.href)&&"active"),onClick:()=>R(e.href),children:[(0,s.jsx)("span",{className:"ic",children:(0,s.jsx)(t,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("span",{className:"lbl",children:e.label})]},e.href)})]},e.href)})]},e.label)})}),(0,s.jsxs)("div",{className:"pf-msheet-foot",children:[(0,s.jsxs)("button",{type:"button",className:"b",onClick:e=>(0,eo.C)(C?"light":"dark",u,e.currentTarget),children:[C?(0,s.jsx)(Z.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(Y.A,{className:"h-3.5 w-3.5"})," ","Theme"]}),(0,s.jsxs)("button",{type:"button",className:"b",onClick:()=>R("/settings"),children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5"})," Settings"]}),(0,s.jsxs)("button",{type:"button",className:"b solid",onClick:()=>{v?(0,d.UD)():(0,d.L1)(h)},children:[(0,s.jsx)(J.A,{className:"h-3.5 w-3.5"})," ",v?"End demo":"Sign out"]})]})]})}function eK(){let[e,t]=(0,r.useState)(!1),a=(0,o.usePathname)(),{user:n,isLoaded:i}=(0,p.Jd)(),{signOut:d}=(0,p.ho)(),{resolvedTheme:h,setTheme:f}=(0,c.D)(),{setOpen:u}=(0,ei.C)();(0,o.useRouter)(),(0,er.Kq)({user:n});let x=(0,r.useRef)(!1);(0,r.useEffect)(()=>{function e(e){let a=e.detail;a&&"boolean"==typeof a.open&&(x.current=a.open,t(a.open))}return window.addEventListener("walkthrough:set-mobile-nav",e),()=>{window.removeEventListener("walkthrough:set-mobile-nav",e)}},[]);let b=(0,r.useCallback)(e=>{(e||!x.current)&&t(e)},[]),y=(0,r.useCallback)(e=>{x.current&&e.preventDefault()},[]);return eq(a)?null:(n?.fullName||n?.firstName||n?.username,n?.primaryEmailAddress?.emailAddress,n?.imageUrl,(0,s.jsxs)("header",{className:"lg:hidden fixed top-0 left-0 right-0 z-50",children:[(0,s.jsxs)("div",{className:"h-14 bg-[var(--bg-primary)] border-b border-[var(--border-default)] flex items-center justify-between px-4",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)(g,{open:e,onOpenChange:b,children:[(0,s.jsx)(v,{asChild:!0,children:(0,s.jsx)(m.$,{variant:"ghost",size:"icon",className:"text-[var(--text-primary)]",children:(0,s.jsx)(X.A,{className:"h-6 w-6"})})}),(0,s.jsx)(N,{side:"left",className:"w-screen max-w-none p-0 border-0 [&>button]:hidden",onPointerDownOutside:y,onInteractOutside:y,onEscapeKeyDown:y,children:(0,s.jsx)(r.Suspense,{fallback:null,children:(0,s.jsx)(eV,{onNavigate:()=>{x.current||t(!1)}})})})]}),(0,s.jsxs)(l(),{href:"/dashboard","data-walkthrough":"sidebar-logo",className:"flex items-center gap-2 ml-3 hover:opacity-80 transition-opacity",children:[(0,s.jsx)("div",{className:"w-6 h-6 rounded-md bg-[var(--ink)] -rotate-3 flex items-center justify-center text-[var(--paper)] font-mono font-black text-[11px]",children:"U"}),(0,s.jsxs)("span",{className:"font-display font-bold text-[15px] tracking-[-0.3px] text-[var(--text-primary)]",children:["UseMoney",(0,s.jsx)("span",{className:"text-[var(--accent-primary)]",children:" AI"})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{variant:"ghost",size:"icon",className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] h-9 w-9",onClick:()=>u(!0),children:(0,s.jsx)(D.A,{className:"h-5 w-5"})}),(0,s.jsx)(eo.J,{iconSize:"h-5 w-5",className:"p-2 rounded-lg text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors h-9 w-9 flex items-center justify-center"}),(0,s.jsx)(el.r,{})]})]}),(0,s.jsx)("div",{className:"h-[var(--mobile-ticker-h)] bg-[var(--nav-bg-scrolled)] border-b border-[var(--border-default)] overflow-hidden",children:(0,s.jsx)(E.F,{})})]}))}function eq(e){return!e||eT.I.some(t=>e===t||e.startsWith(t+"/"))}function eZ(){let{collapsed:e,toggleSidebar:t}=(0,ea.c)();return eq((0,o.usePathname)())?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:(0,b.cn)("fixed left-0 top-0 h-full bg-[var(--bg-primary)] border-r-2 border-[var(--ink)] hidden lg:block z-40 transition-all duration-200",e?"w-16":"w-64"),children:[(0,s.jsx)("button",{onClick:t,className:"absolute -right-4 top-7 z-50 h-8 w-8 rounded-full flex items-center justify-center text-[var(--ink-3)] hover:text-[var(--ink)] transition-colors",style:{background:"var(--paper)",border:"1.5px solid var(--ink)",boxShadow:"2px 2px 0 var(--ink)"},title:e?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:e?(0,s.jsx)(Q.A,{className:"h-4 w-4"}):(0,s.jsx)(ee.A,{className:"h-4 w-4"})}),(0,s.jsx)(r.Suspense,{fallback:null,children:(0,s.jsx)(eG,{collapsed:e})})]}),(0,s.jsx)(eK,{})]})}(0,r.forwardRef)(({userImage:e,userName:t,isDemoMode:a,isLoaded:r,user:i,className:l,onClick:o,...c},d)=>(0,s.jsx)("button",{type:"button",ref:d,onClick:o,"data-walkthrough":"user-menu-trigger",className:(0,b.cn)("h-9 w-9 rounded-full overflow-hidden flex items-center justify-center",l),...c,children:r&&i&&e?(0,s.jsx)(n.default,{src:e,alt:t,width:32,height:32,className:"h-8 w-8 rounded-full object-cover"}):(0,s.jsx)("div",{className:"h-8 w-8 rounded-full bg-gradient-to-br from-emerald-400 to-emerald-500 flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-xs font-bold text-[var(--text-inverse)]",children:a?"D":t.charAt(0).toUpperCase()})})})).displayName="ProfileAvatarButton",R.A,M.A,L.A,U.A,T.A},46944:(e,t,a)=>{"use strict";a.d(t,{U:()=>r});var s=a(5974);let r=(0,s.createServerReference)("40ae5f679b17b87272c1a8110a2a1b2bd456ea07cf",s.callServer,void 0,s.findSourceMapURL,"markAsReadAction")},47188:(e,t,a)=>{"use strict";a.d(t,{X:()=>r});var s=a(1957);function r(){(0,s._t)();try{localStorage.removeItem("um_plan_v1")}catch{}}},48481:(e,t,a)=>{"use strict";a.d(t,{$:()=>c,r:()=>o});var s=a(54568),r=a(7620),n=a(55752),i=a(91397),l=a(74387);let o=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef(({className:e,variant:t,size:a,asChild:r=!1,...i},c)=>{let d=r?n.DX:"button";return(0,s.jsx)(d,{className:(0,l.cn)(o({variant:t,size:a,className:e})),ref:c,...i})});c.displayName="Button"},60701:(e,t,a)=>{"use strict";function s(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}function r(e,t){if(!e)return null;let a=s(e);return a?t.find(e=>s(e)===a)??null:null}a.d(t,{BG:()=>s,Gl:()=>r})},61049:(e,t,a)=>{"use strict";a.d(t,{L1:()=>i,UD:()=>l});var s=a(47188);let r=!1;function n(e="Signing outâ¦"){if("u"<typeof document||r)return;r=!0;let t=document.createElement("div");t.id="um-signing-out",t.style.cssText="position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:var(--paper,#f7f3e6);color:var(--ink,#1d1d1b);font-family:var(--font-dm-sans,system-ui),sans-serif;font-size:14px;font-weight:600;letter-spacing:-0.2px;",t.textContent=e,document.body.appendChild(t)}function i(e,t="/home"){n(),(0,s.X)(),Promise.resolve(e({redirectUrl:t})).catch(()=>{}).finally(()=>{window.location.replace(t)})}function l(e="/home"){n("Exiting demoâ¦");try{localStorage.removeItem("paper_trading_data");let e=[];for(let t=0;t<localStorage.length;t++){let a=localStorage.key(t);a&&a.startsWith("tradebook_")&&e.push(a)}
305e.forEach(e=>localStorage.removeItem(e))}catch{}Promise.resolve(fetch("/api/demo/end",{method:"POST"}).catch(()=>{})).finally(()=>{window.location.replace(e)})}},63461:(e,t,a)=>{"use strict";a.d(t,{F:()=>m});var s=a(54568),r=a(74387),n=a(67126);let i="#1d1d1b",l="#fcd34d",o="#f7f3e6",c={PRE:{label:"PRE-MKT",dot:"#fbbf24"},OPEN:{label:"OPEN",dot:"#4ade80"},POST:{label:"POST-MKT",dot:"#60a5fa"},CLOSED:{label:"CLOSED",dot:"#9a9a92"}},d={IN:"IND",US:"US",MCX:"MCX"};function p({phase:e}){let t=c[e];return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium",children:[(0,s.jsx)("span",{className:(0,r.cn)("h-1.5 w-1.5 rounded-full","CLOSED"!==e&&"animate-pulse"),style:{background:t.dot}}),(0,s.jsx)("span",{style:{color:t.dot},children:t.label})]})}function m(){let{indices:e,marketStatus:t}=(0,n.x)();if(0===e.length)return(0,s.jsx)("div",{className:"h-full flex items-center px-4",style:{background:i,color:o},children:(0,s.jsx)("div",{className:"flex gap-8 text-xs font-mono",style:{color:l},children:(0,s.jsx)("span",{children:"Loading market dataâ¦"})})});let a=[];for(let t of["IN","MCX","US"]){let s=e.filter(e=>e.market===t);if(s.length>0)for(let e of(a.push({type:"label",market:t}),s))a.push({type:"quote",quote:e})}let r=[...a,...a];return(0,s.jsx)("div",{className:"h-full flex items-center overflow-hidden relative",style:{background:i,color:o},children:(0,s.jsx)("div",{className:"animate-marquee flex whitespace-nowrap gap-5 px-4 font-mono text-xs",children:r.map((e,a)=>{var r,n;if("label"===e.type)return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 pl-4 first:border-l-0 first:pl-0",style:{borderLeft:"1px solid rgba(247,243,230,0.18)"},children:[(0,s.jsx)("span",{className:"font-semibold text-[11px]",style:{color:"rgba(247,243,230,0.75)"},children:d[e.market]}),t?.[e.market]&&(0,s.jsx)(p,{phase:t[e.market]})]},`label-${e.market}-${a}`);let i=e.quote;return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"font-semibold",style:{color:l},children:i.name}),(0,s.jsx)("span",{style:{color:o},children:(r=i.price,"US"===(n=i.market)||"MCX"===n?r.toLocaleString("en-US",{maximumFractionDigits:2}):r.toLocaleString("en-IN",{maximumFractionDigits:0}))}),(0,s.jsxs)("span",{style:{color:i.change>=0?"#4ade80":"#ff8a8a"},children:[i.change>=0?"+":"",i.change.toFixed(2)," (",i.changePercent>=0?"+":"",i.changePercent.toFixed(2),"%)"]})]},`${i.symbol}-${a}`)})})})}},64816:()=>{},66428:(e,t,a)=>{"use strict";function s(e=new Date){return new Date(e.getTime()+198e5).toISOString().slice(0,10)}function r(e,t,a=12){let s=t.trim().toUpperCase();if(0===s.length)return[];let n=s.split(/\s+/),i=[];for(let t of e){let e,a=t[0],r=t[1].toUpperCase();if(a===s)e=0;else if(a.startsWith(s))e=1;else if(n.every(e=>r.startsWith(e)||r.includes(` ${e}`)))e=2;else{if(!(a.includes(s)||r.includes(s)))continue;e=3}i.push({row:t,tier:e})}return i.sort((e,t)=>e.tier-t.tier||t.row[4]-e.row[4]||("NSE"!==e.row[2])-("NSE"!==t.row[2])||e.row[0].length-t.row[0].length),i.slice(0,a).map(({row:e})=>({symbol:e[0],name:e[1],exchange:e[2],type:e[3]}))}a.d(t,{QN:()=>r,Tt:()=>s,UE:()=>o,k:()=>l,vT:()=>i});let n=e=>`${e.symbol.trim().toUpperCase()}:${e.exchange.trim().toUpperCase()}`;function i(e,t,a){let s=new Set(e.map(n));return[...e,...t.filter(e=>{let t=n(e);return!s.has(t)&&(s.add(t),!0)})].slice(0,a)}function l(e,t,a,s){let r=t.trim().toUpperCase();return!(!s||r.length<3||e.some(e=>e.symbol.toUpperCase()===r))&&e.length<Math.min(a,3)}function o(e,t){if(t){let e=new Set(t.split(",").map(e=>e.trim().toUpperCase()).filter(Boolean));return t=>e.has(t.type.toUpperCase())}return e.includes("mf")?()=>!0:e=>"MF"!==e.type.toUpperCase()}},67126:(e,t,a)=>{"use strict";a.d(t,{x:()=>p});var s=a(7620),r=a(27650),n=a(330);let i="__sb_ticker_store__";function l(){let e=globalThis;return e[i]||(e[i]=(0,r.y)()(()=>({indices:[],marketStatus:null}))),e[i]}let o="__sb_ticker_poll__";function c(){let e=globalThis;return e[o]||(e[o]={interval:null,subscriberCount:0,fetchInFlight:!1,lastFetchAt:0}),e[o]}async function d(){let e=c();if(!e.fetchInFlight){e.fetchInFlight=!0;try{let t=await fetch("/api/market/indices");if(t.ok){let a=await t.json();a.success&&a.data&&(l().setState({indices:a.data,marketStatus:a.marketStatus??null}),e.lastFetchAt=Date.now())}else 401===t.status||403===t.status||0===l().getState().indices.length&&setTimeout(d,5e3)}catch{0===l().getState().indices.length&&setTimeout(d,5e3)}finally{e.fetchInFlight=!1}}}function p(){let e=l();return(0,s.useEffect)(()=>{let e=c();return e.subscriberCount++,!function(){let e=c();if(e.interval)return;let t=!e.lastFetchAt||Date.now()-e.lastFetchAt>=6e4;(0===l().getState().indices.length||t)&&d(),e.interval=setInterval(d,6e4)}(),()=>{let t;e.subscriberCount=Math.max(0,e.subscriberCount-1),0===e.subscriberCount&&!((t=c()).subscriberCount>0)&&t.interval&&(clearInterval(t.interval),t.interval=null)}},[]),(0,n.P)(e)}},67787:(e,t,a)=>{"use strict";a.d(t,{G:()=>r,I:()=>s});let s=["/","/home","/sign-in","/sign-up","/sso-callback","/forgot-password","/privacy","/terms","/data-usage","/subprocessors","/legal","/blog","/newsletter","/glossary","/docs","/pricing","/alternatives","/risk-disclosure","/features","/about","/changelog","/roadmap","/security","/integrations"],r=["/","/home","/sign-in","/sign-up","/sso-callback","/forgot-password","/terms","/privacy","/data-usage","/risk-disclosure","/legal","/subprocessors","/pricing","/api/","/blog","/docs","/glossary","/newsletter","/welcome","/settings/investor-profile"]},73927:(e,t,a)=>{"use strict";a.d(t,{N:()=>r});var s=a(5974);
305let r=(0,s.createServerReference)("007d0c17f4ab351ef47fbae43cd8adedbe005de7d6",s.callServer,void 0,s.findSourceMapURL,"clearAllReadAction")},74387:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(9917),r=a(2809);function n(...e){return(0,r.QP)((0,s.$)(e))}},76367:(e,t,a)=>{"use strict";a.d(t,{r:()=>L});var s=a(54568),r=a(7620),n=a(77542),i=a(11376),l=a(95148),o=a(79748),c=a(46548),d=a(60527),p=a(94730),m=a(68476),h=a(2939),f=a(5646),u=a(66446),x=a(63264),b=a(23555),g=a(92007),v=a(98748),y=a(13878),j=a(93565),k=a(14432),N=a(77688),w=a(44968),C=a(58299),S=a(30307),A=a(89677),E=a(46944),R=a(79440),I=a(73927),M=a(94291);let U={RESEARCH_COMPLETE:{icon:c.A,pop:"var(--emerald)",iconStroke:"#f7f3e6"},SYNC_COMPLETE:{icon:d.A,pop:"var(--emerald)",iconStroke:"#f7f3e6"},IMPORT_COMPLETE:{icon:p.A,pop:"var(--pop-2)",iconStroke:"#1d1d1b"},PAIRING_COMPLETE:{icon:m.A,pop:"var(--pop-2)",iconStroke:"#1d1d1b"},DOCUMENT_READY:{icon:h.A,pop:"var(--pop-3)",iconStroke:"#f7f3e6"},ROAST_COMPLETE:{icon:f.A,pop:"var(--pop-4)",iconStroke:"#f7f3e6"},ANALYSIS_COMPLETE:{icon:u.A,pop:"var(--pop-4)",iconStroke:"#f7f3e6"},ANALYSIS_FAILED:{icon:x.A,pop:"var(--pop-1)",iconStroke:"#f7f3e6"},SCAN_COMPLETED:{icon:b.A,pop:"var(--emerald)",iconStroke:"#f7f3e6"},SCAN_FAILED:{icon:x.A,pop:"var(--pop-1)",iconStroke:"#f7f3e6"},LOGIN_BRIEFING:{icon:c.A,pop:"var(--pop-2)",iconStroke:"#1d1d1b"},SYSTEM:{icon:g.A,pop:"var(--pop-5)",iconStroke:"#f7f3e6"},PRICE_ALERT:{icon:v.A,pop:"var(--pop-1)",iconStroke:"#f7f3e6"},VOLUME_ALERT:{icon:u.A,pop:"var(--pop-1)",iconStroke:"#f7f3e6"},NEWS_ALERT:{icon:y.A,pop:"var(--pop-3)",iconStroke:"#f7f3e6"},EARNINGS_REMINDER:{icon:j.A,pop:"var(--pop-3)",iconStroke:"#f7f3e6"},CORPORATE_ACTION:{icon:k.A,pop:"var(--pop-2)",iconStroke:"#1d1d1b"}};function T({notification:e,onMarkRead:t,onClick:a}){let r=U[e.type]??U.SYSTEM,n=r.icon,i=!e.isRead;return(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),a(e))},style:{display:"flex",alignItems:"flex-start",gap:10,width:"100%",textAlign:"left",padding:"9px 8px",borderRadius:8,background:i?"var(--emerald-bg)":"transparent",border:i?"1.25px dashed var(--emerald)":"1.25px solid transparent",cursor:"pointer",transition:"background 0.12s",fontFamily:"inherit"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--rule-softer)")},onMouseLeave:e=>{i||(e.currentTarget.style.background="transparent")},children:[(0,s.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:r.pop,border:"1.25px solid var(--ink)",display:"grid",placeItems:"center",transform:"rotate(-3deg)",flexShrink:0,color:r.iconStroke},children:(0,s.jsx)(n,{size:13,strokeWidth:2.25})}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,s.jsx)("div",{style:{fontSize:12.5,fontWeight:i?700:500,color:"var(--ink)",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),(0,s.jsx)("div",{style:{fontSize:11.5,color:"var(--ink-3)",marginTop:2,lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.message}),(0,s.jsx)("div",{className:"mono",style:{fontSize:9.5,color:"var(--ink-4)",marginTop:4,letterSpacing:.5},children:function(e){let t=Math.floor((new Date().getTime()-new Date(e).getTime())/6e4);if(t<1)return"NOW";if(t<60)return`${t}M AGO`;let a=Math.floor(t/60);if(a<24)return`${a}H AGO`;let s=Math.floor(a/24);return s<7?`${s}D AGO`:new Date(e).toLocaleDateString("en-IN",{day:"2-digit",month:"short"}).toUpperCase()}(e.createdAt)})]}),i&&(0,s.jsx)("button",{type:"button","aria-label":"Mark as read",onClick:a=>{a.stopPropagation(),t(e.id)},style:{flexShrink:0,width:22,height:22,borderRadius:5,border:"1.25px solid var(--rule-soft)",background:"transparent",color:"var(--ink-3)",display:"grid",placeItems:"center",cursor:"pointer",marginTop:1},children:(0,s.jsx)(N.A,{size:11,strokeWidth:2.25})})]})}function F({onClose:e,onCountChange:t}){let a=(0,o.useRouter)(),[i,l]=(0,r.useState)([]),[c,d]=(0,r.useState)(!0),[p,m]=(0,r.useState)(!1),[h,f]=(0,r.useState)(!0),u=(0,r.useRef)(null),x=(0,r.useCallback)(async()=>{d(!0);let e=await (0,A.p)(8,0);e?.success&&e?.data&&(l(e.data),f(e.data.length>=8),t(e.data.filter(e=>!e.isRead).length)),d(!1)},[t]),b=(0,r.useCallback)(async()=>
305{if(p||!h)return;m(!0);let e=await (0,A.p)(8,i.length);e?.success&&e?.data&&(0===e.data.length?f(!1):(l(t=>[...t,...e.data]),f(e.data.length>=8))),m(!1)},[p,h,i.length]);(0,r.useEffect)(()=>{x()},[x]),(0,r.useEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{let{scrollTop:t,scrollHeight:a,clientHeight:s}=e;a-t-s<80&&b()};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[b]);let g=async e=>{await (0,E.U)(e),l(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),t(i.filter(t=>!t.isRead&&t.id!==e).length)},v=async()=>{await (0,R.p)(),l(e=>e.map(e=>({...e,isRead:!0}))),t(0)},y=async()=>{await (0,I.N)(),l(e=>e.filter(e=>!e.isRead)),t(i.filter(e=>!e.isRead).length)},j=t=>{t.isRead||g(t.id);let s=t.metadata;s?.link&&"string"==typeof s.link&&(e(),a.push(s.link))},k=i.filter(e=>!e.isRead).length;return(0,s.jsxs)("div",{className:"pf-card",style:{padding:0,overflow:"hidden",boxShadow:"5px 5px 0 var(--ink)",background:"var(--paper)"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1.5px dashed var(--rule-soft)",background:"var(--paper-2)",gap:10},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,s.jsx)(n.A,{size:14,strokeWidth:2.25,style:{color:"var(--ink)",flexShrink:0}}),(0,s.jsx)("span",{style:{fontSize:14,fontWeight:800,color:"var(--ink)",letterSpacing:-.3},children:"Notifications"}),k>0&&(0,s.jsxs)("span",{className:"pf-pill emerald",style:{fontSize:9.5,padding:"2px 7px"},children:[k," new"]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[k>0&&(0,s.jsxs)("button",{type:"button",onClick:v,style:{background:"transparent",border:0,color:"var(--ink-3)",fontSize:11.5,fontWeight:600,fontFamily:"inherit",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,padding:0,display:"flex",alignItems:"center",gap:4},children:[(0,s.jsx)(N.A,{size:11,strokeWidth:2.25}),"All read"]}),i.length>0&&0===k&&(0,s.jsxs)("button",{type:"button",onClick:y,style:{background:"transparent",border:0,color:"var(--ink-3)",fontSize:11.5,fontWeight:600,fontFamily:"inherit",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,padding:0,display:"flex",alignItems:"center",gap:4},children:[(0,s.jsx)(w.A,{size:11,strokeWidth:2.25}),"Clear all"]})]})]}),(0,s.jsx)("div",{ref:u,className:"pf-noscrollbar",style:{maxHeight:340,overflowY:"auto",padding:c||0===i.length?0:8}
305,children:c?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 0"},children:(0,s.jsx)(C.A,{size:20,strokeWidth:2,className:"animate-spin",style:{color:"var(--ink-3)"}})}):0===i.length?(0,s.jsx)("div",{style:{padding:"24px 16px"},children:(0,s.jsx)(M.p,{icon:n.A,title:"All quiet here",description:"You'll see research completions, price alerts, and import updates as they arrive.",color:"var(--pop-5)",card:!1})}):(0,s.jsxs)(s.Fragment,{children:[i.map((e,t)=>(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{style:{height:0,borderTop:"1px dashed var(--rule-soft)",margin:"2px 4px"}}),(0,s.jsx)(T,{notification:e,onMarkRead:g,onClick:j})]},e.id)),p&&(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:(0,s.jsx)(C.A,{size:14,strokeWidth:2,className:"animate-spin",style:{color:"var(--ink-4)"}})}),!h&&i.length>8&&(0,s.jsx)("div",{className:"mono",style:{textAlign:"center",padding:"8px 0",fontSize:9.5,color:"var(--ink-4)",letterSpacing:1},children:"ALL CAUGHT UP"})]})}),!c&&i.length>0&&(0,s.jsx)("div",{style:{padding:"10px 16px",borderTop:"1.5px dashed var(--rule-soft)",background:"var(--paper-2)",textAlign:"center"},children:(0,s.jsxs)("button",{type:"button",onClick:()=>{e(),a.push("/notifications")},style:{background:"transparent",border:0,fontFamily:"inherit",fontSize:12,fontWeight:700,color:"var(--ink)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:["View all notifications",(0,s.jsx)(S.A,{size:11,strokeWidth:2.25})]})})]})}function L(){let[e,t]=(0,r.useState)(0),[a,o]=(0,r.useState)(!1),c=(0,r.useCallback)(async()=>{let e=await (0,l.Z)();e?.success&&e?.data!==void 0&&t(e?.data)},[]);return(0,r.useEffect)(()=>{c();let e=setInterval(c,12e4);return()=>clearInterval(e)},[c]),(0,s.jsxs)(i.AM,{open:a,onOpenChange:o,children:[(0,s.jsx)(i.Wv,{asChild:!0,children:(0,s.jsxs)("button",{type:"button","aria-label":"Notifications",className:"pf-tb-icon-btn",style:a?{background:"var(--pop-2)",boxShadow:"2px 2px 0 var(--ink)",transform:"translate(-1px, -1px)"}:void 0,children:[(0,s.jsx)(n.A,{size:15,strokeWidth:2.25}),e>0&&(0,s.jsx)("span",{className:"mono",style:{position:"absolute",top:-3,right:-3,minWidth:14,height:14,borderRadius:999,background:"var(--pop-1)",border:"1.5px solid var(--ink)",color:"#f7f3e6",fontSize:8,fontWeight:800,lineHeight:1,display:"grid",placeItems:"center",padding:"0 3px",letterSpacing:0},children:e>9?"9+":e})]})}),(0,s.jsx)(i.hl,{className:"p-0 border-0 bg-transparent shadow-none outline-none",align:"end",sideOffset:10,style:{width:360,zIndex:50},children:(0,s.jsx)(F,{onClose:()=>o(!1),onCountChange:t})})]})}},79440:(e,t,a)=>{"use strict";a.d(t,{p:()=>r});var s=a(5974);let r=(0,s.createServerReference)("004201c01009e8994d8d2a9482dfa18af7f99fad01",s.callServer,void 0,s.findSourceMapURL,"markAllAsReadAction")},80584:()=>{},89677:(e,t,a)=>{"use strict";a.d(t,{p:()=>r});var s=a(5974);let r=(0,s.createServerReference)("60d0376e322a9e94b982facec3e4593649bd76fe2a",s.callServer,void 0,s.findSourceMapURL,"getNotificationsAction")},90299:(e,t,a)=>{"use strict";a.d(t,{U:()=>i,t:()=>l});var s=a(7620),r=a(66428);let n=new Map;function i(e,t=new Date){let a=(0,r.Tt)(t),s=n.get(e),l=s?.v===a?s.p:void 0;if(!l){let t=l=fetch(`/api/market/instrument-index?kind=${e}&v=${a}`).then(e=>e.ok?e.json():{rows:[]}).then(e=>Array.isArray(e.rows)?e.rows:[]).catch(()=>[]);n.set(e,{v:a,p:t}),t.then(a=>{0===a.length&&n.get(e)?.p===t&&n.delete(e)})}return l}function l(e,{kinds:t=["core"],limit:a=12,minLength:n=2,fallbackTypes:o,fallback:c=!0}={}
305){let[d,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(!1),f=t.join(",");return(0,s.useEffect)(()=>{let t=e.trim();if(t.length<n){p([]),h(!1);return}let s=!1,l=new AbortController,d=null;return h(!0),Promise.all(f.split(",").map(e=>i(e))).then(e=>{if(s)return;let n=(0,r.QN)(e.flat(),t,a);(p(n),(0,r.k)(n,t,a,c))?(h(0===n.length),d=setTimeout(async()=>{try{let e=(0,r.UE)(f.split(","),o),i=new URLSearchParams({q:t,limit:String(a)});o&&i.set("types",o);let c=await fetch(`/api/market/search?${i}`,{signal:l.signal}),d=c.ok?await c.json():null;if(s||!Array.isArray(d?.results))return;p((0,r.vT)(n,d.results.map(e=>({symbol:String(e.symbol??""),name:String(e.name??""),exchange:String(e.exchange??""),type:String(e.type??"")})).filter(e),a))}catch{}finally{s||h(!1)}},300)):h(!1)}),()=>{s=!0,l.abort(),d&&clearTimeout(d)}},[e,f,a,n,o,c]),{results:d,isSearching:m}}},92378:(e,t,a)=>{"use strict";a.d(t,{SidebarProvider:()=>c,c:()=>o});var s=a(54568),r=a(7620),n=a(79748),i=a(38254);let l=(0,r.createContext)({collapsed:!1,toggleSidebar:()=>{}});function o(){return(0,r.useContext)(l)}function c({children:e}){let[t,a]=(0,r.useState)(!1),[o,d]=(0,r.useState)(!1),p=(0,n.usePathname)(),m=(0,i.B1)(p);(0,r.useEffect)(()=>{"true"===function(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}("sidebar_collapsed")&&a(!0),d(!0)},[]),(0,r.useEffect)(()=>{o&&function(e,t,a=365){if("u"<typeof document)return;let s=new Date(Date.now()+864e5*a).toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; expires=${s}; path=/`}("sidebar_collapsed",String(t))},[t,o]),(0,r.useEffect)(()=>{m?(document.documentElement.style.setProperty("--sidebar-w","0px"),document.documentElement.style.setProperty("--topbar-h","0px")):(document.documentElement.style.setProperty("--sidebar-w",t?"4rem":"16rem"),document.documentElement.style.setProperty("--topbar-h","4.75rem"))},[t,m]);let h=(0,r.useCallback)(()=>a(e=>!e),[]);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"b"===e.key&&(e.preventDefault(),a(e=>!e))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,s.jsx)(l.Provider,{value:{collapsed:t,toggleSidebar:h},children:e})}},93171:(e,t,a)=>{"use strict";a.d(t,{y:()=>o});let s=new Set(["ETF"]),r=new Set(["MF","MUTUAL_FUND","MUTUALFUND"]),n=new Set(["INDEX"]);function i(e){let t=e.instrumentType?.trim();return t?t.toUpperCase():(e.type?.trim()??"").toUpperCase()}function l(e){let t=e.filter(e=>!!e[1]).map(([e,t])=>`${e}=${encodeURIComponent(t)}`);return t.length>0?`?${t.join("&")}`:""}function o(e){let t,a=(t=i(e),r.has(t)?"mf":s.has(t)?"etf":"stock"),o=i(e),c=e.hash?`#${e.hash}`:"",d=e.exchange?.trim()||null,p=e.from?.trim()||null;if("mf"===a){let t=e.schemeCode?.trim()||e.symbol;return`/mf/${encodeURIComponent(t)}${l([["from",p]])}${c}`}return"etf"===a?`/etf/${encodeURIComponent(e.symbol)}${l([["exchange",d],["from",p]])}${c}`:`/stock/${encodeURIComponent(e.symbol)}${l([["exchange",d],["type",n.has(o)?"index":null],["from",p]])}${c}`}},94291:(e,t,a)=>{"use strict";a.d(t,{p:()=>l});var s=a(54568),r=a(65587),n=a.n(r);function i({action:e,variant:t}){let a=`${t} sm`;return e.href?(0,s.jsx)(n(),{href:e.href,className:a,children:e.label}):(0,s.jsx)("button",{type:"button",className:a,onClick:e.onClick,children:e.label})}function l({icon:e,title:t,description:a,color:r="var(--emerald)",muted:n=!1,action:o,secondaryAction:c,card:d=!0,className:p=""}){return(0,s.jsxs)("div",{className:`pf-empty ${d?"pf-empty-card pf-card":""} ${p}`,children:[(0,s.jsx)("div",{className:`pf-empty-ic ${n?"is-muted":""}`,style:n?void 0:{background:r},children:(0,s.jsx)(e,{size:26,strokeWidth:2})}),(0,s.jsx)("div",{className:"pf-empty-t",children:t}),(0,s.jsx)("div",{className:"pf-empty-s ser",children:a}),(o||c)&&(0,s.jsxs)("div",{className:"pf-empty-actions",children:[c&&(0,s.jsx)(i,{action:c,variant:"pf-bf"}),o&&(0,s.jsx)(i,{action:o,variant:n?"pf-bf":"pf-bs"})]})]})}a(64816)},95148:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var s=a(5974);
305let r=(0,s.createServerReference)("0077d827ba354f4700a6f19349559a0c34b1dc87c3",s.callServer,void 0,s.findSourceMapURL,"getUnreadCountAction")}}]);
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.