!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d8aa7a4a-6dc9-40e1-bf59-c8d7c4af6826",e._sentryDebugIdIdentifier="sentry-dbid-d8aa7a4a-6dc9-40e1-bf59-c8d7c4af6826")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2240],{17239:(e,t,s)=>{"use strict";s.d(t,{$:()=>T});var r=s(6029),n=s(4967),a=s(41249),i=s(55729),l=s(90248),o=s(494),d=s(41735),c=s(65789),u=s(54409),x=s(75751),g=s(47146),h=s(76410),p=s(10794);let m=(0,d.default)(a.az).withConfig({componentId:"sc-c5b73d7d-0"})(["width:144px;height:80px;position:absolute;top:0;left:0;background:",";display:grid;svg{margin:auto;}"],e=>e.theme.colors.overlay.darken1),j=(0,d.default)(a.az).withConfig({componentId:"sc-c5b73d7d-1"})(["a:visited{.media-component-seen-notice{color:"," !important;}}img{display:block;border-radius:",";}"],e=>e.theme.colors.neutral.default,e=>e.theme.spacing.xxs);var y=s(21377);let f=/sofascore.com\/news\//g,v=[y.zut.MEDIA_VIDEO,y.zut.MEDIA_NEWS_VIDEO,y.zut.MEDIA_YOUTUBE_VIDEO],b=e=>f.test(e),S=e=>-1!==v.indexOf(e),C=e=>{let t=document.createElement("a");return t.href=e,t.host},w=e=>{if(e){let s=C(e);if("www.youtube.com"===s){let t=new URL(e).searchParams.get("v");return"https://img.youtube.com/vi/".concat(t,"/0.jpg")}if("youtu.be"===s){var t;let s=null==(t=new URL(e).pathname)?void 0:t.slice(1);return"https://img.youtube.com/vi/".concat(s,"/0.jpg")}}},_=()=>{let e=(0,i.useContext)(d.ThemeContext);return(0,r.jsx)(a.az,{w:"144",h:"80",bg:"onSurface.nLv4",display:"grid",br:"xxs",children:(0,r.jsx)(u.dwH,{m:"auto",fill:null==e?void 0:e.colors.onSurface.nLv4})})},T=e=>{let{highlights:t,hideTitle:s,isInWidget:i}=e,d=function(e){let{media:t,selectedLocale:s,geoIPAlpha2:r,n=10}=e;return t.sort((e,t)=>t.createdAtTimestamp-e.createdAtTimestamp).filter(e=>!e.forCountries||!e.forCountries.length||-1!==e.forCountries.indexOf(s.toUpperCase())||-1!==e.forCountries.indexOf(r.toUpperCase())).slice(0,n)}({media:[...t],selectedLocale:(0,o.d4)(p.JV),geoIPAlpha2:(0,o.d4)(p.LQ)||""});return d.length?(0,r.jsx)(x.t,{tag:"Media",children:(0,r.jsxs)(c.Zp,{isInverseDesktop:i,children:[!s&&(0,r.jsx)(c.Zp.Header,{titleId:"media",as:"h4"}),(0,r.jsx)(j,{pt:["sm",i?"sm":0],pb:["sm",i?"sm":"lg"],children:(0,r.jsx)(c.BU,{children:d.map(e=>(0,r.jsx)(a.az,{children:(0,r.jsxs)(a.so,{as:"a",href:e.url,target:"_blank",rel:e.doFollow||b(e.url)?void 0:"nofollow",onClick:()=>(0,h.Xy)(e.title),children:[(0,r.jsxs)(a.az,{position:"relative",children:[(0,r.jsx)(a._V,{src:e.thumbnailUrl||w(e.url),width:"144",height:"80",fallback:(0,r.jsx)(_,{}),alt:"thumbnail"}),S(e.mediaType)&&(0,r.jsx)(m,{children:(0,r.jsx)(u.reY,{fill:"white"})})]}),(0,r.jsxs)(a.so,{direction:"column",justify:"space-between",maxW:"calc(100% - 144px)",grow:1,pl:"lg",children:[(0,r.jsxs)(a.az,{children:[(0,r.jsx)(a.EY,{block:!0,as:"bdi",className:"media-component-title",font:"display.small",color:"onSurface.nLv1",w:"100%",lineClamp:2,children:e.title}),(0,r.jsx)(a.EY,{font:"assistive.default",color:"onSurface.nLv3",w:"100%",mt:"xs",lineClamp:1,children:e.subtitle})]}),(0,r.jsx)(a.az,{children:(0,r.jsxs)(a.so,{justify:"space-between",children:[(0,r.jsx)(a.EY,{as:"bdi",font:"body.small",color:"onSurface.nLv3",w:"100%",mt:"xs",textTransform:"firstLetter",ellipsis:!0,children:(0,r.jsx)(g.v,{timestamp:(0,n.pp)(e.createdAtTimestamp).getTime()})}),(0,r.jsx)(a.EY,{font:"body.small",className:"media-component-seen-notice",color:"transparent",w:"100%",mt:"xs",style:{textAlign:"right",userSelect:"none"},"aria-hidden":"true",ellipsis:!0,children:(0,r.jsx)(l.A,{id:"basic.seen"})})]})})]})]})},e.id))})})]})}):null}},28132:(e,t,s)=>{"use strict";s.d(t,{H:()=>n,m:()=>r});var r=function(e){return e.EventWidget="event_widget",e.EventPage="event_page",e.FantasyCompetition="fantasy_competition",e.FavoritesPage="favorites_page",e.FightNight="fight_night",e.FighterPage="fighter_page",e.ManagerPage="manager_page",e.Organization="organization_page",e.PlayerPage="player_page",e.RefereePage="referee_page",e.StageSport="stage_sport_page",e.StageSportRace="stage_sport_race_page",e.StageSportTeam="stage_sport_team_page",e.TeamPage="team_page",e.TournamentPage="tournament_page",e.UniqueTournamentPage="unique_tournament_page",e.DroppingOddsPage="dropping_odds_page",e.FantasyLeague="fantasy_league",e.ProfilePage="profile_page",e.VenuePage="venue_page",e.MainPageAll="main_page_all",e.MainPageFavorites="main_page_favourites",e.ChallengePage="challenge_page",e}({}),n=function(e){return e.Summary="summary",e.Incidents="incidents",e.Details="details",e.Scorecard="scorecard",e.Overs="overs",e.BoxScore="box_score",e.Lineups="lineups",e.Statistics="statistics",e.Standings="standings",e.Graphs="graphs",e.Matches="matches",e.Odds="odds",e.FeaturedOdds="featured_odds",e.AdditionalOdds="additional_odds",e.Commentary="commentary",e.Games="games",e.Media="media",e.List="list",e.Editor="editor",e.Fights="fights",e.Info="info",e.Rankings="rankings",e.Race="race",e.Races="races",e.Squad="squad",e.TopPlayers="top_players",e.TopStats="top_stats",e.TopTeams="top_teams",e.Knockout="knockout",e.EarlyPrelims="early_prelims",e.MainCard="main_card",e.Other="other",e.Prelims="prelims",e.PlayByPlay="play_by_play",e.FantasyHome="fantasy_home",e.FantasyMyTeam="fantasy_my_team",e.FantasyFixtures="fantasy_fixtures",e.FantasyLeagues="fantasy_leagues",e.FantasyStatistics="fantasy_statistics",e.BetBoost="bet_boost",e.DroppingOdds="dropping_odds",e.WinningOdds="winning_odds",e.HighValueStreaks="high_value_streaks",e.Top20TeamStreaks="top_20_team_streaks",e.Top20H2H="top_20_h2h",e.PowerRankings="power_rankings",e.PlayerFantasy="player_fantasy",e.FantasyLeagueLeaderboard="fantasy_league_leaderboard",e.FantasyLeagueDetails="fantasy_league_details",e.FantasyLeagueSettings="fantasy_league_settings",e.Overview="overview",e.MyPredictions="my_predictions",e.Following="following",e.Contributions="contributions",e.Career="career",e.Season="season",e.PlayerStatistics="player_stats",e.All="all",e.Live="live",e.Finished="finished",e.Upcoming="upcoming",e.TodayMatches="today_matches",e.ChallengeCurrentWeek="current_week",e.ChallengePreviousWeek="previous_week",e.History="history",e}({})},45021:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/stageSport",function(){return s(62153)}])},52951:(e,t,s)=>{"use strict";s.d(t,{xV:()=>c,an:()=>u,Ay:()=>x});var r=s(6029),n=s(55575),a=s.n(n),i=s(95669),l=s.n(i),o=s(55729),d=s(947);let c=(0,o.createContext)({}),u=c.Provider;c.Consumer;let x=e=>{let{titleKey:t,descriptionKey:s,keywordsKey:n,metaKey:i,values:u={},titleFallback:x}=e,{meta:g,seoContent:h}=(0,o.useContext)(c),p=(0,d.A)(),m=t||i?p.formatMessage({id:"title.".concat(t||i)},u):x||"Sofascore",j=p.formatMessage({id:"description.".concat(s||i)},u),y=p.formatMessage({id:"keywords.".concat(n||i)},u);return(0,r.jsxs)(l(),{children:[(0,r.jsx)("title",{children:a()((null==h?void 0:h.title)||(null==g?void 0:g.title)||m)}),(null==h?void 0:h.description)||(null==g?void 0:g.description)?(0,r.jsx)("meta",{name:"description",content:(null==h?void 0:h.description)||(null==g?void 0:g.description)},"description"):p.messages["description.".concat(s||i)]&&(0,r.jsx)("meta",{name:"description",content:j},"description"),(null==g?void 0:g.keywords)?(0,r.jsx)("meta",{name:"keywords",content:g.keywords}):p.messages["keywords.".concat(n||i)]&&(0,r.jsx)("meta",{name:"keywords",content:y})]})}},55342:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var r=s(6029),n=s(21377),a=s(45860),i=s(65789),l=s(17239);function o(e){let{id:t,isDesktop:s}=e,{data:o}=(0,a.Ay)(n.dVR.highlights(t));return o&&o.highlights.length?(0,r.jsx)(i.BU,{children:(0,r.jsx)(l.$,{highlights:o.highlights,hideTitle:!0,isInWidget:s})}):null}},59364:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var r=s(6029),n=s(76356),a=s(494),i=s(10794);let l=["DE","BE","NL","GB","BA","RS","HR","GR","ME","PH","SG","VN","BY","SK","CH","MY","PL","CL","CY","CD","CZ","ZM","MX","EG","RU","KR"];var o=s(14861);function d(e){let{slotId:t}=e,s=(0,a.d4)(i.LQ);return!s||l.includes(s)?null:(0,r.jsx)(n.az,{position:"fixed",overflowY:"visible",zIndex:"fixed",bottom:"0",style:{minHeight:82,width:540},children:(0,r.jsx)(o.i,{id:t,borderless:!0})})}},62153:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>sH});var r=s(6029),n=s(21377),a=s(95083),i=s(76356),l=s(95669),o=s.n(l),d=s(81278),c=s(55729),u=s(947),x=s(90248),g=s(33752),h=s(62859),p=s(50417),m=s(14861),j=s(59364),y=s(29129),f=s(8973),v=s(39969),b=s(26331),S=s(70591),C=s(73088),w=s(52951),_=s(57715),T=s(12047),E=s(54409),M=s(21501),L=s(41249),P=s(57545),k=s(69559);let A=(0,c.createContext)(void 0),z=e=>{let{children:t}=e,[s,n]=(0,c.useState)(new Date);return(0,r.jsx)(A.Provider,{value:{selectedDate:s,onSelectedDateChange:e=>n(e)},children:t})},I=()=>{let e=(0,c.useContext)(A);if(!e)throw Error();return e},D=e=>{let{opened:t,onClose:s}=e,n=(0,k.o)(),l=(0,M.hX)(),{isMobile:o}=(0,a.$c)(),{selectedDate:d,onSelectedDateChange:c}=I(),u=e=>{c(e),s()};return!t||l?null:o?(0,r.jsx)(L.Xn,{isOpen:t,onClose:s,children:(0,r.jsx)(L.Xn.Content,{children:(0,r.jsx)(P.A,{date:d,onChange:u,sport:n})})}):(0,r.jsxs)(i.az,{position:"absolute",left:"[0px]",top:"[0px]",bg:"surface.s1",br:"lg",elevation:"3",overflow:"hidden",zIndex:"popover",children:[(0,r.jsx)(i.so,{justify:"flex-end",p:"sm",cursor:"pointer",onClick:s,children:(0,r.jsx)(E.zQC,{icon:"close",fill:"primary.default"})}),(0,r.jsx)(P.A,{date:d,onChange:u,sport:n})]})},R=(e,t)=>{let s=e.getDay(),r=new Date(e);r.setDate(e.getDate()-(0===s?6:s-1));let n=new Date(r);n.setDate(r.getDate()+6);let a=e=>"".concat(e.getDate()," ").concat(e.toLocaleString(t,{month:"short"}));return"".concat(a(r)," - ").concat(a(n))},U=()=>{let{locale:e}=(0,u.A)(),{selectedDate:t}=I(),[s,n]=(0,c.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.az,{flexGrow:1,children:(0,r.jsxs)(a.$n,{bg:"surface.s2",w:"100%",h:"[40px]",display:"inline-flex",justifyContent:"center",alignItems:"center",br:"xs",gap:"sm",onClick:()=>n(!0),children:[(0,r.jsx)(i.az,{display:{mdOnly:"none"},children:(0,r.jsx)(E.zQC,{icon:"calendar-empty",fill:"primary.default"})}),(0,r.jsx)(a.EY,{textStyle:"display.small",textTransform:"capitalize",lineHeight:1,children:R(t,e)})]})}),(0,r.jsx)(D,{opened:s,onClose:()=>n(!1)})]})},K=e=>{let{type:t}=e,{selectedDate:s,onSelectedDateChange:n}=I(),i="prev"===t?E.pa2:E.CCT;return(0,r.jsx)(a.K0,{bg:"surface.s2",w:"[40px]",h:"[40px]",onClick:()=>{let e=new Date(s);e.setDate(e.getDate()+("prev"===t?-7:7)),n(e)},children:(0,r.jsx)(i,{fill:"primary.default"})})},F=()=>{let e=(0,T.Ay)({isInMobileTabs:!1});return(0,r.jsxs)(i.so,{justify:"space-between",p:"xs",bg:"surface.s1",gap:"xs",position:{mdDown:"sticky"},zIndex:"sticky",style:{top:e},children:[(0,r.jsx)(K,{type:"prev"}),(0,r.jsx)(U,{}),(0,r.jsx)(K,{type:"next"})]})},Y=(0,c.createContext)(void 0),q=e=>{let{children:t,...s}=e;return(0,r.jsx)(Y.Provider,{value:{...s},children:t})},B=()=>{let e=(0,c.useContext)(Y);if(!e)throw Error();return e};var W=s(8329),H=s(24159);let N=e=>{let{uniqueStage:t}=e,s=(0,k.o)();return(0,r.jsx)(S.So,{uniqueStage:t,sportSlug:s,children:(0,r.jsx)(i.so,{align:"center",px:"md",grow:1,py:"md",children:(0,r.jsxs)(i.so,{gap:"lg",align:"center",w:"100%",children:[s===n.QCR.Cycling?(0,r.jsx)(W.w,{alpha2:"international",size:24}):(0,r.jsx)(W.w,{flag:t.slug,name:t.name,size:24}),(0,r.jsx)(a.EY,{textStyle:"body.large",truncate:!0,children:(0,r.jsx)(H.c,{entity:t})})]})})})};var Q=s(4967),J=s(90510),O=s(3763),V=s(17189);let G=e=>{let{status:t,isToday:s}=e;switch(t){case n.hzM.inprogress:return(0,r.jsx)(i.az,{minW:"sm",h:"sm",br:"[100%]",bg:"status.live"});case n.hzM.finished:return(0,r.jsx)(i.az,{minW:"sm",h:"sm",br:"[100%]",bg:"neutrals.nLv3"});default:return(0,r.jsx)(i.so,{align:"center",justify:"center",minW:"[8px]",h:"sm",br:"sm",bg:s?"neutrals.nLv1":"neutrals.nLv3",children:(0,r.jsx)(i.az,{w:"xs",h:"xs",br:"[100%]",bg:"surface.s1"})})}},X=e=>{let{startDateTimestamp:t,live:s}=e;return t?(0,r.jsx)(i.az,{flexGrow:1,flexShrink:0,children:(0,r.jsx)(a.EY,{textStyle:"body.small",color:s?"status.live":"neutrals.nLv3",lineHeight:1,children:(0,r.jsx)(J.XU,{value:1e3*t,...Q.or.dateTime})})}):null},Z=e=>{let{winner:t}=e;return t?(0,r.jsxs)(i.so,{gap:"sm",align:"center",children:[(0,r.jsx)(E.$dv,{fill:"sofaSingles.value"}),(0,r.jsx)(a.EY,{lineHeight:"1",textStyle:"body.small",color:"neutrals.nLv3",children:t.name})]}):null},$=e=>{let{description:t,live:s}=e;return t?(0,r.jsxs)(i.so,{gap:"sm",children:[(0,r.jsx)(a.EY,{textStyle:"body.small",lineHeight:1,color:s?"status.live":"neutrals.nLv3",children:"•"}),(0,r.jsx)(a.EY,{textStyle:"body.small",lineHeight:1,truncate:!0,maxW:{base:"[250px]",md:"[150px]",lg:"[200px]"},color:s?"status.live":"neutrals.nLv3",children:(0,r.jsx)(V.N,{id:t})})]}):null},ee=e=>{let{live:t}=e;return t?(0,r.jsx)(i.so,{bg:"status.live",px:"sm",br:"lg",h:"lg",align:"center",children:(0,r.jsx)(a.EY,{lineHeight:1,textStyle:"assistive.default",color:"[white]",children:(0,r.jsx)(x.A,{id:"live"})})}):null},et=e=>{var t,s,l,o,d,c;let{stage:u}=e,g=(null==(t=u.substage)?void 0:t.status.type)===n.hzM.canceled,h=(null==(s=u.substage)?void 0:s.status.type)===n.hzM.inprogress;return(0,r.jsxs)(i.so,{flexGrow:1,justify:"space-between",align:"center",children:[(0,r.jsxs)(i.BJ,{gap:"xs",flexGrow:1,children:[(0,r.jsxs)(i.so,{align:"center",gap:"md",children:[(0,r.jsx)(O.Q,{stage:u,size:16}),(0,r.jsx)(a.EY,{textStyle:"body.small",lineHeight:1,children:u.name})]}),(0,r.jsxs)(i.so,{children:[(0,r.jsx)(i.az,{minW:"[28px]"}),(0,r.jsxs)(i.so,{flexGrow:1,justify:"space-between",wrap:"wrap",gap:"sm",children:[(0,r.jsxs)(i.so,{gap:"sm",align:"center",wrap:"wrap",children:[(0,r.jsx)(G,{status:null==(l=u.substage)?void 0:l.status.type}),(0,r.jsx)(X,{startDateTimestamp:null==(o=u.substage)?void 0:o.startDateTimestamp,live:h}),(0,r.jsx)($,{description:null==(d=u.substage)?void 0:d.description,live:h})]}),(0,r.jsx)(i.so,{align:"center",children:g?(0,r.jsx)(a.EY,{textStyle:"body.small",color:"status.live",lineHeight:1,children:(0,r.jsx)(x.A,{id:"canceled"})}):(0,r.jsx)(Z,{winner:null==(c=u.substage)?void 0:c.winner})})]})]})]}),(0,r.jsx)(ee,{live:h})]})},es=e=>{var t,s;let{stage:a}=e;return(null==(t=a.substage)?void 0:t.winner)||(null==(s=a.substage)?void 0:s.status.type)===n.hzM.canceled?null:(0,r.jsxs)(i.so,{gap:"sm",flexShrink:0,children:[(0,r.jsx)(i.cG,{w:"[1px]",bg:"neutrals.nLv4"}),(0,r.jsx)(v.x,{id:a.id,uniqueStage:a.uniqueStage,location:f.y.MainMatches})]})},er=e=>{let{stage:t}=e,s=(0,k.o)();return(0,r.jsx)(S.LC,{stage:t,sportSlug:s,children:(0,r.jsxs)(i.so,{justify:"space-between",px:"md",align:"center",pb:"md",gap:"xs",children:[(0,r.jsx)(et,{stage:t}),(0,r.jsx)(es,{stage:t})]})},t.id)},en=e=>{let{stages:t}=e;return t?(0,r.jsx)(r.Fragment,{children:t.map(e=>(0,r.jsx)(er,{stage:e},e.id))}):null},ea=e=>{let{uniqueStage:t,stages:s,isLast:n}=e,{selectedUniqueStageId:a}=B();return(0,r.jsxs)(i.az,{borderBottom:{md:n?void 0:"1px solid {colors.neutrals.nLv4}"},bg:{base:"surface.s1",md:a===t.id?"neutral.highlight":"surface.s1",_hover:"surface.s0"},br:{mdDown:"sm"},elevation:{mdDown:"2"},children:[(0,r.jsx)(N,{uniqueStage:t}),(0,r.jsx)(en,{stages:s})]})};var ei=s(88530);let el=e=>{let{uniqueStages:t,stagesPerWeek:s}=e;return(0,r.jsx)(i.az,{p:{mdDown:"sm"},bg:"surface.s2",children:(0,r.jsx)(i.BJ,{gap:{mdDown:"sm"},children:t.map((e,n)=>(0,r.jsx)(ea,{uniqueStage:e,stages:(0,ei.NW)(e,s),isLast:t.length-1===n},e.id))})})},eo=()=>(0,k.o)()===n.QCR.Motorsport?(0,r.jsx)(i.az,{h:"[800px]",bg:{base:"surface.s0",md:"surface.s1"}}):(0,r.jsx)(i.az,{h:"[100px]",bg:{base:"surface.s0",md:"surface.s1"}});var ed=s(494),ec=s(45860),eu=s(10794);let ex=()=>{var e,t;let s=(0,k.o)(),r=(0,ed.d4)(eu.JU),{selectedDate:a}=I(),i=(0,ec.Ay)(n.t3g.categories(s)),l=(0,ec.Ay)(n.dVR.scheduledStages(s,(0,Q.UG)((0,ei.VZ)(a))));return{uniqueStages:((null==(e=i.data)?void 0:e.categories)||[]).reduce((e,t)=>t.uniqueStages?e.concat(t.uniqueStages.map(e=>({...e,priority:t.priority||0}))):e,[]),stagesPerWeek:[...function(e,t){let s=new Date((0,ei.VZ)(e));s.setHours(0,0,0,0);let r=new Date((0,ei.FF)(e));r.setHours(23,59,59,999);let n=s.getTime(),a=r.getTime();return t.filter(e=>{let t=e.substageStartDateTimestamps;return!!t&&t.some(e=>{let t=1e3*e;return t>=n&&t<=a})})}(a,(null==(t=l.data)?void 0:t.stages)||[])],stagesFavorite:Object.values(r),error:i.error||l.error,loading:i.isLoading||l.isLoading}},eg=()=>{let{uniqueStages:e,stagesPerWeek:t,stagesFavorite:s,error:n,loading:a}=ex();return a?(0,r.jsx)(eo,{}):!e.length||n?null:(0,r.jsx)(el,{uniqueStages:(0,ei.Hk)(e,t,s),stagesPerWeek:t})},eh=()=>(0,r.jsx)(z,{children:(0,r.jsxs)(i.az,{position:"relative",bg:"surface.s1",py:{md:"md"},br:{md:"lg"},elevation:{md:"2"},w:"100%",children:[(0,r.jsx)(a.EY,{textAlign:"center",textStyle:"display.medium",pb:"sm",display:{base:"none",md:"block"},children:(0,r.jsx)(x.A,{id:"tournament.series"})}),(0,r.jsx)(F,{}),(0,r.jsx)(eg,{})]})}),ep=(0,c.createContext)(void 0),em=e=>{let{children:t,stage:s}=e;return(0,r.jsx)(ep.Provider,{value:{stage:s},children:t})},ej=()=>{let e=(0,c.useContext)(ep);if(!e)throw Error();return e},ey=e=>{let{circuit:t}=e;return t?(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:t}):null},ef=()=>{var e;let{stage:t}=ej();return(0,r.jsxs)(i.zt,{p:"lg",children:[(0,r.jsx)(O.Q,{stage:t,size:40}),(0,r.jsxs)(i.BJ,{flexGrow:1,gap:"2xs",children:[(0,r.jsx)(a.EY,{textStyle:"display.medium",color:"neutrals.nLv1",children:t.description}),(0,r.jsx)(ey,{circuit:null==(e=t.info)?void 0:e.circuit})]})]})};var ev=function(e){return e[e.Results=0]="Results",e[e.Info=1]="Info",e[e.Rankings=2]="Rankings",e[e.Media=3]="Media",e}({}),eb=function(e){return e[e.Summary=0]="Summary",e[e.Tyres=1]="Tyres",e[e.PitStop=2]="PitStop",e[e.FastestLap=3]="FastestLap",e[e.Generic=4]="Generic",e[e.CyclingTime=5]="CyclingTime",e[e.CyclingYoungRider=6]="CyclingYoungRider",e[e.CyclingSprint=7]="CyclingSprint",e[e.CyclingClimb=8]="CyclingClimb",e}({}),eS=s(65789),eC=s(3518);let ew=()=>{let{stage:{info:e}}=ej();return e?(0,r.jsx)(eS.Zp,{isInverseDesktop:!0,children:(0,r.jsxs)(i.BJ,{gap:"lg",p:"md",children:[(null==e?void 0:e.circuitCity)&&(0,r.jsxs)(i.zt,{justify:"space-between",children:[(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(x.A,{id:"city"})}),(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:e.circuitCity})]}),(null==e?void 0:e.laps)&&(0,r.jsxs)(i.zt,{justify:"space-between",children:[(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(x.A,{id:"laps"})}),(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:e.laps})]}),(null==e?void 0:e.circuitLength)&&(0,r.jsxs)(i.zt,{justify:"space-between",children:[(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(x.A,{id:"circuitLength"})}),(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(eC.Z,{value:Number(e.circuitLength),fromUnit:"m"})})]}),(null==e?void 0:e.raceDistance)&&(0,r.jsxs)(i.zt,{justify:"space-between",children:[(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(x.A,{id:"raceDistance"})}),(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(eC.Z,{value:Number(e.raceDistance),fromUnit:"m"})})]}),(null==e?void 0:e.lapRecord)&&(0,r.jsxs)(i.zt,{justify:"space-between",children:[(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:(0,r.jsx)(x.A,{id:"lapRecord"})}),(0,r.jsx)(a.EY,{textStyle:"body.medium",color:"neutrals.nLv1",children:e.lapRecord})]})]})}):null};var e_=s(41735),eT=s(86679);let eE=()=>{var e,t,s,l;let{name:o}=(0,e_.useTheme)(),{stage:d}=ej(),{hasStageMap:c}=(0,eT.A)({hasStageMap:{route:n.dVR.trackImage(d.id,"dark"===o)}},[d]);return(0,r.jsx)(eS.Zp,{isInverseDesktop:!0,children:(0,r.jsxs)(i.BJ,{p:"md",children:[(0,r.jsxs)(i.so,{align:"center",justify:"space-between",gap:"md",children:[(0,r.jsxs)(i.zt,{children:[(0,r.jsx)(i.az,{w:"3xl",h:"3xl",display:{md:"none"},children:(0,r.jsx)(O.Q,{stage:d,size:40})}),(null==(e=d.info)?void 0:e.circuit)&&(0,r.jsx)(a.EY,{textStyle:"display.small",lineHeight:1,children:d.info.circuit})]}),(null==(t=d.info)?void 0:t.weather)&&(0,r.jsx)(i.az,{w:"4xl",h:"4xl",children:(0,r.jsx)(E.qgJ,{weather:d.info.weather})})]}),c&&(0,r.jsx)(i.ov,{children:(0,r.jsx)(L._V,{w:"100%",maxW:"345",h:"auto",d:"block",src:n.dVR.trackImage(d.id,"dark"===o),alt:null!=(l=null==(s=d.info)?void 0:s.circuit)?l:""})})]})})};var eM=s(85009);let eL=()=>{let{stage:e}=ej(),{hasTvChannels:t}=(0,eT.A)({hasTvChannels:{route:n.RMf.eventCountryChannels(n.IAy.Stage,e.id)}});return t?(0,r.jsx)(eM.d,{eventId:e.id,type:n.IAy.Stage,startTimestamp:e.startDateTimestamp,isInWidget:!0}):null},eP=()=>(0,r.jsxs)(eS.BU,{children:[(0,r.jsx)(eE,{}),(0,r.jsx)(ew,{}),(0,r.jsx)(eL,{})]});var ek=s(55342);let eA=()=>{let{stage:e}=ej(),{isDesktop:t}=(0,a.$c)();return(0,r.jsx)(ek.A,{id:e.id,isDesktop:t})};var ez=s(28760);let eI=()=>{var e,t;let s=(0,k.o)(),{stage:a}=ej(),i=s===n.QCR.Cycling?a.id:(null==(e=a.stageParent)?void 0:e.id)||a.id;return(0,r.jsx)(ez.n,{stageId:i,uniqueStageName:(null==(t=a.uniqueStage)?void 0:t.name)||""})},eD=e=>{let{stage:t}=e,s=(0,b.A)();if(!t.startDateTimestamp)return null;let l=t.status.type===n.hzM.inprogress,o=(0,Q.cK)(t.startDateTimestamp);return(0,r.jsxs)(i.zt,{gap:"xs",color:l?"status.live":"neutrals.nLv1",children:[l&&(0,r.jsxs)(i.zt,{gap:"xs",children:[(0,r.jsx)(a.EY,{textStyle:"display.small",color:"[currentcolor]",children:(0,r.jsx)(x.A,{id:"live"})}),(0,r.jsx)(a.EY,{textStyle:"display.small",color:"[currentcolor]",children:"\xb7"})]}),(0,r.jsx)(a.EY,{textStyle:"display.small",color:"[currentcolor]",children:o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{id:"today"}),", ",(0,Q.m8)((0,Q.pp)(t.startDateTimestamp),s)]}):(0,r.jsx)(J.XU,{value:1e3*t.startDateTimestamp,day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit",hour12:!1})})]})};var eR=s(76868);let eU=e=>{let{selectedCategory:t,onSelectedCategoryChange:s,tabs:n}=e;return n.hasYoung||n.hasSprint||n.hasClimb?(0,r.jsx)(i.az,{children:(0,r.jsxs)(L.tU,{value:t,variant:"tertiary",onChange:s,children:[(0,r.jsx)(L.tU.Tab,{tabKey:eb.CyclingTime,children:(0,r.jsx)(x.A,{id:"time"})}),n.hasYoung&&(0,r.jsx)(L.tU.Tab,{tabKey:eb.CyclingYoungRider,children:(0,r.jsx)(x.A,{id:"young"})}),n.hasSprint&&(0,r.jsx)(L.tU.Tab,{tabKey:eb.CyclingSprint,children:(0,r.jsx)(x.A,{id:"sprint"})}),n.hasClimb&&(0,r.jsx)(L.tU.Tab,{tabKey:eb.CyclingClimb,children:(0,r.jsx)(x.A,{id:"climb"})})]})}):null},eK={[eb.CyclingYoungRider]:"youngRiderPosition",[eb.CyclingSprint]:"sprintPosition",[eb.CyclingClimb]:"climbPosition"},eF=(0,c.createContext)(void 0),eY=e=>{let{children:t,...s}=e;return(0,r.jsx)(eF.Provider,{value:{...s},children:t})},eq=()=>{let e=(0,c.useContext)(eF);if(!e)throw Error();return e},eB=()=>{let{standings:e}=eq(),t=e.reduce((e,t)=>t.updatedAtTimestamp>e?t.updatedAtTimestamp:e,-1/0);return(0,r.jsx)(i.so,{justify:"flex-end",children:(0,r.jsx)(a.EY,{textStyle:"body.small",children:(0,r.jsx)(x.A,{id:"basic.lastUpdated",values:{dateTime:(0,r.jsx)(J.XU,{value:1e3*t,...Q.or.dateTime})}})})})},eW={key:"laps",shortTranslationKey:"motorsport_laps_short",translationKey:"motorsport_legend_laps",showZeroIfUndefined:!0},eH={key:"gap",shortTranslationKey:"gap",translationKey:"gap",maxCellWidth:72,showMinusIfUndefined:!0},eN={key:"time",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72,showMinusIfUndefined:!0},eQ={key:"totalTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72,showMinusIfUndefined:!0},eJ={key:"lapTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:80,hideColumnIfAllUndefined:!0,showMinusIfUndefined:!0},eO={key:"gridPosition",shortTranslationKey:"motorsport_grid_short",translationKey:"motorsport_grid_position"},eV={key:"points",shortTranslationKey:"motorsport_points_short",translationKey:"motorsport_legend_points",hideColumnIfAllUndefined:!0,showZeroIfUndefined:!0},eG=[eW,eH,eN],eX=[eW,eH,eN],eZ=[eQ],e$=[eO,eW,eV,eQ],e0=[eW,eH,eN],e1=[eN],e2=[eO,{key:"pitStops",shortTranslationKey:"motorsport_pit_stops_short",translationKey:"motorsport_legend_pit_stops",showZeroIfUndefined:!0},eW,eV,eQ],e4=[{key:"personalFastestLap",shortTranslationKey:"motorsport_laps_short",translationKey:"fastestLap.label",hideColumnIfAllUndefined:!0},{key:"personalFastestLapTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72}],e3=[{key:"startingTyres",shortTranslationKey:"motorsport_starting_tyres_short",translationKey:"motorsport_legend_starting_tyres"},{key:"finishingTyres",shortTranslationKey:"motorsport_finishing_tyres_short",translationKey:"motorsport_legend_finishing_tyres"},{key:"hardTyres",shortTranslationKey:"H",translationKey:"motorsport_legend_laps_on_hard_tyres",renderType:"color"},{key:"mediumTyres",shortTranslationKey:"M",translationKey:"motorsport_legend_laps_on_medium_tyres",renderType:"color"},{key:"softTyres",shortTranslationKey:"S",translationKey:"motorsport_legend_laps_on_soft_tyres",renderType:"color"},{key:"intermediateTyres",shortTranslationKey:"I",translationKey:"motorsport_legend_laps_on_intermediate_tyres",renderType:"color"},{key:"wetTyres",shortTranslationKey:"W",translationKey:"motorsport_legend_laps_on_wet_tyres",renderType:"color"}],e9=[eN],e5=[eW,eH],e7=[eW,eJ],e8=[eJ,eW,eV,{...eH,maxCellWidth:80}],e6=[eW,eJ],te=[eW,eJ],tt=[eW,eJ,eV,eH],ts=[eW,eJ,eV,eH],tr=[{...eW,maxCellWidth:48},{...eV,maxCellWidth:48}],tn=[eW,eH],ta=[eW],ti=[eW,eJ,eV,eH],tl=[{...eN,maxCellWidth:80}],to=[{key:"youngRider",shortTranslationKey:"young_rider",translationKey:"young_rider",showMinusIfUndefined:!0,maxCellWidth:80}],td=[{key:"sprint",shortTranslationKey:"Pts",translationKey:"Pts",showMinusIfUndefined:!0,maxCellWidth:40}],tc=[{key:"climb",shortTranslationKey:"Pts",translationKey:"Pts",showMinusIfUndefined:!0,maxCellWidth:40}];var tu=s(70764);let tx=(e,t,s,r)=>s.map(s=>{let a=t[s.key];return e.id===tu.h.WRC?{...s,value:1===t.position?t.time:t.gap}:([n.CEM.Race,n.CEM.Sprint].includes(r)&&"totalTime"===s.key&&1!==t.position&&(a=t.lapsBehind||t.gap),[n.CEM.SprintQualifyingPart,n.CEM.Practice,n.CEM.PracticePart,n.CEM.Qualifying,n.CEM.QualifyingPart].includes(r)&&"gap"===s.key&&1===t.position&&(a=t.time),{...s,value:a})}),tg=e=>{switch(e){case eb.Summary:return e2;case eb.Tyres:return e3;case eb.FastestLap:return e4;default:return[]}},th=e=>{switch(e){case n.CEM.Race:return e8;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return e7;case n.CEM.Practice:case n.CEM.PracticePart:return e5;default:return[]}},tp=e=>{switch(e){case n.CEM.Race:return ts;case n.CEM.Sprint:return tt;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return te;case n.CEM.Practice:case n.CEM.PracticePart:return e6;default:return[]}},tm=e=>{switch(e){case n.CEM.Race:return ti;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return ta;case n.CEM.Practice:case n.CEM.PracticePart:return tn;default:return[]}},tj=(e,t)=>{switch(e){case n.CEM.Practice:case n.CEM.PracticePart:return eG;case n.CEM.Sprint:return e$;case n.CEM.SprintQualifying:return eZ;case n.CEM.SprintQualifyingPart:return eX;case n.CEM.Qualifying:return e1;case n.CEM.QualifyingPart:return e0;case n.CEM.Race:return tg(t);default:return[]}},ty=e=>{if(!e)return[];switch(e){case eb.CyclingYoungRider:return to;case eb.CyclingSprint:return td;case eb.CyclingClimb:return tc;default:return tl}},tf=(e,t,s)=>{switch(e){case tu.h.WRC:return e9;case tu.h.Indycar:return th(t);case tu.h.MotoGP:case tu.h.Moto3:case tu.h.Moto2:case tu.h.Superbike:case tu.h.DTM:return tp(t);case tu.h.NascarSprintCup:case tu.h.NascarXfinity:case tu.h.NascarCampingWorld:return tr;case tu.h.FormulaE:return tm(t);case tu.h.F1:return tj(t,s);case tu.h.CyclingMen:case tu.h.CyclingWomen:return ty(s);default:return[]}},tv=(e,t)=>!(e.hideColumnIfAllUndefined&&t.every(t=>void 0===t[e.key])),tb=(e,t,s,r)=>e?tf(e.id,s,r).filter(e=>tv(e,t)):[],tS=(e,t,s,r,n)=>{if(!e)return[];let a=tf(e.id,r,n);return tx(e,s,a,r).filter(e=>tv(e,t))},tC=e=>[...e].sort((e,t)=>{let s=e=>{if(!e)return 1/0;let[t,s]=e.split(":");return 6e4*parseInt(t)+1e3*parseFloat(s)};return s(e.personalFastestLapTime)-s(t.personalFastestLapTime)}),tw=(e,t)=>t===eb.FastestLap?tC(e):e;var t_=s(62042);let tT=(0,t_.Fj)({variants:{type:{hard:{bg:"rating.s00"},medium:{bg:"rating.s65"},soft:{bg:"rating.s10"},intermediate:{bg:"rating.s70"},wet:{bg:"rating.s80"}}}}),tE=(0,i.I4)("div",tT);var tM=s(17502);let tL={S:"soft",M:"medium",H:"hard",I:"intermediate",W:"wet"},tP=e=>{let{tyreInfo:t,totalLaps:s}=e;return(0,r.jsx)(i.so,{w:"100%",height:"md",gap:"[1px]",children:void 0!==t&&void 0!==s?t.map((e,t)=>(0,r.jsx)(i.so,{justify:"center",style:{width:"".concat(e.laps/Number(s)*100,"%")},children:(0,r.jsx)(a.EY,{textStyle:"table.small",children:e.laps})},t)):(0,r.jsx)("div",{})})},tk=e=>{let{tyreInfo:t,totalLaps:s}=e;return(0,r.jsx)(i.so,{w:"100%",bg:"neutrals.nLv5",height:"sm",br:"sm",gap:"[1px]",overflow:"hidden",children:void 0!==t&&void 0!==s?t.map((e,t)=>(0,r.jsx)(tE,{type:tL[e.type],style:{width:"".concat(e.laps/Number(s)*100,"%")}},t)):(0,r.jsx)("div",{})})},tA=e=>{var t,s;let{driver:a,tyreInfo:l}=e,{stage:o}=ej();return(0,r.jsx)(tM.A,{team:a.team,outrightType:n.SNJ.Competitor,children:(0,r.jsx)(i.so,{flexGrow:1,justify:"flex-end",h:"4xl",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4",children:(0,r.jsx)(i.so,{alignItems:"center",justify:"center",px:"sm",maxW:"[250px]",width:"100%",children:(0,r.jsxs)(i.BJ,{gap:"xs",flexGrow:1,children:[(0,r.jsx)(tP,{tyreInfo:l,totalLaps:null==(t=o.info)?void 0:t.laps}),(0,r.jsx)(tk,{tyreInfo:l,totalLaps:null==(s=o.info)?void 0:s.laps})]})})})})},tz=()=>{let{stage:e}=ej(),{selectedRaceCategory:t,selectedStageType:s,standings:n}=eq(),l=tb(e.uniqueStage,n,s,t).filter(e=>e.translationKey!==e.shortTranslationKey);return 0===l.length?null:(0,r.jsx)("div",{children:(0,r.jsx)(L.nD,{children:(0,r.jsxs)(L.nD.Item,{defaultOpened:!0,br:"md",overflow:"hidden",children:[(0,r.jsx)(L.nD.Trigger,{bg:"surface.s2",children:(0,r.jsx)(a.EY,{textStyle:"display.small",children:(0,r.jsx)(x.A,{id:"legend"})})}),(0,r.jsx)(L.nD.Content,{children:(0,r.jsx)(i.BJ,{px:"md",bg:"surface.s2",pb:"lg",children:l.map(e=>(0,r.jsxs)(i.zt,{children:[(0,r.jsx)(i.az,{w:"2xl",children:"color"===e.renderType?(0,r.jsx)(tE,{w:"100%",h:"sm",type:tL[e.shortTranslationKey],br:"lg"}):(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,fontSize:"xs",children:(0,r.jsx)(x.A,{id:e.shortTranslationKey})})}),(0,r.jsx)(i.az,{children:(0,r.jsx)(a.EY,{textStyle:"body.small",color:"neutrals.nLv1",lineHeight:1,fontSize:"xs",children:(0,r.jsx)(x.A,{id:e.translationKey})})})]},e.key))})})]})})})},tI=e=>{var t;let{driver:s}=e,{stage:n}=ej();return(null==(t=n.uniqueStage)?void 0:t.id)===tu.h.F1?(0,r.jsx)(i.az,{style:{backgroundColor:null==s?void 0:s.teamColors.primary,borderBottomRightRadius:"2px",borderTopRightRadius:"2px"},w:"[4px]",h:"[100%]"}):(0,r.jsx)(i.az,{w:"xs"})},tD=e=>{let{driver:t,didNotFinish:s}=e;if(s)return(0,r.jsx)(i.so,{w:"xl",justify:"center",children:(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"[currentcolor]",lineHeight:1,textAlign:"center",children:"-"})});let n=function(e,t){if(void 0!==t&&void 0!==e){if(t===e)return;let s=e-t;return{positionsChanged:Math.abs(s),direction:s>0?"up":"down"}}}(t.gridPosition,t.position);return(0,r.jsxs)(i.BJ,{gap:"xs",justify:"center",w:"xl",children:[(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv1",lineHeight:1,textAlign:"center",children:t.position}),void 0!==n&&(0,r.jsx)(i.so,{align:"center",children:"up"===n.direction?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"status.success.default",lineHeight:1,textAlign:"center",children:n.positionsChanged}),(0,r.jsx)(i.so,{justify:"center",style:{transform:"rotate(180deg)"},children:(0,r.jsx)(E.Bfd,{fill:"success.default",w:12,h:12})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"status.error.default",lineHeight:1,textAlign:"center",children:n.positionsChanged}),(0,r.jsx)(i.so,{justify:"center",children:(0,r.jsx)(E.Bfd,{fill:"error.default",w:12,h:12})})]})})]})},tR=e=>{var t;let{driver:s,team:n}=e;return(0,r.jsxs)(i.BJ,{gap:"xs",children:[(0,r.jsxs)(i.zt,{children:[(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"[currentcolor]",lineHeight:1,children:s.shortName}),(0,r.jsx)(W.w,{alpha2:(null==(t=s.country)?void 0:t.alpha2)||"international",size:12})]}),n&&(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,fontWeight:"lighter",maxW:"[120px]",truncate:!0,children:n.name})]})},tU=e=>{let{driver:t}=e,s="DNS"===t.gap,a="DNF"===t.gap,l="Disqualified"===t.comment,o=s||a||l;return(0,r.jsx)(tM.A,{team:t.team,outrightType:n.SNJ.Competitor,children:(0,r.jsxs)(i.zt,{h:"4xl",py:"xs",bg:"surface.s1",gap:"sm",pr:"sm",borderBottom:"1px solid",borderColor:"neutrals.nLv4",color:o?"neutrals.nLv3":"neutrals.nLv1",children:[(0,r.jsx)(tI,{driver:t.parentTeam}),(0,r.jsx)(tD,{driver:t,didNotFinish:o}),(0,r.jsx)(tR,{driver:t.team,team:t.parentTeam})]})})},tK=()=>{let{standings:e,selectedRaceCategory:t}=eq();return(0,r.jsx)(i.az,{children:tw(e,t).map(e=>(0,r.jsx)(i.az,{children:(0,r.jsx)(tU,{driver:e})},e.team.id))})},tF=()=>{let{stage:e}=ej(),t=e.uniqueStage&&[tu.h.MotoGP,tu.h.Moto2,tu.h.Moto3,tu.h.Superbike,tu.h.CyclingMen,tu.h.CyclingWomen].includes(e.uniqueStage.id);return(0,r.jsxs)(i.zt,{gap:"sm",alignItems:"center",px:"sm",h:"lg",children:[(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv3",truncate:!0,w:"[28px]",children:(0,r.jsx)(x.A,{id:"position.short"})}),(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv3",truncate:!0,children:(0,r.jsx)(x.A,{id:t?"riders.bikes":"motorsport_driver"})})]})},tY=()=>(0,r.jsxs)(i.BJ,{flexShrink:0,children:[(0,r.jsx)(tF,{}),(0,r.jsx)(tK,{})]}),tq=()=>{let{stage:e}=ej(),{selectedRaceCategory:t,selectedStageType:s,standings:n}=eq(),l=tb(e.uniqueStage,n,s,t);return(0,r.jsxs)(i.zt,{gap:"0",alignItems:"center",h:"lg",children:[(0,r.jsx)(i.az,{flexGrow:1}),l.map(e=>(0,r.jsx)(i.ov,{style:{minWidth:e.maxCellWidth||28},children:(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,r.jsx)(x.A,{id:e.shortTranslationKey})})},e.key))]})},tB=()=>(0,r.jsx)(i.so,{flexGrow:1,justify:"flex-end",h:"lg",children:(0,r.jsxs)(i.so,{justify:"space-between",maxW:"[250px]",w:"[100%]",children:[(0,r.jsx)(i.ov,{style:{width:28},children:(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,r.jsx)(x.A,{id:"motorsport_starting_tyres_short"})})}),(0,r.jsx)(i.ov,{style:{width:28},children:(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,r.jsx)(x.A,{id:"motorsport_finishing_tyres_short"})})})]})}),tW=()=>{let{selectedRaceCategory:e}=eq();return e===eb.Tyres?(0,r.jsx)(tB,{}):(0,r.jsx)(tq,{})},tH=e=>{var t,s,n,a;let{driver:i,statistic:l,didNotFinish:o,didNotStart:d,isDisqualified:c}=e;return"totalTime"===l.key?o?(0,r.jsx)(r.Fragment,{children:"DNF"}):d?(0,r.jsx)(r.Fragment,{children:"DNS"}):c?(0,r.jsx)(r.Fragment,{children:"DSQ"}):void 0!==i.lapsBehind?(0,r.jsxs)(r.Fragment,{children:["+ ",l.value," ",1===i.lapsBehind?"lap":"laps"]}):l.showMinusIfUndefined?(0,r.jsx)(r.Fragment,{children:null!=(t=l.value)?t:"-"}):(0,r.jsx)(r.Fragment,{children:null!=(s=l.value)?s:"-"}):l.showZeroIfUndefined?(0,r.jsx)(r.Fragment,{children:null!=(n=l.value)?n:0}):l.showMinusIfUndefined?(0,r.jsx)(r.Fragment,{children:null!=(a=l.value)?a:"-"}):(0,r.jsx)(r.Fragment,{children:l.value})},tN=e=>{let{driver:t,items:s}=e,l="DNS"===t.gap,o="DNF"===t.gap,d="Disqualified"===t.comment,c=l||o||d;return(0,r.jsx)(tM.A,{team:t.team,outrightType:n.SNJ.Competitor,children:(0,r.jsxs)(i.zt,{gap:"[0px]",alignItems:"center",h:"4xl",color:c?"neutrals.nLv3":"neutrals.nLv1",children:[(0,r.jsx)(i.az,{flexGrow:1,h:"[100%]",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4"}),s.map(e=>(0,r.jsx)(i.ov,{style:{minWidth:e.maxCellWidth||28},h:"4xl",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4",children:(0,r.jsx)(a.EY,{textStyle:"table.medium",color:"[currentcolor]",children:(0,r.jsx)(tH,{driver:t,statistic:e,didNotFinish:o,didNotStart:l,isDisqualified:d})})},e.key))]})})},tQ=e=>{let{item:t}=e,{stage:s}=ej(),{selectedRaceCategory:n,selectedStageType:a,standings:i}=eq();return n===eb.Tyres?(0,r.jsx)(tA,{driver:t,tyreInfo:t.tyreInfo}):(0,r.jsx)(tN,{driver:t,items:tS(s.uniqueStage,i,t,a,n)})},tJ=()=>{let{standings:e,selectedRaceCategory:t}=eq();return(0,r.jsx)(i.az,{children:tw(e,t).map(e=>(0,r.jsx)(tQ,{item:e},e.team.id))})},tO=()=>(0,r.jsxs)(i.BJ,{overflowX:"auto",flexGrow:1,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,r.jsx)(tW,{}),(0,r.jsx)(tJ,{})]}),tV=()=>(0,r.jsx)(i.VJ,{inline:"sm",children:(0,r.jsxs)(i.so,{children:[(0,r.jsx)(tY,{}),(0,r.jsx)(tO,{})]})}),tG=e=>{let{data:t,error:s,isLoading:r}=(0,ec.Ay)(n.dVR.standings(function(e){return e.type.id===n.CEM.Practice&&e.partSubstages&&e.partSubstages.length>0?e.partSubstages[0].id:e.id}(e),n.SNJ.Competitor),{refreshInterval:15*Q.Z2});return{data:(null==t?void 0:t.standings)||[],error:s,loading:r}},tX=e=>{let{data:t}=e,[s,a]=(0,c.useState)(eb.CyclingTime);return(0,r.jsx)(eY,{standings:function(e,t){return t===eb.CyclingTime?e:e.filter(e=>!!e.position&&e[eK[t]]).sort((e,s)=>{let r=e[eK[t]],n=s[eK[t]];return r&&n?r-n:0})}(t,s),selectedStageType:n.CEM.Stage,selectedRaceCategory:s,children:(0,r.jsxs)(i.BJ,{gap:"lg",children:[(0,r.jsx)(eU,{tabs:function(e){return{hasYoung:e.some(e=>void 0!==e.youngRiderPosition||void 0!==e.youngRider),hasSprint:e.some(e=>void 0!==e.sprintPosition||void 0!==e.sprint),hasClimb:e.some(e=>void 0!==e.climbPosition||void 0!==e.climb)}}(t),selectedCategory:s,onSelectedCategoryChange:e=>a(e)}),(0,r.jsx)(tV,{}),(0,r.jsx)(eB,{}),(0,r.jsx)(tz,{})]})})},tZ=e=>{let{stage:t}=e,{data:s,error:n,loading:a}=tG(t);return n?(0,r.jsx)(eR.p,{graphic:"race-start",descriptionMessageId:"motorsport_results_empty_message"}):a?(0,r.jsx)(i.az,{h:"[900px]"}):(0,r.jsx)(tX,{data:s})},t$=e=>{let{item:t}=e;return t?(0,r.jsx)(r.Fragment,{children:t.name}):null},t0=e=>{let{selectedStage:t,onStageChange:s,stages:n}=e;return(0,r.jsx)(L.ms,{items:n,selectedItem:t,renderItem:e=>(0,r.jsx)(t$,{item:e}),onSelectedItemChange:e=>null!==e.selectedItem&&s(e.selectedItem.id)})},t1=e=>{let{stages:t}=e;return(0,r.jsx)(i.VJ,{inline:"sm",display:t.length>1?"block":"none",children:(0,r.jsx)(L.tU.List,{scroll:!0,py:"1px",children:t.map((e,s)=>(0,r.jsx)(L.tU.Tab,{tabKey:e.id,style:{marginLeft:0===s?"8px":void 0,marginRight:s===t.length-1?"8px":void 0},children:e.description},e.id))})})},t2=e=>{let{isDesktop:t}=(0,a.$c)();return 1===e.stages.length?null:t&&e.stages.length>=6?(0,r.jsx)(t0,{...e}):(0,r.jsx)(t1,{...e})},t4=e=>{let{stages:t}=e,[s,n]=(0,c.useState)(t[t.length-1]),a=e=>{let s=t.find(t=>t.id===e);s&&n(s)};return(0,r.jsx)(i.BJ,{mdDown:{p:"sm",bg:"surface.s0"},children:(0,r.jsx)(i.az,{p:"sm",elevation:{mdDown:"2"},br:"lg",bg:"surface.s1",children:(0,r.jsx)(L.tU,{variant:"secondary",value:s.id,onChange:a,children:(0,r.jsxs)(i.BJ,{children:[(0,r.jsx)(t2,{selectedStage:s,onStageChange:a,stages:t}),(0,r.jsxs)(i.BJ,{children:[(0,r.jsx)(eD,{stage:s}),(0,r.jsx)(i.VJ,{inline:"sm",children:(0,r.jsx)(i.az,{w:"100%",h:"[1px]",bg:"neutrals.nLv4"})})]}),t.map(e=>(0,r.jsx)(L.tU.Panel,{tabKey:e.id,children:(0,r.jsx)(tZ,{stage:s})},e.id))]})})})})};function t3(e){return e.hasRaceTab?n.CEM.Race:e.hasQualifyingTab?n.CEM.Qualifying:e.hasSprintTab?n.CEM.Sprint:n.CEM.Practice}function t9(e,t){return e.status.type===n.hzM.notstarted?t[0]:t[t.length-1]}let t5=e=>{let{stage:t,data:s,error:n,loading:a,raceCategory:l}=e;return n?(0,r.jsx)(eR.p,{graphic:"race-start",descriptionMessageId:"motorsport_results_empty_message"}):a?(0,r.jsx)(i.az,{h:"[900px]"}):(0,r.jsx)(eY,{standings:s,selectedStageType:t.type.id,selectedRaceCategory:l,children:(0,r.jsxs)(i.BJ,{gap:"lg",children:[(0,r.jsx)(tV,{}),(0,r.jsx)(eB,{}),(0,r.jsx)(tz,{})]})})},t7=e=>{let{stages:t}=e,{stage:s}=ej(),[n,a]=(0,c.useState)(t9(s,t)),{data:l,error:o,loading:d}=tG(n),u=e=>{a(t.find(t=>t.id===e))};return(0,c.useEffect)(()=>{a(t9(s,t))},[t]),(0,r.jsx)(L.tU,{variant:"quaternary",value:n.id,onChange:u,children:(0,r.jsxs)(i.BJ,{gap:"lg",children:[(0,r.jsx)(t2,{selectedStage:n,onStageChange:u,stages:t}),(0,r.jsxs)(i.BJ,{children:[(0,r.jsx)(eD,{stage:n}),(0,r.jsx)(i.VJ,{inline:"sm",children:(0,r.jsx)(i.az,{w:"100%",h:"[1px]",bg:"neutrals.nLv4"})})]}),t.map(e=>(0,r.jsx)(L.tU.Panel,{tabKey:e.id,children:(0,r.jsx)(t5,{stage:e,data:l,error:o,loading:d})},e.id))]})})},t8=e=>{let{stages:t}=e,{stage:s}=ej();return s.uniqueStage?s.uniqueStage.id===tu.h.F1?(0,r.jsx)(t6,{stage:t[0]}):(0,r.jsx)(t7,{stages:t}):null},t6=e=>{let{stage:t}=e,s=tG(t),[n,a]=(0,c.useState)(eb.Summary),l=s.data.some(e=>void 0!==e.tyreInfo),o=s.data.some(e=>void 0!==e.personalFastestLapTime),d=o||l;return(0,r.jsx)(L.tU,{variant:"quaternary",value:n,onChange:e=>{a(e)},children:(0,r.jsxs)(i.BJ,{gap:"lg",children:[(0,r.jsx)(i.az,{pt:"sm",children:(0,r.jsx)(eD,{stage:t})}),(0,r.jsxs)(L.tU.List,{scroll:!0,py:"xs",display:d?"flex":"none",children:[(0,r.jsx)(L.tU.Tab,{tabKey:eb.Summary,children:"Summary"}),l&&(0,r.jsx)(L.tU.Tab,{tabKey:eb.Tyres,children:(0,r.jsx)(x.A,{id:"motorsport_tyres"})}),o&&(0,r.jsx)(L.tU.Tab,{tabKey:eb.FastestLap,children:(0,r.jsx)(x.A,{id:"fastestLap.label"})})]}),(0,r.jsx)(L.tU.Panel,{tabKey:eb.Summary,children:(0,r.jsx)(t5,{stage:t,...s,raceCategory:eb.Summary})}),(0,r.jsx)(L.tU.Panel,{tabKey:eb.Tyres,children:(0,r.jsx)(t5,{stage:t,...s,raceCategory:eb.Tyres})}),(0,r.jsx)(L.tU.Panel,{tabKey:eb.FastestLap,children:(0,r.jsx)(t5,{stage:t,...s,raceCategory:eb.FastestLap})})]})})},se=()=>{let{isMobile:e}=(0,a.$c)();return e?(0,r.jsxs)(i.BJ,{children:[(0,r.jsx)(eE,{}),(0,r.jsx)(eL,{}),(0,r.jsx)(ew,{})]}):null},st=e=>{let{stages:t}=e,s=function(e){return{hasPracticeTab:e.practice.length>0,hasSprintTab:e.sprint.length>0,hasQualifyingTab:e.qualifying.length>0,hasRaceTab:e.race.length>0}}(t),[a,l]=(0,c.useState)(t3(s));(0,c.useEffect)(()=>{l(t3(s))},[t]);let o=Object.values(s).filter(Boolean).length>1;return(0,r.jsxs)(i.BJ,{mdDown:{p:"sm",bg:"surface.s0"},children:[(0,r.jsx)(i.az,{p:"sm",elevation:{mdDown:"2"},br:"lg",bg:"surface.s1",children:(0,r.jsx)(L.tU,{variant:"secondary",value:a,onChange:e=>l(e),children:(0,r.jsxs)(i.BJ,{children:[(0,r.jsxs)(L.tU.List,{scroll:!0,py:"1px",display:o?"flex":"none",children:[s.hasPracticeTab&&(0,r.jsx)(L.tU.Tab,{tabKey:n.CEM.Practice,children:(0,r.jsx)(x.A,{id:"motorsport_f1_free_practice"})}),s.hasSprintTab&&(0,r.jsx)(L.tU.Tab,{tabKey:n.CEM.Sprint,children:(0,r.jsx)(x.A,{id:"sprint"})}),s.hasQualifyingTab&&(0,r.jsx)(L.tU.Tab,{tabKey:n.CEM.Qualifying,children:(0,r.jsx)(x.A,{id:"motorsport_qualifying"})}),s.hasRaceTab&&(0,r.jsx)(L.tU.Tab,{tabKey:n.CEM.Race,children:(0,r.jsx)(x.A,{id:"race"})})]}),s.hasPracticeTab&&(0,r.jsx)(L.tU.Panel,{tabKey:n.CEM.Practice,children:(0,r.jsx)(t7,{stages:t.practice})}),s.hasSprintTab&&(0,r.jsx)(L.tU.Panel,{tabKey:n.CEM.Sprint,children:(0,r.jsx)(t7,{stages:t.sprint})}),s.hasQualifyingTab&&(0,r.jsx)(L.tU.Panel,{tabKey:n.CEM.Qualifying,children:(0,r.jsx)(t7,{stages:t.qualifying})}),t.race&&(0,r.jsx)(L.tU.Panel,{tabKey:n.CEM.Race,children:(0,r.jsx)(t8,{stages:t.race})})]})})}),(0,r.jsx)(se,{})]})},ss=()=>{let{stage:e}=ej(),{data:t,error:s,isLoading:r}=(0,ec.Ay)(["STAGE_SPORT_FETCH_ALL_STAGES",n.dVR.substages(e.id)],()=>sr(e),{refreshInterval:Q.pY});return{data:t,error:s,loading:r}};async function sr(e){if(!e.uniqueStage)throw Error("Please provide unique stage id");try{let t=await (0,n.TtD)(n.dVR.substages(e.id));if([tu.h.CyclingMen,tu.h.CyclingWomen].includes(e.uniqueStage.id))return{practice:[],qualifying:[],sprint:[],race:t.stages};let s=t.stages.filter(e=>e.type.id===n.CEM.Practice),r=t.stages.find(e=>e.type.id===n.CEM.Qualifying),a=t.stages.find(e=>e.type.id===n.CEM.SprintQualifying),i=t.stages.find(e=>e.type.id===n.CEM.Sprint),l=t.stages.filter(e=>e.type.id===n.CEM.Race),[o,d]=await Promise.all([sn(r),sn(a)]);return{practice:s,qualifying:sa(o,[r]),sprint:sa(d,[a,i]),race:l}}catch(t){return{practice:[],qualifying:[],sprint:[],race:[e]}}}async function sn(e){if(!e)return{stages:[]};try{return await (0,n.TtD)(n.dVR.substages(e.id))}catch(e){return{stages:[]}}}function sa(e,t){return[...e.stages,...t].filter(e=>void 0!==e)}let si=e=>{let{data:t}=e;return(0,k.o)()===n.QCR.Motorsport?(0,r.jsx)(st,{stages:t}):(0,r.jsx)(t4,{stages:t.race})},sl=()=>{let{data:e,error:t,loading:s}=ss();return t?null:s||!e?(0,r.jsx)(i.az,{h:"[900px]"}):(0,r.jsx)(si,{data:e})},so=(e,t,s,r)=>e===n.QCR.Cycling&&t.type.id!==n.CEM.Discipline||e===n.QCR.Motorsport&&!!r,sd=(e,t,s,r,a)=>{var i;return e===n.QCR.Cycling&&!!a&&void 0!==t.info||e===n.QCR.Motorsport&&(null==(i=t.info)?void 0:i.circuitCity)!==void 0&&!!s},sc=[n.hzM.inprogress,n.hzM.finished],su=(e,t,s,r,a)=>{if(e===n.QCR.Motorsport){if(!a)return ev.Results;let e=r?ev.Rankings:ev.Info;return sc.includes(t.status.type)?ev.Results:e}return ev.Results},sx=()=>{let e=(0,k.o)(),{stage:t}=ej(),{isDesktop:s,isMobile:r}=(0,a.$c)(),{hasMedia:i,hasSubstages:l}=(0,eT.A)({hasMedia:{route:n.dVR.highlights(t.id)},hasSubstages:{route:n.dVR.substages(t.id)}}),o=sd(e,t,s,r,!!l),d=so(e,t,s,r);return{initialTab:su(e,t,s,r,o),hasInfo:o,hasRankings:d,hasMedia:i}},sg=()=>{let{initialTab:e,hasInfo:t,hasRankings:s,hasMedia:n}=sx();return(0,r.jsxs)(L.tU,{variant:"primary",fullWidthTabs:!0,initialValue:e,children:[(0,r.jsxs)(L.tU.List,{underline:!0,children:[(0,r.jsx)(L.tU.Tab,{tabKey:ev.Results,children:(0,r.jsx)(x.A,{id:"basic.results"})}),t&&(0,r.jsx)(L.tU.Tab,{tabKey:ev.Info,children:(0,r.jsx)(x.A,{id:"info"})}),s&&(0,r.jsx)(L.tU.Tab,{tabKey:ev.Rankings,children:(0,r.jsx)(x.A,{id:"rankings"})}),n&&(0,r.jsx)(L.tU.Tab,{tabKey:ev.Media,children:(0,r.jsx)(x.A,{id:"media"})})]}),(0,r.jsx)(L.tU.Panel,{tabKey:ev.Results,children:(0,r.jsx)(sl,{})}),(0,r.jsx)(L.tU.Panel,{tabKey:ev.Info,children:(0,r.jsx)(eP,{})}),(0,r.jsx)(L.tU.Panel,{tabKey:ev.Rankings,children:(0,r.jsx)(eI,{})}),(0,r.jsx)(L.tU.Panel,{tabKey:ev.Media,children:(0,r.jsx)(eA,{})})]})},sh=e=>{let{stage:t}=e;return(0,n.S$s)()?null:(0,r.jsx)(em,{stage:t,children:(0,r.jsxs)(i.az,{bg:"surface.s1",elevation:{md:"2"},br:{md:"lg"},w:"100%",children:[(0,r.jsx)(ef,{}),(0,r.jsx)(sg,{})]})})};var sp=s(8712),sm=s(95457);let sj=e=>{let{seasons:t,activeSeasonId:s,setActiveSeasonId:l}=e,o=(0,k.o)(),d=(0,e_.useTheme)(),c=t[0].uniqueStage;return c?(0,r.jsx)(i.az,{position:"relative",h:{base:"[110px]",md:"[130px]"},style:{backgroundImage:"url(".concat(n.qLD.image(c.id),")"),backgroundPosition:"center center",backgroundSize:"cover"},children:(0,r.jsx)(i.so,{position:"absolute",left:"0",top:"0",justify:"space-between",w:"100%",h:"100%",style:{backgroundImage:"\n linear-gradient(\n ".concat(d.colors.overlay.darken3,",\n ").concat(d.colors.overlay.darken3,"),\n linear-gradient(\n ").concat((0,sm.SZ)(d,c.id),",\n ").concat((0,sm.SZ)(d,c.id),"\n )")},children:(0,r.jsxs)(i.so,{w:"100%",p:"md",justify:"space-between",align:"flex-start",children:[(0,r.jsxs)(i.zt,{children:[o!==n.QCR.Cycling&&(0,r.jsx)(W.w,{flag:c.slug,name:c.name,size:40}),(0,r.jsxs)(i.BJ,{gap:"xs",children:[(0,r.jsx)(a.EY,{textStyle:"assistive.default",color:"onColor.primary",lineHeight:1,children:(0,r.jsx)(H.c,{entity:c})}),(0,r.jsx)(i.az,{className:(0,t_.AH)({"& button":{padding:"0",bg:"[transparent]","&:focus:not(:active)":{boxShadow:"[none]"}}}),children:(0,r.jsx)(L.ms,{items:t,selectedItem:t.find(e=>e.id===s),onSelectedItemChange:e=>l(e.selectedItem.id),isOnColor:!0,renderItem:(e,t)=>e?t?(0,r.jsx)(a.EY,{textStyle:"display.large",color:"onColor.primary",children:e.year||e.description}):(0,r.jsx)(r.Fragment,{children:e.year||e.description}):null})})]})]}),(0,r.jsx)(sp.Q,{id:c.id,location:f.y.Header})]})})}):null};var sy=s(28132),sf=s(55057);let sv=()=>{let{selectedSeasonId:e}=B(),[t,s]=(0,c.useState)(e),[r,n]=(0,c.useState)(sy.H.Races),[a,i]=(0,sf.h)(t);return{activeSeasonId:t,setActiveSeasonId:s,activeTab:r,setActiveTab:n,races:a,stageMapping:i}},sb=()=>{let{selectedUniqueStageId:e}=B(),{data:t,error:s,isLoading:r}=(0,ec.Ay)(n.qLD.seasons(e));return{seasons:(null==t?void 0:t.seasons)||[],error:s,loading:r}};var sS=s(84942);let sC=e=>{let{stages:t}=e;if(!t||0===t.length)return null;let s=t[0].startDateTimestamp,n=t[t.length-1].endDateTimestamp;return 1===t.length&&void 0!==s?(0,r.jsxs)(a.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:[(0,r.jsx)(J.XU,{value:1e3*s,day:"numeric",month:"short"})," "]}):(0,r.jsxs)(a.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:[s&&(0,r.jsx)(J.XU,{value:1e3*s,day:"numeric",month:"short"}),n&&(0,r.jsxs)(r.Fragment,{children:["\xa0 - \xa0",(0,r.jsx)(J.XU,{value:1e3*n,day:"numeric",month:"short"})]})]})},sw=(0,t_.Fj)({base:{},variants:{status:{notStarted:{color:"neutrals.nLv3"},finished:{color:"neutrals.nLv3"},today:{color:"neutrals.nLv1"},live:{color:"status.live"}}}}),s_=(0,i.I4)(i.so,sw),sT=e=>{let{stage:t}=e,s=t.substages||t.eventSubstages||[],n=s.length>0?s[s.length-1]:t,l=(null==n?void 0:n.startDateTimestamp)||t.startDateTimestamp;return(0,r.jsxs)(i.so,{px:"md",justify:"space-between",children:[l&&(0,r.jsxs)(a.EY,{textStyle:"body.small",color:"neutrals.nLv3",ml:"2xs",children:[(0,r.jsx)(E.ABt,{mr:"sm",fill:"currentcolor"}),(0,r.jsx)(J.XU,{value:1e3*l,...Q.or.dateTime})," •"," ",(0,r.jsx)(V.N,{id:n.description})]}),t.winner&&(0,r.jsxs)(i.zt,{gap:"sm",flexShrink:0,children:[(0,r.jsx)(E.$dv,{fill:"sofaSingles.value"}),(0,r.jsx)(a.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:t.winner.name})]})]})},sE=e=>{let{isLive:t,isToday:s,notStartedYet:r}=e;return t?"live":s&&r?"today":r?"notStarted":"finished"},sM=e=>{let{stage:t,isTimeline:s,isLast:i}=e,l=null==t?void 0:t.startDateTimestamp;if(!l)return null;let o=t.status.type===n.hzM.inprogress,d=t.status.type===n.hzM.notstarted,c=(0,Q.cK)(1e3*l);return(0,r.jsxs)(s_,{position:"relative",gap:"sm",align:"center",status:sE({isLive:o,isToday:c,notStartedYet:d}),_before:{content:'""',bg:"neutrals.nLv3",w:"[1px]",h:"[10px]",position:"absolute",left:"[3px]",top:"[16px]",display:s&&!i?"block":"none"},children:[(0,r.jsx)(G,{status:t.status.type,isToday:c}),(0,r.jsxs)(a.EY,{textStyle:"body.small",color:"[currentcolor]",children:[o?(0,r.jsx)(x.A,{id:"live"}):c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{id:"today"}),", ",(0,r.jsx)(J.ib,{value:1e3*l})]}):(0,Q.ef)(1e3*l)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{id:"tomorrow"}),", ",(0,r.jsx)(J.ib,{value:1e3*l})]}):(0,r.jsx)(J.XU,{value:1e3*l,...Q.or.dateTime})," ","• ",(0,r.jsx)(V.N,{id:t.description})]})]})},sL=e=>{let{substages:t,timelineOpened:s}=e,n=(0,_.VL)(t);return(0,r.jsx)(r.Fragment,{children:s?(0,r.jsx)(r.Fragment,{children:t.map((e,s)=>(0,r.jsx)(sM,{stage:e,isTimeline:!0,isLast:s===t.length-1},e.id))}):(0,r.jsx)(sM,{stage:n})})},sP=e=>{let{stage:t}=e,[s,n]=(0,c.useState)(!1),l=t.substages||t.eventSubstages||[],o=(0,_.YQ)(t.status.type),d=l.some(e=>void 0!==e.startDateTimestamp);return(0,c.useEffect)(()=>{n(function(e){if(!e)return!1;let t=new Date,s=t.getDay(),r=new Date(t);r.setHours(0,0,0,0),r.setDate(t.getDate()+(0===s?-6:1-s));let n=new Date(r);return n.setDate(r.getDate()+6),n.setHours(23,59,59,999),e.some(e=>{let t=new Date(1e3*e);return t>=r&&t<=n})}(l.map(e=>e.startDateTimestamp).filter(e=>void 0!==e)))},[t]),(0,r.jsxs)(i.so,{px:"md",justify:"space-between",cursor:"pointer",onClick:e=>{!o&&d&&(n(e=>!e),e.stopPropagation(),e.preventDefault())},children:[(0,r.jsx)(i.BJ,{ml:"[6px]",mt:"xs",children:l.length<=1?(0,r.jsx)(sM,{stage:t}):d?(0,r.jsx)(sL,{substages:l,timelineOpened:s}):(0,r.jsx)(sM,{stage:t})}),o?(0,r.jsx)(a.EY,{textStyle:"body.small",color:"status.error.default",children:(0,r.jsx)(x.A,{id:"canceled"})}):(0,r.jsx)(r.Fragment,{children:l.length>1&&d&&(0,r.jsx)(i.so,{w:"xl",h:"xl",color:"neutrals.nLv3",children:(0,r.jsx)(E.zQC,{icon:"chevron-down",fill:"onSurface.nLv3",style:{transition:"0.2s all",transform:"rotate(".concat(180*!!s,"deg)")}})})})]})},sk=e=>{let{stage:t}=e;return t.status.type===n.hzM.finished?(0,r.jsx)(sT,{stage:t}):(0,r.jsx)(sP,{stage:t})},sA=e=>{let{stage:t,isLast:s}=e,{selectedEventStageId:n}=B(),l=(0,k.o)();return(0,r.jsx)(S.LC,{stage:t,sportSlug:l,children:(0,r.jsx)(i.az,{py:"md",pl:"lg",bg:{base:"surface.s1",md:n===t.id?"neutral.highlight":"surface.s1",_hover:"surface.s0"},md:{borderBottom:"1px solid",borderColor:s?"[transparent]":"neutrals.nLv4"},mdDown:{elevation:"2",br:"lg",borderBottom:"none"},children:(0,r.jsxs)(i.BJ,{children:[(0,r.jsxs)(i.so,{justify:"space-between",children:[(0,r.jsxs)(i.zt,{children:[(0,r.jsx)(O.Q,{stage:t,size:24}),(0,r.jsxs)(i.BJ,{gap:"2xs",children:[(0,r.jsx)(a.EY,{textStyle:"body.large",lineHeight:1,children:t.description}),(0,r.jsx)(sC,{stages:(null==t?void 0:t.substages)||(null==t?void 0:t.eventSubstages)||[]})]})]}),(0,r.jsx)(i.so,{w:"4xl",h:"2xl",align:"center",justify:"center",borderLeft:"1px solid",borderColor:"neutrals.nLv4",flexShrink:0,children:(0,r.jsx)(v.x,{id:t.id,uniqueStage:t.uniqueStage,location:f.y.RacesTab})})]}),(0,r.jsx)(sk,{stage:t})]})})})},sz=e=>{let{stages:t}=e;return(0,r.jsx)(i.so,{direction:"column",mdDown:{p:"sm",gap:"sm"},children:t.map((e,s)=>(0,r.jsx)(sA,{stage:e,isLast:s===t.length-1},e.id))})},sI=e=>{let{activeSeasonId:t}=e,{stages:s,loading:n,error:a}=(0,sf.u)(t);return a||n?(0,r.jsx)(i.az,{h:"[900px]"}):(0,r.jsx)(sz,{stages:s})},sD=e=>{let{activeSeasonId:t,activeTab:s,setActiveTab:a,seasons:l}=e,o=(0,k.o)(),d=(0,b.A)(),c=l[0].uniqueStage;return c?(0,r.jsxs)(L.tU,{variant:"primary",fullWidthTabs:!0,value:s,onChange:a,children:[(0,r.jsx)(i.az,{color:"onColor.primary",children:(0,r.jsxs)(L.tU.List,{underline:{color:"currentcolor"},mt:"-50px",children:[(0,r.jsx)(L.tU.Tab,{style:{color:"currentcolor"},tabKey:sy.H.Races,children:(0,r.jsx)(x.A,{id:"races"})}),o!==n.QCR.Cycling&&(0,r.jsx)(L.tU.Tab,{style:{color:"currentcolor"},tabKey:sy.H.Rankings,children:(0,r.jsx)(x.A,{id:"app.standings"})})]})}),(0,r.jsx)(L.tU.Panel,{tabKey:sy.H.Races,children:(0,r.jsx)(sI,{activeSeasonId:t})}),(0,r.jsx)(L.tU.Panel,{tabKey:sy.H.Rankings,children:(0,r.jsx)(i.az,{bg:"surface.s1",children:(0,r.jsx)(ez.n,{stageId:t,uniqueStageName:(0,sS.s)(c,d)})})})]}):null},sR=()=>{let{seasons:e,error:t,loading:s}=sb(),{activeTab:n,setActiveTab:a,activeSeasonId:l,setActiveSeasonId:o}=sv();return s?(0,r.jsx)(i.az,{h:"[900px]"}):t?null:(0,r.jsxs)(i.az,{md:{br:"xl",overflow:"hidden",elevation:"2"},w:"100%",children:[(0,r.jsx)(sj,{seasons:e,activeSeasonId:l,setActiveSeasonId:o}),(0,r.jsx)(sD,{activeTab:n,setActiveTab:a,seasons:e,activeSeasonId:l})]})};var sU=s(70389),sK=s(76410),sF=s(99736),sY=s(25862),sq=s(65097);let sB={categories:"stageSport",uniqueStage:"stageSport.uniqueStage",eventStage:"stageSport.race"},sW=e=>{let{page:t,sportSlug:s,eventStage:n,statusCode:l,params:_}=e,T=(0,u.A)(),E=(0,b.A)(),M=(0,d.useRouter)(),{isMobile:L}=(0,a.$c)();return((0,c.useEffect)(()=>{switch(t){case"categories":if((0,sK.Mt)({name:document.title,link:M.asPath,type:M.route}),L)break;case"uniqueStage":if(n.uniqueStage&&(0,sK.u_)(n.uniqueStage.id),L)break;case"eventStage":(0,sK.vV)(n.id)}},[t,M,L]),l)?(0,r.jsx)(sq.default,{statusCode:l}):(0,r.jsxs)(c.Fragment,{children:[(0,r.jsxs)(o(),{children:[(0,p.v)(s,E)?(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"}):null,(0,r.jsx)("link",{rel:"canonical",href:"https://www.sofascore.com".concat(C.z.getTranslatedCanonicalRoute(E,sB[t],_).route)})]}),(0,r.jsx)(w.Ay,{metaKey:"categories"===t?s:"".concat(s,".stage"),descriptionKey:"main.".concat("categories"===t?s:"".concat(s,".stage")),values:{stage:"uniqueStage"!==t&&n.startDateTimestamp?"".concat(n.uniqueStage.name," ").concat(n.description," ").concat(T.formatDate(1e3*n.startDateTimestamp,{month:"short",year:"numeric"})):n.stageParent.description}}),(0,r.jsxs)(y.Ay,{pb:["sm","md"],children:[(0,r.jsxs)(i.so,{bg:{mdDown:"surface.s1"},justify:"space-between",align:"center",children:[(0,r.jsxs)(g.B,{children:["categories"!==t?(0,r.jsx)(g.B.Item,{children:(0,r.jsx)(S.di,{translatedParams:{sport:s},children:(0,r.jsx)(x.A,{id:"sport.".concat(s)})})}):null,"eventStage"===t?(0,r.jsx)(g.B.Item,{children:(0,r.jsx)(S.So,{sportSlug:s,uniqueStage:n.uniqueStage,children:n.uniqueStage.name})}):null,(0,r.jsx)(g.B.Title,{children:"categories"===t?(0,r.jsx)(x.A,{id:"headerTitle.".concat(s)}):"uniqueStage"===t?n.uniqueStage.name:n.description})]}),"eventStage"===t&&(0,r.jsx)(i.az,{bg:"surface.s1",display:{md:"none"},py:"sm",pr:"lg",children:(0,r.jsx)(v.x,{id:n.id,uniqueStage:n.uniqueStage,location:f.y.Header})})]}),(0,r.jsxs)(h.Ws.Provider,{value:s,children:[(0,r.jsx)(q,{selectedUniqueStageId:n.uniqueStage.id,selectedSeasonId:n.stageParent.id,selectedEventStageId:n.id,children:(0,r.jsxs)(i.so,{gap:"xl",alignItems:"flex-start",children:[(0,r.jsx)(i.so,{mdDown:{display:"categories"===t?"block":"none"},w:{base:"100%",md:"3/12"},children:(0,r.jsxs)(i.BJ,{w:"100%",children:[(0,r.jsx)(eh,{}),(0,r.jsx)(m.i,{id:"motorsport.DESKTOP_LEFT"})]})}),(0,r.jsxs)(i.so,{mdDown:{display:"uniqueStage"===t?"block":"none",w:"100%"},md:{w:"5/12"},children:[(0,r.jsx)(sR,{},n.uniqueStage.id),(0,r.jsx)(j.A,{slotId:"motorsport.FLOAT_BANNER"})]}),(0,r.jsx)(i.so,{mdDown:{display:"eventStage"===t?"block":"none"},w:{base:"100%",md:"4/12"},md:{flexShrink:0},children:(0,r.jsx)(sh,{stage:n})})]})}),(0,r.jsx)(m.i,{id:"motorsport.DESKTOP_BOTTOM",mt:"md"})]})]})]},s)};sW.getInitialProps=sF.Ay.getInitialPageProps(e=>async t=>{let r,{req:a,query:i,res:l}=t,o=a?a._originalUrl:t.asPath,d=(null==a?void 0:a.params)||i,c=d.uniqueStageId?"uniqueStage":d.raceId?"eventStage":"categories",u=C.z.getCurrentLocale(o),x=C.z.getSportKey(d.sport,u),g=(await s(23498)("./route.".concat(sB[c],".json"))).default;e.dispatch((0,sU.Od)(g)),e.dispatch((0,sY.Vy)(x));let h=d.uniqueStageId?Number(d.uniqueStageId):0;try{if("categories"===c){let e=(await n.Tps.fetchSportCategories(x)).categories.sort((e,t)=>(t.priority||0)-(e.priority||0));for(let t=0;t{"use strict";s.r(t),s.d(t,{default:()=>h});var r=s(6029),n=s(14092),a=s(41249),i=s(95669),l=s.n(i),o=s(947),d=s(90248),c=s(54409),u=s(76868),x=s(29129),g=s(70591);function h(e){let{statusCode:t}=e;n.O({statusCode:t});let s=(0,o.A)().formatMessage({id:404===t?"error.pageNotFound":"error.anErrorOccurred"});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l(),{children:[(0,r.jsx)("title",{children:"".concat(t," | ").concat(s||"")}),(0,r.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,r.jsx)("div",{id:"errorPage",children:(0,r.jsx)(x.Ay,{children:(0,r.jsx)(x.xA,{children:(0,r.jsx)(x.fv,{textAlign:"center",my:"xxl",noDividers:!0,children:(0,r.jsxs)(u.p,{graphic:"no-connection",children:[(0,r.jsx)(a.EY,{font:"display.extraLarge",color:"onSurface.nLv3",align:"center",as:"h1",mt:"28px",mb:"xxs",children:t}),(0,r.jsx)(a.EY,{font:"display.medium",color:"onSurface.nLv3",align:"center",as:"h3",children:(0,r.jsx)(d.A,{id:"error.anErrorOccurred"})}),(0,r.jsx)(a.EY,{align:"center",mb:"xxl",as:"div",children:404===t?(0,r.jsx)(d.A,{id:"error.pageCannotBeFound"}):(0,r.jsx)(d.A,{id:"error.somethingWrongWithPage"})}),(0,r.jsx)(g.N_,{routeKey:"home",children:(0,r.jsxs)(a.$n,{children:[(0,r.jsx)(c.pa2,{mt:"-3px"})," ",(0,r.jsx)(d.A,{id:"error.backToSofascore"})]})})]})})})})})]})}h.getInitialProps=async e=>{await n.O(e);let{res:t,err:s}=e;return{statusCode:t?t.statusCode:s?s.statusCode:null}}}},e=>{var t=t=>e(e.s=t);e.O(0,[4092,395,234,5938,7545,3881,636,6593,8792],()=>t(45021)),_N_E=e.O()}]);