1import{r as i,j as s}from"./vendor-react-nIFFWcjg.js";import{u as W}from"./vendor-react-router-65IGR4DC.js";import{u as tt,d as et,a as O,M as st,b as at,c as rt}from"./MatchesListPage-B9tOhGhn.js";import{u as nt,a as ot}from"./useIsMobile-C9JFGQjn.js";import{y as R,u as it,M as U,a as ut,b as ct,z as dt,B,L as mt,N as lt,H as ft,c as p,d as gt}from"./main-CUbWTmvN.js";import{u as ht}from"./useEditableClubsQuery-BzVu4OXN.js";import"./vendor-react-query-ChuYpeSs.js";import"./vendor-datepicker-WU22x5DJ.js";import"./vendor-react-aria-Cxu2IdXX.js";import"./MobileFiltersModal-85B2lMWC.js";import"./ExpandIcon-BTRX85Gp.js";import"./FiltersDialog-BXfeIZkD.js";function Dt(h,a){const c=R(h),M=R(a),r=c.getTime()-M.getTime();return r<0?-1:r>0?1:r}const pt=h=>{if(h){const a=new Date(h),c=at(a.getFullYear(),a.getMonth(),a.getDate());return{...rt(c),date:c}}else return O()};function vt(){var A,I,N,Q;const h=nt(),{data:a}=it(),c=((A=a==null?void 0:a.env)==null?void 0:A.siteName)??"",M=((I=a==null?void 0:a.env)==null?void 0:I.entityName)??"",[r,L]=W(),d=r.get("startDate"),x=r.get("endDate"),j=r.get("team"),T=r.get("competition"),H=r.get("groupBy"),t=r.get("matchType")||"fixtures",E=r.get("sort"),m=H==="flat",[$,X]=i.useState(null),n=i.useMemo(()=>pt(d),[d]),b=i.useMemo(()=>{switch(t){case"results":return U.RESULT;case"all":return;case"fixtures":default:return U.FIXTURE}},[t]),{data:w,isLoading:_}=ht(),{data:e,isLoading:z}=ot(),{data:P,isLoading:G}=ut(),l=i.useMemo(()=>e==null?void 0:e.find(f=>f.competitions===T),[e,T]),o=i.useMemo(()=>new Date().toISOString().split("T")[0],[]),V=i.useMemo(()=>d||(m?t==="results"||t==="all"?void 0:o:t==="fixtures"&&o>n.startDate?o:n.startDate),[m,d,o,n.startDate,t]),Y=i.useMemo(()=>x||(m?t==="fixtures"||t==="all"?void 0:o:t==="results"&&o<n.endDate?o:n.endDate),[m,x,n.endDate,t,o]),v=t==="fixtures"?"ASC":"DESC",k=E?E==="DESC"?p.DESC:p.ASC:v==="DESC"?p.DESC:p.ASC,{data:D,isLoading:S,isFetchedAfterMount:C,error:q}=ct({limit:1e3,period:gt.Custom,startDate:V,endDate:Y,sort:k,status:b,teamId:j,competition:(l==null?void 0:l.competitions)??((N=e==null?void 0:e[0])==null?void 0:N.competitions)},{enabled:!!e}),{data:J,isLoading:K}=tt({startDate:t==="results"?void 0:o,endDate:t==="fixtures"?void 0:o,status:b,teamId:j,competition:(l==null?void 0:l.competitions)??((Q=e==null?void 0:e[0])==null?void 0:Q.competitions)},{enabled:!!e}),u=i.useMemo(()=>{const f=dt(new Date);return D==null?void 0:D.items.filter(g=>{if(g.status!==B.Postponed&&g.status!==B.Abandoned)return!0;const Z=new Date(g.date);return Dt(f,Z)<=0})},[D]);if(i.useEffect(()=>{if(t==="fixtures"&&!m&&!S&&C&&!d&&(u==null?void 0:u.length)===0){const f=et(O().date);L(g=>(g.set("startDate",f.startDate),g.set("endDate",f.endDate),g),{replace:!0}),X(f)}},[t,m,C,S,u==null?void 0:u.length,n,d,L]),z||S||K||_||G)return s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"calc(100vh - 100px)"},children:s.jsx(mt,{})});if(q||!e||!u||!w||!P)return s.jsx(lt,{});const y=`${c} Fixtures & Live Matches Season 2026/27`,F=`View the ${M} fixtures for the 2026/27 season, visit the official website of the ${c}.`;return s.jsxs(s.Fragment,{children:[s.jsxs(ft,{children:[s.jsx("title",{children:y}),s.jsx("meta",{name:"description",content:F}),s.jsx("meta",{property:"og:title",content:y}),s.jsx("meta",{property:"og:description",content:F}),s.jsx("meta",{name:"twitter:title",content:y}),s.jsx("meta",{name:"twitter:description",content:F})]}),s.jsx(st,{title:"Fixtures",isMobile:h,matchFilters:e,selectedCompetition:l??e[0],matches:u,clubs:w.items,currentMonth:$??n,monthSwitcherMode:m?void 0:t==="results"?"RESULTS":"FIXTURES",featureFlags:P,sortByDate:v,matchDates:J,showAdvancedFilters:!0,defaultMatchType:t})]})}export{vt as FixturesPage}; 2//# sourceMappingURL=index-B3_y-bON.js.map
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.