!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]="9789506d-51b7-49fe-97d9-4a383df69095",e._sentryDebugIdIdentifier="sentry-dbid-9789506d-51b7-49fe-97d9-4a383df69095")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2179],{7447:(e,t,o)=>{o.d(t,{A:()=>l});var n=o(6029),r=o(41249),a=o(54409);function l(e){let{isFollowed:t,disabled:o,onClick:l,isOnOverlay:i,...s}=e;return(0,n.jsx)(r.$n,{m:"0",p:"0",onClick:l,noFocus:!0,noActive:!0,variant:"unshielded",disabled:o,...s,children:t?(0,n.jsx)(a.zQC,{icon:"follow-active",fill:i?"onColor.primary":"primary.default",width:24,height:24,"data-testid":"follow-icon-star-button"}):(0,n.jsx)(a.zQC,{icon:"follow-default",fill:i?"onColor.primary":"neutral.default",width:24,height:24,"data-testid":"deselected-icon-star-button"})})}},8973:(e,t,o)=>{o.d(t,{b:()=>n,y:()=>r});var n=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}({}),r=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}({})},24313:(e,t,o)=>{o.d(t,{M:()=>r,l:()=>a});var n=o(55729);let r=(0,n.createContext)({}),a=()=>(0,n.useContext)(r);r.displayName="EventCellContext"},39969:(e,t,o)=>{o.d(t,{h:()=>w,x:()=>S});var n=o(6029),r=o(21377),a=o(41249),l=o(55729),i=o(494),s=o(24313),d=o(70757),u=o(76410),c=o(10794),f=o(44194),p=o(90248),g=o(54409);let b=(e,t,o)=>{if(o)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:o,LinkComponent:r}=e,l=(0,n.jsxs)(a.so,{align:"center",cursor:"pointer",children:[t,(0,n.jsx)(a.EY,{ml:"lg",color:"onSurface.nLv1",font:"body.medium",block:!0,style:{width:"102px"},children:o})]});return(0,n.jsx)(a.az,{my:"md",children:r?(0,n.jsx)(r,{children:l}):l})},h=(0,l.forwardRef)((e,t)=>{let{isEventFollowed:o,entities:r=[],onDeleteClick:l,menuPosition:i,isMenuInverted:s}=e,{isMobile:d}=(0,f.$c)();return(0,n.jsx)(a.az,{ref:t,position:"absolute",w:174,bg:"surface.s1",elevation:3,br:"md",py:"sm",zIndex:a.Py.Popover,style:{...b(d,i,s),whiteSpace:"normal"},children:o&&l?(0,n.jsxs)(a.so,{tabIndex:0,px:"lg",py:"sm",minH:"48",align:"center",br:"md",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==l||l(e))},onClick:l,cursor:"pointer",children:[(0,n.jsx)(g.xV8,{fill:"error.default",width:24,height:24,mr:"lg"}),(0,n.jsx)(a.EY,{color:"onSurface.nLv1",font:"body.medium",block:!0,style:{width:"102px"},children:(0,n.jsx)(p.A,{id:"remove_from_favourites"})})]}):(0,n.jsxs)(a.az,{px:"lg",minH:"48",children:[(0,n.jsx)(a.EY,{color:"onSurface.nLv3",font:"assistive.default",pb:"sm",align:"left",as:"div",children:(0,n.jsx)(p.A,{id:"favorites.becauseYouFollow"})}),r.map(e=>(0,n.jsx)(m,{...e},e.entityType+e.id))]})})});var v=o(37356),x=o(7447);let y=e=>{e.stopPropagation(),e.preventDefault()};function w(e){let{id:t,leftTeam:o,rightTeam:f,tournament:p,menuPosition:g,isMenuInverted:b,isOnOverlay:m,location:w,type:j}=e,C=(0,l.useMemo)(()=>(0,v.fB)(),[]),_=(0,l.useMemo)(()=>(0,v.KL)(),[]),S=(0,i.d4)(e=>C(e,t)),k=(0,i.d4)(e=>_(e,{leftTeam:o,rightTeam:f,tournament:p})),E=(0,i.d4)(c.fg),F=S!==c.dE.NotFollowed&&!!S,P=F||!!k.length,{invertedMenu:q}=(0,s.l)(),z=(0,i.wA)(),D=()=>{z((0,d.q$)(r.bq7.Events,t)),z((0,d.q$)(r.bq7.MutedEvents,t)),(0,u.g2)({id:t,type:j,location:w,isFollowed:!1})},M=()=>{z((0,d.UQ)(r.bq7.Events,t)),(0,u.g2)({id:t,type:j,location:w,isFollowed:!0})},[A,I]=(0,l.useState)(!1),H=()=>I(e=>!e),Q=(0,l.useCallback)(()=>I(!1),[]),T=(0,a.jz)(Q);return(0,n.jsxs)(a.az,{ref:T,w:"fit-content",children:[(0,n.jsx)(x.A,{"aria-label":P?"Remove from favourites":"Add to favourites",disabled:E,isFollowed:P,isOnOverlay:m,onClick:e=>{y(e),E||(P?F?D():H():M())}}),P&&A&&!F&&(0,n.jsx)(h,{isEventFollowed:F,entities:k,menuPosition:g,isMenuInverted:q||b,onDeleteClick:e=>{y(e),D(),Q()}})]})}var j=o(62859),C=o(8973),_=o(37470);function S(e){let{id:t,uniqueStage:o,menuPosition:f,location:p,isSubstageCell:g}=e,b=(0,l.useContext)(j.Ws),m=(0,l.useMemo)(()=>(0,v.BD)(),[]),y=(0,l.useMemo)(()=>(0,v.jM)(),[]),w=(0,i.d4)(e=>m(e,t)),S=(0,i.d4)(e=>y(e,null==o?void 0:o.id)),k=(0,i.d4)(c.fg),E=S&&o?(0,_.P3)({uniqueStage:o,sportSlug:b}):void 0,{invertedMenu:F}=(0,s.l)(),P=(0,i.wA)(),q=()=>{P((0,d.UQ)(r.bq7.Stages,t)),(0,u.g2)({id:t,type:g?C.b.Substage:C.b.Stage,location:p,isFollowed:!0})},z=()=>{P((0,d.q$)(r.bq7.Stages,t)),(0,u.g2)({id:t,type:g?C.b.Substage:C.b.Stage,location:p,isFollowed:!1})},[D,M]=(0,l.useState)(!1),A=()=>M(e=>!e),I=()=>M(!1),H=(0,a.jz)(I),Q=w||S,T=S&&!g;return(0,n.jsxs)(a.az,{ref:H,position:"relative",w:"fit-content",children:[(0,n.jsx)(x.A,{disabled:k,isFollowed:Q,onClick:e=>{e.stopPropagation(),e.preventDefault(),k||(Q?A():q())}}),Q&&D&&(0,n.jsx)(h,{entities:E?[E]:void 0,isEventFollowed:w&&!T,menuPosition:f,isMenuInverted:F,onDeleteClick:e=>{e.stopPropagation(),e.preventDefault(),z(),I()}})]})}},43451:(e,t,o)=>{o.d(t,{D:()=>l});var n=o(6029),r=o(36145),a=o(41735);let l=({width:e="100%",height:t,animate:o=!1,viewBox:l,style:i,children:s,uniqueKey:d})=>{let u=(0,a.useTheme)();return(0,n.jsx)(r.Ay,Object.assign({speed:2,animate:o,width:e,height:t,backgroundColor:o?u.colors.surface.s0:u.colors.surface.s2,foregroundColor:u.colors.surface.s2,viewBox:l,style:i,uniqueKey:d},{children:s}))}},46009:(e,t,o)=>{o.d(t,{w:()=>r,e:()=>g});var n=o(55729);let r=(0,n.createContext)("");var a=o(6029),l=o(76356),i=o(494),s=o(54409),d=o(76410),u=o(10794),c=o(70757),f=o(12759);let p=e=>{e.stopPropagation(),e.preventDefault()};function g(e){let{entity:t,id:o,location:r,type:g,isOnOverlay:b,isDisabled:m,hasNoBorder:h=!1,onClick:v}=e,x=(0,i.wA)(),y=(0,i.d4)(e=>(0,u.Ql)(e,t,o),i.bN),w="boolean"==typeof y?y:y!==u.dE.NotFollowed,j=(0,i.d4)(u.fg)||m,C=(0,n.useCallback)(()=>{if(!j){if(w){let e=y===u.dE.Favorite?(0,f.Hz)(t):t;x((0,c.q$)(e,o))}else{let e=(0,f.Hz)(t);x((0,c.UQ)(e,o))}(0,d.g2)({id:o,type:g,location:r,isFollowed:!w})}},[w,j,t,o]);return(0,a.jsx)(l.I4.button,{border:h?"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:"[26px]",w:"[26px]",p:"[0px]",textStyle:"action.button.primary",gap:"xs",br:"xs",color:"primary.default",backgroundColor:"[transparent]",disabled:j,_disabled:{opacity:.5,color:"neutral.default",cursor:"not-allowed"},_hover:j?{}:{bg:"primary.default/8"},_active:j?{}:{bg:"primary.default/15"},_focusVisible:{},onClick:e=>{p(e),null==v||v(),C()},children:w?(0,a.jsx)(s.zQC,{icon:"follow-active",m:"0",fill:b?"onColor.primary":"primary.default"}):(0,a.jsx)(s.zQC,{icon:"follow-default",m:"0",fill:b?"onColor.primary":"neutral.default"})})}}}]);