@wral/hsot-data 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,44 +4,44 @@ function de(a = {}) {
|
|
|
4
4
|
const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
5
5
|
if (!e.length) return "";
|
|
6
6
|
const t = new URLSearchParams();
|
|
7
|
-
return e.forEach(([s,
|
|
7
|
+
return e.forEach(([s, o]) => t.set(s, String(o))), `?${t.toString()}`;
|
|
8
8
|
}
|
|
9
9
|
function he({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
|
|
10
10
|
if (!a) throw new Error("createClient requires a baseUrl");
|
|
11
|
-
const s = a.replace(/\/+$/, ""),
|
|
12
|
-
async function
|
|
11
|
+
const s = a.replace(/\/+$/, ""), o = t || ((...l) => fetch(...l));
|
|
12
|
+
async function r(l) {
|
|
13
13
|
const h = { Accept: "application/json" };
|
|
14
14
|
e && (h.Authorization = `Bearer ${e}`);
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
-
const c = new Error(`api-hsot ${
|
|
18
|
-
throw c.status =
|
|
15
|
+
const n = await o(`${s}${l}`, { headers: h });
|
|
16
|
+
if (!n.ok) {
|
|
17
|
+
const c = new Error(`api-hsot ${n.status} on ${l}`);
|
|
18
|
+
throw c.status = n.status, c;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return n.json();
|
|
21
21
|
}
|
|
22
|
-
async function d(
|
|
23
|
-
const
|
|
22
|
+
async function d(l, h = {}) {
|
|
23
|
+
const n = [];
|
|
24
24
|
let c = null;
|
|
25
25
|
for (let m = 0; m < ce; m += 1) {
|
|
26
|
-
const f = de(c ? { ...h, cursor: c } : h), g = await
|
|
27
|
-
if (
|
|
26
|
+
const f = de(c ? { ...h, cursor: c } : h), g = await r(`${l}${f}`);
|
|
27
|
+
if (n.push(...g.items || []), c = g.nextCursor || null, !c) break;
|
|
28
28
|
}
|
|
29
|
-
return { items:
|
|
29
|
+
return { items: n, total: n.length, nextCursor: null };
|
|
30
30
|
}
|
|
31
31
|
return {
|
|
32
|
-
listSchools: (
|
|
33
|
-
getSchool: (
|
|
34
|
-
listTeams: (
|
|
35
|
-
getTeam: (
|
|
36
|
-
listConferences: (
|
|
37
|
-
listPlayers: (
|
|
38
|
-
listRosters: (
|
|
39
|
-
listGames: (
|
|
40
|
-
getGame: (
|
|
41
|
-
listTournaments: (
|
|
42
|
-
listSeedings: (
|
|
43
|
-
listRankings: (
|
|
44
|
-
listSports: () =>
|
|
32
|
+
listSchools: (l) => d("/schools", l),
|
|
33
|
+
getSchool: (l) => r(`/schools/${l}`),
|
|
34
|
+
listTeams: (l) => d("/teams", l),
|
|
35
|
+
getTeam: (l) => r(`/teams/${l}`),
|
|
36
|
+
listConferences: (l) => d("/conferences", l),
|
|
37
|
+
listPlayers: (l) => d("/players", l),
|
|
38
|
+
listRosters: (l) => d("/rosters", l),
|
|
39
|
+
listGames: (l) => d("/games", l),
|
|
40
|
+
getGame: (l) => r(`/games/${l}`),
|
|
41
|
+
listTournaments: (l) => d("/tournaments", l),
|
|
42
|
+
listSeedings: (l, h) => d(`/tournaments/${l}/seedings`, h),
|
|
43
|
+
listRankings: (l) => d("/rankings", l),
|
|
44
|
+
listSports: () => r("/sports")
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const H = {
|
|
@@ -62,8 +62,8 @@ function D(a) {
|
|
|
62
62
|
const I = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
63
63
|
function y(a, e) {
|
|
64
64
|
if (!a) return "TBD";
|
|
65
|
-
const [t, s,
|
|
66
|
-
return !t || !s || !
|
|
65
|
+
const [t, s, o] = String(a).split("-").map(Number);
|
|
66
|
+
return !t || !s || !o ? "TBD" : new Date(t, s - 1, o).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
|
|
67
67
|
}
|
|
68
68
|
function U(a) {
|
|
69
69
|
if (!a) return "";
|
|
@@ -86,7 +86,7 @@ function M(a = /* @__PURE__ */ new Date()) {
|
|
|
86
86
|
function pe(a, e = M()) {
|
|
87
87
|
const t = [...new Set((a || []).filter(Boolean))].sort();
|
|
88
88
|
if (!t.length || t.includes(e)) return e;
|
|
89
|
-
const s = t.filter((
|
|
89
|
+
const s = t.filter((o) => o < e);
|
|
90
90
|
return s.length ? s[s.length - 1] : t[0];
|
|
91
91
|
}
|
|
92
92
|
function j(a) {
|
|
@@ -94,19 +94,19 @@ function j(a) {
|
|
|
94
94
|
}
|
|
95
95
|
function E(a) {
|
|
96
96
|
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
97
|
-
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255,
|
|
98
|
-
return 0.299 * t + 0.587 * s + 0.114 *
|
|
97
|
+
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, o = e & 255;
|
|
98
|
+
return 0.299 * t + 0.587 * s + 0.114 * o > 150 ? "#0F1B33" : "#FFFFFF";
|
|
99
99
|
}
|
|
100
100
|
const fe = (a) => {
|
|
101
101
|
const e = ["th", "st", "nd", "rd"], t = a % 100;
|
|
102
102
|
return a + (e[(t - 20) % 10] || e[t] || e[0]);
|
|
103
103
|
};
|
|
104
104
|
function X(a, e) {
|
|
105
|
-
const t = (
|
|
106
|
-
const d = /^\d+/.exec(String(
|
|
105
|
+
const t = (r) => {
|
|
106
|
+
const d = /^\d+/.exec(String(r ?? ""));
|
|
107
107
|
return d ? Number(d[0]) : null;
|
|
108
|
-
}, s = t(a),
|
|
109
|
-
return s !== null &&
|
|
108
|
+
}, s = t(a), o = t(e);
|
|
109
|
+
return s !== null && o !== null && s !== o ? o - s : s !== null && o === null ? -1 : s === null && o !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
|
|
110
110
|
}
|
|
111
111
|
function ue(a, e) {
|
|
112
112
|
const t = (s) => String(s?.name ?? s ?? "");
|
|
@@ -126,8 +126,8 @@ function x(a) {
|
|
|
126
126
|
const t = e.indexOf("#");
|
|
127
127
|
let s = "";
|
|
128
128
|
t !== -1 && (s = e.slice(t).split("?")[0], e = e.slice(0, t));
|
|
129
|
-
let
|
|
130
|
-
return
|
|
129
|
+
let o = e.split("?")[0] + s;
|
|
130
|
+
return o = o.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), o = o.replace(/^\/(?=#)/, ""), o.length > 1 && (o = o.replace(/\/+$/, "")), o.toLowerCase();
|
|
131
131
|
}
|
|
132
132
|
function ae() {
|
|
133
133
|
const a = globalThis.location;
|
|
@@ -139,16 +139,16 @@ function ve(a, e, t) {
|
|
|
139
139
|
if (!t) return null;
|
|
140
140
|
const s = x(a);
|
|
141
141
|
if (!s) return null;
|
|
142
|
-
const
|
|
143
|
-
if (s ===
|
|
142
|
+
const o = x(u(e.game, { sport: t, id: "" })), r = x(u(e.school, { id: "" }));
|
|
143
|
+
if (s === o || s.startsWith(`${o}/`) || s === r || s.startsWith(`${r}/`)) return null;
|
|
144
144
|
const d = x(u(e.section, { sport: t, view: "" }));
|
|
145
145
|
if (s === d) return "";
|
|
146
146
|
if (!s.startsWith(`${d}/`)) return null;
|
|
147
|
-
const
|
|
148
|
-
return h.length > 2 || h.some((
|
|
147
|
+
const l = s.slice(d.length + 1), h = l.split("/");
|
|
148
|
+
return h.length > 2 || h.some((n) => !/^[a-z][a-z-]*$/.test(n)) || ge.has(h[0]) ? null : l;
|
|
149
149
|
}
|
|
150
150
|
function be(a, e, t) {
|
|
151
|
-
const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"),
|
|
151
|
+
const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"), r = new Set((e || []).map((d) => d && d.gender).filter((d) => d === "boys" || d === "girls")).size === 2 ? [
|
|
152
152
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
153
153
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
154
154
|
] : [{ label: "Standings", href: s("standings") }];
|
|
@@ -156,7 +156,7 @@ function be(a, e, t) {
|
|
|
156
156
|
{ label: `${I(a)} Home`, href: s("") },
|
|
157
157
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
158
158
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
159
|
-
...
|
|
159
|
+
...r,
|
|
160
160
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
161
161
|
];
|
|
162
162
|
}
|
|
@@ -497,16 +497,16 @@ function Ce(a) {
|
|
|
497
497
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
498
498
|
}
|
|
499
499
|
function z(a, e) {
|
|
500
|
-
const t = {}, s = (
|
|
501
|
-
for (const
|
|
502
|
-
const d = G(
|
|
500
|
+
const t = {}, s = (r) => (t[r] = t[r] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[r]), o = a.filter((r) => r.state === "final" && r.gameType !== "scrimmage" && (!e || r.date <= e)).sort((r, d) => String(r.date).localeCompare(String(d.date)));
|
|
501
|
+
for (const r of o) {
|
|
502
|
+
const d = G(r), l = r.gameType === "conference";
|
|
503
503
|
for (const h of ["home", "away"]) {
|
|
504
|
-
const
|
|
505
|
-
if (!
|
|
506
|
-
const c = s(
|
|
504
|
+
const n = h === "home" ? r.homeTeamId : r.awayTeamId;
|
|
505
|
+
if (!n) continue;
|
|
506
|
+
const c = s(n), m = h === "home" ? r.homeScore : r.awayScore, f = h === "home" ? r.awayScore : r.homeScore;
|
|
507
507
|
c.pf += m, c.pa += f;
|
|
508
508
|
let g = "T";
|
|
509
|
-
d === "tie" ? (c.t += 1,
|
|
509
|
+
d === "tie" ? (c.t += 1, l && (c.ct += 1)) : d === h ? (c.w += 1, l && (c.cw += 1), g = "W") : (c.l += 1, l && (c.cl += 1), g = "L"), c.results.push({ gameId: r.id, date: r.date, mark: g, my: m, their: f, opp: h === "home" ? r.awayTeamId : r.homeTeamId, conf: l });
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
return t;
|
|
@@ -524,10 +524,10 @@ const Z = (a, e, t) => {
|
|
|
524
524
|
}, J = (a) => a.toFixed(3).replace("0.", ".");
|
|
525
525
|
function w(a, e = !1) {
|
|
526
526
|
if (!a) return "0-0";
|
|
527
|
-
const t = e ? a.cw : a.w, s = e ? a.cl : a.l,
|
|
528
|
-
return `${t}-${s}${
|
|
527
|
+
const t = e ? a.cw : a.w, s = e ? a.cl : a.l, o = e ? a.ct : a.t;
|
|
528
|
+
return `${t}-${s}${o ? `-${o}` : ""}`;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function oe(a, e) {
|
|
531
531
|
return a.map((t) => {
|
|
532
532
|
const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
533
533
|
return { team: t, rec: s, confPct: Z(s.cw, s.cl, s.ct), overallPct: Z(s.w, s.l, s.t) };
|
|
@@ -541,68 +541,68 @@ function ee(a, e) {
|
|
|
541
541
|
return t && t.results.length ? t.results[t.results.length - 1] : null;
|
|
542
542
|
}
|
|
543
543
|
function Ve(a, e, t, s = "") {
|
|
544
|
-
let
|
|
545
|
-
for (const
|
|
546
|
-
|
|
547
|
-
return
|
|
544
|
+
let o = null;
|
|
545
|
+
for (const r of a || [])
|
|
546
|
+
r.sport === e && (t && r.effectiveDate > t || s && r.gender && r.gender !== s || (!o || r.effectiveDate > o.effectiveDate) && (o = r));
|
|
547
|
+
return o;
|
|
548
548
|
}
|
|
549
|
-
function W(a, e, t, s,
|
|
550
|
-
const
|
|
551
|
-
if (!
|
|
549
|
+
function W(a, e, t, s, o) {
|
|
550
|
+
const r = e[t];
|
|
551
|
+
if (!r) return null;
|
|
552
552
|
const d = /* @__PURE__ */ new Map();
|
|
553
553
|
for (const h of a || []) {
|
|
554
|
-
if (h.sport !== s ||
|
|
555
|
-
const
|
|
556
|
-
(!c || h.effectiveDate > c.effectiveDate) && d.set(
|
|
554
|
+
if (h.sport !== s || o && h.effectiveDate > o || h.gender && r.gender !== h.gender && r.gender !== "coed") continue;
|
|
555
|
+
const n = h.gender || "", c = d.get(n);
|
|
556
|
+
(!c || h.effectiveDate > c.effectiveDate) && d.set(n, h);
|
|
557
557
|
}
|
|
558
|
-
let
|
|
558
|
+
let l = null;
|
|
559
559
|
for (const h of d.values()) {
|
|
560
|
-
const
|
|
561
|
-
|
|
560
|
+
const n = (h.teamIds || []).indexOf(t);
|
|
561
|
+
n !== -1 && (!l || h.effectiveDate > l.effectiveDate) && (l = { poll: h, rank: n + 1 });
|
|
562
562
|
}
|
|
563
|
-
return
|
|
563
|
+
return l ? l.rank : null;
|
|
564
564
|
}
|
|
565
565
|
function De(a, e, t) {
|
|
566
566
|
if (!a) return { kind: "none", delta: 0 };
|
|
567
567
|
const s = (a.teamIds || []).indexOf(t) + 1;
|
|
568
568
|
if (!s) return { kind: "none", delta: 0 };
|
|
569
569
|
if (!e) return { kind: "same", delta: 0 };
|
|
570
|
-
const
|
|
571
|
-
if (!
|
|
572
|
-
const
|
|
573
|
-
return
|
|
570
|
+
const o = (e.teamIds || []).indexOf(t) + 1;
|
|
571
|
+
if (!o) return { kind: "new", delta: 0 };
|
|
572
|
+
const r = o - s;
|
|
573
|
+
return r > 0 ? { kind: "up", delta: r } : r < 0 ? { kind: "down", delta: -r } : { kind: "same", delta: 0 };
|
|
574
574
|
}
|
|
575
575
|
function Fe(a) {
|
|
576
576
|
return /^https?:\/\//i.test(String(a || ""));
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function re(a, { w: e, h: t } = {}) {
|
|
579
579
|
if (!Fe(a)) return "";
|
|
580
580
|
const s = [];
|
|
581
581
|
e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
|
|
582
|
-
const
|
|
583
|
-
return `${a}${
|
|
582
|
+
const o = a.includes("?") ? "&" : "?";
|
|
583
|
+
return `${a}${o}${s.join("&")}`;
|
|
584
584
|
}
|
|
585
585
|
function A(a, e) {
|
|
586
586
|
const t = e * 2;
|
|
587
|
-
return
|
|
587
|
+
return re(a?.logoAssetId, { w: t, h: t });
|
|
588
588
|
}
|
|
589
589
|
function ze(a, e) {
|
|
590
|
-
return
|
|
590
|
+
return re(a?.photoAssetId, { w: e * 2 });
|
|
591
591
|
}
|
|
592
|
-
function V(a, e, { title: t, sub: s, teams:
|
|
593
|
-
const
|
|
592
|
+
function V(a, e, { title: t, sub: s, teams: o }) {
|
|
593
|
+
const r = ae(), l = !!a.querySelector(':scope > a[slot="nav"]') || ve(r, e.hrefs, e.sport) !== null;
|
|
594
594
|
return i`
|
|
595
595
|
<div class="band section">
|
|
596
596
|
<div class="inner">
|
|
597
597
|
<h1>${t}</h1>
|
|
598
598
|
${s ? i`<p class="sub">${s}</p>` : p}
|
|
599
599
|
</div>
|
|
600
|
-
${
|
|
600
|
+
${l ? i`
|
|
601
601
|
<nav class="sectionnav" aria-label="${I(e.sport)} section">
|
|
602
602
|
<div class="navrow">
|
|
603
603
|
<slot name="nav">
|
|
604
|
-
${be(e.sport,
|
|
605
|
-
aria-current=${
|
|
604
|
+
${be(e.sport, o, e.hrefs).map((h) => i`<a href=${h.href}
|
|
605
|
+
aria-current=${r && x(h.href) === r ? "page" : p}>${h.label}</a>`)}
|
|
606
606
|
</slot>
|
|
607
607
|
</div>
|
|
608
608
|
</nav>` : p}
|
|
@@ -619,9 +619,9 @@ function C(a, e = 26) {
|
|
|
619
619
|
if (t)
|
|
620
620
|
return i`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
621
621
|
src=${t} style="width:${e}px;height:${e}px" />`;
|
|
622
|
-
const s = a.colorPrimary || "#030711",
|
|
622
|
+
const s = a.colorPrimary || "#030711", o = E(s);
|
|
623
623
|
return i`<span class="swatch" aria-hidden="true"
|
|
624
|
-
style="width:${e}px;height:${e}px;background:${s};color:${
|
|
624
|
+
style="width:${e}px;height:${e}px;background:${s};color:${o};font-size:${Math.max(8, e * 0.28)}px"
|
|
625
625
|
>${j(a)}</span>`;
|
|
626
626
|
}
|
|
627
627
|
function Y(a, e, t) {
|
|
@@ -635,11 +635,11 @@ function ie(a, e, t) {
|
|
|
635
635
|
function K(a, e, t = 5) {
|
|
636
636
|
const s = a.records[e];
|
|
637
637
|
if (!s || !s.results.length) return i`<span class="mut">·</span>`;
|
|
638
|
-
const
|
|
639
|
-
return i`<span class="dots" role="img" aria-label="last ${
|
|
640
|
-
${
|
|
641
|
-
title="${
|
|
642
|
-
href=${u(a.hrefs.game, { sport: a.sport, id:
|
|
638
|
+
const o = s.results.slice(-1 * t);
|
|
639
|
+
return i`<span class="dots" role="img" aria-label="last ${o.length} results">
|
|
640
|
+
${o.map((r) => i`<a class="dot ${r.mark}"
|
|
641
|
+
title="${r.mark} ${r.my}-${r.their} vs ${T(a, r.opp)}"
|
|
642
|
+
href=${u(a.hrefs.game, { sport: a.sport, id: r.gameId })}>${r.mark}</a>`)}
|
|
643
643
|
</span>`;
|
|
644
644
|
}
|
|
645
645
|
function B(a, e) {
|
|
@@ -659,8 +659,8 @@ function R(a) {
|
|
|
659
659
|
}
|
|
660
660
|
function ne(a, e, t) {
|
|
661
661
|
if (!e) return i`<span class="mut">·</span>`;
|
|
662
|
-
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId,
|
|
663
|
-
return i`${e.state === "live" ? i`<span class="pill live">Live</span> ` : i`${y(e.date, { month: "numeric", day: "numeric" })} `}${
|
|
662
|
+
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, o = e.homeTeamId === t ? "vs" : "at";
|
|
663
|
+
return i`${e.state === "live" ? i`<span class="pill live">Live</span> ` : i`${y(e.date, { month: "numeric", day: "numeric" })} `}${o} ${_(a, s)}`;
|
|
664
664
|
}
|
|
665
665
|
class Be extends $ {
|
|
666
666
|
static styles = F;
|
|
@@ -681,7 +681,7 @@ class Be extends $ {
|
|
|
681
681
|
this._datePinned = !!this.date;
|
|
682
682
|
}
|
|
683
683
|
async fetchData(e) {
|
|
684
|
-
const t = this.season || N(), [s,
|
|
684
|
+
const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
|
|
685
685
|
e.listSchools(),
|
|
686
686
|
e.listTeams({ sport: this.sport }),
|
|
687
687
|
e.listConferences(),
|
|
@@ -691,10 +691,10 @@ class Be extends $ {
|
|
|
691
691
|
return this._datePinned || (this.date = pe(d.items.map((h) => h.date)), this._datePinned = !0), {
|
|
692
692
|
season: t,
|
|
693
693
|
schools: s.items,
|
|
694
|
-
teams:
|
|
695
|
-
conferences:
|
|
694
|
+
teams: o.items,
|
|
695
|
+
conferences: r.items,
|
|
696
696
|
games: d.items,
|
|
697
|
-
rankings:
|
|
697
|
+
rankings: l.items
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
get ctx() {
|
|
@@ -708,15 +708,15 @@ class Be extends $ {
|
|
|
708
708
|
}, this._ctxData = this.data), this._ctx;
|
|
709
709
|
}
|
|
710
710
|
renderView() {
|
|
711
|
-
const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((
|
|
712
|
-
const c = [
|
|
713
|
-
return c.length ? Math.min(...c) :
|
|
714
|
-
}, d = this.data.games.filter((
|
|
715
|
-
d.sort((
|
|
711
|
+
const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((n) => n.date).filter(Boolean))].sort(), o = Number.MAX_SAFE_INTEGER, r = (n) => {
|
|
712
|
+
const c = [n.awayTeamId, n.homeTeamId].map((m) => W(e.rankings, e.teamsById, m, this.sport, n.date)).filter(Boolean);
|
|
713
|
+
return c.length ? Math.min(...c) : o;
|
|
714
|
+
}, d = this.data.games.filter((n) => n.date === this.date), l = new Map(d.map((n) => [n, r(n)]));
|
|
715
|
+
d.sort((n, c) => (n.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || l.get(n) - l.get(c));
|
|
716
716
|
const h = /* @__PURE__ */ new Map();
|
|
717
|
-
return d.forEach((
|
|
718
|
-
const c =
|
|
719
|
-
h.has(c) || h.set(c, []), h.get(c).push(
|
|
717
|
+
return d.forEach((n) => {
|
|
718
|
+
const c = n.gameType === "conference" && n.conferenceId ? t[n.conferenceId]?.name || "Conference" : n.gameType === "playoff" ? "Playoffs" : n.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
719
|
+
h.has(c) || h.set(c, []), h.get(c).push(n);
|
|
720
720
|
}), i`
|
|
721
721
|
${V(this, e, {
|
|
722
722
|
title: i`${I(this.sport)} scores & schedules`,
|
|
@@ -727,11 +727,11 @@ class Be extends $ {
|
|
|
727
727
|
${P(this)}
|
|
728
728
|
<div class="toolbar">
|
|
729
729
|
<label class="asof" for="datesel">Date</label>
|
|
730
|
-
<select id="datesel" @change=${(
|
|
731
|
-
this.date =
|
|
730
|
+
<select id="datesel" @change=${(n) => {
|
|
731
|
+
this.date = n.target.value;
|
|
732
732
|
}}>
|
|
733
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((
|
|
734
|
-
${y(
|
|
733
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((n) => i`<option value=${n} ?selected=${n === this.date}>
|
|
734
|
+
${y(n, { weekday: "short", month: "short", day: "numeric" })}${n === M() ? " · today" : ""}
|
|
735
735
|
</option>`)}
|
|
736
736
|
</select>
|
|
737
737
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -746,8 +746,8 @@ class Be extends $ {
|
|
|
746
746
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
747
747
|
</div>
|
|
748
748
|
${d.length ? p : i`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
749
|
-
${[...h.entries()].map(([
|
|
750
|
-
<div class="section-title">${
|
|
749
|
+
${[...h.entries()].map(([n, c]) => i`
|
|
750
|
+
<div class="section-title">${n}</div>
|
|
751
751
|
<div class="card"><ul class="gamelist">
|
|
752
752
|
${c.map((m) => this.renderGame(e, m))}
|
|
753
753
|
</ul></div>
|
|
@@ -759,12 +759,12 @@ class Be extends $ {
|
|
|
759
759
|
// a lone score column on the far right read as detached from the teams).
|
|
760
760
|
// Scheduled games carry their start time on the status pill alone.
|
|
761
761
|
renderGame(e, t) {
|
|
762
|
-
const s = t.state === "final" || t.state === "live",
|
|
762
|
+
const s = t.state === "final" || t.state === "live", o = (d, l, h = p) => i`<span class="side">${ie(e, d, t.date)}${s ? i`<span class="score">${l}</span>` : p}${h}</span>`, r = Ce(t);
|
|
763
763
|
return i`
|
|
764
764
|
<li>
|
|
765
765
|
${R(t)}
|
|
766
|
-
<span class="opp matchup">${
|
|
767
|
-
${
|
|
766
|
+
<span class="opp matchup">${o(t.awayTeamId, t.awayScore, i`<span class="at">at</span>`)}${o(t.homeTeamId, t.homeScore)}</span>
|
|
767
|
+
${r ? i`<span class="ff">${T(e, r === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
|
|
768
768
|
<span class="where">${t.venue || ""}</span>
|
|
769
769
|
${t.broadcast ? i`<span class="pill class">${t.broadcast}</span>` : p}
|
|
770
770
|
<a class="box" href=${u(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
|
|
@@ -786,7 +786,7 @@ class Pe extends $ {
|
|
|
786
786
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
787
787
|
}
|
|
788
788
|
async fetchData(e) {
|
|
789
|
-
const t = this.season || N(), [s,
|
|
789
|
+
const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
|
|
790
790
|
e.listConferences({ active: !0 }),
|
|
791
791
|
e.listSchools(),
|
|
792
792
|
e.listTeams({ sport: this.sport }),
|
|
@@ -796,10 +796,10 @@ class Pe extends $ {
|
|
|
796
796
|
return {
|
|
797
797
|
season: t,
|
|
798
798
|
conferences: s.items,
|
|
799
|
-
schools:
|
|
800
|
-
teams:
|
|
799
|
+
schools: o.items,
|
|
800
|
+
teams: r.items,
|
|
801
801
|
games: d.items,
|
|
802
|
-
rankings:
|
|
802
|
+
rankings: l.items
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
get ctx() {
|
|
@@ -813,7 +813,7 @@ class Pe extends $ {
|
|
|
813
813
|
}, this._ctxData = this.data), this._ctx;
|
|
814
814
|
}
|
|
815
815
|
renderView() {
|
|
816
|
-
const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((
|
|
816
|
+
const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((o) => o.classifications || []))].sort(X)].slice(0, 9), s = this.data.conferences.filter((o) => o.active !== !1).filter((o) => this.classFilter === "All" || (o.classifications || []).includes(this.classFilter)).sort(ue);
|
|
817
817
|
return i`
|
|
818
818
|
${V(this, e, {
|
|
819
819
|
title: i`${I(this.sport)} standings`,
|
|
@@ -824,32 +824,32 @@ class Pe extends $ {
|
|
|
824
824
|
${P(this)}
|
|
825
825
|
<div class="toolbar">
|
|
826
826
|
<div role="group" aria-label="Classification filter">
|
|
827
|
-
${t.map((
|
|
827
|
+
${t.map((o) => i`<button class="chip ${this.classFilter === o ? "on" : ""}"
|
|
828
828
|
@click=${() => {
|
|
829
|
-
this.classFilter =
|
|
830
|
-
}}>${
|
|
829
|
+
this.classFilter = o;
|
|
830
|
+
}}>${o}</button>`)}
|
|
831
831
|
</div>
|
|
832
832
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
833
|
-
.value=${this.query} @input=${(
|
|
834
|
-
this.query =
|
|
833
|
+
.value=${this.query} @input=${(o) => {
|
|
834
|
+
this.query = o.target.value;
|
|
835
835
|
}}>
|
|
836
836
|
<span class="spacer"></span>
|
|
837
837
|
<span class="asof">Records through ${y(M(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
838
838
|
</div>
|
|
839
|
-
${s.map((
|
|
839
|
+
${s.map((o) => this.renderConference(e, o))}
|
|
840
840
|
`)}
|
|
841
841
|
`;
|
|
842
842
|
}
|
|
843
843
|
renderConference(e, t) {
|
|
844
844
|
const s = this.data.teams.filter((d) => d.conferenceId === t.id);
|
|
845
845
|
if (!s.length) return p;
|
|
846
|
-
const
|
|
846
|
+
const o = this.query.trim().toLowerCase(), r = oe(s, e.records);
|
|
847
847
|
return i`
|
|
848
848
|
<div class="card">
|
|
849
849
|
<div class="card-head">
|
|
850
850
|
<h2>${t.name}</h2>
|
|
851
851
|
${[...t.classifications || []].sort(X).map((d) => i`<span class="pill class">${d}</span>`)}
|
|
852
|
-
<span class="meta">${
|
|
852
|
+
<span class="meta">${r.length} teams · membership derives from teams</span>
|
|
853
853
|
</div>
|
|
854
854
|
<div class="tablewrap"><table class="data">
|
|
855
855
|
<thead><tr>
|
|
@@ -858,25 +858,25 @@ class Pe extends $ {
|
|
|
858
858
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
859
859
|
</tr></thead>
|
|
860
860
|
<tbody>
|
|
861
|
-
${
|
|
861
|
+
${r.map((d, l) => this.renderRow(e, d, l, o))}
|
|
862
862
|
</tbody>
|
|
863
863
|
</table></div>
|
|
864
864
|
</div>
|
|
865
865
|
`;
|
|
866
866
|
}
|
|
867
|
-
renderRow(e, t, s,
|
|
868
|
-
const
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
867
|
+
renderRow(e, t, s, o) {
|
|
868
|
+
const r = e.schoolsById[t.team.schoolId], d = r?.name || t.team.name || "TBD";
|
|
869
|
+
if (o && !d.toLowerCase().includes(o)) return p;
|
|
870
|
+
const l = t.rec.pf - t.rec.pa, h = q(this.data.games, t.team.id), n = () => {
|
|
871
871
|
location.href = u(e.hrefs.school, { id: t.team.schoolId });
|
|
872
872
|
};
|
|
873
873
|
return i`
|
|
874
874
|
<tr class="rowlink" @click=${(c) => {
|
|
875
|
-
c.target.closest("a") ||
|
|
875
|
+
c.target.closest("a") || n();
|
|
876
876
|
}}>
|
|
877
877
|
<td class="mut">${s + 1}</td>
|
|
878
878
|
<td class="teamcell">
|
|
879
|
-
${C(
|
|
879
|
+
${C(r)}${Y(e, t.team.id, null)}
|
|
880
880
|
<a href=${u(e.hrefs.school, { id: t.team.schoolId })}>${d}</a>
|
|
881
881
|
</td>
|
|
882
882
|
<td class="num">${w(t.rec, !0)}</td>
|
|
@@ -885,7 +885,7 @@ class Pe extends $ {
|
|
|
885
885
|
<td class="num">${J(t.overallPct)}</td>
|
|
886
886
|
<td class="num">${t.rec.pf}</td>
|
|
887
887
|
<td class="num">${t.rec.pa}</td>
|
|
888
|
-
<td class="num" style="color:${
|
|
888
|
+
<td class="num" style="color:${l >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${l > 0 ? "+" : ""}${l}</td>
|
|
889
889
|
<td>${L(t.rec.results) || "·"}</td>
|
|
890
890
|
<td>${K(e, t.team.id)}</td>
|
|
891
891
|
<td>${ne(e, h, t.team.id)}</td>
|
|
@@ -929,20 +929,20 @@ class Ae extends $ {
|
|
|
929
929
|
e && (this.pollDate = e);
|
|
930
930
|
}
|
|
931
931
|
async fetchData(e) {
|
|
932
|
-
const t = this.season || N(), [s,
|
|
932
|
+
const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
|
|
933
933
|
e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
934
934
|
e.listSchools(),
|
|
935
935
|
e.listTeams({ sport: this.sport }),
|
|
936
936
|
e.listConferences(),
|
|
937
937
|
e.listGames({ sport: this.sport, season: t })
|
|
938
|
-
]), h = s.items.filter((
|
|
938
|
+
]), h = s.items.filter((n) => !this.gender || !n.gender || n.gender === this.gender).sort((n, c) => c.effectiveDate.localeCompare(n.effectiveDate));
|
|
939
939
|
return {
|
|
940
940
|
season: t,
|
|
941
941
|
polls: h,
|
|
942
|
-
schools:
|
|
943
|
-
teams:
|
|
942
|
+
schools: o.items,
|
|
943
|
+
teams: r.items,
|
|
944
944
|
conferences: d.items,
|
|
945
|
-
games:
|
|
945
|
+
games: l.items
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
948
|
get ctx() {
|
|
@@ -956,17 +956,17 @@ class Ae extends $ {
|
|
|
956
956
|
}, this._ctxData = this.data), this._ctx;
|
|
957
957
|
}
|
|
958
958
|
sparkline(e, t, s) {
|
|
959
|
-
const
|
|
959
|
+
const l = t.map((m, f) => {
|
|
960
960
|
const g = (m.teamIds || []).indexOf(e);
|
|
961
961
|
if (g === -1) return null;
|
|
962
962
|
const k = t.length === 1 ? 96 / 2 : f / (t.length - 1) * 90 + 3, O = 3 + g / 24 * 20;
|
|
963
963
|
return { x: k, y: O };
|
|
964
964
|
}), h = [];
|
|
965
|
-
let
|
|
966
|
-
if (
|
|
967
|
-
m ?
|
|
968
|
-
}),
|
|
969
|
-
const c =
|
|
965
|
+
let n = [];
|
|
966
|
+
if (l.forEach((m) => {
|
|
967
|
+
m ? n.push(m) : n.length && (h.push(n), n = []);
|
|
968
|
+
}), n.length && h.push(n), !h.length) return p;
|
|
969
|
+
const c = l[s];
|
|
970
970
|
return i`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
971
971
|
${h.map((m) => Q`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
972
972
|
points=${m.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
@@ -974,13 +974,13 @@ class Ae extends $ {
|
|
|
974
974
|
</svg>`;
|
|
975
975
|
}
|
|
976
976
|
movement(e, t, s) {
|
|
977
|
-
const
|
|
978
|
-
return
|
|
977
|
+
const o = De(e, t, s);
|
|
978
|
+
return o.kind === "up" ? i`<span class="delta up">▲ ${o.delta}</span>` : o.kind === "down" ? i`<span class="delta down">▼ ${o.delta}</span>` : o.kind === "new" ? i`<span class="delta new">NEW</span>` : o.kind === "same" ? i`<span class="delta same">—</span>` : i`<span class="delta same">·</span>`;
|
|
979
979
|
}
|
|
980
980
|
renderView() {
|
|
981
981
|
const e = this.ctx, t = this.data.polls;
|
|
982
982
|
if (!t.length) return i`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
983
|
-
const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)),
|
|
983
|
+
const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), o = t[s] || t[0], r = t[s + 1] || null, d = t.slice().reverse(), l = d.indexOf(o), h = v(this.data.conferences), n = (o.teamIds || [])[0], c = n ? S(e, n) : null;
|
|
984
984
|
return i`
|
|
985
985
|
${V(this, e, {
|
|
986
986
|
title: i`${I(this.sport)} Top 25`,
|
|
@@ -994,7 +994,7 @@ class Ae extends $ {
|
|
|
994
994
|
<select id="pollsel" @change=${(m) => {
|
|
995
995
|
this.pollDate = m.target.value;
|
|
996
996
|
}}>
|
|
997
|
-
${t.map((m, f) => i`<option value=${m.effectiveDate} ?selected=${m ===
|
|
997
|
+
${t.map((m, f) => i`<option value=${m.effectiveDate} ?selected=${m === o}>
|
|
998
998
|
${y(m.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
999
999
|
</option>`)}
|
|
1000
1000
|
</select>
|
|
@@ -1009,59 +1009,59 @@ class Ae extends $ {
|
|
|
1009
1009
|
<span class="spacer"></span>
|
|
1010
1010
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1011
1011
|
</div>
|
|
1012
|
-
${c ? this.renderHero(e,
|
|
1012
|
+
${c ? this.renderHero(e, o, r, n, c, h) : p}
|
|
1013
1013
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1014
1014
|
<thead><tr>
|
|
1015
1015
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1016
1016
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1017
1017
|
</tr></thead>
|
|
1018
1018
|
<tbody>
|
|
1019
|
-
${(
|
|
1019
|
+
${(o.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, o, r, d, l, h, m, f + 1))}
|
|
1020
1020
|
</tbody>
|
|
1021
1021
|
</table></div></div>
|
|
1022
1022
|
<p class="note">Ranks elsewhere on the site resolve the poll in effect on the game date, so past box scores keep the ranks they were played under.</p>
|
|
1023
1023
|
`)}
|
|
1024
1024
|
`;
|
|
1025
1025
|
}
|
|
1026
|
-
renderHero(e, t, s,
|
|
1027
|
-
const
|
|
1026
|
+
renderHero(e, t, s, o, r, d) {
|
|
1027
|
+
const l = e.records[o], h = ee(e.records, o), n = d[e.teamsById[o]?.conferenceId], c = `linear-gradient(120deg, ${r.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1028
1028
|
return i`
|
|
1029
1029
|
<div class="hero1" style="background:${c}">
|
|
1030
1030
|
<div class="bigrank">#1</div>
|
|
1031
|
-
${C(
|
|
1031
|
+
${C(r, 64)}
|
|
1032
1032
|
<div>
|
|
1033
|
-
<h2><a href=${u(e.hrefs.school, { id:
|
|
1033
|
+
<h2><a href=${u(e.hrefs.school, { id: r.id })}>${r.name} ${r.mascot || ""}</a></h2>
|
|
1034
1034
|
<div class="facts">
|
|
1035
|
-
${w(
|
|
1036
|
-
· streak ${L(
|
|
1035
|
+
${w(l)} overall${n ? i` · ${w(l, !0)} ${n.name}` : p}
|
|
1036
|
+
· streak ${L(l?.results) || "·"}
|
|
1037
1037
|
${h ? i` · last: ${h.mark} ${h.my}-${h.their} vs ${_(e, h.opp)}` : p}
|
|
1038
|
-
${this.movement(t, s,
|
|
1038
|
+
${this.movement(t, s, o)}
|
|
1039
1039
|
</div>
|
|
1040
1040
|
</div>
|
|
1041
1041
|
</div>
|
|
1042
1042
|
`;
|
|
1043
1043
|
}
|
|
1044
|
-
renderRow(e, t, s,
|
|
1045
|
-
const
|
|
1046
|
-
if (!
|
|
1047
|
-
const c = e.records[
|
|
1048
|
-
location.href = u(e.hrefs.school, { id:
|
|
1044
|
+
renderRow(e, t, s, o, r, d, l, h) {
|
|
1045
|
+
const n = S(e, l);
|
|
1046
|
+
if (!n) return p;
|
|
1047
|
+
const c = e.records[l], m = ee(e.records, l), f = q(this.data.games, l), g = d[e.teamsById[l]?.conferenceId], k = () => {
|
|
1048
|
+
location.href = u(e.hrefs.school, { id: n.id });
|
|
1049
1049
|
};
|
|
1050
1050
|
return i`
|
|
1051
1051
|
<tr class="rowlink" @click=${(O) => {
|
|
1052
1052
|
O.target.closest("a") || k();
|
|
1053
1053
|
}}>
|
|
1054
1054
|
<td class="num" style="font-weight:700">${h}</td>
|
|
1055
|
-
<td>${this.movement(t, s,
|
|
1056
|
-
<td class="teamcell">${C(
|
|
1057
|
-
<span class="mut" style="font-size:0.78rem">${
|
|
1055
|
+
<td>${this.movement(t, s, l)}</td>
|
|
1056
|
+
<td class="teamcell">${C(n)}<a href=${u(e.hrefs.school, { id: n.id })}>${n.name}</a>
|
|
1057
|
+
<span class="mut" style="font-size:0.78rem">${n.mascot || ""}</span></td>
|
|
1058
1058
|
<td class="num">${w(c)}</td>
|
|
1059
1059
|
<td class="mut">${g?.name || "Independent"}</td>
|
|
1060
1060
|
<td>${m ? i`<a class="box" style="text-decoration:none" href=${u(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
|
|
1061
1061
|
<b style="color:${m.mark === "W" ? "var(--hsot-win)" : m.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${m.mark}</b>
|
|
1062
1062
|
${m.my}-${m.their} vs ${_(e, m.opp)}</a>` : i`<span class="mut">·</span>`}</td>
|
|
1063
|
-
<td>${ne(e, f,
|
|
1064
|
-
<td>${this.sparkline(
|
|
1063
|
+
<td>${ne(e, f, l)}</td>
|
|
1064
|
+
<td>${this.sparkline(l, o, r)}</td>
|
|
1065
1065
|
</tr>
|
|
1066
1066
|
`;
|
|
1067
1067
|
}
|
|
@@ -1089,12 +1089,37 @@ const _e = b`
|
|
|
1089
1089
|
.tile .k { font-family: var(--hsot-heading-font); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; font-weight: 700; color: var(--hsot-red-deep); }
|
|
1090
1090
|
.tile .v { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.7rem; line-height: 1.15; color: var(--hsot-black); }
|
|
1091
1091
|
.tile .s { font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1092
|
-
|
|
1092
|
+
/* Schedule and roster split the width evenly. The roster used to get
|
|
1093
|
+
5/12 (~393px beside the rail), which held six columns; the season
|
|
1094
|
+
photo and the College column (2026-09) took its table to ~480px and
|
|
1095
|
+
gave the card a horizontal scrollbar on desktop while the schedule
|
|
1096
|
+
sat in white space. Both tracks are minmax(0, …) so a table that is
|
|
1097
|
+
still too wide scrolls inside its card instead of stretching the
|
|
1098
|
+
grid — and the page — past the viewport. */
|
|
1099
|
+
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
|
|
1093
1100
|
/* The season roster photo heads the roster card, above the table. Natural
|
|
1094
1101
|
height: a team photo is never cropped to a box — the card's overflow
|
|
1095
1102
|
rounds its top corners. */
|
|
1096
1103
|
.rosterphoto { display: block; width: 100%; height: auto; background: var(--hsot-gray-1); border-bottom: 1px solid var(--hsot-gray-2); }
|
|
1097
|
-
|
|
1104
|
+
/* Roster table: a little less side padding than the shared table so all
|
|
1105
|
+
seven columns fit the card beside the rail. */
|
|
1106
|
+
table.data.roster th, table.data.roster td { padding-left: 10px; padding-right: 10px; }
|
|
1107
|
+
table.data.roster .sub { display: none; }
|
|
1108
|
+
/* A bare 1fr here was the mobile bug: its implicit minimum is the
|
|
1109
|
+
content's width, so the nowrap roster table widened the single column
|
|
1110
|
+
past the phone and the whole page scrolled sideways. */
|
|
1111
|
+
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1112
|
+
@media (max-width: 720px) {
|
|
1113
|
+
/* Phone: the roster fits the screen instead of scrolling. Position
|
|
1114
|
+
and class fold under the player's name, names and colleges may
|
|
1115
|
+
wrap, and cells tighten. Five columns come to ~330px, inside a
|
|
1116
|
+
360px phone's view padding. */
|
|
1117
|
+
table.data.roster { font-size: 13px; }
|
|
1118
|
+
table.data.roster th, table.data.roster td { padding: 7px 8px; }
|
|
1119
|
+
table.data.roster .pos, table.data.roster .cls { display: none; }
|
|
1120
|
+
table.data.roster td.player, table.data.roster td.college { white-space: normal; }
|
|
1121
|
+
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1122
|
+
}
|
|
1098
1123
|
`;
|
|
1099
1124
|
class Re extends $ {
|
|
1100
1125
|
static styles = [...F, _e];
|
|
@@ -1114,7 +1139,7 @@ class Re extends $ {
|
|
|
1114
1139
|
e && !this.sport && (this.sport = e);
|
|
1115
1140
|
}
|
|
1116
1141
|
async fetchData(e) {
|
|
1117
|
-
const t = this.season || N(), s = await e.getSchool(this.schoolId),
|
|
1142
|
+
const t = this.season || N(), s = await e.getSchool(this.schoolId), r = (await e.listTeams({ schoolId: this.schoolId })).items, d = r.find((k) => k.sport === (this.sport || "football")) || r[0] || null, [l, h, n, c, m, f, g] = await Promise.all([
|
|
1118
1143
|
d ? e.listGames({ sport: d.sport, season: t }) : Promise.resolve({ items: [] }),
|
|
1119
1144
|
d ? e.listTeams({ sport: d.sport }) : Promise.resolve({ items: [] }),
|
|
1120
1145
|
e.listSchools(),
|
|
@@ -1128,11 +1153,11 @@ class Re extends $ {
|
|
|
1128
1153
|
return {
|
|
1129
1154
|
season: t,
|
|
1130
1155
|
school: s,
|
|
1131
|
-
teams:
|
|
1156
|
+
teams: r,
|
|
1132
1157
|
active: d,
|
|
1133
|
-
games:
|
|
1158
|
+
games: l.items,
|
|
1134
1159
|
allTeams: h.items,
|
|
1135
|
-
schools:
|
|
1160
|
+
schools: n.items,
|
|
1136
1161
|
conferences: c.items,
|
|
1137
1162
|
rankings: m.items,
|
|
1138
1163
|
roster: f.items.find((k) => k.season === t) || null,
|
|
@@ -1153,9 +1178,9 @@ class Re extends $ {
|
|
|
1153
1178
|
this.sport = e, this.load();
|
|
1154
1179
|
}
|
|
1155
1180
|
renderView() {
|
|
1156
|
-
const { school: e, teams: t, active: s, season:
|
|
1181
|
+
const { school: e, teams: t, active: s, season: o } = this.data;
|
|
1157
1182
|
if (!e) return i`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1158
|
-
const
|
|
1183
|
+
const r = this.ctx, d = E(e.colorPrimary || "#030711"), l = (e.adm || [])[0], h = v(this.data.conferences), n = s ? h[s.conferenceId] : null;
|
|
1159
1184
|
return i`
|
|
1160
1185
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${d}">
|
|
1161
1186
|
<div class="inner">
|
|
@@ -1165,8 +1190,8 @@ class Re extends $ {
|
|
|
1165
1190
|
<div class="facts">
|
|
1166
1191
|
${e.location ? i`<span><b>Location</b>${e.location}${e.county ? i` · ${e.county} County` : p}</span>` : p}
|
|
1167
1192
|
${e.association ? i`<span><b>League</b>${e.association}${e.classification ? i` · ${e.classification}` : p}</span>` : p}
|
|
1168
|
-
${
|
|
1169
|
-
${
|
|
1193
|
+
${n ? i`<span><b>Conference</b>${n.name}</span>` : p}
|
|
1194
|
+
${l ? i`<span><b>Enrollment</b>${l.value.toLocaleString()} (${l.season} ADM)</span>` : p}
|
|
1170
1195
|
${e.openingYear ? i`<span><b>Opened</b>${e.openingYear}</span>` : p}
|
|
1171
1196
|
${e.areaCode ? i`<span><b>Area</b>${e.areaCode}</span>` : p}
|
|
1172
1197
|
</div>
|
|
@@ -1182,22 +1207,22 @@ class Re extends $ {
|
|
|
1182
1207
|
</div>
|
|
1183
1208
|
${B(this, i`
|
|
1184
1209
|
${P(this)}
|
|
1185
|
-
${s ? this.renderTeam(
|
|
1210
|
+
${s ? this.renderTeam(r, s, n, o) : i`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1186
1211
|
`)}
|
|
1187
1212
|
`;
|
|
1188
1213
|
}
|
|
1189
|
-
renderTeam(e, t, s,
|
|
1190
|
-
const
|
|
1214
|
+
renderTeam(e, t, s, o) {
|
|
1215
|
+
const r = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, d = r.w + r.l + r.t, l = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? oe(l, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, n = W(e.rankings, e.teamsById, t.id, t.sport, null), c = this.data.games.filter((m) => m.homeTeamId === t.id || m.awayTeamId === t.id).sort((m, f) => String(m.date).localeCompare(String(f.date)));
|
|
1191
1216
|
return i`
|
|
1192
1217
|
<div class="tiles">
|
|
1193
|
-
<div class="tile"><div class="k">Overall</div><div class="v">${w(
|
|
1194
|
-
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(
|
|
1195
|
-
<div class="s">${h ? `${fe(h)} of ${
|
|
1196
|
-
<div class="tile"><div class="k">Points</div><div class="v">${d ? (
|
|
1197
|
-
<div class="s">scored per game · ${d ? (
|
|
1198
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${L(
|
|
1218
|
+
<div class="tile"><div class="k">Overall</div><div class="v">${w(r)}</div><div class="s">${d} games played</div></div>
|
|
1219
|
+
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(r, !0)}</div>
|
|
1220
|
+
<div class="s">${h ? `${fe(h)} of ${l.length}` : "·"}</div></div>
|
|
1221
|
+
<div class="tile"><div class="k">Points</div><div class="v">${d ? (r.pf / d).toFixed(1) : "0.0"}</div>
|
|
1222
|
+
<div class="s">scored per game · ${d ? (r.pa / d).toFixed(1) : "0.0"} allowed</div></div>
|
|
1223
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${L(r.results) || "·"}</div>
|
|
1199
1224
|
<div class="s">last 5: ${K(e, t.id)}</div></div>
|
|
1200
|
-
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${
|
|
1225
|
+
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${n ? `#${n}` : "NR"}</div>
|
|
1201
1226
|
<div class="s"><a href=${u(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1202
1227
|
</div>
|
|
1203
1228
|
${(t.championships || []).length ? i`
|
|
@@ -1208,31 +1233,31 @@ class Re extends $ {
|
|
|
1208
1233
|
<div>
|
|
1209
1234
|
<div class="section-title">Schedule & results</div>
|
|
1210
1235
|
<div class="card">
|
|
1211
|
-
${c.length ? i`<ul class="gamelist">${c.map((m) => this.renderGameRow(e, t, m))}</ul>` : i`<p class="empty">No ${t.sport} games recorded for ${
|
|
1236
|
+
${c.length ? i`<ul class="gamelist">${c.map((m) => this.renderGameRow(e, t, m))}</ul>` : i`<p class="empty">No ${t.sport} games recorded for ${o}.</p>`}
|
|
1212
1237
|
</div>
|
|
1213
1238
|
</div>
|
|
1214
1239
|
<div>
|
|
1215
|
-
<div class="section-title">Roster · ${
|
|
1216
|
-
<div class="card">${this.renderRoster(t,
|
|
1240
|
+
<div class="section-title">Roster · ${o}</div>
|
|
1241
|
+
<div class="card">${this.renderRoster(t, o)}</div>
|
|
1217
1242
|
</div>
|
|
1218
1243
|
</div>
|
|
1219
1244
|
`;
|
|
1220
1245
|
}
|
|
1221
1246
|
renderGameRow(e, t, s) {
|
|
1222
|
-
const
|
|
1247
|
+
const o = s.homeTeamId === t.id, r = o ? s.awayTeamId : s.homeTeamId, d = o ? s.homeScore : s.awayScore, l = o ? s.awayScore : s.homeScore;
|
|
1223
1248
|
let h = i`<span class="mut">${U(s.time)}</span>`;
|
|
1224
1249
|
if (s.state === "final") {
|
|
1225
|
-
const c = G(s), m = c === "tie" ? "T" : c === (
|
|
1226
|
-
h = i`<span class=${m}>${m}</span> ${d}-${
|
|
1227
|
-
} else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${
|
|
1228
|
-
const
|
|
1250
|
+
const c = G(s), m = c === "tie" ? "T" : c === (o ? "home" : "away") ? "W" : "L";
|
|
1251
|
+
h = i`<span class=${m}>${m}</span> ${d}-${l}${s.finish === "overtime" ? i` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? i` <span class="mut">FF</span>` : p}`;
|
|
1252
|
+
} else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${l}</span>`);
|
|
1253
|
+
const n = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1229
1254
|
return i`
|
|
1230
1255
|
<li>
|
|
1231
1256
|
<span class="d">${y(s.date)}</span>
|
|
1232
1257
|
${se(s).kind === "sched" ? p : R(s)}
|
|
1233
1258
|
<span class="res">${h}</span>
|
|
1234
|
-
<span class="opp">${
|
|
1235
|
-
<span class="pill type">${
|
|
1259
|
+
<span class="opp">${o ? "vs" : "at"} ${ie(e, r, s.date)}
|
|
1260
|
+
<span class="pill type">${n}</span>
|
|
1236
1261
|
${s.broadcast ? i`<span class="pill class">${s.broadcast}</span>` : p}
|
|
1237
1262
|
</span>
|
|
1238
1263
|
<span class="where">${s.venue || ""}</span>
|
|
@@ -1244,24 +1269,26 @@ class Re extends $ {
|
|
|
1244
1269
|
const s = this.data.roster;
|
|
1245
1270
|
if (!s)
|
|
1246
1271
|
return i`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1247
|
-
const
|
|
1272
|
+
const o = ze(s, 560), r = this.data.school?.name || "", d = v(this.data.players), l = s.entries.slice().sort((n, c) => (n.number || 0) - (c.number || 0)), h = l.some((n) => d[n.playerId]?.college);
|
|
1248
1273
|
return i`
|
|
1249
|
-
${
|
|
1250
|
-
alt="${
|
|
1251
|
-
<div class="tablewrap"><table class="data">
|
|
1252
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ? i`<th>College</th>` : p}</tr></thead>
|
|
1274
|
+
${o ? i`<img class="rosterphoto" src=${o} loading="lazy" decoding="async"
|
|
1275
|
+
alt="${r} ${e.name} ${t} team photo" />` : p}
|
|
1276
|
+
<div class="tablewrap"><table class="data roster">
|
|
1277
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ? i`<th>College</th>` : p}</tr></thead>
|
|
1253
1278
|
<tbody>
|
|
1254
|
-
${
|
|
1255
|
-
const c = d[
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
<td>${
|
|
1260
|
-
<td class="
|
|
1279
|
+
${l.map((n) => {
|
|
1280
|
+
const c = d[n.playerId];
|
|
1281
|
+
if (!c) return p;
|
|
1282
|
+
const m = [n.position, c.classOf].filter(Boolean).join(" · ") || "·";
|
|
1283
|
+
return i`<tr>
|
|
1284
|
+
<td class="num mut">${n.number ?? "·"}</td>
|
|
1285
|
+
<td class="player" style="font-weight:500">${c.firstName} ${c.lastName}<span class="sub">${m}</span></td>
|
|
1286
|
+
<td class="pos">${n.position || "·"}</td>
|
|
1287
|
+
<td class="cls mut">${c.classOf || "·"}</td>
|
|
1261
1288
|
<td class="num">${me(c.heightIn)}</td>
|
|
1262
1289
|
<td class="num">${c.weightLb || "·"}</td>
|
|
1263
|
-
${h ? i`<td>${c.college || "·"}</td>` : p}
|
|
1264
|
-
</tr
|
|
1290
|
+
${h ? i`<td class="college">${c.college || "·"}</td>` : p}
|
|
1291
|
+
</tr>`;
|
|
1265
1292
|
})}
|
|
1266
1293
|
</tbody>
|
|
1267
1294
|
</table></div>
|
|
@@ -1293,10 +1320,10 @@ function le(a) {
|
|
|
1293
1320
|
return { uri: a, title: a };
|
|
1294
1321
|
}
|
|
1295
1322
|
async function He(a, e, t) {
|
|
1296
|
-
const
|
|
1297
|
-
if (!
|
|
1298
|
-
const
|
|
1299
|
-
return e.map((
|
|
1323
|
+
const o = await ((...l) => fetch(...l))(Oe(a, e));
|
|
1324
|
+
if (!o.ok) throw new Error(`search answered ${o.status}`);
|
|
1325
|
+
const r = await o.json(), d = new Map((r.items || []).map((l) => [l.uri, l]));
|
|
1326
|
+
return e.map((l) => d.get(l) || le(l));
|
|
1300
1327
|
}
|
|
1301
1328
|
const Ue = b`
|
|
1302
1329
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
@@ -1352,7 +1379,7 @@ class Me extends $ {
|
|
|
1352
1379
|
super(), this.gameId = "", this.searchApi = "";
|
|
1353
1380
|
}
|
|
1354
1381
|
async fetchData(e) {
|
|
1355
|
-
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [
|
|
1382
|
+
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [o, r, d, l, h, n] = await Promise.all([
|
|
1356
1383
|
e.listSchools(),
|
|
1357
1384
|
e.listTeams({ sport: t.sport }),
|
|
1358
1385
|
e.listConferences(),
|
|
@@ -1364,12 +1391,12 @@ class Me extends $ {
|
|
|
1364
1391
|
]);
|
|
1365
1392
|
return {
|
|
1366
1393
|
game: t,
|
|
1367
|
-
schools:
|
|
1368
|
-
teams:
|
|
1394
|
+
schools: o.items,
|
|
1395
|
+
teams: r.items,
|
|
1369
1396
|
conferences: d.items,
|
|
1370
|
-
rankings:
|
|
1397
|
+
rankings: l.items,
|
|
1371
1398
|
games: h.items,
|
|
1372
|
-
coverage:
|
|
1399
|
+
coverage: n
|
|
1373
1400
|
};
|
|
1374
1401
|
}
|
|
1375
1402
|
get ctx() {
|
|
@@ -1385,7 +1412,7 @@ class Me extends $ {
|
|
|
1385
1412
|
renderView() {
|
|
1386
1413
|
const e = this.data.game;
|
|
1387
1414
|
if (!e) return i`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1388
|
-
const t = this.ctx, s = v(this.data.conferences),
|
|
1415
|
+
const t = this.ctx, s = v(this.data.conferences), o = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, r = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, d = G(e), l = (c) => e.state === "final" && d !== c && d !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, n = this.data.games.filter((c) => c.id !== e.id && c.state === "final" && c.gameType !== "scrimmage" && (c.homeTeamId === e.homeTeamId && c.awayTeamId === e.awayTeamId || c.homeTeamId === e.awayTeamId && c.awayTeamId === e.homeTeamId));
|
|
1389
1416
|
return i`
|
|
1390
1417
|
${B(this, i`
|
|
1391
1418
|
${P(this)}
|
|
@@ -1396,12 +1423,12 @@ class Me extends $ {
|
|
|
1396
1423
|
</p>
|
|
1397
1424
|
<div class="card">
|
|
1398
1425
|
<div class="scorehead">
|
|
1399
|
-
${this.teamBlock(t, e, e.awayTeamId,
|
|
1426
|
+
${this.teamBlock(t, e, e.awayTeamId, o, !1)}
|
|
1400
1427
|
<div class="mid">
|
|
1401
1428
|
<div class="bigscore">
|
|
1402
|
-
<span style=${
|
|
1429
|
+
<span style=${l("away")}>${e.awayScore}</span>
|
|
1403
1430
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1404
|
-
<span style=${
|
|
1431
|
+
<span style=${l("home")}>${e.homeScore}</span>
|
|
1405
1432
|
</div>
|
|
1406
1433
|
<div class="status">${R(e)}</div>
|
|
1407
1434
|
<div class="status">${y(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? i` · ${U(e.time)}` : p} · ${e.venue || "Venue TBD"}
|
|
@@ -1412,9 +1439,9 @@ class Me extends $ {
|
|
|
1412
1439
|
${(e.tags || []).map((c) => i`<span class="pill type">${c}</span>`)}
|
|
1413
1440
|
</div>
|
|
1414
1441
|
</div>
|
|
1415
|
-
${this.teamBlock(t, e, e.homeTeamId,
|
|
1442
|
+
${this.teamBlock(t, e, e.homeTeamId, r, !0)}
|
|
1416
1443
|
</div>
|
|
1417
|
-
${this.renderLineScore(e,
|
|
1444
|
+
${this.renderLineScore(e, o, r)}
|
|
1418
1445
|
${e.notes ? i`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${e.notes}</p>` : p}
|
|
1419
1446
|
</div>
|
|
1420
1447
|
${(this.data.coverage || []).length ? i`
|
|
@@ -1435,12 +1462,12 @@ class Me extends $ {
|
|
|
1435
1462
|
</div>` : p}
|
|
1436
1463
|
<div class="section-title">Season context</div>
|
|
1437
1464
|
<div class="cols">
|
|
1438
|
-
${[[e.awayTeamId,
|
|
1465
|
+
${[[e.awayTeamId, o], [e.homeTeamId, r]].map(([c, m]) => this.renderContext(t, c, m))}
|
|
1439
1466
|
</div>
|
|
1440
|
-
${
|
|
1467
|
+
${n.length ? i`
|
|
1441
1468
|
<div class="section-title">Head to head this season</div>
|
|
1442
1469
|
<div class="card"><ul class="gamelist">
|
|
1443
|
-
${
|
|
1470
|
+
${n.map((c) => i`<li>
|
|
1444
1471
|
<span class="d">${y(c.date)}</span>${R(c)}
|
|
1445
1472
|
<span class="opp">${T(t, c.awayTeamId)} ${c.awayScore}, ${T(t, c.homeTeamId)} ${c.homeScore}</span>
|
|
1446
1473
|
<a class="box" href=${u(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
|
|
@@ -1449,36 +1476,36 @@ class Me extends $ {
|
|
|
1449
1476
|
`)}
|
|
1450
1477
|
`;
|
|
1451
1478
|
}
|
|
1452
|
-
teamBlock(e, t, s,
|
|
1453
|
-
if (!
|
|
1454
|
-
const d = e.teamsById[s],
|
|
1479
|
+
teamBlock(e, t, s, o, r) {
|
|
1480
|
+
if (!o) return i`<div class="teamblock ${r ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1481
|
+
const d = e.teamsById[s], l = e.records[s], h = A(o, 58);
|
|
1455
1482
|
return i`
|
|
1456
|
-
<div class="teamblock ${
|
|
1457
|
-
${h ? i`<img class="crest logo" alt="" loading="lazy" src=${h} />` : i`<span class="crest" style="background:${
|
|
1483
|
+
<div class="teamblock ${r ? "right" : ""}">
|
|
1484
|
+
${h ? i`<img class="crest logo" alt="" loading="lazy" src=${h} />` : i`<span class="crest" style="background:${o.colorPrimary || "#030711"};color:${E(o.colorPrimary || "#030711")}">${j(o)}</span>`}
|
|
1458
1485
|
<div>
|
|
1459
|
-
<div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id:
|
|
1460
|
-
<div class="trec">${
|
|
1486
|
+
<div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id: o.id })}>${o.name}</a></div>
|
|
1487
|
+
<div class="trec">${o.mascot || ""} · ${w(l)}${d?.conferenceId ? i` · ${w(l, !0)} conf` : p}</div>
|
|
1461
1488
|
</div>
|
|
1462
1489
|
</div>
|
|
1463
1490
|
`;
|
|
1464
1491
|
}
|
|
1465
1492
|
renderLineScore(e, t, s) {
|
|
1466
|
-
const
|
|
1467
|
-
if (!
|
|
1493
|
+
const o = e.periodScores || [];
|
|
1494
|
+
if (!o.length)
|
|
1468
1495
|
return i`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1469
|
-
const
|
|
1470
|
-
const m =
|
|
1471
|
-
return m ? m[
|
|
1472
|
-
}, h = (
|
|
1496
|
+
const r = Math.max(4, ...o.map((n) => n.period)), d = (n) => n <= 4 ? String(n) : `OT${n > 5 ? n - 4 : ""}`, l = (n, c) => {
|
|
1497
|
+
const m = o.find((f) => f.period === c);
|
|
1498
|
+
return m ? m[n] : e.state === "final" ? 0 : "·";
|
|
1499
|
+
}, h = (n, c, m) => i`
|
|
1473
1500
|
<tr>
|
|
1474
|
-
<td class="teamcell">${C(
|
|
1475
|
-
${Array.from({ length:
|
|
1501
|
+
<td class="teamcell">${C(n, 20)}${n?.abbr || "TBD"}</td>
|
|
1502
|
+
${Array.from({ length: r }, (f, g) => i`<td class="num">${l(c, g + 1)}</td>`)}
|
|
1476
1503
|
<td class="num" style="font-weight:700">${m}</td>
|
|
1477
1504
|
</tr>`;
|
|
1478
1505
|
return i`
|
|
1479
1506
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1480
1507
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1481
|
-
<thead><tr><th>Team</th>${Array.from({ length:
|
|
1508
|
+
<thead><tr><th>Team</th>${Array.from({ length: r }, (n, c) => i`<th class="num">${d(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1482
1509
|
<tbody>
|
|
1483
1510
|
${h(t, "away", e.awayScore)}
|
|
1484
1511
|
${h(s, "home", e.homeScore)}
|
|
@@ -1489,16 +1516,16 @@ class Me extends $ {
|
|
|
1489
1516
|
}
|
|
1490
1517
|
renderContext(e, t, s) {
|
|
1491
1518
|
if (!s) return p;
|
|
1492
|
-
const
|
|
1519
|
+
const o = e.records[t], r = q(this.data.games, t);
|
|
1493
1520
|
return i`
|
|
1494
1521
|
<div class="card ctxcard">
|
|
1495
1522
|
<div class="who">${C(s)}${s.name}</div>
|
|
1496
1523
|
<div class="row">
|
|
1497
1524
|
<span>Last 5: ${K(e, t)}</span>
|
|
1498
|
-
<span>Streak: <b>${
|
|
1499
|
-
<span>PF/PA: <b>${
|
|
1500
|
-
<span>Next: ${
|
|
1501
|
-
${
|
|
1525
|
+
<span>Streak: <b>${o ? L(o.results) : "·"}</b></span>
|
|
1526
|
+
<span>PF/PA: <b>${o ? `${o.pf} / ${o.pa}` : "·"}</b></span>
|
|
1527
|
+
<span>Next: ${r ? i`${y(r.date, { month: "numeric", day: "numeric" })}
|
|
1528
|
+
${r.homeTeamId === t ? "vs" : "at"} ${_(e, r.homeTeamId === t ? r.awayTeamId : r.homeTeamId)}` : "·"}</span>
|
|
1502
1529
|
</div>
|
|
1503
1530
|
</div>
|
|
1504
1531
|
`;
|
|
@@ -1600,8 +1627,8 @@ class qe extends te {
|
|
|
1600
1627
|
});
|
|
1601
1628
|
if (!s.ok)
|
|
1602
1629
|
return;
|
|
1603
|
-
const
|
|
1604
|
-
this.results =
|
|
1630
|
+
const o = await s.json();
|
|
1631
|
+
this.results = o.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
1605
1632
|
} catch (t) {
|
|
1606
1633
|
t.name !== "AbortError" && console.warn("school search failed", t);
|
|
1607
1634
|
}
|
|
@@ -1635,15 +1662,15 @@ class qe extends te {
|
|
|
1635
1662
|
return [e.location, e.county && `${e.county} County`].filter(Boolean).join(" — ");
|
|
1636
1663
|
}
|
|
1637
1664
|
renderOption(e, t) {
|
|
1638
|
-
const s = this.where(e),
|
|
1639
|
-
|
|
1665
|
+
const s = this.where(e), o = (r) => {
|
|
1666
|
+
r.preventDefault(), this.go(e);
|
|
1640
1667
|
};
|
|
1641
1668
|
return i`
|
|
1642
1669
|
<li
|
|
1643
1670
|
id="school-option-${t}"
|
|
1644
1671
|
role="option"
|
|
1645
1672
|
aria-selected="${t === this.activeIndex ? "true" : "false"}"
|
|
1646
|
-
@pointerdown="${
|
|
1673
|
+
@pointerdown="${o}"
|
|
1647
1674
|
@mousemove="${() => {
|
|
1648
1675
|
this.activeIndex = t;
|
|
1649
1676
|
}}"
|
|
@@ -1657,7 +1684,7 @@ class qe extends te {
|
|
|
1657
1684
|
const e = this.searched && !this.results.length, t = i`<li class="empty">No schools found</li>`;
|
|
1658
1685
|
return i`
|
|
1659
1686
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
1660
|
-
${this.results.map((s,
|
|
1687
|
+
${this.results.map((s, o) => this.renderOption(s, o))}
|
|
1661
1688
|
${e ? t : p}
|
|
1662
1689
|
</ul>
|
|
1663
1690
|
`;
|
|
@@ -1700,6 +1727,6 @@ export {
|
|
|
1700
1727
|
L as k,
|
|
1701
1728
|
De as p,
|
|
1702
1729
|
w as r,
|
|
1703
|
-
|
|
1730
|
+
oe as s,
|
|
1704
1731
|
W as t
|
|
1705
1732
|
};
|