PageSourceSearch

https://club.touchtight.com/assets/index-V1oGvfYd.js

js touchtight.com collected 2026-10-02 00:02:36 UTC 64,844 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WeeklySessionPreferencesStep-DQuPlJx8.js","assets/react-vendor-DJtAp8P_.js","assets/index-CyS3LFy6.js","assets/apollo-DL0KWP0Y.js","assets/mui-styles-C9F12l22.js","assets/babel-helpers-D2wBBc1I.js","assets/index-CV9OfG1C.css","assets/weeklySessionPrototype-C2Sc-oto.js","assets/mutation--iSLlBrt.js","assets/onboardingStorage-VOmd6pEl.js","assets/app-DT7WuczB.js","assets/dayjs-CFxoC4n5.js","assets/app-Cg4Kd3Rp.css","assets/WeeklyPracticeCard-XnegRLfU.js","assets/index.esm-CWqXbt53.js","assets/_baseClone-DByvJCmO.js","assets/_baseAssignValue-CjtYt4eh.js","assets/cloneDeep-mVQ3twB2.js","assets/input-CuTRSUQZ.js","assets/editable-input-BbmoAFqJ.js","assets/label-DlgL8a7V.js","assets/popover-DQmY_bgT.js","assets/index-C53T7JDS.js","assets/floating-ui.dom-CpqR1Q5s.js","assets/query-CcmDMjHA.js","assets/arrow-right-CPcr9UUY.js","assets/subMonths-CpZP7vPB.js","assets/addYears-C1EnW8Bh.js","assets/useOnboardingServerSync-D8jgXIFJ.js","assets/arrow-left-D2QUTCdL.js","assets/check-njpSxvzl.js","assets/index-DC1sP82m.js","assets/index-DFAqAA9H.js","assets/imageOptimization-zUL1CBPb.js","assets/useHoverTrailerV2-C_vNBnFz.js","assets/WeeklyPracticeCard-3MQXPqBX.css","assets/sparkles-DgxfdHqs.js","assets/WeeklySessionActionsV2-DQijplNO.js","assets/gafferDugoutHandoff-XpKOt_uZ.js","assets/index-DVtZpAdE.js","assets/index-DR3TqHo-.js","assets/sessionSections-a-lprBoU.js","assets/SessionSavedSheetV2-D11Hnark.js","assets/queries-DiB9xTdd.js","assets/swiper-react-DcF17yCe.js","assets/SessionPlannerMobile-85wkJ1ZS.js","assets/mui-DvP2hOwX.js","assets/moment-Bj79pgB5.js","assets/Modal-BzPnYVEi.js","assets/Button-C4goEOKP.js","assets/Search-BEYvHCFs.js","assets/lodash-icp7yO-G.js","assets/merge-TfBrBrIh.js","assets/isArrayLikeObject-CcVCHQro.js","assets/map-BI8CQ8np.js","assets/browser-B3fhYDhb.js","assets/_arrayIncludes-DFQcso6E.js","assets/_baseIndexOf-DqPIyCu4.js","assets/hello-pangea-dnd-1bhs5THC.js","assets/some-YFJAbcVi.js","assets/values-DeBIqcD0.js","assets/index-B79atc36.js","assets/_baseDifference-BHjDay7E.js","assets/omit-BaIHraq0.js","assets/index-bEsv4Yks.js","assets/mui-x-DMY3qA32.js","assets/s3FileHandler-Bp64keCt.js","assets/compact-DZdspzxW.js","assets/swiper-react-CGdrHBuS.css","assets/FileSaver.min-CVXvx7px.js","assets/index-ngBBROCs.js","assets/buildSessionPdfDocument-Cr4fNpTl.js","assets/switch-DVTTALDv.js","assets/imageUrl-gCnBcCAn.js","assets/chevron-down-D9vZfud1.js","assets/plus-jTnJ9Ylg.js","assets/circle-check-D5IF10Yd.js"])))=>i.map(i=>d[i]);
2import{a as n,j as e}from"./react-vendor-DJtAp8P_.js";import{A as Hs}from"./AddPracticeToSessionModalGate-BB6n61YO.js";import{u as $s}from"./useCollectionsPracticeTypeMap-Diyla1H4.js";import{W as Ys,a as qs,C as zs}from"./WeeklyPracticeCard-XnegRLfU.js";import{E as Ks,a as Qs}from"./index-D1dhoRGq.js";import{R as Js}from"./index-CeeFDfJ-.js";import{b as Xs,C as Zs,Q as en,L as tn}from"./CategorySortDropdown-CR9YM-yu.js";import{u as sn}from"./useIsTabletOrBelow-XMMGxyyS.js";import{ar as ps,aG as ms,a_ as nn,a$ as rn,b0 as on,b1 as an,G as ln,aW as cn,aq as ts,aU as dn,aQ as un,aZ as pn,b2 as mn}from"./query-CcmDMjHA.js";import{bA as hn,bB as fn,bg as gn,by as xn,ar as bn,bt as yn}from"./mutation--iSLlBrt.js";import{bh as kt,bu as de,de as kn,df as Sn,dg as wn,cb as vn,cc as Cn,dl as Nn,dk as En,aT as hs,bi as fs,bc as jn,bA as Tn,aX as P,at as _n,cj as Je}from"./index-CyS3LFy6.js";import{S as ss,g as gs,ce as In,c as St,J as Pn,H as xt,_ as wt,v as Ze,u as ns,F as Rn,W as rs,A as os,aA as Ln,T as On}from"./app-DT7WuczB.js";import{u as An}from"./useRecentlyViewed-B56pK0QT.js";import{u as Mn}from"./usePlaybackProgress-_1fECkJ3.js";import{s as Fn}from"./search-DNkl80Xk.js";import{S as we,s as Gn,F as as,a as Bn,i as is,d as Dn,H as Wn,b as Vn}from"./ShelfRow-CSSHROA7.js";import{r as ls,g as cs,h as bt,w as Un,d as Hn,e as $n,a as Yn,W as xs,i as qn}from"./weeklySessionPrototype-C2Sc-oto.js";import{e as zn,j as bs,u as Kn,I as Qn}from"./onboardingStorage-VOmd6pEl.js";import{u as ys,e as $,n as ve,g as ds}from"./apollo-DL0KWP0Y.js";import{A as Jn}from"./AddPlaylistModalV2-CK13cVBA.js";import{B as ks}from"./bookmark-D81rgROb.js";import{L as Xn}from"./list-plus-jbEUR6Jd.js";import{P as Zn}from"./plus-jTnJ9Ylg.js";import{S as er}from"./sliders-horizontal-Bh3m2IBU.js";import{u as Ss,M as tr}from"./MediaCardV2-CVjrjZCx.js";import{M as sr}from"./MultiSelectBarV2-YoOpbYEX.js";import{u as nr}from"./useIsMobileShell-BG-PNUUI.js";import{C as ws}from"./chevron-down-D9vZfud1.js";import{C as vs}from"./chevron-up-Cdk80VBZ.js";import{C as rr}from"./check-njpSxvzl.js";import{P as yt}from"./index-C1t7uqC1.js";import{T as or}from"./TrailerModal-CVX4TgKw.js";import{aI as ar}from"./swiper-react-DcF17yCe.js";import{s as ir}from"./club-CAt4PSJ5.js";import{M as lr}from"./checkbox-BCFY1QRf.js";import{u as cr}from"./useWeeklySessionVisibility-Cq6aValn.js";import{a as dr,b as ur,c as pr}from"./popover-DQmY_bgT.js";import{E as mr}from"./ellipsis-BPffiR7H.js";import{R as hr}from"./refresh-cw-CGImtvBQ.js";import{R as fr}from"./rotate-ccw-clock-BMQFH01O.js";import{b as gr}from"./useOnboardingServerSync-D8jgXIFJ.js";import{f as xr}from"./footballize-CKQT9bi3.js";import"./dayjs-CFxoC4n5.js";import"./moment-Bj79pgB5.js";import"./index.esm-CWqXbt53.js";import"./_baseClone-DByvJCmO.js";import"./_baseAssignValue-CjtYt4eh.js";import"./cloneDeep-mVQ3twB2.js";import"./mui-styles-C9F12l22.js";import"./babel-helpers-D2wBBc1I.js";import"./SessionPlannerMobile-85wkJ1ZS.js";import"./mui-DvP2hOwX.js";import"./Modal-BzPnYVEi.js";import"./Button-C4goEOKP.js";import"./seededSessionFill-BljGszd4.js";import"./index-CrwW5ro-.js";import"./subMonths-CpZP7vPB.js";import"./chevron-left-hHkvU2-n.js";import"./chevron-right-Bx281FLM.js";import"./Search-BEYvHCFs.js";import"./s3FileHandler-Bp64keCt.js";import"./compact-DZdspzxW.js";import"./sessionSections-a-lprBoU.js";import"./index-CvVUxn0l.js";import"./index-Cor9x_UP.js";
2import"./input-CuTRSUQZ.js";import"./editable-input-BbmoAFqJ.js";import"./label-DlgL8a7V.js";import"./arrow-right-CPcr9UUY.js";import"./funnel-CHKnj2yC.js";import"./addYears-C1EnW8Bh.js";import"./arrow-left-D2QUTCdL.js";import"./index-DC1sP82m.js";import"./index-DFAqAA9H.js";import"./imageOptimization-zUL1CBPb.js";import"./useHoverTrailerV2-C_vNBnFz.js";import"./index-Dmrtjh9z.js";import"./rotate-cw-C3CCEtsC.js";import"./index-B79atc36.js";import"./plainText-DBpeJa6y.js";import"./star-DNcD-a5x.js";import"./heart-SY2Qtxi5.js";import"./calendar-range-BRkGfDrQ.js";import"./arrow-up-Bnsw1-8C.js";import"./arrow-down-oYUkFNnA.js";import"./tokens-BIS2AW1b.js";import"./useDragScroll-DS-iG0FP.js";import"./imageUrl-gCnBcCAn.js";import"./play-CBxhfLg4.js";import"./folder-plus-BuJChPs4.js";import"./trash-2-B3r-aJQU.js";import"./share-2-BcYbamX-.js";import"./lodash-icp7yO-G.js";import"./merge-TfBrBrIh.js";import"./isArrayLikeObject-CcVCHQro.js";import"./map-BI8CQ8np.js";import"./browser-B3fhYDhb.js";import"./_arrayIncludes-DFQcso6E.js";import"./_baseIndexOf-DqPIyCu4.js";import"./hello-pangea-dnd-1bhs5THC.js";import"./some-YFJAbcVi.js";import"./values-DeBIqcD0.js";import"./_baseDifference-BHjDay7E.js";import"./omit-BaIHraq0.js";import"./index-bEsv4Yks.js";import"./mui-x-DMY3qA32.js";import"./index-C53T7JDS.js";import"./floating-ui.dom-CpqR1Q5s.js";try{let i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new i.Error().stack;l&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[l]="c1055753-f463-4bd1-9352-2917f595cc64",i._sentryDebugIdIdentifier="sentry-dbid-c1055753-f463-4bd1-9352-2917f595cc64")}catch{}const br=.05,yr=.9;function Pe(i,l=0){const r=Number(i);return Number.isFinite(r)?r:l}function kr(i,l,r=[]){const u=new Map(l.map(c=>[String(c.id),c])),f=new Map(r.map(c=>[String(c.id),c])),b=new Set;return[...i].sort((c,p)=>Pe(p.updatedAt)-Pe(c.updatedAt)).map(c=>{var k;const p=String(c.id??"");if(!Number.isSafeInteger(Number(p))||Number(p)<=0||b.has(p))return null;b.add(p);const C=Pe(c.duration),m=Pe(c.playedSeconds),T=C>0?m/C:0,_=Math.min(1,Math.max(0,T)),y=u.get(p),N=(y==null?void 0:y.videos)??c.videos,E=c.videoId??((N==null?void 0:N.length)===1?N[0].id:null);return!Number.isSafeInteger(Number(E))||Number(E)<=0||m<=0||c.completed||C<=0||_<br||_>=yr||!y&&!c.title?null:{...{id:c.id,title:c.title??"",main_poster_url:c.main_poster_url,short_description:c.short_description,content_type:c.content_type,videos:c.videos},...y,main_poster_url:(y==null?void 0:y.main_poster_url)||c.main_poster_url||((k=f.get(p))==null?void 0:k.main_poster_url),playback:{videoId:Number(E),playedSeconds:m,duration:C,progress:_,updatedAt:Pe(c.updatedAt)}}}).filter(c=>c!==null).sort((c,p)=>p.playback.updatedAt-c.playback.updatedAt).slice(0,10)}function Sr(i,l){const r=Math.max(0,l-i);return`${Math.max(1,Math.ceil(r/60))} min left`}function wr({row:i,userId:l,onDetailLoaded:r,eager:u=!1,...f}){const b=ys(),c=n.useRef(null),p=n.useRef(!1),[C,m]=n.useState(u);return n.useEffect(()=>{const T=c.current;if(!T)return;const _=()=>{p.current||(p.current=!0,b.query({query:ps,variables:{singleRowInput:{id:i.id,collectionLimit:10,userId:l}},fetchPolicy:"cache-first"}).then(N=>{var h,k;const E=(k=(h=N.data)==null?void 0:h.categoryDetails)==null?void 0:k.data;E&&r(i.id,E)}).catch(()=>{}))};if(!("IntersectionObserver"in window)){m(!0),_();return}const y=new IntersectionObserver(([N])=>{N.isIntersecting&&(y.disconnect(),m(!0),_())},{rootMargin:"300px"});return y.observe(T),()=>y.disconnect()},[]),e.jsx("div",{ref:c,children:e.jsx(we,{...f,items:Gn(i.collections,{near:C}),reserveEmptyRail:!C})})}function vr({selected:i,onClear:l,onBulkAddToSession:r,onBulkAddToPlaylist:u,onBulkSave:f}){const b=i.length,c=b>0;return e.jsx("div",{className:de("fixed left-1/2 -translate-x-1/2 bottom-6 z-40 transition-all duration-200",c?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-3 pointer-events-none"),children:e.jsxs("div",{className:"bg-card-hi border border-tt-border rounded-[3px] px-4 py-3 flex items-center gap-3 shadow-lg",style:{boxShadow:"0 18px 40px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 128, 208, 0.18)"},children:[e.jsxs("span",{className:"font-head font-bold uppercase text-[15px] tracking-wide4 text-fg",children:[b," SELECTED"]}),e.jsx("span",{className:"w-px h-5 bg-hairline mx-1"}),e.jsxs("button",{type:"button",onClick:()=>f(i),className:"bg-transparent border border-tt-border rounded-[2px] px-3 py-1.5 inline-flex items-center gap-2 cursor-pointer hover:border-fg transition-colors",children:[e.jsx(ks,{className:"w-3.5 h-3.5 text-fg"}),e.jsx("span",{className:"font-mono text-[10.5px] uppercase tracking-wide8 text-fg",children:"SAVE"})]}),e.jsxs("button",{type:"button",onClick:()=>u(i),className:"bg-transparent border border-tt-border rounded-[2px] px-3 py-1.5 inline-flex items-center gap-2 cursor-pointer hover:border-fg transition-colors",children:[e.jsx(Xn,{className:"w-3.5 h-3.5 text-fg"}),e.jsx("span",{className:"font-mono text-[10.5px] uppercase tracking-wide8 text-fg",children:"PLAYLIST"})]}),e.jsxs("button",{type:"button",onClick:()=>r(i),className:"bg-accent text-bg border-0 rounded-[2px] px-3 py-1.5 inline-flex items-center gap-2 cursor-pointer hover:brightness-110 transition-all",children:[e.jsx(Zn,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"font-mono text-[10.5px] uppercase tracking-wide8",children:"ADD TO SESSION"})]}),e.jsx("span",{className:"w-px h-5 bg-hairline mx-1"}),e.jsx("button",{type:"button",onClick:l,className:"bg-transparent border-0 text-subtle hover:text-fg cursor-pointer p-1","aria-label":"Clear selection",children:e.jsx(kt,{className:"w-4 h-4"})})]})})}function Cr({searchValue:i,onSearchChange:l,activeFilterCount:r,onOpenFilters:u,hideTitle:f=!1}){const[b,c]=n.useState(!1),p=b||i.length>0;return e.jsxs("div",{className:"px-7 pb-3",children:[!f&&e.jsx("h2",{className:"font-head font-bold uppercase text-[24px] lg:text-[36px] tracking-wide2 leading-[1] text-fg",children:"Engine Room"}),e.jsxs("div",{className:f?"flex items-center gap-3 pt-1":"flex items-center gap-3 mt-3 pt-3 border-t border-hairline",children:[e.jsx("span",{className:"flex-1 h-px bg-hairline"}),p?e.jsxs("div",{className:"bg-card border border-tt-border rounded-[2px] px-3 py-1.5 inline-flex items-center gap-2",children:[e.jsx(ss,{className:"w-3.5 h-3.5 text-subtle flex-shrink-0"}
2),e.jsx("input",{type:"search",autoFocus:!0,placeholder:"Search drills, sessions, themes…",value:i,onChange:C=>l(C.target.value),onBlur:()=>{i||c(!1)},className:"bg-transparent border-0 outline-none font-body text-[13px] text-fg placeholder:text-subtle w-[220px] min-w-0"}),i.length>0&&e.jsx("button",{type:"button",onClick:()=>{l(""),c(!1)},"aria-label":"Clear search",className:"text-subtle hover:text-fg",children:e.jsx(kt,{className:"w-3.5 h-3.5"})})]}):e.jsx("button",{type:"button",onClick:()=>c(!0),"aria-label":"Search",className:"bg-card border border-tt-border rounded-[2px] px-2.5 py-1.5 inline-flex items-center justify-center cursor-pointer text-fg hover:border-fg transition-colors",children:e.jsx(ss,{className:"w-3.5 h-3.5"})}),e.jsxs("button",{type:"button",onClick:u,className:"bg-card border border-tt-border rounded-[2px] px-3 py-1.5 inline-flex items-center gap-2 cursor-pointer hover:border-fg transition-colors",children:[e.jsx(er,{className:"w-3 h-3 text-subtle"}),e.jsx("span",{className:"font-mono text-[10.5px] uppercase tracking-wide8 text-fg",children:"FILTER"}),r>0&&e.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-wide10 text-bg bg-accent px-1.5 py-0.5 rounded-[2px]",children:r})]})]})]})}const us="er-home.onboardingProgress.collapsed";function Nr({clubId:i,onboardingCompleted:l,onOpenStep:r}){var _,y,N,E,h,k;const{data:u}=$(ms,{skip:!i||l===!0,variables:{club_id:i},fetchPolicy:"cache-and-network"}),[f,b]=n.useState(()=>typeof window>"u"?!0:window.localStorage.getItem(us)!=="0"),c=n.useCallback(()=>{b(S=>{const w=!S;return typeof window<"u"&&window.localStorage.setItem(us,w?"1":"0"),w})},[]);if(l===!0||!i)return null;const p=(_=u==null?void 0:u.getClubProgress)==null?void 0:_.data,C=[{key:"team",label:"Add first team",target:1,current:((y=p==null?void 0:p.teams)==null?void 0:y.length)??0},{key:"players",label:"Add 5 players",target:5,current:((N=p==null?void 0:p.players)==null?void 0:N.length)??0},{key:"objectives",label:"Create objectives",target:3,current:((E=p==null?void 0:p.playerObjectives)==null?void 0:E.length)??0},{key:"sessions",label:"Create sessions",target:3,current:((h=p==null?void 0:p.trainingSessions)==null?void 0:h.length)??0},{key:"videos",label:"Add videos to a session",target:2,current:((k=p==null?void 0:p.sessionPractices)==null?void 0:k.length)??0}],m=C.filter(S=>S.current>=S.target).length,T=Math.round(m/C.length*100);return e.jsx("div",{className:de("bg-gradient-to-r from-bg-raised to-card border-b border-hairline",f?"px-7 py-2":"px-7 py-4"),children:e.jsxs("div",{className:"max-w-[1440px] mx-auto",children:[e.jsxs("div",{className:de("flex items-center justify-between gap-4",f?"mb-0":"mb-5"),children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("span",{className:"font-head font-bold text-[16px] uppercase text-fg tracking-wide4",children:"Your progress"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide10 text-subtle",children:"COMPLETE"}),e.jsxs("span",{className:"font-head font-bold text-[20px] text-accent-2 leading-none",children:[T,"%"]}),e.jsx("button",{type:"button",onClick:c,"aria-label":f?"Show onboarding milestones":"Hide onboarding milestones",className:de("ml-2 inline-flex h-6 w-6 items-center justify-center rounded-[2px]","border border-hairline text-muted hover:text-fg hover:border-accent-2/40","transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-accent-2"),children:f?e.jsx(ws,{className:"w-3.5 h-3.5"}):e.jsx(vs,{className:"w-3.5 h-3.5"})})]})]}),!f&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-1 bg-hairline rounded-[1px] overflow-hidden mb-4",children:e.jsx("div",{className:"h-full bg-accent-2 transition-all",style:{width:`${T}%`}})}),e.jsx("div",{className:de("flex md:grid md:grid-cols-5 gap-2.5","overflow-x-auto md:overflow-visible snap-x snap-mandatory md:snap-none","-mx-7 px-7 md:mx-0 md:px-0","scrollbar-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"),children:C.map(S=>{const w=S.current>=S.target;return e.jsxs("button",{type:"button",onClick:()=>r==null?void 0:r(S.key),className:de("shrink-0 w-[200px] md:w-auto snap-start","flex items-center gap-2.5 px-3 py-2.5 rounded-[2px] text-left","border border-solid transition-colors group",w?"border-accent-2/25 text-fg hover:border-accent-2/50":"bg-bg border-hairline text-fg hover:bg-bg-raised hover:border-accent-2/40"),style:w?{background:"rgba(34, 211, 238, 0.08)"}:void 0,children:[e.jsx("span",{className:de("w-4 h-4 rounded-full flex items-center justify-center flex-shrink-0",w?"bg-accent-2 text-bg":"border border-hairline"),children:w&&e.jsx(rr,{className:"w-2.5 h-2.5",strokeWidth:3})}),e.jsxs("span",{className:"flex-1 min-w-0",children:[e.jsxs("span",{className:"block font-mono text-[10px] uppercase tracking-wide10",style:{color:w?"var(--accent-2)":"var(--muted)"},children:[S.current," / ",S.target]}),e.jsx("span",{className:"block text-[12.5px] truncate",children:S.label})]})]},S.key)})})]})]})})}const Er={liked:{title:"Start liking sessions",hint:"Tap the heart on any card. Your library grows as you go.",cta:"Browse whole library"},weekPlans:{title:"Build your first week",hint:"A week plan is 3 sessions, sequenced. We'll suggest one based on your age group.",cta:"Open AI builder"}
2,seasonPlans:{title:"Map your season",hint:"Lay out the whole campaign by month, covering themes, blocks and milestones.",cta:"Open season planner"},generic:{title:"No signal yet",hint:"New content lands here when the editorial team publishes the next drop.",cta:"Browse whole library"}};function jr({shelfNumber:i,variant:l,onCta:r}){const u=Er[l];return e.jsxs("div",{className:"mx-7 mb-7 border border-dashed border-tt-border rounded-[3px] px-7 py-10 flex flex-col items-start gap-3",style:{background:"repeating-linear-gradient(135deg, transparent 0, transparent 10px, rgba(245,247,251,0.025) 10px, rgba(245,247,251,0.025) 11px)"},children:[e.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wide12 text-subtle",children:["NO SIGNAL · ",String(i).padStart(2,"0")]}),e.jsx("h3",{className:"font-head font-bold uppercase text-fg leading-none",style:{fontSize:"28px"},children:u.title}),e.jsx("p",{className:"text-muted text-[13.5px] max-w-[420px]",children:u.hint}),e.jsxs("button",{type:"button",onClick:r,className:"mt-2 px-4 py-2 bg-accent-2 text-bg font-head font-bold uppercase text-[13px] tracking-wide10 rounded-[2px] hover:brightness-110",children:[u.cta," →"]})]})}const ce=5;function Tr({clubId:i,onboardingCompleted:l}){var w,R,L,O,A,ue;const r=Ss(),u=gs(),f=n.useRef(null),b=n.useRef(0),c=n.useRef(!1),[p,C]=n.useState(!1),[m,T]=n.useState(!1),[_,y]=n.useState(!1),{data:N}=$(ms,{skip:!i||l===!0,variables:{club_id:i},fetchPolicy:"cache-and-network"}),[E]=ve(hn),h=(w=N==null?void 0:N.getClubProgress)==null?void 0:w.data,k=[(((R=h==null?void 0:h.teams)==null?void 0:R.length)??0)>=1,(((L=h==null?void 0:h.players)==null?void 0:L.length)??0)>=5,(((O=h==null?void 0:h.playerObjectives)==null?void 0:O.length)??0)>=3,(((A=h==null?void 0:h.trainingSessions)==null?void 0:A.length)??0)>=3,(((ue=h==null?void 0:h.sessionPractices)==null?void 0:ue.length)??0)>=2].filter(Boolean).length;if(n.useEffect(()=>{var G;const re=b.current;b.current=k,!c.current&&re<ce&&k>=ce&&l!==!0&&(c.current=!0,(G=f.current)==null||G.triggerConfetti(),y(!0),(async()=>{try{await E(),u(ir({is_onboarding_completed:!0}))}catch(D){console.error("[YourProgressWidget] onboarding-complete mutation failed",D)}})())},[k,l,E,u]),r||l===!0||!i||m)return null;const S=Math.max(0,Math.min(k,ce));return e.jsxs(e.Fragment,{children:[e.jsx(ar,{ref:f}),p?e.jsxs("button",{type:"button",onClick:()=>C(!1),className:"fixed bottom-6 right-6 z-20 flex items-center gap-2 px-3 py-2 bg-card border border-tt-border rounded-[3px] shadow-[0_8px_20px_rgba(0,0,0,0.4)] hover:border-accent-2","aria-label":"Expand your progress",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide12 text-accent-2",children:"PROGRESS"}),e.jsxs("span",{className:"font-head font-bold text-[14px] text-accent-2 leading-none",children:[S,e.jsxs("span",{className:"text-muted",children:["/",ce]})]})]}):e.jsxs("div",{className:"fixed bottom-6 right-6 z-20 w-[280px] bg-card border border-tt-border rounded-[3px] p-4 shadow-[0_12px_28px_rgba(0,0,0,0.45)]",children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide12 text-accent-2",children:"YOUR PROGRESS"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>C(!0),className:"w-5 h-5 flex items-center justify-center text-subtle hover:text-fg bg-transparent","aria-label":"Collapse",children:e.jsx(lr,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>T(!0),className:"w-5 h-5 flex items-center justify-center text-subtle hover:text-fg bg-transparent","aria-label":"Dismiss",children:e.jsx(kt,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"font-head font-bold text-accent-2 leading-none mb-3",style:{fontSize:"48px"},children:[S," ",e.jsxs("span",{className:"text-muted text-[28px]",children:["/ ",ce]})]}),e.jsx("div",{className:"flex items-end gap-1.5 h-10 mb-1",children:Array.from({length:ce}).map((re,G)=>{const D=G<S;return e.jsx("span",{className:`flex-1 rounded-[1px] ${D?"bg-accent-2":"bg-hairline"}`,style:{height:D?"100%":"40%"}},G)})}),e.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-wide10 text-subtle",children:S===ce?"CLUB SETUP COMPLETE":"CLUB SETUP MILESTONES"})]}),e.jsx(kn,{open:_,onOpenChange:y,children:e.jsxs(Sn,{children:[e.jsx(wn,{className:"fixed inset-0 z-40 bg-bg/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(vn,{className:"fixed left-1/2 top-1/2 z-50 w-[420px] max-w-[92vw] -translate-x-1/2 -translate-y-1/2 bg-bg-raised text-fg font-body border-l-2 border-l-accent-2 border-y border-r border-tt-border rounded-[3px] p-7 shadow-[0_30px_60px_rgba(0,0,0,0.6)]",children:[e.jsx(Cn,{className:"font-head font-bold uppercase text-[28px] leading-[1.05] text-fg mb-2",children:"Club setup complete"}),e.jsx(Nn,{className:"text-[13.5px] text-muted leading-relaxed mb-5",children:"Every milestone ticked. Time to push forward and accelerate your club."}),e.jsx("div",{className:"flex justify-end",children:e.jsx(En,{className:"inline-flex items-center gap-2 bg-accent text-[#0a0810] font-head font-bold uppercase text-[13px] tracking-wide10 px-4 py-2.5 rounded-[2px] hover:brightness-110",children:"Let's go"})})]})]})})]})}
2function _r(i,l){if(!l.userId||!l.clubId||!i.activities.length)throw new Error("This session is not ready to add to your planner.");const r={};return i.activities.forEach((u,f)=>{const b=u.sectionKey??"mainActivities";if(!b||["__proto__","prototype","constructor","mediaCards"].includes(b))throw new Error("This session has an unavailable section. Choose another session.");const c=Number(u.videoId);if(!Number.isSafeInteger(c)||c<=0)throw new Error("Some practices are unavailable. Choose another session or try again later.");(r[b]??(r[b]=[])).push({id:`weekly:${i.id}:${f}:${c}`,title:u.title,content_type:"video",main_poster_url:u.thumbnailUrl,short_description:u.shortDescription??u.description??"",long_description:u.longDescription??"",description:u.description??"",videos:[{id:c}]})}),{owner:l,items:r,weeklyAssignmentId:i.assignmentId,values:{name:i.title,addToGlobalLibrary:"no",tags:{},description:`${i.ageLabel} · ${i.durationMinutes} minutes`,coachNotes:""}}}const Ir=n.lazy(()=>wt(()=>import("./WeeklySessionPreferencesStep-DQuPlJx8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]))),Pr=n.lazy(()=>wt(()=>import("./WeeklySessionActionsV2-DQijplNO.js"),__vite__mapDeps([37,1,8,3,10,2,4,5,6,11,12,38,39,24,40,41,42,19,43,44,45,46,47,48,49,33,14,15,16,17,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,30,25,74,75,76])));function Rr({onSetPreferences:i,openPreferencesToken:l=0}={}){const{hidden:r,canSave:u,setHidden:f}=cr(),{enqueueSnackbar:b,closeSnackbar:c}=In(),p=()=>{if(!f(!0)){b("Could not hide weekly session. Please try again.",{variant:"error"});return}b("Weekly session hidden. Restore it in Profile preferences.",{variant:"info",autoHideDuration:1e4,action:C=>e.jsx("button",{type:"button",className:"px-3 py-2 font-semibold",onClick:()=>{f(!1)?c(C):b("Could not restore weekly session. Please try again.",{variant:"error"})},children:"Undo"})})};return r?null:e.jsx(Lr,{onHide:p,canHide:u,onSetPreferences:i,openPreferencesToken:l})}function Lr({onHide:i,canHide:l,onSetPreferences:r,openPreferencesToken:u=0}){var V,Me;const f=hs(),b=St(),c=Pn("v2-build-session"),p=fs(),C=n.useRef(null),[m,T]=n.useState(()=>ls()),[_,y]=n.useState(()=>cs(f.search)),[N,E]=n.useState(()=>{var d;return typeof window<"u"&&!!((d=window.matchMedia)!=null&&d.call(window,"(min-width: 768px)").matches)});n.useEffect(()=>{var v;const d=(v=window.matchMedia)==null?void 0:v.call(window,"(min-width: 768px)");if(!d)return;const g=()=>E(d.matches);return d.addEventListener("change",g),()=>d.removeEventListener("change",g)},[]);const h=_||N,[k,S]=n.useState(!1),[w,R]=n.useState(!1),[L,O]=n.useState(null),[A,ue]=n.useState(null),[re,G]=n.useState(!1),D=n.useRef(new Set);n.useEffect(()=>{u>0&&R(!0)},[u]);const{data:K,loading:Re,error:Q,refetch:Ce}=$(nn,{fetchPolicy:"network-only",context:{silentErrors:!0},notifyOnNetworkStatusChange:!0}),{data:M,loading:et,error:Ne,refetch:tt}=$(rn,{fetchPolicy:"network-only",context:{silentErrors:!0},notifyOnNetworkStatusChange:!0}),[st,{data:Y,loading:pe}]=ds(on,{fetchPolicy:"network-only",context:{silentErrors:!0}}),[Ee,{loading:je}]=ds(an,{fetchPolicy:"network-only",context:{silentErrors:!0}}),[Le]=ve(fn,{context:{silentErrors:!0}}),Oe=n.useMemo(()=>{var g;const d=(g=Y==null?void 0:Y.getWeeklyAssignmentHistory)==null?void 0:g.data;return Array.isArray(d)?d.map(bt).filter(v=>v!=null):[]},[Y]),q=n.useCallback(async(d,g)=>{if(!g)return;const v=`${g}:${d}`;if(!D.current.has(v)){D.current.add(v);try{await Le({variables:{input:{weeklyAssignmentId:g,type:d}}})}catch{D.current.delete(v)}}},[Le]);n.useEffect(()=>{var g,v;const d=bt((g=K==null?void 0:K.getWeeklyAssignmentCurrent)==null?void 0:g.data);if(d){T(d);return}M&&T(Un((v=M.getWeeklySessionRecommendation)==null?void 0:v.data))},[K,M]),n.useEffect(()=>{const d=g=>T(g.detail??ls());return window.addEventListener("touchtight:weekly-session-updated",d),()=>window.removeEventListener("touchtight:weekly-session-updated",d)},[]),n.useEffect(()=>{if(!m||!cs(f.search))return;y(!0);const d=window.requestAnimationFrame(()=>{var g;return(g=C.current)==null?void 0:g.scrollIntoView({behavior:"smooth",block:"start"})});return()=>window.cancelAnimationFrame(d)},[f.search,m]),n.useEffect(()=>{h&&(m!=null&&m.assignmentId)&&q("viewed",m.assignmentId)},[h,m==null?void 0:m.assignmentId,q]);const nt=d=>{if(d.collectionId==null)return;const g=d.videoId??d.collectionId,v=Ze(d.title,g,d.collectionId,"video");p(`/collections?${v}`)},me=async()=>{var d;O(null);try{const v=(d=(await Ee()).data)==null?void 0:d.getWeeklyAssignmentAlternative,he=v!=null&&v.success?bt(v.data):null;if(!he){O((v==null?void 0:v.message)||"No alternative session is available right now.");return}T(he),y(!0),O("Alternative session ready.")}catch{O("Could not load an alternative session. Try again.")}},Te=async()=>{const d=!k;if(S(d),O(null),d&&!Y)try{await st({variables:{limit:8}})}catch{O("Could not load previous sessions. Try again.")}},Ae=()=>{if(m){if(!c){O("The session editor is not available for this account yet.");return}try{const d=_r(m,{userId:String((b==null?void 0:b.id)??""),clubId:String((b==null?void 0:b.club_id)??"")});ue(g=>(g==null?void 0:g.id)===m.id&&g.seed.owner.userId===d.owner.userId&&g.seed.owner.clubId===d.owner.clubId?g:{seed:d,id:m.id,durationMinutes:m.durationMinutes}),G(!0)}catch(d){O(d instanceof Error?d.message:"Could not open the planner.")}}},W=async()=>{m&&($n(m),await q("saved",m.assignmentId),O("Session saved on this device."))};if(!m){const d=Re||et,g=!!(Q||Ne||((V=K==null?void 0:K.getWeeklyAssignmentCurrent)==null?void 0:V.success)===!1||((Me=M==null?void 0:M.getWeeklySessionRecommendation)==null?void 0:Me.success)===!1),v=()=>{Promise.allSettled([Ce(),tt()])};return e.jsxs("section",{className:"mx-4 mb-5 mt-4 rounded-lg border border-solid border-tt-border bg-card p-3.5 md:mx-7 md:mt-0 md:p-5","aria-labelledby":"weekly-session-title","aria-busy":d,children:[e.jsxs("div",{className:"flex items-start gap-2.5 md:gap-3",children:[e.jsx(xt,{className:"mt-0.5 h-4 w-4 shrink-0 text-accent-2 md:mt-1 md:h-5 md:w-5","aria-hidden":!0}),e.jsxs("div",{children:[e.jsx("h2",{id:"weekly-session-title",className:"m-0 font-head text-[17px] leading-tight uppercase text-fg md:text-xl",children:"Your session this week"}),e.jsx("p",{className:"mb-0 mt-1.5 font-body text-[13px] leading-snug text-muted md:mt-2 md:text-sm",role:g&&!d?"alert":"status",children:d?"Finding your weekly session…":g?"We couldn’t load your weekly session. Please try again.":"No weekly session is available yet. Set your session preferences to find one for your players."}),!d&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:v,className:"min-h-9 cursor-pointer rounded border border-solid border-tt-border bg-transparent px-3 font-head text-xs uppercase text-fg md:min-h-10",children:"Try again"}),!g&&e.jsx("button",{type:"button",onClick:()=>r?r():R(!0),className:"min-h-9 md:min-h-10 cursor-pointer rounded border-0 bg-accent-2 px-3 font-head text-xs uppercase text-bg",children:"Set session preferences"}),l&&e.jsx("button",{type:"button",onClick:i,className:"min-h-9 cursor-pointer border-0 bg-transparent px-1 font-head text-xs text-muted md:min-
2h-10 md:px-3",children:"Hide weekly session"})]})]})]}),w&&e.jsx(n.Suspense,{fallback:e.jsx("p",{role:"status",className:"font-body text-sm text-muted",children:"Opening preferences…"}),children:e.jsx(Ir,{open:!0,onDismiss:()=>R(!1),onSettled:()=>{R(!1),v()}})})]})}return e.jsxs("section",{ref:C,className:"mx-4 mb-5 mt-4 scroll-mt-24 rounded-[8px] border border-accent-2/35 bg-card p-3.5 md:mx-7 md:mt-0 md:p-5","aria-labelledby":"weekly-session-title",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"hidden h-10 w-10 shrink-0 place-items-center rounded-[5px] bg-accent-2/10 text-accent-2 md:grid",children:e.jsx(xt,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-wide12 text-accent-2",children:[e.jsx(xt,{className:"h-3.5 w-3.5 md:hidden","aria-hidden":!0}),"Your session this week"]}),e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide8 text-muted",children:[m.phaseLabel,m.readyForNextWeek?"Ready for next week":"Refreshed weekly"].filter(
2Boolean).join(" · ")})]}),e.jsxs(dr,{children:[e.jsx(ur,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Weekly session options",className:"-my-2 -mr-2 grid h-10 w-10 shrink-0 place-items-center rounded-md text-fg hover:bg-bg-raised",children:e.jsx(mr,{className:"h-5 w-5"})})}),e.jsxs(pr,{align:"end",className:"w-64 bg-bg-raised p-2",children:[e.jsx("button",{type:"button",disabled:!l,onClick:i,className:"min-h-11 w-full rounded-md px-3 text-left text-sm text-fg hover:bg-card",children:"Hide from navigation"}),e.jsx("p",{className:"px-3 pb-2 text-xs text-muted",children:"Restore it in Profile preferences. Your session will not be deleted."})]})]})]}),e.jsx("h2",{id:"weekly-session-title",className:"mb-0 mt-1 font-head text-[18px] font-bold uppercase leading-tight tracking-wide2 text-fg md:text-[26px]",children:m.title})]})]}),m.activities.length?e.jsx("div",{className:`${Hn} mt-2.5 md:mt-4`,children:(h?m.activities:m.activities.slice(0,1)).map((d,g)=>e.jsx(Ys,{activity:d,index:g,onView:d.collectionId!=null?()=>nt(d):void 0},`${d.title}-${g}`))}):null,e.jsx("p",{className:"mt-3 hidden font-body text-[12px] text-muted md:block",children:"Save this session, take it to training or edit it to make it your own."}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 md:flex md:flex-wrap",children:[e.jsx("button",{type:"button",onClick:Ae,className:"inline-flex h-11 items-center justify-center gap-2 rounded-[4px] border border-accent bg-accent px-2 whitespace-nowrap font-head text-[13px] font-bold uppercase tracking-normal text-bg md:tracking-wide8 md:h-auto md:min-h-10 md:justify-start md:px-3 md:text-[11px]",children:"Use this session"}),e.jsxs("button",{type:"button",onClick:()=>y(d=>!d),className:"md:hidden inline-flex h-11 items-center justify-center gap-1.5 rounded-[4px] border border-tt-border bg-bg-raised px-2 whitespace-nowrap font-head text-[13px] font-bold uppercase tracking-normal text-fg md:tracking-wide8 md:h-auto md:min-h-10 md:justify-start md:gap-2 md:bg-transparent md:px-3 md:text-[11px]",children:[_?"Hide practices":m.activities.length>1?`View all ${m.activities.length}`:"View session"," ",_?e.jsx(vs,{className:"h-4 w-4"}):e.jsx(ws,{className:"h-4 w-4"})]}),m.assignmentId?e.jsxs("div",{className:"col-span-2 grid grid-cols-3 gap-2 md:contents",children:[e.jsxs("button",{type:"button",onClick:W,"aria-label":"Keep on this device",className:"flex h-10 items-center justify-center gap-1.5 rounded-[4px] border border-hairline bg-bg-raised px-1.5 whitespace-nowrap font-head text-[12px] font-bold uppercase tracking-normal text-fg md:tracking-wide8 md:h-auto md:min-h-10 md:gap-2 md:border-tt-border md:bg-transparent md:px-3 md:text-[11px]",children:[e.jsx(ks,{className:"h-4 w-4 shrink-0"})," ",e.jsx("span",{className:"md:hidden",children:"Keep"}),e.jsx("span",{className:"hidden md:inline",children:"Keep on this device"})]}),e.jsxs("button",{type:"button",onClick:me,disabled:je,className:"flex h-10 items-center justify-center gap-1.5 rounded-[4px] border border-hairline bg-bg-raised px-1.5 whitespace-nowrap font-head text-[12px] font-bold uppercase tracking-normal text-fg md:tracking-wide8 md:h-auto md:min-h-10 md:gap-2 md:border-tt-border md:bg-transparent md:px-3 md:text-[11px] disabled:opacity-50",children:[e.jsx(hr,{className:`h-4 w-4 shrink-0 ${je?"animate-spin":""}`})," ",je?"Finding":"Try another"]}),e.jsxs("button",{type:"button",onClick:Te,"aria-expanded":k,className:"flex h-10 items-center justify-center gap-1.5 rounded-[4px] border border-hairline bg-bg-raised px-1.5 whitespace-nowrap font-head text-[12px] font-bold uppercase tracking-normal text-fg md:tracking-wide8 md:h-auto md:min-h-10 md:gap-2 md:border-tt-border md:bg-transparent md:px-3 md:text-[11px]",children:[e.jsx(fr,{className:"h-4 w-4 shrink-0"})," Previous"]})]}):null]}),L?e.jsx("p",{className:"mt-2 font-body text-[12px] text-muted",role:"status",children:L}):null,k?e.jsxs("div",{className:"mt-3 border-t border-hairline pt-3",children:[e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wide8 text-muted",children:"Previous weekly sessions"}),pe?e.jsx("p",{className:"mt-2 font-body text-[12px] text-muted",children:"Loading…"}):null,!pe&&Oe.length===0?e.jsx("p",{className:"mt-2 font-body text-[12px] text-muted",children:"No previous matched sessions yet."}):null,e.jsx("div",{className:"mt-2 flex flex-col gap-2",children:Oe.map(d=>e.jsxs("button",{type:"button",onClick:()=>{T(d),y(!0),S(!1)},className:"flex min-h-11 w-full items-center justify-between gap-3 rounded-[3px] border border-hairline px-3 py-2 text-left",children:[e.jsx("span",{className:"min-w-0 truncate font-head text-[12px] font-bold uppercase text-fg",children:d.title}),e.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase text-muted",children:d.weekStart||"Previous"})]},d.id))})]}):null,A&&e.jsx(n.Suspense,{fallback:re?e.jsx("p",{role:"status",className:"mt-2 font-body text-xs text-muted",children:"Opening session actions…"}):null,children:e.jsx(Pr,{open:re,seed:A.seed,sessionId:A.id,durationMinutes:A.durationMinutes,onClose:()=>G(!1)},`${A.seed.owner.userId}:${A.seed.owner.clubId}:${A.id}`)})]})}const Or=n.lazy(()=>wt(()=>import("./WeeklySessionPreferencesStep-DQuPlJx8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36])));function Ar({requestToken:i,onRequestHandled:l}){var E,h,k;const r=gr(),u=r.status==="ready",f=!!((E=r.data)!=null&&E.profile_completed_at),b=!!((h=r.data)!=null&&h.profile_skipped),c=!!((k=r.data)!=null&&k.weekly_session_asked_at),p=f||b,[C,m]=n.useState(0),T=n.useRef(!1),[_,y]=n.useState(!1);n.useEffect(()=>{if(i){if(p||zn()){l();return}T.current=!0,m(S=>S+1)}},[i]);const N=()=>
2{if(T.current){T.current=!1,l();return}Yn({enabled:xs,localProfileCompleted:bs().completed,serverProfileCompleted:f,serverProfileSkipped:b,serverWeeklySettled:c,localWeeklySettled:qn()})||y(!0)};return e.jsxs(e.Fragment,{children:[e.jsx(qs,{ready:u&&!p,onSettled:N},C),_&&e.jsx(n.Suspense,{fallback:null,children:e.jsx(Or,{open:!0,onSettled:()=>y(!1)})})]})}const Xe={displayName:"Content Type",name:"Content Type",tags:[{id:P.PRACTICE_AND_DRILLS,name:"Practices / Drills"},{id:P.FULL_SESSIONS,name:"Full Sessions"},{id:P.SEASON_PLANS,name:"Season Plans"},{id:P.POSITION_SPECIFIC,name:"Position Specific"},{id:P.COACHING_THEMES,name:"Coaching Themes"},{id:P.WEEK_PLANS_46,name:"4-6 Week Plans"},{id:P.FORMATIONS_TACTICS,name:"Formations & Tactics"},{id:P.PRE_SEASON,name:"Pre-Season"}]},Se=100,Mr=2;function Fr(i){const l=i.toLowerCase();return l.includes("lik")?"liked":l.includes("week")?"weekPlans":l.includes("season")?"seasonPlans":"generic"}function Gr(i,l){const r=i.toLowerCase();return r.includes("attack")?"Break lines, create overloads and finish moves.":r.includes("defend")?"Win it back, stay compact and protect the box.":r.includes("possession")?"Keep the ball, build through the thirds and dictate tempo.":r.includes("finish")?"Be clinical in front of goal with strikes, rebounds and 1v1s.":r.includes("passing")?"Sharp passing patterns built on weight, timing and first touch.":r.includes("ball mastery")||r.includes("dribbl")||r.includes("rwtb")||r.includes("running with")?"Close control and 1v1 skills to beat a defender.":r.includes("crossing")?"Deliveries and finishes from wide areas.":r.includes("rondo")?"Rondos to sharpen first touch, support angles and quick play.":r.includes("set piece")||r.includes("corner")||r.includes("free kick")||r.includes("throw in")?"Corners, free kicks and throw-ins, with routines that score.":r.includes("counter")?"Transition fast and break the moment you win it back.":r.includes("switch")?"Switch the point of attack and exploit the space.":r.includes("goalkeep")||r.includes("keeper")?"Goalkeeper work covering handling, footwork, distribution and shot-stopping.":r.includes("phase of play")||r.includes("phases of play")?"Phase-of-play practices to rehearse real game moments.":r.includes("function")?"Functional work to sharpen units and positions.":r.includes("shape")||r.includes("pattern")?"Team shape and patterns of play, drilled to habit.":r.includes("wave")?"Wave practices with repeat reps at game tempo.":r.includes("11 v 11")||r.includes("11v11")?"Full 11v11 work to put it all together on the big pitch.":r.includes("small sided")||r.includes("ssg")||r.includes("game")||r.includes("races")?"Game-realistic practices with high touches and real decisions.":r.includes("individual")?"Focused 1:1 development for individual players.":r.includes("warm up")||r.includes("warm-up")?"Warm-ups to switch players on and prime the ball."
2:r.includes("social distan")?"Distanced practices for restricted training.":r.includes("play at home")||r.includes("home practice")?"Solo practices players can do at home.":r.includes("futsal")?"Futsal in tight spaces, with fast feet and quick decisions.":r.includes("under 8")||r.includes("u8")||r.includes("mini baller")?"Fun, high-touch practices for your youngest players.":r.includes("u9")||r.includes("u11")?"Age-appropriate practices for developing U9–U11s.":r.includes("u12")||r.includes("u14")?"Practices pitched right for U12–U14 development.":r.includes("u15")||r.includes("u17")?"Challenging practices for U15–U17 players.":r.includes("18+")||r.includes("adult")?"Adult-level practices built for intensity and game demands.":r.includes("60 min")?"Ready-to-run 60-minute sessions, warm-up to cooldown.":r.includes("90 min")?"Full 90-minute sessions for a complete night.":r.includes("120 min")?"Extended 120-minute sessions for deep work.":r.includes("player")?"Sized for your numbers, with practices that fit the squad.":r.includes("level 1")||r.includes("beginner")?"Beginner sessions to build the basics.":r.includes("level 2")||r.includes("intermediate")?"Intermediate sessions to push players on.":r.includes("level 3")||r.includes("advanced")?"Advanced sessions for higher demands.":r.includes("level 4")||r.includes("elite")?"Elite-level sessions for top performers.":r.includes("pre-season")||r.includes("pre season")?"Pre-season builds for fitness, sharpness and identity before kickoff.":r.includes("season plan")?"Map the whole campaign across themes, blocks and milestones.":r.includes("week")?"Multi-week blocks, sequenced and ready to run.":r.includes("433")||r.includes("4-3-3")||r.includes("formation")||r.includes("tactic")?"Set your shape, build an identity and dictate the play.":r.includes("position")?"Position-specific work to sharpen every role.":r.includes("coaching")||r.includes("theme")?"Themed blocks to develop one focus at a time.":r.includes("lik")||r.includes("favourite")||r.includes("favorite")||r.includes("my library")?"Your saved and liked content, in one place.":r.includes("practice")||r.includes("drill")?"Practices to drop straight into your session.":r.includes("session")?"Full sessions from warm-up to cooldown, ready to coach.":r.includes("video")||r.includes("tutorial")?"Guides and walkthroughs for coaches.":`${l} hand-picked collections for your coaching.`}function Wa(){const i=St();return e.jsx(Br,{},(i==null?void 0:i.id)??"guest")}function Br(){var Qt,Jt,Xt,Zt,es;const i=hs(),l=fs(),r=ys(),u=gs(),f=St(),{refetch:b}=jn(),c=Ss(),p=sn(),[C,m]=n.useState(0),[T,_]=n.useState(0),y=nr(),N=n.useRef(null),E=n.useRef(null),h=ns(t=>t.club),k=ns(t=>{var s,o;return((o=(s=t.search)==null?void 0:s.engineRoom)==null?void 0:o.home)??""}),S=n.useCallback(t=>{u(Fn({key:"home",value:t}))},[u]),[w]=Rn(),{recentlyViewed:R,trackView:L}=An();n.useEffect(()=>{Kn()},[]);const[O,A]=n.useState(!1);n.useEffect(()=>{new URLSearchParams(i.search).get("setup")==="true"&&A(!0)},[i.search]);const ue=n.useCallback(()=>{A(!1);const t=new URLSearchParams(window.location.search);if(t.has("setup")){t.delete("setup");const s=t.toString();l({pathname:window.location.pathname,search:s?`?${s}`:""},{replace:!0})}},[l]),[re]=ve(gn),G=n.useRef(!1);n.useEffect(()=>{const t=new URLSearchParams(i.search),s=t.get("session_id"),o=t.get("setup");!s||G.current||(G.current=!0,(async()=>{var a;try{const j=(a=(await re({variables:{sessionId:s}})).data)==null?void 0:a.retrieveCheckoutSession;if(j!=null&&j.success){const I=j.data;I!=null&&I.userPermissions&&u(rs(I.userPermissions)),u(os({UserActivePlan:{...f.UserActivePlan??{},hasCompletedInitialCheckout:!0}})),I!=null&&I.user&&u(os({username:I.user.username,lastname:I.user.lastname}))}try{await b({query:{disableCookieCache:!0}});const{data:I}=await Tn({query:{disableCookieCache:!0}}),ne=I==null?void 0:I.user;ne&&(u(Ln(ne)),ne.UserActivePlan&&u(rs(ne.UserActivePlan)),ne.clubDetails&&u(On(ne.clubDetails)))}catch(I){console.error("[EngineRoomHomeV2] BA refetch after checkout failed",I)}const F=new URLSearchParams(window.location.search);F.delete("session_id");const se=F.toString();l({pathname:window.location.pathname,search:se?`?${se}`:""},{replace:!0}),w({msg:"Congratulations! Your subscription has been activated.",variant:"success"}),o==="true"&&A(!0)}catch(x){console.error("[EngineRoomHomeV2] checkout-return handler failed",x),w({msg:"An error occurred. Please try again.",variant:"error"}),G.current=!1}})())},[i.search,re,b,u,f,l,w]);const D={sortBy:"position",sortOrder:"ASC"},[K,Re]=n.useState(!1),[Q,Ce]=n.useState({}),{data:M,loading:et,error:Ne,refetch:tt}=$(ln,{variables:{validSearchFiltersInput:{}},fetchPolicy:"cache-first"}),st=n.useMemo(()=>{var s;const t=(s=M==null?void 0:M.getValidSearchFilters)==null?void 0:s.data;return[...(t==null?void 0:t.Homepage)??[],Xe]},[M]),Y=!et&&(!!Ne||!!M&&((Qt=M.getValidSearchFilters)==null?void 0:Qt.data)==null),pe=n.useRef(!1);n.useEffect(()=>{Y&&!pe.current&&(pe.current=!0,_n(Ne??new Error("getValidSearchFilters returned null data"),{tags:{feature:"er-filters",surface:"home-v2"},extra:{input:"bulk"}})),Y||(pe.current=!1)},[Y,Ne]);const Ee=n.useMemo(()=>{const t=[];for(const[s,o]of Object.entries(Q))s!==Xe.name&&Array.isArray(o)&&o.length>0&&t.push(o);return t},[Q]),je=n.useMemo(()=>{const t=(Q[Xe.name]??[]).map(Number).filter(s=>!Number.isNaN(s));return t.length>0?t:Object.values(P)},[Q]),Le=n.useCallback((t,s)=>{Ce(o=>{const a=o[t]??[],x=a.includes(s)?a.filter(j=>j!==s):[...a,s];return{...o,[t]:x}})},[]),Oe=n.useCallback(()=>Ce({}),[]),[q,nt]=n.useState(!1),[me,Te]=n.useState([]),Ae=f.id,W=Ae!=null?Number(Ae):void 0,{data:V,loading:Me}=$(cn,{skip:!W,variables:{listCategoriesInput:{userId:W,pagination:!0,limit:100,offset:0,sortBy:D.sortBy,sortOrder:D.sortOrder,filter:{collectionTitle:"",tagIds:[]}}},fetchPolicy:"cache-first"}
2),d=(Q[Xe.name]??[]).length>0,g=k.trim().length>0||Ee.length>0||d,[v,he]=n.useState(24),[Fe,Cs]=n.useState({sortBy:"created_at",sortOrder:"DESC"});n.useEffect(()=>{he(24)},[k,Q]);const{data:ae,loading:_e}=$(ts,{skip:!W||!g,variables:{listCategoryCollectionsInput:{userId:W,limit:v,offset:0,sortBy:Fe.sortBy,sortOrder:Fe.sortOrder,filter:{tagIds:Ee,title:k,categoryIds:je}}},fetchPolicy:"cache-and-network"}),Ge=n.useMemo(()=>{var t,s;return((s=(t=ae==null?void 0:ae.getCategoryCollections)==null?void 0:t.data)==null?void 0:s.rows)??[]},[ae]),Be=((Xt=(Jt=ae==null?void 0:ae.getCategoryCollections)==null?void 0:Jt.data)==null?void 0:Xt.count)??0,{data:De,loading:vt,error:Ct}=$(ps,{skip:!W,variables:{singleRowInput:{id:as,collectionLimit:50,userId:W}},fetchPolicy:"cache-and-network",notifyOnNetworkStatusChange:!0}),We=n.useMemo(()=>{var t;return vt||Ct?[]:Bn((t=De==null?void 0:De.categoryDetails)==null?void 0:t.data,50)},[De,vt,Ct]),Nt=n.useMemo(()=>{var s,o;return(((o=(s=V==null?void 0:V.categoriesList)==null?void 0:s.data)==null?void 0:o.rows)??[]).filter(a=>a.id!==as).filter(a=>!(a.id===Se&&(a.likedCollectionCount??0)===0)).filter(a=>{var x;return!((x=a.title)!=null&&x.toLowerCase().includes("coming soon"))}).filter(a=>!is(a.title))},[V]),Ve=n.useMemo(()=>{var s,o,a;return(a=(((o=(s=V==null?void 0:V.categoriesList)==null?void 0:s.data)==null?void 0:o.rows)??[]).find(x=>is(x.title)))==null?void 0:a.id},[V]),[Et,Ns]=n.useState({}),[jt,Tt]=n.useState(()=>new Set),Es=n.useCallback((t,s)=>{Ns(o=>({...o,[t]:s}))},[]),ie=n.useMemo(()=>Nt.map(t=>{var a;const s=t.id===Se?"Liked Content":t.title,o=Et[t.id];if(t.id===Se){const x=(o==null?void 0:o.collections)??t.collections;if(x){const j=x.filter(se=>!jt.has(String(se.id))),F=x.length-j.length;return{...t,title:s,collections:j,collectionCount:Math.max(0,((o==null?void 0:o.collectionCount)??t.collectionCount)-F),likedCollectionCount:Math.max(0,((o==null?void 0:o.likedCollectionCount)??t.likedCollectionCount??t.collectionCount)-F)}}}return(a=o==null?void 0:o.collections)!=null&&a.length?{...t,title:s,collections:o.collections}:{...t,title:s}}),[Nt,Et,jt]),js={[P.PRACTICE_AND_DRILLS]:["practices"],[P.FULL_SESSIONS]:["full_sessions"],[P.SEASON_PLANS]:["session_plans"],[P.WEEK_PLANS_46]:["session_plans"],[P.FORMATIONS_TACTICS]:["tactics","formations"],[P.POSITION_SPECIFIC]:["player_development"]},rt=n.useMemo(()=>{const t=(()=>{const{primaryInterests:o}=bs();if(!o.length)return ie;const a=o.flatMap(j=>Qn[j]??[]);if(!a.length)return ie;const x=j=>{if(j.id===Se)return-1/0;const F=js[Number(j.id)];return F?F.reduce((se,I)=>{const ne=a.indexOf(I);return ne===-1?se:Math.min(se,ne)},1/0):1/0};return[...ie].sort((j,F)=>x(j)-x(F))})(),s=o=>{var a;return o.id===Se?0:Number(o.id)===Number(P.PRACTICE_AND_DRILLS)?1:Number(o.id)===Number(P.FULL_SESSIONS)?2:(a=o.title)!=null&&a.toLowerCase().includes("practice shorts")?9999:100};return[...t].sort((o,a)=>s(o)-s(a))},[ie]),ot=n.useMemo(()=>Xs(rt),[rt]),at=n.useCallback(t=>{l(`/categories/${t}`)},[l]);n.useEffect(()=>{const t=N.current;if(!t)return;const s=()=>{var x;const a=y?53:((x=E.current)==null?void 0:x.offsetHeight)??0;t.style.setProperty("--er-jump-offset",`${a+8}px`)};s();let o;return!y&&E.current&&"ResizeObserver"in window&&(o=new ResizeObserver(s),o.observe(E.current)),()=>o==null?void 0:o.disconnect()},[y]);const[B,fe]=n.useState(null),ge=n.useCallback(t=>{var s,o;if(L==null||L(t),c){const a=t.content_type==="collection"?t.id:((o=(s=t.videos)==null?void 0:s[0])==null?void 0:o.id)??t.id;l(`/collections?${Ze(t.title,a,t.id,t.content_type??"collection")}`);return}fe(t)},[L,c,l]),Ts=n.useCallback(()=>fe(null),[]),[_s,it]=n.useState([]),[Is,_t]=n.useState(null);n.useEffect(()=>{if(!(B!=null&&B.id)){it([]),_t(null);return}let t=!1;return _t(B.likes??null),r.query({query:dn,variables:{collectionLinkedDataInput:{collectionId:B.id}},fetchPolicy:"no-cache"}).then(s=>{var a,x;if(t)return;const o=((x=(a=s.data)==null?void 0:a.getCollectionCategories)==null?void 0:x.categories)??[];it(o)}).catch(()=>{t||it([])}),()=>{t=!0}},[B,r]);const Ps=n.useCallback(t=>{fe(null),l(`/categories/${t}`)},[l]),[xe,Rs]=n.useState(null),oe=n.useCallback(t=>{L==null||L(t),fe(t)},[L]),lt=n.useCallback(()=>Rs(null),[]),[Ue,He]=n.useState([]),[It,ct]=n.useState(!1),[Ls,dt]=n.useState(!1),J=n.useCallback(t=>{He([t]),fe(null),ct(!0)},[]),X=n.useCallback(t=>{He([t]),fe(null),dt(!0)},[]),Os=n.useCallback(()=>ct(!1),[]),As=n.useCallback(()=>dt(!1),[]),Ms=n.useMemo(()=>Ue.flatMap(t=>t.videos??[]).map(t=>
2t.id).filter(t=>t!=null),[Ue]),Pt=n.useMemo(()=>Ue.map(t=>t.id).filter(t=>t!=null),[Ue]),Fs=$s(Pt,It),[Rt,Lt]=n.useState({}),[Ot]=ve(xn),[$e]=ve(bn),[At]=ve(yn),{data:Ye,refetch:qe}=$(un,{skip:!W,variables:{saveForLaterLiteInput:{type:Je.ENGINE_ROOM_COLLECTION}},fetchPolicy:"cache-and-network"}),ut=n.useMemo(()=>{var t,s;return((s=(t=Ye==null?void 0:Ye.saveForLaterEntriesLite)==null?void 0:t.data)==null?void 0:s.savedForLaterEntries)??[]},[Ye]),be=n.useMemo(()=>{const t=new Map;return ut.forEach(s=>t.set(s.collectionId,s.id)),t},[ut]),{data:ze}=$(pn,{skip:!W||ut.length===0,variables:{saveForLaterListInput:{limit:10,offset:0,filters:{type:[Je.ENGINE_ROOM_COLLECTION]}}},fetchPolicy:"cache-and-network"}),Mt=n.useMemo(()=>{var s,o;return(((o=(s=ze==null?void 0:ze.saveForLaterEntries)==null?void 0:s.data)==null?void 0:o.rows)??[]).filter(a=>a==null?void 0:a.collection).map(a=>a.collection)},[ze]),U=n.useCallback(t=>Rt[t.id]??t.isLikedByUser??!1,[Rt]),Z=n.useCallback(t=>be.has(t.id),[be]),ee=n.useCallback(async t=>{const s=!U(t);Lt(o=>({...o,[t.id]:s})),Tt(o=>{const a=new Set(o);return s?a.delete(String(t.id)):a.add(String(t.id)),a});try{await Ot({variables:{likeCollectionInput:{id:t.id,status:s}}}),w({msg:s?"Added to My Liked Content":"Removed from My Liked Content",variant:"success"})}catch(o){console.error("[EngineRoomHomeV2] like failed",o),Lt(a=>({...a,[t.id]:!s})),Tt(a=>{const x=new Set(a);return s?x.add(String(t.id)):x.delete(String(t.id)),x}),w({msg:"Could not update like. Try again.",variant:"error"})}},[U,Ot,w]),te=n.useCallback(async t=>{const s=be.get(t.id);try{s?(await At({variables:{deleteSaveForLaterItemInput:{ids:[s]}}}),w({msg:"Removed from saved",variant:"success"})):(await $e({variables:{createSaveForLaterItemInput:{type:Je.ENGINE_ROOM_COLLECTION,item_id:t.id}}}),w({msg:"Saved for later",variant:"success"})),await qe()}catch(o){console.error("[EngineRoomHomeV2] save toggle failed",o),w({msg:"Could not update save. Try again.",variant:"error"})}},[be,At,$e,qe,w]),H=n.useCallback(t=>{var a,x;const s=t.content_type==="collection"?t.id:((x=(a=t.videos)==null?void 0:a[0])==null?void 0:x.id)??t.id,o=Ze(t.title,s,t.id,t.content_type??"collection");l(`/collections?${o}`)},[l]),{inProgress:Ft}=Mn(),ye=n.useCallback(t=>me.some(s=>s.id===t.id),[me]),ke=n.useCallback(t=>{Te(s=>s.some(o=>o.id===t.id)?s.filter(o=>o.id!==t.id):[...s,t])},[]),Gs=n.useCallback(()=>{Te([]),nt(!1)},[]),Bs=n.useCallback(()=>{Te([])},[]),Gt=n.useCallback(t=>{t.length&&(He(t),ct(!0))},[]),Bt=n.useCallback(t=>{t.length&&(He(t),dt(!0))},[]),Dt=n.useCallback(async t=>{const s=t.filter(o=>!be.has(o.id));for(const o of s)try{await $e({variables:{createSaveForLaterItemInput:{type:Je.ENGINE_ROOM_COLLECTION,item_id:o.id}}})}catch(a){console.error("[EngineRoomHomeV2] bulk save failed",a)}s.length?(await qe(),w({msg:`Saved ${s.length} item${s.length===1?"":"s"}`,variant:"success"})):w({msg:"All selected items already saved",variant:"info"})},[be,$e,qe,w]),Wt=n.useMemo(()=>ie.filter(t=>t.id!==Se),[ie]),z=n.useMemo(()=>{const t=new Set,s=[];return Wt.forEach(o=>{(o.collections??[]).forEach(a=>{t.has(a.id)||(t.add(a.id),s.push(a))})}),s},[Wt]),Ie=n.useMemo(()=>kr(Ft,z,R),[Ft,z,R]),Ke=n.useMemo(()=>new Map(Ie.map(t=>[String(t.id),t])),[Ie]),Vt=n.useCallback(t=>{var x,j;const s=Ke.get(String(t.id));if(!s){H(t);return}const o=s.playback.videoId??((j=(x=t.videos)==null?void 0:x[0])==null?void 0:j.id)??t.id,a=Ze(t.title,o,t.id,"video");l(`/collections?${a}&context=collection`)},[Ke,H,l]),[Ut,Ds]=n.useState({}),Ht=n.useRef(new Set),$t=n.useMemo(()=>{const t=new Map(z.map(s=>[String(s.id),s]));return R.map(s=>{const o=t.get(String(s.id)),a=Ut[String(s.id)];return!o&&!a?s:{...s,visits:(o==null?void 0:o.visits)??(a==null?void 0:a.visits)??s.visits,average_rating:(o==null?void 0:o.average_rating)??(a==null?void 0:a.average_rating)??s.average_rating,totalRatings:(o==null?void 0:o.totalRatings)??(a==null?void 0:a.totalRatings)??s.totalRatings}})},[R,z,Ut]);n.useEffect(()=>{const t=new Set(z.map(o=>String(o.id))),s=R.filter(o=>!t.has(String(o.id))&&!Ht.current.has(String(o.id)));s.length&&(s.forEach(o=>
2Ht.current.add(String(o.id))),s.forEach(o=>{r.query({query:mn,variables:{id:Number(o.id)},fetchPolicy:"cache-first"}).then(a=>{var j,F;const x=(F=(j=a.data)==null?void 0:j.collectionDetailsLite)==null?void 0:F.data;x&&Ds(se=>({...se,[String(o.id)]:{visits:x.visits,average_rating:x.average_rating,totalRatings:x.totalRatings}}))}).catch(()=>{})}))},[R,z,r]);const Qe=n.useMemo(()=>[...z].sort((t,s)=>(s.visits??0)-(t.visits??0)).slice(0,8),[z]),Yt=n.useMemo(()=>{const t=new Set([...We.map(s=>s.id),...R.map(s=>s.id),...Mt.map(s=>s.id),...Qe.slice(0,4).map(s=>s.id)]);return z.filter(s=>!t.has(s.id)).sort((s,o)=>{const a=(s.average_rating??0)*4+Math.min((s.visits??0)/100,1)*5;return(o.average_rating??0)*4+Math.min((o.visits??0)/100,1)*5-a}).slice(0,8)},[z,We,R,Mt,Qe]),qt=n.useMemo(()=>We.slice(0,3),[We]),{data:le}=$(ts,{variables:{listCategoryCollectionsInput:{userId:f==null?void 0:f.id,limit:8,offset:0,sortBy:"manual",sortOrder:"ASC",filter:{categoryIds:[Ve],tagIds:[],title:""}}},skip:!(f!=null&&f.id)||Ve==null,fetchPolicy:"network-only"}),pt=n.useMemo(()=>{var t,s;return((s=(t=le==null?void 0:le.getCategoryCollections)==null?void 0:t.data)==null?void 0:s.rows)??[]},[le]),Ws=(es=(Zt=le==null?void 0:le.getCategoryCollections)==null?void 0:Zt.data)==null?void 0:es.count,zt=pt,mt=Ie,[Vs,,ht,,ft,gt]=n.useMemo(()=>Dn([qt,Ie,Yt,pt,$t,Qe]),[Ie,qt,pt,$t,Qe,Yt]),Us=g&&!_e&&Ge.length===0,Kt=n.useCallback(()=>{S(""),Ce({})},[S]);return e.jsxs("div",{ref:N,className:"er-v2 min-h-screen bg-bg text-fg font-body",children:[!c&&e.jsxs("div",{className:"px-7 pt-3 pb-1",children:[e.jsx("h2",{className:"font-head font-bold uppercase text-[24px] lg:text-[36px] tracking-wide2 leading-[1] text-fg",children:"Engine Room"}),e.jsx("p",{className:"mt-1.5 hidden font-body text-[15px] font-normal normal-case tracking-normal leading-snug text-muted sm:block",children:"Browse the whole Touchtight video library of 2000+ coaching sessions and practices, and drop any of them straight into your own training plans."}),e.jsx("p",{className:"mt-1.5 font-body text-[13px] font-normal normal-case tracking-normal leading-snug text-muted sm:hidden",children:"Browse 2000+ Touchtight sessions."})]}),e.jsxs("div",{ref:E,className:"sticky top-0 z-[12] bg-bg",children:[!p&&e.jsx(yt,{className:"px-4 md:px-7",links:ot,onJump:at}),!c&&e.jsx("div",{"data-tour-id":"er-playlist",children:e.jsx(Cr,{hideTitle:!0,searchValue:k,onSearchChange:S,activeFilterCount:Ee.reduce((t,s)=>t+s.length,0),onOpenFilters:()=>Re(!0)})}),p&&!y&&e.jsx(yt,{className:"px-4 md:px-7",links:ot,onJump:at})]}),y&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed left-0 right-0 z-[11] bg-bg border-b border-hairline",style:{top:"var(--shell-top, 0px)"},children:e.jsx(yt,{className:"px-4",links:ot,onJump:at})}),e.jsx("div",{"aria-hidden":!0,className:"h-[53px]"})]}),e.jsx(Nr,{clubId:(h==null?void 0:h.id)??null,onboardingCompleted:(h==null?void 0:h.is_onboarding_completed)??!1,onOpenStep:t=>{t==="team"||t==="players"?l("/dugout/teams"):t==="objectives"?l("/dugout/players"):(t==="sessions"||t==="videos")&&l("/dugout/sessions")}}),xs?e.jsxs(e.Fragment,{children:[e.jsx(Ar,{requestToken:C,onRequestHandled:()=>_(t=>t+1)}),e.jsx(Rr,{onSetPreferences:()=>m(t=>t+1),openPreferencesToken:T})]}):null,g?_e&&!Ge.length?e.jsx("div",{className:"px-4 md:px-7 pt-16 pb-32 flex justify-center",children:e.jsx("span",{className:"font-mono text-[11px] uppercase tracking-wide10 text-subtle",children:"Searching…"})}):Us?e.jsx("div",{className:"px-4 md:px-7 pt-10 pb-32",children:e.jsx(Ks,{eyebrow:"NO MATCHES",title:"Nothing matches that search",description:k.trim()?e.jsxs(e.Fragment,{children:["No drills, sessions or collections matched ",e.jsxs("span",{className:"text-fg",children:["“",k.trim(),"”"]}),". Try a different term or clear your filters to see the full library."]}):"No content matched the filters you’ve applied. Adjust or clear them to see the full library.",actions:e.jsx(Qs,{onClick:Kt,children:"Clear search"})})}):e.jsxs("div",{className:"px-4 md:px-7 pt-6 pb-32",children:[e.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[e.jsx("h2",{className:"font-head font-bold uppercase text-[20px] tracking-wide2 leading-[1] text-fg",children:"Results"}),e.jsx(Js,{size:"md",count:Be,label:Be===1?"match":"matches"}),e.jsx("span",{className:"flex-1 h-px bg-hairline"}),e.jsx(Zs,{sortBy:Fe.sortBy,sortOrder:Fe.sortOrder,onChange:(t,s)=>{Cs({sortBy:t,sortOrder:s}),he(24)},hasAgeGroupFilter:!1,hasNumberOfPlayersFilter:!1,hasPitchSizeFilter:!1,isPracticeAndDrills:!1,compact:!0}),e.jsx("button",{type:"button",onClick:Kt,className:"font-head uppercase text-[12px] tracking-wide8 text-subtle hover:text-fg transition-colors bg-transparent border-0 cursor-pointer",children:"Clear"})]}),e.jsx("div",{className:"responsive-practice-grid",children:Ge.map((t,s)=>e.jsx(tr,{item:t,index:s,fillCell:!0,onOpen:ge,onPlayClick:H,detailFirst:!0,isLiked:U(t),isSaved:Z(t),onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelected:ye(t),onToggleSelect:ke},t.id))}),Ge.length<Be&&e.jsx("div",{className:"flex justify-center pt-8",children:e.jsx("button",{type:"button",onClick:()=>he(t=>t+24),disabled:_e,className:"font-head uppercase text-[13px] tracking-wide8 text-fg bg-card border border-tt-border rounded-[2px] px-5 py-2.5 cursor-pointer hover:border-fg transition-colors disabled:opacity-50",children:_e?"Loading…":"Load more"})})]}):Me&&!ie.length?e.jsx(Wn,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-7 pt-4 pb-4",children:e.jsx(Vn,{items:Vs,onOpen:H})}),e.jsxs("div",{children:[ht.length>0&&e.jsx(we,{title:"Recommended for you",kicker:"Highly rated picks you haven't watched or saved.",count:ht.length,items:ht,onOpen:ge,onPlayClick:H,isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelectedFor:ye,onToggleSelect:ke}),mt.length>0&&e.jsx(we,{title:"Continue watching",kicker:"Pick up on this device.",count:mt.length,items:mt,onOpen:Vt,onPlayClick:Vt,playbackProgressFor:t=>{var s;return(s=Ke.get(String(t.id)))==null?void 0:s.playback.progress},contextLabelFor:t=>{var o;const s=(o=Ke.get(String(t.id)))==null?void 0:o.playback;return s?Sr(s.playedSeconds,s.duration):null},isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelectedFor:ye,onToggleSelect:ke}),zt.length>0&&e.jsx(we,{title:"Latest releases",kicker:"Fresh drops: the newest additions to the library.",count:Ws??0,items:zt,seeAllHref:Ve!=null?`/categories/${Ve}`:void 0,onOpen:ge,onPlayClick:H,contextLabelFor:()=>"New release",isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelectedFor:ye,onToggleSelect:ke}),ft.length>0&&e.jsx(we,{title:"Recently viewed",kicker:"Pick up where you left off.",count:ft.length,items:ft,onOpen:ge,onPlayClick:H,contextLabelFor:()=>"Viewed recently",isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelectedFor:ye,onToggleSelect:ke}),gt.length>0&&e.jsx(we,{title:"Popular",kicker:"What other coaches are reaching for this week.",count:gt.length,items:gt,onOpen:ge,onPlayClick:H,contextLabelFor:()=>"Popular with coaches",isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,selectMode:q,isSelectedFor:ye,onToggleSelect:ke})]}),e.jsx("div",{className:"pb-32",children:rt.map((t,s)=>{const o=t.collections??[];return(t.collectionCount??o.length)===0?e.jsxs("section",{id:`category-${t.id}`,className:"pb-4",style:{scrollMarginTop:"calc(var(--shell-top, 52px) + var(--er-jump-offset, 60px))"},children:[e.jsxs("div",{className:"px-7 mb-4 flex items-baseline gap-3",children:[e.jsx("span",{className:"font-mono text-[10.5px] uppercase tracking-wide12 text-accent-2",children:String(s+1).padStart(2,"0")}),e.jsx("h2",{className:"font-head font-bold uppercase text-[22px] tracking-wide4 text-fg whitespace-nowrap",children:xr(t.title)}),e.jsx("span",{className:"flex-1 h-px bg-hairline ml-2"})]}
2),e.jsx(jr,{shelfNumber:s+1,variant:Fr(t.title),onCta:()=>l(`/categories/${t.id}`)})]},t.id):e.jsx(wr,{row:t,userId:W,onDetailLoaded:Es,eager:s<Mr,anchorId:`category-${t.id}`,shelfNumber:s+1,title:t.title,kicker:Gr(t.title,t.collectionCount??o.length),count:t.collectionCount??o.length,seeAllHref:`/categories/${t.id}`,onOpen:ge,onPlayClick:H,isLikedFor:U,isSavedFor:Z,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X},t.id)})})]}),e.jsx(Tr,{clubId:(h==null?void 0:h.id)??null,onboardingCompleted:(h==null?void 0:h.is_onboarding_completed)??!1}),e.jsx(en,{open:B!==null,item:B,onClose:Ts,onOpenDetail:H,isLiked:B?U(B):!1,isSaved:B?Z(B):!1,onToggleLike:ee,onToggleSave:te,onPlayTrailer:oe,onAddToSession:J,onAddToPlaylist:X,categories:_s,onCategoryClick:Ps,likesCount:Is}),e.jsx(or,{open:xe!==null,item:xe,onClose:lt,onOpenDetail:t=>{lt(),H(t)},isLiked:xe?U(xe):!1,isSaved:xe?Z(xe):!1,onToggleLike:ee,onToggleSave:te,onAddToSession:J,onCreateSession:t=>{lt(),l("/engine-room/build-session",{state:{seedPractice:t}})},onAddToPlaylist:X}),e.jsx(Hs,{open:It,handleClose:Os,videoIds:Ms,setSelectedCollectionIds:()=>{},workflow:"ENGINE_ROOM",practiceTypeByVideoId:Fs}),e.jsx(Jn,{open:Ls,onClose:As,collectionIds:Pt}),!c&&e.jsx(tn,{open:K,onClose:()=>Re(!1),filterGroups:st,selectedTags:Q,onToggleTag:Le,onClearAll:Oe,resultCount:g?Be:void 0,resultLoading:_e,loadError:Y,onRetry:()=>tt()}),c?e.jsx(sr,{selected:me,onClear:Bs,onBulkSave:Dt,onBulkAddToPlaylist:Bt,onBulkAddToSession:Gt}):e.jsx(vr,{selected:me,onClear:Gs,onBulkAddToSession:Gt,onBulkAddToPlaylist:Bt,onBulkSave:Dt}),e.jsx(zs,{open:O,onClose:ue})]})}export{Wa 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.