1import{a as u,j as e}from"./vendor-react-DCIP6ipm.js";import{q as y,a4 as N,Z as v}from"./index-5SgQjDr9.js";import{b as w}from"./LeagueFilterBar-BrkR6O-_.js";import{u as S}from"./useCompetitionShare-CRix2FXO.js";import{u as C,d as P}from"./useInSeason-B719m2e8.js";import{I as V,W as $}from"./InSeasonHeader-B0TU0Gd0.js";/* empty css */import{d as f,C as g,ab as L,as as E,g as z}from"./vendor-icons-Cwrlw3JZ.js";import"./vendor-react-dom-CpZ_XJmk.js";import"./vendor-query-Brtv2x_Q.js";import"./vendor-router-DmCJgN2X.js";import"./LeaguePageHeader-DfpVtznf.js";function G(){const{leagueId:n,active:i}=y(),l=S(n,i==null?void 0:i.name),[d,m]=u.useState(),[x,h]=u.useState(0),c=C(n,d),o=P(n,d),r=c.data;return u.useEffect(()=>{h(0)},[r==null?void 0:r.season,r==null?void 0:r.week]),e.jsxs("main",{className:"hofPage ins-page ins-props",children:[e.jsx(N,{}),l.prompt,e.jsxs("div",{className:"ins-shell",children:[e.jsx(V,{season:r==null?void 0:r.season,week:r==null?void 0:r.week,state:r==null?void 0:r.state,eyebrow:"Ten calls. One weekly card.",title:"Weekly Props",mobileScorebug:r?e.jsx(T,{rows:r.leaderboard}):void 0}),c.isLoading?e.jsx(v,{}):c.isError?e.jsx(A,{message:c.error.message,retry:()=>c.refetch()}):!(r!=null&&r.available)||r.props.length===0?e.jsx(W,{}):e.jsxs(e.Fragment,{children:[r.weeks.length>1&&e.jsx(w,{className:"ins-props-filters","aria-label":"Props filters",children:e.jsx($,{weeks:r.weeks,value:r.week,onChange:m})}),e.jsx(F,{data:r,index:x,setIndex:h,isVoting:o.isPending,voteError:o.isError,cardMessage:r.state==="open"?r.locksAt?`Locks ${new Date(r.locksAt).toLocaleString(void 0,{timeZone:"America/New_York",weekday:"short",hour:"numeric",minute:"2-digit",timeZoneName:"short"})}`:"Locks Sunday at 12:59 p.m. ET":r.state==="locked"?"Voting closed · results settle when the week is final":"Final scores are in · correct picks are marked in green",choose:(j,k)=>o.mutate({propId:j,optionKey:k},{onSuccess:s=>{h(t=>Math.min(r.props.length-1,t+1)),s.state==="open"&&s.props.length>0&&r.props.some(t=>!t.yourVote)&&s.props.every(t=>!!t.yourVote)&&l.show({kind:"props",key:`${s.season}:${s.week}`,week:s.week,locksAt:s.locksAt})}})})]})]})]})}function F({data:n,index:i,setIndex:l,isVoting:d,voteError:m,cardMessage:x,choose:h}){const c=Math.min(i,n.props.length-1),o=n.props[c],r=n.props.filter(s=>s.yourVote).length,j=u.useRef(null);u.useEffect(()=>{var s;(s=j.current)==null||s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[c]);const k=o.outcome?o.outcome.void?"This prop was voided":`Result · ${o.outcome.resultLabel}`:n.state==="scored"&&o.pendingReason?["matchup_reference","ballot_teams"].includes(o.pendingReason)?"Result under review â your pick is saved":"Awaiting complete data â your pick is saved":m?"Couldnât save that pick â try again":d?"Saving your pickâ¦":o.yourVote?"Pick recorded":n.state==="open"?"Choose one answer":"Voting is locked";return e.jsxs("section",{className:"ins-focus","aria-label":`Week ${n.week} props`,children:[e.jsxs("header",{className:"ins-focus-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Weekly card"}),e.jsx("h2",{children:"Focus Mode"})]}),e.jsxs("p",{children:[e.jsxs("span",{children:[r," of ",n.props.length," picks recorded"]}),e.jsx("span",{className:"ins-focus-deadline",children:x})]}),e.jsxs("strong",{children:[c+1,e.jsxs("small",{children:["of ",n.props.length]})]})]}),e.jsx("div",{className:"ins-focus-progress-wrap",children:e.jsx("nav",{className:"ins-focus-progress","aria-label":"Jump to a prop",children:n.props.map((s,a)=>{var p;const t=!!(s.yourVote&&((p=s.outcome)!=null&&p.correctOptionKeys.includes(s.yourVote)));return e.jsx("button",{ref:a===c?j:void 0,type:"button",className:`${a===c?"is-active":""}${s.yourVote?" is-done":""}${t?" is-correct":""}`,onClick:()=>l(a),"aria-current":a===c?"step":void 0,"aria-label":`Prop ${s.number}: ${s.prompt}${s.yourVote?", picked":""}`,children:s.yourVote?e.jsx(g,{size:14,"aria-hidden":"true"}):s.number},s.id)})})}),e.jsxs("article",{className:"ins-focus-card",children:[e.jsxs("div",{className:"ins-focus-meta",children:[e.jsx("span",{children:o.number===1?"Featured game":o.kind.replace(/[-_]/g," ")}),e.jsxs("b",{children:["#",String(o.number).padStart(2,"0")]})]}),e.jsx("h2",{children:o.prompt}),o.detail&&e.jsx("p",{children:o.detail}),e.jsx("div",{className:"ins-focus-options",children:o.options.map((s,a)=>{var b;const t=o.yourVote===s.key,p=(b=o.outcome)==null?void 0:b.correctOptionKeys.includes(s.key);
1return e.jsxs("button",{type:"button",className:`${t?"is-picked":""}${p?" is-correct":""}`,disabled:n.state!=="open"||d,"aria-pressed":t,onClick:()=>h(o.id,s.key),children:[s.percentage!=null&&e.jsx("span",{className:"ins-focus-vote-fill",style:{width:`${s.percentage}%`},"aria-hidden":"true"}),e.jsx("span",{className:"ins-focus-letter","aria-hidden":"true",children:p?e.jsx(g,{size:16}):String.fromCharCode(65+a)}),e.jsxs("span",{className:"ins-focus-option-copy",children:[e.jsx("strong",{children:s.label}),s.sublabel&&e.jsx("small",{children:s.sublabel}),s.projection&&e.jsxs("span",{className:"ins-focus-projection",children:[e.jsx("b",{children:s.projection.label}),e.jsx("strong",{children:s.projection.value}),s.projection.note&&e.jsx("em",{children:s.projection.note})]})]}),e.jsxs("span",{className:"ins-focus-option-result",children:[t&&!p?"Your pick":null,s.percentage!=null&&e.jsxs("b",{children:[s.percentage,"%"]})]})]},s.key)})}),e.jsxs("footer",{children:[e.jsxs("button",{type:"button",disabled:c===0,onClick:()=>l(Math.max(0,c-1)),children:[e.jsx(L,{size:17})," Previous"]}),e.jsxs("span",{"aria-live":"polite",children:[o.yourVote&&!o.outcome&&!d&&!m&&e.jsx(g,{size:14}),n.state!=="open"&&!o.outcome&&e.jsx(E,{size:14}),k]}),e.jsxs("button",{type:"button",disabled:c===n.props.length-1,onClick:()=>l(Math.min(n.props.length-1,c+1)),children:["Next ",e.jsx(z,{size:17})]})]})]}),e.jsx(R,{rows:n.leaderboard})]})}function R({rows:n}){return e.jsxs("aside",{className:"ins-focus-standings","aria-label":"Pickâem standings",children:[e.jsxs("header",{children:[e.jsx(f,{size:14,"aria-hidden":"true"})," Pickâem standings"]}),n.length?e.jsx("ol",{children:n.map(i=>e.jsxs("li",{children:[e.jsx("b",{children:i.rank}),e.jsxs("span",{children:[e.jsx("strong",{children:i.franchiseName??i.name}),e.jsxs("small",{children:[i.points," pts · ",i.accuracy,"%"]})]})]},i.userId))}):e.jsx("p",{children:"The first submitted card starts the table."})]})}function T({rows:n}){return e.jsxs("section",{className:"ins-mobile-standings","aria-label":"Pickâem standings",children:[e.jsxs("header",{children:[e.jsxs("span",{children:[e.jsx(f,{size:13,"aria-hidden":"true"})," Pickâem standings"]}),e.jsx("small",{children:n.length?"Swipe table":"Season table"})]}),n.length?e.jsx("ol",{children:n.map(i=>e.jsxs("li",{children:[e.jsx("b",{children:i.rank}),e.jsxs("span",{children:[e.jsx("strong",{children:i.franchiseName??i.name}),e.jsxs("small",{children:[i.points," pts · ",i.accuracy,"% acc"]})]})]},i.userId))}):e.jsx("p",{children:"The first submitted card starts the table."})]})}function W(){return e.jsxs("section",{className:"ins-empty",children:[e.jsx("span",{children:"00"}),e.jsx("h2",{children:"The board is waiting for a schedule."}),e.jsx("p",{children:"Once the current season has imported matchups, ten weekly props will appear automatically."})]})}function A({message:n,retry:i}){return e.jsxs("section",{className:"ins-empty",children:[e.jsx("span",{children:"!"}),e.jsx("h2",{children:"Couldnât open this weekâs card."}),e.jsx("p",{children:n}),e.jsx("button",{type:"button",onClick:i,children:"Try again"})]})}export{G as WeeklyProps};
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.