PageSourceSearch

https://app.rialto.xyz/assets/EventCalendar-DBZMrNLF.js

js rialto.xyz collected 2026-10-07 22:59:33 UTC 8,974 bytes, 1 lines download raw bytes

1import{b as O,l as v,E as x,d5 as A,r as W,cA as $,j as e,aN as B,aj as F,ak as M,al as z,am as H,bs as P,bt as U,bu as I,T as q}from"./index-XQdxHmpJ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"18e1602"};var l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8846661f-f671-4b05-b68d-5b01a7ff6561",t._sentryDebugIdIdentifier="sentry-dbid-8846661f-f671-4b05-b68d-5b01a7ff6561")}catch{}})();function w(t){return t.toISOString().slice(0,10)}function K(t){return new Date(t+"T00:00:00").toLocaleDateString("en-US",{day:"numeric",month:"short"})}function Q(t,l){if(t===l)return"Today";const n=new Date(l+"T00:00:00");return n.setDate(n.getDate()+1),t===w(n)?"Tomorrow":new Date(t+"T00:00:00").toLocaleDateString("en-US",{weekday:"short"})}function j(t){const l=t.lastIndexOf("."),n=l===-1?t:t.slice(0,l);return{ticker:n,logoUrl:A(x.baseUrl,`/static/icons/stocks/${n}.webp`)}}function S(t,l=2){return t!=null?t.toFixed(l):null}function Y(t=14){const l=new Date,n=w(l),c=new Date(l);c.setDate(c.getDate()+t-1);const u=w(c),h=Array.from({length:t},(g,p)=>{const r=new Date(l);return r.setDate(r.getDate()+p),w(r)});return O({queryKey:["eodhd","event-calendar",n,t],staleTime:5*6e4,refetchOnWindowFocus:!1,queryFn:async()=>{const[g,p,r,k,...N]=await Promise.all([v(x.calendar.earningsWhitelisted,{from:n,to:u}),v(x.calendar.ipoWhitelisted,{from:n,to:u}),v(x.calendar.splitsWhitelisted,{from:n,to:u}),v(x.calendar.economic,{from:n,to:u,country:"US"}),...h.map(s=>v(x.calendar.dividendsWhitelisted,{date:s}))]),i={};for(const s of g)(i[s.report_date]??=[]).push(s);const f={};for(const s of p)(f[s.start_date]??=[]).push(s);const y={};for(const s of r)(y[s.split_date]??=[]).push(s);const C={};for(const s of k){const b=s.date.slice(0,10);(C[b]??=[]).push(s)}const R={};for(let s=0;s<h.length;s++)R[h[s]]=N[s]??[];return h.map(s=>{const b=i[s]??[],D=f[s]??[],E=y[s]??[],T=R[s]??[],_=C[s]??[],m=[];return b.length>0&&m.push({count:b.length,label:"Earnings",tickers:b.slice(0,6).map(a=>{const{ticker:o,logoUrl:d}=j(a.code);return{ticker:o,logoUrl:d,hoverRows:[{label:"Ticker",value:o},{label:"Report Date",value:a.report_date||null},{label:"EPS Estimate",value:a.estimate!=null?`$${S(a.estimate)}`:null},{label:"EPS Actual",value:a.actual!=null?`$${S(a.actual)}`:null},{label:"Surprise %",value:a.percent!=null?`${S(a.percent,1)}%`:null},{label:"Fiscal Period End",value:a.date||null},{label:"When",value:a.before_after_market||null}]}})}),D.length>0&&m.push({count:D.length,label:"IPOs",tickers:D.slice(0,6).map(a=>{const{ticker:o,logoUrl:d}=j(a.code);return{ticker:o,logoUrl:d,hoverRows:[{label:"Company",value:a.name||null},{label:"Ticker",value:o},{label:"Exchange",value:a.exchange||null},{label:"Expected Date",value:a.start_date||null},{label:"Offer Price",value:a.offer_price?`$${a.offer_price}`:null},{label:"Shares Offered",value:a.shares!=null?a.shares.toLocaleString():null}]}})}),E.length>0&&m.push({count:E.length,label:"Splits",tickers:E.slice(0,6).map(a=>{const{ticker:o,logoUrl:d}=j(a.code);return{ticker:o,logoUrl:d,hoverRows:[{label:"Ticker",value:o},{label:"Split Date",value:a.split_date||null},{label:"Ratio",value:`${a.old_shares}:${a.new_shares}`}]}})}),T.length>0&&m.push({count:T.length,label:"Dividends",tickers:T.slice(0,6).map(a=>{const{ticker:o,logoUrl:d}=j(a.symbol);return{ticker:o,logoUrl:d,hoverRows:[{label:"Ticker",value:o},{label:"Ex-Dividend Date",value:a.date||null}]}})}),_.length>0&&m.push({count:_.length,label:"Economic Events",tickers:_.slice(0,6).map(a=>({ticker:a.type,logoUrl:"",isTextLabel:!0,hoverRows:[{label:"Event",value:a.type||null},{label:"Country",value:a.country||null},{label:"Actual",value:a.actual!=null?String(a.actual):null},{label:"Estimate",value:a.estimate!=null?String(a.estimate):null},{label:"Previous",value:a.previous!=null?String(a.previous):null},{label:"Change",value:a.change_percentage!=null?`${a.change_percentage}%`:null},{label:"Period",value:a.period||null}]}))}),{date:K(s),relative:Q(s,n),events:m}}).filter(s=>s.events.length>0)}})}const G=[{label:"1 Week",days:7},{label:"2 Weeks",days:14},{label:"1 Month",days:30}];function L({rows:t}){return e.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:t.map(l=>e.jsxs("span",{className:"contents",children:[e.jsx("span",{className:"text-theme-on-surface-variant",children:l.label}),e.jsx("span",{className:"text-theme-on-surface text-right font-medium",children:l.value??"—"})]},l.label))})}function J({item:t,nameMap:l}){const n=l.get(t.ticker),c=n?[{label:"Company",value:n},...t.hoverRows]:t.hoverRows;return e.jsxs(P,{children:[e.jsx(U,{asChild:!0,children:e.jsx("span",{className:"shrink-0 cursor-default",children:e.jsx(q,{symbol:t.ticker,address:t.ticker,logoURI:t.logoUrl||void 0,className:"size-[16
1px]",textClassName:"text-[7px]"})})}),e.jsx(I,{side:"top",children:e.jsx(L,{rows:c})})]})}function V({evt:t}){return e.jsxs("div",{className:"relative py-1.5 pl-3",children:[e.jsx("div",{className:"bg-theme-secondary absolute top-[4px] bottom-[4px] left-3 w-px"}),e.jsxs("div",{className:"pl-2",children:[e.jsxs("span",{className:"text-theme-on-surface type-body-sm-em",children:[t.count," ",t.label]}),e.jsx("div",{className:"mt-1 space-y-0.5",children:t.tickers.map((l,n)=>e.jsxs(P,{children:[e.jsx(U,{asChild:!0,children:e.jsxs("div",{className:"text-theme-on-surface-variant hover:text-theme-on-surface flex cursor-default items-center gap-1.5 text-[11px]",children:[e.jsx("span",{className:"text-theme-on-surface-variant-2 shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:l.ticker})]})}),e.jsx(I,{side:"top",sideOffset:4,children:e.jsx(L,{rows:l.hoverRows})})]},`${l.ticker}-${n}`))})]})]})}function Z(){const[t,l]=W.useState(14),{data:n,isLoading:c,isError:u}=Y(t),{symbols:h}=$("stock"),{symbols:g}=$("etf"),p=new Map([...h,...g].map(r=>[r.ticker,r.name]));return e.jsxs(B,{className:"flex h-full min-h-0 flex-col overflow-hidden max-xl:max-h-[min(320px,55vh)] max-xl:overflow-hidden xl:max-h-none",children:[e.jsxs("div",{className:"border-theme-outline flex h-9 items-center justify-between border-b px-3",children:[e.jsx("span",{className:"text-theme-on-surface type-body-sm",children:"Events Calendar"}),e.jsxs(F,{children:[e.jsx(M,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Calendar settings",className:"text-theme-on-surface-variant hover:text-theme-on-surface flex h-6 w-6 items-center justify-center transition-colors",children:e.jsx(z,{size:14,strokeWidth:1.8})})}),e.jsxs(H,{align:"end",className:"w-40 p-2",children:[e.jsx("p",{className:"text-theme-on-surface-variant mb-1.5 px-1 text-[11px] font-medium tracking-wide uppercase",children:"Timeframe"}),G.map(r=>e.jsxs("button",{type:"button",onClick:()=>l(r.days),className:`flex w-full items-center justify-between rounded px-2 py-1 text-[12px] transition-colors ${t===r.days?"text-theme-on-surface bg-theme-surface-variant font-medium":"text-theme-on-surface-variant hover:text-theme-on-surface hover:bg-theme-surface-variant"}`,children:[r.label,t===r.days&&e.jsx("span",{className:"text-theme-primary text-[10px]",children:"✓"})]},r.days))]})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-2 pb-2 pl-4 [scrollbar-width:none] max-xl:max-h-[240px] xl:max-h-[400px] [&::-webkit-scrollbar]:hidden",children:c?e.jsx("div",{className:"text-theme-on-surface-variant flex h-20 items-center justify-center text-xs",children:"Loading…"}):u?e.jsx("div",{className:"text-theme-on-surface-variant flex h-20 items-center justify-center text-xs",children:"Failed to load calendar."}):e.jsx("div",{className:"border-theme-outline relative ml-[3px] border-l",children:(n??[]).map((r,k)=>{const N=k===(n??[]).length-1;return e.jsxs("div",{className:N?"":"pb-2",children:[e.jsxs("div",{className:"relative flex items-center pt-2 pb-1",children:[e.jsx("div",{className:"border-theme-on-surface-variant-2 bg-theme-surface-bright absolute -left-[4px] h-[7px] w-[7px] rounded-full border-[1.5px]"}),e.jsxs("div",{className:"flex items-baseline gap-1 pl-3",children:[e.jsx("span",{className:"text-theme-on-surface type-body-sm-em",children:r.date}),e.jsxs("span",{className:"text-theme-on-surface-variant type-body-sm",children:["· ",r.relative]})]})]}),r.events.map(i=>i.label==="Economic Events"?e.jsx(V,{evt:i},i.label):e.jsxs("div",{className:"relative py-1.5 pl-3",children:[e.jsx("div",{className:"bg-theme-secondary absolute top-[4px] bottom-[4px] left-3 w-px"}),e.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pl-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.jsxs("span",{className:"text-theme-on-surface type-body-sm-em shrink-0 whitespace-nowrap",children:[i.count," ",i.label]}),i.tickers.map((f,y)=>e.jsx(J,{item:f,nameMap:p},`${f.ticker}-${y}`))]})]},i.label))]},r.date)})})})]})}export{Z as EventCalendar};

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.