!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]="ca69da8a-1712-4404-98fe-b6bf2c8af920",e._sentryDebugIdIdentifier="sentry-dbid-ca69da8a-1712-4404-98fe-b6bf2c8af920")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8217],{7447:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6029),n=r(89875),o=r(54409);function l(e){let{isFollowed:t,disabled:r,onClick:l,isOnOverlay:i,isInDesktopHeader:s}=e;return(0,a.jsx)(n.D7,{onClick:l,disabled:r,bg:s?"surface.s2":"[transparent]",children:(0,a.jsx)(o.zQC,{icon:t?"follow-active":"follow-default",fill:i?"onColor.primary":t||s?"primary.default":"neutral.default",style:{width:24,height:24}})})}},8973:(e,t,r)=>{r.d(t,{b:()=>a,y:()=>n});var a=function(e){return e.Event="event",e.Team="team",e.UniqueTournament="unique_tournament",e.Tournament="tournament",e.Player="player",e.Stage="stage",e.Substage="substage",e.UniqueStages="unique_stage",e.Constructor="constructor",e.Driver="driver",e}({}),n=function(e){return e.MainMatches="main_matches",e.MainLeagues="main_leagues",e.Header="header",e.EventHeader="event_header",e.EventsTab="events_tab",e.EventWidget="event_widget",e.MatchesSection="matches_section",e.H2HSection="h2h_section",e.FloatingHeader="floating_header",e.Favorites="favorites",e.PlayerStatistics="player_statistics",e.RacesTab="races_tab",e.FightNight="fight_night",e.Fights="fights",e.PopularPlayers="popular_players",e.PopularTeams="popular_teams",e.Search="search",e.Popup="popup",e}({})},39969:(e,t,r)=>{r.d(t,{h:()=>j,x:()=>k});var a=r(6029),n=r(21377),o=r(99064),l=r(55729),i=r(494),s=r(24313),d=r(70757),u=r(61836),c=r(10794),f=r(89875),p=r(76356),g=r(90248),b=r(54409);let h=(e,t,r)=>{if(r)switch(t){case"right":return{top:"-8px",left:0,transform:"translateY(-100%)"};case"bottom":return{};default:return{top:"-8px",right:0,transform:"translateY(-100%)"}}switch(t){case"right":return{bottom:"-8px",left:0,transform:"translateY(100%)"};case"bottom":return e?{transform:"translateX(-100%)"}:{};default:return{bottom:"-8px",right:0,transform:"translateY(100%)"}}},m=e=>{let{image:t,name:r,LinkComponent:n}=e,o=(0,a.jsxs)(p.so,{align:"center",cursor:"pointer",gap:"lg",children:[t,(0,a.jsx)(p.az,{style:{width:"102px"},textAlign:"start",children:(0,a.jsx)(f.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:r})})]});return(0,a.jsx)(p.az,{my:"md",children:n?(0,a.jsx)(n,{children:o}):o})},x=(0,l.forwardRef)((e,t)=>{let{isEventFollowed:r,entities:n=[],onDeleteClick:o,menuPosition:l,isMenuInverted:i}=e,{textDirection:s}=(0,f.$c)(),{isMobile:d}=(0,f.$c)();return"rtl"===s&&(l="right"===l?"left":"right"),(0,a.jsx)(p.az,{ref:t,position:"absolute",w:"[174px]",bg:"surface.s1",elevation:"3",br:"md",py:"sm",zIndex:"popover",style:{...h(d,l,i),whiteSpace:"normal"},children:r&&o?(0,a.jsxs)(p.so,{tabIndex:0,px:"lg",py:"sm",minH:"4xl",align:"center",br:"md",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==o||o(e))},onClick:o,cursor:"pointer",children:[(0,a.jsx)(b.xV8,{fill:"error.default",width:24,height:24,mr:"lg"}),(0,a.jsx)(p.az,{style:{width:"102px"},children:(0,a.jsx)(f.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:(0,a.jsx)(g.A,{id:"remove_from_favourites"})})})]}):(0,a.jsxs)(p.az,{px:"lg",minH:"4xl",children:[(0,a.jsx)(p.az,{textAlign:"start",children:(0,a.jsx)(f.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",pb:"sm",children:(0,a.jsx)(g.A,{id:"favorites.becauseYouFollow"})})}),n.map(e=>(0,a.jsx)(m,{...e},e.entityType+e.id))]})})});var v=r(37356),y=r(7447);let w=e=>{e.stopPropagation(),e.preventDefault()};function j(e){let{id:t,leftTeam:r,rightTeam:f,tournament:p,menuPosition:g,isMenuInverted:b,isOnOverlay:h,location:m,type:j,isInDesktopHeader:_}=e,C=(0,l.useMemo)(()=>(0,v.fB)(),[]),S=(0,l.useMemo)(()=>(0,v.KL)(),[]),k=(0,l.useMemo)(()=>({leftTeam:r,rightTeam:f,tournament:p}),[r.id,f.id,p.id]),E=(0,i.d4)(e=>C(e,t)),z=(0,i.d4)(e=>S(e,k)),F=(0,i.d4)(c.fg),D=E!==c.dE.NotFollowed&&!!E,q=D||!!z.length,{invertedMenu:M}=(0,s.l)(),P=(0,i.wA)(),I=()=>{P((0,d.q$)(n.bq7.Events,t)),P((0,d.q$)(n.bq7.MutedEvents,t)),(0,u.g2)({id:t,type:j,location:m,isFollowed:!1})},A=()=>{P((0,d.UQ)(n.bq7.Events,t)),(0,u.g2)({id:t,type:j,location:m,isFollowed:!0})},[H,Q]=(0,l.useState)(!1),Y=()=>Q(e=>!e),T=(0,l.useCallback)(()=>Q(!1),[]),N=(0,o.jz)(T);return(0,a.jsxs)(o.az,{ref:N,w:"fit-content",children:[(0,a.jsx)(y.A,{"aria-label":q?"Remove from favourites":"Add to favourites",disabled:F,isFollowed:q,isOnOverlay:h,onClick:e=>{w(e),F||(q?D?I():Y():A())},isInDesktopHeader:_}),q&&H&&!D&&(0,a.jsx)(x,{isEventFollowed:D,entities:z,menuPosition:g,isMenuInverted:M||b,onDeleteClick:e=>{w(e),I(),T()}})]})}var _=r(62859),C=r(8973),S=r(37470);function k(e){let{id:t,uniqueStage:r,menuPosition:f,location:p,isSubstageCell:g}=e,b=(0,l.useContext)(_.Ws),h=(0,l.useMemo)(()=>(0,v.BD)(),[]),m=(0,l.useMemo)(()=>(0,v.jM)(),[]),w=(0,i.d4)(e=>h(e,t)),j=(0,i.d4)(e=>m(e,null==r?void 0:r.id)),k=(0,i.d4)(c.fg),E=j&&r?(0,S.P3)({uniqueStage:r,sportSlug:b}):void 0,{invertedMenu:z}=(0,s.l)(),F=(0,i.wA)(),D=()=>{F((0,d.UQ)(n.bq7.Stages,t)),(0,u.g2)({id:t,type:g?C.b.Substage:C.b.Stage,location:p,isFollowed:!0})},q=()=>{F((0,d.q$)(n.bq7.Stages,t)),(0,u.g2)({id:t,type:g?C.b.Substage:C.b.Stage,location:p,isFollowed:!1})},[M,P]=(0,l.useState)(!1),I=()=>P(e=>!e),A=()=>P(!1),H=(0,o.jz)(A),Q=w||j,Y=j&&!g;return(0,a.jsxs)(o.az,{ref:H,position:"relative",w:"fit-content",children:[(0,a.jsx)(y.A,{disabled:k,isFollowed:Q,onClick:e=>{e.stopPropagation(),e.preventDefault(),k||(Q?I():D())}}),Q&&M&&(0,a.jsx)(x,{entities:E?[E]:void 0,isEventFollowed:w&&!Y,menuPosition:f,isMenuInverted:z,onDeleteClick:e=>{e.stopPropagation(),e.preventDefault(),q(),A()}})]})}},46009:(e,t,r)=>{r.d(t,{w:()=>n,e:()=>b});var a=r(55729);let n=(0,a.createContext)("");var o=r(6029),l=r(89875),i=r(76356),s=r(494),d=r(54409),u=r(61836),c=r(10794),f=r(70757),p=r(12759);let g=e=>{e.stopPropagation(),e.preventDefault()};function b(e){let{entity:t,id:r,location:n,type:b,isOnOverlay:h,isDisabled:m,hasNoBorder:x=!1,onClick:v,isNewButton:y}=e,w=(0,s.wA)(),j=(0,s.d4)(e=>(0,c.Ql)(e,t,r),s.bN),_="boolean"==typeof j?j:j!==c.dE.NotFollowed,C=(0,s.d4)(c.fg)||m,S=(0,a.useCallback)(()=>{if(!C){if(_){let e=j===c.dE.Favorite?(0,p.Hz)(t):t;w((0,f.q$)(e,r))}else{let e=(0,p.Hz)(t);w((0,f.UQ)(e,r))}(0,u.g2)({id:r,type:b,location:n,isFollowed:!_})}},[_,C,t,r]);return y?(0,o.jsx)(l.D7,{disabled:C,onClick:e=>{g(e),null==v||v(),S()},children:(0,o.jsx)(d.zQC,{icon:_?"follow-active":"follow-default",style:{width:24,height:24}})}):(0,o.jsx)(i.I4.button,{border:x?"1.5px solid transparent":void 0,alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",justifyContent:"center",outline:"none",position:"relative",userSelect:"none",flexShrink:"0",whiteSpace:"nowrap",h:"[32px]",w:"[32px]",px:"[0px]",textStyle:"action.button.primary",gap:"xs",br:"sm",color:"primary.default",backgroundColor:"[transparent]",disabled:C,_disabled:{opacity:.5,color:"neutral.default",cursor:"not-allowed"},_hover:C?{}:{bg:"primary.default/8"},_active:C?{}:{bg:"primary.default/15"},_focusVisible:{},onClick:e=>{g(e),null==v||v(),S()},children:_?(0,o.jsx)(d.zQC,{icon:"follow-active",m:"0",fill:h?"onColor.primary":"primary.default"}):(0,o.jsx)(d.zQC,{icon:"follow-default",m:"0",fill:h?"onColor.primary":"neutral.default"})})}}}]);