!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]="97e88e8c-1f99-4a98-80a6-cf5d40abb713",e._sentryDebugIdIdentifier="sentry-dbid-97e88e8c-1f99-4a98-80a6-cf5d40abb713")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9748],{10400:(e,t,s)=>{s.d(t,{A:()=>eG});var n=s(6029),a=s(76356),r=s(55729),l=s(46222),i=s(89721),o=s(73914),d=s(94565),c=s(6813),u=s(90248),m=s(52466);function x(){return(0,n.jsx)(d.AM,{trigger:(0,n.jsx)(m.G_L,{minW:24,fill:"onSurface.nLv1",cursor:"pointer"}),closeOnOutsideClick:!0,children:(0,n.jsxs)(d.AM.Content,{position:"absolute",w:"320px",style:{right:"100%"},elevation:3,children:[(0,n.jsx)(o.EY,{textStyle:"display.large",display:"block",my:"sm",children:(0,n.jsx)(u.A,{id:"standings_tracker_title"})}),(0,n.jsx)(o.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(u.A,{id:"standings_tracker_general"})}),(0,n.jsxs)(a.so,{direction:"column",mt:"md",children:[(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",ml:"2xl",children:(0,n.jsx)(u.A,{id:"position"})}),(0,n.jsxs)(a.so,{children:[(0,n.jsx)(o._V,{src:"/static/images/performance-graph/chart-info-popover-graphic.png",width:"[180px]",height:"[176px]",alt:"Standings tracker info graphic"}),(0,n.jsxs)(a.az,{children:[(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"secondary.default",display:"block",mt:"[54px]",children:(0,n.jsx)(u.A,{id:"standings_tracker_team_one"})}),(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"primary.default",display:"block",mt:"[14px]",children:(0,n.jsx)(u.A,{id:"standings_tracker_team_two"})})]})]}),(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",ml:"[58px]",children:(0,n.jsx)(u.A,{id:"standings_tracker_week_date"})})]})]})})}var p=s(62042),h=s(93338),g=s(78488),j=s(14297),y=s(36729),v=s(28446),f=s(56591),b=s(51384);function w(e){switch(e){case 0:return"secondary.default";case 1:return"primary.default";case 2:return"status.val";case 3:return"tertiary.default";default:return"neutrals.nLv2"}}s(14632);let S=e=>{let{teamCount:t,selectedWeek:s,setSelectedWeek:l,data:i}=e,{textDirection:d,isMobile:c}=(0,o.$c)(),u="rtl"===d,m=c?8:40,x=Math.max(...i.map(e=>(null==e?void 0:e.length)||0)),S=(0,r.useRef)(null),T=(0,r.useMemo)(()=>(0,v.A)().domain([1,x]).range([0,735]),[x]),A=(0,r.useMemo)(()=>(0,v.A)().domain([1,t]).range([0,211]),[t]),k=(0,b.A)().x(e=>e.x).y(e=>e.y);return(0,r.useEffect)(()=>{if(!S.current||!x)return;let e=(0,f.A)(S.current).select("svg").attr("viewBox","0 0 ".concat(780," ").concat(256)).attr("width","100%").attr("height","100%"),s=(0,g.V4)(A).tickSize(735).tickValues([...Array(t)].map((e,t)=>t+1).filter(e=>1===e||e%5==0||e===t)).tickPadding(17.5).tickFormat(e=>e.toString());e.select(".yAxis").remove(),e.append("g").classed("yAxis",!0).classed("hidePath",!0).classed("isRTL",u).call(s).style("stroke-dasharray","3 6").style("stroke-opacity","0.5").attr("transform","translate(".concat(770,", ").concat(10,")"));let n=function(e,t){let s=Array.from({length:e},(e,t)=>t+1);if(e<=t)s=Array.from({length:e},(e,t)=>t+1);else{let n=Math.min(5,Math.ceil((e-1)/(t-1))),a=[];if(5===n){a.push(1);for(let t=5;t=2&&a[a.length-1]-a[a.length-2]e.toString());e.select(".xAxis").remove(),e.append("g").classed("xAxis",!0).classed("hidePath",!0).classed("isRTL",u).call(a).attr("transform","translate(".concat(35,", ").concat(238.5,")"))},[t,x,u,T,A,m]),(0,r.useEffect)(()=>{if(!S.current)return;let e=(0,f.A)(S.current).select("svg");i.forEach((t,s)=>{((t,s)=>{if(!t||0===t.length)return e.select("svg g.graph").selectAll("line.class-".concat(s)).remove();let n=t?t.map(e=>({x:35+T(e.week),y:10+A(e.position)})):[],a=e.select("svg g.graph").selectAll("path.class-".concat(s)).data([n]);a.enter().append("path").classed("class-".concat(s),!0).merge(a).transition().ease(y.wq).duration(350).attr("d",e=>k(e)).attr("fill","none").attr("stroke",h.S.var("colors.".concat(w(s)))).attr("stroke-width","2")})(t,s)})},[i,T,A]),(0,r.useEffect)(()=>{if(!S.current)return;let e=(0,f.A)(S.current).select("svg"),t=e=>{let t=Math.round(T.invert(e.x-35))-1;t=0&&l(t)};(()=>{if(e.select(".slider").remove(),!x)return;let n=e.append("g").classed("slider",!0),a=35+T(s+1),r=231;n.append("path").attr("fill","none").attr("stroke",h.S.var("colors.neutral.variant")).attr("stroke-width","1").attr("d",k([{x:a,y:0},{x:a,y:r}])||""),n.append("rect").attr("x",a).attr("y",0).attr("width",Math.max(735-T(s+1),1)).attr("height",r).classed("rect-overlay",!0),n.append("rect").classed("track",!0).attr("x",35).attr("y",0).attr("width",735).attr("height",r).attr("fill","transparent"),n.call((0,j.A)().on("drag",t))})()},[s,x,T,l]),(0,n.jsx)("div",{ref:S,style:{marginTop:"22px"},children:(0,n.jsxs)(a.I4.svg,{_rtl:{transform:"scale(-1,1)"},className:(0,p.AH)({"& text":{fontSize:{base:"md",md:"xs"}}}),children:[(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"graph-clip-area",children:(0,n.jsx)("rect",{x:35,y:9,width:735,height:213})})}),(0,n.jsx)("g",{className:"graph","clip-path":"url(#graph-clip-area)"})]})})};var T=s(22375),A=s(90510);let k=e=>{let{week:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.A,{id:"standings_tracker_week_date"}),t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:" ("}),(0,n.jsx)(A.XU,{value:1e3*t.timeframeStart,...T.or.fullDate}),(0,n.jsx)("span",{children:" - "}),(0,n.jsx)(A.XU,{value:1e3*t.timeframeEnd,...T.or.fullDate}),(0,n.jsx)("span",{children:")"})]})]})};function C(e){let{setVisibleTeamsCount:t,maxComparisonCount:s,visibleTeamsCount:r,setSelectedTeamIds:l}=e;return(0,n.jsxs)(a.so,{gap:"sm",children:[r>1&&(0,n.jsx)(o.K0,{variant:"clear",size:"primary",onClick:()=>{r>1&&t(e=>e-1),l(e=>{let t=[...e];return t[r-1]=void 0,t})},children:(0,n.jsx)(m.zQC,{icon:"close",width:24})}),rt(e=>e+1),children:(0,n.jsx)(u.A,{id:"compare"})}):(0,n.jsx)(o.K0,{br:"50%",size:"primary",onClick:()=>t(e=>e+1),children:(0,n.jsx)(m.xZp,{width:24})}))]})}function I(e){let{maxMatches:t,position:s,teamIndex:r,children:l}=e,i=48*t+4*(t-1)+16+24+4;return(0,n.jsx)(a.az,{style:{minHeight:i},children:(0,n.jsxs)(a.so,{bg:"surface.s2",align:"center",justify:"flex-start",br:"xs",direction:"column",style:{borderTop:"".concat(4,"px solid ").concat(h.S.var("colors.".concat(w(r))))},children:[(0,n.jsxs)(a.so,{gap:"xs",align:"center",py:"xs",style:{height:24},children:[(0,n.jsx)(o.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",children:(0,n.jsx)(u.A,{id:"position.short"})}),(0,n.jsx)(o.EY,{textStyle:"display.small",children:s})]}),l]})})}var E=s(33144),L=s(88505);let N=e=>{let{availableTeams:t,selectedTeam:s,setSelectedTeams:r,teamIndex:l,showSelectedTeamName:i,isFullWidth:d}=e,c=t.every(e=>e.shortName)?t.sort((e,t)=>e.shortName>t.shortName?1:t.shortName>e.shortName?-1:0).map(e=>({value:e.id,label:(0,n.jsx)(L.Rm,{team:e,short:!0})})):t.sort((e,t)=>e.name>t.name?1:t.name>e.name?-1:0).map(e=>({value:e.id,label:(0,n.jsx)(L.Rm,{team:e})})),u=i&&(null==s?void 0:s.shortName)||"",m=s?{value:s.id,label:u}:void 0;return(0,n.jsx)(o.ms,{width:"100%",buttonStyles:{width:d?"100%":"fit"},label:null==m?void 0:m.value,items:c,selectedItem:m,alignRight:l>1,onSelectedItemChange:e=>{r(t=>{var s;let n=[...t];return n[l]=Number(null==(s=e.selectedItem)?void 0:s.value),n})},renderItem:e=>e?(0,n.jsxs)(a.so,{align:"center",gap:"sm",children:[(0,n.jsx)(E.p,{id:e.value,size:24}),(0,n.jsx)(o.EY,{truncate:!0,children:e.label})]}):(0,n.jsx)(a.so,{align:"center",children:(0,n.jsx)("img",{width:24,src:"/static/images/placeholders/team.svg",alt:"Placeholder team"})})})};var _=s(19501),z=s(67087),R=s(64006),P=s(81484),D=s(14831);function F(e){let{event:t}=e,[s,r]=(0,z.jr)(t,"homeScore","awayScore",t),l=t.winnerCode===_.Jfo.Right||t.winnerCode===_.Jfo.Draw,i=t.winnerCode===_.Jfo.Left||t.winnerCode===_.Jfo.Draw;return(0,n.jsx)(a.so,{align:"center",justify:"center",color:"neutrals.nLv3",py:"xs",w:"100%",children:(0,D.ux)(t)||D.dp.includes(t.status.type)?(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"status.error.default",minW:"[0px]",truncate:!0,children:(0,n.jsx)(P.fP,{id:t.status.type,short:!0})}):(0,n.jsxs)(a.so,{gap:"2xs",children:[(0,n.jsx)(o.EY,{textStyle:"display.small",display:"block",color:l?"[inherit]":"neutrals.nLv1",children:s.display}),(0,n.jsx)(o.EY,{display:"block",color:"[inherit]",children:"-"}),(0,n.jsx)(o.EY,{textStyle:"display.small",display:"block",color:i?"[inherit]":"neutrals.nLv1",children:r.display})]})})}let M=e=>{let{event:t,isWideRow:s}=e,[r,l]=(0,z.jr)(t,"homeTeam","awayTeam",t);return t?(0,n.jsx)(R.tj,{event:t,style:{width:"100%"},children:(0,n.jsxs)(a.so,{direction:"column",justify:"center",align:"center",gap:"xs",br:"sm",md:{px:"sm",py:"xs"},_hover:{bg:"neutral.highlight"},children:[(0,n.jsxs)(a.so,{gap:"md",align:"center",children:[(0,n.jsx)(E.p,{id:r.id,size:20,name:r.name}),s&&(0,n.jsx)(F,{event:t}),(0,n.jsx)(E.p,{id:l.id,size:20,name:l.name})]}),!s&&(0,n.jsx)(F,{event:t})]})}):null};function Y(e){let{events:t,visibleTeamsCount:s}=e,{isDesktop:r}=(0,o.$c)();if(!(null==t?void 0:t.length))return(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",textAlign:"center",p:"sm",children:(0,n.jsx)(u.A,{id:"standings_tracker_no_games_played_short"})});let l=r||s<3;return(0,n.jsx)(a.so,{direction:"column",p:"sm",gap:l?"sm":"xs",w:"100%",children:t.map(e=>(0,n.jsx)(M,{event:e,isWideRow:l},e.id))})}var V=s(45860);let B=(0,a.I4)(a.az,{base:{"& svg .hidePath path":{display:"none"},"& svg .xAxis.isRTL text":{transform:"scale(-1, 1)"},"& svg .yAxis.isRTL text":{transform:"scale(-1, 1) translateX(193%)"},"& .rect-overlay":{fill:"surface.s1/65"}}}),O=e=>{var t,s;let{uniqueTournamentId:i,seasonId:u,preselectedTeamIds:m,availableTeams:p}=e,{isMobile:h}=(0,o.$c)(),g=p.map(e=>e.id),j=Math.min(g.length,4),[y,v]=(0,r.useState)(!1),[f,b]=(0,r.useState)(0),[w,T]=(0,r.useState)((null==m?void 0:m.length)?m:[g[0],g[1]]),[A,E]=(0,r.useState)(w.length),{data:L,isLoading:z}=((e,t,s)=>{let[n,a,r,l]=s,{data:i,isLoading:o}=(0,V.Ay)(n?_.V3t.performanceGraphData(e,t,n):null),{data:d,isLoading:c}=(0,V.Ay)(a?_.V3t.performanceGraphData(e,t,a):null),{data:u,isLoading:m}=(0,V.Ay)(r?_.V3t.performanceGraphData(e,t,r):null),{data:x,isLoading:p}=(0,V.Ay)(l?_.V3t.performanceGraphData(e,t,l):null);return{data:[null==i?void 0:i.graphData,null==d?void 0:d.graphData,null==u?void 0:u.graphData,null==x?void 0:x.graphData],isLoading:o||c||m||p}})(i,u,w),R=(null==(s=L[0])||null==(t=s[f])?void 0:t.week)||0,P=(e=>{if(!e)return[];let t=[];return null==e||e.forEach((e,s)=>{null==e||e.forEach((e,n)=>{t[n]||(t[n]=[]),t[n][s]=e.events})}),[...t]})(L),D=Math.max(0,...P.flat().map(e=>e.length));return((0,r.useEffect)(()=>{!y&&!z&&(null==L?void 0:L.length)&&(b(Math.min(...L.filter(e=>null==e?void 0:e.length).map(e=>((null==e?void 0:e.length)||1)-1))),v(!0))},[L,z,y]),(0,r.useEffect)(()=>{v(!1)},[u]),L.find(e=>null==e?void 0:e.length)&&P.length)?(0,n.jsxs)(l.Zp,{children:[(0,n.jsx)(l.Zp.Header,{titleId:"standings_tracker_title",actionComponent:(0,n.jsx)(x,{})}),(0,n.jsx)(B,{children:(0,n.jsxs)(a.az,{p:{base:"sm",md:"lg"},children:[(0,n.jsx)(a.az,{pb:"lg",children:(0,n.jsx)(S,{teamCount:p.length,data:L,selectedWeek:f,setSelectedWeek:b})}),(0,n.jsx)(d.VQ,{controls:[f,b],buttonProps:{variant:"unshielded"},align:"flex-start",my:"md",children:Array.from({length:P.length},(e,t)=>t).map(e=>{var t,s;return(0,n.jsxs)(a.so,{align:"center",gap:"xs",children:[(0,n.jsx)(o.EY,{textStyle:"display.large",children:R}),(0,n.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,n.jsx)(k,{week:L[0]&&L[0][f]})})]},(null==(s=L[0])||null==(t=s[f])?void 0:t.week)||e)})}),(0,n.jsxs)(a.so,{gap:"sm",py:"sm",children:[Array.from({length:A},(e,t)=>t).map(e=>{var t,s,r;if(e>j)return null;let l=w[e],i=null==(s=L[e])||null==(t=s[f])?void 0:t.position,o=null==(r=P[f])?void 0:r[e];return(0,n.jsxs)(a.so,{gap:"md",direction:"column",w:"100%",minW:"[0px]",children:[(0,n.jsxs)(a.so,{justify:"space-between",children:[(0,n.jsx)(N,{teamIndex:e,availableTeams:p.filter(e=>!w.includes(e.id)),selectedTeam:p.find(e=>e.id===l),setSelectedTeams:T,showSelectedTeamName:A<3&&h||!h,isFullWidth:A>1}),1===A&&(0,n.jsx)(C,{visibleTeamsCount:A,maxComparisonCount:j,setVisibleTeamsCount:E,setSelectedTeamIds:T})]}),l&&void 0!==i&&(0,n.jsx)(I,{maxMatches:D,position:i,teamIndex:e,children:(0,n.jsx)(Y,{events:o,visibleTeamsCount:A})})]},"".concat(l,"-").concat(e,"-").concat(u))}),A>1&&(0,n.jsx)(C,{visibleTeamsCount:A,maxComparisonCount:j,setVisibleTeamsCount:E,setSelectedTeamIds:T})]})]})})]}):(0,n.jsxs)(l.Zp,{children:[(0,n.jsx)(l.Zp.Header,{titleId:"standings_tracker_title",actionComponent:(0,n.jsx)(x,{})}),(0,n.jsx)(c.p,{graphic:"performance-chart",descriptionMessageId:"standings_tracker_empty_season"})]})};var W=s(59721),G=s(4284);let H=(0,r.createContext)({colors:{},texts:{}}),U=e=>{let{standings:t,seasonId:s,children:a}=e,[l,i]=(0,r.useMemo)(()=>{let e=t.rows.map(e=>({...e.promotion,teamId:e.team.id})).filter(e=>!!e.id);return[(0,G.oB)(e),e.reduce((e,t)=>(e[t.teamId]=t.text,e),{})]},[null==t?void 0:t.id,s]);return(0,n.jsx)(H,{value:{colors:l,texts:i},children:a})};var q=s(64327),K=s(15307),$=function(e){return e[e.AFC=1]="AFC",e[e.NFC=2]="NFC",e[e.OVERALL=3]="OVERALL",e}({});let J={1:"American",2:"National"},Z={1:"AFC",2:"NFC"};function X(e,t){return t.findIndex(e=>["AMERICAN","NATIONAL"].includes(e.name))>-1?J[e]:Z[e]}var Q=s(494),ee=s(72753),et=s(80055);let es=(0,p.Fj)({base:{display:"flex",alignItems:"center",position:"relative",textStyle:"table.medium",padding:"sm",height:{base:"4xl",md:"2xl"},_selected:{backgroundColor:"neutral.highlight"},_hover:{backgroundColor:"surface.s2"}},variants:{team:{none:{},home:{backgroundColor:"secondary.highlight",borderStart:"{sizes.xs} solid {colors.secondary.default}",pl:"xs"},away:{backgroundColor:"primary.highlight",borderStart:"{sizes.xs} solid {colors.primary.default}",pl:"xs"}},stuck:{true:{mx:"-sm",px:"lg",backgroundColor:"surface.s1",borderTop:"1px solid {colors.surface.s2}",borderBottom:"1px solid {colors.surface.s2}",elevation:"2"},false:{}}}}),en=(0,a.I4)("div",es),ea=(0,a.I4)("p",{base:{margin:"0",padding:"0",whiteSpace:"pre-line","& + &":{marginTop:"xs"}}}),er=(0,a.I4)("div",{base:{"& button":{border:"1px solid {colors.surface.s2}",px:"xs","& svg":{margin:"0"},"& svg:nth-child(2)":{display:"none"}}}});function el(e){let{description:t,transValue:s}=e;return(0,n.jsxs)(ea,{children:[t.teamName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(L.lC,{original:t.teamName}),":\xa0"]}):null,s||t.text]})}function ei(e){let{description:t,locale:s}=e,{data:a}=(0,V.Ay)(_.oo$.singleEntity(t.id,s));return(0,n.jsx)(el,{description:t,transValue:null==a?void 0:a.translation.value})}function eo(e){let{promotion:t,locale:s}=e,{data:a}=(0,V.Ay)(_.oo$.singleEntity(t.id,s));return(0,n.jsx)(o.EY,{display:"block",textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,children:(null==a?void 0:a.translation.value)||t.text})}function ed(e){let{descriptions:t,locale:s}=e;return t&&t.length&&s?"en"===s?(0,n.jsx)(n.Fragment,{children:t.map(e=>(0,n.jsx)(el,{description:e},e.id))}):(0,n.jsx)(n.Fragment,{children:t.map(e=>(0,n.jsx)(ei,{description:e,locale:s},e.id))}):null}let ec=e=>{let{children:t,defaultOpenedFirstRules:s}=e;return(0,n.jsx)(d.nD,{children:(0,n.jsxs)(d.nD.Item,{bg:"surface.s2",br:"lg",defaultOpened:s,children:[(0,n.jsx)(d.nD.Trigger,{bg:"transparent",children:(0,n.jsx)(o.EY,{textStyle:"display.small",children:(0,n.jsx)(u.A,{id:"rules"})})}),(0,n.jsx)(d.nD.Content,{children:(0,n.jsx)(o.EY,{textStyle:"body.small",display:"block",px:"md",pb:"md",children:t})})]})})},eu=e=>{let{locale:t,descriptions:s,rowDescriptions:r,rowPromotions:l,tieBreakingRules:i,promotionColors:o,defaultOpenedFirstRules:d}=e;return(0,n.jsx)(ec,{defaultOpenedFirstRules:d,children:(0,n.jsxs)(a.so,{direction:"column",gap:"sm",children:[(0,n.jsx)("div",{children:l.map(e=>(0,n.jsxs)(a.so,{align:"center",h:"xl",children:[(0,n.jsx)(a.so,{justify:"center",align:"center",w:"xl",children:(0,n.jsx)(a.az,{h:"sm",w:"sm",br:"50%",style:{background:o[e.id]}})}),(0,n.jsx)(eo,{promotion:e,locale:t})]},e.id))}),(0,n.jsx)(ed,{descriptions:r,locale:t}),(0,n.jsx)(ed,{descriptions:s,locale:t}),(0,n.jsx)(ed,{descriptions:i,locale:t})]})})};function em(e){let{rows:t,descriptions:s,tieBreakingRule:l,defaultOpenedFirstRules:i,hasPerformanceGraph:o}=e,{isStandingsTableEmpty:d}=(0,r.useContext)(q.P),c=(0,Q.d4)(ee.JV),{rowDescriptions:u,rowPromotions:m,tieBreakingRules:x,promotionColors:p}=((e,t,s)=>{let{colors:n}=(0,r.useContext)(H),[a,l,i]=(0,r.useMemo)(()=>{let s=[],a=[],r={};return e.forEach(e=>{var l;e.descriptions&&s.push(...e.descriptions.map(s=>({...s,teamName:(0,et.s)(e.team,t)}))),(null==(l=e.promotion)?void 0:l.text)&&!r[e.promotion.id]&&(a.push(e.promotion),r[e.promotion.id]=n[e.team.id])}),[s,a,r]},[e]);return{rowDescriptions:a,rowPromotions:l,promotionColors:i,tieBreakingRules:s?[s]:[]}})(t,c,l),h=!!(u.length||(null==s?void 0:s.length)||x.length);return d||!h&&0===m.length?null:(0,n.jsx)(a.az,{px:"sm",pb:{mdDown:"sm",md:o?void 0:"sm"},children:(0,n.jsx)(eu,{locale:c,descriptions:s,rowDescriptions:u,rowPromotions:m,tieBreakingRules:x,promotionColors:p,defaultOpenedFirstRules:i})})}function ex(e){return e.isNarrowLayout?(0,n.jsx)(er,{children:(0,n.jsx)(d.ms,{items:e.items||[..._.ur4],selectedItem:e.displayType,onSelectedItemChange:t=>{let{selectedItem:s}=t;s&&e.setDisplayType(s)},renderItem:(e,t)=>t?(0,n.jsx)(m.NwX,{fill:"onSurface.nLv1"}):(0,n.jsx)(u.A,{id:"standings."+e}),menuLabel:(0,n.jsx)(u.A,{id:"standings.appearance"}),alignRight:!0,buttonStyle:{width:36,height:36,zIndex:d.Py.Backdrop}})}):null}function ep(e){let{displayType:t,setDisplayType:s,items:r,isNarrowLayout:l}=e;return(0,n.jsxs)(a.so,{justify:"space-between",p:"sm",borderBottom:"neutrals.nLv4",children:[(0,n.jsxs)(a.az,{children:[(0,n.jsx)(o.EY,{display:"block",textStyle:"assistive.default",pt:"2xs",children:(0,n.jsx)(u.A,{id:"standings.appearance"})}),(0,n.jsx)(o.EY,{display:"block",textStyle:"body.small",color:"neutrals.nLv3",children:(0,n.jsx)(u.A,{id:"standings.appearance.select"})})]}),(0,n.jsx)(ex,{displayType:t,setDisplayType:s,items:r,isNarrowLayout:l})]})}var eh=s(947),eg=s(41735),ej=s(81278),ey=s(90438),ev=s(37236),ef=s(18858),eb=s(73240);let ew=e=>{var t;let{row:s,events:l,sport:i,position:d,columnKeys:c,promotionColors:u,isRTL:x}=e,{selectedTeamId:p,homeTeamId:g,awayTeamId:j,display:y}=(0,r.useContext)(q.P),{displayType:v,isNarrowLayout:f}=y,{isDesktopLarge:b}=(0,o.$c)(),w=(0,Q.d4)(ee.JV),S=s.team.id,T=!!s.liveMatchWinnerCodeColumn,{texts:A}=(0,r.useContext)(H),{data:k}=(0,V.Ay)(s.promotion?_.oo$.singleEntity(s.promotion.id,w):null),C=(null==k?void 0:k.translation.value)||(null==(t=s.promotion)?void 0:t.text)||A[S],[I,N]=(0,r.useState)(!1);return(0,n.jsx)(R.gT,{sport:i,team:s.team,children:(0,n.jsxs)(en,{"data-selected":p===S||void 0,team:g===S?"home":j===S?"away":"none",children:[p===S&&(0,n.jsx)(a.az,{position:"absolute",left:"[0px]",w:"xs",h:"100%",bg:"neutral.default"}),(0,n.jsx)(a.az,{children:(0,n.jsx)(a.so,{w:"xl",h:"xl",justify:"center",align:"center",br:"50%",textStyle:"display.small",cursor:"pointer",userSelect:"none",onClick:e=>{e.preventDefault(),e.stopPropagation(),C&&(I||(N(!0),setTimeout(()=>{N(!1)},3e3),(0,D.MZ)((0,n.jsxs)(a.so,{align:"center",children:[(0,n.jsx)(m.G_L,{fill:"surface.s1",mr:"lg"}),(0,n.jsxs)(o.EY,{textStyle:"display.small",color:"surface.s1",display:"block",children:[(0,n.jsx)(L.Rm,{team:s.team,short:!0})," – ".concat(C)]})]}))))},color:u[S]?"surface.s1":"neutrals.nLv1",style:{backgroundColor:u[S]?u[S]:h.S.var("colors.surface.s2")},title:C||void 0,children:d})}),"full"===v&&(!b||f)?null:(0,n.jsx)(E.p,{id:s.team.id,name:s.team.name,w:[32,24],h:[32,24],ml:"sm",style:{verticalAlign:"top"},fallback:(0,n.jsx)(a.I4.img,{src:"/static/images/placeholders/team.svg",width:{base:"2xl",md:"xl"},height:{base:"2xl",md:"xl"},alt:""})}),(0,n.jsx)(a.az,{flexGrow:1,overflow:"auto",children:(0,n.jsxs)(a.so,{align:"center",pl:"sm",overflow:"hidden",w:"100%",children:[(0,n.jsx)(o.EY,{textStyle:"table.medium",color:T?"status.live":"neutrals.nLv1",display:"block",truncate:!0,children:(0,n.jsx)(L.Rm,{team:s.team,short:!0})}),T&&(0,n.jsx)(a.I4.small,{position:"relative",color:"status.live",_after:{content:"''",position:"relative",display:"inline-block",top:"[-1px]",width:"[6px]",height:"[6px]",ml:"xs",br:"50%",bg:"status.live",animation:"pulse 1s ease-in infinite"}})]})}),c.map(e=>{if("last5"===e)return(0,n.jsx)(eb.o1,{events:l,referenceId:s.team.id},s.team.id+e);let t=G.oG(e,i,s,x),r=!1;e===s.liveMatchWinnerCodeColumn||"points"===e&&T?r=!0:"percentage"===e&&T&&(r=!0);let d=G.j8(e,i,!1);return(0,n.jsx)(a.az,{children:(0,n.jsx)(o.Ym,{textStyle:"table.medium",color:r?"status.live":"neutrals.nLv1",children:(0,n.jsx)(a.so,{justify:"center",style:{minWidth:d},children:t})})},e)})]})})};function eS(e){let{sport:t,columnKeys:s,selectedSeason:r}=e,{isDesktop:l}=(0,o.$c)(),i=(0,ej.useRouter)(),d=null==r?void 0:r.year,c=(0,ef.Ay)({isInMobileTabs:!0,isSportMenuVisible:!0}),m=[ey.xW.OldTeam,ey.xW.Team,ey.xW.TeamAsPlayer].includes(i.route);return(0,n.jsx)(o.PI,{top:c+48*!!m,isStickingDisabled:l,zIndex:"stickyTertiary",children:e=>(0,n.jsxs)(en,{stuck:e,children:[(0,n.jsx)(a.az,{children:(0,n.jsx)(o.EY,{textStyle:"table.medium",color:"neutrals.nLv3",textAlign:"center",display:"block",w:"xl",children:"#"})}),(0,n.jsx)(a.az,{flexGrow:1,children:(0,n.jsx)(o.EY,{textStyle:"table.medium",color:"neutrals.nLv3",display:"block",pl:"sm",children:(0,n.jsx)(u.A,{id:"team"})})}),s.map(e=>{if("last5"===e)return(0,n.jsx)(a.so,{ml:"sm",wrap:"nowrap",flexBasis:"[120px]",justify:"center",align:"center",children:(0,n.jsx)(a.so,{minW:"2xl",justify:"center",children:(0,n.jsx)(o.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,n.jsx)(ev.N,{id:e})})})},"column-key-last5");let s=function(e,t){switch(e){case"pointsCurrSeason":return t;case"pointsPrevSeason":return Number(t)-1;case"pointsPrevPrevSeason":return Number(t)-2;default:return(0,n.jsx)(ev.N,{id:e})}}(e,d),r=G.j8(e,t,!1);return(0,n.jsx)(a.az,{children:(0,n.jsx)(o.EY,{textStyle:"table.medium",color:"neutrals.nLv3",textTransform:"points"===e?"uppercase":void 0,children:(0,n.jsx)(a.so,{justify:"center",style:{minWidth:r},children:s})})},e)})]})})}function eT(e){let{type:t,table:s,teamEvents:a}=e,l=(0,r.useContext)(q.P),{uniqueTournamentId:i,homeTeamId:d,awayTeamId:c,selectedTeamId:u,selectedSeason:m,display:x}=l,{isNarrowLayout:p,displayType:h}=x,{isDesktop:g,mediaBreakpoint:j}=(0,o.$c)(),{settings:y}=(0,eg.useTheme)(),v=(0,eh.A)(),f=s.tournament.category.sport.slug,b=(0,r.useMemo)(()=>{let e=s.rows.reduce((e,t)=>Object.keys(t).length>Object.keys(e).length?t:e,s.rows[0]),n=s.rows.some(e=>0!==Number(e.gamesBehind)),a=s.rows.some(e=>void 0!==e.scoresFor||void 0!==e.scoresAgainst),r=!!(null==m?void 0:m.year)&&s.rows.some(e=>void 0!==e.pointsCurrSeason||void 0!==e.pointsPrevPrevSeason||void 0!==e.pointsPrevPrevSeason);if(e._isPlaceholderRow)return[v.formatMessage({id:"standings_placeholder_data"},{type:t,name:s.name})];let l="xxs"===j||"xs"===j||g&&p;return(0,G.Tx)(e,f,h,p,n,a,r,l,i)},[s.id,f,h,p]),{colors:w}=(0,r.useContext)(H),S=(0,r.useMemo)(()=>{let e={homeTeamId:d,awayTeamId:c,selectedTeamId:u};return t===_.lpv.Home&&(delete e.awayTeamId,delete e.homeTeamId,e.selectedTeamId=u),t===_.lpv.Away&&(delete e.awayTeamId,delete e.homeTeamId,e.selectedTeamId=u),e},[d,c,u,t]);return(0,n.jsxs)("div",{style:{width:"100%"},children:[(0,n.jsx)(eS,{columnKeys:b,sport:f,selectedSeason:m}),(0,n.jsx)(q.P,{value:{...l,...S},children:s.rows.map((e,t)=>(0,n.jsx)(ew,{columnKeys:b,promotionColors:w,position:t+1,row:e,sport:f,events:a?a[e.team.id]:null,isRTL:"rtl"===y.textDirection},e.id))})]})}var eA=s(18205);function ek(e){let{entityType:t,tableType:s,tableName:a,loaderHeight:l}=e,{standingsData:i,standingsError:o,currentStandings:d,teamEvents:u}=function(e,t,s){let{standings:n,uniqueTournamentId:a,tournament:l,seasonId:i,hasHomeAwayStandings:o,setIsStandingsTableEmpty:d}=(0,r.useContext)(q.P),c="tournament"===e?null==l?void 0:l.id:a,u=function(e,t,s,n){let a=t&&s;switch(e){case"tournament":return{standingsRoute:a?_.yKR.standings(t,s,n):null,teamEventsRoute:a?_.yKR.teamEvents(t,s,n):null};case"unique-tournament":return{standingsRoute:a?_.V3t.standings(t,s,n):null,teamEventsRoute:a?_.V3t.teamEvents(t,s,n):null};default:return{standingsRoute:null,teamEventsRoute:null}}}(e,c,i,t),{data:m,error:x}=(0,V.Ay)(u.standingsRoute,{refreshInterval:3e4,fallbackData:t===_.lpv.Total?{standings:n}:void 0,revalidateOnMount:"tournament"===e||void 0}),{data:p}=(0,V.Ay)(u.teamEventsRoute,{refreshInterval:3e4});(0,r.useEffect)(()=>{o&&d&&m&&d(void 0===m.standings.find(e=>e.name===s))},[m,s]);let h=null==m?void 0:m.standings.find(e=>e.name===s),g=p?"tournament"===e?p.teamEvents:h?p.tournamentTeamEvents[h.tournament.id]:void 0:void 0;return{standingsData:m,standingsError:x,currentStandings:h,teamEvents:g}}(t,s,a);return o?null:i?d?(0,n.jsx)(eT,{type:s,table:d,teamEvents:u}):(0,n.jsx)(c.p,{graphic:"no-standings",descriptionMessageId:"empty_recent_searches_title"}):(0,n.jsx)(eA.e,{rows:l})}let eC=e=>{let{tab:t}=e,{standings:s,seasonId:i}=(0,r.useContext)(q.P),d=function(e,t){return 3===e?t.filter(e=>!(e.name.includes("AFC")||e.name.includes("NFC")||e.name.includes("AMERICAN")||e.name.includes("NATIONAL"))):1===e?t.filter(e=>e.name.includes("AFC")||e.name.includes("AMERICAN")):t.filter(e=>e.name.includes("NFC")||e.name.includes("NATIONAL"))}(t,s);return i?(0,n.jsx)(n.Fragment,{children:d.map((e,t)=>(0,n.jsx)(l.Zp,{children:(0,n.jsxs)(a.so,{direction:"column",children:[(0,n.jsxs)(a.so,{align:"center",px:"sm",pt:"sm",columnGap:"md",children:[(0,n.jsx)(W.e,{id:K.nJ,name:e.name,w:40,h:40}),(0,n.jsx)(o.EY,{textStyle:"display.large",children:e.name})]}),(0,n.jsxs)(U,{standings:e,seasonId:i,children:[(0,n.jsx)(a.az,{pb:"sm",children:(0,n.jsx)(ek,{entityType:"unique-tournament",tableType:_.lpv.Total,tableName:e.name})}),(0,n.jsx)(em,{rows:e.rows,descriptions:e.descriptions,tieBreakingRule:e.tieBreakingRule,defaultOpenedFirstRules:0===t})]})]})},e.id))}):null},eI=()=>{let{standings:e,display:t}=(0,r.useContext)(q.P),{displayType:s,setDisplayType:i}=t,[d,c]=(0,r.useState)($.AFC);return(0,n.jsxs)(a.so,{direction:"column",gap:"sm",children:[(0,n.jsx)(l.Zp,{children:(0,n.jsxs)(a.so,{p:"sm",justify:"space-between",children:[(0,n.jsx)("div",{children:(0,n.jsx)(o.tU,{variant:"secondary",initialValue:d,onChange:e=>c(e),centered:!0,children:(0,n.jsxs)(o.tU.List,{children:[(0,n.jsx)(o.tU.Tab,{children:X($.AFC,e)}),(0,n.jsx)(o.tU.Tab,{children:X($.NFC,e)}),(0,n.jsx)(o.tU.Tab,{children:(0,n.jsx)(u.A,{id:"standings.overall"})})]})})}),(0,n.jsx)(ex,{displayType:s,setDisplayType:i,items:["short","form"],isNarrowLayout:!0})]})}),(0,n.jsx)(eC,{tab:d})]})};var eE=s(20288);let eL=e=>{let{currentStandings:t}=e,{uniqueTournamentId:s,seasonId:a,hasHomeAwayStandings:l}=(0,r.useContext)(q.P),i=t.tournament,o=i.id,d=i.slug,c=i.category.slug,u=i.category.sport.slug;return(0,n.jsx)(eE.w,{type:"standings",sport:u,tournamentId:o,tournamentSlug:d,uniqueTournamentId:s,categorySlug:c,seasonId:a,standingsName:t.name,rowCount:t.rows.length,hasHomeAwayStandings:!!l,isButton:!0})},eN=e=>{let{currentStandings:t,showEmbed:s,children:r}=e;return(0,n.jsx)(n.Fragment,{children:r?(0,n.jsxs)(a.so,{justify:"space-between",align:"center",px:"sm",children:[r,s&&(0,n.jsx)(eL,{currentStandings:t})]}):s&&(0,n.jsx)(eL,{currentStandings:t})})};var e_=s(9081);let ez=e=>{let{table:t}=e;return t?t.tournament.groupName?(0,n.jsx)(e_.__,{name:t.tournament.groupName}):(0,n.jsx)(n.Fragment,{children:t.name}):null};function eR(){let{standings:e,selectedStandingsTable:t,setSelectedStandingsTable:s}=(0,r.useContext)(q.P);return(0,n.jsx)(a.az,{py:"sm",children:(0,n.jsx)(o.ms,{label:"Select standings table in tournament standings",items:e,initialSelectedItem:t,selectedItem:t,renderItem:(e,t)=>{if(t&&e){var s,r;return(0,n.jsxs)(a.so,{align:"center",gap:"xs",children:[(0,n.jsx)(W.e,{id:(null==(s=e.tournament.uniqueTournament)?void 0:s.id)||e.tournament.id,name:(null==(r=e.tournament.uniqueTournament)?void 0:r.name)||e.tournament.name,size:24}),(0,n.jsx)(ez,{table:e})]})}return(0,n.jsx)(ez,{table:e})},onSelectedItemChange:e=>{let{selectedItem:t}=e;null!==t&&s(t)}})})}var eP=s(19621),eD=s(43072);let eF=e=>{let{isSelected:t,onClick:s,children:r}=e,[l,i]=(0,eP.c9)([]);return(0,o.rF)(l,[t],()=>!!t),(0,n.jsx)(a.az,{ref:i,children:(0,n.jsx)(a.so,{h:"2xl",minW:"[68px]",px:"sm",br:"sm",userSelect:"none",bg:t?"primary.highlight":"surface.s2",border:t?"1.5px solid {colors.primary.highlight}":"1.5px solid transparent",onClick:t?void 0:s,cursor:"pointer",justify:"center",align:"center",children:(0,n.jsx)(o.EY,{textStyle:"tab.secondary",color:t?"primary.default":"neutrals.nLv1",truncate:!0,textTransform:"uppercase",children:r})})})},eM=e=>{let{currentStandings:t,setSelectedStandingsTable:s,children:l}=e,{standings:i,uniqueTournamentId:d,seasonId:c,display:u}=(0,r.useContext)(q.P),{isNarrowLayout:m,displayType:x,setDisplayType:p}=u,[h,g]=(0,eD.Wx)({trackVisibility:!0,delay:100}),j=!!d&&!!c;return(0,n.jsxs)(a.az,{flexGrow:1,overflow:{md:"hidden"},children:[(0,n.jsxs)(a.so,{align:"center",px:"sm",borderBottom:"1px solid {colors.neutrals.nLv4}",children:[(0,n.jsx)(o.tR,{buttonStyle:"solid",showButtons:"desktop",children:(0,n.jsxs)(a.so,{children:[(0,n.jsx)(a.so,{justify:"flex-start",gap:"lg",py:"sm",children:i.map(e=>(0,n.jsx)(eF,{isSelected:e.id===t.id,onClick:()=>s(e),children:(0,n.jsx)(e_.__,{name:e.tournament.groupName||e.tournament.name})},"".concat(t.tournament.id,"-").concat(c,"-").concat(e.id)))}),(0,n.jsx)(a.az,{ref:h,w:"sm"})]})}),(m||j)&&(0,n.jsxs)(a.so,{align:"center",ps:"sm",boxShadow:{_ltr:g?void 0:"[-3px 0 8px -7px {colors.neutrals.nLv1}]",_rtl:g?void 0:"[3px 0 8px -7px {colors.neutrals.nLv1}]"},children:[m&&(0,n.jsx)(ex,{displayType:x,setDisplayType:p,isNarrowLayout:m}),(0,n.jsx)(eN,{currentStandings:t,showEmbed:j})]})]}),l]})};var eY=s(73045),eV=s(76155);function eB(e){let{currentStandings:t,ignoreTableName:s}=e,{uniqueTournamentId:l,tournament:i,title:d}=(0,r.useContext)(q.P),{hideTitleLogo:c,isMobileOnlyTitle:u}=d;return(0,n.jsx)(a.az,{hideBelow:u?"md":void 0,children:(0,n.jsx)(a.so,{justify:"space-between",align:"center",gap:"lg",children:(0,n.jsxs)(a.so,{gap:"lg",align:"center",children:[!c&&(l?(0,n.jsx)(eY.e,{id:l,size:40}):(0,n.jsx)(eY.l,{id:null==i?void 0:i.id,size:40})),(0,n.jsx)(o.EY,{textStyle:"display.large",lineClamp:2,children:s&&i?(0,n.jsx)(eV.J,{tournament:i}):(0,n.jsx)(ez,{table:t})})]})})})}let eO=e=>{let{isNarrowLayout:t,hideTitle:s}=e,r=0;return t&&(r+=36),s&&(r+=44),(0,n.jsx)(a.az,{hideBelow:"md",style:{minWidth:r}})},eW=e=>{let{entityType:t,currentStandings:s,showHorizontalStandings:l,hasHomeAwayStandings:i,hideTitle:d,ignoreTableName:c}=e,[m,x]=(0,r.useState)(_.lpv.Total),{isMobile:p}=(0,o.$c)(),{setSelectedStandingsTable:h,display:g}=(0,r.useContext)(q.P),{displayType:j,setDisplayType:y,displayTypeOptions:v,isNarrowLayout:f}=g;return l?(0,n.jsx)(eM,{currentStandings:s,setSelectedStandingsTable:h,children:(0,n.jsx)(ek,{entityType:t,tableType:_.lpv.Total,tableName:s.name})}):i?(0,n.jsx)(a.az,{pt:"sm",position:"relative",children:(0,n.jsxs)(o.tU,{variant:p?"tertiary":"secondary",initialValue:m,onChange:x,centered:!p,children:[(0,n.jsxs)(a.so,{justify:"space-between",align:"center",gap:"sm",px:"sm",children:[(f||d)&&(0,n.jsx)(eO,{isNarrowLayout:f,hideTitle:d}),(0,n.jsxs)(o.tU.List,{children:[(0,n.jsx)(o.tU.Tab,{tabKey:_.lpv.Total,children:(0,n.jsx)(u.A,{id:"basic.all"})}),(0,n.jsx)(o.tU.Tab,{tabKey:_.lpv.Home,children:(0,n.jsx)(u.A,{id:"home"})}),(0,n.jsx)(o.tU.Tab,{tabKey:_.lpv.Away,children:(0,n.jsx)(u.A,{id:"away"})})]}),(f||d)&&(0,n.jsxs)(a.so,{align:"center",gap:"sm",children:[f&&(0,n.jsx)(ex,{displayType:j,setDisplayType:y,items:v,isNarrowLayout:f}),d&&(0,n.jsx)(eN,{currentStandings:s,showEmbed:!0})]})]}),(0,n.jsxs)(a.az,{pt:"sm",children:[!d&&(0,n.jsx)(eN,{currentStandings:s,showEmbed:!0,children:(0,n.jsx)(eB,{currentStandings:s,ignoreTableName:c})}),[_.lpv.Total,_.lpv.Home,_.lpv.Away].map(e=>(0,n.jsx)(o.tU.Panel,{tabKey:e,children:(0,n.jsx)(ek,{entityType:t,tableType:e,tableName:s.name,loaderHeight:s.rows.length})},e))]})]})}):(0,n.jsxs)(a.az,{children:[f&&(0,n.jsx)(ep,{displayType:j,setDisplayType:y,items:v,isNarrowLayout:f}),(0,n.jsxs)(a.az,{pt:"sm",children:[!d&&(0,n.jsx)(eN,{currentStandings:s,showEmbed:!0,children:(0,n.jsx)(eB,{currentStandings:s,ignoreTableName:c})}),(0,n.jsx)(ek,{entityType:t,tableType:_.lpv.Total,tableName:s.name})]})]})};function eG(e){var t;let{entityType:s,tableId:o,branding:d,seasonPicker:c,showHorizontalStandings:u,hasTablePicker:m,hideTitle:x,ignoreTableName:p}=e,{seasonId:h,uniqueTournamentId:g,standings:j,hasPerformanceGraphFeature:y,selectedTeamId:v,homeTeamId:f,awayTeamId:b,hasHomeAwayStandings:w,display:S}=(0,r.useContext)(q.P),T=j.find(e=>e.id===o),A=(null==(t=j[0])?void 0:t.id)===o;if(!T)return null;if(!u&&"unique-tournament"===s&&m&&g===K.nJ&&S.isNarrowLayout)return(0,n.jsx)(eI,{});let k=!!x||"tournament"===s&&!!m,C=y&&!!g&&!!h,I=!u&&!c&&!m&&!w&&k;return(0,n.jsx)(U,{standings:T,seasonId:h,children:(0,n.jsxs)(a.so,{direction:"column",gap:"sm",children:[(0,n.jsxs)(l.Zp,{children:[g&&(0,n.jsx)(i.U,{entityId:g,branding:d,location:"league_standings"}),c&&(0,n.jsx)(a.az,{py:{mdDown:"sm"},children:(0,n.jsx)(eN,{currentStandings:T,showEmbed:!m&&!w&&k,children:c})}),m&&(0,n.jsx)(eN,{currentStandings:T,showEmbed:!w&&k,children:(0,n.jsx)(eR,{})}),(0,n.jsx)(a.az,{pb:"sm",children:(0,n.jsx)(eW,{entityType:s,currentStandings:T,showHorizontalStandings:u,hasHomeAwayStandings:w,hideTitle:k&&!I,ignoreTableName:!!p})}),(0,n.jsx)(em,{rows:T.rows,descriptions:T.descriptions,tieBreakingRule:T.tieBreakingRule,defaultOpenedFirstRules:u||A,hasPerformanceGraph:C})]}),C&&(0,n.jsx)(a.az,{id:"performance-graph-box",children:(0,n.jsx)(O,{uniqueTournamentId:g,seasonId:h,preselectedTeamIds:v?[v]:[f,b].filter(e=>"number"==typeof e),availableTeams:T.rows.map(e=>e.team)})})]})})}},53853:(e,t,s)=>{s.d(t,{M:()=>c});var n=s(19501),a=s(55729),r=s(45860),l=s(11996),i=s(15341),o=s(15307);function d(e,t,s,a){switch(e){case"tournament":return n.yKR.standings(t,s,a);case"unique-tournament":return n.V3t.standings(t,s,a);default:return null}}function c(e){var t;let{entityType:s,entityId:c,seasonId:u,isLoadingTournamentIdData:m,selectedTournamentId:x,initialStandings:p,targetTeamId:h,awayTeamId:g,swrOptions:j}=e,[y,v]=(0,a.useState)(),[f,b]=(0,i.A)(o.s4,"short"),[w,S]=(0,a.useState)(),T="unique-tournament"===s,{data:A,error:k}=(0,r.Ay)(d(s,c,u,n.lpv.Total),j),{hasHomeAwayStandings:C,hasStandingsGroups:I,hasStandingsRounds:E}=(0,l.A)({hasHomeAwayStandings:{route:null!=(t=d(s,c,u,n.lpv.Home))?t:void 0},hasStandingsGroups:{route:n.V3t.seasonGroups(c,u),skipCheck:!T},hasStandingsRounds:{route:n.V3t.seasonRounds(c,u),skipCheck:!T}},[c,u]),L=(0,a.useMemo)(()=>T?(null==A?void 0:A.standings)||p:null==A?void 0:A.standings.filter(e=>!h||e.rows.find(e=>e.team.id===h||e.team.id===g)),[A,T,p,h,g]);return(0,a.useEffect)(()=>{L&&!m&&v(x?L.find(e=>e.tournament.id===x):L[0])},[L,m,x,u]),{relevantStandings:null!=L?L:[],standingsErr:k,selectedStandingsTable:y,setSelectedStandingsTable:v,displayType:f,setDisplayType:b,isStandingsTableEmpty:w,setIsStandingsTableEmpty:S,hasHomeAwayStandings:C,hasGroupsData:!!I&&!!E}}},64327:(e,t,s)=>{s.d(t,{P:()=>r});var n=s(78383),a=s.n(n);let r=(0,s(55729).createContext)({standings:[],tournament:void 0,tournamentId:void 0,uniqueTournamentId:void 0,seasonId:void 0,selectedSeason:void 0,selectedStandingsTable:void 0,setSelectedStandingsTable:a(),selectedTeamId:void 0,homeTeamId:void 0,awayTeamId:void 0,title:{hideTitleLogo:void 0,isMobileOnlyTitle:void 0},display:{displayType:"short",setDisplayType:a(),displayTypeOptions:void 0,isNarrowLayout:!0},hasHomeAwayStandings:!1,hasPerformanceGraphFeature:!1,isStandingsTableEmpty:void 0,setIsStandingsTableEmpty:a()})}}]);