@wral/hsot-data 0.1.12 → 0.1.13
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.
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ exactly one of these elements.
|
|
|
12
12
|
| `<hsot-scores>` | Scores/Schedules (the scoreboard; future dates are schedules) | `sport`, `date` (YYYY-MM-DD, deep-linkable via `?date=`; defaults to the closest matchday: today when games are on, otherwise the previous one), `season`, `refresh-interval` |
|
|
13
13
|
| `<hsot-standings>` | Standings, every conference for a sport | `sport`, `season` |
|
|
14
14
|
| `<hsot-rankings>` | The weekly Top 25 with movement + rank history | `sport`, `gender` (poll family), `season`, deep link `?poll=YYYY-MM-DD` |
|
|
15
|
-
| `<hsot-school>` | School hub: hero, team tabs, schedule, roster (headed by the season's roster photo when one is set; a College column appears when a player carries a commitment), honors | `school-id`, `sport` (initial tab, deep link `?sport=`), `season` |
|
|
15
|
+
| `<hsot-school>` | School hub: hero, team tabs, schedule, roster (headed by the season's roster photo when one is set; positions render as a list, "WR/CB"; a College column appears when a player carries a commitment), honors | `school-id`, `sport` (initial tab, deep link `?sport=`), `season` |
|
|
16
16
|
| `<hsot-boxscore>` | Game detail: line score, coverage, season context | `game-id`, `refresh-interval` |
|
|
17
17
|
| `<hsot-school-search>` | "Find Your School" typeahead for the right rail (standalone: fetches `GET /schools?q=` itself, no injected client) | `api`, `school-href`, `limit`, `placeholder` |
|
|
18
18
|
|
package/dist/define.mjs
CHANGED
|
@@ -575,6 +575,9 @@ function pt(a) {
|
|
|
575
575
|
function Te(a) {
|
|
576
576
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
577
577
|
}
|
|
578
|
+
function Ie(a) {
|
|
579
|
+
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((e) => String(e ?? "").trim()).filter(Boolean).join("/");
|
|
580
|
+
}
|
|
578
581
|
function et(a = /* @__PURE__ */ new Date()) {
|
|
579
582
|
const t = a.getFullYear();
|
|
580
583
|
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
@@ -583,7 +586,7 @@ function mt(a = /* @__PURE__ */ new Date()) {
|
|
|
583
586
|
const t = (e) => String(e).padStart(2, "0");
|
|
584
587
|
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
585
588
|
}
|
|
586
|
-
function
|
|
589
|
+
function Ce(a, t = mt()) {
|
|
587
590
|
const e = [...new Set((a || []).filter(Boolean))].sort();
|
|
588
591
|
if (!e.length || e.includes(t)) return t;
|
|
589
592
|
const s = e.filter((r) => r < t);
|
|
@@ -597,7 +600,7 @@ function K(a) {
|
|
|
597
600
|
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
598
601
|
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
599
602
|
}
|
|
600
|
-
const
|
|
603
|
+
const Ee = (a) => {
|
|
601
604
|
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
602
605
|
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
603
606
|
};
|
|
@@ -608,7 +611,7 @@ function zt(a, t) {
|
|
|
608
611
|
}, s = e(a), r = e(t);
|
|
609
612
|
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
|
|
610
613
|
}
|
|
611
|
-
function
|
|
614
|
+
function Pe(a, t) {
|
|
612
615
|
const e = (s) => String(s?.name ?? s ?? "");
|
|
613
616
|
return e(a).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
614
617
|
}
|
|
@@ -620,7 +623,7 @@ function Wt(a) {
|
|
|
620
623
|
}
|
|
621
624
|
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(a.date, { month: "short", day: "numeric" })} · ${pt(a.time)}`.replace(/ · $/, "") };
|
|
622
625
|
}
|
|
623
|
-
const
|
|
626
|
+
const De = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
624
627
|
function _(a) {
|
|
625
628
|
let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
626
629
|
const e = t.indexOf("#");
|
|
@@ -635,7 +638,7 @@ function qt() {
|
|
|
635
638
|
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
636
639
|
return _((a.pathname || "") + t);
|
|
637
640
|
}
|
|
638
|
-
function
|
|
641
|
+
function ze(a, t, e) {
|
|
639
642
|
if (!e) return null;
|
|
640
643
|
const s = _(a);
|
|
641
644
|
if (!s) return null;
|
|
@@ -645,9 +648,9 @@ function De(a, t, e) {
|
|
|
645
648
|
if (s === i) return "";
|
|
646
649
|
if (!s.startsWith(`${i}/`)) return null;
|
|
647
650
|
const n = s.slice(i.length + 1), d = n.split("/");
|
|
648
|
-
return d.length > 2 || d.some((l) => !/^[a-z][a-z-]*$/.test(l)) ||
|
|
651
|
+
return d.length > 2 || d.some((l) => !/^[a-z][a-z-]*$/.test(l)) || De.has(d[0]) ? null : n;
|
|
649
652
|
}
|
|
650
|
-
function
|
|
653
|
+
function Re(a, t, e) {
|
|
651
654
|
const s = (i) => g(e.section, { sport: a, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
|
|
652
655
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
653
656
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
@@ -660,7 +663,7 @@ function ze(a, t, e) {
|
|
|
660
663
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
661
664
|
];
|
|
662
665
|
}
|
|
663
|
-
function
|
|
666
|
+
function Be(a, t = qt()) {
|
|
664
667
|
const e = _(t);
|
|
665
668
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
666
669
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
@@ -696,7 +699,7 @@ class w extends E {
|
|
|
696
699
|
this.load();
|
|
697
700
|
}
|
|
698
701
|
updated(t) {
|
|
699
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
702
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Be(this);
|
|
700
703
|
}
|
|
701
704
|
async load() {
|
|
702
705
|
const t = this.client;
|
|
@@ -731,7 +734,7 @@ class w extends E {
|
|
|
731
734
|
return c``;
|
|
732
735
|
}
|
|
733
736
|
}
|
|
734
|
-
const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])),
|
|
737
|
+
const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
735
738
|
:host {
|
|
736
739
|
--hsot-red: var(--color-red, #D1232A);
|
|
737
740
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -769,7 +772,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
769
772
|
outline-offset: 1px;
|
|
770
773
|
}
|
|
771
774
|
.mut { color: var(--hsot-gray-5); }
|
|
772
|
-
`,
|
|
775
|
+
`, Ne = b`
|
|
773
776
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
774
777
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
775
778
|
.band h1, .band h2.bandtitle {
|
|
@@ -818,7 +821,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
818
821
|
@media (max-width: 720px) {
|
|
819
822
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
820
823
|
}
|
|
821
|
-
`,
|
|
824
|
+
`, Ue = b`
|
|
822
825
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
823
826
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
824
827
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -882,7 +885,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
882
885
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
883
886
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
884
887
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
885
|
-
`,
|
|
888
|
+
`, Oe = b`
|
|
886
889
|
.pill {
|
|
887
890
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
888
891
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -897,7 +900,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
897
900
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
898
901
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
899
902
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
900
|
-
`,
|
|
903
|
+
`, He = b`
|
|
901
904
|
.tablewrap { overflow-x: auto; }
|
|
902
905
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
903
906
|
table.data th {
|
|
@@ -915,7 +918,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
915
918
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
916
919
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
917
920
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
918
|
-
`,
|
|
921
|
+
`, Me = b`
|
|
919
922
|
.swatch {
|
|
920
923
|
display: inline-flex; align-items: center; justify-content: center;
|
|
921
924
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -939,7 +942,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
939
942
|
.dot.W { background: var(--hsot-win); }
|
|
940
943
|
.dot.L { background: var(--hsot-loss); }
|
|
941
944
|
.dot.T { background: var(--hsot-tie); }
|
|
942
|
-
`,
|
|
945
|
+
`, Le = b`
|
|
943
946
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
944
947
|
.gamelist li {
|
|
945
948
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -989,11 +992,11 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Be = b`
|
|
|
989
992
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
990
993
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
991
994
|
.gamelist a.box { font-size: 0.78rem; }
|
|
992
|
-
`, j = [
|
|
995
|
+
`, j = [Fe, Ne, Ue, Oe, He, Me, Le];
|
|
993
996
|
function ut(a) {
|
|
994
997
|
return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
995
998
|
}
|
|
996
|
-
function
|
|
999
|
+
function je(a) {
|
|
997
1000
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
998
1001
|
}
|
|
999
1002
|
function W(a, t) {
|
|
@@ -1056,7 +1059,7 @@ function vt(a, t, e, s, r) {
|
|
|
1056
1059
|
}
|
|
1057
1060
|
return n ? n.rank : null;
|
|
1058
1061
|
}
|
|
1059
|
-
function
|
|
1062
|
+
function We(a, t, e) {
|
|
1060
1063
|
if (!a) return { kind: "none", delta: 0 };
|
|
1061
1064
|
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
1062
1065
|
if (!s) return { kind: "none", delta: 0 };
|
|
@@ -1066,11 +1069,11 @@ function je(a, t, e) {
|
|
|
1066
1069
|
const o = r - s;
|
|
1067
1070
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1068
1071
|
}
|
|
1069
|
-
function
|
|
1072
|
+
function qe(a) {
|
|
1070
1073
|
return /^https?:\/\//i.test(String(a || ""));
|
|
1071
1074
|
}
|
|
1072
1075
|
function Vt(a, { w: t, h: e } = {}) {
|
|
1073
|
-
if (!
|
|
1076
|
+
if (!qe(a)) return "";
|
|
1074
1077
|
const s = [];
|
|
1075
1078
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1076
1079
|
const r = a.includes("?") ? "&" : "?";
|
|
@@ -1080,11 +1083,11 @@ function Q(a, t) {
|
|
|
1080
1083
|
const e = t * 2;
|
|
1081
1084
|
return Vt(a?.logoAssetId, { w: e, h: e });
|
|
1082
1085
|
}
|
|
1083
|
-
function
|
|
1086
|
+
function Ge(a, t) {
|
|
1084
1087
|
return Vt(a?.photoAssetId, { w: t * 2 });
|
|
1085
1088
|
}
|
|
1086
1089
|
function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
1087
|
-
const o = qt(), n = !!a.querySelector(':scope > a[slot="nav"]') ||
|
|
1090
|
+
const o = qt(), n = !!a.querySelector(':scope > a[slot="nav"]') || ze(o, t.hrefs, t.sport) !== null;
|
|
1088
1091
|
return c`
|
|
1089
1092
|
<div class="band section">
|
|
1090
1093
|
<div class="inner">
|
|
@@ -1095,7 +1098,7 @@ function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
|
1095
1098
|
<nav class="sectionnav" aria-label="${z(t.sport)} section">
|
|
1096
1099
|
<div class="navrow">
|
|
1097
1100
|
<slot name="nav">
|
|
1098
|
-
${
|
|
1101
|
+
${Re(t.sport, r, t.hrefs).map((d) => c`<a href=${d.href}
|
|
1099
1102
|
aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
|
|
1100
1103
|
</slot>
|
|
1101
1104
|
</div>
|
|
@@ -1182,7 +1185,7 @@ class Qt extends w {
|
|
|
1182
1185
|
t.listGames({ sport: this.sport, season: e }),
|
|
1183
1186
|
t.listRankings({ sport: this.sport })
|
|
1184
1187
|
]);
|
|
1185
|
-
return this._datePinned || (this.date =
|
|
1188
|
+
return this._datePinned || (this.date = Ce(i.items.map((d) => d.date)), this._datePinned = !0), {
|
|
1186
1189
|
season: e,
|
|
1187
1190
|
schools: s.items,
|
|
1188
1191
|
teams: r.items,
|
|
@@ -1253,7 +1256,7 @@ class Qt extends w {
|
|
|
1253
1256
|
// a lone score column on the far right read as detached from the teams).
|
|
1254
1257
|
// Scheduled games carry their start time on the status pill alone.
|
|
1255
1258
|
renderGame(t, e) {
|
|
1256
|
-
const s = e.state === "final" || e.state === "live", r = (i, n, d = m) => c`<span class="side">${Yt(t, i, e.date)}${s ? c`<span class="score">${n}</span>` : m}${d}</span>`, o =
|
|
1259
|
+
const s = e.state === "final" || e.state === "live", r = (i, n, d = m) => c`<span class="side">${Yt(t, i, e.date)}${s ? c`<span class="score">${n}</span>` : m}${d}</span>`, o = je(e);
|
|
1257
1260
|
return c`
|
|
1258
1261
|
<li>
|
|
1259
1262
|
${J(e)}
|
|
@@ -1307,7 +1310,7 @@ class Zt extends w {
|
|
|
1307
1310
|
}, this._ctxData = this.data), this._ctx;
|
|
1308
1311
|
}
|
|
1309
1312
|
renderView() {
|
|
1310
|
-
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(zt)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(
|
|
1313
|
+
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(zt)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(Pe);
|
|
1311
1314
|
return c`
|
|
1312
1315
|
${$t(this, t, {
|
|
1313
1316
|
title: c`${z(this.sport)} standings`,
|
|
@@ -1388,7 +1391,7 @@ class Zt extends w {
|
|
|
1388
1391
|
}
|
|
1389
1392
|
}
|
|
1390
1393
|
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Zt);
|
|
1391
|
-
const
|
|
1394
|
+
const Ve = b`
|
|
1392
1395
|
.hero1 {
|
|
1393
1396
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1394
1397
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1406,7 +1409,7 @@ const Ge = b`
|
|
|
1406
1409
|
.sparkline { vertical-align: middle; }
|
|
1407
1410
|
`;
|
|
1408
1411
|
class Jt extends w {
|
|
1409
|
-
static styles = [...j,
|
|
1412
|
+
static styles = [...j, Ve];
|
|
1410
1413
|
static properties = {
|
|
1411
1414
|
...w.properties,
|
|
1412
1415
|
sport: { type: String },
|
|
@@ -1468,7 +1471,7 @@ class Jt extends w {
|
|
|
1468
1471
|
</svg>`;
|
|
1469
1472
|
}
|
|
1470
1473
|
movement(t, e, s) {
|
|
1471
|
-
const r =
|
|
1474
|
+
const r = We(t, e, s);
|
|
1472
1475
|
return r.kind === "up" ? c`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? c`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? c`<span class="delta new">NEW</span>` : r.kind === "same" ? c`<span class="delta same">—</span>` : c`<span class="delta same">·</span>`;
|
|
1473
1476
|
}
|
|
1474
1477
|
renderView() {
|
|
@@ -1561,7 +1564,7 @@ class Jt extends w {
|
|
|
1561
1564
|
}
|
|
1562
1565
|
}
|
|
1563
1566
|
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Jt);
|
|
1564
|
-
const
|
|
1567
|
+
const Ye = b`
|
|
1565
1568
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1566
1569
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1567
1570
|
.schoolhero .crest {
|
|
@@ -1616,7 +1619,7 @@ const Ve = b`
|
|
|
1616
1619
|
}
|
|
1617
1620
|
`;
|
|
1618
1621
|
class Xt extends w {
|
|
1619
|
-
static styles = [...j,
|
|
1622
|
+
static styles = [...j, Ye];
|
|
1620
1623
|
static properties = {
|
|
1621
1624
|
...w.properties,
|
|
1622
1625
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1711,7 +1714,7 @@ class Xt extends w {
|
|
|
1711
1714
|
<div class="tiles">
|
|
1712
1715
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1713
1716
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1714
|
-
<div class="s">${d ? `${
|
|
1717
|
+
<div class="s">${d ? `${Ee(d)} of ${n.length}` : "·"}</div></div>
|
|
1715
1718
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1716
1719
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1717
1720
|
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
@@ -1763,7 +1766,7 @@ class Xt extends w {
|
|
|
1763
1766
|
const s = this.data.roster;
|
|
1764
1767
|
if (!s)
|
|
1765
1768
|
return c`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1766
|
-
const r =
|
|
1769
|
+
const r = Ge(s, 560), o = this.data.school?.name || "", i = v(this.data.players), n = s.entries.slice().sort((l, h) => (l.number || 0) - (h.number || 0)), d = n.some((l) => i[l.playerId]?.college);
|
|
1767
1770
|
return c`
|
|
1768
1771
|
${r ? c`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1769
1772
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
@@ -1773,11 +1776,11 @@ class Xt extends w {
|
|
|
1773
1776
|
${n.map((l) => {
|
|
1774
1777
|
const h = i[l.playerId];
|
|
1775
1778
|
if (!h) return m;
|
|
1776
|
-
const p =
|
|
1779
|
+
const p = Ie(l), f = [p, h.classOf].filter(Boolean).join(" · ") || "·";
|
|
1777
1780
|
return c`<tr>
|
|
1778
1781
|
<td class="num mut">${l.number ?? "·"}</td>
|
|
1779
|
-
<td class="player" style="font-weight:500">${h.firstName} ${h.lastName}<span class="sub">${
|
|
1780
|
-
<td class="pos">${
|
|
1782
|
+
<td class="player" style="font-weight:500">${h.firstName} ${h.lastName}<span class="sub">${f}</span></td>
|
|
1783
|
+
<td class="pos">${p || "·"}</td>
|
|
1781
1784
|
<td class="cls mut">${h.classOf || "·"}</td>
|
|
1782
1785
|
<td class="num">${Te(h.heightIn)}</td>
|
|
1783
1786
|
<td class="num">${h.weightLb || "·"}</td>
|
|
@@ -1790,12 +1793,12 @@ class Xt extends w {
|
|
|
1790
1793
|
}
|
|
1791
1794
|
}
|
|
1792
1795
|
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Xt);
|
|
1793
|
-
const
|
|
1794
|
-
function
|
|
1796
|
+
const Ke = "https://api.wral.com/search";
|
|
1797
|
+
function Qe(a) {
|
|
1795
1798
|
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1796
1799
|
}
|
|
1797
|
-
function
|
|
1798
|
-
const e = String(a ||
|
|
1800
|
+
function Ze(a, t) {
|
|
1801
|
+
const e = String(a || Ke).replace(/\/+$/, ""), s = new URLSearchParams({ query: Qe(t), sort: "score", lang: "en" });
|
|
1799
1802
|
return `${e}/v1/query?${s}`;
|
|
1800
1803
|
}
|
|
1801
1804
|
function te(a) {
|
|
@@ -1813,13 +1816,13 @@ function te(a) {
|
|
|
1813
1816
|
}
|
|
1814
1817
|
return { uri: a, title: a };
|
|
1815
1818
|
}
|
|
1816
|
-
async function
|
|
1817
|
-
const r = await ((...n) => fetch(...n))(
|
|
1819
|
+
async function Je(a, t, e) {
|
|
1820
|
+
const r = await ((...n) => fetch(...n))(Ze(a, t));
|
|
1818
1821
|
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1819
1822
|
const o = await r.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1820
1823
|
return t.map((n) => i.get(n) || te(n));
|
|
1821
1824
|
}
|
|
1822
|
-
const
|
|
1825
|
+
const Xe = b`
|
|
1823
1826
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1824
1827
|
.breadcrumbs a { text-decoration: none; }
|
|
1825
1828
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1859,7 +1862,7 @@ const Je = b`
|
|
|
1859
1862
|
}
|
|
1860
1863
|
`;
|
|
1861
1864
|
class ee extends w {
|
|
1862
|
-
static styles = [...j,
|
|
1865
|
+
static styles = [...j, Xe];
|
|
1863
1866
|
static properties = {
|
|
1864
1867
|
...w.properties,
|
|
1865
1868
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1881,7 +1884,7 @@ class ee extends w {
|
|
|
1881
1884
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1882
1885
|
// A search outage must not blank the box score — degrade to bare
|
|
1883
1886
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1884
|
-
s.length ?
|
|
1887
|
+
s.length ? Je(this.searchApi, s).catch(() => s.map(te)) : Promise.resolve([])
|
|
1885
1888
|
]);
|
|
1886
1889
|
return {
|
|
1887
1890
|
game: e,
|
|
@@ -2026,7 +2029,7 @@ class ee extends w {
|
|
|
2026
2029
|
}
|
|
2027
2030
|
}
|
|
2028
2031
|
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", ee);
|
|
2029
|
-
const
|
|
2032
|
+
const ts = 250, es = 2;
|
|
2030
2033
|
class se extends E {
|
|
2031
2034
|
static properties = {
|
|
2032
2035
|
api: { type: String },
|
|
@@ -2107,11 +2110,11 @@ class se extends E {
|
|
|
2107
2110
|
}
|
|
2108
2111
|
onInput(t) {
|
|
2109
2112
|
const e = t.target.value.trim();
|
|
2110
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2113
|
+
if (clearTimeout(this.debounceTimer), e.length < es) {
|
|
2111
2114
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2112
2115
|
return;
|
|
2113
2116
|
}
|
|
2114
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2117
|
+
this.debounceTimer = setTimeout(() => this.search(e), ts);
|
|
2115
2118
|
}
|
|
2116
2119
|
async search(t) {
|
|
2117
2120
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2205,7 +2208,7 @@ class se extends E {
|
|
|
2205
2208
|
}
|
|
2206
2209
|
}
|
|
2207
2210
|
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", se);
|
|
2208
|
-
const
|
|
2211
|
+
const ss = {
|
|
2209
2212
|
"hsot-scores": Qt,
|
|
2210
2213
|
"hsot-standings": Zt,
|
|
2211
2214
|
"hsot-rankings": Jt,
|
|
@@ -2213,13 +2216,13 @@ const es = {
|
|
|
2213
2216
|
"hsot-boxscore": ee,
|
|
2214
2217
|
"hsot-school-search": se
|
|
2215
2218
|
};
|
|
2216
|
-
function
|
|
2219
|
+
function as() {
|
|
2217
2220
|
const a = globalThis?.customElements;
|
|
2218
2221
|
if (a)
|
|
2219
|
-
for (const [t, e] of Object.entries(
|
|
2222
|
+
for (const [t, e] of Object.entries(ss))
|
|
2220
2223
|
a.get(t) || a.define(t, e);
|
|
2221
2224
|
}
|
|
2222
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2225
|
+
typeof window < "u" && globalThis.customElements && as();
|
|
2223
2226
|
export {
|
|
2224
|
-
|
|
2227
|
+
as as defineAll
|
|
2225
2228
|
};
|