1import{p as re,c as u,r as U,w as N,D as o,F as a,P as d,S as i,u as r,K as h,W as O,H as m,O as _,E as g,U as f,N as D,$ as ce,a2 as ue,V as Q,a3 as de}from"./_plugin-vue_export-helper-C8YFU58O.js";import{d2 as ge,d3 as he,u as pe,Q as ve,cR as M,cS as me,d8 as _e,dh as L,cX as b,di as fe}from"./main-Dx4_sGQs.js";import{C as H}from"./chevron-right-CwDNr7nP.js";const ye=async()=>{const I=`${he.baseURL}/v2/football/categories?locale=vi`,p=await ge(I);if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return(await p.json()).data},ke=()=>({...pe({queryKey:[ve.LEAGUE_DETAIL.CATEGORIESV2],queryFn:()=>ye(),refetchOnMount:!1,refetchOnWindowFocus:!1,refetchInterval:!1})});/** 2 * @license lucide-vue-next v0.563.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const W=M("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 7 * @license lucide-vue-next v0.563.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Ce=M("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 12 * @license lucide-vue-next v0.563.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const we=M("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Le=""+new URL("europe-B19SV8Eu.png",import.meta.url).href,be=""+new URL("america-CCC2KSZe.png",import.meta.url).href,Ie=""+new URL("asia-DR1Iu_gt.png",import.meta.url).href,xe=""+new URL("oceania-CArqqv7E.png",import.meta.url).href,ze=""+new URL("africa-BJ2FC3eH.png",import.meta.url).href,Ee=""+new URL("beach-BbarCMC0.png",import.meta.url).href,Ue=""+new URL("beach-BbarCMC0.png",import.meta.url).href,Se={class:"page-container"},Be={key:0,class:"nav-header"},$e={class:"page-content"},Pe={key:0,class:"state-message"},Re={key:1,class:"state-message error"},Te={class:"wps-section pinned-leagues"},De={key:0,class:"pinned-hint"},Me={key:1,class:"league-rows"},qe=["onClick"],Ve={class:"comp-name"},Ae=["onClick"],Fe={class:"wps-section top-leagues"},je={class:"league-rows"},Ge=["onClick"],Ke={class:"comp-name"},Ne=["onClick","title"],Oe={class:"wps-section all-leagues"},Qe={class:"filter-box"},He={key:0,class:"state-message"},We={key:1,class:"categories-list"},Ye=["onClick"],Je={class:"category-header-left"},Xe=["src","alt"],Ze={class:"category-name"},et={key:0,class:"category-body"},tt=["onClick"],st={class:"comp-name"},nt=["onClick","title"],at={class:"country-header-wrapper"},it=["onClick"],ot={class:"country-header-left"},lt={class:"country-name"},rt={key:0,class:"country-body"},ct=["onClick"],ut={class:"comp-name"},dt=["onClick","title"],gt=re({__name:"LeagueListPage",props:{topLeagueIds:{}},setup(I){var G;const p=I,S=me(),B=_e(),{data:$,isLoading:Y,isError:J}=ke(),X=["z8yomo4h7wq0j6l","vl7oqdehlyr510j","jednm9whz0ryox8","yl5ergphnzr8k0o","gy0or5jhg6qwzv3","4zp5rzghp5q82w1"],q=u(()=>p.topLeagueIds?p.topLeagueIds.split(",").map(e=>e.trim()).filter(Boolean):[]),y=u(()=>{var e;return((e=$.value)==null?void 0:e.competitions)||[]}),Z=u(()=>{var e;return((e=$.value)==null?void 0:e.categories)||[]}),ee=u(()=>{var e;return((e=$.value)==null?void 0:e.countries)||[]}),te=u(()=>q.value.length>0?q.value.map(e=>y.value.find(t=>t.id===e)).filter(Boolean):X.map(e=>y.value.find(t=>t.id===e)).filter(Boolean)),V=u(()=>{const e=B.favorite.leagues;return e.length?e.map(t=>y.value.find(s=>s.id===t)).filter(Boolean):[]}),se=u(()=>V.value.length>0),P=U(""),R=U("");let T=null;N(P,e=>{T&&clearTimeout(T),T=setTimeout(()=>{R.value=e},300)});const k=U(new Set),C=U(new Set),x=u(()=>{const e=R.value.toLowerCase().trim();return Z.value.map(t=>{let n=ee.value.filter(c=>c.category_id===t.id).map(c=>{let w=y.value.filter(K=>K.country_id===c.id);return e&&(c.name.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(w=w.filter(le=>le.name.toLowerCase().includes(e)))),{...c,competitions:w}}).filter(c=>c.competitions.length>0),l=y.value.filter(c=>c.category_id===t.id&&c.country_id==null);return e&&(t.name.toLowerCase().includes(e)||(l=l.filter(w=>w.name.toLowerCase().includes(e)))),{...t,countries:n,competitions:l}}).filter(t=>t.countries.length>0||t.competitions.length>0)});N(R,e=>{if(e.trim()){const t=x.value.map(n=>n.id);k.value=new Set(t);const s=x.value.flatMap(n=>n.countries.map(l=>l.id));C.value=new Set(s)}});const ne=e=>{k.value.has(e)?k.value.delete(e):k.value.add(e)},A=e=>k.value.has(e),ae=e=>{C.value.has(e)?C.value.delete(e):C.value.add(e)},F=e=>C.value.has(e),v=e=>B.favorite.leagues.includes(e),z=(e,t)=>{t.stopPropagation(),B.toggleFavoriteLeague(e)},ie=((G=window.wp_sport_advanced)==null?void 0:G.leagueSlug)||"/giai-dau",E=(e,t)=>{const s=fe(t),n=`${ie}/${s}-${e}`;window.open(n,"_blank")},oe={Europe:Le,Americas:be,Asia:Ie,Oceania:xe,Africa:ze,International:Ee,Beach:Ue},j=e=>oe[e]||null;return(e,t)=>(a(),o("div",Se,[r(S).canGoBack()?(a(),o("div",Be,[i("button",{onClick:t[0]||(t[0]=s=>r(S).goBack()),class:"btn-back"},"â Quay lại")])):d("",!0),i("div",$e,[r(Y)?(a(),o("div",Pe,"Äang tải danh sách giải Äấu...")):r(J)?(a(),o("div",Re,"Không thá» tải danh sách giải Äấu.")):(a(),o(h,{key:2},[i("div",Te,[t[4]||(t[4]=i("h3",{class:"wps-section-title"},"Giải Äấu yêu thÃch",-1)),t[5]||(t[5]=i("div",{class:"section-divider"},null,-1)),se.value?(a(),o("div",Me,[(a(!0),o(h,null,_(V.value,s=>(a(),o("div",{key:s.id,class:"league-row",onClick:n=>E(s.id,s.name)},[s.logo?(a(),g(b,{key:0,src:s.logo,alt:s.name,"image-size":"xs",class:"comp-logo"},null,8,["src","alt"])):d("",!0),i("span",Ve,f(s.name),1),i("button",{class:"pin-btn pinned",onClick:n=>z(s.id,n),title:"Unpin"},[m(r(L),{size:14})],8,Ae)],8,qe))),128))])):(a(),o("div",De,[i("p",null,[t[2]||(t[2]=O(" Äá» chá»n giải Äấu yêu thÃch, chá» cần nhấp và o biá»u tượng ",-1)),m(r(L),{size:14,class:"pin-icon-hint"}),t[3]||(t[3]=O(" bên cạnh tên giải Äấu. ",-1))])]))]),i("div",Fe,[t[6]||(t[6]=i("h3",{class:"wps-section-title"}
16,"Giải Äấu hà ng Äầu",-1)),t[7]||(t[7]=i("div",{class:"section-divider"},null,-1)),i("div",je,[(a(!0),o(h,null,_(te.value,s=>(a(),o("div",{key:s.id,class:"league-row",onClick:n=>E(s.id,s.name)},[s.logo?(a(),g(b,{key:0,src:s.logo,alt:s.name,"image-size":"xs",class:"comp-logo"},null,8,["src","alt"])):d("",!0),i("span",Ke,f(s.name),1),i("button",{class:D(["pin-btn",{pinned:v(s.id)}]),onClick:n=>z(s.id,n),title:v(s.id)?"Unpin":"Pin"},[m(r(L),{size:14})],10,Ne)],8,Ge))),128))])]),i("div",Oe,[t[9]||(t[9]=i("h3",{class:"wps-section-title"},"Tất cả giải Äấu",-1)),t[10]||(t[10]=i("div",{class:"section-divider"},null,-1)),i("div",Qe,[m(r(we),{size:16,class:"filter-icon"}),ce(i("input",{"onUpdate:modelValue":t[1]||(t[1]=s=>P.value=s),type:"text",placeholder:"Filter",class:"filter-input"},null,512),[[ue,P.value]])]),x.value.length===0?(a(),o("div",He," Không tìm thấy giải Äấu phù hợp ")):(a(),o("div",We,[(a(!0),o(h,null,_(x.value,s=>(a(),o("div",{key:"cat-"+s.id,class:"category-section"},[i("button",{class:"category-header",onClick:n=>ne(s.id)},[i("div",Je,[j(s.name)?(a(),o("img",{key:0,src:j(s.name),alt:s.name,class:"category-icon"},null,8,Xe)):(a(),g(r(Ce),{key:1,size:18,class:"category-icon-default"})),i("span",Ze,f(s.name),1)]),(a(),g(Q(A(s.id)?r(W):r(H)),{class:"chevron-icon"}))],8,Ye),A(s.id)?(a(),o("div",et,[(a(!0),o(h,null,_(s.competitions,n=>(a(),o("div",{key:n.id,class:"league-row league-row--nested",onClick:l=>E(n.id,n.name)},[n.logo?(a(),g(b,{key:0,src:n.logo,alt:n.name,"image-size":"xs",class:"comp-logo comp-logo--sm"},null,8,["src","alt"])):d("",!0),i("span",st,f(n.name),1),i("button",{class:D(["pin-btn",{pinned:v(n.id)}]),onClick:l=>z(n.id,l),title:v(n.id)?"Unpin":"Pin"},[m(r(L),{size:14})],10,nt)],8,tt))),128)),(a(!0),o(h,null,_(s.countries,n=>(a(),o("div",{key:n.id,class:"country-section"},[t[8]||(t[8]=i("span",{style:{"min-width":"32px"}}," ",-1)),i("div",at,[i("button",{class:"country-header",onClick:l=>ae(n.id)},[i("div",ot,[n.logo?(a(),g(b,{key:0,src:n.logo,alt:n.name,"image-size":"xs",class:"country-flag"},null,8,["src","alt"])):d("",!0),i("span",lt,f(n.name),1)]),(a(),g(Q(F(n.id)?r(W):r(H)),{class:"chevron-icon chevron-icon--sm"}))],8,it),F(n.id)?(a(),o("div",rt,[(a(!0),o(h,null,_(n.competitions,l=>(a(),o("div",{key:l.id,class:"league-row league-row--nested",onClick:c=>E(l.id,l.name)},[l.logo?(a(),g(b,{key:0,src:l.logo,alt:l.name,"image-size":"xs",class:"comp-logo comp-logo--sm"},null,8,["src","alt"])):d("",!0),i("span",ut,f(l.name),1),i("button",{class:D(["pin-btn",{pinned:v(l.id)}]),onClick:c=>z(l.id,c),title:v(l.id)?"Unpin":"Pin"},[m(r(L),{size:14})],10,dt)],8,ct))),128))])):d("",!0)])]))),128))])):d("",!0)]))),128))]))])],64))])]))}}),mt=de(gt,[["__scopeId","data-v-d55821e5"]]);export{mt 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.