@wral/hsot-data 0.1.3 → 0.1.5
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 +27 -0
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +692 -582
- package/dist/{hsot-boxscore-CY8jCxLh.js → hsot-boxscore-B_yZEV8T.js} +465 -355
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const G = globalThis, lt = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = /* @__PURE__ */ Symbol(), yt = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Rt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== ct) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (lt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = yt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && yt.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,101 +17,101 @@ let Dt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e =
|
|
20
|
+
const Qt = (a) => new Rt(typeof a == "string" ? a : a + "", void 0, ct), w = (a, ...t) => {
|
|
21
|
+
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((i) => {
|
|
22
22
|
if (i._$cssResult$ === !0) return i.cssText;
|
|
23
23
|
if (typeof i == "number") return i;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
25
|
+
})(r) + a[o + 1], a[0]);
|
|
26
|
+
return new Rt(e, a, ct);
|
|
27
|
+
}, Jt = (a, t) => {
|
|
28
|
+
if (lt) a.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"),
|
|
31
|
-
|
|
30
|
+
const s = document.createElement("style"), r = G.litNonce;
|
|
31
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, bt = lt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is:
|
|
36
|
+
return Qt(e);
|
|
37
|
+
})(a) : a;
|
|
38
|
+
const { is: Xt, defineProperty: te, getOwnPropertyDescriptor: ee, getOwnPropertyNames: se, getOwnPropertySymbols: ae, getPrototypeOf: re } = Object, Q = globalThis, wt = Q.trustedTypes, oe = wt ? wt.emptyScript : "", ie = Q.reactiveElementPolyfillSupport, R = (a, t) => a, ot = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
a = a ? oe : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
45
|
-
|
|
45
|
+
a = a == null ? a : JSON.stringify(a);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, fromAttribute(
|
|
49
|
-
let e =
|
|
47
|
+
return a;
|
|
48
|
+
}, fromAttribute(a, t) {
|
|
49
|
+
let e = a;
|
|
50
50
|
switch (t) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
e =
|
|
52
|
+
e = a !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
e =
|
|
55
|
+
e = a === null ? null : Number(a);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
e = JSON.parse(
|
|
60
|
+
e = JSON.parse(a);
|
|
61
61
|
} catch {
|
|
62
62
|
e = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, Bt = (a, t) => !Xt(a, t), xt = { attribute: !0, type: String, converter: ot, reflect: !1, useDefault: !1, hasChanged: Bt };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let C = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
75
|
+
static createProperty(t, e = xt) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
r !== void 0 && te(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: r, set: o } = ee(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const n =
|
|
87
|
+
return { get: r, set(i) {
|
|
88
|
+
const n = r?.call(this);
|
|
89
89
|
o?.call(this, i), this.requestUpdate(t, n, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? xt;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(R("elementProperties"))) return;
|
|
97
|
+
const t = re(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties, s = [...
|
|
104
|
-
for (const
|
|
101
|
+
if (this.hasOwnProperty(R("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
|
|
103
|
+
const e = this.properties, s = [...se(e), ...ae(e)];
|
|
104
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [s,
|
|
109
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
112
|
for (const [e, s] of this.elementProperties) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const r = this._$Eu(e, s);
|
|
114
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
@@ -119,8 +119,8 @@ let T = class extends HTMLElement {
|
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
121
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
-
for (const
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const r of s) e.unshift(bt(r));
|
|
123
|
+
} else t !== void 0 && e.push(bt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
@@ -146,7 +146,7 @@ let T = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return Jt(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -160,31 +160,31 @@ let T = class extends HTMLElement {
|
|
|
160
160
|
this._$AK(t, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const s = this.constructor.elementProperties.get(t),
|
|
164
|
-
if (
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
164
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : ot).toAttribute(e, s.type);
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const s = this.constructor,
|
|
171
|
-
if (
|
|
172
|
-
const o = s.getPropertyOptions(
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, r = s._$Eh.get(t);
|
|
171
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
+
const o = s.getPropertyOptions(r), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : ot;
|
|
173
|
+
this._$Em = r;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(t, e, s,
|
|
178
|
+
requestUpdate(t, e, s, r = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const i = this.constructor;
|
|
181
|
-
if (
|
|
181
|
+
if (r === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Bt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)),
|
|
186
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, i) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let T = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [
|
|
206
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [
|
|
211
|
-
const { wrapped: i } = o, n = this[
|
|
212
|
-
i !== !0 || this._$AL.has(
|
|
210
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
+
const { wrapped: i } = o, n = this[r];
|
|
212
|
+
i !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,70 +246,70 @@ let T = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
249
|
+
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[R("elementProperties")] = /* @__PURE__ */ new Map(), C[R("finalized")] = /* @__PURE__ */ new Map(), ie?.({ ReactiveElement: C }), (Q.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const dt = globalThis, kt = (a) => a, V = dt.trustedTypes, _t = V ? V.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ft = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ut = "?" + k, ne = `<${Ut}>`, T = document, F = () => T.createComment(""), U = (a) => a === null || typeof a != "object" && typeof a != "function", ht = Array.isArray, le = (a) => ht(a) || typeof a?.[Symbol.iterator] == "function", at = `[
|
|
251
|
+
\f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, St = /-->/g, At = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Tt = /'/g, Ct = /"/g, Ot = /^(?:script|style|textarea|title)$/i, Nt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), l = Nt(1), It = Nt(2), I = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Et = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
|
+
function Ht(a, t) {
|
|
254
|
+
if (!ht(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return _t !== void 0 ? _t.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const e =
|
|
259
|
-
let
|
|
257
|
+
const ce = (a, t) => {
|
|
258
|
+
const e = a.length - 1, s = [];
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = D;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
|
-
const c =
|
|
262
|
-
let p,
|
|
263
|
-
for (; f < c.length && (i.lastIndex = f,
|
|
264
|
-
const u = i ===
|
|
265
|
-
o += i ===
|
|
261
|
+
const c = a[n];
|
|
262
|
+
let p, d, h = -1, f = 0;
|
|
263
|
+
for (; f < c.length && (i.lastIndex = f, d = i.exec(c), d !== null); ) f = i.lastIndex, i === D ? d[1] === "!--" ? i = St : d[1] !== void 0 ? i = At : d[2] !== void 0 ? (Ot.test(d[2]) && (r = RegExp("</" + d[2], "g")), i = S) : d[3] !== void 0 && (i = S) : i === S ? d[0] === ">" ? (i = r ?? D, h = -1) : d[1] === void 0 ? h = -2 : (h = i.lastIndex - d[2].length, p = d[1], i = d[3] === void 0 ? S : d[3] === '"' ? Ct : Tt) : i === Ct || i === Tt ? i = S : i === St || i === At ? i = D : (i = S, r = void 0);
|
|
264
|
+
const u = i === S && a[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === D ? c + ne : h >= 0 ? (s.push(p), c.slice(0, h) + Ft + c.slice(h) + k + u) : c + k + (h === -2 ? n : u);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Ht(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class O {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
|
-
let
|
|
271
|
+
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1, c = this.parts, [p,
|
|
275
|
-
if (this.el =
|
|
274
|
+
const n = t.length - 1, c = this.parts, [p, d] = ce(t, e);
|
|
275
|
+
if (this.el = O.createElement(p, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const h = this.el.content.firstChild;
|
|
277
277
|
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const f =
|
|
283
|
-
c.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ?
|
|
284
|
-
} else h.startsWith(
|
|
285
|
-
if (
|
|
286
|
-
const h =
|
|
279
|
+
for (; (r = A.nextNode()) !== null && c.length < n; ) {
|
|
280
|
+
if (r.nodeType === 1) {
|
|
281
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ft)) {
|
|
282
|
+
const f = d[i++], u = r.getAttribute(h).split(k), $ = /([.?@])?(.*)/.exec(f);
|
|
283
|
+
c.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? he : $[1] === "?" ? pe : $[1] === "@" ? me : J }), r.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(k) && (c.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
285
|
+
if (Ot.test(r.tagName)) {
|
|
286
|
+
const h = r.textContent.split(k), f = h.length - 1;
|
|
287
287
|
if (f > 0) {
|
|
288
|
-
|
|
289
|
-
for (let u = 0; u < f; u++)
|
|
290
|
-
|
|
288
|
+
r.textContent = V ? V.emptyScript : "";
|
|
289
|
+
for (let u = 0; u < f; u++) r.append(h[u], F()), A.nextNode(), c.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(h[f], F());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Ut) c.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let h = -1;
|
|
296
|
-
for (; (h =
|
|
296
|
+
for (; (h = r.data.indexOf(k, h + 1)) !== -1; ) c.push({ type: 7, index: o }), h += k.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = T.createElement("template");
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function E(a, t, e = a, s) {
|
|
307
307
|
if (t === I) return t;
|
|
308
|
-
let
|
|
309
|
-
const o =
|
|
310
|
-
return
|
|
308
|
+
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
+
const o = U(t) ? void 0 : t._$litDirective$;
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = E(a, r._$AS(a, t.values), r, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class de {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,29 +320,29 @@ class ie {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
324
|
-
|
|
325
|
-
let o =
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? T).importNode(e, !0);
|
|
324
|
+
A.currentNode = r;
|
|
325
|
+
let o = A.nextNode(), i = 0, n = 0, c = s[0];
|
|
326
326
|
for (; c !== void 0; ) {
|
|
327
327
|
if (i === c.index) {
|
|
328
328
|
let p;
|
|
329
|
-
c.type === 2 ? p = new
|
|
329
|
+
c.type === 2 ? p = new M(o, o.nextSibling, this, t) : c.type === 1 ? p = new c.ctor(o, c.name, c.strings, this, t) : c.type === 6 && (p = new fe(o, this, t)), this._$AV.push(p), c = s[++n];
|
|
330
330
|
}
|
|
331
|
-
i !== c?.index && (o =
|
|
331
|
+
i !== c?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return A.currentNode = T, r;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class M {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(t, e, s,
|
|
345
|
-
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options =
|
|
344
|
+
constructor(t, e, s, r) {
|
|
345
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let t = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class N {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = E(this, t, e), U(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : le(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,63 +365,63 @@ class N {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== m &&
|
|
368
|
+
this._$AH !== m && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t,
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
371
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(Ht(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new de(r, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = Et.get(t.strings);
|
|
380
|
+
return e === void 0 && Et.set(t.strings, e = new O(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
ht(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
|
-
let s,
|
|
386
|
-
for (const o of t)
|
|
387
|
-
|
|
385
|
+
let s, r = 0;
|
|
386
|
+
for (const o of t) r === e.length ? e.push(s = new M(this.O(F()), this.O(F()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
387
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = kt(t).nextSibling;
|
|
392
|
+
kt(t).remove(), t = s;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(t) {
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class J {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s,
|
|
407
|
-
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
406
|
+
constructor(t, e, s, r, o) {
|
|
407
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
|
|
408
408
|
}
|
|
409
|
-
_$AI(t, e = this, s,
|
|
409
|
+
_$AI(t, e = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let i = !1;
|
|
412
|
-
if (o === void 0) t =
|
|
412
|
+
if (o === void 0) t = E(this, t, e, 0), i = !U(t) || t !== this._$AH && t !== I, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const n = t;
|
|
415
415
|
let c, p;
|
|
416
|
-
for (t = o[0], c = 0; c < o.length - 1; c++) p =
|
|
416
|
+
for (t = o[0], c = 0; c < o.length - 1; c++) p = E(this, n[s + c], e, c), p === I && (p = this._$AH[c]), i ||= !U(p) || p !== this._$AH[c], p === m ? t = m : t !== m && (t += (p ?? "") + o[c + 1]), this._$AH[c] = p;
|
|
417
417
|
}
|
|
418
|
-
i && !
|
|
418
|
+
i && !r && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class he extends J {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ne extends Q {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class pe extends J {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class le extends Q {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(t, e, s,
|
|
442
|
-
super(t, e, s,
|
|
440
|
+
class me extends J {
|
|
441
|
+
constructor(t, e, s, r, o) {
|
|
442
|
+
super(t, e, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
445
|
+
if ((t = E(this, t, e, 0) ?? m) === I) return;
|
|
446
|
+
const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || r);
|
|
447
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class fe {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class de {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
E(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const ue = dt.litHtmlPolyfillSupport;
|
|
465
|
+
ue?.(O, M), (dt.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const ge = (a, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
468
|
+
let r = s._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ =
|
|
471
|
+
s._$litPart$ = r = new M(t.insertBefore(F(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class
|
|
475
|
+
const pt = globalThis;
|
|
476
|
+
class B extends C {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class R extends T {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ge(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -495,36 +495,36 @@ class R extends T {
|
|
|
495
495
|
return I;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const t = Object.entries(
|
|
498
|
+
B._$litElement$ = !0, B.finalized = !0, pt.litElementHydrateSupport?.({ LitElement: B });
|
|
499
|
+
const ve = pt.litElementPolyfillSupport;
|
|
500
|
+
ve?.({ LitElement: B });
|
|
501
|
+
(pt.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const $e = 50;
|
|
503
|
+
function ye(a = {}) {
|
|
504
|
+
const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
|
-
return t.forEach(([s,
|
|
507
|
+
return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
const s =
|
|
509
|
+
function be({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
|
+
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
513
513
|
const c = { Accept: "application/json" };
|
|
514
514
|
t && (c.Authorization = `Bearer ${t}`);
|
|
515
|
-
const p = await
|
|
515
|
+
const p = await r(`${s}${n}`, { headers: c });
|
|
516
516
|
if (!p.ok) {
|
|
517
|
-
const
|
|
518
|
-
throw
|
|
517
|
+
const d = new Error(`api-hsot ${p.status} on ${n}`);
|
|
518
|
+
throw d.status = p.status, d;
|
|
519
519
|
}
|
|
520
520
|
return p.json();
|
|
521
521
|
}
|
|
522
522
|
async function i(n, c = {}) {
|
|
523
523
|
const p = [];
|
|
524
|
-
let
|
|
525
|
-
for (let h = 0; h <
|
|
526
|
-
const f =
|
|
527
|
-
if (p.push(...u.items || []),
|
|
524
|
+
let d = null;
|
|
525
|
+
for (let h = 0; h < $e; h += 1) {
|
|
526
|
+
const f = ye(d ? { ...c, cursor: d } : c), u = await o(`${n}${f}`);
|
|
527
|
+
if (p.push(...u.items || []), d = u.nextCursor || null, !d) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: p, total: p.length, nextCursor: null };
|
|
530
530
|
}
|
|
@@ -544,7 +544,111 @@ function ge({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
544
544
|
listSports: () => o("/sports")
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
|
|
547
|
+
const rt = {
|
|
548
|
+
game: "/{sport}/game/{id}/",
|
|
549
|
+
school: "/school/{id}/",
|
|
550
|
+
section: "/{sport}/{view}/"
|
|
551
|
+
};
|
|
552
|
+
function g(a, t) {
|
|
553
|
+
return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
|
+
}
|
|
555
|
+
function L(a) {
|
|
556
|
+
return {
|
|
557
|
+
game: a.getAttribute("game-href") || rt.game,
|
|
558
|
+
school: a.getAttribute("school-href") || rt.school,
|
|
559
|
+
section: a.getAttribute("section-href") || rt.section
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
const P = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
563
|
+
function y(a, t) {
|
|
564
|
+
if (!a) return "TBD";
|
|
565
|
+
const [e, s, r] = String(a).split("-").map(Number);
|
|
566
|
+
return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
|
+
}
|
|
568
|
+
function X(a) {
|
|
569
|
+
if (!a) return "";
|
|
570
|
+
const [t, e] = String(a).split(":").map(Number);
|
|
571
|
+
if (Number.isNaN(t)) return "";
|
|
572
|
+
const s = t >= 12 ? "PM" : "AM";
|
|
573
|
+
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
|
+
}
|
|
575
|
+
function we(a) {
|
|
576
|
+
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
577
|
+
}
|
|
578
|
+
function tt(a = /* @__PURE__ */ new Date()) {
|
|
579
|
+
const t = a.getFullYear();
|
|
580
|
+
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
581
|
+
}
|
|
582
|
+
function it(a = /* @__PURE__ */ new Date()) {
|
|
583
|
+
const t = (e) => String(e).padStart(2, "0");
|
|
584
|
+
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
585
|
+
}
|
|
586
|
+
function mt(a) {
|
|
587
|
+
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
588
|
+
}
|
|
589
|
+
function q(a) {
|
|
590
|
+
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
591
|
+
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
592
|
+
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
593
|
+
}
|
|
594
|
+
const xe = (a) => {
|
|
595
|
+
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
596
|
+
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
597
|
+
};
|
|
598
|
+
function ke(a) {
|
|
599
|
+
if (a.state === "live") return { kind: "live", label: `Live · ${a.period || ""}`.replace(/ · $/, "") };
|
|
600
|
+
if (a.state === "final") {
|
|
601
|
+
const t = [];
|
|
602
|
+
return a.finish === "overtime" && t.push("OT"), a.finish === "shootout" && t.push("PK-SO"), a.forfeit && a.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
603
|
+
}
|
|
604
|
+
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" })} · ${X(a.time)}`.replace(/ · $/, "") };
|
|
605
|
+
}
|
|
606
|
+
const _e = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
607
|
+
function _(a) {
|
|
608
|
+
let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
609
|
+
const e = t.indexOf("#");
|
|
610
|
+
let s = "";
|
|
611
|
+
e !== -1 && (s = t.slice(e).split("?")[0], t = t.slice(0, e));
|
|
612
|
+
let r = t.split("?")[0] + s;
|
|
613
|
+
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
614
|
+
}
|
|
615
|
+
function Mt() {
|
|
616
|
+
const a = globalThis.location;
|
|
617
|
+
if (!a) return "";
|
|
618
|
+
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
619
|
+
return _((a.pathname || "") + t);
|
|
620
|
+
}
|
|
621
|
+
function Se(a, t, e) {
|
|
622
|
+
if (!e) return null;
|
|
623
|
+
const s = _(a);
|
|
624
|
+
if (!s) return null;
|
|
625
|
+
const r = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
|
|
626
|
+
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
627
|
+
const i = _(g(t.section, { sport: e, view: "" }));
|
|
628
|
+
if (s === i) return "";
|
|
629
|
+
if (!s.startsWith(`${i}/`)) return null;
|
|
630
|
+
const n = s.slice(i.length + 1), c = n.split("/");
|
|
631
|
+
return c.length > 2 || c.some((p) => !/^[a-z][a-z-]*$/.test(p)) || _e.has(c[0]) ? null : n;
|
|
632
|
+
}
|
|
633
|
+
function Ae(a, t, e) {
|
|
634
|
+
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 ? [
|
|
635
|
+
{ label: "Boys Standings", href: s("boys/standings") },
|
|
636
|
+
{ label: "Girls Standings", href: s("girls/standings") }
|
|
637
|
+
] : [{ label: "Standings", href: s("standings") }];
|
|
638
|
+
return [
|
|
639
|
+
{ label: `${P(a)} Home`, href: s("") },
|
|
640
|
+
{ label: "Scores/Schedule", href: s("scores") },
|
|
641
|
+
{ label: "Playoff Brackets", href: s("brackets") },
|
|
642
|
+
...o,
|
|
643
|
+
{ label: "Polls & Rankings", href: s("rankings") }
|
|
644
|
+
];
|
|
645
|
+
}
|
|
646
|
+
function Te(a, t = Mt()) {
|
|
647
|
+
const e = _(t);
|
|
648
|
+
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
649
|
+
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
650
|
+
}
|
|
651
|
+
class b extends B {
|
|
548
652
|
static properties = {
|
|
549
653
|
api: { type: String },
|
|
550
654
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -560,7 +664,7 @@ class b extends R {
|
|
|
560
664
|
this._client = t, this.isConnected && this.load();
|
|
561
665
|
}
|
|
562
666
|
get client() {
|
|
563
|
-
return this._client ? this._client : this.api ?
|
|
667
|
+
return this._client ? this._client : this.api ? be({ baseUrl: this.api }) : null;
|
|
564
668
|
}
|
|
565
669
|
connectedCallback() {
|
|
566
670
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -572,7 +676,7 @@ class b extends R {
|
|
|
572
676
|
this.load();
|
|
573
677
|
}
|
|
574
678
|
updated(t) {
|
|
575
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval();
|
|
679
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Te(this);
|
|
576
680
|
}
|
|
577
681
|
async load() {
|
|
578
682
|
const t = this.client;
|
|
@@ -601,13 +705,13 @@ class b extends R {
|
|
|
601
705
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
602
706
|
}
|
|
603
707
|
render() {
|
|
604
|
-
return this.error === "not-configured" ?
|
|
708
|
+
return this.error === "not-configured" ? l`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? l`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : l`<div class="loading" role="status">Loading…</div>`;
|
|
605
709
|
}
|
|
606
710
|
renderView() {
|
|
607
|
-
return
|
|
711
|
+
return l``;
|
|
608
712
|
}
|
|
609
713
|
}
|
|
610
|
-
const
|
|
714
|
+
const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
|
|
611
715
|
:host {
|
|
612
716
|
--hsot-red: var(--color-red, #D1232A);
|
|
613
717
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -625,6 +729,10 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
625
729
|
--hsot-win: var(--color-green-dark, #66A208);
|
|
626
730
|
--hsot-loss: var(--color-red, #D1232A);
|
|
627
731
|
--hsot-tie: var(--color-gray-4, #7C7C7C);
|
|
732
|
+
--hsot-section-bg: var(--color-section-header, #1A1A1A);
|
|
733
|
+
--hsot-section-text: var(--color-section-header-text, #FFFFFF);
|
|
734
|
+
--hsot-section-divider: var(--color-section-header-divider, rgba(255, 255, 255, 0.2));
|
|
735
|
+
--hsot-section-red: #B90100;
|
|
628
736
|
--hsot-heading-font: var(--heading-font-family, 'IBM Plex Sans Condensed', 'Helvetica Neue', Helvetica, sans-serif);
|
|
629
737
|
--hsot-body-font: var(--body-font-family, Roboto, 'Helvetica Neue', Helvetica, sans-serif);
|
|
630
738
|
--hsot-radius-xs: var(--radius-xs, 0.15rem);
|
|
@@ -641,7 +749,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
641
749
|
outline-offset: 1px;
|
|
642
750
|
}
|
|
643
751
|
.mut { color: var(--hsot-gray-5); }
|
|
644
|
-
`,
|
|
752
|
+
`, Ie = w`
|
|
645
753
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
646
754
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
647
755
|
.band h1, .band h2.bandtitle {
|
|
@@ -660,8 +768,37 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
660
768
|
}
|
|
661
769
|
.band nav.tabs a.on { border-bottom-color: var(--hsot-red); }
|
|
662
770
|
.band nav.tabs span.off { color: var(--hsot-gray-4); cursor: not-allowed; }
|
|
663
|
-
|
|
664
|
-
|
|
771
|
+
/* Section-front treatment, matching the site's hsot-section-header: dark
|
|
772
|
+
band, red baseline, sub-nav row of section links. The section tokens
|
|
773
|
+
inherit from the page when it defines the --color-section-header set. */
|
|
774
|
+
.band.section {
|
|
775
|
+
background: var(--hsot-section-bg); color: var(--hsot-section-text);
|
|
776
|
+
border-bottom: 3px solid var(--hsot-section-red);
|
|
777
|
+
}
|
|
778
|
+
.band.section .inner { padding: 1.25rem; }
|
|
779
|
+
.band.section h1, .band.section h2.bandtitle {
|
|
780
|
+
color: inherit; font-size: 2.875rem; font-weight: 700; line-height: 1;
|
|
781
|
+
}
|
|
782
|
+
.band.section .sub { color: #CFCFCF; margin: 0.4rem 0 0; }
|
|
783
|
+
nav.sectionnav { border-top: 1px solid var(--hsot-section-divider); }
|
|
784
|
+
.sectionnav .navrow {
|
|
785
|
+
display: flex; gap: 1rem; max-width: 1366px; margin: 0 auto;
|
|
786
|
+
padding: 0 1.25rem; overflow-x: auto; box-sizing: border-box;
|
|
787
|
+
}
|
|
788
|
+
.sectionnav a, .sectionnav ::slotted(a) {
|
|
789
|
+
font-family: var(--hsot-heading-font); font-weight: 500; font-size: 0.875rem;
|
|
790
|
+
line-height: 1.5rem; text-transform: uppercase; text-decoration: none;
|
|
791
|
+
white-space: nowrap; padding: 0.5rem; color: #CFCFCF;
|
|
792
|
+
border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
|
|
793
|
+
}
|
|
794
|
+
.sectionnav a:hover, .sectionnav a:focus-visible, .sectionnav a[aria-current="page"],
|
|
795
|
+
.sectionnav ::slotted(a:hover), .sectionnav ::slotted(a:focus-visible), .sectionnav ::slotted(a[aria-current="page"]) {
|
|
796
|
+
color: var(--hsot-section-text); border-bottom-color: var(--hsot-section-red);
|
|
797
|
+
}
|
|
798
|
+
@media (max-width: 720px) {
|
|
799
|
+
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
800
|
+
}
|
|
801
|
+
`, Ee = w`
|
|
665
802
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
666
803
|
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.1rem; }
|
|
667
804
|
.toolbar .spacer { flex: 1; }
|
|
@@ -704,7 +841,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
704
841
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
705
842
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
706
843
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
707
|
-
`,
|
|
844
|
+
`, Pe = w`
|
|
708
845
|
.pill {
|
|
709
846
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
710
847
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -719,7 +856,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
719
856
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
720
857
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
721
858
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
722
|
-
`,
|
|
859
|
+
`, De = w`
|
|
723
860
|
.tablewrap { overflow-x: auto; }
|
|
724
861
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
725
862
|
table.data th {
|
|
@@ -737,7 +874,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
737
874
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
738
875
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
739
876
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
740
|
-
`,
|
|
877
|
+
`, ze = w`
|
|
741
878
|
.swatch {
|
|
742
879
|
display: inline-flex; align-items: center; justify-content: center;
|
|
743
880
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -761,7 +898,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
761
898
|
.dot.W { background: var(--hsot-win); }
|
|
762
899
|
.dot.L { background: var(--hsot-loss); }
|
|
763
900
|
.dot.T { background: var(--hsot-tie); }
|
|
764
|
-
`,
|
|
901
|
+
`, Re = w`
|
|
765
902
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
766
903
|
.gamelist li {
|
|
767
904
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -778,121 +915,62 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ve = w`
|
|
|
778
915
|
.gamelist .opp a:hover { text-decoration: underline; }
|
|
779
916
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
780
917
|
.gamelist a.box { font-size: 0.78rem; }
|
|
781
|
-
`,
|
|
782
|
-
function
|
|
783
|
-
return
|
|
918
|
+
`, j = [Ce, Ie, Ee, Pe, De, ze, Re];
|
|
919
|
+
function ft(a) {
|
|
920
|
+
return a.state !== "final" ? null : a.forfeit && a.forfeit !== "none" ? a.forfeit : a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
784
921
|
}
|
|
785
|
-
function
|
|
786
|
-
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]),
|
|
787
|
-
for (const o of
|
|
788
|
-
const i =
|
|
922
|
+
function W(a, t) {
|
|
923
|
+
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
|
|
924
|
+
for (const o of r) {
|
|
925
|
+
const i = ft(o), n = o.gameType === "conference";
|
|
789
926
|
for (const c of ["home", "away"]) {
|
|
790
927
|
const p = c === "home" ? o.homeTeamId : o.awayTeamId;
|
|
791
928
|
if (!p) continue;
|
|
792
|
-
const
|
|
793
|
-
|
|
929
|
+
const d = s(p), h = c === "home" ? o.homeScore : o.awayScore, f = c === "home" ? o.awayScore : o.homeScore;
|
|
930
|
+
d.pf += h, d.pa += f;
|
|
794
931
|
let u = "T";
|
|
795
|
-
i === "tie" ? (
|
|
932
|
+
i === "tie" ? (d.t += 1, n && (d.ct += 1)) : i === c ? (d.w += 1, n && (d.cw += 1), u = "W") : (d.l += 1, n && (d.cl += 1), u = "L"), d.results.push({ gameId: o.id, date: o.date, mark: u, my: h, their: f, opp: c === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
|
|
796
933
|
}
|
|
797
934
|
}
|
|
798
935
|
return e;
|
|
799
936
|
}
|
|
800
|
-
function
|
|
801
|
-
if (!
|
|
802
|
-
const t =
|
|
937
|
+
function et(a) {
|
|
938
|
+
if (!a || !a.length) return "";
|
|
939
|
+
const t = a[a.length - 1].mark;
|
|
803
940
|
let e = 0;
|
|
804
|
-
for (let s =
|
|
941
|
+
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
805
942
|
return t + e;
|
|
806
943
|
}
|
|
807
|
-
const
|
|
808
|
-
const s =
|
|
809
|
-
return s ? (
|
|
810
|
-
},
|
|
811
|
-
function x(
|
|
812
|
-
if (!
|
|
813
|
-
const e = t ?
|
|
814
|
-
return `${e}-${s}${
|
|
944
|
+
const Pt = (a, t, e) => {
|
|
945
|
+
const s = a + t + e;
|
|
946
|
+
return s ? (a + e / 2) / s : 0;
|
|
947
|
+
}, Dt = (a) => a.toFixed(3).replace("0.", ".");
|
|
948
|
+
function x(a, t = !1) {
|
|
949
|
+
if (!a) return "0-0";
|
|
950
|
+
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
951
|
+
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
815
952
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
953
|
+
function Lt(a, t) {
|
|
954
|
+
return a.map((e) => {
|
|
818
955
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
819
|
-
return { team: e, rec: s, confPct:
|
|
956
|
+
return { team: e, rec: s, confPct: Pt(s.cw, s.cl, s.ct), overallPct: Pt(s.w, s.l, s.t) };
|
|
820
957
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
821
958
|
}
|
|
822
|
-
function
|
|
823
|
-
return
|
|
959
|
+
function ut(a, t) {
|
|
960
|
+
return a.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
|
|
824
961
|
}
|
|
825
|
-
function
|
|
826
|
-
const e =
|
|
962
|
+
function zt(a, t) {
|
|
963
|
+
const e = a[t];
|
|
827
964
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
828
965
|
}
|
|
829
|
-
|
|
830
|
-
game: "/{sport}/game/{id}/",
|
|
831
|
-
school: "/school/{id}/",
|
|
832
|
-
section: "/{sport}/{view}/"
|
|
833
|
-
};
|
|
834
|
-
function v(r, t) {
|
|
835
|
-
return String(r).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
836
|
-
}
|
|
837
|
-
function L(r) {
|
|
838
|
-
return {
|
|
839
|
-
game: r.getAttribute("game-href") || at.game,
|
|
840
|
-
school: r.getAttribute("school-href") || at.school,
|
|
841
|
-
section: r.getAttribute("section-href") || at.section
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
const J = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
|
|
845
|
-
function y(r, t) {
|
|
846
|
-
if (!r) return "TBD";
|
|
847
|
-
const [e, s, a] = String(r).split("-").map(Number);
|
|
848
|
-
return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
849
|
-
}
|
|
850
|
-
function X(r) {
|
|
851
|
-
if (!r) return "";
|
|
852
|
-
const [t, e] = String(r).split(":").map(Number);
|
|
853
|
-
if (Number.isNaN(t)) return "";
|
|
854
|
-
const s = t >= 12 ? "PM" : "AM";
|
|
855
|
-
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
856
|
-
}
|
|
857
|
-
function ke(r) {
|
|
858
|
-
return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
|
|
859
|
-
}
|
|
860
|
-
function tt(r = /* @__PURE__ */ new Date()) {
|
|
861
|
-
const t = r.getFullYear();
|
|
862
|
-
return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
863
|
-
}
|
|
864
|
-
function ot(r = /* @__PURE__ */ new Date()) {
|
|
865
|
-
const t = (e) => String(e).padStart(2, "0");
|
|
866
|
-
return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
|
|
867
|
-
}
|
|
868
|
-
function ft(r) {
|
|
869
|
-
return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
870
|
-
}
|
|
871
|
-
function V(r) {
|
|
872
|
-
if (!r || !/^#[0-9a-fA-F]{6}$/.test(r)) return "#FFFFFF";
|
|
873
|
-
const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
|
|
874
|
-
return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
|
|
875
|
-
}
|
|
876
|
-
const Se = (r) => {
|
|
877
|
-
const t = ["th", "st", "nd", "rd"], e = r % 100;
|
|
878
|
-
return r + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
879
|
-
};
|
|
880
|
-
function Ae(r) {
|
|
881
|
-
if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
|
|
882
|
-
if (r.state === "final") {
|
|
883
|
-
const t = [];
|
|
884
|
-
return r.finish === "overtime" && t.push("OT"), r.finish === "shootout" && t.push("PK-SO"), r.forfeit && r.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
885
|
-
}
|
|
886
|
-
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${X(r.time)}`.replace(/ · $/, "") };
|
|
887
|
-
}
|
|
888
|
-
function Ht(r, t, e, s, a) {
|
|
966
|
+
function jt(a, t, e, s, r) {
|
|
889
967
|
const o = t[e];
|
|
890
968
|
if (!o) return null;
|
|
891
969
|
const i = /* @__PURE__ */ new Map();
|
|
892
|
-
for (const c of
|
|
893
|
-
if (c.sport !== s ||
|
|
894
|
-
const p = c.gender || "",
|
|
895
|
-
(!
|
|
970
|
+
for (const c of a || []) {
|
|
971
|
+
if (c.sport !== s || r && c.effectiveDate > r || c.gender && o.gender !== c.gender && o.gender !== "coed") continue;
|
|
972
|
+
const p = c.gender || "", d = i.get(p);
|
|
973
|
+
(!d || c.effectiveDate > d.effectiveDate) && i.set(p, c);
|
|
896
974
|
}
|
|
897
975
|
let n = null;
|
|
898
976
|
for (const c of i.values()) {
|
|
@@ -901,69 +979,89 @@ function Ht(r, t, e, s, a) {
|
|
|
901
979
|
}
|
|
902
980
|
return n ? n.rank : null;
|
|
903
981
|
}
|
|
904
|
-
function
|
|
905
|
-
if (!
|
|
906
|
-
const s = (
|
|
982
|
+
function Be(a, t, e) {
|
|
983
|
+
if (!a) return { kind: "none", delta: 0 };
|
|
984
|
+
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
907
985
|
if (!s) return { kind: "none", delta: 0 };
|
|
908
986
|
if (!t) return { kind: "same", delta: 0 };
|
|
909
|
-
const
|
|
910
|
-
if (!
|
|
911
|
-
const o =
|
|
987
|
+
const r = (t.teamIds || []).indexOf(e) + 1;
|
|
988
|
+
if (!r) return { kind: "new", delta: 0 };
|
|
989
|
+
const o = r - s;
|
|
912
990
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
913
991
|
}
|
|
914
|
-
function
|
|
915
|
-
return /^https?:\/\//i.test(String(
|
|
992
|
+
function Fe(a) {
|
|
993
|
+
return /^https?:\/\//i.test(String(a || ""));
|
|
916
994
|
}
|
|
917
|
-
function
|
|
918
|
-
const e =
|
|
919
|
-
if (!
|
|
920
|
-
const s = Math.max(1, Math.round(t * 2)),
|
|
921
|
-
return `${e}${
|
|
995
|
+
function Y(a, t) {
|
|
996
|
+
const e = a?.logoAssetId;
|
|
997
|
+
if (!Fe(e)) return "";
|
|
998
|
+
const s = Math.max(1, Math.round(t * 2)), r = e.includes("?") ? "&" : "?";
|
|
999
|
+
return `${e}${r}w=${s}&h=${s}&f=webp`;
|
|
922
1000
|
}
|
|
923
|
-
|
|
924
|
-
const
|
|
925
|
-
return
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1001
|
+
function gt(a, t, { title: e, sub: s, teams: r }) {
|
|
1002
|
+
const o = Mt(), n = !!a.querySelector(':scope > a[slot="nav"]') || Se(o, t.hrefs, t.sport) !== null;
|
|
1003
|
+
return l`
|
|
1004
|
+
<div class="band section">
|
|
1005
|
+
<div class="inner">
|
|
1006
|
+
<h1>${e}</h1>
|
|
1007
|
+
${s ? l`<p class="sub">${s}</p>` : m}
|
|
1008
|
+
</div>
|
|
1009
|
+
${n ? l`
|
|
1010
|
+
<nav class="sectionnav" aria-label="${P(t.sport)} section">
|
|
1011
|
+
<div class="navrow">
|
|
1012
|
+
<slot name="nav">
|
|
1013
|
+
${Ae(t.sport, r, t.hrefs).map((c) => l`<a href=${c.href}
|
|
1014
|
+
aria-current=${o && _(c.href) === o ? "page" : m}>${c.label}</a>`)}
|
|
1015
|
+
</slot>
|
|
1016
|
+
</div>
|
|
1017
|
+
</nav>` : m}
|
|
1018
|
+
</div>
|
|
1019
|
+
`;
|
|
1020
|
+
}
|
|
1021
|
+
const N = (a, t) => {
|
|
1022
|
+
const e = a.teamsById[t];
|
|
1023
|
+
return e ? a.schoolsById[e.schoolId] : null;
|
|
1024
|
+
}, z = (a, t) => N(a, t)?.name || "TBD", Z = (a, t) => N(a, t)?.abbr || "TBD";
|
|
1025
|
+
function H(a, t = 26) {
|
|
1026
|
+
if (!a) return m;
|
|
1027
|
+
const e = Y(a, t);
|
|
930
1028
|
if (e)
|
|
931
|
-
return
|
|
1029
|
+
return l`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
932
1030
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
933
|
-
const s =
|
|
934
|
-
return
|
|
935
|
-
style="width:${t}px;height:${t}px;background:${s};color:${
|
|
936
|
-
>${
|
|
1031
|
+
const s = a.colorPrimary || "#030711", r = q(s);
|
|
1032
|
+
return l`<span class="swatch" aria-hidden="true"
|
|
1033
|
+
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
1034
|
+
>${mt(a)}</span>`;
|
|
937
1035
|
}
|
|
938
|
-
function
|
|
939
|
-
const s =
|
|
940
|
-
return s ?
|
|
1036
|
+
function vt(a, t, e) {
|
|
1037
|
+
const s = jt(a.rankings, a.teamsById, t, a.sport, e);
|
|
1038
|
+
return s ? l`<span class="rankbadge">#${s}</span>` : m;
|
|
941
1039
|
}
|
|
942
|
-
function
|
|
943
|
-
const s =
|
|
944
|
-
return s ?
|
|
1040
|
+
function nt(a, t, e) {
|
|
1041
|
+
const s = N(a, t);
|
|
1042
|
+
return s ? l`${vt(a, t, e)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
|
|
945
1043
|
}
|
|
946
|
-
function
|
|
947
|
-
const s =
|
|
948
|
-
if (!s || !s.results.length) return
|
|
949
|
-
const
|
|
950
|
-
return
|
|
951
|
-
${
|
|
952
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
953
|
-
href=${
|
|
1044
|
+
function $t(a, t, e = 5) {
|
|
1045
|
+
const s = a.records[t];
|
|
1046
|
+
if (!s || !s.results.length) return l`<span class="mut">·</span>`;
|
|
1047
|
+
const r = s.results.slice(-1 * e);
|
|
1048
|
+
return l`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1049
|
+
${r.map((o) => l`<a class="dot ${o.mark}"
|
|
1050
|
+
title="${o.mark} ${o.my}-${o.their} vs ${z(a, o.opp)}"
|
|
1051
|
+
href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
954
1052
|
</span>`;
|
|
955
1053
|
}
|
|
956
|
-
function
|
|
957
|
-
const t =
|
|
958
|
-
return
|
|
1054
|
+
function K(a) {
|
|
1055
|
+
const t = ke(a);
|
|
1056
|
+
return l`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
959
1057
|
}
|
|
960
|
-
function
|
|
961
|
-
if (!t) return
|
|
962
|
-
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId,
|
|
963
|
-
return
|
|
1058
|
+
function Wt(a, t, e) {
|
|
1059
|
+
if (!t) return l`<span class="mut">·</span>`;
|
|
1060
|
+
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
1061
|
+
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${r} ${Z(a, s)}`;
|
|
964
1062
|
}
|
|
965
|
-
class
|
|
966
|
-
static styles =
|
|
1063
|
+
class Gt extends b {
|
|
1064
|
+
static styles = j;
|
|
967
1065
|
static properties = {
|
|
968
1066
|
...b.properties,
|
|
969
1067
|
sport: { type: String },
|
|
@@ -976,11 +1074,11 @@ class Lt extends b {
|
|
|
976
1074
|
connectedCallback() {
|
|
977
1075
|
if (super.connectedCallback(), !this.date) {
|
|
978
1076
|
const t = new URLSearchParams(globalThis.location?.search || "").get("date");
|
|
979
|
-
this.date = t ||
|
|
1077
|
+
this.date = t || it();
|
|
980
1078
|
}
|
|
981
1079
|
}
|
|
982
1080
|
async fetchData(t) {
|
|
983
|
-
const e = this.season || tt(), [s,
|
|
1081
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
984
1082
|
t.listSchools(),
|
|
985
1083
|
t.listTeams({ sport: this.sport }),
|
|
986
1084
|
t.listConferences(),
|
|
@@ -990,7 +1088,7 @@ class Lt extends b {
|
|
|
990
1088
|
return {
|
|
991
1089
|
season: e,
|
|
992
1090
|
schools: s.items,
|
|
993
|
-
teams:
|
|
1091
|
+
teams: r.items,
|
|
994
1092
|
conferences: o.items,
|
|
995
1093
|
games: i.items,
|
|
996
1094
|
rankings: n.items
|
|
@@ -998,34 +1096,33 @@ class Lt extends b {
|
|
|
998
1096
|
}
|
|
999
1097
|
get ctx() {
|
|
1000
1098
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1001
|
-
teamsById:
|
|
1002
|
-
schoolsById:
|
|
1003
|
-
records:
|
|
1099
|
+
teamsById: v(this.data.teams),
|
|
1100
|
+
schoolsById: v(this.data.schools),
|
|
1101
|
+
records: W(this.data.games),
|
|
1004
1102
|
rankings: this.data.rankings,
|
|
1005
1103
|
hrefs: L(this),
|
|
1006
1104
|
sport: this.sport
|
|
1007
1105
|
}, this._ctxData = this.data), this._ctx;
|
|
1008
1106
|
}
|
|
1009
1107
|
renderView() {
|
|
1010
|
-
const t = this.ctx, e =
|
|
1011
|
-
return
|
|
1108
|
+
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(), r = this.data.games.filter((i) => i.date === this.date).sort((i, n) => (i.state === "live" ? -1 : 1) - (n.state === "live" ? -1 : 1)), o = /* @__PURE__ */ new Map();
|
|
1109
|
+
return r.forEach((i) => {
|
|
1012
1110
|
const n = i.gameType === "conference" && i.conferenceId ? e[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1013
1111
|
o.has(n) || o.set(n, []), o.get(n).push(i);
|
|
1014
|
-
}),
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
</div>
|
|
1112
|
+
}), l`
|
|
1113
|
+
${gt(this, t, {
|
|
1114
|
+
title: l`${P(this.sport)} scores & schedules`,
|
|
1115
|
+
sub: l`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${r.length} games`,
|
|
1116
|
+
teams: this.data.teams
|
|
1117
|
+
})}
|
|
1021
1118
|
<div class="view">
|
|
1022
1119
|
<div class="toolbar">
|
|
1023
1120
|
<label class="asof" for="datesel">Date</label>
|
|
1024
1121
|
<select id="datesel" @change=${(i) => {
|
|
1025
1122
|
this.date = i.target.value;
|
|
1026
1123
|
}}>
|
|
1027
|
-
${s.map((i) =>
|
|
1028
|
-
${y(i, { weekday: "short", month: "short", day: "numeric" })}${i ===
|
|
1124
|
+
${s.map((i) => l`<option value=${i} ?selected=${i === this.date}>
|
|
1125
|
+
${y(i, { weekday: "short", month: "short", day: "numeric" })}${i === it() ? " · today" : ""}
|
|
1029
1126
|
</option>`)}
|
|
1030
1127
|
</select>
|
|
1031
1128
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1039,8 +1136,8 @@ class Lt extends b {
|
|
|
1039
1136
|
<span class="spacer"></span>
|
|
1040
1137
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1041
1138
|
</div>
|
|
1042
|
-
${
|
|
1043
|
-
${[...o.entries()].map(([i, n]) =>
|
|
1139
|
+
${r.length ? m : l`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1140
|
+
${[...o.entries()].map(([i, n]) => l`
|
|
1044
1141
|
<div class="section-title">${i}</div>
|
|
1045
1142
|
<div class="card"><ul class="gamelist">
|
|
1046
1143
|
${n.map((c) => this.renderGame(t, c))}
|
|
@@ -1051,21 +1148,21 @@ class Lt extends b {
|
|
|
1051
1148
|
}
|
|
1052
1149
|
renderGame(t, e) {
|
|
1053
1150
|
const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` : X(e.time);
|
|
1054
|
-
return
|
|
1151
|
+
return l`
|
|
1055
1152
|
<li>
|
|
1056
|
-
${
|
|
1057
|
-
<span class="opp">${
|
|
1153
|
+
${K(e)}
|
|
1154
|
+
<span class="opp">${nt(t, e.awayTeamId, e.date)} at ${nt(t, e.homeTeamId, e.date)}</span>
|
|
1058
1155
|
<span class="res" style="width:auto">${s}</span>
|
|
1059
1156
|
<span class="where">${e.venue || ""}</span>
|
|
1060
|
-
${e.broadcast ?
|
|
1061
|
-
<a class="box" href=${
|
|
1157
|
+
${e.broadcast ? l`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1158
|
+
<a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1062
1159
|
</li>
|
|
1063
1160
|
`;
|
|
1064
1161
|
}
|
|
1065
1162
|
}
|
|
1066
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1067
|
-
class
|
|
1068
|
-
static styles =
|
|
1163
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Gt);
|
|
1164
|
+
class Vt extends b {
|
|
1165
|
+
static styles = j;
|
|
1069
1166
|
static properties = {
|
|
1070
1167
|
...b.properties,
|
|
1071
1168
|
sport: { type: String },
|
|
@@ -1077,7 +1174,7 @@ class jt extends b {
|
|
|
1077
1174
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1078
1175
|
}
|
|
1079
1176
|
async fetchData(t) {
|
|
1080
|
-
const e = this.season || tt(), [s,
|
|
1177
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
1081
1178
|
t.listConferences({ active: !0 }),
|
|
1082
1179
|
t.listSchools(),
|
|
1083
1180
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1087,7 +1184,7 @@ class jt extends b {
|
|
|
1087
1184
|
return {
|
|
1088
1185
|
season: e,
|
|
1089
1186
|
conferences: s.items,
|
|
1090
|
-
schools:
|
|
1187
|
+
schools: r.items,
|
|
1091
1188
|
teams: o.items,
|
|
1092
1189
|
games: i.items,
|
|
1093
1190
|
rankings: n.items
|
|
@@ -1095,51 +1192,50 @@ class jt extends b {
|
|
|
1095
1192
|
}
|
|
1096
1193
|
get ctx() {
|
|
1097
1194
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1098
|
-
teamsById:
|
|
1099
|
-
schoolsById:
|
|
1100
|
-
records:
|
|
1195
|
+
teamsById: v(this.data.teams),
|
|
1196
|
+
schoolsById: v(this.data.schools),
|
|
1197
|
+
records: W(this.data.games),
|
|
1101
1198
|
rankings: this.data.rankings,
|
|
1102
1199
|
hrefs: L(this),
|
|
1103
1200
|
sport: this.sport
|
|
1104
1201
|
}, this._ctxData = this.data), this._ctx;
|
|
1105
1202
|
}
|
|
1106
1203
|
renderView() {
|
|
1107
|
-
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
</div>
|
|
1204
|
+
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter));
|
|
1205
|
+
return l`
|
|
1206
|
+
${gt(this, t, {
|
|
1207
|
+
title: l`${P(this.sport)} standings`,
|
|
1208
|
+
sub: l`${this.data.season} season · every conference, computed live from reported results`,
|
|
1209
|
+
teams: this.data.teams
|
|
1210
|
+
})}
|
|
1115
1211
|
<div class="view">
|
|
1116
1212
|
<div class="toolbar">
|
|
1117
1213
|
<div role="group" aria-label="Classification filter">
|
|
1118
|
-
${e.map((
|
|
1214
|
+
${e.map((r) => l`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
1119
1215
|
@click=${() => {
|
|
1120
|
-
this.classFilter =
|
|
1121
|
-
}}>${
|
|
1216
|
+
this.classFilter = r;
|
|
1217
|
+
}}>${r}</button>`)}
|
|
1122
1218
|
</div>
|
|
1123
1219
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
1124
|
-
.value=${this.query} @input=${(
|
|
1125
|
-
this.query =
|
|
1220
|
+
.value=${this.query} @input=${(r) => {
|
|
1221
|
+
this.query = r.target.value;
|
|
1126
1222
|
}}>
|
|
1127
1223
|
<span class="spacer"></span>
|
|
1128
|
-
<span class="asof">Records through ${y(
|
|
1224
|
+
<span class="asof">Records through ${y(it(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1129
1225
|
</div>
|
|
1130
|
-
${s.map((
|
|
1226
|
+
${s.map((r) => this.renderConference(t, r))}
|
|
1131
1227
|
</div>
|
|
1132
1228
|
`;
|
|
1133
1229
|
}
|
|
1134
1230
|
renderConference(t, e) {
|
|
1135
1231
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1136
1232
|
if (!s.length) return m;
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1233
|
+
const r = this.query.trim().toLowerCase(), o = Lt(s, t.records);
|
|
1234
|
+
return l`
|
|
1139
1235
|
<div class="card">
|
|
1140
1236
|
<div class="card-head">
|
|
1141
1237
|
<h2>${e.name}</h2>
|
|
1142
|
-
${(e.classifications || []).map((i) =>
|
|
1238
|
+
${(e.classifications || []).map((i) => l`<span class="pill class">${i}</span>`)}
|
|
1143
1239
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1144
1240
|
</div>
|
|
1145
1241
|
<div class="tablewrap"><table class="data">
|
|
@@ -1149,44 +1245,44 @@ class jt extends b {
|
|
|
1149
1245
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1150
1246
|
</tr></thead>
|
|
1151
1247
|
<tbody>
|
|
1152
|
-
${o.map((i, n) => this.renderRow(t, i, n,
|
|
1248
|
+
${o.map((i, n) => this.renderRow(t, i, n, r))}
|
|
1153
1249
|
</tbody>
|
|
1154
1250
|
</table></div>
|
|
1155
1251
|
</div>
|
|
1156
1252
|
`;
|
|
1157
1253
|
}
|
|
1158
|
-
renderRow(t, e, s,
|
|
1254
|
+
renderRow(t, e, s, r) {
|
|
1159
1255
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1160
|
-
if (
|
|
1161
|
-
const n = e.rec.pf - e.rec.pa, c =
|
|
1162
|
-
<span class="pill champ" title="${h.season} ${h.title} champion">★ ${h.season} ${h.title}</span>`),
|
|
1163
|
-
location.href =
|
|
1256
|
+
if (r && !i.toLowerCase().includes(r)) return m;
|
|
1257
|
+
const n = e.rec.pf - e.rec.pa, c = ut(this.data.games, e.team.id), p = (e.team.championships || []).map((h) => l`
|
|
1258
|
+
<span class="pill champ" title="${h.season} ${h.title} champion">★ ${h.season} ${h.title}</span>`), d = () => {
|
|
1259
|
+
location.href = g(t.hrefs.school, { id: e.team.schoolId });
|
|
1164
1260
|
};
|
|
1165
|
-
return
|
|
1261
|
+
return l`
|
|
1166
1262
|
<tr class="rowlink" @click=${(h) => {
|
|
1167
|
-
h.target.closest("a") ||
|
|
1263
|
+
h.target.closest("a") || d();
|
|
1168
1264
|
}}>
|
|
1169
1265
|
<td class="mut">${s + 1}</td>
|
|
1170
1266
|
<td class="teamcell">
|
|
1171
|
-
${
|
|
1172
|
-
<a href=${
|
|
1267
|
+
${H(o)}${vt(t, e.team.id, null)}
|
|
1268
|
+
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${p}
|
|
1173
1269
|
</td>
|
|
1174
1270
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1175
|
-
<td class="num">${
|
|
1271
|
+
<td class="num">${Dt(e.confPct)}</td>
|
|
1176
1272
|
<td class="num">${x(e.rec)}</td>
|
|
1177
|
-
<td class="num">${
|
|
1273
|
+
<td class="num">${Dt(e.overallPct)}</td>
|
|
1178
1274
|
<td class="num">${e.rec.pf}</td>
|
|
1179
1275
|
<td class="num">${e.rec.pa}</td>
|
|
1180
1276
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1181
|
-
<td>${
|
|
1182
|
-
<td>${
|
|
1183
|
-
<td>${
|
|
1277
|
+
<td>${et(e.rec.results) || "·"}</td>
|
|
1278
|
+
<td>${$t(t, e.team.id)}</td>
|
|
1279
|
+
<td>${Wt(t, c, e.team.id)}</td>
|
|
1184
1280
|
</tr>
|
|
1185
1281
|
`;
|
|
1186
1282
|
}
|
|
1187
1283
|
}
|
|
1188
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1189
|
-
const
|
|
1284
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Vt);
|
|
1285
|
+
const Ue = w`
|
|
1190
1286
|
.hero1 {
|
|
1191
1287
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1192
1288
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1203,8 +1299,8 @@ const Ce = w`
|
|
|
1203
1299
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1204
1300
|
.sparkline { vertical-align: middle; }
|
|
1205
1301
|
`;
|
|
1206
|
-
class
|
|
1207
|
-
static styles = [...
|
|
1302
|
+
class qt extends b {
|
|
1303
|
+
static styles = [...j, Ue];
|
|
1208
1304
|
static properties = {
|
|
1209
1305
|
...b.properties,
|
|
1210
1306
|
sport: { type: String },
|
|
@@ -1221,17 +1317,17 @@ class Wt extends b {
|
|
|
1221
1317
|
t && (this.pollDate = t);
|
|
1222
1318
|
}
|
|
1223
1319
|
async fetchData(t) {
|
|
1224
|
-
const e = this.season || tt(), [s,
|
|
1320
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
1225
1321
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1226
1322
|
t.listSchools(),
|
|
1227
1323
|
t.listTeams({ sport: this.sport }),
|
|
1228
1324
|
t.listConferences(),
|
|
1229
1325
|
t.listGames({ sport: this.sport, season: e })
|
|
1230
|
-
]), c = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p,
|
|
1326
|
+
]), c = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, d) => d.effectiveDate.localeCompare(p.effectiveDate));
|
|
1231
1327
|
return {
|
|
1232
1328
|
season: e,
|
|
1233
1329
|
polls: c,
|
|
1234
|
-
schools:
|
|
1330
|
+
schools: r.items,
|
|
1235
1331
|
teams: o.items,
|
|
1236
1332
|
conferences: i.items,
|
|
1237
1333
|
games: n.items
|
|
@@ -1239,9 +1335,9 @@ class Wt extends b {
|
|
|
1239
1335
|
}
|
|
1240
1336
|
get ctx() {
|
|
1241
1337
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1242
|
-
teamsById:
|
|
1243
|
-
schoolsById:
|
|
1244
|
-
records:
|
|
1338
|
+
teamsById: v(this.data.teams),
|
|
1339
|
+
schoolsById: v(this.data.schools),
|
|
1340
|
+
records: W(this.data.games),
|
|
1245
1341
|
rankings: this.data.polls,
|
|
1246
1342
|
hrefs: L(this),
|
|
1247
1343
|
sport: this.sport
|
|
@@ -1251,42 +1347,41 @@ class Wt extends b {
|
|
|
1251
1347
|
const n = e.map((h, f) => {
|
|
1252
1348
|
const u = (h.teamIds || []).indexOf(t);
|
|
1253
1349
|
if (u === -1) return null;
|
|
1254
|
-
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1255
|
-
return { x: $, y:
|
|
1350
|
+
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, st = 3 + u / 24 * 20;
|
|
1351
|
+
return { x: $, y: st };
|
|
1256
1352
|
}), c = [];
|
|
1257
1353
|
let p = [];
|
|
1258
1354
|
if (n.forEach((h) => {
|
|
1259
1355
|
h ? p.push(h) : p.length && (c.push(p), p = []);
|
|
1260
1356
|
}), p.length && c.push(p), !c.length) return m;
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1263
|
-
${c.map((h) =>
|
|
1357
|
+
const d = n[s];
|
|
1358
|
+
return l`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1359
|
+
${c.map((h) => It`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1264
1360
|
points=${h.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1265
|
-
${
|
|
1361
|
+
${d ? It`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1266
1362
|
</svg>`;
|
|
1267
1363
|
}
|
|
1268
1364
|
movement(t, e, s) {
|
|
1269
|
-
const
|
|
1270
|
-
return
|
|
1365
|
+
const r = Be(t, e, s);
|
|
1366
|
+
return r.kind === "up" ? l`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? l`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? l`<span class="delta new">NEW</span>` : r.kind === "same" ? l`<span class="delta same">—</span>` : l`<span class="delta same">·</span>`;
|
|
1271
1367
|
}
|
|
1272
1368
|
renderView() {
|
|
1273
1369
|
const t = this.ctx, e = this.data.polls;
|
|
1274
|
-
if (!e.length) return
|
|
1275
|
-
const s = Math.max(0, e.findIndex((h) => h.effectiveDate === this.pollDate)),
|
|
1276
|
-
return
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
</div>
|
|
1370
|
+
if (!e.length) return l`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1371
|
+
const s = Math.max(0, e.findIndex((h) => h.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(r), c = v(this.data.conferences), p = (r.teamIds || [])[0], d = p ? N(t, p) : null;
|
|
1372
|
+
return l`
|
|
1373
|
+
${gt(this, t, {
|
|
1374
|
+
title: l`${P(this.sport)} Top 25`,
|
|
1375
|
+
sub: l`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1376
|
+
teams: this.data.teams
|
|
1377
|
+
})}
|
|
1283
1378
|
<div class="view">
|
|
1284
1379
|
<div class="toolbar">
|
|
1285
1380
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1286
1381
|
<select id="pollsel" @change=${(h) => {
|
|
1287
1382
|
this.pollDate = h.target.value;
|
|
1288
1383
|
}}>
|
|
1289
|
-
${e.map((h, f) =>
|
|
1384
|
+
${e.map((h, f) => l`<option value=${h.effectiveDate} ?selected=${h === r}>
|
|
1290
1385
|
${y(h.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1291
1386
|
</option>`)}
|
|
1292
1387
|
</select>
|
|
@@ -1301,65 +1396,65 @@ class Wt extends b {
|
|
|
1301
1396
|
<span class="spacer"></span>
|
|
1302
1397
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1303
1398
|
</div>
|
|
1304
|
-
${
|
|
1399
|
+
${d ? this.renderHero(t, r, o, p, d, c) : m}
|
|
1305
1400
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1306
1401
|
<thead><tr>
|
|
1307
1402
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1308
1403
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1309
1404
|
</tr></thead>
|
|
1310
1405
|
<tbody>
|
|
1311
|
-
${(
|
|
1406
|
+
${(r.teamIds || []).map((h, f) => f === 0 || !h ? m : this.renderRow(t, r, o, i, n, c, h, f + 1))}
|
|
1312
1407
|
</tbody>
|
|
1313
1408
|
</table></div></div>
|
|
1314
1409
|
<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>
|
|
1315
1410
|
</div>
|
|
1316
1411
|
`;
|
|
1317
1412
|
}
|
|
1318
|
-
renderHero(t, e, s,
|
|
1319
|
-
const n = t.records[
|
|
1320
|
-
return
|
|
1321
|
-
<div class="hero1" style="background:${
|
|
1413
|
+
renderHero(t, e, s, r, o, i) {
|
|
1414
|
+
const n = t.records[r], c = zt(t.records, r), p = i[t.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1415
|
+
return l`
|
|
1416
|
+
<div class="hero1" style="background:${d}">
|
|
1322
1417
|
<div class="bigrank">#1</div>
|
|
1323
|
-
${
|
|
1418
|
+
${H(o, 64)}
|
|
1324
1419
|
<div>
|
|
1325
|
-
<h2><a href=${
|
|
1420
|
+
<h2><a href=${g(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1326
1421
|
<div class="facts">
|
|
1327
|
-
${x(n)} overall${p ?
|
|
1328
|
-
· streak ${
|
|
1329
|
-
${c ?
|
|
1330
|
-
${this.movement(e, s,
|
|
1422
|
+
${x(n)} overall${p ? l` · ${x(n, !0)} ${p.name}` : m}
|
|
1423
|
+
· streak ${et(n?.results) || "·"}
|
|
1424
|
+
${c ? l` · last: ${c.mark} ${c.my}-${c.their} vs ${Z(t, c.opp)}` : m}
|
|
1425
|
+
${this.movement(e, s, r)}
|
|
1331
1426
|
</div>
|
|
1332
1427
|
</div>
|
|
1333
1428
|
</div>
|
|
1334
1429
|
`;
|
|
1335
1430
|
}
|
|
1336
|
-
renderRow(t, e, s,
|
|
1337
|
-
const p =
|
|
1431
|
+
renderRow(t, e, s, r, o, i, n, c) {
|
|
1432
|
+
const p = N(t, n);
|
|
1338
1433
|
if (!p) return m;
|
|
1339
|
-
const
|
|
1340
|
-
location.href =
|
|
1434
|
+
const d = t.records[n], h = zt(t.records, n), f = ut(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
|
|
1435
|
+
location.href = g(t.hrefs.school, { id: p.id });
|
|
1341
1436
|
};
|
|
1342
|
-
return
|
|
1343
|
-
<tr class="rowlink" @click=${(
|
|
1344
|
-
|
|
1437
|
+
return l`
|
|
1438
|
+
<tr class="rowlink" @click=${(st) => {
|
|
1439
|
+
st.target.closest("a") || $();
|
|
1345
1440
|
}}>
|
|
1346
1441
|
<td class="num" style="font-weight:700">${c}</td>
|
|
1347
1442
|
<td>${this.movement(e, s, n)}</td>
|
|
1348
|
-
<td class="teamcell">${
|
|
1443
|
+
<td class="teamcell">${H(p)}<a href=${g(t.hrefs.school, { id: p.id })}>${p.name}</a>
|
|
1349
1444
|
<span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
|
|
1350
|
-
<td class="num">${x(
|
|
1445
|
+
<td class="num">${x(d)}</td>
|
|
1351
1446
|
<td class="mut">${u?.name || "Independent"}</td>
|
|
1352
|
-
<td>${h ?
|
|
1447
|
+
<td>${h ? l`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: h.gameId })}>
|
|
1353
1448
|
<b style="color:${h.mark === "W" ? "var(--hsot-win)" : h.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${h.mark}</b>
|
|
1354
|
-
${h.my}-${h.their} vs ${
|
|
1355
|
-
<td>${
|
|
1356
|
-
<td>${this.sparkline(n,
|
|
1449
|
+
${h.my}-${h.their} vs ${Z(t, h.opp)}</a>` : l`<span class="mut">·</span>`}</td>
|
|
1450
|
+
<td>${Wt(t, f, n)}</td>
|
|
1451
|
+
<td>${this.sparkline(n, r, o)}</td>
|
|
1357
1452
|
</tr>
|
|
1358
1453
|
`;
|
|
1359
1454
|
}
|
|
1360
1455
|
}
|
|
1361
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1362
|
-
const
|
|
1456
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", qt);
|
|
1457
|
+
const Oe = w`
|
|
1363
1458
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1364
1459
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1365
1460
|
.schoolhero .crest {
|
|
@@ -1384,8 +1479,8 @@ const Ee = w`
|
|
|
1384
1479
|
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
|
|
1385
1480
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1386
1481
|
`;
|
|
1387
|
-
class
|
|
1388
|
-
static styles = [...
|
|
1482
|
+
class Yt extends b {
|
|
1483
|
+
static styles = [...j, Oe];
|
|
1389
1484
|
static properties = {
|
|
1390
1485
|
...b.properties,
|
|
1391
1486
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1402,7 +1497,7 @@ class Vt extends b {
|
|
|
1402
1497
|
t && !this.sport && (this.sport = t);
|
|
1403
1498
|
}
|
|
1404
1499
|
async fetchData(t) {
|
|
1405
|
-
const e = this.season || tt(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, c, p,
|
|
1500
|
+
const e = this.season || tt(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, c, p, d, h, f, u] = await Promise.all([
|
|
1406
1501
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1407
1502
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1408
1503
|
t.listSchools(),
|
|
@@ -1421,7 +1516,7 @@ class Vt extends b {
|
|
|
1421
1516
|
games: n.items,
|
|
1422
1517
|
allTeams: c.items,
|
|
1423
1518
|
schools: p.items,
|
|
1424
|
-
conferences:
|
|
1519
|
+
conferences: d.items,
|
|
1425
1520
|
rankings: h.items,
|
|
1426
1521
|
roster: f.items.find(($) => $.season === e) || null,
|
|
1427
1522
|
players: u.items
|
|
@@ -1429,9 +1524,9 @@ class Vt extends b {
|
|
|
1429
1524
|
}
|
|
1430
1525
|
get ctx() {
|
|
1431
1526
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1432
|
-
teamsById:
|
|
1433
|
-
schoolsById:
|
|
1434
|
-
records:
|
|
1527
|
+
teamsById: v(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
|
|
1528
|
+
schoolsById: v(this.data.schools),
|
|
1529
|
+
records: W(this.data.games),
|
|
1435
1530
|
rankings: this.data.rankings,
|
|
1436
1531
|
hrefs: L(this),
|
|
1437
1532
|
sport: this.data.active?.sport || "football"
|
|
@@ -1441,110 +1536,110 @@ class Vt extends b {
|
|
|
1441
1536
|
this.sport = t, this.load();
|
|
1442
1537
|
}
|
|
1443
1538
|
renderView() {
|
|
1444
|
-
const { school: t, teams: e, active: s, season:
|
|
1445
|
-
if (!t) return
|
|
1446
|
-
const o = this.ctx, i =
|
|
1447
|
-
return
|
|
1539
|
+
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1540
|
+
if (!t) return l`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1541
|
+
const o = this.ctx, i = q(t.colorPrimary || "#030711"), n = (t.adm || [])[0], c = v(this.data.conferences), p = s ? c[s.conferenceId] : null;
|
|
1542
|
+
return l`
|
|
1448
1543
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1449
1544
|
<div class="inner">
|
|
1450
|
-
${
|
|
1545
|
+
${Y(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${Y(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${q(t.colorSecondary || "#7C7C7C")}">${mt(t)}</div>`}
|
|
1451
1546
|
<div style="min-width:260px">
|
|
1452
1547
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1453
1548
|
<div class="facts">
|
|
1454
|
-
${t.location ?
|
|
1455
|
-
${t.association ?
|
|
1456
|
-
${p ?
|
|
1457
|
-
${n ?
|
|
1458
|
-
${t.openingYear ?
|
|
1459
|
-
${t.areaCode ?
|
|
1460
|
-
${t.tagSlug ?
|
|
1549
|
+
${t.location ? l`<span><b>Location</b>${t.location}${t.county ? l` · ${t.county} County` : m}</span>` : m}
|
|
1550
|
+
${t.association ? l`<span><b>League</b>${t.association}${t.classification ? l` · ${t.classification}` : m}</span>` : m}
|
|
1551
|
+
${p ? l`<span><b>Conference</b>${p.name}</span>` : m}
|
|
1552
|
+
${n ? l`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
|
|
1553
|
+
${t.openingYear ? l`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1554
|
+
${t.areaCode ? l`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1555
|
+
${t.tagSlug ? l`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
|
|
1461
1556
|
</div>
|
|
1462
1557
|
</div>
|
|
1463
1558
|
</div>
|
|
1464
1559
|
</div>
|
|
1465
1560
|
<div class="band">
|
|
1466
1561
|
<nav class="tabs" aria-label="Teams">
|
|
1467
|
-
${e.map((
|
|
1468
|
-
h.preventDefault(), this.switchSport(
|
|
1469
|
-
}}>${
|
|
1562
|
+
${e.map((d) => d.id === s?.id ? l`<a class="on" href="#" @click=${(h) => h.preventDefault()}>${d.name}</a>` : l`<a href="#" @click=${(h) => {
|
|
1563
|
+
h.preventDefault(), this.switchSport(d.sport);
|
|
1564
|
+
}}>${d.name}</a>`)}
|
|
1470
1565
|
</nav>
|
|
1471
1566
|
</div>
|
|
1472
1567
|
<div class="view">
|
|
1473
|
-
${s ? this.renderTeam(o, s, p,
|
|
1568
|
+
${s ? this.renderTeam(o, s, p, r) : l`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1474
1569
|
</div>
|
|
1475
1570
|
`;
|
|
1476
1571
|
}
|
|
1477
|
-
renderTeam(t, e, s,
|
|
1478
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((h) => h.conferenceId === s.id) : [], c = s ?
|
|
1479
|
-
return
|
|
1572
|
+
renderTeam(t, e, s, r) {
|
|
1573
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((h) => h.conferenceId === s.id) : [], c = s ? Lt(n, t.records).findIndex((h) => h.team.id === e.id) + 1 : 0, p = jt(t.rankings, t.teamsById, e.id, e.sport, null), d = this.data.games.filter((h) => h.homeTeamId === e.id || h.awayTeamId === e.id).sort((h, f) => String(h.date).localeCompare(String(f.date)));
|
|
1574
|
+
return l`
|
|
1480
1575
|
<div class="tiles">
|
|
1481
1576
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1482
1577
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1483
|
-
<div class="s">${c ? `${
|
|
1578
|
+
<div class="s">${c ? `${xe(c)} of ${n.length}` : "·"}</div></div>
|
|
1484
1579
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1485
1580
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1486
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1487
|
-
<div class="s">last 5: ${
|
|
1581
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${et(o.results) || "·"}</div>
|
|
1582
|
+
<div class="s">last 5: ${$t(t, e.id)}</div></div>
|
|
1488
1583
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
|
|
1489
|
-
<div class="s"><a href=${
|
|
1584
|
+
<div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1490
1585
|
</div>
|
|
1491
|
-
${(e.championships || []).length ?
|
|
1586
|
+
${(e.championships || []).length ? l`
|
|
1492
1587
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1493
|
-
${e.championships.map((h) =>
|
|
1588
|
+
${e.championships.map((h) => l`<span class="pill champ">★ ${h.season} ${h.title} champion${h.classification ? ` · ${h.classification}` : ""}${h.region ? ` · ${h.region}` : ""}</span>`)}
|
|
1494
1589
|
</div>` : m}
|
|
1495
1590
|
<div class="cols">
|
|
1496
1591
|
<div>
|
|
1497
1592
|
<div class="section-title">Schedule & results</div>
|
|
1498
1593
|
<div class="card">
|
|
1499
|
-
${
|
|
1594
|
+
${d.length ? l`<ul class="gamelist">${d.map((h) => this.renderGameRow(t, e, h))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1500
1595
|
</div>
|
|
1501
1596
|
</div>
|
|
1502
1597
|
<div>
|
|
1503
|
-
<div class="section-title">Roster · ${
|
|
1504
|
-
<div class="card">${this.renderRoster(
|
|
1598
|
+
<div class="section-title">Roster · ${r}</div>
|
|
1599
|
+
<div class="card">${this.renderRoster(r)}</div>
|
|
1505
1600
|
</div>
|
|
1506
1601
|
</div>
|
|
1507
1602
|
`;
|
|
1508
1603
|
}
|
|
1509
1604
|
renderGameRow(t, e, s) {
|
|
1510
|
-
const
|
|
1511
|
-
let c =
|
|
1605
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore, n = r ? s.awayScore : s.homeScore;
|
|
1606
|
+
let c = l`<span class="mut">${X(s.time)}</span>`;
|
|
1512
1607
|
if (s.state === "final") {
|
|
1513
|
-
const
|
|
1514
|
-
c =
|
|
1515
|
-
} else s.state === "live" && (c =
|
|
1608
|
+
const d = ft(s), h = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
|
|
1609
|
+
c = l`<span class=${h}>${h}</span> ${i}-${n}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
|
|
1610
|
+
} else s.state === "live" && (c = l`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1516
1611
|
const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1517
|
-
return
|
|
1612
|
+
return l`
|
|
1518
1613
|
<li>
|
|
1519
1614
|
<span class="d">${y(s.date)}</span>
|
|
1520
|
-
${
|
|
1615
|
+
${K(s)}
|
|
1521
1616
|
<span class="res">${c}</span>
|
|
1522
|
-
<span class="opp">${
|
|
1617
|
+
<span class="opp">${r ? "vs" : "at"} ${nt(t, o, s.date)}
|
|
1523
1618
|
<span class="pill type">${p}</span>
|
|
1524
|
-
${s.broadcast ?
|
|
1619
|
+
${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1525
1620
|
</span>
|
|
1526
1621
|
<span class="where">${s.venue || ""}</span>
|
|
1527
|
-
<a class="box" href=${
|
|
1622
|
+
<a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
1528
1623
|
</li>
|
|
1529
1624
|
`;
|
|
1530
1625
|
}
|
|
1531
1626
|
renderRoster(t) {
|
|
1532
1627
|
const e = this.data.roster;
|
|
1533
1628
|
if (!e)
|
|
1534
|
-
return
|
|
1535
|
-
const s =
|
|
1536
|
-
return
|
|
1629
|
+
return l`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1630
|
+
const s = v(this.data.players), r = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
|
|
1631
|
+
return l`
|
|
1537
1632
|
<div class="tablewrap"><table class="data">
|
|
1538
1633
|
<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></tr></thead>
|
|
1539
1634
|
<tbody>
|
|
1540
|
-
${
|
|
1635
|
+
${r.map((o) => {
|
|
1541
1636
|
const i = s[o.playerId];
|
|
1542
|
-
return i ?
|
|
1637
|
+
return i ? l`<tr>
|
|
1543
1638
|
<td class="num mut">${o.number ?? "·"}</td>
|
|
1544
1639
|
<td style="font-weight:500">${i.firstName} ${i.lastName}</td>
|
|
1545
1640
|
<td>${o.position || "·"}</td>
|
|
1546
1641
|
<td class="mut">${i.classOf || "·"}</td>
|
|
1547
|
-
<td class="num">${
|
|
1642
|
+
<td class="num">${we(i.heightIn)}</td>
|
|
1548
1643
|
<td class="num">${i.weightLb || "·"}</td>
|
|
1549
1644
|
</tr>` : m;
|
|
1550
1645
|
})}
|
|
@@ -1553,22 +1648,37 @@ class Vt extends b {
|
|
|
1553
1648
|
`;
|
|
1554
1649
|
}
|
|
1555
1650
|
}
|
|
1556
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1557
|
-
const
|
|
1558
|
-
function
|
|
1559
|
-
return
|
|
1651
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Yt);
|
|
1652
|
+
const Ne = "https://api.wral.com/search";
|
|
1653
|
+
function He(a) {
|
|
1654
|
+
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1560
1655
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const e = String(
|
|
1656
|
+
function Me(a, t) {
|
|
1657
|
+
const e = String(a || Ne).replace(/\/+$/, ""), s = new URLSearchParams({ query: He(t), sort: "score", lang: "en" });
|
|
1563
1658
|
return `${e}/v1/query?${s}`;
|
|
1564
1659
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1660
|
+
function Zt(a) {
|
|
1661
|
+
try {
|
|
1662
|
+
const t = new URL(a);
|
|
1663
|
+
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
1664
|
+
const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
|
|
1665
|
+
return {
|
|
1666
|
+
uri: a,
|
|
1667
|
+
title: s ? a : decodeURIComponent(e).replace(/-/g, " "),
|
|
1668
|
+
photos: !0
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
} catch {
|
|
1672
|
+
}
|
|
1673
|
+
return { uri: a, title: a };
|
|
1570
1674
|
}
|
|
1571
|
-
|
|
1675
|
+
async function Le(a, t, e) {
|
|
1676
|
+
const r = await ((...n) => fetch(...n))(Me(a, t));
|
|
1677
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1678
|
+
const o = await r.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1679
|
+
return t.map((n) => i.get(n) || Zt(n));
|
|
1680
|
+
}
|
|
1681
|
+
const je = w`
|
|
1572
1682
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1573
1683
|
.breadcrumbs a { text-decoration: none; }
|
|
1574
1684
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1607,8 +1717,8 @@ const Be = w`
|
|
|
1607
1717
|
.cols { grid-template-columns: 1fr; }
|
|
1608
1718
|
}
|
|
1609
1719
|
`;
|
|
1610
|
-
class
|
|
1611
|
-
static styles = [...
|
|
1720
|
+
class Kt extends b {
|
|
1721
|
+
static styles = [...j, je];
|
|
1612
1722
|
static properties = {
|
|
1613
1723
|
...b.properties,
|
|
1614
1724
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1622,7 +1732,7 @@ class Gt extends b {
|
|
|
1622
1732
|
super(), this.gameId = "", this.searchApi = "";
|
|
1623
1733
|
}
|
|
1624
1734
|
async fetchData(t) {
|
|
1625
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [
|
|
1735
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, n, c, p] = await Promise.all([
|
|
1626
1736
|
t.listSchools(),
|
|
1627
1737
|
t.listTeams({ sport: e.sport }),
|
|
1628
1738
|
t.listConferences(),
|
|
@@ -1630,11 +1740,11 @@ class Gt extends b {
|
|
|
1630
1740
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1631
1741
|
// A search outage must not blank the box score — degrade to bare
|
|
1632
1742
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1633
|
-
s.length ?
|
|
1743
|
+
s.length ? Le(this.searchApi, s).catch(() => s.map(Zt)) : Promise.resolve([])
|
|
1634
1744
|
]);
|
|
1635
1745
|
return {
|
|
1636
1746
|
game: e,
|
|
1637
|
-
schools:
|
|
1747
|
+
schools: r.items,
|
|
1638
1748
|
teams: o.items,
|
|
1639
1749
|
conferences: i.items,
|
|
1640
1750
|
rankings: n.items,
|
|
@@ -1644,9 +1754,9 @@ class Gt extends b {
|
|
|
1644
1754
|
}
|
|
1645
1755
|
get ctx() {
|
|
1646
1756
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1647
|
-
teamsById:
|
|
1648
|
-
schoolsById:
|
|
1649
|
-
records:
|
|
1757
|
+
teamsById: v(this.data.teams),
|
|
1758
|
+
schoolsById: v(this.data.schools),
|
|
1759
|
+
records: W(this.data.games),
|
|
1650
1760
|
rankings: this.data.rankings,
|
|
1651
1761
|
hrefs: L(this),
|
|
1652
1762
|
sport: this.data.game.sport
|
|
@@ -1654,49 +1764,49 @@ class Gt extends b {
|
|
|
1654
1764
|
}
|
|
1655
1765
|
renderView() {
|
|
1656
1766
|
const t = this.data.game;
|
|
1657
|
-
if (!t) return
|
|
1658
|
-
const e = this.ctx, s =
|
|
1659
|
-
return
|
|
1767
|
+
if (!t) return l`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1768
|
+
const e = this.ctx, s = v(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ft(t), n = (d) => t.state === "final" && i !== d && i !== "tie" ? "opacity:0.45" : "", c = t.conferenceId ? s[t.conferenceId] : null, p = this.data.games.filter((d) => d.id !== t.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === t.homeTeamId && d.awayTeamId === t.awayTeamId || d.homeTeamId === t.awayTeamId && d.awayTeamId === t.homeTeamId));
|
|
1769
|
+
return l`
|
|
1660
1770
|
<div class="view">
|
|
1661
1771
|
<p class="breadcrumbs">
|
|
1662
|
-
<a href=${
|
|
1663
|
-
<a href=${
|
|
1664
|
-
${
|
|
1772
|
+
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${P(t.sport)}</a> /
|
|
1773
|
+
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1774
|
+
${z(e, t.awayTeamId)} at ${z(e, t.homeTeamId)}
|
|
1665
1775
|
</p>
|
|
1666
1776
|
<div class="card">
|
|
1667
1777
|
<div class="scorehead">
|
|
1668
|
-
${this.teamBlock(e, t, t.awayTeamId,
|
|
1778
|
+
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1669
1779
|
<div class="mid">
|
|
1670
1780
|
<div class="bigscore">
|
|
1671
1781
|
<span style=${n("away")}>${t.awayScore}</span>
|
|
1672
1782
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1673
1783
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1674
1784
|
</div>
|
|
1675
|
-
<div class="status">${
|
|
1676
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ?
|
|
1677
|
-
${t.broadcast ?
|
|
1785
|
+
<div class="status">${K(t)}</div>
|
|
1786
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${X(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1787
|
+
${t.broadcast ? l` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1678
1788
|
<div class="status">
|
|
1679
1789
|
<span class="pill type">${t.gameType === "conference" ? `${c?.name || "Conference"} game` : t.gameType}</span>
|
|
1680
|
-
${t.label ?
|
|
1681
|
-
${(t.tags || []).map((
|
|
1790
|
+
${t.label ? l`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
1791
|
+
${(t.tags || []).map((d) => l`<span class="pill type">${d}</span>`)}
|
|
1682
1792
|
</div>
|
|
1683
1793
|
</div>
|
|
1684
1794
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1685
1795
|
</div>
|
|
1686
|
-
${this.renderLineScore(t,
|
|
1687
|
-
${t.notes ?
|
|
1796
|
+
${this.renderLineScore(t, r, o)}
|
|
1797
|
+
${t.notes ? l`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1688
1798
|
</div>
|
|
1689
|
-
${(this.data.coverage || []).length ?
|
|
1799
|
+
${(this.data.coverage || []).length ? l`
|
|
1690
1800
|
<div class="section-title">Coverage</div>
|
|
1691
1801
|
<div class="covgrid">
|
|
1692
|
-
${this.data.coverage.map((
|
|
1693
|
-
<a class="card covcard" href=${
|
|
1694
|
-
${
|
|
1802
|
+
${this.data.coverage.map((d) => l`
|
|
1803
|
+
<a class="card covcard" href=${d.uri}>
|
|
1804
|
+
${d.image ? l`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
|
|
1695
1805
|
<div class="covbody">
|
|
1696
|
-
<div class="covtitle">${
|
|
1697
|
-
${
|
|
1698
|
-
${
|
|
1699
|
-
<div class="covmeta">${[
|
|
1806
|
+
<div class="covtitle">${d.videoDuration ? l`<span class="pill live" style="animation:none">Video</span> ` : m}${d.photos ? l`<span class="pill live" style="animation:none">Photos</span> ` : m}${d.title || d.uri}</div>
|
|
1807
|
+
${d.description ? l`<p class="covdesc">${d.description}</p>` : m}
|
|
1808
|
+
${d.author || d.publishedTime ? l`
|
|
1809
|
+
<div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1700
1810
|
` : m}
|
|
1701
1811
|
</div>
|
|
1702
1812
|
</a>
|
|
@@ -1704,50 +1814,50 @@ class Gt extends b {
|
|
|
1704
1814
|
</div>` : m}
|
|
1705
1815
|
<div class="section-title">Season context</div>
|
|
1706
1816
|
<div class="cols">
|
|
1707
|
-
${[[t.awayTeamId,
|
|
1817
|
+
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([d, h]) => this.renderContext(e, d, h))}
|
|
1708
1818
|
</div>
|
|
1709
|
-
${p.length ?
|
|
1819
|
+
${p.length ? l`
|
|
1710
1820
|
<div class="section-title">Head to head this season</div>
|
|
1711
1821
|
<div class="card"><ul class="gamelist">
|
|
1712
|
-
${p.map((
|
|
1713
|
-
<span class="d">${y(
|
|
1714
|
-
<span class="opp">${
|
|
1715
|
-
<a class="box" href=${
|
|
1822
|
+
${p.map((d) => l`<li>
|
|
1823
|
+
<span class="d">${y(d.date)}</span>${K(d)}
|
|
1824
|
+
<span class="opp">${z(e, d.awayTeamId)} ${d.awayScore}, ${z(e, d.homeTeamId)} ${d.homeScore}</span>
|
|
1825
|
+
<a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: d.id })}>Box score →</a>
|
|
1716
1826
|
</li>`)}
|
|
1717
1827
|
</ul></div>` : m}
|
|
1718
1828
|
</div>
|
|
1719
1829
|
`;
|
|
1720
1830
|
}
|
|
1721
|
-
teamBlock(t, e, s,
|
|
1722
|
-
if (!
|
|
1723
|
-
const i = t.teamsById[s], n = t.records[s], c =
|
|
1724
|
-
return
|
|
1831
|
+
teamBlock(t, e, s, r, o) {
|
|
1832
|
+
if (!r) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1833
|
+
const i = t.teamsById[s], n = t.records[s], c = Y(r, 58);
|
|
1834
|
+
return l`
|
|
1725
1835
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1726
|
-
${c ?
|
|
1836
|
+
${c ? l`<img class="crest logo" alt="" loading="lazy" src=${c} />` : l`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${q(r.colorPrimary || "#030711")}">${mt(r)}</span>`}
|
|
1727
1837
|
<div>
|
|
1728
|
-
<div class="tname">${
|
|
1729
|
-
<div class="trec">${
|
|
1838
|
+
<div class="tname">${vt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
1839
|
+
<div class="trec">${r.mascot || ""} · ${x(n)}${i?.conferenceId ? l` · ${x(n, !0)} conf` : m}</div>
|
|
1730
1840
|
</div>
|
|
1731
1841
|
</div>
|
|
1732
1842
|
`;
|
|
1733
1843
|
}
|
|
1734
1844
|
renderLineScore(t, e, s) {
|
|
1735
|
-
const
|
|
1736
|
-
if (!
|
|
1737
|
-
return
|
|
1738
|
-
const o = Math.max(4, ...
|
|
1739
|
-
const h =
|
|
1845
|
+
const r = t.periodScores || [];
|
|
1846
|
+
if (!r.length)
|
|
1847
|
+
return l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1848
|
+
const o = Math.max(4, ...r.map((p) => p.period)), i = (p) => p <= 4 ? String(p) : `OT${p > 5 ? p - 4 : ""}`, n = (p, d) => {
|
|
1849
|
+
const h = r.find((f) => f.period === d);
|
|
1740
1850
|
return h ? h[p] : t.state === "final" ? 0 : "·";
|
|
1741
|
-
}, c = (p,
|
|
1851
|
+
}, c = (p, d, h) => l`
|
|
1742
1852
|
<tr>
|
|
1743
|
-
<td class="teamcell">${
|
|
1744
|
-
${Array.from({ length: o }, (f, u) =>
|
|
1853
|
+
<td class="teamcell">${H(p, 20)}${p?.abbr || "TBD"}</td>
|
|
1854
|
+
${Array.from({ length: o }, (f, u) => l`<td class="num">${n(d, u + 1)}</td>`)}
|
|
1745
1855
|
<td class="num" style="font-weight:700">${h}</td>
|
|
1746
1856
|
</tr>`;
|
|
1747
|
-
return
|
|
1857
|
+
return l`
|
|
1748
1858
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1749
1859
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1750
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (p,
|
|
1860
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, d) => l`<th class="num">${i(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1751
1861
|
<tbody>
|
|
1752
1862
|
${c(e, "away", t.awayScore)}
|
|
1753
1863
|
${c(s, "home", t.homeScore)}
|
|
@@ -1758,36 +1868,36 @@ class Gt extends b {
|
|
|
1758
1868
|
}
|
|
1759
1869
|
renderContext(t, e, s) {
|
|
1760
1870
|
if (!s) return m;
|
|
1761
|
-
const
|
|
1762
|
-
return
|
|
1871
|
+
const r = t.records[e], o = ut(this.data.games, e);
|
|
1872
|
+
return l`
|
|
1763
1873
|
<div class="card ctxcard">
|
|
1764
|
-
<div class="who">${
|
|
1874
|
+
<div class="who">${H(s)}${s.name}</div>
|
|
1765
1875
|
<div class="row">
|
|
1766
|
-
<span>Last 5: ${
|
|
1767
|
-
<span>Streak: <b>${
|
|
1768
|
-
<span>PF/PA: <b>${
|
|
1769
|
-
<span>Next: ${o ?
|
|
1770
|
-
${o.homeTeamId === e ? "vs" : "at"} ${
|
|
1876
|
+
<span>Last 5: ${$t(t, e)}</span>
|
|
1877
|
+
<span>Streak: <b>${r ? et(r.results) : "·"}</b></span>
|
|
1878
|
+
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
1879
|
+
<span>Next: ${o ? l`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1880
|
+
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1771
1881
|
</div>
|
|
1772
1882
|
</div>
|
|
1773
1883
|
`;
|
|
1774
1884
|
}
|
|
1775
1885
|
}
|
|
1776
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1777
|
-
const
|
|
1778
|
-
"hsot-scores":
|
|
1779
|
-
"hsot-standings":
|
|
1780
|
-
"hsot-rankings":
|
|
1781
|
-
"hsot-school":
|
|
1782
|
-
"hsot-boxscore":
|
|
1886
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Kt);
|
|
1887
|
+
const We = {
|
|
1888
|
+
"hsot-scores": Gt,
|
|
1889
|
+
"hsot-standings": Vt,
|
|
1890
|
+
"hsot-rankings": qt,
|
|
1891
|
+
"hsot-school": Yt,
|
|
1892
|
+
"hsot-boxscore": Kt
|
|
1783
1893
|
};
|
|
1784
|
-
function
|
|
1785
|
-
const
|
|
1786
|
-
if (
|
|
1787
|
-
for (const [t, e] of Object.entries(
|
|
1788
|
-
|
|
1894
|
+
function Ge() {
|
|
1895
|
+
const a = globalThis?.customElements;
|
|
1896
|
+
if (a)
|
|
1897
|
+
for (const [t, e] of Object.entries(We))
|
|
1898
|
+
a.get(t) || a.define(t, e);
|
|
1789
1899
|
}
|
|
1790
|
-
typeof window < "u" && globalThis.customElements &&
|
|
1900
|
+
typeof window < "u" && globalThis.customElements && Ge();
|
|
1791
1901
|
export {
|
|
1792
|
-
|
|
1902
|
+
Ge as defineAll
|
|
1793
1903
|
};
|