!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]="db0fbd74-5faf-44ce-b33c-0e6872672b68",e._sentryDebugIdIdentifier="sentry-dbid-db0fbd74-5faf-44ce-b33c-0e6872672b68")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9469],{17352:(e,t,n)=>{n.d(t,{Iz:()=>g,K$:()=>x,Q3:()=>c,T8:()=>f,bZ:()=>m,d4:()=>h,do:()=>v,kS:()=>j,mK:()=>d,mt:()=>p});var i=n(21377),o=n(39676),r=n(98516),l=n(9329),s=n(89194),a=n(75067);let d=(e,t,n)=>{let i=(e||0)+(t||0)+(n||0),o=0===i?0:(e||0)/i*100,l=0===i?0:(t||0)/i*100,s=0===i?0:(n||0)/i*100,a=parseFloat((0,r.M)(o)),d=parseFloat((0,r.M)(l)),c=parseFloat((0,r.M)(s)),u=100-(a+d+c);if(0!==u){let e=o%1,t=s%1,n=Math.max(e,l%1,t);n===e?a+=u:n===t?c+=u:d+=u}return{leftPercentage:a,middlePercentage:d,rightPercentage:c}},c=e=>{let t=Object.keys(a.Qf);return Object.keys(e).some(n=>t.includes(n)&&Object.values(e[+n]).some(e=>!!e))},u=e=>{switch(e){case i.gbi.One:case i.gbi.Yes:return s.m.Left;case i.gbi.Two:case i.gbi.No:return s.m.Right;default:return s.m.Middle}},v=e=>{switch(e){case i.rjx.WillBothTeamsScore:return l.NT;case i.rjx.FirstTeamToScore:return l.dT;default:return l.o3}},f=e=>[o.Mx.DesktopEventPage,o.Mx.MobileEventPage].includes(e)?"event_details":e===o.Mx.DesktopWidget?"event_widget":void 0,x=(e,t)=>{switch(e){case i.rjx.WhoWillWin:return t?"who_will_win_daily_10x":"who_will_win";case i.rjx.WillBothTeamsScore:return"will_both_teams_score";case i.rjx.FirstTeamToScore:return"first_team_to_score";default:return}},p=e=>{switch(e){case i.rjx.WhoWillWin:return"1";case i.rjx.WillBothTeamsScore:return"2";case i.rjx.FirstTeamToScore:return"3";default:return}},m=e=>1e3*e.startTimestamp>Date.now()&&e.status.type===i.XUj.NotStarted;function h(e,t){return Object.values(s.m).find(n=>{var i,o;return(null==e||null==(o=e.position)||null==(i=o[n])?void 0:i.voteOption)===t})}function j(e,t,n,i,o){var r,l;let s=n.voteModelKey,a=null==(r=n.position[i])?void 0:r.voteApiKey,d=o?u(o):void 0,c=d?null==(l=n.position[d])?void 0:l.voteApiKey:void 0,v=c===a;if(e&&a){let n=e[s],i=n[a],o=n[c],r=a in n?v?i:i+1:1,l=c&&c in n?v?o:o-1:0;t({...e,[s]:{...e[s],[a]:r,...c&&{[c]:l}}},{revalidate:!1,populateCache:!0})}}function g(e,t){return e?s.w.Votable:t?s.w.Transform:s.w.NoAnimation}},29469:(e,t,n)=>{n.d(t,{A:()=>D});var i=n(6029),o=n(76356),r=n(81278),l=n(55729),s=n(65789),a=n(75751),d=n(62827),c=n(70448),u=n(89875),v=n(99064),f=n(90248),x=n(90112),p=n(9127),m=n(41735),h=n(22648);let j=e=>{let{isCancelable:t,isOpen:n,portalsContainerId:o,onClose:r}=e,l=(0,m.useTheme)();return((0,u.NF)(n),"undefined"==typeof document)?null:(0,i.jsx)(v.ZL,{id:o,children:(0,i.jsx)(x.N,{children:n&&(0,i.jsxs)(p.m.div,{animate:{backgroundColor:l.colors.overlay.darken2},exit:{backgroundColor:"rgba(0,0,0,0)",transition:{delay:.1}},transition:{duration:.2,ease:"easeIn"},style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",inset:0,overflow:"hidden",zIndex:v.Py.ModalBackdrop},onClick:r,children:[(0,i.jsx)(h.a,{size:56,spinnerColor:"#fff"}),t&&(0,i.jsx)(v.$n,{borderStyle:"rounded",colorScheme:"onColor",style:{position:"absolute",bottom:"10%",left:"50%",transform:"translateX(-50%)"},color:"secondary",onClick:r,children:(0,i.jsx)(f.A,{id:"basic.cancel"})})]},"overlay")})})};function g(e){let{onChangeVote:t,onChangeVoteContinue:n,onChangeVoteClose:r,isModalOpen:l,isLoaderOpen:s,onLoaderExit:a}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j,{isOpen:s,onClose:a,isCancelable:!0}),(0,i.jsx)(u.$n,{variant:"clear",size:"tertiary",onClick:t,children:(0,i.jsx)(f.A,{id:"basic.changeVote"})}),(0,i.jsx)(v.aF,{isOpen:l,children:(0,i.jsxs)(o.az,{w:"[312px]",bg:"surface.s1",p:"lg",br:"lg",elevation:"3",mx:"auto",children:[(0,i.jsx)(v.EY,{font:"display.large",color:"onSurface.nLv1",lineHeight:"24px",mb:"sm",as:"div",children:(0,i.jsx)(f.A,{id:"profile.changeVoteTooltipDescription"})}),(0,i.jsx)(v.EY,{font:"body.medium",color:"onSurface.nLv1",as:"div",children:(0,i.jsx)(f.A,{id:"change_vote_watch_ad"})}),(0,i.jsxs)(o.so,{justify:"flex-end",mt:"xl",children:[(0,i.jsx)(u.$n,{variant:"clear",onClick:r,children:(0,i.jsx)(f.A,{id:"close_window_button"})}),(0,i.jsx)(u.$n,{variant:"clear",onClick:n,children:(0,i.jsx)(f.A,{id:"basic.continue"})})]})]})})]})}var y=n(75414);function b(e){let{totalVotes:t,isLoading:n}=e;return(0,i.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f.A,{id:"prediction_total_votes"}),": ",(0,y.A)(t)]})})}function T(e){let{event:t,isVotingEnabled:n,activeVoteType:r,changeVoteBtn:l}=e,{totalVotes:s,isLoading:a}=(0,c.sr)(t,r),{hasNotStarted:d}=(0,c.N6)(t);return d?n?(0,i.jsx)(o.so,{justify:"center",align:"center",minH:"2xl",children:(0,i.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,i.jsx)(f.A,{id:"change_vote_info_text"})})}):(0,i.jsxs)(o.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,i.jsx)(b,{totalVotes:s,isLoading:a}),l]}):(0,i.jsxs)(o.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,i.jsx)(b,{totalVotes:s,isLoading:a}),(0,i.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,i.jsx)(f.A,{id:"voting_ended_status"})})]})}function _(e){let{titleId:t,voteType:n}=e;return t?(0,i.jsx)(u.EY,{textStyle:"display.medium",children:t&&(0,i.jsx)(f.A,{id:t})},n):null}function w(e){let{sliderOptions:t,initialIndex:n,setActiveVoteType:o}=e,[r,s]=(0,l.useState)(n);return(0,l.useEffect)(()=>{o(t[r])},[r]),(0,i.jsx)(v.VQ,{mx:"sm",h:"40px",centerVertically:!0,controls:[r,s],buttonProps:{variant:"unshielded"},children:t.map(e=>{let t=c.HD[e];return(0,i.jsx)(_,{titleId:t,voteType:e},e)})})}function E(e){let{sliderOptions:t}=e;if(t.length>1)return(0,i.jsx)(w,{...e});let n=t[0],r=c.HD[n];return(0,i.jsx)(o.so,{h:"3xl",justify:"center",align:"center",children:(0,i.jsx)(_,{titleId:r,voteType:n})})}var S=n(89042);let C=(0,n(62042).Fj)({base:{h:"sm",br:"xs",mx:"xs"},variants:{type:{default:{w:"sm",bg:"neutrals.nLv4"},active:{w:"xl",bg:"primary.default"}}}}),V=(0,o.I4)("div",C);function A(e){let{sliderOptions:t,activeVoteType:n}=e;return t.length>1?(0,i.jsx)(o.so,{align:"center",justify:"center",children:t.map(e=>(0,i.jsx)(V,{type:n===e?"active":"default"},"".concat(e,"-dot")))}):null}var R=n(54409),W=n(82707),k=n(61836);function I(e){let{location:t}=e;return(0,i.jsx)(s.Zp,{isNewCard:!0,children:(0,i.jsx)(o.az,{py:"sm",px:"lg",children:(0,i.jsxs)(o.so,{align:"center",justify:"space-between",children:[(0,i.jsx)(u._V,{h:"[36px]",w:"[52px]",src:"/static/images/weekly-challenge/predictions-cta.svg",alt:"Weekly challenge trophies"}),(0,i.jsx)(W.N_,{routeKey:"user.weeklyChallenge",onClick:()=>{(0,k.Wk)({type:"weekly_challenge",location:t})},children:(0,i.jsxs)(o.so,{cursor:"pointer",align:"center",children:[(0,i.jsx)(u.EY,{color:"primary.default",textStyle:"display.micro",children:(0,i.jsx)(f.A,{id:"view_weekly_challenge"})}),(0,i.jsx)(R.CCT,{fill:"primary.default"})]})})]})})})}function D(e){let{event:t}=e,n=(0,r.useRouter)(),d=e.event.tournament.category.sport.slug,u=c.Ej[d]||c.il,[v,f]=(0,l.useState)(u[0]),[x,p]=(0,l.useState)(0),[m,h]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{if(n.query.voteType&&!m){f(u.find(e=>"".concat(e)===n.query.voteType)||u[0]);let e=u.findIndex(e=>"".concat(e)===n.query.voteType);p(e<0?0:e)}h(!0)},[]),m)?0===u.length||t.awayTeam.disabled||t.homeTeam.disabled?null:(0,i.jsx)(a.t,{tag:"EventVotes",children:(0,i.jsx)(M,{sliderOptions:u,initialIndex:x,activeVoteType:v,setActiveVoteType:f,...e})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Zp,{isNewCard:!0,children:(0,i.jsx)(o.az,{h:"[130px]"})}),(0,i.jsx)(o.az,{h:"sm",mb:"md"})]})}function M(e){let{event:t,placement:n,initialIndex:r,sliderOptions:a,setActiveVoteType:u,activeVoteType:v}=e,f=(0,c.T8)(n),{userVote:x}=(0,c.tV)(t,v),{hasNotStarted:p}=(0,c.N6)(t),[m,h]=(0,l.useState)(!1),[j,y]=(0,l.useState)(!1),b=p&&!(0,d.ux)(t)&&!x||j,{autoShowAd:_,canEditVote:w,grantReward:C,hasRevisitedChangeVote:V,setAutoShowAd:R}=(0,c.a8)(t,v,m,h,y),{isModalOpen:W,onChangeVote:k,onShowAd:D,setAdCanceled:M,setIsModalOpen:L,setShowLoader:O,showLoader:N}=(0,c.$d)(t.id,n,_,V,v,()=>R(!1),()=>{C(),O(!1)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.Zp,{isNewCard:!0,children:[(0,i.jsx)(o.az,{pt:"xs",children:(0,i.jsx)(E,{sliderOptions:a,initialIndex:r,setActiveVoteType:u})}),(0,i.jsx)(o.az,{px:"lg",py:"sm",children:(0,i.jsx)(S.A,{location:f,voteType:v,enableVoteChange:m})}),(0,i.jsx)(o.az,{px:"lg",children:(0,i.jsx)(T,{event:t,activeVoteType:v,isVotingEnabled:b,changeVoteBtn:(w||V)&&(0,i.jsx)(g,{onChangeVote:k,onChangeVoteClose:()=>L(!1),onChangeVoteContinue:D,isModalOpen:W,isLoaderOpen:N,onLoaderExit:()=>{O(!1),M(!0)}})})}),(0,i.jsx)(s.Zp.Footer,{defaultHeight:"sm"})]}),(0,i.jsx)(A,{sliderOptions:a,activeVoteType:v}),(0,i.jsx)(I,{location:"event_details"})]})}},32259:(e,t,n)=>{n.d(t,{a:()=>r});var i=n(65078),o=n(89194);function r(e,t){return(0,i.g3)(e)?{...t,[o.m.Left]:t[o.m.Right],[o.m.Right]:t[o.m.Left]}:t}},42796:(e,t,n)=>{n.d(t,{e1:()=>r,sJ:()=>o,u_:()=>i});let i=[n(21377).QCR.Football],o=["IT","US"],r="has-voted-daily-10x"},64528:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(21377),o=n(4967),r=n(494),l=n(45860),s=n(88339);let a=()=>{let e=(0,r.d4)(s.$F);return(0,l.Ay)((null==e?void 0:e.id)?i.VfS.futurePredictions(e.id):null,{dedupingInterval:o.dp})}},70448:(e,t,n)=>{n.d(t,{_7:()=>f._7,NT:()=>u.NT,w:()=>v.w,il:()=>u.il,dT:()=>u.dT,Ej:()=>u.Ej,HD:()=>f.HD,mR:()=>v.m,o3:()=>u.o3,d4:()=>d.d4,Iz:()=>d.Iz,mt:()=>d.mt,T8:()=>d.T8,Q3:()=>d.Q3,bZ:()=>d.bZ,kS:()=>d.kS,wH:()=>x.wH,a8:()=>i.a8,$d:()=>i.$d,sr:()=>o.s,N6:()=>r.N,tV:()=>l.t,CU:()=>c});var i=n(84570),o=n(96169),r=n(87966);n(32259);var l=n(77562),s=n(1815),a=n(61836),d=n(17352);function c(e){let{voteType:t,isDailyBonus:n,eventId:i,location:o}=e,r=(0,d.K$)(t,n),l=(0,d.mt)(t)||"";return{impressionRef:(0,s.e)(()=>{r&&(0,a.M_)({type:r,id:i,position:l,location:o})},{sendInterval:3e4}),logOnEventVote:()=>{r&&(0,a.Tc)({id:i,type:r,position:l,location:o})}}}var u=n(9329),v=n(89194),f=n(75067),x=n(39332)},75067:(e,t,n)=>{n.d(t,{HD:()=>s,Qf:()=>l,_7:()=>o,fw:()=>r});var i=n(21377);let o={[i.rjx.WhoWillWin]:"who_will_win",[i.rjx.WillBothTeamsScore]:"will_both_teams_score",[i.rjx.FirstTeamToScore]:"first_team_to_score"},r={[i.rjx.WhoWillWin]:"who_will_win_edit",[i.rjx.WillBothTeamsScore]:"will_both_teams_score_edit",[i.rjx.FirstTeamToScore]:"first_team_to_score_edit"},l={[i.rjx.WhoWillWin]:"fullTime",[i.rjx.WillBothTeamsScore]:"bothTeamsToScore",[i.rjx.FirstTeamToScore]:"firstTeamToScore"},s={[i.rjx.WhoWillWin]:"who_will_win",[i.rjx.WillBothTeamsScore]:"will_both_teams_score_title",[i.rjx.FirstTeamToScore]:"who_will_score_first_title"}},75414:(e,t,n)=>{n.d(t,{A:()=>i});let i=function(e){switch(!0){case e<1e3:return"".concat(e);case e<1e4&&e/1e3%1>=.1:let t="".concat((e/1e3).toPrecision(2));return t.endsWith(".0")&&(t=t.substring(0,t.length-2)),"".concat(t,"k");case e<1e6:let n=Math.round(e/1e3);if(1e3===n)return"1M";return"".concat(n,"k");case e<1e7:let i=(e/1e5).toFixed();return i=i.endsWith("0")?i.substring(0,i.length-1):"".concat(i[0],".").concat(i[1]),"".concat(i,"M");case e<1e8:return"".concat(Math.round(e/1e6),"M");case e<1e9:let o=Math.round(e/1e6);if(1e3===o)return"1B";return"".concat(o,"M");default:return"".concat(e)}}},77562:(e,t,n)=>{n.d(t,{t:()=>s});var i=n(494),o=n(75067),r=n(39332),l=n(64528);let s=(e,t)=>{var n,s,a;let d=(0,i.d4)(r.wH),{data:c,isLoading:u,mutate:v}=(0,l.Z)(),f=null==c||null==(s=c.predictions)||null==(n=s.find)?void 0:n.call(s,t=>t.eventId===e.id),x=null==(a=d[e.id])?void 0:a[t],p=null==x?void 0:x.current,m=null==x?void 0:x.prev;return{userVote:(null==f?void 0:f.votes[o.Qf[t]])||p,oldVote:m,eventFuturePrediction:f,userFuturePredictions:c,areFuturePredictionsLoading:u,mutateFuturePredictions:v}}},84570:(e,t,n)=>{n.d(t,{a8:()=>y,$d:()=>w,dV:()=>m,NC:()=>x});var i=n(55729),o=n(494),r=n(62859),l=n(75067),s=n(5815);let a=e=>({type:s.UG.ADD_CHANGED_VOTE,payload:e}),d=e=>({type:s.UG.REMOVE_CHANGED_VOTE,payload:e});var c=n(37567),u=n(17352),v=n(96169),f=n(77562);let x=(e,t)=>{let n=(0,o.wA)(),{event:s}=(0,i.useContext)(r.y$),{data:a,mutate:x}=(0,v.s)(s,e),{userVote:p,oldVote:m,userFuturePredictions:h,eventFuturePrediction:j,mutateFuturePredictions:g}=(0,f.t)(s,e),y=(n,i)=>{(0,u.kS)(a,x,t,i,p),(null==h?void 0:h.predictions)&&(null==j?void 0:j.votes)!==void 0&&(j.votes={...j.votes,[l.Qf[e]]:n},g({predictions:[...h.predictions.filter(e=>e.eventId!==s.id),j]},!1))};return{handleChangeVote:(t,i)=>{n(d({eventId:s.id,voteType:e})),y(t,i),m||n((0,c.sP)({eventId:s.id,type:e,vote:t}))}}};var p=n(39332);let m=(e,t)=>!!(0,o.d4)(p.am).find(n=>{var i;return n.eventId===e&&(null==(i=n.voteTypes[t])?void 0:i.isChangeVoteRewarded)});var h=n(81278),j=n(61836),g=n(87966);let y=(e,t,n,r,s)=>{let d=(0,o.wA)(),c=(0,h.useRouter)(),u=m(e.id,t),{userVote:v}=(0,f.t)(e,t),{hasNotStarted:x}=(0,g.N)(e),[p,y]=(0,i.useState)(!1),b=(0,i.useRef)(t);b.current=t;let T=x&&!n&&u,_=x&&!u&&!!v;(0,i.useEffect)(()=>{y("true"===c.query.editVote&&c.query.voteType==="".concat(t))},[]),(0,i.useEffect)(()=>{r(!1)},[t]),(0,i.useEffect)(()=>{s(n&&u)},[n,u]);let w=(0,i.useCallback)(()=>{r(!0);let t=b.current;d(a({eventId:e.id,voteType:t})),p?(0,j.ke)({action:"reward",location:"user_profile",type:l.fw[t]}):(0,j.ke)({action:"reward",location:"event_details",type:l._7[t]})},[e.id,t]);return{hasRevisitedChangeVote:T,canEditVote:_,autoShowAd:p,setAutoShowAd:y,grantReward:w}};var b=n(39676),T=n(98095);let _={[b.Mx.DesktopEventPage]:b.Rj.REWARDED_DESKTOP_VOTE_EVENT,[b.Mx.DesktopProfilePage]:b.Rj.REWARDED_DESKTOP_VOTE_PROFILE,[b.Mx.MobileEventPage]:b.Rj.REWARDED_MOBILE_VOTE_EVENT,[b.Mx.MobileProfilePage]:b.Rj.REWARDED_MOBILE_VOTE_PROFILE,[b.Mx.DesktopWidget]:b.Rj.REWARDED_DESKTOP_VOTE_WIDGET},w=(e,t,n,o,r,s,a,d)=>{let{hasAdBlock:c}=(0,T.j)(),[v,f]=(0,i.useState)(!1),[x,p]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!1),g=b.BP.find(e=>e.id===_[t]),{showRewardedAd:y,isEnabled:w}=(0,b.NL)(g.Google,a,d),E=(0,i.useCallback)(async n=>{n.preventDefault(),n.stopPropagation(),(0,j.tN)({type:l._7[r],position:(0,u.mt)(r)||"",location:(0,u.T8)(t),id:e}),h(!1),f(!0),await y(),f(!1)},[y,o,r]),S=(0,i.useCallback)(()=>{if(o||!w){null==a||a();return}h(!0)},[o,w,a]);return(0,i.useEffect)(()=>{(async()=>{n&&(c?null==a||a():(x||o||(f(!0),await y(),f(!1)),p(!1)),s())})()},[n,c,y]),{onChangeVote:S,setShowLoader:f,setAdCanceled:p,showLoader:v,onShowAd:E,isModalOpen:m,setIsModalOpen:h}}},87966:(e,t,n)=>{n.d(t,{N:()=>r});var i=n(55729),o=n(17352);let r=e=>{let[t,n]=(0,i.useState)((0,o.bZ)(e));return(0,i.useEffect)(()=>{let t=setInterval(()=>{n((0,o.bZ)(e))},1e3);return()=>{clearInterval(t)}},[]),{hasNotStarted:t}}},89042:(e,t,n)=>{n.d(t,{A:()=>A});var i=n(6029),o=n(21377),r=n(76356),l=n(55729),s=n(494),a=n(62859),d=n(62827),c=n(83260),u=n(33144),v=n(99064),f=n(90248),x=n(54409),p=n(58918),m=n(57126),h=n(41735),j=n(94497),g=n(70448);let y=(0,h.keyframes)(["from{left:50%;transform:translateX(-50%);}to{left:0;}"]),b=(0,h.default)(v.so).withConfig({componentId:"sc-ace7c0c8-0"})(["position:absolute;",""],e=>{let{buttonState:t}=e;return t===g.w.NoAnimation?(0,h.css)(["left:0;"]):t===g.w.Transform?(0,h.css)(["animation:"," 0.35s ease-out forwards;"],y):null}),T=(0,h.default)(v.az).withConfig({componentId:"sc-ace7c0c8-1"})(["position:absolute;right:0;",""],e=>{let{buttonState:t}=e;return t===g.w.NoAnimation?(0,h.css)(["opacity:1;"]):t===g.w.Transform?(0,h.css)(["opacity:0;animation:"," 0.2s 0.35s ease-in forwards;"],j.qG):(0,h.css)(["opacity:0;"])});function _(e){var t;let{isSelected:n,...r}=e,{percentage:l,team:a,buttonPositionType:d,isVotingEnabled:c,voteConfig:h,animate:j}=r,y=(0,s.d4)(m.xl),_=h.position[d],w=(0,g.Iz)(c,j),E=null==a?void 0:a.sport.slug,S=(null==a||null==(t=a.subTeams)?void 0:t.length)===2&&E===o.QCR.Tennis,C=h.isTranslated&&(null==_?void 0:_.text),V=y&&(null==_?void 0:_.inverseTeamsText);return(0,i.jsxs)(v.so,{position:"relative",w:"100%",align:"center",justify:"center",h:24,children:[(0,i.jsx)(b,{buttonState:w,align:"center",children:S&&(null==a?void 0:a.subTeams)?(0,i.jsx)(p.K,{size:24,sport:E,teams:a.subTeams,hideFlags:!0,ignoreLink:!0}):a?(0,i.jsx)(u.p,{size:24,id:a.id,name:a.name}):(null==_?void 0:_.voteOption)===o.gbi.NoGoal?(0,i.jsx)(x.U7g,{fill:"onSurface.nLv1"}):(0,i.jsx)(v.EY,{font:"display.micro",c:n?"primary.default":"onSurface.nLv1",mt:1,textTransform:"uppercase",children:C?(0,i.jsx)(f.A,{id:_.text}):V?(0,i.jsx)(i.Fragment,{children:_.inverseTeamsText}):(0,i.jsx)(i.Fragment,{children:null==_?void 0:_.text})})}),!c&&(0,i.jsx)(T,{buttonState:w,children:(0,i.jsxs)(v.EY,{as:"div",font:"display.small",c:n?"primary.default":"onSurface.nLv1",children:[null!=l?l:0,"%"]})})]})}function w(e){let{isVotingEnabled:t,votedPositionType:n,voteConfig:o,buttonPositionType:r,isChangeVoteActive:l,onVote:s}=e,a=!l&&void 0!==n&&n===r;return(0,i.jsx)(v.so,{as:t?"button":"div",align:"center",justify:"center",px:"lg",py:"xs",w:"100%",br:"xxl",bg:a?"primary.highlight":"surface.s1",border:t||a?"primary.default":"onSurface.nLv4",hoverBg:t?"primary.highlight":void 0,cursor:t?"pointer":"default",userSelect:"none",onClick:()=>{if(t){var e;let t=null==(e=o.position[r])?void 0:e.voteOption;t&&s(t,r)}},children:(0,i.jsx)(_,{isSelected:a,...e})})}var E=n(42796),S=n(84570),C=n(37567);function V(e){var t,n;let{isDailyBonus:u,eventVoteLocation:v,voteType:f,config:x,enableVoteChange:p}=e,m=(0,s.wA)(),{event:h,leftTeam:j,rightTeam:y}=(0,l.useContext)(a.y$),{userVote:b}=(0,g.tV)(h,f),T=(0,S.dV)(h.id,f),{eventVotes:_,data:V,isLoading:A,mutate:R}=(0,g.sr)(h,f),{handleChangeVote:W}=(0,S.NC)(f,x),[k,I]=(0,c.A)(E.e1,!1),[D,M]=(0,l.useState)(!1),L=(0,g.bZ)(h),O=(0,g.d4)(x,b),N=T&&p,F=L&&!(0,d.ux)(h)&&!b||N;(0,l.useEffect)(()=>{M(!1)},[f]);let{impressionRef:P,logOnEventVote:B}=(0,g.CU)({voteType:f,isDailyBonus:u,eventId:h.id,location:v}),z={voteConfig:x,votedPositionType:O,isVotingEnabled:F,isChangeVoteActive:N,animate:D,onVote:(e,t)=>{M(!0),T&&p?(W(e,t),m((0,C.eM)({eventId:h.id,type:f,vote:e,oldVote:b,isDailyBonus:u}))):((0,g.kS)(V,R,x,t),m((0,C.eM)({eventId:h.id,type:f,vote:e,isDailyBonus:u})),m((0,C.sP)({eventId:h.id,type:f,vote:e}))),B(),u&&I(!0)}},H=_.voteMiddle.isAvailable&&!!x.position[g.mR.Middle],K=_.voteLeft.isAvailable&&!!x.position[g.mR.Left],Z=_.voteRight.isAvailable&&!!x.position[g.mR.Right],$=(null==(t=x.position[g.mR.Left])?void 0:t.voteOption)===o.gbi.One,Q=(null==(n=x.position[g.mR.Right])?void 0:n.voteOption)===o.gbi.Two;return A?(0,i.jsx)(r.az,{h:"2xl"}):(0,i.jsxs)(r.so,{ref:P,justify:"center",gap:"sm",children:[K&&(0,i.jsx)(w,{buttonPositionType:g.mR.Left,percentage:_[g.mR.Left].percentage,team:$?j:void 0,...z}),H&&(0,i.jsx)(w,{buttonPositionType:g.mR.Middle,percentage:_[g.mR.Middle].percentage,...z}),Z&&(0,i.jsx)(w,{buttonPositionType:g.mR.Right,percentage:_[g.mR.Right].percentage,team:Q?y:void 0,...z})]})}function A(e){let{location:t,voteType:n,isDailyBonus:r,enableVoteChange:l}=e;switch(n){case o.rjx.WhoWillWin:return(0,i.jsx)(V,{config:g.o3,voteType:o.rjx.WhoWillWin,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case o.rjx.WillBothTeamsScore:return(0,i.jsx)(V,{config:g.NT,voteType:o.rjx.WillBothTeamsScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case o.rjx.FirstTeamToScore:return(0,i.jsx)(V,{config:g.dT,voteType:o.rjx.FirstTeamToScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});default:return null}}},96169:(e,t,n)=>{n.d(t,{s:()=>d});var i=n(21377),o=n(45860);function r(e,t){if(void 0!==e&&void 0!==t)return t in e?e[t]:void 0}var l=n(32259),s=n(89194),a=n(17352);function d(e,t){let{data:n,isLoading:d,mutate:c}=(0,o.Ay)(i.bnp.votes(e.id),{refreshInterval:6e4,dedupingInterval:6e4}),{voteModelKey:u,position:v}=(0,a.do)(t),f=(0,l.a)(e,v),x=f[s.m.Left],p=v[s.m.Middle],m=f[s.m.Right],h=r(n,u),j=r(h,null==x?void 0:x.voteApiKey),g=r(h,null==p?void 0:p.voteApiKey),y=r(h,null==m?void 0:m.voteApiKey),b=(!j||j<0?0:j)+(!y||y<0?0:y)+(!g||g<0?0:g),{leftPercentage:T,middlePercentage:_,rightPercentage:w}=(0,a.mK)(j,g,y);return{data:n,isLoading:d,mutate:c,totalVotes:b,eventVotes:{[s.m.Left]:{isAvailable:"number"==typeof j,count:j,percentage:T},[s.m.Middle]:{isAvailable:"number"==typeof g,count:g,percentage:_},[s.m.Right]:{isAvailable:"number"==typeof y,count:y,percentage:w}}}}}}]);