1import{u as R,f as T,r as x,j as e,P as D,g as m,w}from"./index-BGXoFh6q.js";function C(a,l){return a.map((r,s)=>{const n=new Date(r+"T00:00:00");return{iso:r,monthLabel:n.toLocaleDateString(l==="ar"?"ar-SA":"en-US",{month:"short",day:"numeric"}),dayNum:s+1,weekday:n.toLocaleDateString(l==="ar"?"ar-SA":"en-US",{weekday:"short"})}})}function H(){const{t:a,i18n:l}=R(),r=l.language==="ar"?"ar":"en",s=r==="ar",n=T.useLoaderData(),[d,i]=x.useState("ff"),h=a("schedulePage.firefighterTitle","Firefighter Specific Sports"),g=a("schedulePage.generalTitle","General Sports");return e.jsxs("div",{className:"bg-background",children:[e.jsx(D,{kicker:a("schedulePage.kicker",s?"ÙÙÙ
ÙØ§ بÙÙÙ
":"Day-by-day"),title:a("schedulePage.title",s?"Ø§ÙØ¬Ø¯ÙÙ":"Schedule"),isAr:s}),e.jsx("section",{className:"bg-muted/30 py-10 sm:py-14",children:e.jsxs("div",{role:"tablist","aria-label":"Schedule categories",className:"mx-auto flex max-w-3xl flex-wrap items-center justify-center gap-4 px-4",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":d==="ff","aria-controls":"panel-ff",id:"tab-ff",onClick:()=>i("ff"),className:m("rounded-md px-8 py-4 text-base font-semibold shadow-md transition-all sm:text-lg",d==="ff"?"bg-brand-red text-white hover:brightness-110":"bg-white text-brand-red ring-1 ring-brand-red/30 hover:bg-brand-red/5"),children:h}),e.jsx("button",{type:"button",role:"tab","aria-selected":d==="gen","aria-controls":"panel-gen",id:"tab-gen",onClick:()=>i("gen"),className:m("rounded-md px-8 py-4 text-base font-semibold shadow-md transition-all sm:text-lg",d==="gen"?"bg-brand-green text-white hover:brightness-110":"bg-white text-brand-green ring-1 ring-brand-green/30 hover:bg-brand-green/5"),children:g})]})}),e.jsx("section",{className:"bg-muted/30 pb-20",children:e.jsx("div",{className:"mx-auto max-w-7xl px-4",children:d==="ff"?e.jsx("div",{role:"tabpanel",id:"panel-ff","aria-labelledby":"tab-ff",children:e.jsx(N,{title:h,sports:n.firefighter.sports,dates:n.firefighter.dates,color:"ff",lang:r,isRtl:s,t:a})}):e.jsx("div",{role:"tabpanel",id:"panel-gen","aria-labelledby":"tab-gen",children:e.jsx(N,{title:g,sports:n.general.sports,dates:n.general.dates,color:"gen",lang:r,isRtl:s,t:a})})})})]})}function N({title:a,sports:l,dates:r,color:s,lang:n,isRtl:d,t:i}){const h=x.useRef(null),g=x.useRef(null),[b,v]=x.useState({visible:!1,left:0,width:0,top:128}),o=x.useMemo(()=>C(r,n),[r,n]),S=s==="ff"?"bg-brand-red":"bg-brand-green",_=s==="ff"?"bg-brand-red":"bg-brand-green",k=s==="ff"?"text-brand-red":"text-brand-green",j=`minmax(280px, 30%) repeat(${o.length}, minmax(76px, 1fr))`;return x.useEffect(()=>{const t=()=>{const f=h.current,p=g.current;if(!f||!p)return;const c=window.innerWidth>=1024?160:128,u=f.getBoundingClientRect(),y=p.getBoundingClientRect(),L=y.height,P=y.top<c&&u.bottom>c+L;v({visible:P,left:u.left,width:u.width,top:c})};return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[o.length]),l.length===0||r.length===0?e.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/20 px-6 py-16 text-center",children:e.jsx("p",{className:"text-base font-semibold text-foreground",children:i("schedulePage.empty",{defaultValue:"No events to show."})})}):e.jsxs(e.Fragment,{children:[b.visible&&e.jsx("div",{"aria-hidden":"true",className:"fixed z-40 overflow-hidden bg-white shadow-[0_6px_18px_-8px_rgba(0,0,0,0.35)]",style:{top:b.top,left:b.left,width:b.
1width},children:e.jsxs("div",{className:"grid min-w-[900px] bg-white",style:{gridTemplateColumns:j},children:[e.jsx("div",{className:"flex items-center justify-center px-4 py-4",children:e.jsx("img",{src:w,alt:"",className:"h-14 w-auto sm:h-16",loading:"lazy"})}),o.map(t=>e.jsxs("div",{className:"px-2 py-3 text-center",children:[e.jsx("div",{className:"text-sm font-bold text-foreground sm:text-base",children:t.monthLabel}),e.jsx("div",{className:"mt-0.5 text-xs font-medium text-muted-foreground",children:i("schedulePage.dayN",{defaultValue:"Day {{n}}",n:t.dayNum})}),e.jsx("div",{className:"mt-0.5 text-xs font-bold text-foreground/80",children:t.weekday})]},t.iso))]})}),e.jsxs("div",{ref:h,className:"rounded-2xl bg-white shadow-[0_10px_40px_-15px_rgba(0,0,0,0.15)] ring-1 ring-border",children:[e.jsx("div",{className:m("rounded-t-2xl px-6 py-4 text-center sm:px-8 sm:py-5",S),children:e.jsx("h2",{className:"text-base font-bold text-white sm:text-lg md:text-xl",children:a})}),e.jsxs("div",{role:"row","aria-hidden":"true",ref:g,className:m("grid min-w-[900px] bg-white shadow-[0_4px_16px_-6px_rgba(0,0,0,0.25)]",b.visible&&"opacity-0"),style:{gridTemplateColumns:j},children:[e.jsx("div",{className:"flex items-center justify-center px-4 py-4",children:e.jsx("img",{src:w,alt:"",className:"h-14 w-auto sm:h-16",loading:"lazy"})}),o.map(t=>e.jsxs("div",{className:"px-2 py-3 text-center",children:[e.jsx("div",{className:"text-sm font-bold text-foreground sm:text-base",children:t.monthLabel}),e.jsx("div",{className:"mt-0.5 text-xs font-medium text-muted-foreground",children:i("schedulePage.dayN",{defaultValue:"Day {{n}}",n:t.dayNum})}),e.jsx("div",{className:"mt-0.5 text-xs font-bold text-foreground/80",children:t.weekday})]},t.iso))]}),e.jsxs("table",{className:"w-full min-w-[900px] table-fixed border-separate border-spacing-0 text-sm",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),o.map(t=>e.jsx("col",{},t.iso))]}),e.jsx("thead",{className:"sr-only",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"bg-white px-4 py-4 text-center align-middle",children:e.jsx("img",{src:w,alt:"WFG26",className:"mx-auto h-14 w-auto sm:h-16",loading:"lazy"})}),o.map(t=>e.jsxs("th",{scope:"col",className:"bg-white px-2 py-3 text-center align-middle",children:[e.jsx("div",{className:"text-sm font-bold text-foreground sm:text-base",children:t.monthLabel}),e.jsx("div",{className:"mt-0.5 text-xs font-medium text-muted-foreground",children:i("schedulePage.dayN",{defaultValue:"Day {{n}}",n:t.dayNum})}),e.jsx("div",{className:"mt-0.5 text-xs font-bold text-foreground/80",children:t.weekday})]},t.iso))]})}),e.jsx("tbody",{children:l.map(t=>{const f=new Set(t.scheduled_dates),p=d&&t.sport_name_ar||t.sport_name;return e.jsxs("tr",{children:[e.jsx("th",{scope:"row",className:m("border-t border-brand-green/30 px-4 py-3 font-bold",k,d?"text-right":"text-left"),children:p}),o.map(c=>{const u=f.has(c.iso);return e.jsx("td",{className:"border-t border-brand-green/30 px-2 py-3 text-center",children:u?e.jsx("span",{className:m("mx-auto inline-block h-3.5 w-3.5 rounded-full sm:h-4 sm:w-4",_),"aria-label":"Scheduled"}):e.jsx("span",{className:"sr-only",children:"â"})},c.iso)})]},`${t.category}-${t.sport_name}`)})})]})]})]})}export{H as component};
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.