1import{a as ze}from"./chunk-AOJIJXI6.js";import{a as Ae}from"./chunk-FWHXQ42M.js";import{a as De}from"./chunk-HX3BORHK.js";import{a as Oe}from"./chunk-JMT7FOFF.js";import{a as Me}from"./chunk-MT3HMXLT.js";import"./chunk-IBAUG35L.js";import"./chunk-NNWV6LMH.js";import"./chunk-CLOCKAZL.js";import{a as je}from"./chunk-VAHMQJ66.js";import{b as Be}from"./chunk-T2DCJEGU.js";import{a as Ne}from"./chunk-AW25YZA2.js";import{a as Le}from"./chunk-KVWHJRAT.js";import{a as Fe}from"./chunk-NPIKR4WU.js";import{$d as ke,Aa as _,Ab as se,Ac as me,Ba as C,Cc as ue,Ce as Re,Da as ie,Db as re,Dc as de,E as d,Eb as le,F as b,Fa as A,Fc as he,Gb as ce,Gc as ge,H as x,Ha as g,Ic as fe,Je as we,Ka as ne,L as P,Lc as G,Oe as ye,Pe as Te,Q as ee,Qe as $e,R as te,Ra as z,Rc as ve,Ta as w,Ua as V,Va as N,Xd as J,Yc as ot,Yd as K,Zd as xe,_c as _e,ba as r,bb as O,cb as U,e as at,eb as q,fa as c,gb as S,hb as y,hd as Ce,i as X,ia as j,id as Se,ja as M,jb as B,k as D,lb as H,ld as be,ma as h,n as f,nf as Ee,o as E,of as Pe,ra as l,sb as ae,t as R,tb as oe,ub as L,ve as Ie,w as Y,we as Q,x as Z,xa as m,ya as p,yc as pe,za as I}from"./chunk-KYZXTCEJ.js";var rt=(t,s,i,e)=>({"d-n@<sm":t,"ta-l":s,"pin-s pin-xs@<xs":i,"pr-xs@<sm":e}),lt=t=>({"bgc-alabaster":t}),ct=(t,s)=>({up:t,down:s}),pt=(t,s,i,e)=>({"d-n@<sm":t,"pl-no@<xs":s,"pin-xxs@<xs":i,"pr-xs@<sm":e}),Ve=t=>({"fw-900":t}),mt=(t,s)=>({"d-n@<sm":t,"list-cercle":s});function ut(t,s){if(t&1&&(m(0,"th",9),w(1),p()),t&2){let i=s.$implicit,e=s.first,o=s.index,n=g().ngIf;l("ngClass",q(2,rt,o>n.length-4,o===1,e,o===n.length-4)),r(),N(" ",i.value," ")}}function dt(t,s){if(t&1&&(m(0,"tr",7),h(1,ut,2,7,"th",8),p()),t&2){let i=s.ngIf;r(),l("ngForOf",i)}}function ht(t,s){if(t&1&&(_(0),m(1,"span",18),w(2),p(),C()),t&2){let i=g().$implicit;r(),l("ngClass",U(2,ct,i[1].value.split(" ")[1]==="up",i[1].value.split(" ")[1]==="down")),r(),N("",i[1].value.split(" ")[0]," ")}}function gt(t,s){t&1&&I(0,"div")}function ft(t,s){if(t&1&&(I(0,"TwicImg",19),S(1,"imageSrc")),t&2){let i=g().$implicit;ne("src",y(1,2,i[2].value)),l("alt",i[3].value||"image")}}function vt(t,s){if(t&1&&I(0,"img",20),t&2){let i=g().$implicit;l("alt",i[3].value||"image")}}function _t(t,s){if(t&1&&(_(0),m(1,"td",22)(2,"span",23),w(3),p()(),C()),t&2){let i=s.$implicit,e=s.index;r(),l("ngClass",q(3,pt,e>4,e===4,e!==4,e===4)),r(),l("ngClass",O(8,Ve,e===0)),r(),V(i.value)}}function Ct(t,s){if(t&1&&(_(0),h(1,_t,4,10,"ng-container",21),S(2,"slice"),C()),t&2){let i=g().$implicit;r(),l("ngForOf",B(2,1,i,5,i.length-1))}}function St(t,s){if(t&1&&(_(0),m(1,"td",24)(2,"span",23),w(3),p()(),C()),t&2){let i=s.$implicit,e=s.index,o=s.last;r(),l("ngClass",U(3,mt,e>4,o)),r(),l("ngClass",O(6,Ve,e===0)),r(),V(i.value)}}function bt(t,s){if(t&1&&(_(0),h(1,St,4,8,"ng-container",21),S(2,"slice"),C()),t&2){let i=g().$implicit;r(),l("ngForOf",B(2,1,i,5,i.length-1))}}function xt(t,s){if(t&1&&(m(0,"tr",11)(1,"td",12)(2,"div",13),h(3,ht,3,5,"ng-container",6),p()(),m(4,"td",14)(5,"figure",15),h(6,gt,1,0,"div",16)(7,ft,2,4,"ng-template",null,0,H)(9,vt,1,1,"ng-template",null,1,H),m(11,"figcaption",17),w(12),p()()(),h(13,Ct,3,5,"ng-container",6)(14,bt,3,5,"ng-container",6),p()),t&2){let i=s.$implicit,e=z(8),o=z(10),n=g(2);l("ngClass",O(8,lt,i[0].isOlTeam)),r(3),l("ngIf",i[1].value.split(" ")[1]),r(3),l("ngIf",i[2].value!=="")("ngIfThen",e)("ngIfElse",o),r(6),N(" ",i[4].value," "),r(),l("ngIf",n.sport==="football"),r(),l("ngIf",n.sport==="basketball")}}function kt(t,s){if(t&1&&(m(0,"tbody"),h(1,xt,15,10,"tr",10),S(2,"slice"),p()),t&2){let i=g();r(),l("ngForOf",B(2,1,i.data,1,i.data.length))}}var Ue=(()=>{class t{constructor(){}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=j({type:t,selectors:[["app-rankings"]],inputs:{data:"data",sport:"sport"},standalone:!1,decls:5,vars:2,consts:[["thenBlock",""],["elseBlock",""],[1,"o-a","w-100"],[1,"bgc-white"],[1,"bgc-torea","c-white","fw-900"],["scope","row","class","va-m",4,"ngIf"],[4,"ngIf"],["scope","row",1,"va-m"],["scope","col","class","pbl-m",3,"ngClass",4,"ngFor","ngForOf"],["scope","col",1,"pbl-m",3,"ngClass"],["scope","row","class","bc-alto bw-xs bs-s",3,"ngClass",4,"ngFor","ngForOf"],["scope","row",1,"bc-alto","bw-xs","bs-s",3,"ngClass"],["scope","col",1,"pin-s"],[1,"d-f","fd-r","jc-c"],["scope","col","width","170",1,"pbl-m"],[1,"d-f","jc-fs","ai-c"],[4,"ngIf","ngIfThe
1n","ngIfElse"],[1,""],[1,"fw-700","icon-ranking",3,"ngClass"],["mode","contain","focus","auto","placeholder","none",1,"mr-xs","fs-0",2,"width","48px",3,"src","alt"],["src","assets/team-no-logo.png",1,"mr-xs","fs-0",2,"width","48px",3,"alt"],[4,"ngFor","ngForOf"],["scope","col",1,"pbl-m","pin-xs","ta-c",3,"ngClass"],[3,"ngClass"],["scope","col",1,"pbl-m","pin-xs","ta-c","pin-xxs@<xs",3,"ngClass"]],template:function(e,o){e&1&&(m(0,"div",2)(1,"table",3)(2,"thead",4),h(3,dt,2,1,"tr",5),p(),h(4,kt,3,5,"tbody",6),p()()),e&2&&(r(3),l("ngIf",o.data&&o.data[0]),r(),l("ngIf",o.data&&o.data.length>0))},dependencies:[ae,oe,L,xe,ue,re,Re],encapsulation:2})}}return t})();var T=at(ot());function Rt(t,s){if(t&1){let i=ie();_(0),m(1,"app-filter",7),S(2,"async"),A("filterClick",function(o){ee(i);let n=g(2);return te(n.setSelectedCompetition(o))}),p(),C()}if(t&2){let i=g(2);r(),l("id","ranking-competitions")("filter",y(2,2,i.filterCompetitions$))}}function wt(t,s){if(t&1&&(_(0),h(1,Rt,3,4,"ng-container",4),C()),t&2){let i=s.ngIf;r(),l("ngIf",i.items==null?null:i.items.length)}}var qe=(()=>{class t{constructor(i,e,o,n,u,v,k,Ge,Je,Ke,Qe,We,Xe,Ye,Ze,et,tt,it,nt){this.viewportScroller=i,this.remoteConfigService=e,this.rankingService=o,this.seasonService=n,this.competitionService=u,this.router=v,this.translate=k,this.sportService=Ge,this.promoMatchService=Je,this.teamService=Ke,this.metaService=Qe,this.componentLoadingService=We,this.languageSwitchService=Xe,this.urlPageService=Ye,this.pagesService=Ze,this.activatedRoute=et,this.seoService=tt,this.breadcrumbService=it,this.headerService=nt,this.filterSeasons$=new D,this.filterCompetitions$=new D,this.subscriptionRemover=new X,this.locale=this.translate.currentLang,k.onLangChange.pipe(b(this.subscriptionRemover),x(a=>this.locale=a.lang),d(()=>f(this.page?.localizations?.find(a=>a?.locale===this.locale))),d(a=>R(()=>!!a,f(a),E(new Error("Localization not found"))))).subscribe(a=>{this.router.navigateByUrl(`${this.locale}${a.url}`)},a=>{console.error(a),this.urlPageService.navigateToNotFound()}),this.activatedRoute.params.pipe(b(this.subscriptionRemover)).subscribe(a=>{this.sportName=a.sport,this.teamName=a.team}),this.headerService.headerMenu$.pipe(b(this.subscriptionRemover)).subscribe(a=>{this.header=a}),this.router.events.pipe(b(this.subscriptionRemover),Y(a=>a instanceof he),d(a=>f(a)),x(a=>{this.currentRoute=Ie(a.url).replace(`/${this.locale}`,""),this.currentRoute!==this.previousRoute&&this.viewportScroller.scrollToPosition([0,0])}),d(()=>this.pagesService.getPageByUrl(T.default.stringify({locale:this.locale,filters:{url:{$eq:this.currentRoute}},populate:{localizations:{fields:["locale","url"]}}}))),d(a=>R(()=>!!a.data[0],f(a.data[0]),E(new Error("Page not found")))),x(a=>{this.page=a,this.languageSwitchService.setAvailableLocales(this.locale,this.page.localizations);let F=this.headerService.getParentGenericByPageId(this.page.id,this.header);F?.length>0&&this.generateBreadcrumb(F.map($=>({isActive:!1,title:$.title,url:$.url?[$.url]:void 0}))),this.metaService.addHeaderTags({title:a.title||a.metadata?.meta_title,meta_title:a.metadata?.meta_title||a.title,meta_description:a.metadata?.meta_description||a.description,meta_image:a?.metadata?.meta_image,locale:this.locale}),this.seoService.addAlternatePageLinks(a)}),d(()=>this.sportService.getSports(this.locale)),d(a=>R(()=>!!a.data[0],f(a.data),E(new Error("Sport not found")))),x(a=>{let F=a.find($=>$.slug===this.sportName);this.sport=F}),d(()=>R(()=>!!(this.sport&&this.teamName),this.teamService.getTeams(this.sport?.technical_name||"",T.default.stringify({locale:this.locale,pagination:{pageSize:1},populate:{current_season:{populate:"*"}},filters:{slug:{$eq:this.teamName}}})),f(null))),d(a=>R(()=>!!a?.data[0],f(a.data[0]),E(new Error("Team not found")))),x(a=>{this.team=a,this.promoMatchService.addSportAndTeam(this.sport,this.team)}),d(()=>this.getFilters())).subscribe({next:()=>{this.componentLoadingService.setCurrentContentLoaded(2)},error:console.error}),this.promoMatchService.getPromoMatch().pipe(b(this.subscriptionRemover)).subscribe(a=>{this.promoMatch=a},console.error)}ngOnDestroy(){this.languageSwitchService.clearAvailableLocales(),this.subscriptionRemover.next(),this.subscriptionRemover.complete(),this.breadcrumbService.breadcrumb$.next(null)}getFilters(){let i=this.seasonService.getSeasons(T.default.stringify({sort:["name:desc"],fields:["name"]})),e=this.remoteConfigService.getConfig(this.locale);return Z(i,this.team?.current_season?f(null):e).pipe(b(this.subscriptionRemover)).pipe(x(([o,n])=>{let u=this.team?.current_season||n?.data?.current_season,v=o.data.map(k=>({text:k.name,value:k.id}));this.filterSeasons={items:v,selectedItem:v.find(k=>k.value===u?.id)??v[0]},this.filterSeasons$.next(this.filterSeasons),this.updateCompetitionFilter()}),d(()=>this.retrieveRanking()))}retrieveRanking(){return this.rankingService.getRankings(this.sport?.technical_name,T.default.stringify({locale:this.locale,filters:{[`${this.sport?.technical_name}_team`]:{slug:this.teamName},season:{id:this.filterSeasons?.selectedItem?.value},competition:{id:this.filterCompetitions?.selectedItem?.value}},populate:{competition:{populate:"*"},entries:{populate:{club:{populate:["logo"]},last_results:{populate:"*"}}},[`${this.sport?.technical_name??"football"}_team`]:{populate:"*"},localizations:{populate:"*"},ol_stats:{populate:"*"},season:{populate:"*"}}})).pipe(b(this.subscriptionRemover),d(i=>f(i.data[0])),d(i=>{this.ranking=i;let e=i?.entries;return e?.sort((o,n)=>n?.points?n?.points-o?.points:n?.wins-o?.wins),this.currentTeamIndex=e?.findIndex(o=>Q(o.club?.initials)),f(i)}),x(()=>this.generateRankingTable()))}setSelectedCompetition(i){this.filterCompetitions.selectedItem=this.filterCompetitions.items?.find(e=>e.value===i.value),this.filterCompetitions$.next(this.filterCompetitions),this.retrieveRanking().subscribe({error:e=>console.error(e)})}setSelectedSeason(i){this.filterSeasons.selectedItem=this.filterSeasons.items?.find(e=>e.value===i.value),this.filterSeasons$.next(this.filterSeasons),this.retrieveRanking().subscribe({error:e=>console.error(e)}),this.updateCompetitionFilter()}generateRankingTable(){if(this.data=[],this.ranking){let i=[];this.sport?.technical_name==="football"&&(i.push([{value:this.translate.instant("ranking.position")},{value:this.translate.instant("ranking.team")},{value:this.translate.instant("ranking.points")},{value:this.translate.instant("ranking.matches.played")},{value:this.translate.instant("ranking.matches.wins")},{value:this.translate.instant("ranking.matches.draws")},{value:this.translate.instant("ranking.matches.losses")},{value:this.translate.instant("ranking.goals.scored")},{value:this.translate.instant("ranking.goals.conceded")},{value:this.translate.instant("ranking.goals.diff")}
1]),this.ranking.entries.forEach((e,o)=>{let n=[],u=e.club?.logo?.url?.replaceAll(K,J);n.push({value:e.club?.initials||"",isOlTeam:Q(e.club?.initials)}),n.push({value:`${o+1} ${e.evolution||""}`}),n.push({value:u||""}),n.push({value:e.club?.logo?.alternativeText||""}),n.push({value:e.club?.short_name||""}),n.push({value:e.points||"0"}),n.push({value:e.matches||"0"}),n.push({value:e.wins||"0"}),n.push({value:e.ties||"0"}),n.push({value:e.losses||"0"}),n.push({value:e.BP||"0"}),n.push({value:e.BC||"0"}),e.diff!==void 0?e.diff>0?n.push({value:"+"+e.diff}):n.push({value:e.diff}):n.push({value:"0"});let v=[];n.push({value:v.join(" ")}),i?.push(n)})),this.sport?.technical_name==="basketball"&&(i.push([{value:this.translate.instant("ranking.position")},{value:this.translate.instant("ranking.team")},{value:"%V"},{value:this.translate.instant("ranking.played")},{value:"V"},{value:"D"}]),this.ranking.entries.forEach((e,o)=>{let n=[],u=e.club?.logo?.url.replaceAll(K,J);n.push({value:e.club?.initials||""}),n.push({value:`${o+1} ${e.evolution||""}`}),n.push({value:`<img src="${u}" alt="${e.club?.logo?.alternativeText}" /> 2 ${e.club?.name||""}`}),n.push({value:e.victory_percentage||"0"}),n.push({value:e.matches||"0"}),n.push({value:e.wins||"0"}),n.push({value:e.losses||"0"}),i?.push(n)})),this.data=i}}generateBreadcrumb(i=[]){this.breadcrumbService.breadcrumb$.next({breadcrumb:i,switchRow:!1})}updateCompetitionFilter(){let i={filters:{[`${this.sport?.technical_name}_team`]:{slug:this.team?.slug},seasons:{id:this.filterSeasons.selectedItem?.value}},locale:this.locale,sort:["id:asc"],populate:{country:{populate:"*"},cup_image:{populate:"*"},[`${this.sport?.technical_name}_team`]:{populate:"*"},localizations:{populate:"*"},logo:{populate:"*"},logo_mono:{populate:"*"}}};this.competitionService.getCompetitions(this.sport?.technical_name,T.default.stringify(i)).subscribe(o=>{let n=[];n.push(...o.data.sort((u,v)=>u.type.localeCompare(v.type)).map(u=>({text:u.name,value:u.id}))),this.filterCompetitions={items:n,selectedItem:n[0]},this.filterCompetitions$.next(this.filterCompetitions)})}static{this.\u0275fac=function(e){return new(e||t)(c(ce),c(we),c(Me),c(Ae),c(De),c(fe),c(pe),c(Te),c(ze),c(ye),c(Fe),c(Pe),c(Be),c(Ne),c(Oe),c(ge),c(je),c(Le),c(_e))}}static{this.\u0275cmp=j({type:t,selectors:[["app-ranking-page"]],standalone:!1,decls:11,vars:8,consts:[[1,"bgc-seashell","pbl-xxl","min-xs","min-no@<md","pt-no@<sm"],[1,"viewport"],[1,"pbl-m","d-f","jc-c","bbs-s","bw-xs","bc-alto"],[1,"mr-s",3,"filterClick","filter"],[4,"ngIf"],[1,"pbl-m"],[3,"data","sport"],[3,"filterClick","id","filter"]],template:function(e,o){e&1&&(I(0,"app-page-nav-header"),m(1,"div",0)(2,"div",1)(3,"div",2)(4,"form")(5,"app-filter",3),S(6,"async"),A("filterClick",function(u){return o.setSelectedSeason(u)}),p(),h(7,wt,2,1,"ng-container",4),S(8,"async"),p()(),m(9,"div",5),I(10,"app-rankings",6),p()()()),e&2&&(r(5),l("filter",y(6,4,o.filterSeasons$)),r(2),l("ngIf",y(8,6,o.filterCompetitions$)),r(3),l("data",o.data)("sport",o.sport==null?null:o.sport.technical_name))},dependencies:[L,$e,be,Ce,Se,ke,Ue,se],encapsulation:2})}}return t})();var yt=[{path:"",component:qe}],He=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275mod=M({type:t})}static{this.\u0275inj=P({imports:[G.forChild(yt),G]})}}return t})();var fi=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275mod=M({type:t})}static{this.\u0275inj=P({imports:[le,me,Ee,ve,He,de]})}}return t})();export{fi as RankingPageModule};
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.