PageSourceSearch

https://app.ymyc.ai/_next/static/chunks/8273-b1c7ce069e44db4d.js

js ymyc.ai collected 2026-10-02 01:12:59 UTC 108,935 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8273],{2538:(e,t,a)=>{a.d(t,{MarketCalendarSection:()=>j});var l=a(95155),s=a(12115),n=a(52232),r=a(52714),i=a(81744),c=a(84769),o=a(98832),d=a(28015),u=a(52619),x=a.n(u);function m(e){var t;let{event:a,lng:s,labels:n}=e,r="post-market"===a.report_time,i=void 0!==a.eps_actual&&null!==a.eps_actual,u=void 0!==a.eps_surprise&&null!==a.eps_surprise,m=i?a.eps_actual:a.eps_estimate,h=i?n.epsActual:n.epsEstimate,p=(null!=(t=a.eps_surprise)?t:0)>0;return(0,l.jsx)(x(),{href:"/".concat(s,"/tickers/").concat(a.symbol),children:(0,l.jsxs)(o.Zp,{variant:"interactive",className:"flex items-center justify-between p-3 cursor-pointer",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"w-10 h-10 flex-shrink-0 flex items-center justify-center",children:(0,l.jsx)(o.AR,{symbol:a.symbol,height:32})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h4",{className:"font-bold text-neutral-100 text-sm",children:a.symbol}),(0,l.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] flex-shrink-0 ".concat(r?"bg-indigo-500/20 text-indigo-300":"bg-amber-500/20 text-amber-300"),children:r?n.afterClose:n.preMarket})]}),(0,l.jsx)("div",{className:"text-xs text-neutral-400 truncate",children:a.name})]})]}),(0,l.jsxs)("div",{className:"text-right flex-shrink-0 ml-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,l.jsx)("span",{className:"text-xs text-neutral-500",children:h}),(0,l.jsx)("span",{className:"text-sm font-medium text-neutral-200",children:null!=m?"$".concat((0,d.ZV)(Number(m))):"-"}),i&&u&&(0,l.jsx)("span",{className:"px-1 py-0.5 rounded text-[10px] font-medium ".concat(p?"bg-emerald-500/20 text-emerald-400":"bg-red-500/20 text-red-400"),children:p?n.beat:n.miss})]}),(0,l.jsx)("div",{className:"text-xs text-neutral-500",children:(0,c.yf)(a.report_date).format("MMM D")})]})]})})}function h(e){let{event:t,lng:a,labels:s}=e;return(0,l.jsx)(x(),{href:"/".concat(a,"/tickers/").concat(t.symbol),children:(0,l.jsxs)(o.Zp,{variant:"interactive",className:"flex items-center justify-between p-3 cursor-pointer",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"w-10 h-10 flex-shrink-0 flex items-center justify-center relative",children:[(0,l.jsx)(o.AR,{symbol:t.symbol,height:32}),(0,l.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 px-1 py-0.5 rounded text-[8px] font-bold bg-emerald-500 text-white",children:"IPO"})]}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h4",{className:"font-bold text-neutral-100 text-sm",children:t.symbol}),(0,l.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-neutral-700 text-neutral-300",children:t.exchange})]}),(0,l.jsx)("div",{className:"text-xs text-neutral-400 truncate",children:t.name})]})]}),(0,l.jsxs)("div",{className:"text-right flex-shrink-0 ml-2",children:[(0,l.jsx)("div",{className:"text-sm font-medium text-neutral-200",children:t.price_range||s.priceTBD}),(0,l.jsx)("div",{className:"text-xs text-neutral-500",children:(0,c.yf)(t.ipo_date).format("MMM D, YYYY")})]})]})})}function p(e){return null==e?"-":Math.abs(e)>=1e3?e.toLocaleString("en-US",{maximumFractionDigits:0}):e.toLocaleString("en-US",{maximumFractionDigits:2})}function b(e){let{importance:t,label:a}=e;return(0,l.jsx)("span",{className:"text-[10px] px-2 py-1 rounded font-medium ".concat("HIGH"===t?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"),children:a})}function v(e){var t;let{event:a,labels:s}=e,n="UPCOMING"===a.status;return(0,l.jsxs)(o.Zp,{className:"relative overflow-hidden",children:[(0,l.jsx)("div",{className:"absolute top-3 right-3",children:(0,l.jsx)(b,{importance:a.importance,label:"HIGH"===a.importance?s.importanceHigh:s.importanceMedium})}),(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-sm xl:text-base font-bold text-neutral-100 pr-16 mb-1",children:a.displayTitle||a.title}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[(0,l.jsx)("span",{children:(t=a.eventDate,(0,c.yf)(t).format("MMM D"))}),a.eventTime&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:"•"}),(0,l.jsx)("span",{children:function(e){if(!e)return"";let[t,a]=e.split(":").map(Number);return"".concat(t%12||12,":").concat(a.toString().padStart(2,"0")," ").concat(t>=12?"PM":"AM"," ET")}(a.eventTime)})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:n?s.forecast:s.actual}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold text-neutral-100",children:n?p(a.forecastValue):p(a.actualValue)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:s.previous}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold text-neutral-100",children:p(a.previousValue)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:s.status}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold ".concat(n?"text-blue-400":"text-green-400"),children:n?s.statusUpcoming:s.statusPublished})]})]})]})}function f(){return(0,l.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,l.jsxs)(o.Zp,{className:"animate-pulse",children:[(0,l.jsx)("div",{className:"h-4 skeleton rounded w-3/4 mb-3"}),(0,l.jsx)("div",{className:"h-3 skeleton rounded w-1/2 mb-4"}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsx)("div",{className:"h-8 skeleton rounded"}),(0,l.jsx)("div",{className:"h-8 skeleton rounded"}),(0,l.jsx)("div",{className:"h-8 skeleton rounded"})]})]},e))})}function g(e){let{message:t}=e;return(0,l.jsx)(o.Zp,{className:"py-8 text-center",children:(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:t})})}function j(e){var t,a;let{lng:d}=e,{t:u}
1=(0,i.B)(d,"left-sidebar"),[x,p]=(0,s.useState)("MACRO"),[b,j]=(0,s.useState)({upcoming:[],recent:[]}),[y,N]=(0,s.useState)([]),[w,k]=(0,s.useState)([]),[S,A]=(0,s.useState)(!1),[C,P]=(0,s.useState)(null),[M,E]=(0,s.useState)("all"),[_,D]=(0,s.useState)("ALL"),[T,z]=(0,s.useState)(!1),[R,K]=(0,s.useState)(!1),[L,I]=(0,s.useState)(!1),O=(0,s.useMemo)(()=>[{key:"MACRO",label:u("calendar-tab-macro")},{key:"EARNINGS",label:u("calendar-tab-earnings")}],[u]),U=(0,s.useMemo)(()=>[{key:"all",label:u("tab-all")},{key:"upcoming",label:u("tab-upcoming")},{key:"recent",label:u("tab-recent")}],[u]),F=(0,s.useMemo)(()=>[{key:"ALL",label:u("tab-all")},{key:"HIGH",label:u("calendar-importance-high")},{key:"MEDIUM",label:u("calendar-importance-medium")}],[u]),B=(0,s.useMemo)(()=>({forecast:u("calendar-forecast"),actual:u("calendar-actual"),previous:u("calendar-previous"),status:u("calendar-status"),statusUpcoming:u("calendar-status-upcoming"),statusPublished:u("calendar-status-published"),importanceHigh:u("calendar-importance-high"),importanceMedium:u("calendar-importance-medium")}),[u]),Y=(0,s.useMemo)(()=>({epsEstimate:u("calendar-eps-estimate"),epsActual:u("calendar-eps-actual"),preMarket:u("calendar-pre-market"),afterClose:u("calendar-after-close"),beat:u("calendar-beat"),miss:u("calendar-miss")}),[u]),G=(0,s.useMemo)(()=>({priceTBD:u("calendar-price-tbd")}),[u]),H=(0,s.useCallback)(async()=>{if(!T||"ALL"!==_){A(!0),P(null);try{let e=await (0,n.t3)({range:14,importance:_,includeRecent:!0});j(e.data),z(!0)}catch(e){P(u("calendar-load-error")),console.error("Failed to fetch macro calendar:",e)}finally{A(!1)}}},[_,T,u]),V=(0,s.useCallback)(async()=>{if(!R){A(!0),P(null);try{let e=(0,c.yf)().subtract(3,"day").format("YYYY-MM-DD"),t=(0,c.yf)().add(7,"day").format("YYYY-MM-DD"),a=(await (0,n.AE)({startDate:e,endDate:t})).data.earnings.sort((e,t)=>(0,c.yf)(e.report_date).diff((0,c.yf)(t.report_date)));N(a),K(!0)}catch(e){P(u("calendar-load-error")),console.error("Failed to fetch earnings calendar:",e)}finally{A(!1)}}},[R,u]),W=(0,s.useCallback)(async()=>{if(!L){A(!0),P(null);try{let e=(0,c.yf)().subtract(7,"day").format("YYYY-MM-DD"),t=(0,c.yf)().add(30,"day").format("YYYY-MM-DD"),a=(await (0,n.NA)({startDate:e,endDate:t})).data.ipos.sort((e,t)=>(0,c.yf)(e.ipo_date).diff((0,c.yf)(t.ipo_date)));k(a),I(!0)}catch(e){P(u("calendar-load-error")),console.error("Failed to fetch IPO calendar:",e)}finally{A(!1)}}},[L,u]);(0,s.useEffect)(()=>{"MACRO"===x?H():"EARNINGS"===x?V():"IPO"===x&&W()},[x,H,V,W]),(0,s.useEffect)(()=>{"MACRO"===x&&z(!1)},[_,x]);let Z=(0,s.useMemo)(()=>"upcoming"===M?b.upcoming:"recent"===M?b.recent:[...b.upcoming,...b.recent],[M,b]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.X3,{title:u("section-calendar"),showViewAll:!1}),(0,l.jsx)(r.dJ,{tabs:O.map(e=>e.label),activeTab:null==(t=O.find(e=>e.key===x))?void 0:t.label,onTabChange:e=>{var t;let a=null==(t=O.find(t=>t.label===e))?void 0:t.key;a&&p(a)},className:"mb-3"}),"MACRO"===x&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.dJ,{tabs:U.map(e=>e.label),activeTab:null==(a=U.find(e=>e.key===M))?void 0:a.label,onTabChange:e=>{let t=U.find(t=>t.label===e);t&&E(t.key)},className:"mb-3"}),(0,l.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,l.jsx)("span",{className:"text-xs text-neutral-400 self-center",children:u("calendar-importance")}),F.map(e=>(0,l.jsx)(o.vu,{label:e.label,isActive:_===e.key,onClick:()=>D(e.key)},e.key))]})]}),(()=>{if(S)return(0,l.jsx)(f,{});if(C)return(0,l.jsxs)(o.Zp,{className:"py-8 text-center",children:[(0,l.jsx)("div",{className:"text-red-400 text-sm mb-2",children:C}),(0,l.jsx)("button",{onClick:()=>{"MACRO"===x?(z(!1),H()):"EARNINGS"===x?(K(!1),V()):(I(!1),W())},className:"text-xs text-blue-400 active:text-blue-300 [@media(hover:hover)_and_(pointer:fine)]:hover:text-blue-300",children:u("btn-retry")})]});switch(x){case"MACRO":return 0===Z.length?(0,l.jsx)(g,{message:u("calendar-empty")}):(0,l.jsx)("div",{className:"space-y-3",children:Z.slice(0,8).map(e=>(0,l.jsx)(v,{event:e,labels:B},e.eventId))});case"EARNINGS":return 0===y.length?(0,l.jsx)(g,{message:u("calendar-no-earnings")}):(0,l.jsx)("div",{className:"space-y-2",children:y.slice(0,8).map((e,t)=>(0,l.jsx)(m,{event:e,lng:d,labels:Y},"".concat(e.symbol,"-").concat(e.report_date,"-").concat(t)))});case"IPO":return 0===w.length?(0,l.jsx)(g,{message:u("calendar-no-ipo")}):(0,l.jsx)("div",{className:"space-y-2",children:w.slice(0,5).map((e,t)=>(0,l.jsx)(h,{event:e,lng:d,labels:G},"".concat(e.symbol,"-").concat(e.ipo_date,"-").concat(t)))});default:return null}})()]})}},4614:(e,t,a)=>{a.d(t,{CalendarSection:()=>d});var l=a(95155),s=a(20063),n=a(12115),r=a(52714),i=a(81744);let c=[{day:"Sat",date:18},{day:"Sun",date:19},{day:"Mon",date:20,isActive:!0},{day:"Tue",date:21},{day:"Wed",date:22},{day:"Thu",date:23},{day:"Fri",date:24},{day:"Sat",date:25},{day:"Sun",date:26},{day:"Mon",date:27},{day:"Tue",date:28},{day:"Wed",date:29}],o=[{type:"Earnings Event",primaryInfo:[{label:"Symbol",value:"TM"},{label:"Company",value:"Toyota Motor Corporation"}],secondaryInfo:[{label:"Earnings Call time",value:"BMO"},{label:"EPS Estimate",value:"5.36"},{label:"Market",value:"265.75B"}]}
1,{type:"Stock Spilt",primaryInfo:[{label:"Symbol",value:"0103.HK"},{label:"Company",value:"Shougang Century Holding Ltd"}],secondaryInfo:[{label:"Payable On",value:"Nov 05, 2025"},{label:"Optionable?",value:"N"},{label:"Ratio",value:"5.00 - 1.00"}]},{type:"IPO",primaryInfo:[{label:"Symbol",value:"ELWT"},{label:"Company",value:"Elauwit Connection Inc."}],secondaryInfo:[{label:"Exchange",value:"Nasdaq"},{label:"Date",value:"Nov 05, 2025"},{label:"Actions",value:"Expected"}]},{type:"Economic Event",primaryInfo:[{label:"Country",value:"SG"},{label:"Event",value:"Retail Sales MM"}],secondaryInfo:[{label:"Event Time",value:"5:00 AM UTC"},{label:"For",value:"Sep"},{label:"Prior to This",value:"0.5"}]}];function d(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,i.B)(t,"left-sidebar"),d=[a("tab-all"),a("tab-earnings"),a("tab-stock-split"),a("tab-ipo"),a("tab-economic-event")],[u,x]=n.useState(d[0]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.X3,{title:a("section-calendar")}),(0,l.jsx)("div",{className:"flex gap-2 mb-4 xl:mb-6 overflow-x-auto xl:overflow-x-visible pb-2 xl:pb-0 scrollbar-hide -mx-4 xl:mx-0 px-4 xl:px-0",children:c.map((e,t)=>(0,l.jsx)(r.ik,{...e},t))}),(0,l.jsx)(r.dJ,{tabs:d,activeTab:u,onTabChange:x,className:"mb-3 xl:mb-4"}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:o.map((e,t)=>(0,l.jsx)(r.nn,{...e},t))})]})}},4998:(e,t,a)=>{a.d(t,{RelatedNewsSection:()=>o});var l=a(95155),s=a(20063),n=a(12115),r=a(52714),i=a(81744);let c=[{source:"Forbes",date:"Fri, July 11, 2025 at 7:24 PM PDT",title:"Google to Pay $2.4 Billion in Deal to License Tech of Coding Startup",summary:"Google's deal boosts AI edge and talent pool overall seen as a positive for GOOGL stock.",ticker:"GOOGL",tickerChange:"+2.03%"},{source:"Forbes",date:"Sat, July 12, 2025 at 1:05 AM PDT",title:"2 Growth Stocks to Buy Now With Less Than $500",summary:"Growth stocks can help you get ahead of your retirement goals.",ticker:"SNOW",tickerChange:"+2.03%"}];function o(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,i.B)(t,"left-sidebar"),o=[a("tab-gainers"),a("tab-losers"),a("news"),a("tab-alerts"),a("tab-top-3-mover")],[d,u]=n.useState(o[0]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.X3,{title:a("section-related-news")}),(0,l.jsx)("div",{className:"flex gap-2 mb-4 overflow-x-auto pb-2 scrollbar-hide",children:o.map(e=>(0,l.jsx)("button",{onClick:()=>u(e),className:"px-4 py-2 rounded-full text-sm whitespace-nowrap transition-all ".concat(d===e?"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20":"glass-card text-neutral-400 active:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15"),children:e},e))}),(0,l.jsx)("div",{className:"flex flex-col gap-3",children:c.map((e,t)=>(0,l.jsx)(r.rx,{...e},t))})]})}},13702:(e,t,a)=>{a.d(t,{ExploreStocksSection:()=>h});var l=a(95155),s=a(52619),n=a.n(s),r=a(20063),i=a(12115),c=a(52232),o=a(52714),d=a(62332),u=a(81744),x=a(58327);let m=[{key:"tab-today",dateRange:"today"},{key:"tab-weekly",dateRange:"last7days"},{key:"tab-monthly",dateRange:"last30days"},{key:"tab-quarterly",dateRange:"last90days"}];function h(e){let{title:t,onStockClick:a}=e,s=(0,r.useParams)(),h=(null==s?void 0:s.lng)||"en",{t:p}=(0,u.B)(h,"left-sidebar"),b=m.map(e=>({label:p(e.key),dateRange:e.dateRange})),[v,f]=(0,i.useState)(0),[g,j]=(0,i.useState)([]),[y,N]=(0,i.useState)(!0),[w,k]=(0,i.useState)(null),S=(0,i.useCallback)(async e=>{N(!0),k(null);try{let t=m[e].dateRange,a=await (0,c.Su)({dateRange:t,limit:10});j(a.data.tickers)}catch(e){console.error("Failed to fetch trending tickers:",e),k("Failed to load trending stocks"),j([])}finally{N(!1)}},[]);(0,i.useEffect)(()=>{S(v)},[v,S]);let A=(0,i.useMemo)(()=>g.map(e=>e.ticker),[g]),C=(0,x.pu)(),{prices:P}=(0,d.z6)(A,{enabled:C});return(0,l.jsxs)("div",{children:[(0,l.jsx)(o.X3,{title:null!=t?t:p("section-trending")}),(0,l.jsx)("div",{className:"flex gap-2 mb-4 xl:mb-5 overflow-x-auto pb-2 scrollbar-hide -mx-4 xl:mx-0 px-4 xl:px-0",children:b.map((e,t)=>(0,l.jsx)("button",{onClick:()=>(e=>{let t=b.findIndex(t=>t.label===e);-1!==t&&t!==v&&f(t)})(e.label),className:"px-4 xl:px-5 py-2 xl:py-2.5 rounded-full text-sm xl:text-base font-medium whitespace-nowrap transition-all ".concat(v===t?"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20":"glass-card text-neutral-400 active:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15"),children:e.label},e.dateRange))}),y&&(0,l.jsx)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 xl:gap-4",children:Array.from({length:6}).map((e,t)=>(0,l.jsx)("div",{className:"animate-pulse skeleton-card rounded-2xl p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("div",{className:"h-4 w-16 skeleton rounded"}),(0,l.jsx)("div",{className:"h-3 w-24 skeleton rounded"})]}),(0,l.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,l.jsx)("div",{className:"h-4 w-16 skeleton rounded"}),(0,l.jsx)("div",{className:"h-3 w-12 skeleton rounded"})]})]})},t))}),w&&!y&&(0,l.jsxs)("div",{className:"text-center py-8 text-neutral-400",children:[w,(0,l.jsx)("button",{onClick:()=>S(v),className:"ml-2 text-neutral-100 underline",children:p("btn-retry")})]}),!y&&!w&&0===g.length&&(0,l.jsx)("div",{className:"text-center py-8 text-neutral-400",children:"No trending stocks foun
1d"}),!y&&!w&&g.length>0&&(0,l.jsx)("div",{className:"\n            grid grid-cols-1 xl:grid-cols-2 gap-3 xl:gap-4\n            ".concat(g.length>5?"max-h-[600px] overflow-y-auto pr-0 xl:pr-2 scrollbar-hide xl:scrollbar-thin xl:scrollbar-thumb-neutral-600 xl:scrollbar-track-neutral-800":"","\n            ").concat(g.length>5&&g.length<=10?"xl:max-h-none xl:overflow-visible xl:pr-0":"","\n            ").concat(g.length>10?"xl:max-h-[720px] xl:overflow-y-auto xl:pr-2":"","\n          "),children:g.map(e=>a?(0,l.jsx)(o.Se,{ticker:e.ticker,priceData:P.get(e.ticker.toUpperCase()),onCardClick:a},e.ticker):(0,l.jsx)(n(),{href:"/".concat(h,"/tickers/").concat(e.ticker),className:"block",children:(0,l.jsx)(o.Se,{ticker:e.ticker,priceData:P.get(e.ticker.toUpperCase())})},e.ticker))})]})}},13823:(e,t,a)=>{a.d(t,{EconomicCalendarSection:()=>p});var l=a(95155),s=a(12115),n=a(52232),r=a(52714),i=a(81744),c=a(84769),o=a(98832);function d(e){return null==e?"-":Math.abs(e)>=1e3?e.toLocaleString("en-US",{maximumFractionDigits:0}):e.toLocaleString("en-US",{maximumFractionDigits:2})}function u(e){let{importance:t,label:a}=e;return(0,l.jsx)("span",{className:"text-[10px] px-2 py-1 rounded font-medium ".concat("HIGH"===t?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"),children:a})}function x(e){var t;let{event:a,labels:s}=e,n="UPCOMING"===a.status;return(0,l.jsxs)(o.Zp,{className:"relative overflow-hidden",children:[(0,l.jsx)("div",{className:"absolute top-3 right-3",children:(0,l.jsx)(u,{importance:a.importance,label:"HIGH"===a.importance?s.importanceHigh:s.importanceMedium})}),(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-sm xl:text-base font-bold text-neutral-100 pr-16 mb-1",children:a.displayTitle||a.title}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[(0,l.jsx)("span",{children:(t=a.eventDate,(0,c.yf)(t).format("MMM D"))}),a.eventTime&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:"•"}),(0,l.jsx)("span",{children:function(e){if(!e)return"";let[t,a]=e.split(":").map(Number);return"".concat(t%12||12,":").concat(a.toString().padStart(2,"0")," ").concat(t>=12?"PM":"AM"," ET")}(a.eventTime)})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:n?s.forecast:s.actual}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold text-neutral-100",children:n?d(a.forecastValue):d(a.actualValue)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:s.previous}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold text-neutral-100",children:d(a.previousValue)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[10px] xl:text-xs text-neutral-400 mb-0.5",children:s.status}),(0,l.jsx)("div",{className:"text-sm xl:text-base font-bold ".concat(n?"text-blue-400":"text-green-400"),children:n?s.statusUpcoming:s.statusPublished})]})]})]})}function m(){return(0,l.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,l.jsxs)(o.Zp,{className:"animate-pulse",children:[(0,l.jsx)("div",{className:"h-4 skeleton rounded w-3/4 mb-3"}),(0,l.jsx)("div",{className:"h-3 skeleton rounded w-1/2 mb-4"}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsx)("div",{className:"h-8 skeleton rounded"}),(0,l.jsx)("div",{className:"h-8 skeleton rounded"}),(0,l.jsx)("div",{className:"h-8 skeleton rounded"})]})]},e))})}function h(e){let{message:t}=e;return(0,l.jsx)(o.Zp,{className:"py-8 text-center",children:(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:t})})}function p(e){var t;let{lng:a}=e,{t:c}=(0,i.B)(a,"left-sidebar"),[d,u]=(0,s.useState)({upcoming:[],recent:[]}),[p,b]=(0,s.useState)(!0),[v,f]=(0,s.useState)(null),[g,j]=(0,s.useState)("all"),[y,N]=(0,s.useState)("ALL"),w=(0,s.useCallback)(async()=>{try{b(!0),f(null);let e=await (0,n.t3)({range:14,importance:y,includeRecent:!0});u(e.data)}catch(e){f(c("calendar-load-error")),console.error("Failed to fetch calendar:",e)}finally{b(!1)}},[y,c]);(0,s.useEffect)(()=>{w()},[w]);let k=(0,s.useMemo)(()=>[{key:"all",label:c("tab-all")},{key:"upcoming",label:c("tab-upcoming")},{key:"recent",label:c("tab-recent")}],[c]),S=(0,s.useMemo)(()=>[{key:"ALL",label:c("tab-all")},{key:"HIGH",label:c("calendar-importance-high")},{key:"MEDIUM",label:c("calendar-importance-medium")}],[c]),A=(0,s.useMemo)(()=>({forecast:c("calendar-forecast"),actual:c("calendar-actual"),previous:c("calendar-previous"),status:c("calendar-status"),statusUpcoming:c("calendar-status-upcoming"),statusPublished:c("calendar-status-published"),importanceHigh:c("calendar-importance-high"),importanceMedium:c("calendar-importance-medium")}),[c]),C=(0,s.useMemo)(()=>"upcoming"===g?d.upcoming:"recent"===g?d.recent:[...d.upcoming,...d.recent],[g,d]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.X3,{title:c("section-calendar"),showViewAll:!1}),(0,l.jsx)(r.dJ,{tabs:k.map(e=>e.label),activeTab:null==(t=k.find(e=>e.key===g))?void 0:t.label,onTabChange:e=>{let t=k.find(t=>t.label===e);t&&j(t.key)},className:"mb-3"}),(0,l.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,l.jsx)("span",{className:"text-xs text-neutral-400 self-center",children:c("calendar-importance")}),S.map(e=>
1(0,l.jsx)(o.vu,{label:e.label,isActive:y===e.key,onClick:()=>N(e.key)},e.key))]}),p?(0,l.jsx)(m,{}):v?(0,l.jsxs)(o.Zp,{className:"py-8 text-center",children:[(0,l.jsx)("div",{className:"text-red-400 text-sm mb-2",children:v}),(0,l.jsx)("button",{onClick:w,className:"text-xs text-blue-400 active:text-blue-300 [@media(hover:hover)_and_(pointer:fine)]:hover:text-blue-300",children:c("btn-retry")})]}):0===C.length?(0,l.jsx)(h,{message:c("calendar-empty")}):(0,l.jsx)("div",{className:"space-y-3",children:C.slice(0,10).map(e=>(0,l.jsx)(x,{event:e,labels:A},e.eventId))})]})}},15574:(e,t,a)=>{a.d(t,{USIndicatorsSection:()=>c});var l=a(95155);a(12115);var s=a(52714),n=a(98832);function r(e){let{title:t,subtitle:a,period:s,value:r,description:i}=e;return(0,l.jsxs)(n.Zp,{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h3",{className:"text-sm xl:text-base font-bold text-neutral-100 mb-1",children:t}),(0,l.jsx)("p",{className:"text-xs xl:text-sm text-neutral-400",children:a}),(0,l.jsx)("p",{className:"text-[10px] xl:text-xs text-neutral-400 mt-1",children:s})]}),(0,l.jsx)("div",{className:"w-10 h-10 xl:w-12 xl:h-12 rounded-full bg-neutral-400 shrink-0"})]}),(0,l.jsxs)("div",{className:"text-3xl xl:text-4xl font-bold text-neutral-100 mb-3",children:[r,(0,l.jsx)("span",{className:"text-base xl:text-lg",children:"%"})]}),(0,l.jsx)("p",{className:"text-xs xl:text-sm text-neutral-300 leading-relaxed",children:i})]})}let i=[{title:"GDP Growth",subtitle:"Real Gross Domestic Product (GDP)",period:"2025 Q2",value:"3.80",description:"The U.S. economy continues to show resilience despite cooling inflation and a softer labor market."},{title:"GDP Growth",subtitle:"Real Gross Domestic Product (GDP)",period:"2025 Q2",value:"3.80",description:"The U.S. economy continues to show resilience despite cooling inflation and a softer labor market."},{title:"GDP Growth",subtitle:"Real Gross Domestic Product (GDP)",period:"2025 Q2",value:"3.80",description:"The U.S. economy continues to show resilience despite cooling inflation and a softer labor market."},{title:"GDP Growth",subtitle:"Real Gross Domestic Product (GDP)",period:"2025 Q2",value:"3.80",description:"The U.S. economy continues to show resilience despite cooling inflation and a softer labor market."}];function c(){return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4 xl:mb-5",children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100",children:"US Indicators"}),(0,l.jsx)(s.VN,{})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 xl:gap-5",children:i.map((e,t)=>(0,l.jsx)(r,{...e},t))})]})}},17812:(e,t,a)=>{a.d(t,{WatchlistTrendingSection:()=>n});var l=a(95155);a(12115);var s=a(38309);function n(e){return(0,l.jsx)(s.TrendingSection,{})}},24954:(e,t,a)=>{a.d(t,{DailyInsightsSection:()=>c});var l=a(95155),s=a(20063);a(12115);var n=a(52714),r=a(81744);let i=[{description:"U.S. October Non-farm Payrolls rose by 125K vs. market expectation of 180K, showing early signs of labor market cooling.",sentiment:"Positive"},{description:"U.S. October Non-farm Payrolls rose by 125K vs. market expectation of 180K, showing early signs of labor market cooling.",sentiment:"Positive"}];function c(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,r.B)(t,"left-sidebar");return(0,l.jsxs)("div",{children:[(0,l.jsx)(n.X3,{title:a("section-ai-daily-insights")}),(0,l.jsx)("div",{className:"flex xl:grid xl:grid-cols-2 gap-3 xl:gap-4 overflow-x-auto xl:overflow-x-visible pb-2 xl:pb-0 scrollbar-hide snap-x snap-mandatory xl:snap-none -mx-4 xl:mx-0 px-4 xl:px-0",children:i.map((e,t)=>(0,l.jsx)(n.n$,{...e},t))})]})}},25286:(e,t,a)=>{a.d(t,{NewsTrendingSection:()=>m});var l=a(95155),s=a(98832),n=a(20063),r=a(12115),i=a(87144),c=a(52714),o=a(79369),d=a(81744),u=a(73572),x=a(36114);function m(){let{tempTopic:e,onTempTopicChange:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.useParams)(),m=(null==a?void 0:a.lng)||"en-US",{t:h}=(0,d.B)(m,"left-sidebar"),{data:p,isLoading:b,error:v,fetchNextPage:f,hasNextPage:g,isFetchingNextPage:j}=(0,o.YC)(),y=(0,r.useMemo)(()=>(0,o.KP)(null==p?void 0:p.pages),[p]),N=(0,r.useRef)(null),[w,k]=(0,r.useState)(["All"]),[S,A]=(0,r.useState)(!0),[C,P]=(0,r.useState)("All"),[M,E]=(0,r.useState)([]),[_,D]=(0,r.useState)({currentPage:1,hasMore:!0,isLoadingMore:!1}),[T,z]=(0,r.useState)(!1),[R,K]=(0,r.useState)(null),[L,I]=(0,r.useState)(null),[O,U]=(0,r.useState)([]),[F,B]=(0,r.useState)({currentPage:1,hasMore:!0,isLoadingMore:!1}),[Y,G]=(0,r.useState)(!1),[H,V]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{A(!0);try{let e=(await (0,i.Ou)("daily")).data.topics.slice(0,10).map(e=>e.name);k(["All",...e])}catch(e){console.error("Failed to fetch topic tabs:",e),k(["All"])}finally{A(!1)}})()},[]);let W=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];1===t?(z(!0),K(null)):D(e=>({...e,isLoadingMore:!0}));try{let l=await (0,i.I1)(e,t,20),s=l.data.news||[],n=l.data.pagination;a?E(e=>[...e,...s]):E(s),D({currentPage:t,hasMore:n&&n.total?20*t<n.total:20===s.length,isLoadingMore:!1})}catch(t){console.error("Failed to fetch news for topic ".concat(e,":"),t),K("Failed to load news"),a||E([]),D(e=>({...e,isLoadingMore:!1}))}finally{z(!1)}},[]),Z=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];1===t?(G(!0),V(null)):B(e=>({...e,isLoadingMore:!0}));try{let l=await (0,i.sd)(e,t,20),s=l.data.news||[],n=l.data.pagination;a?U(e=>[...e,...s]):U(s),B({currentPage:t,hasMore:n&&n.total?20*t<n.total:20===s.length,isLoadingMore:!1})}catch(t){console.error("Failed to fetch news for ticker ".concat(e,":"),t),V("Failed to load news"),a||U([]),B(e=>({...e,isLoadingMore:!1}))}finally{G(!1)}},[]);(0,r.useEffect)(()=>{e&&e!==C&&(P(e),N.current&&(N.current.scrollTop=0),D({currentPage:1,hasMore:!0,isLoadingMore:!1}),W(e,1,!1))},[e,C,W]);let J=(0,r.useCallback)(a=>{a!==C&&(e&&a!==e&&(null==t||t(null)),P(a),N.current&&(N.current.scrollTop=0),"All"!==a&&(D({currentPage:1,hasMore:!0,isLoadingMore:!1}),W(a,1,!1)))},[C,W,e,t]),X=(0,r.useCallback)(e=>{null==t||t(e),I(null)},[t]),q=(0,r.useCallback)(e=>{null==t||t(null),P("All"),I(e),N.current&&(N.current.scrollTop=0),B({currentPage:1,hasMore:!0,isLoadingMore:!1}),Z(e,1,!1)},[t,Z]),Q=(0,r.useCallback)(()=>{I(null),U([])},[]),$=(0,r.useCallback)(()=>{j||b||!g||f()},[j,b,g,f]),ee=(0,r.useCallback)(()=>{_.isLoadingMore||T||!_.hasMore||W(C,_.currentPage+1,!0)},[_.isLoadingMore,_.hasMore,_.currentPage,T,C,W]),et=(0,r.useCallback)(()=>{L&&!F.isLoadingMore&&!Y&&F.hasMore&&Z(L,F.currentPage+1,!0)},[L,F.isLoadingMore,F.hasMore,F.currentPage,Y,Z]),ea=(0,r.useCallback)(()=>{let e=N.current;if(!e)return;let{scrollTop:t,scrollHeight:a,clientHeight:l}=e;a-t-l<100&&(L?et():"All"===C?$():ee())},[C,L,$,ee,et]);(0,r.useEffect)(()=>{let e=N.current;if(e)return e.addEventListener("scroll",ea),()=>e.removeEventListener("scroll",ea)},[ea]);let el=(0,r.useCallback)(e=>e.map(e=>{let{title:t,text:a}=(0,u.$)(e,m);return{news_id:e.news_id,title:t,description:a,source:e.source_name||"Unknown",publishedDate:e.published_time?(0,x.Pf)(e.published_time,m):"",stockSymbol:e.tickers&&e.tickers.length>0?e.tickers[0]:void 0,stockChange:void 0,isPositive:"Positive"===e.sentiment,imageUrl:e.image_url,url:e.news_url,sentiment:e.sentiment,rankScore:e.rank_score,topics:e.topics,tickers:e.tickers}}),[m]),es=(0,r.useMemo)(()=>L?el(O):"All"===C?el(y):el(M),[C,y,M,O,L,el]),en=L?Y:"All"===C?b&&0===y.length:T,er=L?H:"All"===C?(null==v?void 0:v.message)||null:R,ei=L?F:"All"===C?{isLoadingMore:j,hasMore:!!g}:_;return(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg xl:text-xl font-bold text-neutral-100 mb-3 xl:mb-4",children:h("section-trending")}),S?(0,l.jsx)("div",{className:"flex gap-2 mb-4 overflow-x-auto pb-2",children:Array.from({length:5}).map((e,t)=>(0,l.jsx)("div",{className:"animate-pulse skeleton rounded-full h-9 w-20"},t))}):(0,l.jsxs)("div",{className:"flex gap-1 xl:gap-2 overflow-x-auto xl:overflow-x-visible pb-1 xl:pb-0 scrollbar-hide -mx-4 xl:mx-0 px-4 xl:px-0 xl:flex-wrap mb-4",children:[(0,l.jsx)("button",{onClick:()=>{J("All"),Q()},className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat("All"!==C||L?"glass-card text-neutral-400 active:bg-white/15 active:text-neutral-300 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:text-neutral-300":"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20"),children:h("tab-all")}),L&&(0,l.jsxs)("button",{onMouseLeave:Q,className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors flex items-center gap-1.5 bg-purple-600 text-white",children:["$"+L,(0,l.jsx)("span",{onClick:e=>{e.stopPropagation(),Q()},className:"ml-1 active:text-white [@media(hover:hover)_and_(pointer:fine)]:hover:text-white cursor-pointer",children:"\xd7"})]}),e&&!w.includes(e)&&!L&&(0,l.jsxs)("button",{onClick:()=>J(e),className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors flex items-center gap-1.5 ".concat(C===e?"bg-cyan-600 text-white":"bg-cyan-900/50 text-cyan-300 border border-cyan-700 active:bg-cyan-800/50 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-cyan-800/50"),children:[e,(0,l.jsx)("span",{onClick:a=>{a.stopPropagation(),null==t||t(null),C===e&&P("All")},className:"ml-1 active:text-white [@media(hover:hover)_and_(pointer:fine)]:hover:text-white cursor-pointer",children:"\xd7"})]}),w.slice(1).map(e=>(0,l.jsx)("button",{onClick:()=>J(e),className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(C===e?"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20":"glass-card text-neutral-400 active:bg-white/15 active:text-neutral-300 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:text-neutral-300"),children:e},e))]}),h("news-translation-disclaimer")&&(0,l.jsx)("p",{className:"text-[10px] xl:text-xs text-neutral-500 mb-2",children:h("news-translation-disclaimer")}),(0,l.jsx)("div",{ref:N,className:"h-[800px] overflow-y-auto scrollbar-auto-hide",children:(0,l.jsx)("div",{className:"flex flex-col gap-3 pr-2",children:en?(0,l.jsx)(s.tn,{}):er?(0,l.jsxs)("div",{className:"text-red-500 text-center p-4",children:["Error loading news: ",er]}):0===es.length?(0,l.jsx)("div",{className:"text-neutral-400 text-center p-4",children:h("no-trending-news")}):(0,l.jsxs)(l.Fragment,{children:[es.map(e=>
1(0,l.jsx)(c.Qc,{...e,onTopicClick:X,onTickerClick:q},e.news_id)),ei.isLoadingMore&&(0,l.jsx)("div",{className:"py-4",children:(0,l.jsx)(s.tn,{})}),!ei.hasMore&&es.length>0&&(0,l.jsx)("div",{className:"text-neutral-500 text-center py-4 text-sm",children:h("no-more-news")})]})})})]})}},25882:(e,t,a)=>{a.d(t,{HeatmapSection:()=>d});var l=a(95155),s=a(20063),n=a(12115),r=a(52232),i=a(52714),c=a(78436),o=a(81744);function d(){let e=(0,s.useRouter)(),t=(0,s.useParams)(),a=(null==t?void 0:t.lng)||"en",[,d]=(0,n.useTransition)(),{t:u}=(0,o.B)(a,"left-sidebar"),{t:x}=(0,o.B)(a,"industries"),{t:m}=(0,o.B)(a,"common"),[h,p]=(0,n.useState)([]),[b,v]=(0,n.useState)(!0),[f,g]=(0,n.useState)(null);(0,n.useEffect)(()=>{(async()=>{try{v(!0);let e=await (0,r.fw)();p(e.data.industries.slice(0,8)),g(null)}catch(e){g(m("error.load-industries-failed")),console.error("Failed to fetch industry heatmap:",e)}finally{v(!1)}})()},[]);let j=()=>{(0,c.ot)(),d(()=>{e.push("/".concat(a,"/heatmap"))})};return b?(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:u("heatmap"),onViewAll:j}),(0,l.jsx)("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-3",children:[...Array(8)].map((e,t)=>(0,l.jsx)("div",{className:"skeleton-card rounded-xl p-3 min-h-[80px] animate-pulse"},t))})]}):f?(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:u("heatmap"),onViewAll:j}),(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:f})]}):0===h.length?(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:u("heatmap"),onViewAll:j}),(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:m("empty.no-industry-data")})]}):(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:u("heatmap"),onViewAll:j}),(0,l.jsx)("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-3",children:h.map(e=>(0,l.jsx)(i.Dt,{slug:e.slug,title:(e=>{let t=x(e.slug);return t!==e.slug?t:e.slug})(e),change:"--",size:"md"},e.id))})]})}},26114:(e,t,a)=>{a.d(t,{MacroAiSummarySection:()=>c});var l=a(95155),s=a(12115),n=a(94044),r=a(81744),i=a(36114);function c(e){let{lng:t}=e,{t:a}=(0,r.B)(t||"en-US","left-sidebar"),[c,o]=(0,s.useState)(null),[d,u]=(0,s.useState)(!0),[x,m]=(0,s.useState)(null),[h,p]=(0,s.use
1State)("ai"),b=(0,s.useRef)(null);(0,s.useEffect)(()=>{!async function(){try{u(!0),m(null);let e=await (0,n._t)(t);o(e.data)}catch(e){console.error("Failed to fetch recession signal:",e),m("加载失败")}finally{u(!1)}}()},[t]);let v=e=>{if(b.current){let t=b.current.clientWidth;b.current.scrollTo({left:"data"===e?t:0,behavior:"smooth"})}};if(d)return(0,l.jsxs)("div",{className:"glass-card rounded-xl p-4 xl:p-6 mb-6 animate-pulse",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)("div",{className:"w-6 h-6 skeleton rounded-full"}),(0,l.jsx)("div",{className:"h-4 skeleton rounded w-32"})]}),(0,l.jsx)("div",{className:"h-4 skeleton rounded w-full mb-2"}),(0,l.jsx)("div",{className:"h-4 skeleton rounded w-3/4"})]});if(x||!c)return null;let{overallRisk:f,aiSummary:g,signals:j}=c,y=e=>"SAFE"===e?"text-green-400":"WARNING"===e?"text-yellow-400":"text-red-400";return(0,l.jsxs)("div",{className:"relative mb-6",children:[(0,l.jsxs)("div",{ref:b,onScroll:()=>{b.current&&p(b.current.scrollLeft>b.current.clientWidth/2?"data":"ai")},className:"flex gap-4 overflow-x-auto snap-x snap-mandatory scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,l.jsxs)("div",{className:"flex-shrink-0 w-full snap-center glass-card rounded-xl p-4 xl:p-6",children:[(0,l.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,l.jsx)("span",{className:"text-sm font-semibold text-neutral-200 border-b-2 border-ymyc-brand pb-0.5",children:a("ai-macro-insight")})}),(0,l.jsx)("p",{className:"text-sm text-neutral-300 leading-relaxed mb-3",children:g||a("loading-ai-analysis")}),(0,l.jsx)("p",{className:"text-xs text-neutral-500",children:a("swipe-for-signals")})]}),(0,l.jsxs)("div",{className:"flex-shrink-0 w-full snap-center glass-card rounded-xl p-4 xl:p-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-neutral-200 border-b-2 border-ymyc-brand pb-0.5",children:a("recession-signals")}),(0,l.jsx)("span",{className:"text-xs font-medium ml-auto ".concat("LOW"===f?"text-green-400":"MODERATE"===f?"text-yellow-400":"HIGH"===f?"text-orange-400":"text-red-400"),children:(e=>{switch(e){case"LOW":return a("risk-low");case"MODERATE":return a("risk-moderate");case"HIGH":return a("risk-high");case"CRITICAL":return a("risk-critical");default:return e}})(f)})]}),(0,l.jsxs)("div",{className:"space-y-2 mb-3",children:[(0,l.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,l.jsx)("span",{className:"text-neutral-400",children:a("sahm-rule")}),(0,l.jsx)("span",{className:y(j.sahmRule.status),children:(0,i.ZV)(j.sahmRule.currentValue)})]}),(0,l.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,l.jsx)("span",{className:"text-neutral-400",children:a("yield-spread-10y-2y")}),(0,l.jsxs)("span",{className:y(j.yieldCurve.status),children:[(0,i.ZV)(j.yieldCurve.currentValue),"%"]})]})]}),(0,l.jsx)("p",{className:"text-xs text-neutral-500",children:a("back-to-ai-insight")})]})]}),(0,l.jsxs)("div",{className:"flex justify-center gap-2 mt-3",children:[(0,l.jsx)("button",{onClick:()=>v("ai"),className:"w-2 h-2 rounded-full transition-colors ".concat("ai"===h?"bg-neutral-300":"bg-neutral-600"),"aria-label":"AI insight page"}),(0,l.jsx)("button",{onClick:()=>v("data"),className:"w-2 h-2 rounded-full transition-colors ".concat("data"===h?"bg-neutral-300":"bg-neutral-600"),"aria-label":"Data page"})]})]})}},29555:(e,t,a)=>{a.d(t,{NewsAIRecommendSection:()=>d});var l=a(95155),s=a(20063);a(12115),a(74062),a(18068);var n=a(65380),r=a(74551),i=a(52714),c=a(81744);let o=[{description:"U.S. October Non-farm Payrolls rose by 125K vs. market expectation of 180K, showing early signs of labor market cooling.",stockSymbol:"GOOGL",stockChange:"+2.03%",isPositive:!0},{description:"U.S. October Non-farm Payrolls rose by 125K vs. market expectation of 180K, showing early signs of labor market cooling.",stockSymbol:"GOOGL",stockChange:"+2.03%",isPositive:!0}];function d(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,c.B)(t,"left-sidebar");return(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:a("section-ai-recommend")}),(0,l.jsx)("div",{className:"xl:hidden -mx-4",children:(0,l.jsx)(r.RC,{modules:[n.dK],spaceBetween:12,slidesPerView:1,centeredSlides:!1,slidesOffsetBefore:16,slidesOffsetAfter:16,className:"pb-8",children:o.map((e,t)=>(0,l.jsx)(r.qr,{children:(0,l.jsx)(i.Ci,{title:"",...e,className:"h-full"})},t))})}),(0,l.jsx)("div",{className:"hidden xl:grid xl:grid-cols-2 gap-4",children:o.map((e,t)=>(0,l.jsx)(i.Ci,{title:"",...e},t))})]})}},38309:(e,t,a)=>{a.d(t,{TrendingSection:()=>p});var l=a(95155),s=a(52619),n=a.n(s),r=a(20063),i=a(12115),c=a(52232),o=a(52714),d=a(62332),u=a(81744),x=a(58327),m=a(98832);let h=[{key:"tab-today",dateRange:"today"},{key:"tab-weekly",dateRange:"last7days"},{key:"tab-monthly",dateRange:"last30days"},{key:"tab-quarterly",dateRange:"last90days"}];function p(){let e=(0,r.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,u.B)(t,"left-sidebar"),s=h.map(e=>({label:a(e.key),dateRange:e.dateRange})),[p,b]=(0,i.useState)(0),[v,f]=(0,i.useState)([]),[g,j]=(0,i.useState)(!0),[y,N]=(0,i.useState)(null),w=(0,i.useCallback)(async e=>{j(!0),N(null);try{let t=h[e].dateRange,a=await (0,c.Su)({dateRange:t,limit:10});f(a.data.tickers)}catch(e){console.error("Failed to fetch trending tickers:",e),N("Failed to load trending stocks"),f([])}finally{j(!1)}},[]);(0,i.useEffect)(()=>{w(p)},[p,w]);let k=(0,i.useMemo)(()=>v.map(e=>e.ticker),[v]),S=(0,x.pu)(),{prices:A}=(0,d.z6)(k,{enabled:S});return(0,l.jsxs)("div",{children:[(0,l.jsx)(o.X3,{title:a("section-trending"),showDataSource:!0}),(0,l.jsx)(o.dJ,{tabs:s.map(e=>e.label),activeTab:s[p].label,onTabChange:e=>{let t=s.findIndex(t=>t.label===e);-1!==t&&t!==p&&b(t)},className:"mb-3 xl:mb-4"}),(0,l.jsx)("div",{className:"flex flex-col gap-1 xl:gap-2",children:g?Array.from({length:5}).map((e,t)=>(0,l.jsx)(m.Zp,{className:"animate-pulse",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("div",{className:"h-4 w-16 skeleton rounded"}),(0,l.jsx)("div",{className:"h-3 w-24 skeleton rounded"})]}),(0,l.jsx)("div",{className:"h-3 w-12 skeleton rounded"})]})},t)):y?(0,l.jsxs)(m.Zp,{className:"text-center py-4",children:[(0,l.jsx)("p",{className:"text-neutral-400 text-sm",children:y}),(0,l.jsx)("button",{onClick:()=>w(p),className:"mt-2 text-xs text-blue-400 active:text-blue-300 [@media(hover:hover)_and_(pointer:fine)]:hover:text-blue-300",children:a("btn-retry")})]}):0===v.length?(0,l.jsx)(m.Zp,{className:"text-center py-4",children:(0,l.jsx)("p",{className:"text-neutral-400 text-sm",children:"No trending stocks foun
1d"})}):v.map(e=>{var a;let s=A.get(e.ticker.toUpperCase()),r=null!=(a=null==s?void 0:s.price)?a:null,i=(null==s?void 0:s.prevClose)&&s.prevClose>0?s.prevClose:e.latestClose;return(0,l.jsx)(n(),{href:"/".concat(t,"/tickers/").concat(e.ticker),className:"block",children:(0,l.jsx)(o.po,{symbol:e.ticker,name:e.tickerName,translations:e.translations,mentions:e.mentions,sentiment:e.sentimentScore,realtimePrice:r,latestClose:i})},e.id)})})]})}},41167:(e,t,a)=>{a.d(t,{DiscoverSection:()=>x});var l=a(95155),s=a(52619),n=a.n(s),r=a(20063),i=a(12115),c=a(52232),o=a(52714),d=a(81744),u=a(36114);function x(){let e=(0,r.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,d.B)(t,"left-sidebar"),[s,x]=(0,i.useState)([]),[m,h]=(0,i.useState)(!0);return((0,i.useEffect)(()=>{(async()=>{try{let e=sessionStorage.getItem(u.k0);if(e){let t=JSON.parse(e);if(t.length>0){x(t),h(!1);return}}}catch(e){}h(!0);try{let e=await (0,c.En)({maxResults:50}),t=(0,u.g9)(e.data.videos,3);sessionStorage.setItem(u.k0,JSON.stringify(t)),x(t)}catch(e){console.error("Failed to fetch discover videos:",e)}finally{h(!1)}})()},[]),m)?(0,l.jsxs)("div",{children:[(0,l.jsx)(o.X3,{title:a("section-discover-picks")}),(0,l.jsx)("div",{className:"flex xl:grid xl:grid-cols-3 gap-3 xl:gap-4",children:[1,2,3].map(e=>(0,l.jsxs)("div",{className:"glass-card rounded-xl overflow-hidden min-w-[180px] xl:min-w-0 animate-pulse",children:[(0,l.jsx)("div",{className:"aspect-video w-full skeleton"}),(0,l.jsxs)("div",{className:"p-2.5 xl:p-3",children:[(0,l.jsx)("div",{className:"h-4 skeleton rounded w-3/4 mb-2"}),(0,l.jsx)("div",{className:"h-3 skeleton rounded w-1/2"})]})]},e))})]}):0===s.length?null:(0,l.jsxs)("div",{children:[(0,l.jsx)(o.X3,{title:a("section-discover-picks")}),(0,l.jsx)("div",{className:"flex xl:grid xl:grid-cols-3 gap-3 xl:gap-4 overflow-x-auto xl:overflow-x-visible pb-2 xl:pb-0 scrollbar-hide snap-x snap-mandatory xl:snap-none -mx-4 xl:mx-0 px-4 xl:px-0",children:s.map(e=>(0,l.jsxs)(n(),{href:"/".concat(t,"/discover?v=").concat(e.videoId),className:"glass-card rounded-xl overflow-hidden flex flex-col min-w-[180px] xl:min-w-0 snap-center active:ring-1 active:ring-white/20 [@media(hover:hover)_and_(pointer:fine)]:hover:ring-1 [@media(hover:hover)_and_(pointer:fine)]:hover:ring-white/20 transition-all",children:[(0,l.jsx)("div",{className:"aspect-video w-full bg-neutral-700 overflow-hidden",children:e.thumbnail&&(0,l.jsx)("img",{src:e.thumbnail,alt:e.title,className:"w-full h-full object-cover"})}),(0,l.jsx)("div",{className:"p-2.5 xl:p-3 flex flex-col flex-1",children:(0,l.jsx)("div",{className:"text-[12px] xl:text-[14px] text-neutral-200 line-clamp-2 font-medium",children:e.title})})]},e.videoId))})]})}},45140:(e,t,a)=>{a.d(t,{TopicsSection:()=>d});var l=a(95155),s=a(20063),n=a(12115),r=a(87144),i=a(52714),c=a(81744);let o=[{key:"tab-today",period:"daily"},{key:"tab-weekly",period:"weekly"},{key:"tab-monthly",period:"monthly"},{key:"tab-quarterly",period:"quarterly"}];
1function d(){let{onTopicClick:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,s.useParams)(),a=(null==t?void 0:t.lng)||"en",{t:d}=(0,c.B)(a,"left-sidebar"),u=o.map(e=>({label:d(e.key),period:e.period})),[x,m]=(0,n.useState)(0),[h,p]=(0,n.useState)([]),[b,v]=(0,n.useState)(!0),[f,g]=(0,n.useState)(null),j=(0,n.useCallback)(async e=>{v(!0),g(null);try{let t=o[e].period,a=await (0,r.Ou)(t);p(a.data.topics.slice(0,20))}catch(e){console.error("Failed to fetch news topics:",e),g("Failed to load topics"),p([])}finally{v(!1)}},[]);return(0,n.useEffect)(()=>{j(x)},[x,j]),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl xl:text-2xl font-bold text-neutral-100 mb-4 xl:mb-5",children:d("section-topics")}),(0,l.jsx)("div",{className:"flex gap-2 mb-4 xl:mb-5 overflow-x-auto pb-2 scrollbar-hide",children:u.map((e,t)=>(0,l.jsx)("button",{onClick:()=>{t!==x&&m(t)},className:"px-4 xl:px-5 py-2 xl:py-2.5 rounded-full text-sm xl:text-base font-medium whitespace-nowrap transition-all ".concat(x===t?"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20":"glass-card text-neutral-400 active:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15"),children:e.label},e.period))}),b&&(0,l.jsx)("div",{className:"flex flex-col gap-3 xl:gap-4",children:Array.from({length:4}).map((e,t)=>(0,l.jsx)("div",{className:"animate-pulse skeleton-card rounded-2xl px-5 xl:px-6 py-4 xl:py-5",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("div",{className:"h-5 w-32 skeleton rounded"}),(0,l.jsx)("div",{className:"h-4 w-20 skeleton rounded"})]})},t))}),f&&!b&&(0,l.jsxs)("div",{className:"text-center py-8 text-neutral-400",children:[f,(0,l.jsx)("button",{onClick:()=>j(x),className:"ml-2 text-neutral-100 underline",children:d("btn-retry")})]}),!b&&!f&&0===h.length&&(0,l.jsx)("div",{className:"text-center py-8 text-neutral-400",children:"No topics found"}),!b&&!f&&h.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-3 xl:gap-4 ".concat(h.length>6?"xl:max-h-[600px] xl:overflow-y-auto xl:pr-1 xl:scrollbar-thin xl:scrollbar-thumb-neutral-600 xl:scrollbar-track-neutral-800":""),children:h.map((t,a)=>(0,l.jsx)(i.lP,{title:t.name,articleCount:t.count,onClick:()=>null==e?void 0:e(t.name)},"".concat(t.name,"-").concat(a)))})]})}},47290:(e,t,a)=>{a.d(t,{GlobalIndicesSection:()=>d});var l=a(95155),s=a(20063);a(12115);var n=a(75641),r=a(81744),i=a(58327),c=a(36114);let o=[{symbol:"SPY",name:"S&P 500"},{symbol:"QQQ",name:"Nasdaq"},{symbol:"DIA",name:"Dow Jones"}];function d(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,r.B)(t,"left-sidebar"),d=o.map(e=>e.symbol),u=(0,i.pu)(),{prices:x,isLoading:m}=(0,n.z)(d,{enabled:u});return(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100 mb-4 xl:mb-5",children:a("section-global-indices")}),(0,l.jsx)("div",{className:"flex flex-col gap-1 xl:gap-2 glass-card rounded-xl p-4 xl:p-6",children:m?(0,l.jsx)(l.Fragment,{children:[1,2,3].map(e=>(0,l.jsxs)("div",{className:"flex items-center justify-between py-3 xl:py-4 animate-pulse",children:[(0,l.jsx)("div",{className:"h-5 skeleton rounded w-24"}),(0,l.jsx)("div",{className:"h-5 skeleton rounded w-16"})]},e))}):o.map(e=>{var t;let a=x.get(e.symbol.toUpperCase()),s=!!a&&a.price>0,n=null!=(t=null==a?void 0:a.prevClose)?t:0,r=s&&n>0?(a.price-n)/n*100:0,i=r>=0,o=s&&n>0?(0,c.l9)(r):"--";return(0,l.jsxs)("div",{className:"flex items-center justify-between py-3 xl:py-4",children:[(0,l.jsx)("span",{className:"text-lg xl:text-xl font-medium text-neutral-200",children:e.name}),(0,l.jsx)("span",{className:"text-lg xl:text-xl font-bold ".concat(s?i?"text-green-500":"text-red-500":"text-neutral-400"),children:o})]},e.symbol)})})]})}},48536:(e,t,a)=>{a.d(t,{UpNextSection:()=>r});var l=a(95155),s=a(12115),n=a(52714);function r(e){let{className:t="",videos:a=[],currentIndex:r=0,onVideoSelect:i,loop:c=!1,onLoadMore:o,isLoadingMore:d=!1,hasMore:u=!1}=e,x=(0,s.useRef)(null),m=(0,s.useRef)(null),h=(0,s.useRef)(!1),[p,b]=(0,s.useState)(!1),[v,f]=(0,s.use
1State)(null),g=Math.floor(2.5);(0,s.useEffect)(()=>{if(!c||0===a.length){f(!1),b(!0);return}f(null),b(!1)},[c,a]),(0,s.useEffect)(()=>{if(null!==v||!c||0===a.length)return;let e=x.current;if(!e)return;let t=setTimeout(()=>{let t=e.scrollHeight>e.clientHeight;f(t),t||b(!0)},100);return()=>clearTimeout(t)},[v,c,a]),(0,s.useEffect)(()=>{if(!0!==v||0===a.length)return;let e=x.current;if(!e)return;h.current=!0;let t=setTimeout(()=>{let t=e.scrollHeight/5;e.scrollTop=t*g,setTimeout(()=>{h.current=!1,b(!0)},300)},150);return()=>clearTimeout(t)},[v,a,5,g]);let j=(0,s.useCallback)(()=>{if(!0!==v||!p||h.current||0===a.length)return;let e=x.current;if(!e)return;let{scrollTop:t,scrollHeight:l}=e,s=l/5;if(t>=4*s){h.current=!0;let a=t-s*g;e.scrollTop=s*g+a%s,setTimeout(()=>{h.current=!1},300);return}if(t<+s){h.current=!0,e.scrollTop=t+s*g,setTimeout(()=>{h.current=!1},300);return}},[v,p,a.length,5,g]),y=(0,s.useCallback)(()=>{let e=x.current;if(e){if(u&&!d&&o){let{scrollTop:t,scrollHeight:a,clientHeight:l}=e;t+l>=a-100&&o()}!0===v&&p&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{j()},150))}},[v,p,j,u,d,o]);(0,s.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let N=!0===v&&a.length>0?[,,,,,].fill(a).flat():a;return(0,l.jsxs)("div",{className:"bg-black rounded-2xl p-4 xl:p-6 h-full flex flex-col ".concat(t),children:[(0,l.jsx)("h2",{className:"text-xl xl:text-2xl font-bold text-white mb-4 shrink-0",children:"Up Next"}),(0,l.jsxs)("div",{ref:x,className:"flex flex-col gap-3 flex-1 overflow-y-auto scrollbar-hide",onScroll:y,children:[N.map((e,t)=>{let s=!0===v?t%a.length:t;return(0,l.jsx)(n.af,{title:e.title,description:e.description,thumbnailUrl:e.thumbnail,isActive:s===r,onClick:()=>null==i?void 0:i(s)},"".concat(e.videoId,"-").concat(t))}),d&&(0,l.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,l.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"})})]})]})}},49206:(e,t,a)=>{a.d(t,{WatchlistNewsSection:()=>p});var l=a(95155),s=a(20063),n=a(12115),r=a(52714),i=a(19980),c=a(79369),o=a(81744),d=a(73572),u=a(84639),x=a(81594),m=a(36114),h=a(98832);function p(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en-US",{t:a}=(0,o.B)(t,"left-sidebar"),p=(0,u.j)(),b=(0,n.useRef)(null),{user:v,isLoading:f}=(0,i.A)(),{watchlistedTickers:g,isWatchlistInitialized:j,isWatchlistLoading:y}=(0,u.G)(e=>e.user),N=(0,n.useMemo)(()=>Object.keys(g||{}
1),[g]),[w,k]=(0,n.useState)(null),[S,A]=(0,n.useState)(null);(0,n.useEffect)(()=>{(null==v?void 0:v.sub)&&!j&&!y&&p((0,x.D7)(v.sub))},[null==v?void 0:v.sub,j,y,p]);let C=(0,n.useMemo)(()=>!!v&&j&&N.length>0,[v,j,N.length]),{data:P,isLoading:M,error:E,fetchNextPage:_,hasNextPage:D,isFetchingNextPage:T}=(0,c.i2)({tickers:N,pageSize:20,enabled:C}),z=(0,n.useMemo)(()=>(0,c.KP)(null==P?void 0:P.pages),[P]),R=(0,n.useCallback)(()=>{T||M||!D||_()},[T,M,D,_]),K=(0,n.useCallback)(()=>{let e=b.current;if(!e)return;let{scrollTop:t,scrollHeight:a,clientHeight:l}=e;a-t-l<100&&R()},[R]);(0,n.useEffect)(()=>{let e=b.current;if(e)return e.addEventListener("scroll",K),()=>e.removeEventListener("scroll",K)},[K]);let L=(0,n.useMemo)(()=>z.map(e=>{let{title:a,text:l}=(0,d.$)(e,t);return{news_id:e.news_id,title:a,description:l,source:e.source_name||"Unknown",publishedDate:e.published_time?(0,m.Pf)(e.published_time,t):"",stockSymbol:e.tickers&&e.tickers.length>0?e.tickers[0]:void 0,stockChange:void 0,isPositive:"Positive"===e.sentiment,imageUrl:e.image_url,url:e.news_url,sentiment:e.sentiment,rankScore:e.rank_score,topics:e.topics,tickers:e.tickers}}),[z,t]),I=(0,n.useMemo)(()=>w&&S?L.filter(e=>{var t,a;return"ticker"===S?null==(t=e.tickers)?void 0:t.includes(w):"topic"!==S||(null==(a=e.topics)?void 0:a.includes(w))}):L,[L,w,S]),O=(0,n.useCallback)(e=>{k(e),A("ticker")},[]),U=(0,n.useCallback)(e=>{k(e),A("topic")},[]),F=(0,n.useCallback)(()=>{k(null),A(null)},[]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.X3,{title:a("section-watchlist-news"),showViewAll:!1}),(0,l.jsxs)("div",{className:"flex gap-1 xl:gap-2 overflow-x-auto xl:overflow-x-visible pb-1 xl:pb-0 scrollbar-hide -mx-4 xl:mx-0 px-4 xl:px-0 xl:flex-wrap mb-4",children:[(0,l.jsx)("button",{onClick:F,className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(w?"glass-card text-neutral-400 active:bg-white/15 active:text-neutral-300 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:text-neutral-300":"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20"),children:a("tab-all-watchlist")}),w&&(0,l.jsxs)("button",{onMouseLeave:F,className:"px-3 xl:px-4 py-1.5 xl:py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors flex items-center gap-1.5 bg-purple-600 text-white",children:["ticker"===S?"$".concat(w):w,(0,l.jsx)("span",{onClick:e=>{e.stopPropagation(),F()},className:"ml-1 active:text-white [@media(hover:hover)_and_(pointer:fine)]:hover:text-white cursor-pointer",children:"\xd7"})]})]}),f||v&&!j||y?(0,l.jsx)(h.tn,{}):v?0===N.length?(0,l.jsxs)("div",{className:"text-center py-8",children:[(0,l.jsx)("p",{className:"text-neutral-400 mb-2",children:a("empty-watchlist")||"Your watchlist is empty"}),(0,l.jsx)("p",{className:"text-neutral-500 text-sm",children:a("add-stocks-to-watchlist")||"Add stocks to your watchlist to see relevant news here"})]}):M&&0===z.length?(0,l.jsx)(h.tn,{}):E?(0,l.jsxs)("div",{className:"text-red-500 text-center p-4",children:["Error loading news: ",E.message]}):0===L.length?(0,l.jsx)("div",{className:"text-neutral-400 text-center p-4",children:a("no-watchlist-news")||"No news found for your watchlist"}):(0,l.jsxs)(l.Fragment,{children:[a("news-translation-disclaimer")&&(0,l.jsx)("p",{className:"text-[10px] xl:text-xs text-neutral-500 mb-2",children:a("news-translation-disclaimer")}),(0,l.jsx)("div",{ref:b,className:"max-h-[600px] overflow-y-auto scrollbar-auto-hide",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3 pr-2",children:[I.map(e=>(0,l.jsx)(r.Qc,{...e,onTopicClick:U,onTickerClick:O},e.news_id)),w&&0===I.length&&(0,l.jsx)("div",{className:"text-neutral-400 text-center p-4",children:"ticker"===S?"No news found for ".concat(w):'No news found for topic "'.concat(w,'"')}),!w&&T&&(0,l.jsx)("div",{className:"py-4",children:(0,l.jsx)(h.tn,{})}),!w&&!D&&I.length>0&&(0,l.jsx)("div",{className:"text-neutral-500 text-center py-4 text-sm",children:a("no-more-news")})]})})]}):(0,l.jsxs)("div",{className:"text-center py-8",children:[(0,l.jsx)("p",{className:"text-neutral-400 mb-2",children:a("login-to-see-watchlist-news")||"Log in to see news for your watchlist"}),(0,l.jsx)("p",{className:"text-neutral-500 text-sm",children:a("watchlist-news-description")||"Get personalized news based on the stocks you follow"})]})]})}},62332:(e,t,a)=>{a.d(t,{Dg:()=>r,Zx:()=>s.Z,Xu:()=>p,z6:()=>b.z}),a(19980);var l=a(12115);a(52232);var s=a(29581),n=a(16635);function r(e,t){return(0,n.Br)(e,t)}var i=a(32432),c=a(84769);let o=null,d=!1,u=new Map,x=null,m=new Map;
1function h(e){let t=c.yf.utc(e).tz("America/New_York"),a=60*t.hour()+t.minute();return a>=570&&a<960}function p(e){let[t,a]=(0,l.useState)({open:null,high:null,low:null,volume:null}),[s,n]=(0,l.useState)(!0),r=(0,l.useRef)(new Map),c=(0,l.useCallback)(()=>{let e=Array.from(r.current.values());if(0===e.length)return;let t=e.filter(e=>h(e.timestamp)).sort((e,t)=>e.timestamp-t.timestamp);if(0===t.length)return;let l=t[0].open,s=Math.max(...t.map(e=>e.high));a({open:l,high:s,low:Math.min(...t.map(e=>e.low)),volume:t.reduce((e,t)=>e+t.volume,0)}),n(!1)},[]),p=(0,l.useCallback)(e=>{if(!h(e.timestamp))return;let t=6e4*Math.floor(e.timestamp/6e4);r.current.set(t,e),c()},[c]);return(0,l.useEffect)(()=>{if(!e){r.current.clear(),a({open:null,high:null,low:null,volume:null}),n(!1);return}r.current.clear(),a({open:null,high:null,low:null,volume:null}),n(!0);let t=e.toUpperCase();m.has(t)||m.set(t,new Set),m.get(t).add(p),function e(){if((null==o?void 0:o.readyState)!==WebSocket.OPEN&&!d){d=!0;try{let t=(0,i.getBackendUrl)().replace(/^http:/,"ws:").replace(/^https:/,"wss:");(o=new WebSocket("".concat(t,"/ws/intraday"))).onopen=()=>{d=!1,console.log("[useIntradayData] WebSocket connected"),function(){if(!o||o.readyState!==WebSocket.OPEN)return;let e=Array.from(u.keys()),t=[...new Set([...e,...Array.from(m.keys())])];0!==t.length&&o.send(JSON.stringify({action:"subscribe",tickers:t}))}()},o.onmessage=e=>{!function(e){try{let n=JSON.parse(e);if("minute_bar"===n.type&&n.ticker&&void 0!==n.close){let e=n.ticker.toUpperCase(),r=n.timestamp?new Date(n.timestamp).getTime():Date.now(),i=u.get(e);if(i&&i.size>0){let e={close:n.close,timestamp:r};i.forEach(t=>t(e))}let c=m.get(e);if(c&&c.size>0){var t,a,l,s;let e={timestamp:r,open:null!=(t=n.open)?t:n.close,high:null!=(a=n.high)?a:n.close,low:null!=(l=n.low)?l:n.close,close:n.close,volume:null!=(s=n.volume)?s:0};c.forEach(t=>t(e))}}}catch(e){}}(e.data)},o.onclose=()=>{d=!1,console.log("[useIntradayData] WebSocket closed"),(u.size>0||m.size>0)&&!x&&(x=setTimeout(()=>{x=null,e()},5e3))},o.onerror=()=>{d=!1}}catch(e){d=!1}}}(),(null==o?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({action:"subscribe",tickers:[t]}));let l=setTimeout(()=>{n(!1)},3e3);return()=>{clearTimeout(l);let t=e.toUpperCase(),a=m.get(t);a&&(a.delete(p),0===a.size&&(m.delete(t),u.has(t)||(null==o?void 0:o.readyState)!==WebSocket.OPEN||o.send(JSON.stringify({action:"unsubscribe",tickers:[t]}))))}},[e,p]),{ohlv:t,isLoading:s}}a(58327),a(87200);var b=a(75641)},62884:(e,t,a)=>{a.d(t,{TickerCalendarSection:()=>x});var l=a(95155),s=a(20063),n=a(12115),r=a(94607),i=a(52714),c=a(81744),o=a(84769),d=a(28015),u=a(98832);function x(e){var t,a;let{symbol:d}=e,x=(0,s.useParams)(),b=(null==x?void 0:x.lng)||"en",{t:v}=(0,c.B)(b,"left-sidebar"),f=[{key:"all",label:v("tab-all")},{key:"earnings",label:v("tab-earnings")},{key:"dividends",label:v("tab-dividends")},{key:"splits",label:v("tab-stock-split")}],[g,j]=(0,n.useState)("all"),[y,N]=(0,n.useState)(!0),[w,k]=(0,n.useState)(null),[S,A]=(0,n.use
1State)([]),[C,P]=(0,n.useState)([]),[M,E]=(0,n.useState)([]);(0,n.useEffect)(()=>{let e=async()=>{N(!0),k(null);try{let e=new Date,t=new Date(e);t.setMonth(e.getMonth()-6);let a=new Date(e);a.setMonth(e.getMonth()+3);let l=e=>e.toISOString().split("T")[0],s=d.toUpperCase(),[n,i,c]=await Promise.all([(0,r.AE)({startDate:l(t),endDate:l(a),symbol:s}),(0,r.BF)({symbol:s}),(0,r.Ql)({symbol:s})]);A(n.data.earnings),P(i.data.dividends),E(c.data.splits)}catch(e){console.error("Failed to fetch calendar data:",e),k(v("calendar-load-failed"))}finally{N(!1)}};d&&e()},[d]);let _=n.useMemo(()=>{let e=[];return S.forEach(t=>{e.push({type:"earnings",date:t.report_date,data:t})}),C.forEach(t=>{e.push({type:"dividends",date:t.ex_date,data:t})}),M.forEach(t=>{e.push({type:"splits",date:t.date,data:t})}),e.sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())},[S,C,M]),D=n.useMemo(()=>"all"===g?_:_.filter(e=>e.type===g),[_,g]);return y?(0,l.jsxs)("div",{className:"mt-8",children:[(0,l.jsx)(i.X3,{title:"".concat(d," ").concat(v("section-calendar"))}),(0,l.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,l.jsx)(u.Zp,{children:(0,l.jsx)(u.tn,{})},e))})]}):w?(0,l.jsxs)("div",{className:"mt-8",children:[(0,l.jsx)(i.X3,{title:"".concat(d," ").concat(v("section-calendar"))}),(0,l.jsx)(u.Zp,{className:"text-center py-6",children:(0,l.jsx)("p",{className:"text-neutral-400",children:w})})]}):(0,l.jsxs)("div",{className:"mt-8",children:[(0,l.jsx)(i.X3,{title:"".concat(d," ").concat(v("section-calendar"))}),(0,l.jsx)(i.dJ,{tabs:f.map(e=>e.label),activeTab:(null==(t=f.find(e=>e.key===g))?void 0:t.label)||f[0].label,onTabChange:e=>{let t=f.find(t=>t.label===e);t&&j(t.key)},className:"mb-4"}),(0,l.jsx)("div",{className:"space-y-3 max-h-[500px] overflow-y-auto scrollbar-hide md:scrollbar-auto-hide md:pr-1",children:D.length>0?D.map((e,t)=>((e,t)=>{let{type:a,date:s,data:n}=e,r={earnings:v("tab-earnings"),dividends:v("calendar-dividend"),splits:v("tab-stock-split")};return(0,l.jsx)(u.Zp,{className:"active:bg-neutral-750 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-neutral-750 transition-colors",children:(0,l.jsx)("div",{className:"flex items-start justify-between gap-4",children:(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded border ".concat({earnings:"bg-blue-500/20 text-blue-400 border-blue-500/30",dividends:"bg-green-500/20 text-green-400 border-green-500/30",splits:"bg-purple-500/20 text-purple-400 border-purple-500/30"}[a]),children:r[a]}),(0,l.jsx)("span",{className:"text-xs text-neutral-400",children:(0,o.yf)(s).format("MMM D, YYYY")})]}),"earnings"===a&&(0,l.jsx)(m,{data:n,t:v}),"dividends"===a&&(0,l.jsx)(h,{data:n,t:v}),"splits"===a&&(0,l.jsx)(p,{data:n,t:v})]})})},"".concat(a,"-").concat(t))})(e,t)):(0,l.jsx)(u.Zp,{className:"text-center py-6",children:(0,l.jsx)("p",{className:"text-neutral-400",children:"all"===g?v("calendar-no-events",{symbol:d}):v("calendar-no-type-events",{symbol:d,type:(null==(a=f.find(e=>e.key===g))?void 0:a.label)||g})})})})]})}function m(e){let{data:t,t:a}=e,s=o.yf.tz(t.report_date,"America/New_York").endOf("day").isBefore((0,o.yf)().tz("America/New_York")),n="number"==typeof t.eps_actual,r=null!=t.eps_actual&&null!=t.eps_estimate&&t.eps_actual>=t.eps_estimate;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-200 font-medium",children:t.name}),t.report_time&&"time-not-supplied"!==t.report_time&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium ".concat("post-market"===t.report_time?"bg-indigo-500/20 text-indigo-300":"bg-amber-500/20 text-amber-300"),children:a("pre-market"===t.report_time?"calendar-pre-market":"calendar-after-close")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs",children:["number"==typeof t.eps_estimate&&(0,l.jsxs)("span",{className:"text-neutral-400",children:[a("calendar-eps-est"),":"," ",(0,l.jsxs)("span",{className:"text-neutral-300",children:["$",(0,d.ZV)(t.eps_estimate)]})]}),n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{className:"text-neutral-400",children:[a("calendar-eps-actual"),":"," ",(0,l.jsxs)("span",{className:r?"text-green-400":"text-red-400",children:["$",(0,d.ZV)(t.eps_actual)]})]}),"number"==typeof t.eps_estimate&&(0,l.jsxs)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium ".concat(r?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"),children:[r?"▲ ".concat(a("c
1alendar-eps-beat")):"▼ ".concat(a("calendar-eps-miss")),"number"==typeof t.eps_surprise&&(0,l.jsxs)("span",{className:"ml-1",children:[t.eps_surprise>=0?"+":"",t.eps_surprise.toFixed(1),"%"]})]})]}):s?(0,l.jsxs)("span",{className:"text-neutral-500 italic",children:[a("calendar-eps-actual"),": ",a("calendar-pending")]}):(0,l.jsx)("span",{className:"text-neutral-500",children:a("calendar-status-upcoming")})]})]})}function h(e){let{data:t,t:a}=e,s=e=>e?(0,o.yf)(e).format("MMM D"):"--";return(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsxs)("p",{className:"text-sm text-neutral-200 font-medium",children:[a("calendar-dividend"),":"," ",(0,l.jsxs)("span",{className:"text-green-400",children:["$","number"==typeof t.amount?t.amount.toFixed(4):"--"]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-neutral-400",children:[(0,l.jsxs)("span",{children:[a("calendar-ex-date"),":"," ",(0,l.jsx)("span",{className:"text-neutral-300",children:s(t.ex_date)})]}),t.payment_date&&(0,l.jsxs)("span",{children:[a("calendar-payment"),":"," ",(0,l.jsx)("span",{className:"text-neutral-300",children:s(t.payment_date)})]}),t.record_date&&(0,l.jsxs)("span",{children:[a("calendar-record"),":"," ",(0,l.jsx)("span",{className:"text-neutral-300",children:s(t.record_date)})]})]})]})}function p(e){var t,a;let{data:s,t:n}=e;return(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-200 font-medium",children:s.description}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-neutral-400",children:[(0,l.jsxs)("span",{children:[n("calendar-ratio"),":"," ",(0,l.jsxs)("span",{className:"text-neutral-300",children:[null!=(t=s.to_factor)?t:"--",":",null!=(a=s.from_factor)?a:"--"]})]}),(0,l.jsxs)("span",{children:[n("calendar-exchange"),":"," ",(0,l.jsx)("span",{className:"text-neutral-300",children:s.exchange||"--"})]})]})]})}},67341:(e,t,a)=>{a.d(t,{WatchlistSection:()=>h});var l=a(95155),s=a(19980),n=a(52619),r=a.n(n),i=a(20063),c=a(12115),o=a(4590),d=a(52714),u=a(75641),x=a(81744),m=a(58327);function h(){let{user:e}=(0,s.A)(),t=(0,i.useParams)(),a=(null==t?void 0:t.lng)||"en",{t:n}=(0,x.B)(a,"left-sidebar"),h=(0,c.useMemo)(()=>[n("tab-all"),n("tab-gainers"),n("tab-losers")],[n]),[p,b]=(0,c.useState)(null),[v,f]=(0,c.useState)([]),[g,j]=(0,c.useState)(!1),[y,N]=(0,c.useState)(null);(0,c.useEffect)(()=>{null===p&&h.length>0&&b(h[0])},[p,h]),(0,c.useEffect)(()=>{(null==e?void 0:e.sub)&&w(e.sub)},[null==e?void 0:e.sub]);let w=async e=>{j(!0),N(null);try{var t;let a=await (0,o.ED)(e);f(null!=(t=a.data)?t:[])}catch(e){N("Failed to load watchlists"),console.error("Failed to fetch watchlists:",e)}finally{j(!1)}},k=(0,c.useMemo)(()=>{let e=new Set;return v.forEach(t=>{t.companies.forEach(t=>{e.add(t.toUpperCase())})}),Array.from(e)},[v]),S=(0,m.pu)(),{prices:A,isLoading:C}=(0,u.z)(k,{enabled:S}),{allStocks:P,gainers:M,losers:E}=(0,c.useMemo)(()=>{let e=k.map(e=>{let t=A.get(e),a=0;return t&&t.prevClose>0&&(a=(t.price-t.prevClose)/t.prevClose*100),{ticker:e,changePercent:a,hasData:!!t}}),t=[...e].sort((e,t)=>e.hasData&&!t.hasData?-1:!e.hasData&&t.hasData?1:Math.abs(t.changePercent)-Math.abs(e.changePercent)).slice(0,5);return{allStocks:t,gainers:e.filter(e=>e.hasData&&e.changePercent>0).sort((e,t)=>t.changePercent-e.changePercent).slice(0,5),losers:e.filter(e=>e.hasData&&e.changePercent<0).sort((e,t)=>e.changePercent-t.changePercent).slice(0,5)}},[k,A]),_=null!=p?p:h[0],D=_===h[0],T=_===h[1],z=D?P:T?M:E,R=0===k.length;return(0,l.jsxs)("div",{children:[(0,l.jsx)(d.X3,{title:n("watchlist"),showDataSource:!0}),(0,l.jsx)(d.dJ,{tabs:h,activeTab:_,onTabChange:b,className:"mb-3 xl:mb-4"}),g&&(0,l.jsx)("div",{className:"flex justify-center items-center py-6",children:(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-neutral-100"})}),y&&(0,l.jsxs)("div",{className:"text-center py-6 text-neutral-400 text-sm",children:[y,(0,l.jsx)("button",{onClick:()=>(null==e?void 0:e.sub)&&w(e.sub),className:"ml-2 text-neutral-100 underline",children:n("btn-retry")})]}),!g&&!y&&R&&(0,l.jsx)("div",{className:"text-center py-6 text-neutral-400 text-sm",children:e?n("msg-no-stocks"):n("msg-login-required")}),!g&&!y&&!R&&0===z.length&&(0,l.jsx)("div",{className:"text-center py-6 text-neutral-400 text-sm",children:D?C?n("msg-loading-prices"):n("msg-no-stocks"):T?n("msg-no-gainers"):n("msg-no-losers")}),!g&&!y&&z.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-2 xl:gap-3",children:z.map(e=>(0,l.jsx)(r(),{href:"/".concat(a,"/tickers/").concat(e.ticker),className:"block",children:(0,l.jsx)(d.Qg,{symbol:e.ticker,priceData:A.get(e.ticker)})},e.ticker))})]})}},72107:(e,t,a)=>{a.d(t,{DS:()=>s});var l=a(36880);let s=async e=>await (0,l.bE)("/api/account/delete",{},{headers:{"x-user-sub":e}})},75641:(e,t,a)=>{a.d(t,{z:()=>r});var l=a(12115),s=a(46830),n=a(32432);function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{enabled:a=!0}=t,[r,i]=(0,l.useState)(new Map),[c,o]=(0,l.useState)("disconnected"),[d,u]=(0,l.useState)(!0),[x,m]=(0,l.useState)(!1),h=(0,l.useRef)(null),p=(0,l.useRef)(null),b=(0,l.useRef)(null),v=(0,l.useRef)(null),f=(0,l.useRef)(!1),g=(0,l.useRef)(!1),j=(0,l.useRef)(new Map),y=(0,l.useRef)(null),N=(0,l.useRef)(!1),w=e.map(e=>e.toUpperCase()),k=[...w].sort().join(","),S=(0,l.useCallback)(async()=>
1{if(!N.current&&0!==w.length){N.current=!0;try{var e;console.log("[useRealtimePrices] Fetching fallback prices for:",w.length,"tickers");let t=await (0,s.L2)(w),a=null==(e=t.data)?void 0:e.prices;if(a){let e=new Map;for(let[t,l]of Object.entries(a))e.set(t.toUpperCase(),{ticker:t.toUpperCase(),price:l.price,prevClose:l.prevClose,timestamp:l.timestamp});i(e),console.log("[useRealtimePrices] Fallback loaded ".concat(e.size," prices (fresh: ").concat(t.data.freshCount,", stale: ").concat(t.data.staleCount,", unavailable: ").concat(t.data.unavailableCount,")"))}}catch(e){console.warn("[useRealtimePrices] Failed to fetch fallback prices:",e)}finally{u(!1)}}},[w]),A=(0,l.useCallback)(()=>{var e;(null==(e=h.current)?void 0:e.readyState)===WebSocket.OPEN&&h.current.send(JSON.stringify({action:"ping"}))},[]),C=(0,l.useCallback)(()=>{b.current&&clearInterval(b.current),b.current=setInterval(A,3e4)},[A]),P=(0,l.useCallback)(()=>{b.current&&(clearInterval(b.current),b.current=null)},[]),M=(0,l.useCallback)(()=>{var e;(null==(e=h.current)?void 0:e.readyState)===WebSocket.OPEN&&w.length>0&&(console.log("[useRealtimePrices] Subscribing to:",w),h.current.send(JSON.stringify({action:"subscribe",tickers:w})))},[w]),E=(0,l.useCallback)(()=>{if(0===j.current.size)return;let e=j.current;j.current=new Map,i(t=>{let a=new Map(t);for(let[t,l]of e)a.set(t,l);return a})},[]),_=(0,l.useCallback)(e=>{try{let l=JSON.parse(e);switch(l.type){case"quote":if(l.ticker&&void 0!==l.price){let e=l.ticker.toUpperCase();if(w.includes(e)){var t,a;j.current.set(e,{ticker:e,price:l.price,prevClose:null!=(t=l.prevClose)?t:0,timestamp:null!=(a=l.timestamp)?a:new Date().toISOString()}),y.current||(y.current=setTimeout(()=>{y.current=null,E()},50)),u(!1),m(!0),g.current=!0,v.current&&(clearTimeout(v.current),v.current=null)}}break;case"subscribed":console.log("[useRealtimePrices] Subscribed to:",l.tickers);break;case"error":console.error("[useRealtimePrices] Server error:",l.message)}}catch(t){console.warn("[useRealtimePrices] Failed to parse message:",e)}},[w,E]),D=(0,l.useCallback)(()=>{if(f.current||0===w.length)return void u(!1);h.current&&(h.current.close(),h.current=null);try{let e=(0,n.getBackendUrl)();if(!e){console.warn("[useRealtimePrices] Backend URL not configured"),o("error"),u(!1);return}let t=e.replace(/^http:/,"ws:").replace(/^https:/,"wss:");console.log("[useRealtimePrices] Connecting to:","".concat(t,"/ws/quote")),o("connecting");let a=new WebSocket("".concat(t,"/ws/quote"));h.current=a,a.onopen=()=>{if(f.current){console.log("[useRealtimePrices] Connection opened but manual close requested, closing"),a.close();return}console.log("[useRealtimePrices] Connected"),o("connected"),M(),C(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{console.log("[useRealtimePrices] Initial data timeout, no realtime data available"),v.current=null,u(!1),g.current||m(!1)},5e3)},a.onmessage=e=>{f.current||_(e.data)},a.onclose=e=>{console.log("[useRealtimePrices] Disconnected:",e.code,e.reason),o("disconnected"),P(),!f.current&&g.current?(console.log("[useRealtimePrices] Had received realtime data before, will reconnect in 5s"),p.current=setTimeout(()=>{p.current=null,D()},5e3)):f.current||(console.log("[useRealtimePrices] Never received realtime data, not reconnecting (likely market closed)"),u(!1),m(!1))},a.onerror=e=>{f.current||(console.error("[useRealtimePrices] Error:",e),o("error"),v.current&&(clearTimeout(v.current),v.current=null),u(!1),m(!1))}}catch(e){console.error("[useRealtimePrices] Failed to connect:",e),o("error"),u(!1),m(!1)}},[w,M,C,P,_]),T=(0,l.useCallback)(()=>{f.current=!0,p.current&&(clearTimeout(p.current),p.current=null),v.current&&(clearTimeout(v.current),v.current=null),y.current&&(clearTimeout(y.current),y.current=null),j.current.clear(),P(),h.current&&(h.current.close(),h.current=null),o("disconnected"),m(!1)},[P]);return(0,l.useEffect)(()=>{if(!a){console.log("[useRealtimePrices] Market closed, not connecting WebSocket"),T(),o("market_closed"),m(!1),N.current=!1,S();return}return f.current=!1,g.current=!1,N.current=!1,i(new Map),u(!0),m(!1),D(),()=>{T()}},[k,a]),{prices:r,status:c,isLoading:d,isLive:x}}},88530:(e,t,a)=>{a.d(t,{SectorPerformanceSection:()=>o});var l=a(95155),s=a(20063),n=a(12115),r=a(52232),i=a(52714),c=a(81744);function o(){let e=(0,s.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,c.B)(t,"left-sidebar"),{t:o}=(0,c.B)(t,"industries"),{t:d}
1=(0,c.B)(t,"common"),[u,x]=(0,n.useState)([]),[m,h]=(0,n.useState)(!0),[p,b]=(0,n.useState)(null);return((0,n.useEffect)(()=>{(async()=>{try{h(!0);let e=await (0,r.fw)();x(e.data.industries.slice(0,7)),b(null)}catch(e){b(d("error.load-industries-failed")),console.error("Failed to fetch industry heatmap:",e)}finally{h(!1)}})()},[]),m)?(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100 mb-4 xl:mb-5",children:a("section-sector-performance")}),(0,l.jsx)("div",{className:"flex flex-col gap-1 xl:gap-2 border border-neutral-800 rounded-xl p-4 xl:p-6",children:[...Array(7)].map((e,t)=>(0,l.jsx)("div",{className:"h-10 skeleton rounded animate-pulse"},t))})]}):p?(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100 mb-4 xl:mb-5",children:a("section-sector-performance")}),(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:p})]}):0===u.length?(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100 mb-4 xl:mb-5",children:a("section-sector-performance")}),(0,l.jsx)("div",{className:"flex flex-col gap-1 xl:gap-2 border border-neutral-800 rounded-xl p-4 xl:p-6",children:(0,l.jsx)("div",{className:"text-neutral-400 text-sm",children:d("empty.no-industry-data")})})]}):(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl xl:text-3xl font-bold text-neutral-100 mb-4 xl:mb-5",children:a("section-sector-performance")}),(0,l.jsx)("div",{className:"flex flex-col gap-1 xl:gap-2 border border-neutral-800 rounded-xl p-4 xl:p-6",children:u.map(e=>(0,l.jsx)(i.kn,{name:(e=>{let t=o(e.slug);return t!==e.slug?t:e.slug})(e),change:"--"},e.id))})]})}},88552:(e,t,a)=>{a.d(t,{MacroEconomySection:()=>v});var l=a(95155),s=a(20063),n=a(12115),r=a(94044),i=a(52714),c=a(81744),o=a(36114),d=a(98832);let u={GDPC1:"GDP",UNRATE:"UNRATE",PAYEMS:"PAYEMS",CPIAUCSL:"CPI",CPILFESL:"CORE_CPI",PCEPI:"PCE",PCEPILFE:"CORE_PCE",FEDFUNDS:"FEDFUNDS",ICSA:"ICSA",T10Y2Y:"T10Y2Y",SAHMREALTIME:"SAHM"};function x(e){let{title:t,subtitle:a,period:s,value:n,unit:r,change:c,changeType:o="neutral",indicatorKey:u,lng:x="en"}=e;return(0,l.jsxs)(d.Zp,{className:"flex flex-col",children:[(0,l.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h3",{className:"text-sm xl:text-base font-bold text-neutral-100 mb-1",children:t}),(0,l.jsx)("p",{className:"text-xs xl:text-sm text-neutral-400",children:a}),(0,l.jsx)("p",{className:"text-[10px] xl:text-xs text-neutral-500 mt-1",children:s})]})}),(0,l.jsxs)("div",{className:"flex items-baseline gap-2 mb-2",children:[(0,l.jsx)("span",{className:"text-2xl xl:text-3xl font-bold text-neutral-100",children:n}),r&&(0,l.jsx)("span",{className:"text-sm xl:text-base text-neutral-400",children:r})]}),c&&(0,l.jsx)("p",{className:"text-xs xl:text-sm ".concat("positive"===o?"text-green-400":"negative"===o?"text-red-400":"text-neutral-400"),children:c}),u&&(0,l.jsx)("div",{className:"mt-3 pt-3 border-t border-neutral-700/50",children:(0,l.jsx)(i.A,{indicatorKey:u,lng:x})})]})}function m(e){let{overallRisk:t,riskScore:a,sahmStatus:s,sahmValue:n,yieldStatus:r,yieldValue:c,t:u,lng:x}=e,m="LOW"===t?"bg-green-400/10":"MODERATE"===t?"bg-yellow-400/10":"HIGH"===t?"bg-orange-400/10":"bg-red-400/10",h=e=>"SAFE"===e?"text-green-400":"WARNING"===e?"text-yellow-400":"text-red-400";return(0,l.jsxs)(d.Zp,{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,l.jsx)("div",{className:"px-3 py-1.5 rounded-full ".concat(m," ").concat("LOW"===t?"text-green-400":"MODERATE"===t?"text-yellow-400":"HIGH"===t?"text-orange-400":"text-red-400"," text-sm font-bold"),children:t}),(0,l.jsxs)("span",{className:"text-neutral-400 text-sm",children:[u("recession.risk-score"),": ",a]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("span",{className:"text-neutral-300 text-sm",children:u("recession.sahm-rule")}),(0,l.jsxs)("span",{className:"text-sm font-medium ".concat(h(s)),children:[(0,o.ZV)(n)," (",s,")"]})]}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(i.A,{indicatorKey:"SAHM",lng:x})})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("span",{className:"text-neutral-300 text-sm",children:u("recession.yield-spread")}),(0,l.jsxs)("span",{className:"text-sm font-medium ".concat(h(r)),children:[(0,o.ZV)(c),"% (",r,")"]})]}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(i.A,{indicatorKey:"T10Y2Y",lng:x})})]})]})]})}function h(e){let{date:t,spread:a,isInverted:s,shape:n,curve:r,t:i}=e,c=["3M","2Y","5Y","10Y","30Y"],u=r.filter(e=>c.includes(e.tenor));return(0,l.jsxs)(d.Zp,{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm xl:text-base font-bold text-neutral-100",children:i("yield-curve.title")}),(0,l.jsx)("p",{className:"text-xs text-neutral-500",children:t})]}),(0,l.jsx)("div",{className:"px-2 py-1 rounded text-xs font-medium ".concat(s?"bg-red-400/10 text-red-400":"bg-green-400/10 text-green-400"),children:n})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsxs)("span",{className:"text-neutral-400 text-sm",children:[i("yield-curve.spread-label"),":"," "]}),(0,l.jsxs)("span",{className:"font-bold ".concat(a>=0?"text-green-400":"text-red-400"),children:[(0,o.ZV)(a),"%"]})]}
1),(0,l.jsx)("div",{className:"grid grid-cols-5 gap-2",children:u.map(e=>(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"text-xs text-neutral-500 mb-1",children:e.tenor}),(0,l.jsxs)("div",{className:"text-sm font-medium text-neutral-100",children:[e.yield,"%"]}),(0,l.jsx)("div",{className:"text-xs ".concat(parseFloat(String(e.change))>=0?"text-green-400":"text-red-400"),children:(0,o.x1)(e.change)})]},e.tenor))})]})}function p(e){let{title:t}=e;return(0,l.jsx)("h2",{className:"text-lg xl:text-xl font-bold text-neutral-100 mb-3 xl:mb-4 border-l-4 border-amber-500 pl-3",children:t})}function b(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=arguments.length>2?arguments[2]:void 0,l=t?e.primary:e.secondary;if(!l||!l.seriesId)return null;let s=l.change,n=s>0?"positive":s<0?"negative":"neutral",r="absolute"===l.changeType?(0,o.x1)(s):(0,o.l9)(s),i=u[l.seriesId];return{title:l.name,subtitle:l.seriesId,period:l.latestDate,value:l.latestValue.toLocaleString("en-US",{maximumFractionDigits:2}),unit:l.unit.includes("Percent")?"%":void 0,change:"".concat(a,": ").concat(r),changeType:n,indicatorKey:i}}function v(){var e;let t=(0,s.useParams)(),a=(null==t?void 0:t.lng)||"en",{t:i}=(0,c.B)(a,"macro"),[o,d]=(0,n.useState)(null),[u,v]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[j,y]=(0,n.useState)(!0),[N,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{!async function(){try{y(!0),w(null);let[e,t,a]=await Promise.all([(0,r.tf)(),(0,r._t)(),(0,r.V9)()]);d(e),v(t),g(a)}catch(e){console.error("Failed to fetch macro data:",e),w(i("status.load-failed"))}finally{y(!1)}}()},[i]);let k=null==o||null==(e=o.data)?void 0:e.cards,S=i("change.vs-prev"),A=(0,n.useMemo)(()=>{var e,t,a;return k?{employmentPrimary:b(k.employment,!0,S),employmentSecondary:(null==(e=k.employment)?void 0:e.secondary)?b(k.employment,!1,S):null,inflationPrimary:b(k.inflation,!0,S),inflationSecondary:(null==(t=k.inflation)?void 0:t.secondary)?b(k.inflation,!1,S):null,growthPrimary:b(k.growth,!0,S),growthSecondary:(null==(a=k.growth)?void 0:a.secondary)?b(k.growth,!1,S):null,ratesPrimary:b(k.rates,!0,S)}:null},[k,S]),C=null==u?void 0:u.data,P=null==f?void 0:f.data;return j?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"animate-pulse",children:[(0,l.jsx)("div",{className:"h-6 skeleton rounded w-32 mb-4"}),(0,l.jsx)("div",{className:"h-32 skeleton-card rounded"})]}),(0,l.jsxs)("div",{className:"animate-pulse",children:[(0,l.jsx)("div",{className:"h-6 skeleton rounded w-32 mb-4"}),(0,l.jsx)("div",{className:"h-32 skeleton-card rounded"})]})]}):N?(0,l.jsx)("div",{className:"text-center py-8",children:(0,l.jsx)("p",{className:"text-red-400",children:N})}):(0,l.jsxs)("div",{className:"flex flex-col gap-6 xl:gap-8",children:[(null==A?void 0:A.employmentPrimary)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.employment-market")}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)(x,{...A.employmentPrimary,lng:a}),A.employmentSecondary&&(0,l.jsx)(x,{...A.employmentSecondary,lng:a})]})]}),(null==A?void 0:A.inflationPrimary)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.inflation-level")}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)(x,{...A.inflationPrimary,lng:a}),A.inflationSecondary&&(0,l.jsx)(x,{...A.inflationSecondary,lng:a})]})]}),(null==A?void 0:A.growthPrimary)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.economic-growth")}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)(x,{...A.growthPrimary,lng:a}),A.growthSecondary&&(0,l.jsx)(x,{...A.growthSecondary,lng:a})]})]}),(null==A?void 0:A.ratesPrimary)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.interest-rate")}),(0,l.jsx)("div",{className:"flex flex-col gap-3",children:(0,l.jsx)(x,{...A.ratesPrimary,lng:a})})]}),C&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.recession-signal")}),(0,l.jsx)(m,{overallRisk:C.overallRisk,riskScore:C.riskScore,sahmStatus:C.signals.sahmRule.status,sahmValue:C.signals.sahmRule.currentValue,yieldStatus:C.signals.yieldCurve.status,yieldValue:C.signals.yieldCurve.currentValue,t:i,lng:a})]}),P&&(0,l.jsxs)("div",{children:[(0,l.jsx)(p,{title:i("sections.yield-curve")}),(0,l.jsx)(h,{date:P.date,spread:P.spread.t10y2y,isInverted:P.spread.isInverted,shape:P.analysis.shape,curve:P.curve,t:i})]})]})}},91189:(e,t,a)=>{a.d(t,{ProfileSection:()=>x});var l=a(95155),s=a(52714),n=a(72107),r=a(19980),i=a(81744),c=a(84769),o=a(20063),d=a(12115);let u=()=>{let e=(0,o.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,i.B)(t,"profile"),{user:s}=(0,r.A)(),[u,x]=(0,d.useState)(!1),[m,h]=(0,d.useState)(15),[p,b]=(0,d.useState)(!1),[v,f]=(0,d.useState)(null),[g,j]=(0,d.useState)(!1),[y,N]=(0,d.useState)("");(0,d.useEffect)(()=>{let e;return u&&m>0&&(e=setTimeout(()=>h(m-1),1e3)),()=>{e&&clearTimeout(e)}},[u,m]);let w=(0,d.useCallback)(()=>{x(!0),h(15),f(null)},[]),k=(0,d.useCallback)(()=>{x(!1),h(15),f(null)},[]),S=(0,d.useCallback)(async()=>
1{if(!(m>0)){if(!(null==s?void 0:s.sub))return void f(a("delete-account-error","Failed to delete account. Please try again later."));b(!0),f(null);try{let e=await (0,n.DS)(s.sub);N((0,c.PA)(e.data.scheduledDeletionAt,"YYYY-MM-DD",(0,c.dB)())),x(!1),j(!0)}catch(t){var e;console.error("[DeleteAccount] Failed to delete account:",t),(null==t||null==(e=t.response)?void 0:e.status)===400?f(a("delete-account-already-scheduled","Your account is already scheduled for deletion.")):f(a("delete-account-error","Failed to delete account. Please try again later."))}finally{b(!1)}}},[m,a,null==s?void 0:s.sub,t]),A=(0,d.useCallback)(async()=>{try{await fetch("/api/auth/native-logout",{method:"POST"})}catch(e){console.error("[DeleteAccount] Failed to clear native cookies:",e)}window.location.href="/api/auth/logout"},[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:w,className:"inline-flex items-center min-h-[45px] px-4 text-base font-light whitespace-nowrap text-red-400 glass-card rounded-lg justify-center active:bg-red-950/50 active:border-red-700/70 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-red-950/50 border border-red-800/50 [@media(hover:hover)_and_(pointer:fine)]:hover:border-red-700/70 transition-all",children:a("btn-delete-account","Delete Account")}),u&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"modal-card rounded-xl p-6 max-w-md mx-4 shadow-2xl",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:(0,l.jsx)("svg",{className:"w-6 h-6 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,l.jsx)("h2",{className:"text-xl font-semibold text-white",children:a("delete-account-title","Delete Account")})]}),(0,l.jsxs)("div",{className:"mb-6 space-y-3",children:[(0,l.jsx)("p",{className:"text-neutral-300",children:a("delete-account-warning-1","This action cannot be undone. Your account and all associated data will be permanently deleted after 30 days.")}),(0,l.jsx)("p",{className:"text-neutral-400 text-sm",children:a("delete-account-warning-2","During the 30-day grace period, you can contact support to cancel the deletion request.")}),(0,l.jsxs)("div",{className:"bg-white/5 rounded-lg p-3 mt-4",children:[(0,l.jsx)("p",{className:"text-neutral-400 text-sm font-medium mb-2",children:a("delete-account-data-list","The following data will be deleted:")}),(0,l.jsxs)("ul",{className:"text-neutral-500 text-sm space-y-1",children:[(0,l.jsxs)("li",{children:["• ",a("delete-data-profile","Profile information")]}),(0,l.jsxs)("li",{children:["• ",a("delete-data-watchlist","Watchlists")]}),(0,l.jsxs)("li",{children:["• ",a("delete-data-preferences","Preferences and settings")]})]})]})]}),v&&(0,l.jsx)("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-500/30 rounded-lg",children:(0,l.jsx)("p",{className:"text-red-400 text-sm",children:v})}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)("button",{onClick:k,disabled:p,className:"flex-1 px-4 py-3 text-neutral-300 glass-card-interactive rounded-lg transition-all disabled:opacity-50",children:a("btn-cancel","Cancel")}),(0,l.jsx)("button",{onClick:S,disabled:m>0||p,className:"flex-1 px-4 py-3 rounded-lg font-medium transition-all ".concat(m>0?"bg-white/10 text-neutral-500 cursor-not-allowed":"bg-red-600 text-white active:bg-red-700 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-red-700"),children:p?(0,l.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,l.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),a("deleting","Deleting...")]}):m>0?a("delete-countdown",{countdown:m,defaultValue:"Delete (".concat(m,"s)")}):a("btn-confirm-delete","Confirm Delete")})]})]})}),g&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"modal-card rounded-xl p-6 max-w-md mx-4 shadow-2xl",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-full bg-green-500/20 flex items-center justify-center",children:(0,l.jsx)("svg",{className:"w-6 h-6 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,l.jsx)("h2",{className:"text-xl font-semibold text-white",children:a("delete-account-scheduled-title","Deletion Sc
1heduled")})]}),(0,l.jsx)("div",{className:"mb-6",children:(0,l.jsx)("p",{className:"text-neutral-300",children:a("delete-account-success",{date:y})})}),(0,l.jsx)("button",{onClick:A,className:"w-full px-4 py-3 bg-green-600 text-white rounded-lg font-medium active:bg-green-700 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-green-700 transition-colors",children:a("btn-ok","OK")})]})})]})},x=e=>{let{lng:t,userClaims:a}=e,{t:n}=(0,i.B)(t,"profile");return(0,l.jsxs)("div",{className:"text-neutral-100 py-6",children:[(0,l.jsxs)("div",{className:"glass-card rounded-xl p-6 mb-6",children:[(0,l.jsx)("h2",{className:"text-2xl font-semibold mb-4",children:n("user-info-title")}),(0,l.jsx)("table",{className:"w-full border-collapse",children:(0,l.jsx)("tbody",{children:a?Object.entries({email:"email",nickname:"nickname"}).map(e=>{var t;let[s,r]=e;return(0,l.jsxs)("tr",{className:"border-t border-white/10",children:[(0,l.jsx)("td",{className:"py-3 pr-4 font-medium text-neutral-400",children:n("user-info.".concat(r))}),(0,l.jsx)("td",{className:"py-3 text-neutral-200",children:(null==(t=a[s])?void 0:t.toString())||"N/A"})]},s)}):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"py-4 text-center text-neutral-500",children:n("user-info.no-info")})})})})]}),(0,l.jsxs)("div",{className:"glass-card rounded-xl p-6",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold mb-4 text-neutral-200",children:n("account-actions")}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,l.jsx)(s.zG,{}),(0,l.jsx)(u,{})]})]})]})}},91901:(e,t,a)=>{a.d(t,{SettingsSection:()=>C});var l=a(95155),s=a(52714),n=a(81744),r=a(64847),i=a(84639),c=a(51885),o=a(95145),d=a(24278),u=a(40948),x=a(27095),m=a(25986),h=a(69857),p=a(69686),b=a(85657),v=a(52619),f=a.n(v),g=a(20063),j=a(12115),y=a(24136),N=a(78436);let w=[{value:"Pacific/Midway",labelKey:"tz-midway"},{value:"Pacific/Honolulu",labelKey:"tz-hawaii"},{value:"America/Anchorage",labelKey:"tz-alaska"},{value:"America/Los_Angeles",labelKey:"tz-pacific-us"},{value:"America/Vancouver",labelKey:"tz-vancouver"},{value:"America/Tijuana",labelKey:"tz-tijuana"},{value:"America/Denver",labelKey:"tz-mountain-us"},{value:"America/Phoenix",labelKey:"tz-arizona"},{value:"America/Chicago",labelKey:"tz-central-us"},{value:"America/Mexico_City",labelKey:"tz-mexico-city"},{value:"America/New_York",labelKey:"tz-eastern-us"},{value:"America/Toronto",labelKey:"tz-toronto"},{value:"America/Bogota",labelKey:"tz-bogota-lima"},{value:"America/Caracas",labelKey:"tz-caracas"},{value:"America/Halifax",labelKey:"tz-atlantic-canada"},{value:"America/Santiago",labelKey:"tz-santiago"},{value:"America/St_Johns",labelKey:"tz-newfoundland"},{value:"America/Sao_Paulo",labelKey:"tz-sao-paulo"},{value:"America/Buenos_Aires",labelKey:"tz-buenos-aires"},{value:"Atlantic/South_Georgia",labelKey:"tz-mid-atlantic"},{value:"Atlantic/Azores",labelKey:"tz-azores"},{value:"Atlantic/Cape_Verde",labelKey:"tz-cape-verde"},{value:"UTC",labelKey:"tz-utc"},{value:"Europe/London",labelKey:"tz-london-dublin"},{value:"Europe/Lisbon",labelKey:"tz-lisbon"},{value:"Africa/Casablanca",labelKey:"tz-casablanca"},{value:"Europe/Paris",labelKey:"tz-paris-berlin"},{value:"Europe/Amsterdam",labelKey:"tz-amsterdam-brussels"},{value:"Europe/Rome",labelKey:"tz-rome-madrid"},{value:"Europe/Warsaw",labelKey:"tz-warsaw-prague"},{value:"Africa/Lagos",labelKey:"tz-lagos"},{value:"Europe/Athens",labelKey:"tz-athens-bucharest"},{value:"Europe/Helsinki",labelKey:"tz-helsinki-kyiv"},{value:"Africa/Cairo",labelKey:"tz-cairo"},{value:"Africa/Johannesburg",labelKey:"tz-johannesburg"},{value:"Asia/Jerusalem",labelKey:"tz-jerusalem"},{value:"Europe/Moscow",labelKey:"tz-moscow"},{value:"Europe/Istanbul",labelKey:"tz-istanbul"},{value:"Asia/Riyadh",labelKey:"tz-riyadh-kuwait"},{value:"Africa/Nairobi",labelKey:"tz-nairobi"},{value:"Asia/Tehran",labelKey:"tz-tehran"},{value:"Asia/Dubai",labelKey:"tz-dubai"},{value:"Asia/Baku",labelKey:"tz-baku"},{value:"Asia/Kabul",labelKey:"tz-kabul"},{value:"Asia/Karachi",labelKey:"tz-karachi"},{value:"Asia/Tashkent",labelKey:"tz-tashkent"},{value:"Asia/Kolkata",labelKey:"tz-mumbai"},{value:"Asia/Kathmandu",labelKey:"tz-kathmandu"},{value:"Asia/Dhaka",labelKey:"tz-dhaka"},{value:"Asia/Almaty",labelKey:"tz-almaty"},{value:"Asia/Yangon",labelKey:"tz-yangon"},{value:"Asia/Bangkok",labelKey:"tz-bangkok-hanoi"},{value:"Asia/Jakarta",labelKey:"tz-jakarta"},{value:"Asia/Shanghai",labelKey:"tz-beijing-shanghai"},{value:"Asia/Hong_Kong",labelKey:"tz-hong-kong"},{value:"Asia/Taipei",labelKey:"tz-taipei"},{value:"Asia/Singapore",labelKey:"tz-singapore"},{value:"Asia/Manila",labelKey:"tz-manila"},{value:"Australia/Perth",labelKey:"tz-perth"},{value:"Asia/Tokyo",labelKey:"tz-tokyo"},{value:"Asia/Seoul",labelKey:"tz-seoul"},{value:"Australia/Darwin",labelKey:"tz-darwin"},{value:"Australia/Adelaide",labelKey:"tz-adelaide"},{value:"Australia/Brisbane",labelKey:"tz-brisbane"},{value:"Australia/Sydney",labelKey:"tz-sydney-melbourne"},{value:"Pacific/Guam",labelKey:"tz-guam"},{value:"Pacific/Noumea",labelKey:"tz-new-caledonia"},{value:"Pacific/Auckland",labelKey:"tz-auckland"},{value:"Pacific/Fiji",labelKey:"tz-fiji"},{value:"Pacific/Tongatapu",labelKey:"tz-tonga"},{value:"Pacific/Apia",labelKey:"tz-samoa"}],k=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return r.oz}},S=e=>{if(r.F1.includes(e))return e;let t={"Asia/Chongqing":"Asia/Shanghai","Asia/Harbin":"Asia/Shanghai","Asia/Urumqi":"Asia/Shanghai","Asia/Kashgar":"Asia/Shanghai",PRC:"Asia/Shanghai","US/Eastern":"America/Ne
1w_York","US/Central":"America/Chicago","US/Mountain":"America/Denver","US/Pacific":"America/Los_Angeles","US/Alaska":"America/Anchorage","US/Hawaii":"Pacific/Honolulu","US/Arizona":"America/Phoenix","Canada/Eastern":"America/Toronto","Canada/Atlantic":"America/Halifax","Canada/Pacific":"America/Vancouver","Canada/Newfoundland":"America/St_Johns","Europe/Berlin":"Europe/Paris","Europe/Madrid":"Europe/Rome","Europe/Vienna":"Europe/Paris","Europe/Zurich":"Europe/Paris","Europe/Stockholm":"Europe/Helsinki","Europe/Oslo":"Europe/Paris","Europe/Copenhagen":"Europe/Paris","Europe/Brussels":"Europe/Amsterdam","Europe/Prague":"Europe/Warsaw","Europe/Budapest":"Europe/Warsaw","Europe/Bucharest":"Europe/Athens","Europe/Sofia":"Europe/Athens","Europe/Kyiv":"Europe/Helsinki","Europe/Kiev":"Europe/Helsinki","Asia/Calcutta":"Asia/Kolkata","Asia/Bombay":"Asia/Kolkata","Asia/Saigon":"Asia/Bangkok","Asia/Ho_Chi_Minh":"Asia/Bangkok","Asia/Kuala_Lumpur":"Asia/Singapore","Australia/Melbourne":"Australia/Sydney","Australia/Canberra":"Australia/Sydney","Australia/Hobart":"Australia/Sydney","Australia/ACT":"Australia/Sydney","Australia/NSW":"Australia/Sydney","Australia/Queensland":"Australia/Brisbane","Australia/Victoria":"Australia/Sydney","Australia/West":"Australia/Perth","Australia/South":"Australia/Adelaide","Australia/North":"Australia/Darwin",NZ:"Pacific/Auckland","Pacific/Samoa":"Pacific/Apia","Africa/Harare":"Africa/Johannesburg","Africa/Abidjan":"Africa/Casablanca",GMT:"UTC","Etc/GMT":"UTC","Etc/UTC":"UTC"};return t[e]?t[e]:(console.warn("[Timezone] Unknown timezone: ".concat(e,", falling back to ").concat(r.oz)),r.oz)};async function A(){try{var e,t;let a=navigator.userAgent,l=a.includes("YMYCApp")?{}:{"User-Agent":"".concat(a," YMYCApp/dev")},s=await fetch("/api/app-config",{headers:l});if(!s.ok)return[];let n=await s.json(),r=[null==(e=n.android)?void 0:e.staging_url,null==(t=n.ios)?void 0:t.staging_url].filter(e=>"string"==typeof e).map(e=>{try{return new URL(e).hostname}catch(e){return null}}).filter(e=>null!==e);return[...new Set(r)]}catch(e){return[]}}let C=()=>{let e=(0,g.useRouter)(),t=(0,i.j)(),{t:a}=(0,n.B)(void 0,"settings"),[v,C]=(0,y.lT)([r.Ok,r.JH]),P=v&&v[r.Ok]?v[r.Ok]:r.yL,[M,E]=(0,j.useState)(""),[_,D]=(0,j.useState)(null),[T,z]=(0,j.useState)(!1);(0,j.useEffect)(()=>{A().then(e=>{E((0,o.bb)(e))}),z((0,o.TY)()),D((0,o.yJ)())},[]);let R=v&&v[r.JH],K=R&&"auto"!==R?R:S(k());return(0,l.jsxs)("div",{className:"mt-6 max-w-4xl",children:[(0,l.jsxs)("div",{className:"mb-6 flex flex-col gap-2",children:[(0,l.jsxs)("span",{className:"text-sm text-neutral-400",children:[a("environment"),":"," ",(0,l.jsx)("span",{className:"text-neutral-200",children:M||"..."})]}),(0,l.jsxs)("span",{className:"text-sm text-neutral-400",children:[a("version"),":"," ",(0,l.jsx)("span",{className:"text-neutral-200",children:"3.5.35"})]}),T&&_&&(0,l.jsxs)("span",{className:"text-sm text-neutral-400",children:[a("app-version"),":"," ",(0,l.jsx)("span",{className:"text-neutral-200",children:_})]})]}),(0,l.jsxs)("div",{className:"glass-card rounded-lg p-6 relative z-10",children:[(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{htmlFor:"language-select",className:"block text-base font-medium text-neutral-200 mb-3",children:a("language")}),(0,l.jsx)(s.Ae,{id:"language-select",value:P,onChange:a=>
1{t(c.o.actions.setLanguage(a)),C(r.Ok,a,{path:"/",maxAge:31536e5}),(0,N.ot)(),e.replace("/".concat(a,"/settings")),e.refresh()},options:d.mN.map(e=>({value:e.value,label:a(e.labelKey)}))})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{htmlFor:"timezone-select",className:"block text-base font-medium text-neutral-200 mb-3",children:a("time-zone")}),(0,l.jsx)(s.Ae,{id:"timezone-select",value:K,onChange:e=>{t(c.o.actions.setTimeZone(e)),C(r.JH,e,{path:"/",maxAge:31536e5}),window.dispatchEvent(new CustomEvent("timezoneChanged",{detail:e}))},options:w.map(e=>({value:e.value,label:a(e.labelKey)}))})]}),(0,l.jsx)("div",{className:"flex justify-end pt-2",children:(0,l.jsxs)("button",{onClick:()=>{let a=(0,d.lK)(),l=S(k());a!==P&&(t(c.o.actions.setLanguage(a)),C(r.Ok,a,{path:"/",maxAge:31536e5})),l!==K&&(t(c.o.actions.setTimeZone(l)),C(r.JH,l,{path:"/",maxAge:31536e5}),window.dispatchEvent(new CustomEvent("timezoneChanged",{detail:l}))),a!==P&&((0,N.ot)(),e.replace("/".concat(a,"/settings")),e.refresh())},className:"flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-neutral-300 glass-card-interactive rounded-lg transition-all",children:[(0,l.jsx)(p.A,{sx:{fontSize:18}}),a("use-system-settings")]})})]}),(0,l.jsxs)("div",{className:"mt-8",children:[(0,l.jsx)("h2",{className:"text-2xl font-semibold text-neutral-100 mb-4",children:a("support-title")}),(0,l.jsx)("div",{className:"glass-card rounded-lg overflow-hidden",children:(0,l.jsxs)("a",{href:"mailto:[email protected]?subject=YMYC App Feedback",className:"flex items-center justify-between p-4 active:bg-white/5 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/5 transition-colors",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"p-2 bg-white/10 rounded-lg text-neutral-300",children:(0,l.jsx)(u.A,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-base font-medium text-neutral-200",children:a("contact-us")}),(0,l.jsx)("p",{className:"text-sm text-neutral-400",children:a("contact-us-desc")})]})]}),(0,l.jsx)("div",{className:"text-neutral-400",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})})})]})})]}),(0,l.jsxs)("div",{className:"mt-8 mb-12 md:hidden",children:[(0,l.jsx)("h2",{className:"text-2xl font-semibold text-neutral-100 mb-4",children:a("legal-title")}),(0,l.jsxs)("div",{className:"glass-card rounded-lg overflow-hidden divide-y divide-white/5",children:[(0,l.jsxs)(f(),{href:"/".concat(P,"/privacy-policy"),className:"flex items-center justify-between p-4 active:bg-white/5 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/5 transition-colors",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"p-2 bg-white/10 rounded-lg text-neutral-300",children:(0,l.jsx)(h.A,{})}),(0,l.jsx)("span",{className:"text-base font-medium text-neutral-200",children:a("privacy-policy")})]}),(0,l.jsx)("div",{className:"text-neutral-400",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})})})]}),(0,l.jsxs)(f(),{href:"/".concat(P,"/terms-of-service"),className:"flex items-center justify-between p-4 active:bg-white/5 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/5 transition-colors",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"p-2 bg-white/10 rounded-lg text-neutral-300",children:(0,l.jsx)(m.A,{})}),(0,l.jsx)("span",{className:"text-base font-medium text-neutral-200",children:a("terms-of-service")})]}),(0,l.jsx)("div",{className:"text-neutral-400",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})})})]}),(0,l.jsxs)(f(),{href:"/".concat(P,"/disclaimer"),className:"flex items-center justify-between p-4 active:bg-white/5 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/5 transition-colors",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"p-2 bg-white/10 rounded-lg text-neutral-300",children:(0,l.jsx)(b.A,{})}),(0,l.jsx)("span",{className:"text-base font-medium text-neutral-200",children:a("disclaimer")})]}),(0,l.jsx)("div",{className:"text-neutral-400",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})})})]}),(0,l.jsxs)(f(),{href:"/".concat(P,"/cookie-policy"),className:"flex items-center justify-between p-4 active:bg-white/5 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/5 transition-colors",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"p-2 bg-white/10 rounded-lg text-neutral-300",children:(0,l.jsx)(x.A,{})}),(0,l.jsx)("span",{className:"text-base font-medium text-neutral-200",children:a("cookie-policy")})]}),(0,l.jsx)("div",{className:"text-neutral-400",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})})})]})]}),(0,l.jsxs)("p",{className:"text-center text-sm text-neutral-500 mt-6",children:["\xa9 2024-",new Date().getFullYear()," YMYC AI LLC. All rights reserved."]})]})]})}},93766:(e,t,a)=>{a.d(t,{WatchlistStocksSection:()=>h});var l=a(95155),s=a(19980),n=a(52619),r=a.n(n),i=a(20063),c=a(12115),o=a(4590),d=a(52714),u=a(75641),x=a(81744),m=a(58327);function h(e){let{title:t}=e,{user:a}=(0,s.A)(),n=(0,i.useParams)(),h=(null==n?void 0:n.lng)||"en",{t:p}=(0,x.B)(h,"left-sidebar"),b=(0,c.useMemo)(()=>[p("tab-all"),p("tab-gainers"),p("tab-losers")],[p]),[v,f]=(0,c.useState)(null),[g,j]=(0,c.useState)([]),[y,N]=(0,c.useState)(!1),[w,k]=(0,c.useState)(null);(0,c.useEffect)(()=>{null===v&&b.length>0&&f(b[0])},[v,b]),(0,c.useEffect)(()=>{(null==a?void 0:a.sub)&&S(a.sub)},[null==a?void 0:a.sub]);let S=async e=>{N(!0),k(null);try{var t;let a=await (0,o.ED)(e);j(null!=(t=a.data)?t:[])}catch(e){k("Failed to load watchlists"),console.error("Failed to fetch watchlists:",e)}finally{N(!1)}},A=(0,c.useMemo)(()=>{let e=new Set;return g.forEach(t=>{t.companies.forEach(t=>{e.add(t.toUpperCase())})}),Array.from(e)},[g]),C=(0,m.pu)(),{prices:P,isLoading:M}=(0,u.z)(A,{enabled:C}),{allStocks:E,gainers:_,losers:D}=(0,c.useMemo)(()=>{let e=A.map(e=>{let t=P.get(e),a=0;return t&&t.prevClose>0&&(a=(t.price-t.prevClose)/t.prevClose*100),{ticker:e,changePercent:a,hasData:!!t}}),t=[...e].sort((e,t)=>e.hasData&&!t.hasData?-1:!e.hasData&&t.hasData?1:Math.abs(t.changePercent)-Math.abs(e.changePercent));return{allStocks:t,gainers:e.filter(e=>e.hasData&&e.changePercent>0).sort((e,t)=>t.changePercent-e.changePercent),losers:e.filter(e=>e.hasData&&e.changePercent<0).sort((e,t)=>e.changePercent-t.changePercent)}},[A,P]),T=null!=v?v:b[0],z=T===b[0],R=T===b[1],K=z?E:R?_:D,L=0===A.length;return(0,l.jsxs)("div",{children:[(0,l.jsx)(d.X3,{title:t,showDataSource:!0}),(0,l.jsx)("div",{className:"flex gap-2 mb-4 xl:mb-5 overflow-x-auto pb-2 scrollbar-hide -mx-4 xl:mx-0 px-4 xl:px-0",children:b.map(e=>(0,l.jsx)("button",{onClick:()=>f(e),className:"px-4 xl:px-5 py-2 xl:py-2.5 rounded-full text-sm xl:text-base font-medium whitespace-nowrap transition-all ".concat(T===e?"bg-white/20 backdrop-blur-sm text-neutral-100 border border-white/20":"glass-card text-neutral-400 active:bg-white/15 [@media(hover:hover)_and_(pointer:fine)]:hover:bg-white/15"),children:e},e))}),y&&(0,l.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-neutral-100"})}),w&&(0,l.jsxs)("div",{className:"text-center py-8 text-neutral-400",children:[w,(0,l.jsx)("button",{onClick:()=>(null==a?void 0:a.sub)&&S(a.sub),className:"ml-2 text-neutral-100 underline",children:p("btn-retry")})]}),!y&&!w&&L&&(0,l.jsx)("div",{className:"text-center py-8 text-neutral-400",children:a?p("msg-no-stocks"):p("msg-login-required")}),!y&&!w&&!L&&0===K.length&&(0,l.jsx)("div",{className:"text-center py-8 text-neutral-400",children:z?M?p("msg-loading-prices"):p("msg-no-stocks"):R?p("msg-no-gainers"):p("msg-no-losers")}),!y&&!w&&K.length>0&&(0,l.jsx)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 xl:gap-4",children:K.map(e=>(0,l.jsx)(r(),{href:"/".concat(h,"/tickers/").concat(e.ticker),className:"block",children:(0,l.jsx)(d.Se,{ticker:e.ticker,priceData:P.get(e.ticker)})},e.ticker))})]})}},94239:(e,t,a)=>{a.d(t,{IndicesSection:()=>x});var l=a(95155),s=a(52619),n=a.n(s),r=a(20063);a(12115);var i=a(52714),c=a(75641),o=a(81744),d=a(58327);let u=[{symbol:"SPY",title:"S&P 500"},{symbol:"QQQ",title:"Nasdaq 100"},{symbol:"DIA",title:"Dow 30"}];function x(){let e=(0,r.useParams)(),t=(null==e?void 0:e.lng)||"en",{t:a}=(0,o.B)(t,"left-sidebar"),s=u.map(e=>e.symbol),x=(0,d.pu)(),{prices:m,isLoading:h,isLive:p}=(0,c.z)(s,{enabled:x});return(0,l.jsxs)("div",{children:[(0,l.jsx)(i.X3,{title:a("section-indices"),showDataSource:!0}),(0,l.jsx)("div",{className:"flex xl:grid xl:grid-cols-3 gap-3 xl:gap-4 overflow-x-auto xl:overflow-x-visible pb-2 xl:pb-0 scrollbar-hide snap-x snap-mandatory xl:snap-none -mx-4 xl:mx-0 px-4 xl:px-0",children:u.map(e=>{let a=m.get(e.symbol.toUpperCase());return(0,l.jsx)(n(),{href:"/".concat(t,"/tickers/").concat(e.symbol),className:"block",children:(0,l.jsx)(i.fR,{symbol:e.symbol,title:e.title,priceData:a,isLoading:h&&!a,isLive:p})},e.symbol)})})]})}}}]);

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.