PageSourceSearch

https://fit4tennis.com/_next/static/chunks/2932-86ef24e9422985c9.js

js fit4tennis.com collected 2026-10-02 00:49:58 UTC 29,292 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2932],{12635:(e,t,n)=>{n.d(t,{F4TVideoPlayer:()=>i});var s=n(40264),r=n(97333),a=n(42936);function i({playbackId:e,title:t,poster:n,tokens:l,className:o,onEnded:d,onTimeUpdate:c,muted:u,autoPlay:m,loop:x,playsInline:f,playerRef:h,onPlay:p,onPause:b,hideControls:y,fill:w}){let g=function({fill:e,hideControls:t}){let n=e?{position:"absolute",inset:0,width:"100%",height:"100%","--media-object-fit":"cover","--media-object-position":"center"}:{aspectRatio:"16 / 9",width:"100%",borderRadius:"0.5rem",overflow:"hidden"};return t?{...n,"--controls":"none"}:n}({fill:w,hideControls:y});return(0,s.jsx)(r.Ay,{ref:h,playbackId:e,tokens:l,metadata:{video_title:t??"Fit4Tennis"},streamType:"on-demand",accentColor:a.QY.yellow,defaultHiddenCaptions:!0,muted:u,autoPlay:m,loop:x,playsInline:f,nohotkeys:y,poster:n,className:o,onEnded:d,onPlay:p,onPause:b,onTimeUpdate:c?e=>{let t=e.currentTarget;t&&Number.isFinite(t.duration)&&c(t.currentTime,t.duration)}:void 0,style:g})}},35222:(e,t,n)=>{n.d(t,{A:()=>l});var s=n(40264),r=n(36932),a=n(51191);let i=["shoulder","elbow","wrist","back","hip","knee","ankle"];function l({workoutId:e,onDone:t,recordedCompleted:n}){let[o,d]=(0,r.useState)(n??!0),[c,u]=(0,r.useState)(5),[m,x]=(0,r.useState)(3),[f,h]=(0,r.useState)(4),[p,b]=(0,r.useState)([]),[y,w]=(0,r.useState)(""),[g,v]=(0,r.useState)("idle");async function j(){if("saving"!==g){v("saving");try{let s=await fetch("/api/member/session-signal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workout_id:e??null,completed:n??o,rpe:c,technique_confidence:m,enjoyment:f,sore_regions:p,competition_date:y||null})});if(!s.ok){let e=await s.json().catch(()=>({}));console.error("[SessionCheckin] session-signal write failed",s.status,e?.error),v("error");return}v("done"),t?.()}catch(e){console.error("[SessionCheckin] session-signal network error",e),v("error")}}}return"done"===g?(0,s.jsxs)("div",{className:"rounded-lg border border-performance-yellow/30 bg-charcoal p-6 text-center",children:[(0,s.jsx)("p",{className:"text-lg font-semibold text-performance-yellow",children:"Got it. Thank you."}),(0,s.jsx)("p",{className:"mt-1 text-sm text-off-white/70",children:"We'll use this to keep your next session safe and smart."})]}):(0,s.jsxs)("div",{className:"rounded-lg border border-off-white/10 bg-charcoal p-6",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-off-white",children:"How'd that feel?"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-off-white/60",children:"Four quick taps so your coach can tune what's next."}),(0,s.jsxs)("div",{className:"mt-6 space-y-6",children:[(0,s.jsxs)("fieldset",{children:[(0,s.jsx)("legend",{className:"text-sm font-medium text-off-white/90",children:"Did you finish?"}),(0,s.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>d(!0),"aria-pressed":(n??o)===!0,disabled:void 0!==n,className:(0,a.cn)("min-h-[44px] rounded-md border px-4 py-3 text-sm font-medium transition-colors",n??o?"border-performance-yellow bg-performance-yellow/10 text-performance-yellow":"border-off-white/15 text-off-white/70 hover:border-off-white/30",void 0!==n&&"cursor-default"),children:"Finished it"}),(0,s.jsx)("button",{type:"button",onClick:()=>d(!1),"aria-pressed":(n??o)===!1,disabled:void 0!==n,className:(0,a.cn)("min-h-[44px] rounded-md border px-4 py-3 text-sm font-medium transition-colors",n??o?"border-off-white/15 text-off-white/70 hover:border-off-white/30":"border-performance-yellow bg-performance-yellow/10 text-performance-yellow",void 0!==n&&"cursor-default"),children:"Cut it short"})]}),void 0!==n?(0,s.jsx)("p",{className:"mt-2 text-xs text-off-white/50",children:"Based on the exercises recorded by your player."}):null]}),(0,s.jsxs)("fieldset",{children:[(0,s.jsx)("legend",{className:"text-sm font-medium text-off-white/90",children:"How confident did your movement feel?"}),(0,s.jsx)("div",{className:"mt-2 grid grid-cols-5 gap-2","aria-label":"Technique confidence",children:[1,2,3,4,5].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>x(e),"aria-pressed":m===e,"aria-label":`Technique confidence ${e} of 5`,className:(0,a.cn)("min-h-[44px] rounded-md border text-sm font-semibold transition-colors",m===e?"border-performance-yellow bg-performance-yellow/10 text-performance-yellow":"border-off-white/15 text-off-white/70 hover:border-off-white/30"),children:e},e))}),(0,s.jsxs)("div",{className:"mt-1 flex justify-between text-xs text-off-white/40",children:[(0,s.jsx)("span",{children:"Unsure"}),(0,s.jsx)("span",{children:"Sharp"})]})]}),(0,s.jsxs)("fieldset",{children:[(0,s.jsx)("legend",{className:"text-sm font-medium text-off-white/90",children:"Did you enjoy it?"}
1),(0,s.jsx)("div",{className:"mt-2 grid grid-cols-5 gap-2","aria-label":"Session enjoyment",children:[1,2,3,4,5].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>h(e),"aria-pressed":f===e,"aria-label":`Session enjoyment ${e} of 5`,className:(0,a.cn)("min-h-[44px] rounded-md border text-sm font-semibold transition-colors",f===e?"border-performance-yellow bg-performance-yellow/10 text-performance-yellow":"border-off-white/15 text-off-white/70 hover:border-off-white/30"),children:e},e))}),(0,s.jsxs)("div",{className:"mt-1 flex justify-between text-xs text-off-white/40",children:[(0,s.jsx)("span",{children:"Not for me"}),(0,s.jsx)("span",{children:"Loved it"})]})]}),(0,s.jsxs)("fieldset",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("legend",{className:"text-sm font-medium text-off-white/90",children:"How hard? 1–10"}),(0,s.jsx)("span",{className:"text-base font-semibold text-performance-yellow","aria-live":"polite",children:c})]}),(0,s.jsx)("div",{className:"mt-2 flex min-h-[44px] items-center",children:(0,s.jsx)("input",{type:"range",min:1,max:10,step:1,value:c,onChange:e=>u(Number(e.target.value)),"aria-label":"How hard the session felt, 1 to 10",className:"h-2 w-full cursor-pointer appearance-none rounded-full bg-off-white/15 accent-performance-yellow"})}),(0,s.jsxs)("div",{className:"mt-1 flex justify-between text-xs text-off-white/40",children:[(0,s.jsx)("span",{children:"Easy"}),(0,s.jsx)("span",{children:"All out"})]})]}),(0,s.jsxs)("fieldset",{children:[(0,s.jsx)("legend",{className:"text-sm font-medium text-off-white/90",children:"Anything sore?"}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:i.map(e=>{let t=p.includes(e);return(0,s.jsx)("button",{type:"button",onClick:()=>{b(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":t,className:(0,a.cn)("min-h-[44px] rounded-full border px-4 py-2 text-sm capitalize transition-colors",t?"border-performance-yellow bg-performance-yellow/10 text-performance-yellow":"border-off-white/15 text-off-white/70 hover:border-off-white/30"),children:e},e)})})]}),(0,s.jsxs)("fieldset",{children:[(0,s.jsxs)("label",{htmlFor:"session-checkin-competition-date",className:"text-sm font-medium text-off-white/90",children:["Next match? ",(0,s.jsx)("span",{className:"text-off-white/40",children:"(optional)"})]}),(0,s.jsx)("input",{id:"session-checkin-competition-date",type:"date",value:y,onChange:e=>w(e.target.value),className:"mt-2 block min-h-[44px] w-full rounded-md border border-off-white/15 bg-transparent px-3 py-2 text-sm text-off-white focus:border-performance-yellow focus:outline-none"})]})]}),"error"===g&&(0,s.jsx)("p",{className:"mt-4 text-sm text-red-400",role:"alert",children:"Feedback wasn't saved. Try again, or skip for now."}),(0,s.jsx)("button",{type:"button",onClick:j,disabled:"saving"===g,className:"mt-6 min-h-[44px] w-full rounded-md bg-performance-yellow px-4 py-3 text-sm font-semibold text-charcoal transition-opacity hover:opacity-90 disabled:opacity-50",children:"saving"===g?"Saving…":"Done"}),(0,s.jsx)("button",{type:"button",onClick:()=>t?.(),className:"mt-3 min-h-[44px] w-full text-sm text-off-white/50 transition-colors hover:text-off-white/80",children:"Skip for now"})]})}},42936:(e,t,n)=>{n.d(t,{QY:()=>s});let s={navy:"#373B48",yellow:"#F7E645",yellowHover:"#FFF06E",gray:"#949597",rose:"#7F4D53",sage:"#81856F",cream:"#CFC486",ink:"#1B1E26",paper:"#FAFAF7",bone:"#F1EFE7",line:"#D8D9DC",mute:"#888D9A",mutedInk:"#6B6E75",mutedOnDark:"#A3A5A8",white:"#FFFFFF"};s.paper,s.ink,s.mutedInk,s.yellow,s.ink,s.ink,s.paper,s.mute,s.line},44536:(e,t,n)=>{n.d(t,{$:()=>o});var s=n(40264);n(36932);var r=n(25587),a=n(53744),i=n(51191);let l=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",brand:"bg-yellow text-navy font-semibold hover:bg-yellow/90 focus-visible:ring-yellow/50"},size:{default:"min-h-11 px-4 py-2 has-[>svg]:px-3",sm:"min-h-11 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"min-h-11 rounded-md px-6 has-[>svg]:px-4",icon:"size-11","icon-sm":"size-11","icon-lg":"size-12"}},defaultVariants:{variant:"default",size:"default"}});function o({className:e,variant:t,size:n,asChild:a=!1,...d}){let c=a?r.DX:"button";return(0,s.jsx)(c,{"data-slot":"button",className:(0,i.cn)(l({variant:t,size:n,className:e})),...d})}},51191:(e,t,n)=>{n.d(t,{cn:()=>a});var s=n(3934),r=n(74066);function a(...e){return(0,r.QP)((0,s.$)(e))}},62932:(e,t,n)=>{n.d(t,{jd:()=>N});var s=n(40264),r=n(36932),a=n(56066),i=n(30519),l=n(44536),o=n(78276),d=n(51191);function c({className:e,value:t,...n}){return(0,s.jsx)(o.bL,{"data-slot":"progress",className:(0,d.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:(0,s.jsx)(o.C1,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}var u=n(12635),m=n(4678),x=n(35222);function f({title:e,workoutId:t,usesInlineCheckin:n,checkinComplete:r,onCheckinDone:a,onRestart:o,onClose:d,summary:c}){let u=Math.floor(c.elapsedSeconds/60),h=c.elapsedSeconds%60;return(0,s.jsxs)(i.P.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"border border-white/10 bg-fit4tennis-black p-6 text-center sm:p-8",children:[(0,s.jsx)(i.P.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",delay:.2},className:"mx-auto mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-fit4tennis-yellow",children:(0,s.jsx)(m.O,{name:"check",size:40,className:"text-fit4tennis-black"})}),(0,s.jsx)("h2",{className:"font-display text-3xl text-white mb-2",children:c.allExercisesCompleted?"Workout complete":"Session ended"}),(0,s.jsxs)("p",{className:"mx-auto mb-6 max-w-lg text-muted-on-dark",children:[c.allExercisesCompleted?`You finished ${e}.`:`You completed ${c.completedExerciseIds.length} of ${c.totalExercises} exercises in ${u}:${h.toString().padStart(2,"0")}.`," ","Tell us how it felt so your feedback is available for the next session."]}),n&&!r?(0,s.jsx)("div",{className:"mx-auto max-w-xl text-left",children:(0,s.jsx)(x.A,{workoutId:t,recordedCompleted:c.allExercisesCompleted,onDone:a})}):(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 justify-center",children:[(0,s.jsxs)(l.$,{type:"button",variant:"outline",onClick:o,className:"min-h-11 border-white/20 text-white hover:bg-white/10 bg-transparent",children:[(0,s.jsx)(m.O,{name:"refresh",size:18}),"Do Again"]}),d?(0,s.jsx)(l.$,{type:"button",onClick:d,className:"min-h-11 bg-fit4tennis-yellow text-fit4tennis-black hover:bg-fit4tennis-yellow/90",children:"Done"}):null]})]})}let h=["warm-up","main","cool-down"],p={"warm-up":"Warm-Up",main:"Main","cool-down":"Cool-Down"};function b({exercises:e,currentIndex:t,completedIndexes:n,onJump:r}){return(0,s.jsx)("div",{className:"p-4 border-t border-white/10 bg-white/5 space-y-3",children:h.map(a=>{let i=e.map((e,t)=>({exercise:e,index:t})).filter(({exercise:e})=>(e.segment??"main")===a);return 0===i.length?null:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-muted-on-dark text-[11px] font-medium uppercase tracking-wide mb-1.5",children:p[a]}),(0,s.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 scrollbar-hide",children:i.map(({exercise:e,index:a})=>{let i=a===t,l=n.has(a);return(0,s.jsxs)("button",{type:"button",onClick:()=>r(a),"aria-current":i?"step":void 0,className:`min-h-11 flex-shrink-0 rounded-md px-4 py-2 text-sm transition-colors ${i?"bg-fit4tennis-yellow text-fit4tennis-black font-medium":l?"bg-sage/20 text-olive-on-dark":"bg-white/10 text-muted-on-dark hover:bg-white/20 hover:text-white"}`,children:[l?(0,s.jsx)(m.O,{name:"check",size:14,className:"mr-1 inline"}):null,e.name]},e.id||a)})})]},a)})})}function y(e,t,n){let s=Math.max(0,(n-e.anchorMs)/1e3),r=Math.min(t,e.bankedSeconds+s);return{elapsedSeconds:r,remainingSeconds:Math.max(0,t-r),isComplete:r>=t}}var w=n(69271);let g={"warm-up":"Warm-Up",main:"Main","cool-down":"Cool-Down"};function v(e,t,n){let s=Array.from(new Set(t)).filter(t=>Number.isInteger(t)&&t>=0&&t<e.length).sort((e,t)=>e-t);return{completedExerciseIds:s.map(t=>e[t].id),completedExerciseIndexes:s,elapsedSeconds:Math.floor(e.reduce((e,t,s)=>{let r=Number(n[s]??0);return e+Math.max(0,Math.min(t.duration,Number.isFinite(r)?r:0))},0)),totalExercises:e.length,allExercisesCompleted:e.length>0&&s.length===e.length}}async function j(e,t,n){var s,r,a;let i=await fetch("/api/mux/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((s=e,r=t,(a=n)?"program"===a.context?{playbackId:s,context:"program",programId:a.programId,sessionId:a.sessionId}:"generated"===a.context||"match-prep"===a.context?{playbackId:s,context:a.context,sessionId:a.sessionId}:a.sessionId?{playbackId:s,context:"baseline",sessionId:a.sessionId}:{playbackId:s,context:"baseline"}:r?{playbackId:s,workoutId:r}:{playbackId:s}))}),l=await i.json().catch(()=>({}));if((0,w.Np)(i.status,l.error))throw Error(w.MG);if(!i.ok)throw Error(`Mux token mint failed (${i.status}): ${l.error??"unknown"}`);return l}async function k(e,t,n,s){try{let r=await n();if(e.current!==t)return;s.onSuccess(r),s.onSettled()}catch(r){if(e.current!==t)return;let n=r instanceof Error?r.message:"Token error";s.onError(n,n===w.MG),s.onSettled(),e.current=null}}function N({title:e,duration:t,exercises:n,workoutId:o,playbackContext:d,initialExerciseIndex:x=0,initialCompletedIndexes:h=[],onProgressChange:p,onComplete:S,onClose:I,completionCheckin:C,resumeKey:E}){let M=Math.max(0,Math.min(n.length,x)),$=new Set(h.filter(e=>Number.isInteger(e)&&e>=0&&e<n.length)),F=Math.min(M,Math.max(0,n.length-1)),A=n.reduce((e,t,n
1)=>($.has(n)&&(e[n]=t.duration),e),{}),[P,O]=(0,r.useState)(F),[z,T]=(0,r.useState)(!1),[D,B]=(0,r.useState)(Math.max(0,(n[F]?.duration||30)-(A[F]??0))),[R,_]=(0,r.useState)(A),[L,q]=(0,r.useState)($),[H,W]=(0,r.useState)(n.length>0&&M===n.length),[J,U]=(0,r.useState)(()=>n.length>0&&M===n.length?v(n,$,A):null),[V,G]=(0,r.useState)(!1),[Y,Q]=(0,r.useState)(!1),[X,K]=(0,r.useState)(!E),[Z,ee]=(0,r.useState)(!1),[et,en]=(0,r.useState)(null),[es,er]=(0,r.useState)(!1),[ea,ei]=(0,r.useState)(null),[el,eo]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(0),eu=(0,r.useRef)(null),em=(0,r.useRef)(null),ex=(0,r.useRef)(!1),ef=(0,r.useRef)(null),eh=(0,r.useRef)(!1),ep=(0,r.useRef)(null),eb=(0,r.useRef)({}),ey=(0,r.useRef)(null),ew=(0,r.useRef)(!1),eg=(0,r.useRef)(()=>{}),ev="inline"===C||void 0===C&&(!!o||!S),ej=n[P],ek=ej?.duration||30,eN=n.length>0?n.reduce((e,t)=>e+t.duration,0):60*t,eS=Object.values(R).reduce((e,t)=>e+t,0),eI=eN>0?Math.min(100,eS/eN*100):0,eC=ek>0?Math.min(100,(R[P]??0)/ek*100):0;(0,r.useEffect)(()=>{if(E&&ef.current!==E){ef.current=E;try{let e=window.localStorage.getItem(E);if(!e)return;let t=function(e,t,n=Date.now()){if("object"!=typeof t||null===t||Array.isArray(t))return null;let s=e.map(e=>e.id),r=2===t.version&&Array.isArray(t.exerciseIds)&&t.exerciseIds.length===s.length&&t.exerciseIds.every((e,t)=>e===s[t]),a="number"==typeof t.savedAt&&n-t.savedAt>=0&&n-t.savedAt<=864e5,i="number"==typeof t.activeIndex?t.activeIndex:-1,l=Number.isInteger(i)&&i>=0&&i<e.length,o=Array.isArray(t.completedIndexes)&&t.completedIndexes.every(t=>Number.isInteger(t)&&t>=0&&t<e.length),d="object"!=typeof t.elapsedSecondsByIndex||null===t.elapsedSecondsByIndex||Array.isArray(t.elapsedSecondsByIndex)?null:t.elapsedSecondsByIndex;if(!r||!a||!l||!o||!d)return null;let c=Array.from(new Set(t.completedIndexes)).sort((e,t)=>e-t);return{activeIndex:i,completedIndexes:c,elapsedSecondsByIndex:e.reduce((e,t,n)=>{let s=Number(d[n]??0);return Number.isFinite(s)&&s>0&&(e[n]=Math.min(t.duration,s)),e},{})}}(n,JSON.parse(e));if(!t)return void window.localStorage.removeItem(E);let s=new Set(t.completedIndexes);O(t.activeIndex),q(s),_(t.elapsedSecondsByIndex),B(Math.max(0,(n[t.activeIndex]?.duration||30)-(t.elapsedSecondsByIndex[t.activeIndex]??0))),ee(s.size>0||Object.keys(t.elapsedSecondsByIndex).length>0||t.activeIndex>0),eh.current=!0}catch{window.localStorage.removeItem(E)}finally{K(!0)}}},[n,E]),(0,r.useEffect)(()=>{if(!E||!X)return;if(eh.current){eh.current=!1;return}if(H){try{window.localStorage.removeItem(E)}catch{}return}let e=n.reduce((e,t,n)=>{let s=R[n];return s&&s>0&&(e[n]=s),e},{}),t={version:2,savedAt:Date.now(),exerciseIds:n.map(e=>e.id),activeIndex:P,completedIndexes:Array.from(L).sort((e,t)=>e-t),elapsedSecondsByIndex:e};try{window.localStorage.setItem(E,JSON.stringify(t))}catch{}},[L,P,R,n,H,X,E]),(0,r.useEffect)(()=>(0,w.yl)(()=>{eu.current=null,ec(e=>e+1)}),[]),(0,r.useEffect)(()=>{let e=ej?.muxPlaybackId;if(!e){en(null),eu.current=null;return}let t=d?"program"===d.context?`program:${d.programId}:${d.sessionId}`:"generated"===d.context||"match-prep"===d.context?`${d.context}:${d.sessionId}`:`baseline:${d.sessionId??""}`:o??"direct",n=`${t}:${e}:${ed}`;eu.current!==n&&(er(!0),ei(null),eo(!1),en(null),eu.current=n,k(eu,n,()=>j(e,o,d),{onSuccess:e=>en(e),onError:(e,t)=>{console.error("[WorkoutPlayer]",e),t?eo(!0):ei(e)},onSettled:()=>er(!1)}))},[ej?.muxPlaybackId,o,d?.context,d?.sessionId,d&&"program"===d.context?d.programId:void 0,ed]),(0,r.useEffect)(()=>{if(!et||!ej?.muxPlaybackId)return;let e=R[P]??0;if(e<=0||e>=ej.duration)return;let t=em.current;if(!t)return;let n=()=>{let n=Number.isFinite(t.duration)&&t.duration>0?Math.min(e,t.duration):e;t.currentTime+1<n&&(t.currentTime=n)};return t.readyState>=1?void n():(t.addEventListener("loadedmetadata",n,{once:!0}),()=>t.removeEventListener("loadedmetadata",n))},[ej?.duration,ej?.muxPlaybackId,P,R,et]);let eE=(0,r.useCallback)((e,t,s,r=R)=>{p?.({activeIndex:e,completedIndexes:Array.from(t).sort((e,t)=>e-t),completedExerciseIds:Array.from(t).sort((e,t)=>e-t).map(e=>
1n[e]?.id).filter(Boolean),elapsedSeconds:Math.floor(Object.values(r).reduce((e,t)=>e+t,0)),isComplete:s})},[R,n,p]),eM=(0,r.useCallback)(e=>{ex.current||(ex.current=!0,S?.(e))},[S]),e$=(0,r.useCallback)((e,t)=>{let s=v(n,e,t);T(!1),W(!0),U(s),eE(s.allExercisesCompleted?n.length:P,e,s.allExercisesCompleted,t),eM(s)},[P,eE,n,eM]),eF=(0,r.useCallback)(()=>{if(P>0){let e=P-1;O(e),B(Math.max(0,(n[e]?.duration||30)-(R[e]??0))),T(!1),eE(e,L,!1)}},[L,P,R,eE,n]),eA=(0,r.useCallback)(()=>{let e=new Set(L);e.add(P);let t={...R,[P]:ej?.duration||R[P]||0};if(q(e),_(t),P<n.length-1){let s=P+1;O(s),B(Math.max(0,(n[s]?.duration||30)-(t[s]??0))),T(!1),eE(s,e,!1)}else e$(e,t)},[L,ej?.duration,P,R,eE,n,e$]),eP=(0,r.useCallback)(()=>{if(P<n.length-1){let e=P+1;O(e),B(Math.max(0,(n[e]?.duration||30)-(R[e]??0))),T(!1),eE(e,L,!1);return}e$(L,R)},[L,P,R,eE,n,e$]);(0,r.useEffect)(()=>{eb.current=R},[R]),(0,r.useEffect)(()=>{eg.current=eA},[eA]),(0,r.useEffect)(()=>{ew.current=!1},[P]);let eO=(0,r.useCallback)(()=>{let e=ey.current;ey.current=null,e&&e.release().catch(()=>{})},[]),ez=(0,r.useCallback)(()=>{"u">typeof navigator&&"wakeLock"in navigator&&navigator.wakeLock.request("screen").then(e=>{ey.current=e}).catch(()=>{})},[]),eT=(0,r.useCallback)(()=>{if(ew.current)return;ew.current=!0;let e=em.current;e&&e.pause(),eg.current()},[]),eD=(0,r.useCallback)(()=>{let e=ep.current;if(!e||!ej)return;if(y(e,ej.duration,performance.now()).isComplete)return void eT();let t=em.current;t&&(t.currentTime=0,t.play().catch(()=>{}))},[ej,eT]);(0,r.useEffect)(()=>{var e;if(!z){ep.current=null;return}let t=n[P]?.duration||30,s=(e=eb.current[P]??0,{anchorMs:performance.now(),bankedSeconds:Math.max(0,e)});ep.current=s,ez();let r=()=>{let e=y(s,t,performance.now());B(Math.ceil(e.remainingSeconds)),_(t=>({...t,[P]:e.elapsedSeconds})),e.isComplete&&eT()};r();let a=setInterval(r,250),i=()=>{"visible"===document.visibilityState&&r()};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i),clearInterval(a),eO();let e=y(s,t,performance.now());_(t=>({...t,[P]:e.elapsedSeconds})),ep.current=null}},[z,P]);let eB=(0,r.useCallback)(()=>{O(0),B(n[0]?.duration||30),_({}),q(new Set),W(!1),U(null),T(!1),Q(!1),ee(!1),ex.current=!1,eE(0,new Set,!1)},[eE,n]),eR=(0,r.useCallback)(e=>{O(e),B(Math.max(0,(n[e]?.duration||30)-(R[e]??0))),T(!1),eE(e,L,!1)},[L,R,eE,n]),e_=e=>{let t=Math.floor(e/60);return`${t}:${(e%60).toString().padStart(2,"0")}`};if(H){let t=J??v(n,L,R);return(0,s.jsx)(f,{title:e,workoutId:o,usesInlineCheckin:ev,checkinComplete:Y,onCheckinDone:()=>{Q(!0),eM(t)},summary:t,onRestart:eB,onClose:I})}let eL=!!ej?.muxPlaybackId;return(0,s.jsxs)("div",{className:"overflow-hidden border border-white/10 bg-fit4tennis-black",children:[(0,s.jsxs)("div",{className:"p-4 border-b border-white/10 flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-fit4tennis-yellow text-sm font-medium",children:["Exercise ",P+1,"/",n.length]}),(0,s.jsx)("h3",{className:"font-display text-xl text-white",children:e})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("button",{type:"button",onClick:()=>G(!V),"aria-label":V?"Turn sound on":"Mute sound","aria-pressed":V,className:"f4t-icon-button text-muted-on-dark hover:bg-white/10 hover:text-white",children:(0,s.jsx)(m.O,{name:V?"volumeOff":"volumeOn",size:21})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-muted-on-dark",children:[(0,s.jsx)(m.O,{name:"clock",size:17}),(0,s.jsxs)("span",{children:[e_(eN-eS)," left"]})]}),I&&(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",onClick:I,"aria-label":"Close workout player",className:"h-11 w-11 text-muted-on-dark hover:text-white",children:(0,s.jsx)(m.O,{name:"close",size:21})})]})]}),Z?(0,s.jsx)("p",{role:"status",className:"border-b border-white/10 bg-white/5 px-4 py-2 text-xs text-muted-on-dark",children:"Resumed your saved session progress."}):null,(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(a.N,{mode:"wait",children:(0,s.jsx)(i.P.div,{initial:{opacity:0,x:50}
1,animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.3},className:"relative",children:(0,s.jsxs)("div",{className:"relative aspect-video bg-black flex items-center justify-center overflow-hidden",children:[eL?es?(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-fit4tennis-black gap-3",children:[(0,s.jsx)(i.P.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-10 h-10 border-2 border-fit4tennis-yellow border-t-transparent rounded-full"}),(0,s.jsx)("p",{className:"text-muted-on-dark text-sm",role:"status",children:"Loading video…"})]}):el?(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-fit4tennis-black gap-2 px-6 text-center",children:[(0,s.jsx)(m.O,{name:"tennisBall",size:44,className:"text-fit4tennis-yellow"}),(0,s.jsx)("p",{className:"text-white/80 font-display text-lg",children:"One confirmation first"}),(0,s.jsx)("p",{className:"text-muted-on-dark text-xs",role:"status",children:"Check the box on the notice — then this video starts."})]}):ea?(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-fit4tennis-black gap-2 px-6 text-center",children:[(0,s.jsx)(m.O,{name:"tennisBall",size:44,className:"text-fit4tennis-yellow"}),(0,s.jsx)("p",{className:"text-white/80 font-display text-lg",children:ej?.name}),(0,s.jsx)("p",{className:"text-muted-on-dark text-xs",role:"status",children:"Video didn't load — follow the coaching cue below"})]}):et?(0,s.jsx)(u.F4TVideoPlayer,{playerRef:em,playbackId:ej.muxPlaybackId,tokens:et,title:ej?.name,poster:ej?.imageUrl,muted:V,onPlay:()=>T(!0),onPause:()=>T(!1),className:"absolute inset-0 w-full h-full",onEnded:eD}):null:(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-fit4tennis-charcoal",children:(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)(i.P.div,{animate:z?{scale:[1,1.1,1]}:{},transition:{duration:1,repeat:1/0},className:"w-32 h-32 mx-auto mb-4 rounded-full bg-fit4tennis-yellow/20 flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-6xl font-display text-fit4tennis-yellow",children:P+1})})})}),!eL&&(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/40"}),!eL&&(0,s.jsx)("div",{className:"absolute top-4 right-4 bg-black/60 backdrop-blur-sm rounded-lg px-4 py-2",children:(0,s.jsx)("span",{className:"text-4xl font-mono text-fit4tennis-yellow font-bold",children:e_(D)})}),(0,s.jsxs)("div",{className:`absolute bottom-0 left-0 right-0 p-6 bg-gradient-to-t from-black/90 to-transparent ${eL&&!es&&!ea&&et?"pointer-events-none":""}`,children:[(ej?.category||ej?.segment)&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[ej?.segment&&(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full bg-white/15 text-white/80 text-[11px] font-medium uppercase tracking-wide",children:g[ej.segment]}),ej?.category&&(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full bg-fit4tennis-yellow/20 text-fit4tennis-yellow text-[11px] font-medium",children:ej.category})]}),(0,s.jsx)("h2",{className:"font-display text-2xl lg:text-3xl text-white mb-1",children:ej?.name||"Exercise"}),ej?.description&&(0,s.jsxs)("p",{className:"text-fit4tennis-yellow/90 text-sm font-medium mb-3 italic",children:['"',ej.description,'"']}),(ej?.reps||ej?.sets)&&(0,s.jsxs)("p",{className:"text-white/80 text-base mb-3",children:[ej.sets&&`${ej.sets} sets \xd7 `,ej.reps&&`${ej.reps} reps`]}),(0,s.jsx)("div",{className:"w-full h-1 bg-white/20 rounded-full overflow-hidden mb-4",children:(0,s.jsx)(i.P.div,{className:"h-full bg-fit4tennis-yellow",initial:{width:0},animate:{width:`${eC}%`}})}),(0,s.jsxs)("div",{className:`flex items-center justify-center gap-6 ${eL&&et?"pointer-events-auto":""}`,children:[(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",onClick:eF,disabled:0===P,className:"h-12 w-12 text-muted-on-dark hover:text-white disabled:opacity-30","aria-label":"Previous exercise",children:(0,s.jsx)(m.O,{name:"skipBack",size:24})}),(0,s.jsx)(l.$,{type:"button",size:"lg",onClick:()=>{!function(e,t,n){if(!e.hasMuxVideo)return n(e=>!e);if(t){if(e.isPlaying){t.pause(),n(!1);return}t.play().catch(e=>{console.error("[WorkoutPlayer] Playback failed",e),n(!1)})}}({hasMuxVideo:eL,isPlaying:z},em.current,T)},"aria-label":z?"Pause exercise video":"Play exercise video",className:"w-16 h-16 rounded-full bg-fit4tennis-yellow text-fit4tennis-black hover:bg-fit4tennis-yellow/90",children:(0,s.jsx)(m.O,{name:z?"pause":"play",size:32,className:z?"":"ml-1"})}),(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",onClick:eP,className:"h-12 w-12 text-muted-on-dark hover:text-white disabled:opacity-30",disabled:!1,"aria-label":P===n.length-1?"End session":"Skip exercise",children:(0,s.jsx)(m.O,{name:"skipForward",size:24})})]})]})]})},P)}
1)}),(0,s.jsx)("div",{className:"p-4 border-t border-white/10",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(c,{value:eI,"aria-label":"Overall workout progress",className:"h-2 bg-white/10"}),(0,s.jsxs)("div",{className:"flex justify-between text-sm text-muted-on-dark",children:[(0,s.jsx)("span",{children:e_(eS)}),(0,s.jsx)("span",{children:e_(eN)})]})]})}),(0,s.jsx)(b,{exercises:n,currentIndex:P,completedIndexes:L,onJump:eR})]})}},69271:(e,t,n)=>{n.d(t,{MG:()=>s,Np:()=>a,pT:()=>i,yl:()=>l});let s="assumption_of_risk_required",r="f4t:aor-accepted";function a(e,t){return 403===e&&t===s}function i(){window.dispatchEvent(new CustomEvent(r))}function l(e){return window.addEventListener(r,e),()=>window.removeEventListener(r,e)}}}]);

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.