1import{a as e,j as a}from"./vendor-animation-428022f4.js";import{r,u as o}from"./vendor-react-60b2ddf1.js";import{s as l}from"./LeaguePerformanceReport.module-f17c4432.js";import{S as s,Q as t}from"./vendor-ui-722eb924.js";import{C as i,E as n}from"./ComparePlayerModel-401acdbb.js";import{s as c,v as m}from"./v4-61c4dc18.js";import{b as d}from"./backIcon-51badf39.js";import{u as p,C as h,ba as u,be as f,J as v,N as g,K as y,a3 as b,F as P,b3 as N,b4 as x,b5 as w,b6 as I,b7 as S}from"./index-bebc22d9.js";import{M as R,P as k}from"./MenuTabs-2eec9547.js";import{t as T}from"./TouchScrollMenuList-2015a052.js";import"./vendor-forms-28fcec82.js";import"./selector-9e697a40.js";import"./imageFallbacks-ffd2b4c7.js";import"./selectedIcon-2b5f7da0.js";import"./vendor-query-7477f658.js";import"./speaker_stop-739fde10.js";import"./index-cf4fbd91.js";import"./currencyUtils-a4379a13.js";import"./gridPointerBlue-cee78049.js";import"./calendar-2ee76a65.js";import"./number-cdf634f0.js";import"./imageNotFound-7b47b0c8.js";import"./auto-2cc6adad.js";import"./vendor-charts-1b436cd4.js";import"./leaguesSeasonFormat-1be2583e.js";import"./worldCupFixtures-21fd6f44.js";import"./fifa-world-cup-ebdd54fd.js";function j({}){const{t:j}=p(),[D,F]=r.useState(!1),_=o(),[O,C]=r.useState(!1),L=j("leaguePerformanceReport.lprNotFound"),{competitionId:A,competitionName:E,matchDate:$,matchDay:M}=_.state,H="bestPerformers",W="worstPerformers",[z]=r.useState([H,W]),[B,G]=r.useState(H),[K]=r.useState([h.POSITION_GOALKEEPER,h.POSITION_DEFENDER,h.POSITION_MIDFIELDER,h.POSITION_FORWARD]),[q,Y]=r.useState(h.POSITION_FORWARD),[V,U]=r.useState([]),[X,J]=r.useState(window.innerWidth),[Q,Z]=r.useState({}),[ee,ae]=r.useState("Overview"),[re,oe]=r.useState(!1),le=e=>{const a=q===h.POSITION_GOALKEEPER;return"bestPerformers"===e?j(a?"leaguePerformanceReport.top5Performers":"leaguePerformanceReport.top10Performers"):"worstPerformers"===e?j(a?"leaguePerformanceReport.bottom5Performers":"leaguePerformanceReport.bottom10Performers"):void 0},{data:se,isLoading:te}=u([A]),[ie,ne]=r.useState(M),[ce,me]=r.useState($),{data:de,isLoading:pe}=f({competition_id:A,game_dates:ce,match_day:ie,position:q,category:B===H?"Best":"Worst"}),he=()=>{let e,a,r;try{e=m().slice(0,8),a=N("LPR",e),r=x("LPR",e)}catch(l){return void t.error(j("leaguePerformanceReport.shareLinkFailed"))}w({title:I("LPR").title,url:r});const o={uniqueId:e,uniqueLink:`${window.location.origin}${a}`,product:"LPR",competitionId:A,matchDate:$,matchDay:M,position:q,category:B,league:E,playerId:(null==de?void 0:de.map(e=>{var a;return null==(a=e["player-details"])?void 0:a.playerId}).filter(e=>null!=e&&void 0!==e))||[]};S(o).catch(e=>{t.error(j("leaguePerformanceReport.shareLinkFailed"))})},ue=e=>{ne(e);const a=Array.isArray(se)?se.find(a=>a.matchDay===e):null;a&&me(a.matchDate)};r.useEffect(()=>{const e=()=>J(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),r.useEffect(()=>{if(X>1280){Z({menuList:()=>({color:"white",background:"#0d0d0d",fontSize:"12px",fontFamily:"'Montserrat', sans-serif",maxHeight:"200px",overflowY:"auto"}),control:e=>({...e,color:"white",background:"#fff",border:"0px solid #fff",borderRadius:"8px 8px 0px 0px",fontSize:"12px",fontFamily:"'Montserrat', sans-serif",boxShadow:"0px 0px 7px 0px rgba(124, 124, 124, 0.12)","&:hover":{outline:"none"},"&:focus":{outline:"none"},"&:focusWithin":{outline:"none"}}),valueContainer:e=>({...e,height:"34px",overflowY:"auto",overflowX:"visible"}),singleValue:e=>({...e,color:"#0F0F0F",fontWeight:"600",whiteSpace:"normal",overflow:"visible",background:"transparent",lineHeight:1.2}),option:(e,{isFocused:a})=>({...e,background:a?"#2A2A2A":"#0d0d0d",color:a?"white":e.color,cursor:"pointer",fontSize:"12px",fontFamily:"'Montserrat', sans-serif"}),indicatorSeparator:()=>({display:"none"})})}else{Z({menuList:()=>({color:"white",background:"#0d0d0d",fontSize:"10px",fontFamily:"'Montserrat', sans-serif",maxHeight:"200px",overflowY:"auto"}),control:e=>({...e,color:"white",background:"#fff",border:"0px solid #fff",borderRadius:"8px 8px 0px 0px",fontSize:"10px",minHeight:"24px",fontFamily:"'Montserrat', sans-serif",boxShadow:"0px 0px 7px 0px rgba(124, 124, 124, 0.12)","&:hover":{outline:"none"},"&:focus":{outline:"none"},"&:focusWithin":{outline:"none"}}),valueContainer:e=>({...e,height:"24px",overflowY:"visible",overflowX:"visible",padding:"0px 2px 0px 4px",minHeight:"24px",placeItems:"center"}),indicatorContainer:e=>({...e,height:"24px",padding:"2px"}),dropdownIndicator:e=>({...e,padding:"0 4px",svg:{width:"12px",height:"12px"}}),singleValue:e=>({...e,color:"#0F0F0F",fontWeight:"600",whiteSpace:"normal",overflow:"visible",background:"transparent",lineHeight:1.2}),option:(e,{isFocused:a})=>({...e,background:a?"#2A2A2A":"#0d0d0d",color:a?"white":e.color,cursor:"pointer",fontSize:"10px",fontFamily:"'Montserrat', sans-serif",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),indicatorSeparator:()=>({display:"none"})})}},[X]),r.useEffect(()=>{if(null!=de&&null!=de&&de.length>0){let e=[...de];q===h.POSITION_GOALKEEPER?e=e.slice(0,5):B===W&&(e=e.slice(0,10)),U(e),C(!0)}else U([]),C(!1)},[de,B,q]);return pe?e(v,{}):a("div",{className:l.mainContainer,children:[e(g,{setIsSidebarOpen:F}),e(y,{isSidebarOpen:D,setIsSidebarOpen:F}),re&&e("div",{style:{position:"absolute"},children:e(i,{modelIsOpen:re,onRequestClose:()=>{oe(!1)},players:V})}),a("div",{children:[e("div",{className:l.bgGradient}),e("div",{className:l.titleBox,children:e("span",{children:j("leaguePerformanceReport.title")})}),e("div",{className:l.matchDayBox,children:a("span",{className:l.matchDay,children:[j("leaguePerformanceReport.matchDay")," ",ie]})}),e("span",{className:l.backToMatchContainer,children:a("span",{className:l.backToMatch,onClick:()=>{window.history.back()},children:[e("img",{src:d,alt:j("leaguePerformanceReport.backAlt")}),j("leaguePerformanceReport.goBack")]})}),O?a("div",{children:[a("div",{className:`${l.tile} ${l.desktopHidden}`,children:[a("div",{className:l.leftTile,children:[e("img",{className:l.competitionImage,alt:b
1(E),src:`https://storage.googleapis.com/fair_logos/competitions/${A}.png`}),a("div",{className:l.type_position,children:[a("div",{className:l.beforeImg,children:[e("div",{className:l.selectedPerfromanceType,children:le(B)}),e("div",{className:l.selectedPosition,children:q})]}),a("div",{className:l.afterImg,children:[e("div",{className:l.line,style:{marginRight:"22px"}}),e("div",{className:l.line})]})]})]}),a("div",{className:l.rightSideDropdowns,children:[e("span",{className:l.dropdown,children:e(s,{onChange:e=>{e&&ue(e.value)},value:ie?{value:ie,label:`${j("leaguePerformanceReport.matchdayLabel")} ${ie}`}:null,styles:Q,options:(Array.isArray(se)?se:[]).map(e=>({value:e.matchDay,label:`${j("leaguePerformanceReport.matchdayLabel")} ${e.matchDay}`})),classNamePrefix:"select",components:T,isSearchable:!1})}),e("span",{className:l.dropdownPerformanceType,children:e(s,{onChange:e=>{e&&G(e.value)},value:B?{value:B,label:le(B)}:null,placeholder:j("leaguePerformanceReport.performanceTypePlaceholder"),name:"PerformanceType",styles:Q,options:z.map(e=>({value:e,label:le(e)})),classNamePrefix:"select",components:T,isSearchable:!1})}),e("span",{className:l.dropdown,children:e(s,{onChange:e=>{e&&Y(e.value)},value:q?{value:q,label:q}:null,placeholder:j("leaguePerformanceReport.performanceTypePlaceholder"),name:"PerformanceType",styles:Q,options:K.map(e=>({value:e,label:e})),classNamePrefix:"select",components:T,isSearchable:!1})})]}),a("span",{className:l.share,onClick:he,children:[e("img",{className:l.shareImage,alt:j("leaguePerformanceReport.shareIconAlt"),src:c}),e("span",{className:l.shareText,children:j("leaguePerformanceReport.share")})]})]}),V&&a("div",{className:l.playerContainer,children:[e(R,{activeTab:ee,handleTabClick:e=>{ae(e)}}),e("div",{className:`${l.desktopHidden}`,children:e("div",{className:l.mobileNote,children:j("leaguePerformanceReport.note",{league:b(E)})})}),V.map((r,o)=>{var t,i,m,d,p,h,u,f,v,g,y,P,N,x,w;return a("div",{children:[a("div",{className:`${l.tile} ${l.mobileHidden}`,children:[a("div",{className:l.leftTile,children:[e("img",{className:l.competitionImage,alt:b(E),src:`https://storage.googleapis.com/fair_logos/competitions/${A}.png`}),a("div",{className:l.type_position,children:[a("div",{className:l.beforeImg,children:[e("div",{className:l.selectedPerfromanceType,children:le(B)}),e("div",{className:l.selectedPosition,children:q})]}),a("div",{className:l.afterImg,children:[e("div",{className:l.line,style:{marginRight:"22px"}}),e("div",{className:l.line})]}),a("div",{className:"rankPositionBox",children:[e("div",{className:l.rankBox,children:a("span",{className:l.rank,children:["#",r.player_rank]})}),a("div",{className:l.playerLeague,children:[q," ",j("leaguePerformanceReport.positionIn")," ",b((null==(d=null==(m=null==(i=null==(t=r["match-performances"])?void 0:t[0])?void 0:i["player-match-stats"])?void 0:m[0])?void 0:d.competitionName)||(null==(p=r["player-details"])?void 0:p.competitionName))]})]})]})]}),0===o&&a("div",{className:l.rightSideDropdowns,children:[a("span",{className:l.share,onClick:he,children:[e("img",{className:l.shareImage,alt:j("leaguePerformanceReport.shareIconAlt"),src:c}),e("span",{className:l.shareText,children:j("leaguePerformanceReport.share")})]}),e("span",{className:l.dropdown,children:e(s,{onChange:e=>{e&&ue(e.value)},value:ie?{value:ie,label:`${j("leaguePerformanceReport.matchdayLabel")} ${ie}`}:null,placeholder:j("leaguePerformanceReport.selectMatchday"),name:"MatchDay",styles:Q,options:(Array.isArray(se)?se:[]).map(e=>({value:e.matchDay,label:`${j("leaguePerformanceReport.matchdayLabel")} ${e.matchDay}`})),classNamePrefix:"select",components:T,isSearchable:!1})}),e("span",{className:l.dropdownPerformanceType,children:e(s,{onChange:e=>{e&&G(e.value)},value:B?{value:B,label:le(B)}:null,placeholder:j("leaguePerformanceReport.performanceTypePlaceholder"),name:"PerformanceType",styles:Q,options:z.map(e=>({value:e,label:le(e)})),classNamePrefix:"select",components:T,isSearchable:!1})}),e("span",{className:l.dropdown,children:e(s,{onChange:e=>{e&&Y(e.value)},value:q?{value:q,label:q}:null,placeholder:j("leaguePerformanceReport.performanceTypePlaceholder"),name:"PerformanceType",styles:Q,options:K.map(e=>({value:e,label:e})),classNamePrefix:"select",components:T,isSearchable:!1})})]})]}),e("div",{className:`${l.playerInnerContainer} ${l.mobileHidden}`,children:e("div",{children:e(k,{rank:r.player_rank,data:{"player-details":r["player-details"],"league-performance":{performance_ts:r.last_15_games},"player-match-stats":r["match-performances"][0]["player-match-stats"][0],competitionId:(null==(v=null==(f=null==(u=null==(h=r["match-performances"])?void 0:h[0])?void 0:u["player-match-stats"])?void 0:f[0])?void 0:v.competitionId)||(null==(g=r["player-details"])?void 0:g.competitionId),gameDates:$,performanceAnalysis:r.long_analysis},playerId:r["player-details"].playerId,multipleComparisons:!1,activeTab:ee,match
1Day:ie,showPerformanceRating:!0})})}),e("div",{className:`${l.desktopHidden}`,children:e(n,{title:r["player-details"].name,rank:r.player_rank,children:e("div",{className:l.playerInnerContainerMob,children:e(k,{rank:r.player_rank,data:{"player-details":r["player-details"],"league-performance":{performance_ts:r.last_15_games},"player-match-stats":r["match-performances"][0]["player-match-stats"][0],competitionId:(null==(x=null==(N=null==(P=null==(y=r["match-performances"])?void 0:y[0])?void 0:P["player-match-stats"])?void 0:N[0])?void 0:x.competitionId)||(null==(w=r["player-details"])?void 0:w.competitionId),gameDates:$,performanceAnalysis:r.long_analysis},playerId:r["player-details"].playerId,multipleComparisons:!1,activeTab:ee,matchDay:ie,showPerformanceRating:!0})})})})]},o)})]})]}):e("div",{className:l.noDataFound,children:L})]}),e(P,{})]})}export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.