PageSourceSearch

https://fantasyhoff.com/assets/LeagueReveal-ewkb0Ek2.js

js fantasyhoff.com collected 2026-09-24 14:43:05 UTC 17,754 bytes, 1 lines download raw bytes

1import{a as h,j as e}from"./vendor-react-DCIP6ipm.js";import{L as we}from"./LeagueBotUnlock-CLtmmB-Z.js";import{_ as $e,$ as Se,j as Le,P as Ce,p as Ie,s as Pe,a0 as Te,a1 as Oe,L as Me,a2 as _e,t as _,a3 as Ae,Z as Ee,a4 as ue,a5 as Re,H as Be,I as Fe,K as ze}from"./index-5SgQjDr9.js";import{u as He}from"./useLeagueData-BBHxNK3e.js";import{u as We,a as Ye,b as De}from"./useHistorian-Gc2wTVJl.js";import{u as Ve,a as qe}from"./useStats-D63dhjCr.js";import{n as Ke}from"./ownerTeams-Culkj4cf.js";import{b as Ue,u as Ge,a as Je,L as pe}from"./vendor-router-DmCJgN2X.js";import{d as G,$ as Ze,h as Qe,H as Xe,S as me,C as es,a0 as ss,e as as,c as rs,n as ts,A as ge,a1 as ns}from"./vendor-icons-Cwrlw3JZ.js";import"./vendor-react-dom-CpZ_XJmk.js";import"./vendor-query-Brtv2x_Q.js";const is={yahoo:"Yahoo",sleeper:"Sleeper",espn:"ESPN",cbs:"CBS",mfl:"MyFantasyLeague",fleaflicker:"Fleaflicker"};function ls(a){return!a.hidden&&!/^[-\s]*hidden[-\s]*$/i.test(a.name)}function os(a){return a?`${a.wins}–${a.losses}${a.ties?`–${a.ties}`:""} across ${a.seasons} season${a.seasons===1?"":"s"}`:"Your career line is still being calculated."}function ws(){var X,ee,se,ae,re,te,ne,ie,le,oe,ce,de;const{leagueId:a=""}=Ue(),[m]=Ge(),I=Je(),d=["import","invite","museum"].includes(m.get("source")??"")?m.get("source"):"museum",j=m.toString(),n=h.useMemo(()=>$e(j,a),[j,a]),u={journeyVersion:Ae,...Se(n)},$=Le(a),o=Ve(a),S=He(a),P=Ce(a),r=$.data,b=(r==null?void 0:r.accessRole)==="owner"||(r==null?void 0:r.accessRole)==="commissioner",k=Ie(a),w=Pe(a),g=We(a,!0),[y,t]=h.useState(null),[p,H]=h.useState(!1),E=h.useMemo(()=>ve.map(s=>{var f,N,z;return{...s,fact:((z=(N=(f=g.data)==null?void 0:f.facts)==null?void 0:N[s.page])==null?void 0:z[0])??null}}).filter(s=>s.fact),[g.data]),[i,A]=h.useState(!1),T=h.useRef(!1),J=h.useRef(!1),v=h.useMemo(()=>((r==null?void 0:r.owners)??[]).filter(ls),[r==null?void 0:r.owners]),xe=h.useMemo(()=>Ke(r),[r]),c=(r==null?void 0:r.suggestedOwner)??null,x=c&&v.some(s=>s.id===c.ownerId&&!s.isClaimed)?c.ownerId:null,Z=h.useRef(!1);h.useEffect(()=>{Z.current||!x||!c||(Z.current=!0,t(x),_("claim_suggestion_shown",{leagueId:a,source:d,signal:c.signal,provider:c.provider,seasons:c.seasons,...u}))},[x]);const fe=h.useMemo(()=>x?[...v].sort((s,f)=>s.id===x?-1:f.id===x?1:0):v,[v,x]),W=r!=null&&r.myOwnerId?`owner:${r.myOwnerId}`:void 0,l=(X=o.data)==null?void 0:X.standings.find(s=>s.groupId===W),L=h.useMemo(()=>{var s;if(l)return[...((s=o.data)==null?void 0:s.standings)??[]].filter(f=>f.groupId!==l.groupId).sort((f,N)=>Math.abs(f.wins-l.wins)-Math.abs(N.wins-l.wins))[0]},[l,(ee=o.data)==null?void 0:ee.standings]),O=qe(a,W,L==null?void 0:L.groupId),R=(se=o.data)==null?void 0:se.trophies.find(s=>s.groupId===W),C=(ae=o.data)==null?void 0:ae.matchupRecords.find(s=>s.groupId===W),M=S.data?S.data.summary.succeeded+(S.data.summary.partial??0):(r==null?void 0:r.seasons.length)??0,B=((re=o.data)==null?void 0:re.meta.matchupCount)??0,Y=1+(((te=P.data)==null?void 0:te.members.filter(s=>s.status==="accepted").length)??0),D=v.filter(s=>s.isClaimed).length;if(h.useEffect(()=>{!r||T.current||(T.current=!0,_("league_reveal_viewed",{leagueId:a,source:d,seasons:M,matchups:B,accessRole:r.accessRole,...u}))},[M,r,a,B,d]),h.useEffect(()=>{var s;!l||J.current||(J.current=!0,_("personal_insight_viewed",{leagueId:a,source:d,manager:l.groupId,hasRivalry:!!((s=O.data)!=null&&s.summary.total),hasRecord:!!C,...u}))},[C,a,l,(ne=O.data)==null?void 0:ne.summary.total,d]),$.isLoading||o.isLoading)return e.jsx(Ee,{});if(!r)return e.jsxs("main",{className:"hofPage reveal-page",children:[e.jsx(ue,{}),e.jsx("div",{className:"reveal-error",children:"That league could not be loaded."})]});const V=r.league.name,F=v.find(s=>s.id===y),je=[{label:`${M} season${M===1?"":"s"} recovered`,done:M>0},{label:`${B.toLocaleString()} matchups archived`,done:B>0},{label:b?`${D} of ${v.length} franchises claimed`:l?"Your file is open":"Your file is being built",done:b?D>=v.length:!!l}],Q=!!r.myOwnerId,be=E.length>0||g.isLoading,q=(()=>{let s=0;return{file:Q?String(++s).padStart(2,"0"):null,tour:be?String(++s).padStart(2,"0"):null,share:String(++s).padStart(2,"0")}})(),ye=()=>{_(d==="invite"?"member_reveal_completed":"league_reveal_completed",{leagueId:a,source:d,claimed:!!r.myOwnerId,shared:i,acceptedMembers:Y,...u}),I(ze(a))},Ne=()=>{H(!0),_("league_reveal_skipped",{leagueId:a,source:d,claimed:!1,acceptedMembers:Y,...u})},ke=async()=>{var N;const s=(N=k.data)==null?void 0:N.url;if(!s)return;await Be({title:`${V} Fantasy Hall of Fame`,text:Fe({leagueName:V,seasons:M}),url:s,event:"league_invite_shared",props:{leagueId:a,surface:"league-reveal",source:d,managers:v.length},inviteAttribution:{leagueId:a,surface:"league-reveal"}})&&A(!0)};return e.jsxs("main",{className:"hofPage reveal-page",children:[e.jsx(ue,{}),e.jsxs("div",{className:"reveal-shell",children:[e.jsxs("header",{className:"reveal-mast",children:[e.jsx("div",{className:"reveal-bulbs","aria-hidden":"true"}),e.jsxs("div",{className:"reveal-mast-copy",children:[e.jsxs("p",{className:"reveal-kicker",children:[e.jsx(me,{size:14})," The doors are open"]}),e.jsxs("h1",{children:[V," is on the record."]}),e.jsxs("p",{children:[M," season",M===1?"":"s"," ·"," ",B.toLocaleStr
1ing()," matchups · ",v.length," ","managers. Now find yourself in it."]})]}),e.jsx("ol",{className:"reveal-progress","aria-label":"What was recovered",children:je.map((s,f)=>e.jsxs("li",{className:s.done?"is-done":"",children:[e.jsx("span",{children:s.done?e.jsx(es,{size:13}):f+1}),s.label]},s.label))})]}),!r.myOwnerId&&!p?e.jsxs("section",{className:"reveal-stage reveal-identity",children:[e.jsxs("div",{className:"reveal-stage-head",children:[e.jsx("span",{className:"reveal-stage-no",children:"01"}),e.jsxs("div",{children:[e.jsx("p",{className:"reveal-eyebrow",children:"Claim your jersey"}),e.jsx("h2",{children:x?"Is this you?":"Which manager are you?"}),e.jsx("p",{children:x?`The import says ${c==null?void 0:c.ownerName} is your franchise${(c==null?void 0:c.signal)==="account"?` — that team is on your ${is[c.provider]??c.provider} account`:""}. Confirm it and your records and rivalries light up everywhere.`:"This is what turns a league archive into your history. Your records and rivalries will light up everywhere."})]})]}),e.jsx("div",{className:"reveal-owner-grid",role:"listbox","aria-label":"Managers",children:fe.map(s=>{var he;const f=(he=o.data)==null?void 0:he.standings.find(U=>U.groupId===`owner:${s.id}`),N=s.isClaimed,z=s.id===x,K=xe.get(s.id);return e.jsxs("button",{type:"button",role:"option","aria-selected":y===s.id,className:"reveal-owner"+(y===s.id?" is-picked":"")+(N?" is-taken":"")+(z?" is-suggested":""),disabled:N,onClick:()=>t(U=>U===s.id?null:s.id),children:[e.jsx("span",{className:"reveal-owner-mark",children:e.jsx(ss,{size:16})}),e.jsx("strong",{children:s.name}),K&&K!==s.name&&e.jsx("small",{className:"reveal-owner-team",children:K}),e.jsx("small",{children:N?"Already claimed":os(f)}),z&&e.jsxs("span",{className:"reveal-owner-flag",children:[e.jsx(me,{size:11})," Probably you"]})]},s.id)})}),F&&e.jsxs("div",{className:"reveal-confirm",children:[e.jsxs("span",{children:["Light up ",e.jsx("strong",{children:F.name})," as your franchise?"]}),e.jsx("button",{type:"button",className:"hof-btn primary",disabled:w.isPending,onClick:()=>w.mutate({ownerId:F.id,inviteAttribution:n},{onSuccess:()=>{x&&_("claim_suggestion_resolved",{leagueId:a,source:d,accepted:F.id===x,signal:c==null?void 0:c.signal,provider:c==null?void 0:c.provider,...u}),t(null)}}),children:w.isPending?"Claiming…":F.id===x?"Yes, that's me":"This is me"})]}),w.isError&&e.jsx("p",{className:"reveal-inline-error",children:w.error.message||"That franchise could not be claimed."}),e.jsx("button",{type:"button",className:"reveal-skip",onClick:Ne,children:"Explore without claiming"})]}):e.jsxs(e.Fragment,{children:[Q&&e.jsxs("section",{className:"reveal-stage",children:[e.jsxs("div",{className:"reveal-stage-head",children:[e.jsx("span",{className:"reveal-stage-no",children:q.file}),e.jsxs("div",{children:[e.jsx("p",{className:"reveal-eyebrow",children:"Your file"}),e.jsxs("h2",{children:[(l==null?void 0:l.name)??"Your history",", recovered."]}),e.jsx("p",{children:"The broad strokes are free. The arguments they start are the point."})]})]}),e.jsxs("div",{className:"reveal-proof-grid",children:[e.jsxs("article",{className:"reveal-proof is-record",children:[e.jsx("span",{className:"reveal-proof-icon",children:e.jsx(G,{size:17})}),e.jsx("p",{children:"Career ledger"}),e.jsx("strong",{children:l?`${l.wins}–${l.losses}${l.ties?`–${l.ties}`:""}`:"Calculating…"}),e.jsx("small",{children:R!=null&&R.championships?`${R.championships} championship${R.championships===1?"":"s"} · ${(l==null?void 0:l.seasons)??0} seasons`:`${(l==null?void 0:l.seasons)??0} seasons on the books`})]}),e.jsxs("article",{className:"reveal-proof is-rivalry",children:[e.jsx("span",{className:"reveal-proof-icon",children:e.jsx(as,{size:17})}),e.jsx("p",{children:"A rival in your weight class"}),e.jsx("strong",{children:(L==null?void 0:L.name)??"Tape loading…"}),e.jsx("small",{children:(ie=O.data)!=null&&ie.summary.total?`${O.data.summary.aWins}–${O.data.summary.bWins}${O.data.summary.ties?`–${O.data.summary.ties}`:""} in ${O.data.summary.total} meetings`:"The head-to-head tape is being checked"})]}),e.jsxs("article",{className:"reveal-proof is-receipt",children:[e.jsx("span",{className:"reveal-proof-icon",children:e.jsx(rs,{size:17})}),e.jsx("p",{children:"A receipt with your name on it"}),e.jsx("strong",{children:(C==null?void 0:C.title)??"Your best mark is loading"}),e.jsx("small",{children:C?`${C.value.toFixed(1)} · ${C.season} week ${C.week}`:"The record book is still sorting the evidence"})]})]}),e.jsx(ds,{seasons:(r==null?void 0:r.seasons)??[],standings:((le=o.data)==null?void 0:le.standings)??[],trophies:((oe=o.data)==null?void 0:oe.trophies)??[],matchupCount:(ce=o.data)==null?void 0:ce.meta.matchupCount,visibleOwnerIds:v.map(s=>s.id)}),e.jsx(us,{leagueId:a,rivalName:L==null?void 0:L.name,claimedName:l==null?void 0:l.name,trackProps:{source:d,...u}})]}),e.jsx(cs,{leagueId:a,stops:E,no:q.tour,loading:g.isLoading,trackProps:{source:d,...u}}),e.jsxs("section",{className:"reveal-stage reveal-share",children:[e.jsxs("div",{className:"reveal-stage-head",children:[e.jsx("span",{className:"reveal-stage-no",children:q.share}),e.jsxs("div",{children:[e.jsx("p",{className:"reveal-eyebrow",children:"Open the doors"}),e.jsx("h2",{children:"Now bring in the group chat."}),e.jsxs("p",{children:[Y," of ",v.length," managers are in and"," ",D," ",D===1?"has":"have"," ","claimed their franchise. One link does the recruiting for you."]})]})]}),e.jsxs("div",{className:"reveal-share-board",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"reveal-share-count",children:[Y,"/",v.length]}),e.jsx("span",{children:"managers inside"})]}),e.jsxs("button",{type:"button",className:"reveal-share-cta",disabled:!((de=k.data)!=null&&de.url),onClick:ke,children:[e.jsx(ts,{size:17}),i?"Shared — keep it moving":"Share to group chat"]}),b&&e.jsx(pe,{to:`/settings/teams/${a}#invite-email`,className:"reveal-email-link",children:"Invite individually"})]})]}),e.jsxs("div",{className:"reveal-finish",children:[e.jsxs("button",{type:"button",className:"hof-btn primary",onClick:ye,children:["Enter the Museum ",e.jsx(ge,{size:14})]}),e.jsx("span",{children:"Your full league home is ready."})]})]})]})]})}const ve=[{page:"records",icon:G,eyebrow:"The Record Book",title:"Every mark your league has ever set.",cta:"Open the Record Book",href:Te},{page:"transactions",icon:Ze,eyebrow:"The Wire",title:"Every add, drop and trade, still on the record.",cta:"Open the Wire",href:Oe},{page:"draft-grades",icon:Qe,eyebrow:"Draft History",title:"Every pick you ever made, graded.",cta:"Open Draft History",href:Me},{page:"timeline",icon:Xe,eyebrow:"The Timeline",title:"The eras, the renames, the expansions.",cta:"Open the Timeline",href:_e}];function cs({leagueId:a,stops:m,no:I,loading:d,trackProps:j}){return m.length===0&&!d?null:e.jsxs("section",{className:"reveal-stage reveal-tour","aria-label":"What's inside",children:[e.jsxs("div",{className:"reveal-stage-head",children:[e.jsx("span",{className:"reveal-stage-no",children:I}),e.jsxs("div",{children:[e.jsx("p",{className:"reveal-eyebrow",children:"What's inside"}),e.jsx("h2",{children:"All of this came back with your seasons."}),e.jsx("p",{children:"No setup, no data entry, no spreadsheet to fill in."})]})]}
1),d&&m.length===0?e.jsx("ul",{className:"reveal-tour-list","aria-hidden":"true",children:ve.map(n=>e.jsxs("li",{className:"is-loading",children:[e.jsx("span",{className:"reveal-tour-icon",children:e.jsx(n.icon,{size:17})}),e.jsxs("div",{className:"reveal-tour-body",children:[e.jsx("p",{className:"reveal-tour-eyebrow",children:n.eyebrow}),e.jsx("h3",{children:n.title}),e.jsx("span",{className:"reveal-tour-skel"})]})]},n.page))}):e.jsx("ul",{className:`reveal-tour-list${m.length%2===1?" is-odd":""}`,children:m.map(n=>e.jsxs("li",{children:[e.jsx("span",{className:"reveal-tour-icon","aria-hidden":"true",children:e.jsx(n.icon,{size:17})}),e.jsxs("div",{className:"reveal-tour-body",children:[e.jsx("p",{className:"reveal-tour-eyebrow",children:n.eyebrow}),e.jsx("h3",{children:n.title}),e.jsx("blockquote",{children:n.fact}),e.jsxs(pe,{className:"reveal-tour-link",to:n.href(a),onClick:()=>_("reveal_tour_opened",{leagueId:a,page:n.page,...j}),children:[n.cta," ",e.jsx(ge,{size:13,"aria-hidden":"true"})]})]})]},n.page))})]})}function ds({seasons:a,standings:m,trophies:I,matchupCount:d,visibleOwnerIds:j}){const n=h.useMemo(()=>{const u=new Set(j.map(t=>`owner:${t}`)),$=m.filter(t=>!t.groupId.startsWith("owner:")||u.has(t.groupId));if($.length===0||a.length===0)return[];const o=a.map(t=>Number(t.season)).filter(t=>Number.isFinite(t)&&t>1990),S=o.length>1?`${Math.min(...o)}–${Math.max(...o)}`:o.length===1?String(o[0]):null,P=d??Math.round($.reduce((t,p)=>t+p.wins+p.losses+p.ties,0)/2),b=[...I.filter(t=>!t.groupId.startsWith("owner:")||u.has(t.groupId))].sort((t,p)=>p.championships-t.championships)[0],k=[...$].sort((t,p)=>p.pointsFor-t.pointsFor)[0],w=$.filter(t=>t.seasons>=3),g=w.length>0?[...w].sort((t,p)=>p.winPct-t.winPct)[0]:null,y=[{stat:String(a.length),label:S?`seasons preserved · ${S}`:"seasons preserved"}];return P>0&&y.push({stat:P.toLocaleString(),label:"games archived"}),b&&b.championships>0&&y.push({stat:`${b.championships}×`,label:`champion — ${b.name}`}),g?y.push({stat:`${Math.round(g.winPct*100)}%`,label:`best career win rate — ${g.name}`}):k&&y.push({stat:Math.round(k.pointsFor).toLocaleString(),label:`career points — ${k.name}`}),y.slice(0,4)},[a,m,I,d,j]);return n.length===0?null:e.jsxs("div",{className:"reveal-facts",children:[e.jsxs("p",{className:"reveal-eyebrow",children:[e.jsx(G,{size:13,"aria-hidden":"true"})," From your record book"]}),e.jsx("div",{className:"reveal-facts-grid",children:n.map(u=>e.jsxs("div",{className:"reveal-fact",children:[e.jsx("strong",{children:u.stat}),e.jsx("span",{children:u.label})]},u.label))}),e.jsx("p",{className:"reveal-facts-note",children:"…and the full record book is inside."})]})}const hs=["Who is the true GOAT of this league?","What is the most lopsided result in our history?","Which manager has been the unluckiest?"];function us({leagueId:a,rivalName:m,claimedName:I,trackProps:d}){var t,p,H,E;const j=Ye(a),n=De(a),[u,$]=h.useState(!1),[o,S]=h.useState(""),P=h.useRef(null);P.current===null&&(P.current=n.messages.length);const r=((t=j.data)==null?void 0:t.configured)!==!1&&((p=j.data)==null?void 0:p.hasData)!==!1,{isFree:b}=Re(a),k=b,w=h.useMemo(()=>{var A;const i=[];m&&i.push(`Give me the honest history of my rivalry with ${m}.`);for(const T of((A=j.data)==null?void 0:A.suggestions)??[]){if(i.length>=3)break;i.includes(T)||i.push(T)}for(const T of hs){if(i.length>=3)break;i.includes(T)||i.push(T)}return i.slice(0,3)},[(H=j.data)==null?void 0:H.suggestions,m]);if(!r)return null;const g=n.messages.slice(P.current??0).slice(-6),y=i=>{const A=i.trim();!A||n.streaming||k||($(!0),_("reveal_sampler_asked",{leagueId:a,...d}),n.send(A))};return e.jsxs("div",{className:"reveal-sampler",children:[e.jsxs("p",{className:"reveal-eyebrow",children:[e.jsx(ns,{size:13,"aria-hidden":"true"})," Ask LeagueBot"]}),e.jsx("p",{className:"reveal-sampler-lede",children:b?"Preview what you can ask about your history with Elite.":"It has read your entire history. Try it — one tap."}),e.jsx("div",{className:"reveal-sampler-chips",children:w.map(i=>e.jsx("button",{type:"button",disabled:n.streaming||k,onClick:()=>y(i),children:i},i))}),u&&g.length>0&&e.jsxs("div",{className:"reveal-sampler-thread",children:[g.map(i=>i.role==="user"?e.jsx("p",{className:"reveal-sampler-q",children:i.content},i.id):e.jsx("div",{className:"reveal-sampler-a",children:e.jsx("p",{children:i.content})},i.id)),n.streaming&&((E=g[g.length-1])==null?void 0:E.role)==="user"&&e.jsx("div",{className:"reveal-sampler-a",children:e.jsx("p",{className:"reveal-sampler-thinking",children:"Reading two decades of receipts…"})})]}),!k&&e.jsxs("form",{className:"reveal-sampler-ask",onSubmit:i=>{i.preventDefault(),y(o),S("")},children:[e.jsx("input",{type:"text",value:o,maxLength:400,placeholder:u?"Ask a follow-up or clarify…":"Or type your own question…",onChange:i=>S(i.target.value),disabled:n.streaming}),e.jsx("button",{type:"submit",disabled:n.streaming||!o.trim(),"aria-label":"Ask LeagueBot",children:"Ask"})]}),!I&&u&&e.jsx("p",{className:"reveal-sampler-hint",children:"Tip: claim your team above and LeagueBot knows who “me” is."}),b&&e.jsx(we,{leagueId:a})]})}export{ws as LeagueReveal};

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.