@wral/hsot-data 0.5.1 → 0.7.0
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 +10 -1
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +623 -571
- package/dist/{hsot-brackets-ClfXvdcH.js → hsot-brackets-DAlf4dVv.js} +549 -497
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const J = globalThis, me = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ue = /* @__PURE__ */ Symbol(), Te = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let
|
|
2
|
+
let We = class {
|
|
3
3
|
constructor(e, t, s) {
|
|
4
4
|
if (this._$cssResult$ = !0, s !== ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = e, this.t = t;
|
|
@@ -17,28 +17,28 @@ let qe = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const St = (a) => new We(typeof a == "string" ? a : a + "", void 0, ue), b = (a, ...e) => {
|
|
21
21
|
const t = a.length === 1 ? a[0] : e.reduce((s, r, o) => s + ((n) => {
|
|
22
22
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
23
|
if (typeof n == "number") return n;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(r) + a[o + 1], a[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
26
|
+
return new We(t, a, ue);
|
|
27
|
+
}, _t = (a, e) => {
|
|
28
28
|
if (me) a.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
29
29
|
else for (const t of e) {
|
|
30
30
|
const s = document.createElement("style"), r = J.litNonce;
|
|
31
31
|
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, Ie = me ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((e) => {
|
|
34
34
|
let t = "";
|
|
35
35
|
for (const s of e.cssRules) t += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return St(t);
|
|
37
37
|
})(a) : a;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: At, defineProperty: Tt, getOwnPropertyDescriptor: It, getOwnPropertyNames: Ct, getOwnPropertySymbols: Et, getPrototypeOf: Pt } = Object, re = globalThis, Ce = re.trustedTypes, Bt = Ce ? Ce.emptyScript : "", Dt = re.reactiveElementPolyfillSupport, j = (a, e) => a, he = { toAttribute(a, e) {
|
|
39
39
|
switch (e) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
a = a ?
|
|
41
|
+
a = a ? Bt : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,23 +63,23 @@ const { is: _t, defineProperty: Tt, getOwnPropertyDescriptor: At, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return t;
|
|
66
|
-
} },
|
|
66
|
+
} }, Ve = (a, e) => !At(a, e), Ee = { attribute: !0, type: String, converter: he, reflect: !1, useDefault: !1, hasChanged: Ve };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), re.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
-
let
|
|
68
|
+
let z = class extends HTMLElement {
|
|
69
69
|
static addInitializer(e) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(e);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(e, t =
|
|
75
|
+
static createProperty(e, t = Ee) {
|
|
76
76
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
77
77
|
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
78
78
|
r !== void 0 && Tt(this.prototype, e, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(e, t, s) {
|
|
82
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = It(this.prototype, e) ?? { get() {
|
|
83
83
|
return this[t];
|
|
84
84
|
}, set(n) {
|
|
85
85
|
this[t] = n;
|
|
@@ -90,17 +90,17 @@ let R = class extends HTMLElement {
|
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(e) {
|
|
93
|
-
return this.elementProperties.get(e) ??
|
|
93
|
+
return this.elementProperties.get(e) ?? Ee;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const e =
|
|
96
|
+
if (this.hasOwnProperty(j("elementProperties"))) return;
|
|
97
|
+
const e = Pt(this);
|
|
98
98
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const t = this.properties, s = [...
|
|
101
|
+
if (this.hasOwnProperty(j("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
|
|
103
|
+
const t = this.properties, s = [...Ct(t), ...Et(t)];
|
|
104
104
|
for (const r of s) this.createProperty(r, t[r]);
|
|
105
105
|
}
|
|
106
106
|
const e = this[Symbol.metadata];
|
|
@@ -119,8 +119,8 @@ let R = class extends HTMLElement {
|
|
|
119
119
|
const t = [];
|
|
120
120
|
if (Array.isArray(e)) {
|
|
121
121
|
const s = new Set(e.flat(1 / 0).reverse());
|
|
122
|
-
for (const r of s) t.unshift(
|
|
123
|
-
} else e !== void 0 && t.push(
|
|
122
|
+
for (const r of s) t.unshift(Ie(r));
|
|
123
|
+
} else e !== void 0 && t.push(Ie(e));
|
|
124
124
|
return t;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(e, t) {
|
|
@@ -146,7 +146,7 @@ let R = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return _t(e, this.constructor.elementStyles), e;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
@@ -178,7 +178,7 @@ let R = class extends HTMLElement {
|
|
|
178
178
|
requestUpdate(e, t, s, r = !1, o) {
|
|
179
179
|
if (e !== void 0) {
|
|
180
180
|
const n = this.constructor;
|
|
181
|
-
if (r === !1 && (o = this[e]), s ??= n.getPropertyOptions(e), !((s.hasChanged ??
|
|
181
|
+
if (r === !1 && (o = this[e]), s ??= n.getPropertyOptions(e), !((s.hasChanged ?? Ve)(o, t) || s.useDefault && s.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, s)))) return;
|
|
182
182
|
this.C(e, t, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -246,70 +246,70 @@ let R = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(e) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const fe = globalThis,
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
249
|
+
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[j("elementProperties")] = /* @__PURE__ */ new Map(), z[j("finalized")] = /* @__PURE__ */ new Map(), Dt?.({ ReactiveElement: z }), (re.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const fe = globalThis, Pe = (a) => a, X = fe.trustedTypes, Be = X ? X.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ke = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Ye = "?" + _, Rt = `<${Ye}>`, E = document, q = () => E.createComment(""), W = (a) => a === null || typeof a != "object" && typeof a != "function", ge = Array.isArray, zt = (a) => ge(a) || typeof a?.[Symbol.iterator] == "function", ce = `[
|
|
251
|
+
\f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, De = /-->/g, Re = />/g, I = RegExp(`>|${ce}(?:([^\\s"'>=/]+)(${ce}*=${ce}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ze = /'/g, Ne = /"/g, Qe = /^(?:script|style|textarea|title)$/i, Ze = (a) => (e, ...t) => ({ _$litType$: a, strings: e, values: t }), c = Ze(1), Me = Ze(2), F = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Fe = /* @__PURE__ */ new WeakMap(), C = E.createTreeWalker(E, 129);
|
|
253
|
+
function Je(a, e) {
|
|
254
254
|
if (!ge(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
-
return
|
|
255
|
+
return Be !== void 0 ? Be.createHTML(e) : e;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Nt = (a, e) => {
|
|
258
258
|
const t = a.length - 1, s = [];
|
|
259
|
-
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n =
|
|
259
|
+
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = L;
|
|
260
260
|
for (let i = 0; i < t; i++) {
|
|
261
|
-
const
|
|
261
|
+
const l = a[i];
|
|
262
262
|
let p, d, h = -1, u = 0;
|
|
263
|
-
for (; u <
|
|
264
|
-
const f = n ===
|
|
265
|
-
o += n ===
|
|
263
|
+
for (; u < l.length && (n.lastIndex = u, d = n.exec(l), d !== null); ) u = n.lastIndex, n === L ? d[1] === "!--" ? n = De : d[1] !== void 0 ? n = Re : d[2] !== void 0 ? (Qe.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = I) : d[3] !== void 0 && (n = I) : n === I ? d[0] === ">" ? (n = r ?? L, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, p = d[1], n = d[3] === void 0 ? I : d[3] === '"' ? Ne : ze) : n === Ne || n === ze ? n = I : n === De || n === Re ? n = L : (n = I, r = void 0);
|
|
264
|
+
const f = n === I && a[i + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === L ? l + Rt : h >= 0 ? (s.push(p), l.slice(0, h) + Ke + l.slice(h) + _ + f) : l + _ + (h === -2 ? i : f);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Je(a, o + (a[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class V {
|
|
270
270
|
constructor({ strings: e, _$litType$: t }, s) {
|
|
271
271
|
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, n = 0;
|
|
274
|
-
const i = e.length - 1,
|
|
275
|
-
if (this.el =
|
|
274
|
+
const i = e.length - 1, l = this.parts, [p, d] = Nt(e, t);
|
|
275
|
+
if (this.el = V.createElement(p, s), C.currentNode = this.el.content, t === 2 || t === 3) {
|
|
276
276
|
const h = this.el.content.firstChild;
|
|
277
277
|
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (r =
|
|
279
|
+
for (; (r = C.nextNode()) !== null && l.length < i; ) {
|
|
280
280
|
if (r.nodeType === 1) {
|
|
281
|
-
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(
|
|
281
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ke)) {
|
|
282
282
|
const u = d[n++], f = r.getAttribute(h).split(_), g = /([.?@])?(.*)/.exec(u);
|
|
283
|
-
|
|
284
|
-
} else h.startsWith(_) && (
|
|
285
|
-
if (
|
|
283
|
+
l.push({ type: 1, index: o, name: g[2], strings: f, ctor: g[1] === "." ? Ft : g[1] === "?" ? Ot : g[1] === "@" ? Ut : oe }), r.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(_) && (l.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
285
|
+
if (Qe.test(r.tagName)) {
|
|
286
286
|
const h = r.textContent.split(_), u = h.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
288
|
r.textContent = X ? X.emptyScript : "";
|
|
289
|
-
for (let f = 0; f < u; f++) r.append(h[f],
|
|
290
|
-
r.append(h[u],
|
|
289
|
+
for (let f = 0; f < u; f++) r.append(h[f], q()), C.nextNode(), l.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(h[u], q());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (r.nodeType === 8) if (r.data === Ye)
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Ye) l.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let h = -1;
|
|
296
|
-
for (; (h = r.data.indexOf(_, h + 1)) !== -1; )
|
|
296
|
+
for (; (h = r.data.indexOf(_, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += _.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(e, t) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = E.createElement("template");
|
|
303
303
|
return s.innerHTML = e, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function O(a, e, t = a, s) {
|
|
307
307
|
if (e === F) return e;
|
|
308
308
|
let r = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
309
|
-
const o =
|
|
310
|
-
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e =
|
|
309
|
+
const o = W(e) ? void 0 : e._$litDirective$;
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e = O(a, r._$AS(a, e.values), r, s)), e;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Mt {
|
|
313
313
|
constructor(e, t) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
315
315
|
}
|
|
@@ -320,17 +320,17 @@ class Nt {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(e) {
|
|
323
|
-
const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ??
|
|
324
|
-
|
|
325
|
-
let o =
|
|
326
|
-
for (;
|
|
327
|
-
if (n ===
|
|
323
|
+
const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ?? E).importNode(t, !0);
|
|
324
|
+
C.currentNode = r;
|
|
325
|
+
let o = C.nextNode(), n = 0, i = 0, l = s[0];
|
|
326
|
+
for (; l !== void 0; ) {
|
|
327
|
+
if (n === l.index) {
|
|
328
328
|
let p;
|
|
329
|
-
|
|
329
|
+
l.type === 2 ? p = new Y(o, o.nextSibling, this, e) : l.type === 1 ? p = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (p = new Ht(o, this, e)), this._$AV.push(p), l = s[++i];
|
|
330
330
|
}
|
|
331
|
-
n !==
|
|
331
|
+
n !== l?.index && (o = C.nextNode(), n++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return C.currentNode = E, r;
|
|
334
334
|
}
|
|
335
335
|
p(e) {
|
|
336
336
|
let t = 0;
|
|
@@ -356,7 +356,7 @@ class Y {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(e, t = this) {
|
|
359
|
-
e =
|
|
359
|
+
e = O(this, e, t), W(e) ? e === m || e == null || e === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : e !== this._$AH && e !== F && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : zt(e) ? this.k(e) : this._(e);
|
|
360
360
|
}
|
|
361
361
|
O(e) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -365,31 +365,31 @@ class Y {
|
|
|
365
365
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
366
|
}
|
|
367
367
|
_(e) {
|
|
368
|
-
this._$AH !== m &&
|
|
368
|
+
this._$AH !== m && W(this._$AH) ? this._$AA.nextSibling.data = e : this.T(E.createTextNode(e)), this._$AH = e;
|
|
369
369
|
}
|
|
370
370
|
$(e) {
|
|
371
|
-
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el =
|
|
371
|
+
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = V.createElement(Je(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new Mt(r, this), n = o.u(this.options);
|
|
375
375
|
o.p(t), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(e) {
|
|
379
379
|
let t = Fe.get(e.strings);
|
|
380
|
-
return t === void 0 && Fe.set(e.strings, t = new
|
|
380
|
+
return t === void 0 && Fe.set(e.strings, t = new V(e)), t;
|
|
381
381
|
}
|
|
382
382
|
k(e) {
|
|
383
383
|
ge(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const t = this._$AH;
|
|
385
385
|
let s, r = 0;
|
|
386
|
-
for (const o of e) r === t.length ? t.push(s = new Y(this.O(
|
|
386
|
+
for (const o of e) r === t.length ? t.push(s = new Y(this.O(q()), this.O(q()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
387
387
|
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
390
390
|
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = Pe(e).nextSibling;
|
|
392
|
+
Pe(e).remove(), e = s;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(e) {
|
|
@@ -409,11 +409,11 @@ class oe {
|
|
|
409
409
|
_$AI(e, t = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let n = !1;
|
|
412
|
-
if (o === void 0) e =
|
|
412
|
+
if (o === void 0) e = O(this, e, t, 0), n = !W(e) || e !== this._$AH && e !== F, n && (this._$AH = e);
|
|
413
413
|
else {
|
|
414
414
|
const i = e;
|
|
415
|
-
let
|
|
416
|
-
for (e = o[0],
|
|
415
|
+
let l, p;
|
|
416
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) p = O(this, i[s + l], t, l), p === F && (p = this._$AH[l]), n ||= !W(p) || p !== this._$AH[l], p === m ? e = m : e !== m && (e += (p ?? "") + o[l + 1]), this._$AH[l] = p;
|
|
417
417
|
}
|
|
418
418
|
n && !r && this.j(e);
|
|
419
419
|
}
|
|
@@ -429,7 +429,7 @@ class Ft extends oe {
|
|
|
429
429
|
this.element[this.name] = e === m ? void 0 : e;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Ot extends oe {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,12 +437,12 @@ class Mt extends oe {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!e && e !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Ut extends oe {
|
|
441
441
|
constructor(e, t, s, r, o) {
|
|
442
442
|
super(e, t, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(e, t = this) {
|
|
445
|
-
if ((e =
|
|
445
|
+
if ((e = O(this, e, t, 0) ?? m) === F) return;
|
|
446
446
|
const s = this._$AH, r = e === m && s !== m || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== m && (s === m || r);
|
|
447
447
|
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
448
|
}
|
|
@@ -450,7 +450,7 @@ class Ot extends oe {
|
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class Ht {
|
|
454
454
|
constructor(e, t, s) {
|
|
455
455
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class Ut {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(e) {
|
|
461
|
-
|
|
461
|
+
O(this, e);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const Lt = fe.litHtmlPolyfillSupport;
|
|
465
|
+
Lt?.(V, Y), (fe.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const Gt = (a, e, t) => {
|
|
467
467
|
const s = t?.renderBefore ?? e;
|
|
468
468
|
let r = s._$litPart$;
|
|
469
469
|
if (r === void 0) {
|
|
470
470
|
const o = t?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = r = new Y(e.insertBefore(
|
|
471
|
+
s._$litPart$ = r = new Y(e.insertBefore(q(), o), o, void 0, t ?? {});
|
|
472
472
|
}
|
|
473
473
|
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
475
|
const ve = globalThis;
|
|
476
|
-
class
|
|
476
|
+
class M extends z {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class N extends R {
|
|
|
483
483
|
}
|
|
484
484
|
update(e) {
|
|
485
485
|
const t = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Gt(t, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -495,35 +495,35 @@ class N extends R {
|
|
|
495
495
|
return F;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
498
|
+
M._$litElement$ = !0, M.finalized = !0, ve.litElementHydrateSupport?.({ LitElement: M });
|
|
499
|
+
const jt = ve.litElementPolyfillSupport;
|
|
500
|
+
jt?.({ LitElement: M });
|
|
501
501
|
(ve.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
const
|
|
503
|
-
function
|
|
502
|
+
const qt = 50;
|
|
503
|
+
function Wt(a = {}) {
|
|
504
504
|
const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!e.length) return "";
|
|
506
506
|
const t = new URLSearchParams();
|
|
507
507
|
return e.forEach(([s, r]) => t.set(s, String(r))), `?${t.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Vt({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
|
|
510
510
|
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
511
|
const s = a.replace(/\/+$/, ""), r = t || ((...i) => fetch(...i));
|
|
512
512
|
async function o(i) {
|
|
513
|
-
const
|
|
514
|
-
e && (
|
|
515
|
-
const p = await r(`${s}${i}`, { headers:
|
|
513
|
+
const l = { Accept: "application/json" };
|
|
514
|
+
e && (l.Authorization = `Bearer ${e}`);
|
|
515
|
+
const p = await r(`${s}${i}`, { headers: l });
|
|
516
516
|
if (!p.ok) {
|
|
517
517
|
const d = new Error(`api-hsot ${p.status} on ${i}`);
|
|
518
518
|
throw d.status = p.status, d;
|
|
519
519
|
}
|
|
520
520
|
return p.json();
|
|
521
521
|
}
|
|
522
|
-
async function n(i,
|
|
522
|
+
async function n(i, l = {}) {
|
|
523
523
|
const p = [];
|
|
524
524
|
let d = null;
|
|
525
|
-
for (let h = 0; h <
|
|
526
|
-
const u =
|
|
525
|
+
for (let h = 0; h < qt; h += 1) {
|
|
526
|
+
const u = Wt(d ? { ...l, cursor: d } : l), f = await o(`${i}${u}`);
|
|
527
527
|
if (p.push(...f.items || []), d = f.nextCursor || null, !d) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: p, total: p.length, nextCursor: null };
|
|
@@ -539,13 +539,13 @@ function Wt({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
|
|
|
539
539
|
listGames: (i) => n("/games", i),
|
|
540
540
|
getGame: (i) => o(`/games/${i}`),
|
|
541
541
|
listTournaments: (i) => n("/tournaments", i),
|
|
542
|
-
listSeedings: (i,
|
|
543
|
-
listEdges: (i,
|
|
542
|
+
listSeedings: (i, l) => n(`/tournaments/${i}/seedings`, l),
|
|
543
|
+
listEdges: (i, l) => n(`/tournaments/${i}/edges`, l),
|
|
544
544
|
listRankings: (i) => n("/rankings", i),
|
|
545
545
|
listSports: () => o("/sports")
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
const
|
|
548
|
+
const G = {
|
|
549
549
|
game: "/{sport}/game/{id}/",
|
|
550
550
|
school: "/school/{id}/",
|
|
551
551
|
section: "/{sport}/{view}/",
|
|
@@ -556,16 +556,16 @@ const L = {
|
|
|
556
556
|
function v(a, e) {
|
|
557
557
|
return String(a).replace(/\{(\w+)\}/g, (t, s) => e[s] !== void 0 && e[s] !== null ? String(e[s]) : t);
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function U(a) {
|
|
560
560
|
return {
|
|
561
|
-
game: a.getAttribute("game-href") ||
|
|
562
|
-
school: a.getAttribute("school-href") ||
|
|
563
|
-
section: a.getAttribute("section-href") ||
|
|
564
|
-
report: a.getAttribute("report-href") ||
|
|
561
|
+
game: a.getAttribute("game-href") || G.game,
|
|
562
|
+
school: a.getAttribute("school-href") || G.school,
|
|
563
|
+
section: a.getAttribute("section-href") || G.section,
|
|
564
|
+
report: a.getAttribute("report-href") || G.report
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
const t = v(a.report ||
|
|
567
|
+
function Xe(a, e = "") {
|
|
568
|
+
const t = v(a.report || G.report, { id: e || "" });
|
|
569
569
|
return e ? t : t.replace(/([?&])game=(?=&|$)/, "$1").replace(/[?&]$/, "").replace(/\?&/, "?");
|
|
570
570
|
}
|
|
571
571
|
const k = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
@@ -581,27 +581,27 @@ function $e(a) {
|
|
|
581
581
|
const s = e >= 12 ? "PM" : "AM";
|
|
582
582
|
return `${(e + 11) % 12 + 1}:${String(t || 0).padStart(2, "0")} ${s}`;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Kt(a) {
|
|
585
585
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
586
586
|
}
|
|
587
587
|
function Yt(a) {
|
|
588
588
|
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Q(a = /* @__PURE__ */ new Date()) {
|
|
591
591
|
const e = a.getFullYear();
|
|
592
592
|
return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function ye(a = /* @__PURE__ */ new Date()) {
|
|
595
595
|
const e = (t) => String(t).padStart(2, "0");
|
|
596
596
|
return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Qt(a, e = ye()) {
|
|
599
599
|
const t = [...new Set((a || []).filter(Boolean))].sort();
|
|
600
600
|
if (!t.length || t.includes(e)) return e;
|
|
601
601
|
const s = t.filter((r) => r < e);
|
|
602
602
|
return s.length ? s[s.length - 1] : t[0];
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function be(a) {
|
|
605
605
|
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
606
606
|
}
|
|
607
607
|
function ee(a) {
|
|
@@ -609,7 +609,7 @@ function ee(a) {
|
|
|
609
609
|
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, r = e & 255;
|
|
610
610
|
return 0.299 * t + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
611
611
|
}
|
|
612
|
-
const
|
|
612
|
+
const Zt = (a) => {
|
|
613
613
|
const e = ["th", "st", "nd", "rd"], t = a % 100;
|
|
614
614
|
return a + (e[(t - 20) % 10] || e[t] || e[0]);
|
|
615
615
|
};
|
|
@@ -620,11 +620,11 @@ function de(a, e) {
|
|
|
620
620
|
}, s = t(a), r = t(e);
|
|
621
621
|
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function et(a, e) {
|
|
624
624
|
const t = (s) => String(s?.name ?? s ?? "");
|
|
625
625
|
return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function tt(a) {
|
|
628
628
|
if (a.state === "live") {
|
|
629
629
|
const e = [a.period, a.clock].filter(Boolean).join(" ");
|
|
630
630
|
return { kind: "live", label: e ? `Live · ${e}` : "Live" };
|
|
@@ -635,19 +635,19 @@ function et(a) {
|
|
|
635
635
|
}
|
|
636
636
|
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${x(a.date, { month: "short", day: "numeric" })} · ${$e(a.time)}`.replace(/ · $/, "") };
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
638
|
+
const Jt = ["boys", "girls"];
|
|
639
|
+
function st(a, e) {
|
|
640
640
|
return e ? a ? a.gender === e || a.gender === "coed" : !1 : !0;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
return e ? (a || []).filter((t) =>
|
|
642
|
+
function at(a, e) {
|
|
643
|
+
return e ? (a || []).filter((t) => st(t, e)) : a || [];
|
|
644
644
|
}
|
|
645
645
|
function pe(a) {
|
|
646
646
|
const e = new Set((a || []).map((t) => t && t.gender));
|
|
647
|
-
return
|
|
647
|
+
return Jt.filter((t) => e.has(t));
|
|
648
648
|
}
|
|
649
|
-
const
|
|
650
|
-
function
|
|
649
|
+
const Xt = (a) => pe(a).length === 2, es = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
650
|
+
function A(a) {
|
|
651
651
|
let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
652
652
|
const t = e.indexOf("#");
|
|
653
653
|
let s = "";
|
|
@@ -655,26 +655,26 @@ function T(a) {
|
|
|
655
655
|
let r = e.split("?")[0] + s;
|
|
656
656
|
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function rt() {
|
|
659
659
|
const a = globalThis.location;
|
|
660
660
|
if (!a) return "";
|
|
661
661
|
const e = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
662
|
-
return
|
|
662
|
+
return A((a.pathname || "") + e);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function ts(a, e, t) {
|
|
665
665
|
if (!t) return null;
|
|
666
|
-
const s =
|
|
666
|
+
const s = A(a);
|
|
667
667
|
if (!s) return null;
|
|
668
|
-
const r =
|
|
668
|
+
const r = A(v(e.game, { sport: t, id: "" })), o = A(v(e.school, { id: "" }));
|
|
669
669
|
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
670
|
-
const n =
|
|
670
|
+
const n = A(v(e.section, { sport: t, view: "" }));
|
|
671
671
|
if (s === n) return "";
|
|
672
672
|
if (!s.startsWith(`${n}/`)) return null;
|
|
673
|
-
const i = s.slice(n.length + 1),
|
|
674
|
-
return
|
|
673
|
+
const i = s.slice(n.length + 1), l = i.split("/");
|
|
674
|
+
return l.length > 2 || l.some((p) => !/^[a-z][a-z-]*$/.test(p)) || es.has(l[0]) ? null : i;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
677
|
-
const s = (o) => v(t.section, { sport: a, view: o }).replace(/([^:])\/{2,}/g, "$1/"), r =
|
|
676
|
+
function ss(a, e, t) {
|
|
677
|
+
const s = (o) => v(t.section, { sport: a, view: o }).replace(/([^:])\/{2,}/g, "$1/"), r = Xt(e) ? [
|
|
678
678
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
679
679
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
680
680
|
] : [{ label: "Standings", href: s("standings") }];
|
|
@@ -686,12 +686,12 @@ function ts(a, e, t) {
|
|
|
686
686
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
687
687
|
];
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
const t =
|
|
689
|
+
function as(a, e = rt()) {
|
|
690
|
+
const t = A(e);
|
|
691
691
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
692
|
-
t &&
|
|
692
|
+
t && A(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
693
693
|
}
|
|
694
|
-
class w extends
|
|
694
|
+
class w extends M {
|
|
695
695
|
static properties = {
|
|
696
696
|
api: { type: String },
|
|
697
697
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -710,7 +710,7 @@ class w extends N {
|
|
|
710
710
|
this._client = e, this.isConnected && this.load();
|
|
711
711
|
}
|
|
712
712
|
get client() {
|
|
713
|
-
return this._client ? this._client : this.api ?
|
|
713
|
+
return this._client ? this._client : this.api ? Vt({ baseUrl: this.api }) : null;
|
|
714
714
|
}
|
|
715
715
|
connectedCallback() {
|
|
716
716
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -722,7 +722,7 @@ class w extends N {
|
|
|
722
722
|
this.load();
|
|
723
723
|
}
|
|
724
724
|
updated(e) {
|
|
725
|
-
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(),
|
|
725
|
+
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), as(this);
|
|
726
726
|
}
|
|
727
727
|
async load() {
|
|
728
728
|
const e = this.client;
|
|
@@ -751,13 +751,13 @@ class w extends N {
|
|
|
751
751
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
752
752
|
}
|
|
753
753
|
render() {
|
|
754
|
-
return this.error === "not-configured" ?
|
|
754
|
+
return this.error === "not-configured" ? c`<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 ? c`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : c`<div class="loading" role="status">Loading…</div>`;
|
|
755
755
|
}
|
|
756
756
|
renderView() {
|
|
757
|
-
return
|
|
757
|
+
return c``;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
const
|
|
760
|
+
const y = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), rs = b`
|
|
761
761
|
:host {
|
|
762
762
|
--hsot-red: var(--color-red, #D1232A);
|
|
763
763
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -795,7 +795,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
795
795
|
outline-offset: 1px;
|
|
796
796
|
}
|
|
797
797
|
.mut { color: var(--hsot-gray-5); }
|
|
798
|
-
`,
|
|
798
|
+
`, os = b`
|
|
799
799
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
800
800
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
801
801
|
.band h1, .band h2.bandtitle {
|
|
@@ -844,7 +844,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
844
844
|
@media (max-width: 720px) {
|
|
845
845
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
846
846
|
}
|
|
847
|
-
`,
|
|
847
|
+
`, ns = b`
|
|
848
848
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
849
849
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
850
850
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -908,7 +908,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
908
908
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
909
909
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
910
910
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
911
|
-
`,
|
|
911
|
+
`, is = b`
|
|
912
912
|
.pill {
|
|
913
913
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
914
914
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -923,7 +923,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
923
923
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
924
924
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
925
925
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
926
|
-
`,
|
|
926
|
+
`, ls = b`
|
|
927
927
|
.tablewrap { overflow-x: auto; }
|
|
928
928
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
929
929
|
table.data th {
|
|
@@ -941,7 +941,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
941
941
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
942
942
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
943
943
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
944
|
-
`,
|
|
944
|
+
`, cs = b`
|
|
945
945
|
.swatch {
|
|
946
946
|
display: inline-flex; align-items: center; justify-content: center;
|
|
947
947
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -965,7 +965,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
965
965
|
.dot.W { background: var(--hsot-win); }
|
|
966
966
|
.dot.L { background: var(--hsot-loss); }
|
|
967
967
|
.dot.T { background: var(--hsot-tie); }
|
|
968
|
-
`,
|
|
968
|
+
`, hs = b`
|
|
969
969
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
970
970
|
.gamelist li {
|
|
971
971
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -1015,24 +1015,24 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
|
1015
1015
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
1016
1016
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
1017
1017
|
.gamelist a.box { font-size: 0.78rem; }
|
|
1018
|
-
`,
|
|
1018
|
+
`, H = [rs, os, ns, is, ls, cs, hs];
|
|
1019
1019
|
function ne(a) {
|
|
1020
1020
|
return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function ds(a) {
|
|
1023
1023
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Z(a, e) {
|
|
1026
1026
|
const t = {}, s = (o) => (t[o] = t[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, n) => String(o.date).localeCompare(String(n.date)));
|
|
1027
1027
|
for (const o of r) {
|
|
1028
1028
|
const n = ne(o), i = o.gameType === "conference";
|
|
1029
|
-
for (const
|
|
1030
|
-
const p =
|
|
1029
|
+
for (const l of ["home", "away"]) {
|
|
1030
|
+
const p = l === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1031
1031
|
if (!p) continue;
|
|
1032
|
-
const d = s(p), h =
|
|
1032
|
+
const d = s(p), h = l === "home" ? o.homeScore : o.awayScore, u = l === "home" ? o.awayScore : o.homeScore;
|
|
1033
1033
|
d.pf += h, d.pa += u;
|
|
1034
1034
|
let f = "T";
|
|
1035
|
-
n === "tie" ? (d.t += 1, i && (d.ct += 1)) : n ===
|
|
1035
|
+
n === "tie" ? (d.t += 1, i && (d.ct += 1)) : n === l ? (d.w += 1, i && (d.cw += 1), f = "W") : (d.l += 1, i && (d.cl += 1), f = "L"), d.results.push({ gameId: o.id, date: o.date, mark: f, my: h, their: u, opp: l === "home" ? o.awayTeamId : o.homeTeamId, conf: i });
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
return t;
|
|
@@ -1044,25 +1044,25 @@ function ie(a) {
|
|
|
1044
1044
|
for (let s = a.length - 1; s >= 0 && a[s].mark === e; s -= 1) t += 1;
|
|
1045
1045
|
return e + t;
|
|
1046
1046
|
}
|
|
1047
|
-
const
|
|
1047
|
+
const Oe = (a, e, t) => {
|
|
1048
1048
|
const s = a + e + t;
|
|
1049
1049
|
return s ? (a + t / 2) / s : 0;
|
|
1050
|
-
},
|
|
1050
|
+
}, Ue = (a) => a.toFixed(3).replace("0.", ".");
|
|
1051
1051
|
function S(a, e = !1) {
|
|
1052
1052
|
if (!a) return "0-0";
|
|
1053
1053
|
const t = e ? a.cw : a.w, s = e ? a.cl : a.l, r = e ? a.ct : a.t;
|
|
1054
1054
|
return `${t}-${s}${r ? `-${r}` : ""}`;
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function ot(a, e) {
|
|
1057
1057
|
return a.map((t) => {
|
|
1058
1058
|
const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1059
|
-
return { team: t, rec: s, confPct:
|
|
1059
|
+
return { team: t, rec: s, confPct: Oe(s.cw, s.cl, s.ct), overallPct: Oe(s.w, s.l, s.t) };
|
|
1060
1060
|
}).sort((t, s) => s.confPct - t.confPct || s.overallPct - t.overallPct || s.rec.pf - s.rec.pa - (t.rec.pf - t.rec.pa));
|
|
1061
1061
|
}
|
|
1062
1062
|
function we(a, e) {
|
|
1063
1063
|
return a.filter((t) => (t.homeTeamId === e || t.awayTeamId === e) && (t.state === "scheduled" || t.state === "live") && t.gameType !== "scrimmage").sort((t, s) => String(t.date).localeCompare(String(s.date)))[0] || null;
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function He(a, e) {
|
|
1066
1066
|
const t = a[e];
|
|
1067
1067
|
return t && t.results.length ? t.results[t.results.length - 1] : null;
|
|
1068
1068
|
}
|
|
@@ -1070,19 +1070,19 @@ function xe(a, e, t, s, r) {
|
|
|
1070
1070
|
const o = e[t];
|
|
1071
1071
|
if (!o) return null;
|
|
1072
1072
|
const n = /* @__PURE__ */ new Map();
|
|
1073
|
-
for (const
|
|
1074
|
-
if (
|
|
1075
|
-
const p =
|
|
1076
|
-
(!d ||
|
|
1073
|
+
for (const l of a || []) {
|
|
1074
|
+
if (l.sport !== s || r && l.effectiveDate > r || l.gender && o.gender !== l.gender && o.gender !== "coed") continue;
|
|
1075
|
+
const p = l.gender || "", d = n.get(p);
|
|
1076
|
+
(!d || l.effectiveDate > d.effectiveDate) && n.set(p, l);
|
|
1077
1077
|
}
|
|
1078
1078
|
let i = null;
|
|
1079
|
-
for (const
|
|
1080
|
-
const p = (
|
|
1081
|
-
p !== -1 && (!i ||
|
|
1079
|
+
for (const l of n.values()) {
|
|
1080
|
+
const p = (l.teamIds || []).indexOf(t);
|
|
1081
|
+
p !== -1 && (!i || l.effectiveDate > i.effectiveDate) && (i = { poll: l, rank: p + 1 });
|
|
1082
1082
|
}
|
|
1083
1083
|
return i ? i.rank : null;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function ps(a, e, t) {
|
|
1086
1086
|
if (!a) return { kind: "none", delta: 0 };
|
|
1087
1087
|
const s = (a.teamIds || []).indexOf(t) + 1;
|
|
1088
1088
|
if (!s) return { kind: "none", delta: 0 };
|
|
@@ -1092,11 +1092,11 @@ function ds(a, e, t) {
|
|
|
1092
1092
|
const o = r - s;
|
|
1093
1093
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function ms(a) {
|
|
1096
1096
|
return /^https?:\/\//i.test(String(a || ""));
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
if (!
|
|
1098
|
+
function nt(a, { w: e, h: t } = {}) {
|
|
1099
|
+
if (!ms(a)) return "";
|
|
1100
1100
|
const s = [];
|
|
1101
1101
|
e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
|
|
1102
1102
|
const r = a.includes("?") ? "&" : "?";
|
|
@@ -1104,125 +1104,172 @@ function ot(a, { w: e, h: t } = {}) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
function te(a, e) {
|
|
1106
1106
|
const t = e * 2;
|
|
1107
|
-
return
|
|
1107
|
+
return nt(a?.logoAssetId, { w: t, h: t });
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1109
|
+
function us(a, e) {
|
|
1110
|
+
return nt(a?.photoAssetId, { w: e * 2 });
|
|
1111
1111
|
}
|
|
1112
1112
|
function le(a, e, { title: t, sub: s, teams: r }) {
|
|
1113
|
-
const o =
|
|
1114
|
-
return
|
|
1113
|
+
const o = rt(), i = !!a.querySelector(':scope > a[slot="nav"]') || ts(o, e.hrefs, e.sport) !== null;
|
|
1114
|
+
return c`
|
|
1115
1115
|
<div class="band section">
|
|
1116
1116
|
<div class="inner">
|
|
1117
1117
|
<h1>${t}</h1>
|
|
1118
|
-
${s ?
|
|
1118
|
+
${s ? c`<p class="sub">${s}</p>` : m}
|
|
1119
1119
|
</div>
|
|
1120
|
-
${i ?
|
|
1120
|
+
${i ? c`
|
|
1121
1121
|
<nav class="sectionnav" aria-label="${k(e.sport)} section">
|
|
1122
1122
|
<div class="navrow">
|
|
1123
1123
|
<slot name="nav">
|
|
1124
|
-
${
|
|
1125
|
-
aria-current=${o &&
|
|
1124
|
+
${ss(e.sport, r, e.hrefs).map((l) => c`<a href=${l.href}
|
|
1125
|
+
aria-current=${o && A(l.href) === o ? "page" : m}>${l.label}</a>`)}
|
|
1126
1126
|
</slot>
|
|
1127
1127
|
</div>
|
|
1128
1128
|
</nav>` : m}
|
|
1129
1129
|
</div>
|
|
1130
1130
|
`;
|
|
1131
1131
|
}
|
|
1132
|
-
const
|
|
1132
|
+
const P = (a, e) => {
|
|
1133
1133
|
const t = a.teamsById[e];
|
|
1134
1134
|
return t ? a.schoolsById[t.schoolId] : null;
|
|
1135
|
-
},
|
|
1136
|
-
function
|
|
1135
|
+
}, N = (a, e) => P(a, e)?.name || "TBD", se = (a, e) => P(a, e)?.abbr || "TBD";
|
|
1136
|
+
function B(a, e = 26) {
|
|
1137
1137
|
if (!a) return m;
|
|
1138
1138
|
const t = te(a, e);
|
|
1139
1139
|
if (t)
|
|
1140
|
-
return
|
|
1140
|
+
return c`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1141
1141
|
src=${t} style="width:${e}px;height:${e}px" />`;
|
|
1142
1142
|
const s = a.colorPrimary || "#030711", r = ee(s);
|
|
1143
|
-
return
|
|
1143
|
+
return c`<span class="swatch" aria-hidden="true"
|
|
1144
1144
|
style="width:${e}px;height:${e}px;background:${s};color:${r};font-size:${Math.max(8, e * 0.28)}px"
|
|
1145
|
-
>${
|
|
1145
|
+
>${be(a)}</span>`;
|
|
1146
1146
|
}
|
|
1147
1147
|
function ke(a, e, t) {
|
|
1148
1148
|
const s = xe(a.rankings, a.teamsById, e, a.sport, t);
|
|
1149
|
-
return s ?
|
|
1149
|
+
return s ? c`<span class="rankbadge">#${s}</span>` : m;
|
|
1150
1150
|
}
|
|
1151
1151
|
function ae(a, e, t) {
|
|
1152
|
-
const s =
|
|
1153
|
-
return s ?
|
|
1152
|
+
const s = P(a, e);
|
|
1153
|
+
return s ? c`${ke(a, e, t)}<a href=${v(a.hrefs.school, { id: s.id })}>${s.name}</a>` : c`<span class="mut">TBD</span>`;
|
|
1154
1154
|
}
|
|
1155
1155
|
function Se(a, e, t = 5) {
|
|
1156
1156
|
const s = a.records[e];
|
|
1157
|
-
if (!s || !s.results.length) return
|
|
1157
|
+
if (!s || !s.results.length) return c`<span class="mut">·</span>`;
|
|
1158
1158
|
const r = s.results.slice(-1 * t);
|
|
1159
|
-
return
|
|
1160
|
-
${r.map((o) =>
|
|
1161
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1159
|
+
return c`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1160
|
+
${r.map((o) => c`<a class="dot ${o.mark}"
|
|
1161
|
+
title="${o.mark} ${o.my}-${o.their} vs ${N(a, o.opp)}"
|
|
1162
1162
|
href=${v(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1163
1163
|
</span>`;
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1166
|
-
return a.querySelector(':scope > [slot="rail"]') ?
|
|
1165
|
+
function D(a, e) {
|
|
1166
|
+
return a.querySelector(':scope > [slot="rail"]') ? c`<div class="view withrail">
|
|
1167
1167
|
<div class="viewmain">${e}</div>
|
|
1168
1168
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1169
|
-
</div>` :
|
|
1169
|
+
</div>` : c`<div class="view">${e}</div>`;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function R(a) {
|
|
1172
1172
|
if (!a.promoImage) return m;
|
|
1173
|
-
const e =
|
|
1174
|
-
return
|
|
1173
|
+
const e = c`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1174
|
+
return c`<div class="promo">${a.promoHref ? c`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const e =
|
|
1178
|
-
return
|
|
1176
|
+
function K(a) {
|
|
1177
|
+
const e = tt(a);
|
|
1178
|
+
return c`<span class="pill ${e.kind}">${e.label}</span>`;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
if (!e) return
|
|
1180
|
+
function it(a, e, t) {
|
|
1181
|
+
if (!e) return c`<span class="mut">·</span>`;
|
|
1182
1182
|
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
|
|
1183
|
-
return
|
|
1183
|
+
return c`${e.state === "live" ? c`<span class="pill live">Live</span> ` : c`${x(e.date, { month: "numeric", day: "numeric" })} `}${r} ${se(a, s)}`;
|
|
1184
|
+
}
|
|
1185
|
+
const fs = "https://api.wral.com/search";
|
|
1186
|
+
function gs(a) {
|
|
1187
|
+
return a.map((e) => `uri:"${e}"`).join(" OR ");
|
|
1188
|
+
}
|
|
1189
|
+
function vs(a, e) {
|
|
1190
|
+
const t = String(a || fs).replace(/\/+$/, ""), s = new URLSearchParams({ query: gs(e), sort: "score", lang: "en" });
|
|
1191
|
+
return `${t}/v1/query?${s}`;
|
|
1184
1192
|
}
|
|
1185
|
-
|
|
1193
|
+
function lt(a) {
|
|
1194
|
+
try {
|
|
1195
|
+
const e = new URL(a);
|
|
1196
|
+
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
1197
|
+
const t = e.pathname.split("/").filter(Boolean).pop() || "", s = !t || /^[ni]-[A-Za-z0-9]+$/.test(t);
|
|
1198
|
+
return {
|
|
1199
|
+
uri: a,
|
|
1200
|
+
title: s ? a : decodeURIComponent(t).replace(/-/g, " "),
|
|
1201
|
+
photos: !0
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
} catch {
|
|
1205
|
+
}
|
|
1206
|
+
return { uri: a, title: a };
|
|
1207
|
+
}
|
|
1208
|
+
async function $s(a, e, t) {
|
|
1209
|
+
const r = await ((...i) => fetch(...i))(vs(a, e));
|
|
1210
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1211
|
+
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
1212
|
+
return e.map((i) => n.get(i) || lt(i));
|
|
1213
|
+
}
|
|
1214
|
+
function ys(a) {
|
|
1215
|
+
try {
|
|
1216
|
+
const e = new URL(a);
|
|
1217
|
+
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) return "Photos";
|
|
1218
|
+
const t = e.pathname.split("/").filter(Boolean)[0] || "";
|
|
1219
|
+
if (t === "video") return "Video";
|
|
1220
|
+
if (t === "news" || t === "story") return "Story";
|
|
1221
|
+
} catch {
|
|
1222
|
+
}
|
|
1223
|
+
return "Coverage";
|
|
1224
|
+
}
|
|
1225
|
+
function bs(a) {
|
|
1226
|
+
const e = /* @__PURE__ */ new Map();
|
|
1227
|
+
return (Array.isArray(a) ? a : []).filter((t) => /^https?:\/\//i.test(String(t || ""))).map((t) => {
|
|
1228
|
+
const s = ys(t), r = (e.get(s) || 0) + 1;
|
|
1229
|
+
return e.set(s, r), { href: t, label: r > 1 ? `${s} ${r}` : s };
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
const ws = ["all", "conferences"], ct = "all", Le = (a) => ws.includes(a) ? a : ct, ht = Number.MAX_SAFE_INTEGER, dt = (a, e, t) => {
|
|
1186
1233
|
const s = a[t];
|
|
1187
1234
|
return s && e[s.schoolId] || null;
|
|
1188
1235
|
};
|
|
1189
|
-
function
|
|
1236
|
+
function xs(a, e) {
|
|
1190
1237
|
const t = (a || []).map((s) => e[s.schoolId]?.areaCode).filter(Boolean);
|
|
1191
1238
|
return [...new Set(t)].sort();
|
|
1192
1239
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return e ? [a.awayTeamId, a.homeTeamId].some((r) =>
|
|
1240
|
+
function ks(a, e, t, s) {
|
|
1241
|
+
return e ? [a.awayTeamId, a.homeTeamId].some((r) => dt(t, s, r)?.areaCode === e) : !0;
|
|
1195
1242
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const r = (i) =>
|
|
1198
|
-
rank: e(i) ||
|
|
1243
|
+
function Ss(a, e, t, s) {
|
|
1244
|
+
const r = (i) => dt(t, s, i)?.name || "", o = (i, l) => !i - !l || et(i, l), n = new Map((a || []).map((i) => [i, {
|
|
1245
|
+
rank: e(i) || ht,
|
|
1199
1246
|
away: r(i.awayTeamId),
|
|
1200
1247
|
home: r(i.homeTeamId)
|
|
1201
1248
|
}]));
|
|
1202
|
-
return [...n.keys()].sort((i,
|
|
1203
|
-
const p = n.get(i), d = n.get(
|
|
1204
|
-
return p.rank - d.rank || o(p.away, d.away) || o(p.home, d.home) || String(i.time || "").localeCompare(String(
|
|
1249
|
+
return [...n.keys()].sort((i, l) => {
|
|
1250
|
+
const p = n.get(i), d = n.get(l);
|
|
1251
|
+
return p.rank - d.rank || o(p.away, d.away) || o(p.home, d.home) || String(i.time || "").localeCompare(String(l.time || ""));
|
|
1205
1252
|
});
|
|
1206
1253
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const t = new Map((a || []).map((r) => [r, e(r) ||
|
|
1254
|
+
function _s(a, e) {
|
|
1255
|
+
const t = new Map((a || []).map((r) => [r, e(r) || ht])), s = (r) => r.state === "live" ? 0 : 1;
|
|
1209
1256
|
return [...t.keys()].sort((r, o) => s(r) - s(o) || t.get(r) - t.get(o));
|
|
1210
1257
|
}
|
|
1211
|
-
function
|
|
1258
|
+
function As(a, e) {
|
|
1212
1259
|
if (a.gameType === "conference" && a.conferenceId) {
|
|
1213
1260
|
const t = e[a.conferenceId] || null;
|
|
1214
1261
|
return { name: t?.name || "Conference", conference: t };
|
|
1215
1262
|
}
|
|
1216
1263
|
return a.gameType === "playoff" ? { name: "Playoffs", conference: null } : a.gameType === "scrimmage" ? { name: "Scrimmages", conference: null } : { name: "Nonconference", conference: null };
|
|
1217
1264
|
}
|
|
1218
|
-
function
|
|
1265
|
+
function Ts(a, e) {
|
|
1219
1266
|
const t = /* @__PURE__ */ new Map();
|
|
1220
1267
|
return (a || []).forEach((s) => {
|
|
1221
|
-
const { name: r, conference: o } =
|
|
1268
|
+
const { name: r, conference: o } = As(s, e);
|
|
1222
1269
|
t.has(r) || t.set(r, { name: r, conference: o, games: [] }), t.get(r).games.push(s);
|
|
1223
1270
|
}), [...t.values()];
|
|
1224
1271
|
}
|
|
1225
|
-
const
|
|
1272
|
+
const Is = b`
|
|
1226
1273
|
.toolbar.filters { gap: 0.5rem 1.1rem; }
|
|
1227
1274
|
.filters [role="group"] { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
|
|
1228
1275
|
.filters .asof { margin-right: 0.1rem; }
|
|
@@ -1231,9 +1278,14 @@ const ws = y`
|
|
|
1231
1278
|
@media (max-width: 480px) { .filters .asof { flex-basis: 100%; } }
|
|
1232
1279
|
/* Conference headings carry the standings cards' classification pills. */
|
|
1233
1280
|
.section-title .pill { margin-left: 0.3rem; vertical-align: 0.1em; }
|
|
1281
|
+
/* The desk's coverage links ride in one group with the box-score link, in
|
|
1282
|
+
its style, so a narrow row wraps them together instead of leaving a
|
|
1283
|
+
lone "Story" beside the matchup and "Box score" on the next line. */
|
|
1284
|
+
.gamelist .links { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
|
|
1285
|
+
.gamelist .links a { font-size: 0.78rem; }
|
|
1234
1286
|
`;
|
|
1235
|
-
class
|
|
1236
|
-
static styles = [...
|
|
1287
|
+
class pt extends w {
|
|
1288
|
+
static styles = [...H, Is];
|
|
1237
1289
|
static properties = {
|
|
1238
1290
|
...w.properties,
|
|
1239
1291
|
sport: { type: String },
|
|
@@ -1251,14 +1303,14 @@ class ht extends w {
|
|
|
1251
1303
|
!this.date && e.get("date") && (this.date = e.get("date")), !this.view && e.get("view") && (this.view = e.get("view")), !this.areaCode && e.get("area") && (this.areaCode = e.get("area")), this._datePinned = !!this.date;
|
|
1252
1304
|
}
|
|
1253
1305
|
async fetchData(e) {
|
|
1254
|
-
const t = this.season ||
|
|
1306
|
+
const t = this.season || Q(), [s, r, o, n, i] = await Promise.all([
|
|
1255
1307
|
e.listSchools(),
|
|
1256
1308
|
e.listTeams({ sport: this.sport }),
|
|
1257
1309
|
e.listConferences(),
|
|
1258
1310
|
e.listGames({ sport: this.sport, season: t }),
|
|
1259
1311
|
e.listRankings({ sport: this.sport })
|
|
1260
1312
|
]);
|
|
1261
|
-
return this._datePinned || (this.date =
|
|
1313
|
+
return this._datePinned || (this.date = Qt(n.items.map((l) => l.date)), this._datePinned = !0), {
|
|
1262
1314
|
season: t,
|
|
1263
1315
|
schools: s.items,
|
|
1264
1316
|
teams: r.items,
|
|
@@ -1269,11 +1321,11 @@ class ht extends w {
|
|
|
1269
1321
|
}
|
|
1270
1322
|
get ctx() {
|
|
1271
1323
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1272
|
-
teamsById:
|
|
1273
|
-
schoolsById:
|
|
1274
|
-
records:
|
|
1324
|
+
teamsById: y(this.data.teams),
|
|
1325
|
+
schoolsById: y(this.data.schools),
|
|
1326
|
+
records: Z(this.data.games),
|
|
1275
1327
|
rankings: this.data.rankings,
|
|
1276
|
-
hrefs:
|
|
1328
|
+
hrefs: U(this),
|
|
1277
1329
|
sport: this.sport
|
|
1278
1330
|
}, this._ctxData = this.data), this._ctx;
|
|
1279
1331
|
}
|
|
@@ -1282,34 +1334,34 @@ class ht extends w {
|
|
|
1282
1334
|
e !== null && (this.view = e), t !== null && (this.areaCode = t);
|
|
1283
1335
|
try {
|
|
1284
1336
|
const s = new URL(globalThis.location.href), r = (o, n, i) => n && n !== i ? s.searchParams.set(o, n) : s.searchParams.delete(o);
|
|
1285
|
-
r("view",
|
|
1337
|
+
r("view", Le(this.view), ct), r("area", this.areaCode, ""), globalThis.history?.replaceState(null, "", s);
|
|
1286
1338
|
} catch {
|
|
1287
1339
|
}
|
|
1288
1340
|
}
|
|
1289
1341
|
renderView() {
|
|
1290
|
-
const e = this.ctx, t =
|
|
1342
|
+
const e = this.ctx, t = y(this.data.conferences), s = [...new Set(this.data.games.map((h) => h.date).filter(Boolean))].sort(), r = Le(this.view), o = xs(this.data.teams, e.schoolsById), n = o.includes(this.areaCode) ? this.areaCode : "", i = (h) => {
|
|
1291
1343
|
const u = [h.awayTeamId, h.homeTeamId].map((f) => xe(e.rankings, e.teamsById, f, this.sport, h.date)).filter(Boolean);
|
|
1292
1344
|
return u.length ? Math.min(...u) : null;
|
|
1293
|
-
},
|
|
1345
|
+
}, l = this.data.games.filter((h) => h.date === this.date), p = l.filter((h) => ks(h, n, e.teamsById, e.schoolsById)), d = r === "conferences" ? Ts(_s(p, i), t) : p.length ? [{
|
|
1294
1346
|
name: n ? `All games · ${n}` : "All games",
|
|
1295
1347
|
conference: null,
|
|
1296
|
-
games:
|
|
1348
|
+
games: Ss(p, i, e.teamsById, e.schoolsById)
|
|
1297
1349
|
}] : [];
|
|
1298
|
-
return
|
|
1350
|
+
return c`
|
|
1299
1351
|
${le(this, e, {
|
|
1300
|
-
title:
|
|
1301
|
-
sub:
|
|
1352
|
+
title: c`${k(this.sport)} scores & schedules`,
|
|
1353
|
+
sub: c`${x(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${l.length} games`,
|
|
1302
1354
|
teams: this.data.teams
|
|
1303
1355
|
})}
|
|
1304
|
-
${
|
|
1305
|
-
${
|
|
1356
|
+
${D(this, c`
|
|
1357
|
+
${R(this)}
|
|
1306
1358
|
<div class="toolbar">
|
|
1307
1359
|
<label class="asof" for="datesel">Date</label>
|
|
1308
1360
|
<select id="datesel" @change=${(h) => {
|
|
1309
1361
|
this.date = h.target.value;
|
|
1310
1362
|
}}>
|
|
1311
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((h) =>
|
|
1312
|
-
${x(h, { weekday: "short", month: "short", day: "numeric" })}${h ===
|
|
1363
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((h) => c`<option value=${h} ?selected=${h === this.date}>
|
|
1364
|
+
${x(h, { weekday: "short", month: "short", day: "numeric" })}${h === ye() ? " · today" : ""}
|
|
1313
1365
|
</option>`)}
|
|
1314
1366
|
</select>
|
|
1315
1367
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1322,27 +1374,27 @@ class ht extends w {
|
|
|
1322
1374
|
}}>Next →</button>
|
|
1323
1375
|
<span class="spacer"></span>
|
|
1324
1376
|
<span class="asof">${r === "conferences" ? "Live games first" : "Ranked matchups first, then A–Z by road team"}
|
|
1325
|
-
· <a href=${
|
|
1377
|
+
· <a href=${Xe(e.hrefs)}>report a score</a> to see it update here</span>
|
|
1326
1378
|
</div>
|
|
1327
1379
|
<div class="toolbar filters">
|
|
1328
1380
|
<div role="group" aria-label="Scoreboard view">
|
|
1329
|
-
${[["all", "All games"], ["conferences", "Conferences view"]].map(([h, u]) =>
|
|
1381
|
+
${[["all", "All games"], ["conferences", "Conferences view"]].map(([h, u]) => c`<button
|
|
1330
1382
|
class="chip ${r === h ? "on" : ""}" aria-pressed=${r === h ? "true" : "false"}
|
|
1331
1383
|
@click=${() => this.pick({ view: h })}>${u}</button>`)}
|
|
1332
1384
|
</div>
|
|
1333
|
-
${o.length ?
|
|
1385
|
+
${o.length ? c`
|
|
1334
1386
|
<div role="group" aria-label="Filter by area code">
|
|
1335
1387
|
<span class="asof">Area code</span>
|
|
1336
|
-
${o.map((h) =>
|
|
1388
|
+
${o.map((h) => c`<button class="chip ${n === h ? "on" : ""}"
|
|
1337
1389
|
aria-pressed=${n === h ? "true" : "false"}
|
|
1338
1390
|
@click=${() => this.pick({ area: n === h ? "" : h })}>${h}</button>`)}
|
|
1339
1391
|
</div>` : m}
|
|
1340
1392
|
</div>
|
|
1341
|
-
${
|
|
1342
|
-
${
|
|
1393
|
+
${l.length ? m : c`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1394
|
+
${l.length && !p.length ? c`<p class="empty">No ${this.sport} games in the ${n} area code on this date.
|
|
1343
1395
|
<button class="chip" @click=${() => this.pick({ area: "" })}>Every area</button></p>` : m}
|
|
1344
|
-
${d.map(({ name: h, conference: u, games: f }) =>
|
|
1345
|
-
<div class="section-title">${h}${[...u?.classifications || []].sort(de).map((g) =>
|
|
1396
|
+
${d.map(({ name: h, conference: u, games: f }) => c`
|
|
1397
|
+
<div class="section-title">${h}${[...u?.classifications || []].sort(de).map((g) => c`<span class="pill class">${g}</span>`)}</div>
|
|
1346
1398
|
<div class="card"><ul class="gamelist">
|
|
1347
1399
|
${f.map((g) => this.renderGame(e, g))}
|
|
1348
1400
|
</ul></div>
|
|
@@ -1353,23 +1405,30 @@ class ht extends w {
|
|
|
1353
1405
|
// Each team's score rides in a block beside its name (reader feedback:
|
|
1354
1406
|
// a lone score column on the far right read as detached from the teams).
|
|
1355
1407
|
// Scheduled games carry their start time on the status pill alone.
|
|
1408
|
+
// The desk's coverage links (Game.coverageUrls, already on the games
|
|
1409
|
+
// list, so they cost no request) sit before the box score link, labelled
|
|
1410
|
+
// from each URL's shape (lib/search.mjs) rather than the site search the
|
|
1411
|
+
// box score's coverage cards query.
|
|
1356
1412
|
renderGame(e, t) {
|
|
1357
|
-
const s = t.state === "final" || t.state === "live", r = (n, i,
|
|
1358
|
-
return
|
|
1413
|
+
const s = t.state === "final" || t.state === "live", r = (n, i, l = m) => c`<span class="side">${ae(e, n, t.date)}${s ? c`<span class="score">${i}</span>` : m}${l}</span>`, o = ds(t);
|
|
1414
|
+
return c`
|
|
1359
1415
|
<li>
|
|
1360
|
-
${
|
|
1361
|
-
<span class="opp matchup">${r(t.awayTeamId, t.awayScore,
|
|
1362
|
-
${o ?
|
|
1416
|
+
${K(t)}
|
|
1417
|
+
<span class="opp matchup">${r(t.awayTeamId, t.awayScore, c`<span class="at">at</span>`)}${r(t.homeTeamId, t.homeScore)}</span>
|
|
1418
|
+
${o ? c`<span class="ff">${N(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : m}
|
|
1363
1419
|
<span class="where">${t.venue || ""}</span>
|
|
1364
|
-
${t.broadcast ?
|
|
1365
|
-
<
|
|
1420
|
+
${t.broadcast ? c`<span class="pill class">${t.broadcast}</span>` : m}
|
|
1421
|
+
<span class="links">
|
|
1422
|
+
${bs(t.coverageUrls).map((n) => c`<a href=${n.href}>${n.label}</a>`)}
|
|
1423
|
+
<a class="box" href=${v(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
|
|
1424
|
+
</span>
|
|
1366
1425
|
</li>
|
|
1367
1426
|
`;
|
|
1368
1427
|
}
|
|
1369
1428
|
}
|
|
1370
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1371
|
-
class
|
|
1372
|
-
static styles =
|
|
1429
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", pt);
|
|
1430
|
+
class mt extends w {
|
|
1431
|
+
static styles = H;
|
|
1373
1432
|
static properties = {
|
|
1374
1433
|
...w.properties,
|
|
1375
1434
|
sport: { type: String },
|
|
@@ -1393,7 +1452,7 @@ class dt extends w {
|
|
|
1393
1452
|
return e.length < 2 ? "" : e.includes(this.pickedGender) ? this.pickedGender : e[0];
|
|
1394
1453
|
}
|
|
1395
1454
|
async fetchData(e) {
|
|
1396
|
-
const t = this.season ||
|
|
1455
|
+
const t = this.season || Q(), [s, r, o, n, i] = await Promise.all([
|
|
1397
1456
|
e.listConferences({ active: !0 }),
|
|
1398
1457
|
e.listSchools(),
|
|
1399
1458
|
// Deliberately NOT gender-filtered: the sub-nav decides whether to
|
|
@@ -1417,41 +1476,41 @@ class dt extends w {
|
|
|
1417
1476
|
}
|
|
1418
1477
|
get ctx() {
|
|
1419
1478
|
return (!this._ctx || this._ctxData !== this.data || this._ctxGender !== this.viewGender) && (this._ctx = {
|
|
1420
|
-
teamsById:
|
|
1421
|
-
schoolsById:
|
|
1422
|
-
records:
|
|
1479
|
+
teamsById: y(this.data.teams),
|
|
1480
|
+
schoolsById: y(this.data.schools),
|
|
1481
|
+
records: Z(this.data.games),
|
|
1423
1482
|
rankings: this.data.rankings,
|
|
1424
|
-
hrefs:
|
|
1483
|
+
hrefs: U(this),
|
|
1425
1484
|
sport: this.sport,
|
|
1426
1485
|
// The teams this view stands for — one side of a gendered
|
|
1427
1486
|
// sport, or all of them when the sport fields only one.
|
|
1428
|
-
teams:
|
|
1487
|
+
teams: at(this.data.teams, this.viewGender)
|
|
1429
1488
|
}, this._ctxData = this.data, this._ctxGender = this.viewGender), this._ctx;
|
|
1430
1489
|
}
|
|
1431
1490
|
renderView() {
|
|
1432
|
-
const e = this.ctx, t = this.viewGender, s = this.gender ? [] : pe(this.data.teams), r = ["All", ...[...new Set(this.data.conferences.flatMap((n) => n.classifications || []))].sort(de)].slice(0, 9), o = this.data.conferences.filter((n) => n.active !== !1).filter((n) => this.classFilter === "All" || (n.classifications || []).includes(this.classFilter)).sort(
|
|
1433
|
-
return
|
|
1491
|
+
const e = this.ctx, t = this.viewGender, s = this.gender ? [] : pe(this.data.teams), r = ["All", ...[...new Set(this.data.conferences.flatMap((n) => n.classifications || []))].sort(de)].slice(0, 9), o = this.data.conferences.filter((n) => n.active !== !1).filter((n) => this.classFilter === "All" || (n.classifications || []).includes(this.classFilter)).sort(et);
|
|
1492
|
+
return c`
|
|
1434
1493
|
${le(this, e, {
|
|
1435
|
-
title:
|
|
1436
|
-
sub:
|
|
1494
|
+
title: c`${t ? `${k(t)} ` : ""}${k(this.sport)} standings`,
|
|
1495
|
+
sub: c`${this.data.season} season · every conference, computed live from reported results`,
|
|
1437
1496
|
// The WHOLE sport, not this view's side: the sub-nav offers the
|
|
1438
1497
|
// Boys/Girls split only when both are fielded, and a
|
|
1439
1498
|
// gender-scoped list would always look like one side.
|
|
1440
1499
|
teams: this.data.teams
|
|
1441
1500
|
})}
|
|
1442
|
-
${
|
|
1443
|
-
${
|
|
1501
|
+
${D(this, c`
|
|
1502
|
+
${R(this)}
|
|
1444
1503
|
<div class="toolbar">
|
|
1445
|
-
${s.length === 2 ?
|
|
1504
|
+
${s.length === 2 ? c`
|
|
1446
1505
|
<div role="group" aria-label="Boys or girls standings">
|
|
1447
|
-
${s.map((n) =>
|
|
1506
|
+
${s.map((n) => c`<button class="chip ${t === n ? "on" : ""}"
|
|
1448
1507
|
aria-pressed=${t === n ? "true" : "false"}
|
|
1449
1508
|
@click=${() => {
|
|
1450
1509
|
this.pickedGender = n;
|
|
1451
1510
|
}}>${k(n)}</button>`)}
|
|
1452
1511
|
</div>` : m}
|
|
1453
1512
|
<div role="group" aria-label="Classification filter">
|
|
1454
|
-
${r.map((n) =>
|
|
1513
|
+
${r.map((n) => c`<button class="chip ${this.classFilter === n ? "on" : ""}"
|
|
1455
1514
|
@click=${() => {
|
|
1456
1515
|
this.classFilter = n;
|
|
1457
1516
|
}}>${n}</button>`)}
|
|
@@ -1461,7 +1520,7 @@ class dt extends w {
|
|
|
1461
1520
|
this.query = n.target.value;
|
|
1462
1521
|
}}>
|
|
1463
1522
|
<span class="spacer"></span>
|
|
1464
|
-
<span class="asof">Records through ${x(
|
|
1523
|
+
<span class="asof">Records through ${x(ye(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1465
1524
|
</div>
|
|
1466
1525
|
${o.map((n) => this.renderConference(e, n))}
|
|
1467
1526
|
`)}
|
|
@@ -1470,12 +1529,12 @@ class dt extends w {
|
|
|
1470
1529
|
renderConference(e, t) {
|
|
1471
1530
|
const s = e.teams.filter((n) => n.conferenceId === t.id);
|
|
1472
1531
|
if (!s.length) return m;
|
|
1473
|
-
const r = this.query.trim().toLowerCase(), o =
|
|
1474
|
-
return
|
|
1532
|
+
const r = this.query.trim().toLowerCase(), o = ot(s, e.records);
|
|
1533
|
+
return c`
|
|
1475
1534
|
<div class="card">
|
|
1476
1535
|
<div class="card-head">
|
|
1477
1536
|
<h2>${t.name}</h2>
|
|
1478
|
-
${[...t.classifications || []].sort(de).map((n) =>
|
|
1537
|
+
${[...t.classifications || []].sort(de).map((n) => c`<span class="pill class">${n}</span>`)}
|
|
1479
1538
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1480
1539
|
</div>
|
|
1481
1540
|
<div class="tablewrap"><table class="data">
|
|
@@ -1494,34 +1553,34 @@ class dt extends w {
|
|
|
1494
1553
|
renderRow(e, t, s, r) {
|
|
1495
1554
|
const o = e.schoolsById[t.team.schoolId], n = o?.name || t.team.name || "TBD";
|
|
1496
1555
|
if (r && !n.toLowerCase().includes(r)) return m;
|
|
1497
|
-
const i = t.rec.pf - t.rec.pa,
|
|
1556
|
+
const i = t.rec.pf - t.rec.pa, l = we(this.data.games, t.team.id), p = () => {
|
|
1498
1557
|
location.href = v(e.hrefs.school, { id: t.team.schoolId });
|
|
1499
1558
|
};
|
|
1500
|
-
return
|
|
1559
|
+
return c`
|
|
1501
1560
|
<tr class="rowlink" @click=${(d) => {
|
|
1502
1561
|
d.target.closest("a") || p();
|
|
1503
1562
|
}}>
|
|
1504
1563
|
<td class="mut">${s + 1}</td>
|
|
1505
1564
|
<td class="teamcell">
|
|
1506
|
-
${
|
|
1565
|
+
${B(o)}${ke(e, t.team.id, null)}
|
|
1507
1566
|
<a href=${v(e.hrefs.school, { id: t.team.schoolId })}>${n}</a>
|
|
1508
1567
|
</td>
|
|
1509
1568
|
<td class="num">${S(t.rec, !0)}</td>
|
|
1510
|
-
<td class="num">${
|
|
1569
|
+
<td class="num">${Ue(t.confPct)}</td>
|
|
1511
1570
|
<td class="num">${S(t.rec)}</td>
|
|
1512
|
-
<td class="num">${
|
|
1571
|
+
<td class="num">${Ue(t.overallPct)}</td>
|
|
1513
1572
|
<td class="num">${t.rec.pf}</td>
|
|
1514
1573
|
<td class="num">${t.rec.pa}</td>
|
|
1515
1574
|
<td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
|
|
1516
1575
|
<td>${ie(t.rec.results) || "·"}</td>
|
|
1517
1576
|
<td>${Se(e, t.team.id)}</td>
|
|
1518
|
-
<td>${
|
|
1577
|
+
<td>${it(e, l, t.team.id)}</td>
|
|
1519
1578
|
</tr>
|
|
1520
1579
|
`;
|
|
1521
1580
|
}
|
|
1522
1581
|
}
|
|
1523
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1524
|
-
const
|
|
1582
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", mt);
|
|
1583
|
+
const Cs = b`
|
|
1525
1584
|
.hero1 {
|
|
1526
1585
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1527
1586
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1538,8 +1597,8 @@ const xs = y`
|
|
|
1538
1597
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1539
1598
|
.sparkline { vertical-align: middle; }
|
|
1540
1599
|
`;
|
|
1541
|
-
class
|
|
1542
|
-
static styles = [...
|
|
1600
|
+
class ut extends w {
|
|
1601
|
+
static styles = [...H, Cs];
|
|
1543
1602
|
static properties = {
|
|
1544
1603
|
...w.properties,
|
|
1545
1604
|
sport: { type: String },
|
|
@@ -1556,16 +1615,16 @@ class pt extends w {
|
|
|
1556
1615
|
e && (this.pollDate = e);
|
|
1557
1616
|
}
|
|
1558
1617
|
async fetchData(e) {
|
|
1559
|
-
const t = this.season ||
|
|
1618
|
+
const t = this.season || Q(), [s, r, o, n, i] = await Promise.all([
|
|
1560
1619
|
e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1561
1620
|
e.listSchools(),
|
|
1562
1621
|
e.listTeams({ sport: this.sport }),
|
|
1563
1622
|
e.listConferences(),
|
|
1564
1623
|
e.listGames({ sport: this.sport, season: t })
|
|
1565
|
-
]),
|
|
1624
|
+
]), l = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, d) => d.effectiveDate.localeCompare(p.effectiveDate));
|
|
1566
1625
|
return {
|
|
1567
1626
|
season: t,
|
|
1568
|
-
polls:
|
|
1627
|
+
polls: l,
|
|
1569
1628
|
schools: r.items,
|
|
1570
1629
|
teams: o.items,
|
|
1571
1630
|
conferences: n.items,
|
|
@@ -1574,11 +1633,11 @@ class pt extends w {
|
|
|
1574
1633
|
}
|
|
1575
1634
|
get ctx() {
|
|
1576
1635
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1577
|
-
teamsById:
|
|
1578
|
-
schoolsById:
|
|
1579
|
-
records:
|
|
1636
|
+
teamsById: y(this.data.teams),
|
|
1637
|
+
schoolsById: y(this.data.schools),
|
|
1638
|
+
records: Z(this.data.games),
|
|
1580
1639
|
rankings: this.data.polls,
|
|
1581
|
-
hrefs:
|
|
1640
|
+
hrefs: U(this),
|
|
1582
1641
|
sport: this.sport
|
|
1583
1642
|
}, this._ctxData = this.data), this._ctx;
|
|
1584
1643
|
}
|
|
@@ -1588,40 +1647,40 @@ class pt extends w {
|
|
|
1588
1647
|
if (f === -1) return null;
|
|
1589
1648
|
const g = t.length === 1 ? 96 / 2 : u / (t.length - 1) * 90 + 3, $ = 3 + f / 24 * 20;
|
|
1590
1649
|
return { x: g, y: $ };
|
|
1591
|
-
}),
|
|
1650
|
+
}), l = [];
|
|
1592
1651
|
let p = [];
|
|
1593
1652
|
if (i.forEach((h) => {
|
|
1594
|
-
h ? p.push(h) : p.length && (
|
|
1595
|
-
}), p.length &&
|
|
1653
|
+
h ? p.push(h) : p.length && (l.push(p), p = []);
|
|
1654
|
+
}), p.length && l.push(p), !l.length) return m;
|
|
1596
1655
|
const d = i[s];
|
|
1597
|
-
return
|
|
1598
|
-
${
|
|
1656
|
+
return c`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1657
|
+
${l.map((h) => Me`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1599
1658
|
points=${h.map((u) => `${u.x.toFixed(1)},${u.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1600
|
-
${d ?
|
|
1659
|
+
${d ? Me`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1601
1660
|
</svg>`;
|
|
1602
1661
|
}
|
|
1603
1662
|
movement(e, t, s) {
|
|
1604
|
-
const r =
|
|
1605
|
-
return r.kind === "up" ?
|
|
1663
|
+
const r = ps(e, t, s);
|
|
1664
|
+
return r.kind === "up" ? c`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? c`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? c`<span class="delta new">NEW</span>` : r.kind === "same" ? c`<span class="delta same">—</span>` : c`<span class="delta same">·</span>`;
|
|
1606
1665
|
}
|
|
1607
1666
|
renderView() {
|
|
1608
1667
|
const e = this.ctx, t = this.data.polls;
|
|
1609
|
-
if (!t.length) return
|
|
1610
|
-
const s = Math.max(0, t.findIndex((h) => h.effectiveDate === this.pollDate)), r = t[s] || t[0], o = t[s + 1] || null, n = t.slice().reverse(), i = n.indexOf(r),
|
|
1611
|
-
return
|
|
1668
|
+
if (!t.length) return c`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1669
|
+
const s = Math.max(0, t.findIndex((h) => h.effectiveDate === this.pollDate)), r = t[s] || t[0], o = t[s + 1] || null, n = t.slice().reverse(), i = n.indexOf(r), l = y(this.data.conferences), p = (r.teamIds || [])[0], d = p ? P(e, p) : null;
|
|
1670
|
+
return c`
|
|
1612
1671
|
${le(this, e, {
|
|
1613
|
-
title:
|
|
1614
|
-
sub:
|
|
1672
|
+
title: c`${k(this.sport)} Top 25`,
|
|
1673
|
+
sub: c`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
|
|
1615
1674
|
teams: this.data.teams
|
|
1616
1675
|
})}
|
|
1617
|
-
${
|
|
1618
|
-
${
|
|
1676
|
+
${D(this, c`
|
|
1677
|
+
${R(this)}
|
|
1619
1678
|
<div class="toolbar">
|
|
1620
1679
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1621
1680
|
<select id="pollsel" @change=${(h) => {
|
|
1622
1681
|
this.pollDate = h.target.value;
|
|
1623
1682
|
}}>
|
|
1624
|
-
${t.map((h, u) =>
|
|
1683
|
+
${t.map((h, u) => c`<option value=${h.effectiveDate} ?selected=${h === r}>
|
|
1625
1684
|
${x(h.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${u === 0 ? " · current" : ""}
|
|
1626
1685
|
</option>`)}
|
|
1627
1686
|
</select>
|
|
@@ -1636,14 +1695,14 @@ class pt extends w {
|
|
|
1636
1695
|
<span class="spacer"></span>
|
|
1637
1696
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1638
1697
|
</div>
|
|
1639
|
-
${d ? this.renderHero(e, r, o, p, d,
|
|
1698
|
+
${d ? this.renderHero(e, r, o, p, d, l) : m}
|
|
1640
1699
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1641
1700
|
<thead><tr>
|
|
1642
1701
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1643
1702
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1644
1703
|
</tr></thead>
|
|
1645
1704
|
<tbody>
|
|
1646
|
-
${(r.teamIds || []).map((h, u) => u === 0 || !h ? m : this.renderRow(e, r, o, n, i,
|
|
1705
|
+
${(r.teamIds || []).map((h, u) => u === 0 || !h ? m : this.renderRow(e, r, o, n, i, l, h, u + 1))}
|
|
1647
1706
|
</tbody>
|
|
1648
1707
|
</table></div></div>
|
|
1649
1708
|
<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>
|
|
@@ -1651,50 +1710,50 @@ class pt extends w {
|
|
|
1651
1710
|
`;
|
|
1652
1711
|
}
|
|
1653
1712
|
renderHero(e, t, s, r, o, n) {
|
|
1654
|
-
const i = e.records[r],
|
|
1655
|
-
return
|
|
1713
|
+
const i = e.records[r], l = He(e.records, r), p = n[e.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1714
|
+
return c`
|
|
1656
1715
|
<div class="hero1" style="background:${d}">
|
|
1657
1716
|
<div class="bigrank">#1</div>
|
|
1658
|
-
${
|
|
1717
|
+
${B(o, 64)}
|
|
1659
1718
|
<div>
|
|
1660
1719
|
<h2><a href=${v(e.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1661
1720
|
<div class="facts">
|
|
1662
|
-
${S(i)} overall${p ?
|
|
1721
|
+
${S(i)} overall${p ? c` · ${S(i, !0)} ${p.name}` : m}
|
|
1663
1722
|
· streak ${ie(i?.results) || "·"}
|
|
1664
|
-
${
|
|
1723
|
+
${l ? c` · last: ${l.mark} ${l.my}-${l.their} vs ${se(e, l.opp)}` : m}
|
|
1665
1724
|
${this.movement(t, s, r)}
|
|
1666
1725
|
</div>
|
|
1667
1726
|
</div>
|
|
1668
1727
|
</div>
|
|
1669
1728
|
`;
|
|
1670
1729
|
}
|
|
1671
|
-
renderRow(e, t, s, r, o, n, i,
|
|
1672
|
-
const p =
|
|
1730
|
+
renderRow(e, t, s, r, o, n, i, l) {
|
|
1731
|
+
const p = P(e, i);
|
|
1673
1732
|
if (!p) return m;
|
|
1674
|
-
const d = e.records[i], h =
|
|
1733
|
+
const d = e.records[i], h = He(e.records, i), u = we(this.data.games, i), f = n[e.teamsById[i]?.conferenceId], g = () => {
|
|
1675
1734
|
location.href = v(e.hrefs.school, { id: p.id });
|
|
1676
1735
|
};
|
|
1677
|
-
return
|
|
1736
|
+
return c`
|
|
1678
1737
|
<tr class="rowlink" @click=${($) => {
|
|
1679
1738
|
$.target.closest("a") || g();
|
|
1680
1739
|
}}>
|
|
1681
|
-
<td class="num" style="font-weight:700">${
|
|
1740
|
+
<td class="num" style="font-weight:700">${l}</td>
|
|
1682
1741
|
<td>${this.movement(t, s, i)}</td>
|
|
1683
|
-
<td class="teamcell">${
|
|
1742
|
+
<td class="teamcell">${B(p)}<a href=${v(e.hrefs.school, { id: p.id })}>${p.name}</a>
|
|
1684
1743
|
<span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
|
|
1685
1744
|
<td class="num">${S(d)}</td>
|
|
1686
1745
|
<td class="mut">${f?.name || "Independent"}</td>
|
|
1687
|
-
<td>${h ?
|
|
1746
|
+
<td>${h ? c`<a class="box" style="text-decoration:none" href=${v(e.hrefs.game, { sport: this.sport, id: h.gameId })}>
|
|
1688
1747
|
<b style="color:${h.mark === "W" ? "var(--hsot-win)" : h.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${h.mark}</b>
|
|
1689
|
-
${h.my}-${h.their} vs ${se(e, h.opp)}</a>` :
|
|
1690
|
-
<td>${
|
|
1748
|
+
${h.my}-${h.their} vs ${se(e, h.opp)}</a>` : c`<span class="mut">·</span>`}</td>
|
|
1749
|
+
<td>${it(e, u, i)}</td>
|
|
1691
1750
|
<td>${this.sparkline(i, r, o)}</td>
|
|
1692
1751
|
</tr>
|
|
1693
1752
|
`;
|
|
1694
1753
|
}
|
|
1695
1754
|
}
|
|
1696
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1697
|
-
const
|
|
1755
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", ut);
|
|
1756
|
+
const Es = b`
|
|
1698
1757
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1699
1758
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1700
1759
|
.schoolhero .crest {
|
|
@@ -1748,8 +1807,8 @@ const ks = y`
|
|
|
1748
1807
|
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1749
1808
|
}
|
|
1750
1809
|
`;
|
|
1751
|
-
class
|
|
1752
|
-
static styles = [...
|
|
1810
|
+
class ft extends w {
|
|
1811
|
+
static styles = [...H, Es];
|
|
1753
1812
|
static properties = {
|
|
1754
1813
|
...w.properties,
|
|
1755
1814
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1767,7 +1826,7 @@ class mt extends w {
|
|
|
1767
1826
|
t && !this.sport && (this.sport = t), s && !this.gender && (this.gender = s);
|
|
1768
1827
|
}
|
|
1769
1828
|
async fetchData(e) {
|
|
1770
|
-
const t = this.season ||
|
|
1829
|
+
const t = this.season || Q(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, n = this.sport || "football", i = o.find(($) => $.id === this.activeTeamId) || o.find(($) => $.sport === n && st($, this.gender)) || o.find(($) => $.sport === n) || o[0] || null, [l, p, d, h, u, f, g] = await Promise.all([
|
|
1771
1830
|
i ? e.listGames({ sport: i.sport, season: t }) : Promise.resolve({ items: [] }),
|
|
1772
1831
|
i ? e.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1773
1832
|
e.listSchools(),
|
|
@@ -1783,7 +1842,7 @@ class mt extends w {
|
|
|
1783
1842
|
school: s,
|
|
1784
1843
|
teams: o,
|
|
1785
1844
|
active: i,
|
|
1786
|
-
games:
|
|
1845
|
+
games: l.items,
|
|
1787
1846
|
allTeams: p.items,
|
|
1788
1847
|
schools: d.items,
|
|
1789
1848
|
conferences: h.items,
|
|
@@ -1794,11 +1853,11 @@ class mt extends w {
|
|
|
1794
1853
|
}
|
|
1795
1854
|
get ctx() {
|
|
1796
1855
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1797
|
-
teamsById:
|
|
1798
|
-
schoolsById:
|
|
1799
|
-
records:
|
|
1856
|
+
teamsById: y(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
|
|
1857
|
+
schoolsById: y(this.data.schools),
|
|
1858
|
+
records: Z(this.data.games),
|
|
1800
1859
|
rankings: this.data.rankings,
|
|
1801
|
-
hrefs:
|
|
1860
|
+
hrefs: U(this),
|
|
1802
1861
|
sport: this.data.active?.sport || "football"
|
|
1803
1862
|
}, this._ctxData = this.data), this._ctx;
|
|
1804
1863
|
}
|
|
@@ -1812,45 +1871,45 @@ class mt extends w {
|
|
|
1812
1871
|
}
|
|
1813
1872
|
renderView() {
|
|
1814
1873
|
const { school: e, teams: t, active: s, season: r } = this.data;
|
|
1815
|
-
if (!e) return
|
|
1816
|
-
const o = this.ctx, n = ee(e.colorPrimary || "#030711"), i = (e.adm || [])[0],
|
|
1817
|
-
return
|
|
1874
|
+
if (!e) return c`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1875
|
+
const o = this.ctx, n = ee(e.colorPrimary || "#030711"), i = (e.adm || [])[0], l = y(this.data.conferences), p = s ? l[s.conferenceId] : null;
|
|
1876
|
+
return c`
|
|
1818
1877
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${n}">
|
|
1819
1878
|
<div class="inner">
|
|
1820
|
-
${te(e, 84) ?
|
|
1879
|
+
${te(e, 84) ? c`<img class="crest logo" alt="" loading="lazy" src=${te(e, 84)} />` : c`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${ee(e.colorSecondary || "#7C7C7C")}">${be(e)}</div>`}
|
|
1821
1880
|
<div style="min-width:260px">
|
|
1822
1881
|
<h1>${e.name} <span class="mascot">${e.mascot || ""}</span></h1>
|
|
1823
1882
|
<div class="facts">
|
|
1824
|
-
${e.location ?
|
|
1825
|
-
${e.association ?
|
|
1826
|
-
${p ?
|
|
1827
|
-
${i ?
|
|
1828
|
-
${e.openingYear ?
|
|
1829
|
-
${e.areaCode ?
|
|
1883
|
+
${e.location ? c`<span><b>Location</b>${e.location}${e.county ? c` · ${e.county} County` : m}</span>` : m}
|
|
1884
|
+
${e.association ? c`<span><b>League</b>${e.association}${e.classification ? c` · ${e.classification}` : m}</span>` : m}
|
|
1885
|
+
${p ? c`<span><b>Conference</b>${p.name}</span>` : m}
|
|
1886
|
+
${i ? c`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : m}
|
|
1887
|
+
${e.openingYear ? c`<span><b>Opened</b>${e.openingYear}</span>` : m}
|
|
1888
|
+
${e.areaCode ? c`<span><b>Area</b>${e.areaCode}</span>` : m}
|
|
1830
1889
|
</div>
|
|
1831
1890
|
</div>
|
|
1832
1891
|
</div>
|
|
1833
1892
|
</div>
|
|
1834
1893
|
<div class="band">
|
|
1835
1894
|
<nav class="tabs" aria-label="Teams">
|
|
1836
|
-
${t.map((d) => d.id === s?.id ?
|
|
1895
|
+
${t.map((d) => d.id === s?.id ? c`<a class="on" href="#" aria-current="page" @click=${(h) => h.preventDefault()}>${d.name}</a>` : c`<a href="#" @click=${(h) => {
|
|
1837
1896
|
h.preventDefault(), this.switchTeam(d);
|
|
1838
1897
|
}}>${d.name}</a>`)}
|
|
1839
1898
|
</nav>
|
|
1840
1899
|
</div>
|
|
1841
|
-
${
|
|
1842
|
-
${
|
|
1843
|
-
${s ? this.renderTeam(o, s, p, r) :
|
|
1900
|
+
${D(this, c`
|
|
1901
|
+
${R(this)}
|
|
1902
|
+
${s ? this.renderTeam(o, s, p, r) : c`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1844
1903
|
`)}
|
|
1845
1904
|
`;
|
|
1846
1905
|
}
|
|
1847
1906
|
renderTeam(e, t, s, r) {
|
|
1848
|
-
const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, n = o.w + o.l + o.t, i = s ?
|
|
1849
|
-
return
|
|
1907
|
+
const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, n = o.w + o.l + o.t, i = s ? at(this.data.allTeams.filter((h) => h.conferenceId === s.id), t.gender) : [], l = s ? ot(i, e.records).findIndex((h) => h.team.id === t.id) + 1 : 0, p = xe(e.rankings, e.teamsById, t.id, t.sport, null), d = this.data.games.filter((h) => h.homeTeamId === t.id || h.awayTeamId === t.id).sort((h, u) => String(h.date).localeCompare(String(u.date)));
|
|
1908
|
+
return c`
|
|
1850
1909
|
<div class="tiles">
|
|
1851
1910
|
<div class="tile"><div class="k">Overall</div><div class="v">${S(o)}</div><div class="s">${n} games played</div></div>
|
|
1852
1911
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${S(o, !0)}</div>
|
|
1853
|
-
<div class="s">${
|
|
1912
|
+
<div class="s">${l ? `${Zt(l)} of ${i.length}` : "·"}</div></div>
|
|
1854
1913
|
<div class="tile"><div class="k">Points</div><div class="v">${n ? (o.pf / n).toFixed(1) : "0.0"}</div>
|
|
1855
1914
|
<div class="s">scored per game · ${n ? (o.pa / n).toFixed(1) : "0.0"} allowed</div></div>
|
|
1856
1915
|
<div class="tile"><div class="k">Streak</div><div class="v">${ie(o.results) || "·"}</div>
|
|
@@ -1858,15 +1917,15 @@ class mt extends w {
|
|
|
1858
1917
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
|
|
1859
1918
|
<div class="s"><a href=${v(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1860
1919
|
</div>
|
|
1861
|
-
${(t.championships || []).length ?
|
|
1920
|
+
${(t.championships || []).length ? c`
|
|
1862
1921
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1863
|
-
${t.championships.map((h) =>
|
|
1922
|
+
${t.championships.map((h) => c`<span class="pill champ">★ ${h.season} ${h.title} champion${h.classification ? ` · ${h.classification}` : ""}${h.region ? ` · ${h.region}` : ""}</span>`)}
|
|
1864
1923
|
</div>` : m}
|
|
1865
1924
|
<div class="cols">
|
|
1866
1925
|
<div>
|
|
1867
1926
|
<div class="section-title">Schedule & results</div>
|
|
1868
1927
|
<div class="card">
|
|
1869
|
-
${d.length ?
|
|
1928
|
+
${d.length ? c`<ul class="gamelist">${d.map((h) => this.renderGameRow(e, t, h))}</ul>` : c`<p class="empty">No ${t.sport} games recorded for ${r}.</p>`}
|
|
1870
1929
|
</div>
|
|
1871
1930
|
</div>
|
|
1872
1931
|
<div>
|
|
@@ -1878,20 +1937,20 @@ class mt extends w {
|
|
|
1878
1937
|
}
|
|
1879
1938
|
renderGameRow(e, t, s) {
|
|
1880
1939
|
const r = s.homeTeamId === t.id, o = r ? s.awayTeamId : s.homeTeamId, n = r ? s.homeScore : s.awayScore, i = r ? s.awayScore : s.homeScore;
|
|
1881
|
-
let
|
|
1940
|
+
let l = c`<span class="mut">${$e(s.time)}</span>`;
|
|
1882
1941
|
if (s.state === "final") {
|
|
1883
1942
|
const d = ne(s), h = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
|
|
1884
|
-
|
|
1885
|
-
} else s.state === "live" && (
|
|
1943
|
+
l = c`<span class=${h}>${h}</span> ${n}-${i}${s.finish === "overtime" ? c` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? c` <span class="mut">FF</span>` : m}`;
|
|
1944
|
+
} else s.state === "live" && (l = c`<span style="color:var(--hsot-red)">${n}-${i}</span>`);
|
|
1886
1945
|
const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1887
|
-
return
|
|
1946
|
+
return c`
|
|
1888
1947
|
<li>
|
|
1889
1948
|
<span class="d">${x(s.date)}</span>
|
|
1890
|
-
${
|
|
1891
|
-
<span class="res">${
|
|
1949
|
+
${tt(s).kind === "sched" ? m : K(s)}
|
|
1950
|
+
<span class="res">${l}</span>
|
|
1892
1951
|
<span class="opp">${r ? "vs" : "at"} ${ae(e, o, s.date)}
|
|
1893
1952
|
<span class="pill type">${p}</span>
|
|
1894
|
-
${s.broadcast ?
|
|
1953
|
+
${s.broadcast ? c`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1895
1954
|
</span>
|
|
1896
1955
|
<span class="where">${s.venue || ""}</span>
|
|
1897
1956
|
<a class="box" href=${v(e.hrefs.game, { sport: t.sport, id: s.id })}>Box score →</a>
|
|
@@ -1901,26 +1960,26 @@ class mt extends w {
|
|
|
1901
1960
|
renderRoster(e, t) {
|
|
1902
1961
|
const s = this.data.roster;
|
|
1903
1962
|
if (!s)
|
|
1904
|
-
return
|
|
1905
|
-
const r =
|
|
1906
|
-
return
|
|
1907
|
-
${r ?
|
|
1963
|
+
return c`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1964
|
+
const r = us(s, 560), o = this.data.school?.name || "", n = y(this.data.players), i = s.entries.slice().sort((p, d) => (p.number || 0) - (d.number || 0)), l = i.some((p) => n[p.playerId]?.college);
|
|
1965
|
+
return c`
|
|
1966
|
+
${r ? c`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1908
1967
|
alt="${o} ${e.name} ${t} team photo" />` : m}
|
|
1909
1968
|
<div class="tablewrap"><table class="data roster">
|
|
1910
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${
|
|
1969
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${l ? c`<th>College</th>` : m}</tr></thead>
|
|
1911
1970
|
<tbody>
|
|
1912
1971
|
${i.map((p) => {
|
|
1913
1972
|
const d = n[p.playerId];
|
|
1914
1973
|
if (!d) return m;
|
|
1915
1974
|
const h = Yt(p), u = [h, d.classOf].filter(Boolean).join(" · ") || "·";
|
|
1916
|
-
return
|
|
1975
|
+
return c`<tr>
|
|
1917
1976
|
<td class="num mut">${p.number ?? "·"}</td>
|
|
1918
1977
|
<td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${u}</span></td>
|
|
1919
1978
|
<td class="pos">${h || "·"}</td>
|
|
1920
1979
|
<td class="cls mut">${d.classOf || "·"}</td>
|
|
1921
|
-
<td class="num">${
|
|
1980
|
+
<td class="num">${Kt(d.heightIn)}</td>
|
|
1922
1981
|
<td class="num">${d.weightLb || "·"}</td>
|
|
1923
|
-
${
|
|
1982
|
+
${l ? c`<td class="college">${d.college || "·"}</td>` : m}
|
|
1924
1983
|
</tr>`;
|
|
1925
1984
|
})}
|
|
1926
1985
|
</tbody>
|
|
@@ -1928,8 +1987,8 @@ class mt extends w {
|
|
|
1928
1987
|
`;
|
|
1929
1988
|
}
|
|
1930
1989
|
}
|
|
1931
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1932
|
-
const
|
|
1990
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", ft);
|
|
1991
|
+
const gt = {
|
|
1933
1992
|
football: ["quarters", 4],
|
|
1934
1993
|
flag_football: ["quarters", 4],
|
|
1935
1994
|
basketball: ["quarters", 4],
|
|
@@ -1940,30 +1999,32 @@ const ut = {
|
|
|
1940
1999
|
softball: ["innings", 7],
|
|
1941
2000
|
volleyball: ["sets", 3]
|
|
1942
2001
|
};
|
|
1943
|
-
function ft(a) {
|
|
1944
|
-
return (ut[a] || ["quarters", 4])[0];
|
|
1945
|
-
}
|
|
1946
2002
|
function _e(a) {
|
|
1947
|
-
return (
|
|
2003
|
+
return (gt[a] || ["quarters", 4])[0];
|
|
2004
|
+
}
|
|
2005
|
+
function Ae(a) {
|
|
2006
|
+
return (gt[a] || ["quarters", 4])[1];
|
|
1948
2007
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const t =
|
|
2008
|
+
function Ps(a, e) {
|
|
2009
|
+
const t = _e(a), s = Ae(a);
|
|
1951
2010
|
if (e <= s || t === "innings" || t === "sets") return String(e);
|
|
1952
2011
|
const r = e - s;
|
|
1953
2012
|
return `OT${r > 1 ? r : ""}`;
|
|
1954
2013
|
}
|
|
1955
|
-
function
|
|
2014
|
+
function vt(a, e) {
|
|
1956
2015
|
const t = String(a ?? "").trim();
|
|
1957
2016
|
let s;
|
|
1958
|
-
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ?
|
|
2017
|
+
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? _e(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? Ae(e) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(t)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(t)) || (s = /^set\s*(\d+)$/i.exec(t)) ? Number(s[1]) : null;
|
|
1959
2018
|
}
|
|
1960
|
-
const
|
|
1961
|
-
function
|
|
2019
|
+
const T = (a) => Number.isInteger(a) && a >= 0 ? a : null;
|
|
2020
|
+
function Bs(a) {
|
|
1962
2021
|
const e = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
|
|
1963
2022
|
if (!e.length) return null;
|
|
1964
|
-
const t = a.sport
|
|
2023
|
+
const t = a.sport;
|
|
2024
|
+
if (_e(t) === "sets") return Ds(a, e);
|
|
2025
|
+
const s = /* @__PURE__ */ new Map();
|
|
1965
2026
|
for (const h of e) {
|
|
1966
|
-
const u =
|
|
2027
|
+
const u = vt(h?.period, t), f = T(h?.homeScore), g = T(h?.awayScore);
|
|
1967
2028
|
if (!u || f === null || g === null) return null;
|
|
1968
2029
|
const $ = s.get(u) || { home: 0, away: 0 };
|
|
1969
2030
|
$.home = Math.max($.home, f), $.away = Math.max($.away, g), s.set(u, $);
|
|
@@ -1974,44 +2035,36 @@ function Ts(a) {
|
|
|
1974
2035
|
const u = s.get(h) || i, f = u.home - i.home, g = u.away - i.away;
|
|
1975
2036
|
(f < 0 || g < 0) && (n = !1), o.push({ period: h, home: Math.max(f, 0), away: Math.max(g, 0) }), i = { home: Math.max(u.home, i.home), away: Math.max(u.away, i.away) };
|
|
1976
2037
|
}
|
|
1977
|
-
const
|
|
1978
|
-
return n = n && i.home <=
|
|
2038
|
+
const l = T(a.homeScore) ?? 0, p = T(a.awayScore) ?? 0, d = n && i.home === l && i.away === p;
|
|
2039
|
+
return n = n && i.home <= l && i.away <= p, { periods: o, reconciled: d, consistent: n };
|
|
1979
2040
|
}
|
|
1980
|
-
function
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
const
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2041
|
+
function Ds(a, e) {
|
|
2042
|
+
const t = /* @__PURE__ */ new Map();
|
|
2043
|
+
for (const d of e) {
|
|
2044
|
+
const h = vt(d?.period, a.sport), u = T(d?.homeScore), f = T(d?.awayScore);
|
|
2045
|
+
if (!h || u === null || f === null) return null;
|
|
2046
|
+
const g = t.get(h) || { home: 0, away: 0 };
|
|
2047
|
+
t.set(h, { home: Math.max(g.home, u), away: Math.max(g.away, f) });
|
|
2048
|
+
}
|
|
2049
|
+
const s = Math.max(...t.keys()), r = Array.from({ length: s }, (d, h) => ({ period: h + 1, ...t.get(h + 1) || { home: 0, away: 0 } })), o = (d) => ({
|
|
2050
|
+
home: d.filter((h) => h.home > h.away).length,
|
|
2051
|
+
away: d.filter((h) => h.away > h.home).length
|
|
2052
|
+
}), n = T(a.homeScore) ?? 0, i = T(a.awayScore) ?? 0, l = o(r), p = o(r.slice(0, -1));
|
|
2053
|
+
return {
|
|
2054
|
+
periods: r,
|
|
2055
|
+
reconciled: l.home === n && l.away === i,
|
|
2056
|
+
consistent: p.home <= n && p.away <= i
|
|
2057
|
+
};
|
|
1992
2058
|
}
|
|
1993
|
-
function
|
|
1994
|
-
|
|
1995
|
-
const e = new URL(a);
|
|
1996
|
-
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
1997
|
-
const t = e.pathname.split("/").filter(Boolean).pop() || "", s = !t || /^[ni]-[A-Za-z0-9]+$/.test(t);
|
|
1998
|
-
return {
|
|
1999
|
-
uri: a,
|
|
2000
|
-
title: s ? a : decodeURIComponent(t).replace(/-/g, " "),
|
|
2001
|
-
photos: !0
|
|
2002
|
-
};
|
|
2003
|
-
}
|
|
2004
|
-
} catch {
|
|
2005
|
-
}
|
|
2006
|
-
return { uri: a, title: a };
|
|
2059
|
+
function Rs(a) {
|
|
2060
|
+
return (Array.isArray(a?.scoringPlays) ? a.scoringPlays : []).some((t) => String(t?.description ?? "").trim() !== "");
|
|
2007
2061
|
}
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
return e.map((i) => n.get(i) || gt(i));
|
|
2062
|
+
function zs(a) {
|
|
2063
|
+
if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
|
|
2064
|
+
const e = Bs(a);
|
|
2065
|
+
return e ? a.state === "final" ? e.reconciled ? e.periods : null : e.consistent ? e.periods : null : null;
|
|
2013
2066
|
}
|
|
2014
|
-
const
|
|
2067
|
+
const Ns = b`
|
|
2015
2068
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
2016
2069
|
.breadcrumbs a { text-decoration: none; }
|
|
2017
2070
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -2067,8 +2120,8 @@ const Bs = y`
|
|
|
2067
2120
|
.cols { grid-template-columns: 1fr; }
|
|
2068
2121
|
}
|
|
2069
2122
|
`;
|
|
2070
|
-
class
|
|
2071
|
-
static styles = [...
|
|
2123
|
+
class $t extends w {
|
|
2124
|
+
static styles = [...H, Ns];
|
|
2072
2125
|
static properties = {
|
|
2073
2126
|
...w.properties,
|
|
2074
2127
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -2088,7 +2141,7 @@ class vt extends w {
|
|
|
2088
2141
|
super(), this.gameId = "", this.searchApi = "", this.embed = !1;
|
|
2089
2142
|
}
|
|
2090
2143
|
async fetchData(e) {
|
|
2091
|
-
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, n, i,
|
|
2144
|
+
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, n, i, l, p] = await Promise.all([
|
|
2092
2145
|
e.listSchools(),
|
|
2093
2146
|
e.listTeams({ sport: t.sport }),
|
|
2094
2147
|
e.listConferences(),
|
|
@@ -2098,7 +2151,7 @@ class vt extends w {
|
|
|
2098
2151
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
2099
2152
|
// The embed drops the Coverage grid, so it skips the search
|
|
2100
2153
|
// round-trip entirely rather than fetching cards it will not render.
|
|
2101
|
-
s.length && !this.embed ?
|
|
2154
|
+
s.length && !this.embed ? $s(this.searchApi, s).catch(() => s.map(lt)) : Promise.resolve([])
|
|
2102
2155
|
]);
|
|
2103
2156
|
return {
|
|
2104
2157
|
game: t,
|
|
@@ -2106,32 +2159,32 @@ class vt extends w {
|
|
|
2106
2159
|
teams: o.items,
|
|
2107
2160
|
conferences: n.items,
|
|
2108
2161
|
rankings: i.items,
|
|
2109
|
-
games:
|
|
2162
|
+
games: l.items,
|
|
2110
2163
|
coverage: p
|
|
2111
2164
|
};
|
|
2112
2165
|
}
|
|
2113
2166
|
get ctx() {
|
|
2114
2167
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
2115
|
-
teamsById:
|
|
2116
|
-
schoolsById:
|
|
2117
|
-
records:
|
|
2168
|
+
teamsById: y(this.data.teams),
|
|
2169
|
+
schoolsById: y(this.data.schools),
|
|
2170
|
+
records: Z(this.data.games),
|
|
2118
2171
|
rankings: this.data.rankings,
|
|
2119
|
-
hrefs:
|
|
2172
|
+
hrefs: U(this),
|
|
2120
2173
|
sport: this.data.game.sport
|
|
2121
2174
|
}, this._ctxData = this.data), this._ctx;
|
|
2122
2175
|
}
|
|
2123
2176
|
renderView() {
|
|
2124
2177
|
const e = this.data.game;
|
|
2125
|
-
if (!e) return
|
|
2126
|
-
const t = this.ctx, s =
|
|
2127
|
-
return
|
|
2128
|
-
${
|
|
2129
|
-
${
|
|
2130
|
-
${this.embed ? m :
|
|
2178
|
+
if (!e) return c`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
2179
|
+
const t = this.ctx, s = y(this.data.conferences), r = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, o = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, n = ne(e), i = (d) => e.state === "final" && n !== d && n !== "tie" ? "opacity:0.45" : "", l = e.conferenceId ? s[e.conferenceId] : null, p = this.data.games.filter((d) => d.id !== e.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === e.homeTeamId && d.awayTeamId === e.awayTeamId || d.homeTeamId === e.awayTeamId && d.awayTeamId === e.homeTeamId));
|
|
2180
|
+
return c`
|
|
2181
|
+
${D(this, c`
|
|
2182
|
+
${R(this)}
|
|
2183
|
+
${this.embed ? m : c`
|
|
2131
2184
|
<p class="breadcrumbs">
|
|
2132
2185
|
<a href=${v(t.hrefs.section, { sport: e.sport, view: "scores" })}>${k(e.sport)}</a> /
|
|
2133
2186
|
<a href=${v(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
2134
|
-
${
|
|
2187
|
+
${N(t, e.awayTeamId)} at ${N(t, e.homeTeamId)}
|
|
2135
2188
|
</p>`}
|
|
2136
2189
|
<div class="card">
|
|
2137
2190
|
<div class="scorehead">
|
|
@@ -2142,39 +2195,39 @@ class vt extends w {
|
|
|
2142
2195
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
2143
2196
|
<span style=${i("home")}>${e.homeScore}</span>
|
|
2144
2197
|
</div>
|
|
2145
|
-
<div class="status">${
|
|
2146
|
-
<div class="status">${x(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ?
|
|
2147
|
-
${e.broadcast ?
|
|
2198
|
+
<div class="status">${K(e)}</div>
|
|
2199
|
+
<div class="status">${x(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? c` · ${$e(e.time)}` : m} · ${e.venue || "Venue TBD"}
|
|
2200
|
+
${e.broadcast ? c` · <span class="pill class">${e.broadcast}</span>` : m}</div>
|
|
2148
2201
|
<div class="status">
|
|
2149
|
-
<span class="pill type">${e.gameType === "conference" ? `${
|
|
2150
|
-
${e.label ?
|
|
2151
|
-
${(e.tags || []).map((d) =>
|
|
2202
|
+
<span class="pill type">${e.gameType === "conference" ? `${l?.name || "Conference"} game` : e.gameType}</span>
|
|
2203
|
+
${e.label ? c`<span class="pill type">Bracket ${e.label}</span>` : m}
|
|
2204
|
+
${(e.tags || []).map((d) => c`<span class="pill type">${d}</span>`)}
|
|
2152
2205
|
</div>
|
|
2153
|
-
${this.embed ? m :
|
|
2206
|
+
${this.embed ? m : c`
|
|
2154
2207
|
<div class="status">
|
|
2155
|
-
<a href=${
|
|
2208
|
+
<a href=${Xe(t.hrefs, e.id)}>Report a score for this game</a>
|
|
2156
2209
|
</div>`}
|
|
2157
2210
|
</div>
|
|
2158
2211
|
${this.teamBlock(t, e, e.homeTeamId, o, !0)}
|
|
2159
2212
|
</div>
|
|
2160
2213
|
${this.renderLineScore(e, r, o)}
|
|
2161
2214
|
${this.renderScoringPlays(e, r, o)}
|
|
2162
|
-
${e.notes ?
|
|
2215
|
+
${e.notes ? c`<p class="note gamenote">${e.notes}</p>` : m}
|
|
2163
2216
|
</div>
|
|
2164
|
-
${this.embed ?
|
|
2217
|
+
${this.embed ? c`
|
|
2165
2218
|
<p class="fullbox">
|
|
2166
2219
|
<a href=${v(t.hrefs.game, { sport: e.sport, id: e.id })}>Full box score →</a>
|
|
2167
|
-
</p>` :
|
|
2168
|
-
${(this.data.coverage || []).length ?
|
|
2220
|
+
</p>` : c`
|
|
2221
|
+
${(this.data.coverage || []).length ? c`
|
|
2169
2222
|
<div class="section-title">Coverage</div>
|
|
2170
2223
|
<div class="covgrid">
|
|
2171
|
-
${this.data.coverage.map((d) =>
|
|
2224
|
+
${this.data.coverage.map((d) => c`
|
|
2172
2225
|
<a class="card covcard" href=${d.uri}>
|
|
2173
|
-
${d.image ?
|
|
2226
|
+
${d.image ? c`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
|
|
2174
2227
|
<div class="covbody">
|
|
2175
|
-
<div class="covtitle">${d.videoDuration ?
|
|
2176
|
-
${d.description ?
|
|
2177
|
-
${d.author || d.publishedTime ?
|
|
2228
|
+
<div class="covtitle">${d.videoDuration ? c`<span class="pill live" style="animation:none">Video</span> ` : m}${d.photos ? c`<span class="pill live" style="animation:none">Photos</span> ` : m}${d.title || d.uri}</div>
|
|
2229
|
+
${d.description ? c`<p class="covdesc">${d.description}</p>` : m}
|
|
2230
|
+
${d.author || d.publishedTime ? c`
|
|
2178
2231
|
<div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
2179
2232
|
` : m}
|
|
2180
2233
|
</div>
|
|
@@ -2185,12 +2238,12 @@ class vt extends w {
|
|
|
2185
2238
|
<div class="cols">
|
|
2186
2239
|
${[[e.awayTeamId, r], [e.homeTeamId, o]].map(([d, h]) => this.renderContext(t, d, h))}
|
|
2187
2240
|
</div>
|
|
2188
|
-
${p.length ?
|
|
2241
|
+
${p.length ? c`
|
|
2189
2242
|
<div class="section-title">Head to head this season</div>
|
|
2190
2243
|
<div class="card"><ul class="gamelist">
|
|
2191
|
-
${p.map((d) =>
|
|
2192
|
-
<span class="d">${x(d.date)}</span>${
|
|
2193
|
-
<span class="opp">${
|
|
2244
|
+
${p.map((d) => c`<li>
|
|
2245
|
+
<span class="d">${x(d.date)}</span>${K(d)}
|
|
2246
|
+
<span class="opp">${N(t, d.awayTeamId)} ${d.awayScore}, ${N(t, d.homeTeamId)} ${d.homeScore}</span>
|
|
2194
2247
|
<a class="box" href=${v(t.hrefs.game, { sport: e.sport, id: d.id })}>Box score →</a>
|
|
2195
2248
|
</li>`)}
|
|
2196
2249
|
</ul></div>` : m}`}
|
|
@@ -2198,48 +2251,47 @@ class vt extends w {
|
|
|
2198
2251
|
`;
|
|
2199
2252
|
}
|
|
2200
2253
|
teamBlock(e, t, s, r, o) {
|
|
2201
|
-
if (!r) return
|
|
2202
|
-
const n = e.teamsById[s], i = e.records[s],
|
|
2203
|
-
return
|
|
2254
|
+
if (!r) return c`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
2255
|
+
const n = e.teamsById[s], i = e.records[s], l = te(r, 58);
|
|
2256
|
+
return c`
|
|
2204
2257
|
<div class="teamblock ${o ? "right" : ""}">
|
|
2205
|
-
${
|
|
2258
|
+
${l ? c`<img class="crest logo" alt="" loading="lazy" src=${l} />` : c`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${ee(r.colorPrimary || "#030711")}">${be(r)}</span>`}
|
|
2206
2259
|
<div>
|
|
2207
2260
|
<div class="tname">${ke(e, s, t.date)}<a href=${v(e.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
2208
|
-
<div class="trec">${r.mascot || ""} · ${S(i)}${n?.conferenceId ?
|
|
2261
|
+
<div class="trec">${r.mascot || ""} · ${S(i)}${n?.conferenceId ? c` · ${S(i, !0)} conf` : m}</div>
|
|
2209
2262
|
</div>
|
|
2210
2263
|
</div>
|
|
2211
2264
|
`;
|
|
2212
2265
|
}
|
|
2213
2266
|
renderLineScore(e, t, s) {
|
|
2214
|
-
const r =
|
|
2267
|
+
const r = zs(e);
|
|
2215
2268
|
if (!r)
|
|
2216
|
-
return e.state === "scheduled" ?
|
|
2217
|
-
const o = Math.max(
|
|
2269
|
+
return e.state === "scheduled" ? c`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : m;
|
|
2270
|
+
const o = Math.max(Ae(e.sport), ...r.map((p) => p.period)), n = (p) => Ps(e.sport, p), i = (p, d) => {
|
|
2218
2271
|
const h = r.find((u) => u.period === d);
|
|
2219
2272
|
return h ? h[p] : e.state === "final" ? 0 : "·";
|
|
2220
|
-
},
|
|
2273
|
+
}, l = (p, d, h) => c`
|
|
2221
2274
|
<tr>
|
|
2222
|
-
<td class="teamcell">${
|
|
2223
|
-
${Array.from({ length: o }, (u, f) =>
|
|
2275
|
+
<td class="teamcell">${B(p, 20)}${p?.abbr || "TBD"}</td>
|
|
2276
|
+
${Array.from({ length: o }, (u, f) => c`<td class="num">${i(d, f + 1)}</td>`)}
|
|
2224
2277
|
<td class="num" style="font-weight:700">${h}</td>
|
|
2225
2278
|
</tr>`;
|
|
2226
|
-
return
|
|
2279
|
+
return c`
|
|
2227
2280
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
2228
2281
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
2229
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, d) =>
|
|
2282
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, d) => c`<th class="num">${n(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
2230
2283
|
<tbody>
|
|
2231
|
-
${
|
|
2232
|
-
${
|
|
2284
|
+
${l(t, "away", e.awayScore)}
|
|
2285
|
+
${l(s, "home", e.homeScore)}
|
|
2233
2286
|
</tbody>
|
|
2234
2287
|
</table>
|
|
2235
2288
|
</div>
|
|
2236
2289
|
`;
|
|
2237
2290
|
}
|
|
2238
2291
|
renderScoringPlays(e, t, s) {
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
return l`
|
|
2292
|
+
if (!Rs(e)) return m;
|
|
2293
|
+
const r = e.scoringPlays, o = (n) => [n.period, n.clock].filter(Boolean).join(" ");
|
|
2294
|
+
return c`
|
|
2243
2295
|
<div class="plays">
|
|
2244
2296
|
<div class="plays-title">Scoring plays</div>
|
|
2245
2297
|
<div class="tablewrap">
|
|
@@ -2249,7 +2301,7 @@ class vt extends w {
|
|
|
2249
2301
|
<th class="num">${t?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
|
|
2250
2302
|
</tr></thead>
|
|
2251
2303
|
<tbody>
|
|
2252
|
-
${r.map((n) =>
|
|
2304
|
+
${r.map((n) => c`<tr>
|
|
2253
2305
|
<td class="when">${o(n) || "·"}</td>
|
|
2254
2306
|
<td class="play">${n.description || "·"}</td>
|
|
2255
2307
|
<td class="num">${n.awayScore}</td>
|
|
@@ -2264,23 +2316,23 @@ class vt extends w {
|
|
|
2264
2316
|
renderContext(e, t, s) {
|
|
2265
2317
|
if (!s) return m;
|
|
2266
2318
|
const r = e.records[t], o = we(this.data.games, t);
|
|
2267
|
-
return
|
|
2319
|
+
return c`
|
|
2268
2320
|
<div class="card ctxcard">
|
|
2269
|
-
<div class="who">${
|
|
2321
|
+
<div class="who">${B(s)}${s.name}</div>
|
|
2270
2322
|
<div class="row">
|
|
2271
2323
|
<span>Last 5: ${Se(e, t)}</span>
|
|
2272
2324
|
<span>Streak: <b>${r ? ie(r.results) : "·"}</b></span>
|
|
2273
2325
|
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
2274
|
-
<span>Next: ${o ?
|
|
2326
|
+
<span>Next: ${o ? c`${x(o.date, { month: "numeric", day: "numeric" })}
|
|
2275
2327
|
${o.homeTeamId === t ? "vs" : "at"} ${se(e, o.homeTeamId === t ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
2276
2328
|
</div>
|
|
2277
2329
|
</div>
|
|
2278
2330
|
`;
|
|
2279
2331
|
}
|
|
2280
2332
|
}
|
|
2281
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
2282
|
-
const
|
|
2283
|
-
class
|
|
2333
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", $t);
|
|
2334
|
+
const Ms = 250, Fs = 2;
|
|
2335
|
+
class yt extends M {
|
|
2284
2336
|
static properties = {
|
|
2285
2337
|
api: { type: String },
|
|
2286
2338
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2291,7 +2343,7 @@ class $t extends N {
|
|
|
2291
2343
|
activeIndex: { state: !0 },
|
|
2292
2344
|
searched: { state: !0 }
|
|
2293
2345
|
};
|
|
2294
|
-
static styles =
|
|
2346
|
+
static styles = b`
|
|
2295
2347
|
:host {
|
|
2296
2348
|
display: block;
|
|
2297
2349
|
position: relative;
|
|
@@ -2360,11 +2412,11 @@ class $t extends N {
|
|
|
2360
2412
|
}
|
|
2361
2413
|
onInput(e) {
|
|
2362
2414
|
const t = e.target.value.trim();
|
|
2363
|
-
if (clearTimeout(this.debounceTimer), t.length <
|
|
2415
|
+
if (clearTimeout(this.debounceTimer), t.length < Fs) {
|
|
2364
2416
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2365
2417
|
return;
|
|
2366
2418
|
}
|
|
2367
|
-
this.debounceTimer = setTimeout(() => this.search(t),
|
|
2419
|
+
this.debounceTimer = setTimeout(() => this.search(t), Ms);
|
|
2368
2420
|
}
|
|
2369
2421
|
async search(e) {
|
|
2370
2422
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2412,7 +2464,7 @@ class $t extends N {
|
|
|
2412
2464
|
const s = this.where(e), r = (o) => {
|
|
2413
2465
|
o.preventDefault(), this.go(e);
|
|
2414
2466
|
};
|
|
2415
|
-
return
|
|
2467
|
+
return c`
|
|
2416
2468
|
<li
|
|
2417
2469
|
id="school-option-${t}"
|
|
2418
2470
|
role="option"
|
|
@@ -2423,13 +2475,13 @@ class $t extends N {
|
|
|
2423
2475
|
}}"
|
|
2424
2476
|
>
|
|
2425
2477
|
<span class="name">${e.name}</span>
|
|
2426
|
-
${s ?
|
|
2478
|
+
${s ? c`<span class="where">${s}</span>` : m}
|
|
2427
2479
|
</li>
|
|
2428
2480
|
`;
|
|
2429
2481
|
}
|
|
2430
2482
|
renderListbox() {
|
|
2431
|
-
const e = this.searched && !this.results.length, t =
|
|
2432
|
-
return
|
|
2483
|
+
const e = this.searched && !this.results.length, t = c`<li class="empty">No schools found</li>`;
|
|
2484
|
+
return c`
|
|
2433
2485
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2434
2486
|
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
2435
2487
|
${e ? t : m}
|
|
@@ -2438,7 +2490,7 @@ class $t extends N {
|
|
|
2438
2490
|
}
|
|
2439
2491
|
render() {
|
|
2440
2492
|
const e = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
|
|
2441
|
-
return
|
|
2493
|
+
return c`
|
|
2442
2494
|
<input
|
|
2443
2495
|
type="text"
|
|
2444
2496
|
role="combobox"
|
|
@@ -2457,37 +2509,37 @@ class $t extends N {
|
|
|
2457
2509
|
`;
|
|
2458
2510
|
}
|
|
2459
2511
|
}
|
|
2460
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2512
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", yt);
|
|
2461
2513
|
function bt(a, e) {
|
|
2462
|
-
const t = new Map(a.map((
|
|
2463
|
-
for (const
|
|
2464
|
-
|
|
2465
|
-
const o = a.filter((
|
|
2466
|
-
function i(
|
|
2467
|
-
const p = t.get(
|
|
2514
|
+
const t = new Map(a.map((l) => [l.id, l])), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2515
|
+
for (const l of e || [])
|
|
2516
|
+
l.outcome === "winner" && (s.has(l.targetGameId) || s.set(l.targetGameId, []), s.get(l.targetGameId).push(l), r.has(l.sourceGameId) || r.set(l.sourceGameId, []), r.get(l.sourceGameId).push(l));
|
|
2517
|
+
const o = a.filter((l) => !r.has(l.id)), n = (l) => l.targetSlot === "home" ? 0 : 1;
|
|
2518
|
+
function i(l) {
|
|
2519
|
+
const p = t.get(l);
|
|
2468
2520
|
if (!p) return null;
|
|
2469
|
-
const h = [...s.get(
|
|
2521
|
+
const h = [...s.get(l) || []].sort((u, f) => n(u) - n(f)).map((u) => i(u.sourceGameId)).filter(Boolean);
|
|
2470
2522
|
return { game: p, children: h, bracketGroup: p.bracketGroup };
|
|
2471
2523
|
}
|
|
2472
|
-
return o.length === 1 ? i(o[0].id) : o.map((
|
|
2524
|
+
return o.length === 1 ? i(o[0].id) : o.map((l) => i(l.id));
|
|
2473
2525
|
}
|
|
2474
|
-
function
|
|
2526
|
+
function wt(a, e = [], t = 0) {
|
|
2475
2527
|
if (!a) return e;
|
|
2476
2528
|
e[t] || (e[t] = []), e[t].push(a.game);
|
|
2477
|
-
for (const s of a.children || [])
|
|
2529
|
+
for (const s of a.children || []) wt(s, e, t + 1);
|
|
2478
2530
|
return e;
|
|
2479
2531
|
}
|
|
2480
|
-
const
|
|
2481
|
-
function
|
|
2482
|
-
const s =
|
|
2532
|
+
const Os = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
|
|
2533
|
+
function Us({ round: a, perGroup: e, groupCount: t = 1 }) {
|
|
2534
|
+
const s = Os(e), o = (t === 4 ? s + 2 : t === 2 ? s + 1 : s) - a;
|
|
2483
2535
|
return o === 0 ? t > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
|
|
2484
2536
|
}
|
|
2485
|
-
function
|
|
2537
|
+
function Hs(a) {
|
|
2486
2538
|
if (!a || !a.length) return "setup";
|
|
2487
2539
|
const e = Math.max(...a.map((s) => s.round ?? 0)), t = a.filter((s) => (s.round ?? 0) === e);
|
|
2488
2540
|
return t.length && t.every((s) => s.state === "final") ? "complete" : a.some((s) => s.state !== "scheduled" || s.homeScore || s.awayScore || s.round === 1 && (s.homeTeamId || s.awayTeamId)) ? "active" : "setup";
|
|
2489
2541
|
}
|
|
2490
|
-
function
|
|
2542
|
+
function Ls(a, e) {
|
|
2491
2543
|
const t = a?.groupNames || [];
|
|
2492
2544
|
if (t.length >= 2) {
|
|
2493
2545
|
const r = t.map((o) => ({ key: o, name: o }));
|
|
@@ -2496,23 +2548,23 @@ function Ms(a, e) {
|
|
|
2496
2548
|
const s = [...new Set((e || []).map((r) => r.bracketGroup).filter(Boolean))];
|
|
2497
2549
|
return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
|
|
2498
2550
|
}
|
|
2499
|
-
const
|
|
2551
|
+
const Gs = (a, e) => e?.key == null ? [...a || []] : (a || []).filter((t) => t.bracketGroup === e.key), Ge = (a) => {
|
|
2500
2552
|
const e = /(\d+)\s*$/.exec(a.label || "");
|
|
2501
2553
|
return e ? Number(e[1]) : 1 / 0;
|
|
2502
|
-
},
|
|
2503
|
-
function
|
|
2554
|
+
}, je = (a, e) => Ge(a) - Ge(e) || String(a.id).localeCompare(String(e.id));
|
|
2555
|
+
function js(a, e) {
|
|
2504
2556
|
if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
|
|
2505
2557
|
const t = bt(a, e), s = /* @__PURE__ */ new Map();
|
|
2506
2558
|
for (const r of Array.isArray(t) ? t : [t]) {
|
|
2507
|
-
const o =
|
|
2508
|
-
o.forEach((i,
|
|
2559
|
+
const o = wt(r), n = o.length - 1;
|
|
2560
|
+
o.forEach((i, l) => i.forEach((p) => s.set(p.id, n - l + 1)));
|
|
2509
2561
|
}
|
|
2510
2562
|
return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
|
|
2511
2563
|
}
|
|
2512
|
-
function
|
|
2513
|
-
const s =
|
|
2564
|
+
function qs(a, e, t) {
|
|
2565
|
+
const s = Gs(a, t);
|
|
2514
2566
|
if (!s.length) return [];
|
|
2515
|
-
const r =
|
|
2567
|
+
const r = js(a || [], e || []), o = /* @__PURE__ */ new Map();
|
|
2516
2568
|
for (const p of s) {
|
|
2517
2569
|
const d = r(p);
|
|
2518
2570
|
o.has(d) || o.set(d, []), o.get(d).push(p);
|
|
@@ -2521,37 +2573,37 @@ function Hs(a, e, t) {
|
|
|
2521
2573
|
for (const p of e || [])
|
|
2522
2574
|
p.outcome === "winner" && (n.has(p.targetGameId) || n.set(p.targetGameId, []), n.get(p.targetGameId).push(p.sourceGameId));
|
|
2523
2575
|
const i = [];
|
|
2524
|
-
let
|
|
2576
|
+
let l = null;
|
|
2525
2577
|
for (const p of [...o.keys()].sort((d, h) => d - h)) {
|
|
2526
2578
|
let d = [...o.get(p)];
|
|
2527
|
-
if (
|
|
2579
|
+
if (l) {
|
|
2528
2580
|
const h = (u) => {
|
|
2529
|
-
const f = (n.get(u.id) || []).map((g) =>
|
|
2581
|
+
const f = (n.get(u.id) || []).map((g) => l.get(g)).filter((g) => g !== void 0);
|
|
2530
2582
|
return f.length ? Math.min(...f) : 1 / 0;
|
|
2531
2583
|
};
|
|
2532
|
-
d.sort((u, f) => h(u) - h(f) ||
|
|
2584
|
+
d.sort((u, f) => h(u) - h(f) || je(u, f));
|
|
2533
2585
|
} else
|
|
2534
|
-
d.sort(
|
|
2535
|
-
|
|
2586
|
+
d.sort(je);
|
|
2587
|
+
l = new Map(d.map((h, u) => [h.id, u])), i.push({ round: p, games: d });
|
|
2536
2588
|
}
|
|
2537
2589
|
return i;
|
|
2538
2590
|
}
|
|
2539
|
-
function
|
|
2591
|
+
function Ws(a, e, t) {
|
|
2540
2592
|
const s = a[`${e}TeamId`] || null, r = (t || []).find((n) => n.gameId === a.id && n.slot === e), o = a[`${e}Seed`] ?? r?.seed ?? null;
|
|
2541
2593
|
return { teamId: s, seed: o, bye: !s && !!r?.isBye };
|
|
2542
2594
|
}
|
|
2543
|
-
function
|
|
2595
|
+
function xt(a) {
|
|
2544
2596
|
const e = ne(a);
|
|
2545
2597
|
return e === "home" || e === "away" ? e : null;
|
|
2546
2598
|
}
|
|
2547
|
-
function
|
|
2599
|
+
function Vs(a, e) {
|
|
2548
2600
|
const t = bt(a || [], e || []);
|
|
2549
2601
|
if (!t || Array.isArray(t)) return null;
|
|
2550
|
-
const s =
|
|
2602
|
+
const s = xt(t.game);
|
|
2551
2603
|
return s && t.game[`${s}TeamId`] || null;
|
|
2552
2604
|
}
|
|
2553
|
-
const
|
|
2554
|
-
function
|
|
2605
|
+
const qe = { active: 0, setup: 1, complete: 2 };
|
|
2606
|
+
function Ks(a, { id: e, param: t } = {}) {
|
|
2555
2607
|
const s = a || [];
|
|
2556
2608
|
if (!s.length) return null;
|
|
2557
2609
|
for (const r of [e, t]) {
|
|
@@ -2559,9 +2611,9 @@ function js(a, { id: e, param: t } = {}) {
|
|
|
2559
2611
|
const o = s.find((n) => n.id === r);
|
|
2560
2612
|
if (o) return o;
|
|
2561
2613
|
}
|
|
2562
|
-
return [...s].sort((r, o) => (
|
|
2614
|
+
return [...s].sort((r, o) => (qe[r.status] ?? 3) - (qe[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
|
|
2563
2615
|
}
|
|
2564
|
-
const
|
|
2616
|
+
const Ys = b`
|
|
2565
2617
|
.bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
|
|
2566
2618
|
.round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
|
|
2567
2619
|
.roundhead {
|
|
@@ -2607,8 +2659,8 @@ const qs = y`
|
|
|
2607
2659
|
.champ .tname a { color: inherit; text-decoration: none; font-weight: 700; }
|
|
2608
2660
|
@media (max-width: 720px) { .round { flex-basis: 215px; } }
|
|
2609
2661
|
`;
|
|
2610
|
-
class
|
|
2611
|
-
static styles = [
|
|
2662
|
+
class kt extends w {
|
|
2663
|
+
static styles = [H, Ys];
|
|
2612
2664
|
static properties = {
|
|
2613
2665
|
...w.properties,
|
|
2614
2666
|
sport: { type: String },
|
|
@@ -2621,9 +2673,9 @@ class xt extends w {
|
|
|
2621
2673
|
super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
|
|
2622
2674
|
}
|
|
2623
2675
|
async fetchData(e) {
|
|
2624
|
-
const t = this.season ||
|
|
2676
|
+
const t = this.season || Q(), s = (await e.listTournaments({ sport: this.sport, season: t })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = Ks(s, { id: this.picked || this.tournamentId, param: r });
|
|
2625
2677
|
if (!o) return { season: t, tournaments: s, tournament: null };
|
|
2626
|
-
const [n, i,
|
|
2678
|
+
const [n, i, l, p, d] = await Promise.all([
|
|
2627
2679
|
e.listSeedings(o.id),
|
|
2628
2680
|
e.listEdges(o.id),
|
|
2629
2681
|
e.listGames({ tournamentId: o.id }),
|
|
@@ -2636,18 +2688,18 @@ class xt extends w {
|
|
|
2636
2688
|
tournament: o,
|
|
2637
2689
|
seedings: n.items,
|
|
2638
2690
|
edges: i.items,
|
|
2639
|
-
games:
|
|
2691
|
+
games: l.items,
|
|
2640
2692
|
schools: p.items,
|
|
2641
2693
|
teams: d.items
|
|
2642
2694
|
};
|
|
2643
2695
|
}
|
|
2644
2696
|
get ctx() {
|
|
2645
2697
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
2646
|
-
teamsById:
|
|
2647
|
-
schoolsById:
|
|
2698
|
+
teamsById: y(this.data.teams),
|
|
2699
|
+
schoolsById: y(this.data.schools),
|
|
2648
2700
|
records: {},
|
|
2649
2701
|
rankings: [],
|
|
2650
|
-
hrefs:
|
|
2702
|
+
hrefs: U(this),
|
|
2651
2703
|
sport: this.sport
|
|
2652
2704
|
}, this._ctxData = this.data), this._ctx;
|
|
2653
2705
|
}
|
|
@@ -2665,29 +2717,29 @@ class xt extends w {
|
|
|
2665
2717
|
}
|
|
2666
2718
|
renderView() {
|
|
2667
2719
|
const e = this.data, t = this.ctx, s = le(this, t, {
|
|
2668
|
-
title:
|
|
2669
|
-
sub: e.tournament ?
|
|
2720
|
+
title: c`${k(this.sport)} playoff brackets`,
|
|
2721
|
+
sub: e.tournament ? c`${e.tournament.name} · ${e.season} season` : c`${e.season} season`,
|
|
2670
2722
|
teams: e.teams
|
|
2671
2723
|
});
|
|
2672
2724
|
if (!e.tournament)
|
|
2673
|
-
return
|
|
2674
|
-
${
|
|
2725
|
+
return c`${s}${D(this, c`
|
|
2726
|
+
${R(this)}
|
|
2675
2727
|
<div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${e.season} season yet.</div></div>
|
|
2676
2728
|
`)}`;
|
|
2677
|
-
const r =
|
|
2678
|
-
return
|
|
2729
|
+
const r = Ls(e.tournament, e.games), o = r.find((h) => h.key === this.group) || r[0], n = (e.tournament.groupNames || []).length >= 2 ? e.tournament.groupNames.length : 1, i = (Number(e.tournament.size) || 0) / n, l = qs(e.games, e.edges, o), p = Hs(e.games), d = Vs(e.games, e.edges);
|
|
2730
|
+
return c`
|
|
2679
2731
|
${s}
|
|
2680
|
-
${
|
|
2681
|
-
${
|
|
2732
|
+
${D(this, c`
|
|
2733
|
+
${R(this)}
|
|
2682
2734
|
<div class="toolbar">
|
|
2683
|
-
${e.tournaments.length > 1 ?
|
|
2735
|
+
${e.tournaments.length > 1 ? c`
|
|
2684
2736
|
<div role="group" aria-label="Tournament">
|
|
2685
|
-
${e.tournaments.map((h) =>
|
|
2737
|
+
${e.tournaments.map((h) => c`<button class="chip ${h.id === e.tournament.id ? "on" : ""}"
|
|
2686
2738
|
@click=${() => this.pick(h.id)}>${h.name}</button>`)}
|
|
2687
2739
|
</div>` : m}
|
|
2688
|
-
${r.length > 1 ?
|
|
2740
|
+
${r.length > 1 ? c`
|
|
2689
2741
|
<div role="tablist" aria-label="Bracket group">
|
|
2690
|
-
${r.map((h) =>
|
|
2742
|
+
${r.map((h) => c`<button class="chip ${h.key === o.key ? "on" : ""}" role="tab"
|
|
2691
2743
|
aria-selected=${h.key === o.key ? "true" : "false"}
|
|
2692
2744
|
@click=${() => {
|
|
2693
2745
|
this.group = h.key;
|
|
@@ -2697,62 +2749,62 @@ class xt extends w {
|
|
|
2697
2749
|
<span class="pill ${p === "complete" ? "final" : p === "active" ? "class" : "type"}">${p === "complete" ? "Complete" : p === "active" ? "In progress" : "Bracket set"}</span>
|
|
2698
2750
|
<span class="asof">${e.tournament.size}-team ${String(e.tournament.format || "").replace(/_/g, " ")}</span>
|
|
2699
2751
|
</div>
|
|
2700
|
-
${d ?
|
|
2701
|
-
${P(
|
|
2702
|
-
${
|
|
2752
|
+
${d ? c`<div class="champ"><span class="pill champ">Champion</span>
|
|
2753
|
+
${B(P(t, d), 26)}<span class="tname">${ae(t, d)}</span></div>` : m}
|
|
2754
|
+
${l.length ? c`
|
|
2703
2755
|
<div class="bracket" role="region" aria-label="${o.name} bracket">
|
|
2704
|
-
${
|
|
2756
|
+
${l.map((h) => c`
|
|
2705
2757
|
<section class="round">
|
|
2706
|
-
<h3 class="roundhead">${
|
|
2758
|
+
<h3 class="roundhead">${Us({ round: h.round, perGroup: i, groupCount: n })}</h3>
|
|
2707
2759
|
<div class="games">${h.games.map((u) => this.renderMatchup(t, u))}</div>
|
|
2708
2760
|
</section>`)}
|
|
2709
|
-
</div>` :
|
|
2761
|
+
</div>` : c`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
|
|
2710
2762
|
`)}
|
|
2711
2763
|
`;
|
|
2712
2764
|
}
|
|
2713
2765
|
renderMatchup(e, t) {
|
|
2714
2766
|
const s = t.homeTeamId && t.awayTeamId || t.state === "final" || t.state === "live";
|
|
2715
|
-
return
|
|
2767
|
+
return c`
|
|
2716
2768
|
<article class="matchup ${t.state}" aria-label="${t.label || "Matchup"}">
|
|
2717
2769
|
${this.renderSlot(e, t, "home")}
|
|
2718
2770
|
${this.renderSlot(e, t, "away")}
|
|
2719
2771
|
<footer class="mfoot">
|
|
2720
|
-
${
|
|
2721
|
-
${t.label ?
|
|
2772
|
+
${K(t)}
|
|
2773
|
+
${t.label ? c`<span class="label">${t.label}</span>` : m}
|
|
2722
2774
|
<span class="spacer"></span>
|
|
2723
|
-
${s ?
|
|
2775
|
+
${s ? c`<a class="box" href=${v(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score</a>` : m}
|
|
2724
2776
|
</footer>
|
|
2725
2777
|
</article>
|
|
2726
2778
|
`;
|
|
2727
2779
|
}
|
|
2728
2780
|
renderSlot(e, t, s) {
|
|
2729
|
-
const { teamId: r, seed: o, bye: n } =
|
|
2730
|
-
return
|
|
2781
|
+
const { teamId: r, seed: o, bye: n } = Ws(t, s, this.data.seedings), i = xt(t), l = t.state === "live" || t.state === "final";
|
|
2782
|
+
return c`
|
|
2731
2783
|
<div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
|
|
2732
2784
|
<span class="seed">${o ?? ""}</span>
|
|
2733
|
-
${r ?
|
|
2734
|
-
${
|
|
2785
|
+
${r ? c`${B(P(e, r), 22)}<span class="tname">${ae(e, r, t.date)}</span>` : n ? c`<span class="tname bye">Bye</span>` : c`<span class="tname mut">TBD</span>`}
|
|
2786
|
+
${l ? c`<span class="score">${t[`${s}Score`] ?? 0}</span>` : m}
|
|
2735
2787
|
</div>
|
|
2736
2788
|
`;
|
|
2737
2789
|
}
|
|
2738
2790
|
}
|
|
2739
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets",
|
|
2740
|
-
const
|
|
2741
|
-
"hsot-scores":
|
|
2742
|
-
"hsot-standings":
|
|
2743
|
-
"hsot-rankings":
|
|
2744
|
-
"hsot-school":
|
|
2745
|
-
"hsot-boxscore":
|
|
2746
|
-
"hsot-school-search":
|
|
2747
|
-
"hsot-brackets":
|
|
2791
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", kt);
|
|
2792
|
+
const Qs = {
|
|
2793
|
+
"hsot-scores": pt,
|
|
2794
|
+
"hsot-standings": mt,
|
|
2795
|
+
"hsot-rankings": ut,
|
|
2796
|
+
"hsot-school": ft,
|
|
2797
|
+
"hsot-boxscore": $t,
|
|
2798
|
+
"hsot-school-search": yt,
|
|
2799
|
+
"hsot-brackets": kt
|
|
2748
2800
|
};
|
|
2749
|
-
function
|
|
2801
|
+
function Zs() {
|
|
2750
2802
|
const a = globalThis?.customElements;
|
|
2751
2803
|
if (a)
|
|
2752
|
-
for (const [e, t] of Object.entries(
|
|
2804
|
+
for (const [e, t] of Object.entries(Qs))
|
|
2753
2805
|
a.get(e) || a.define(e, t);
|
|
2754
2806
|
}
|
|
2755
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2807
|
+
typeof window < "u" && globalThis.customElements && Zs();
|
|
2756
2808
|
export {
|
|
2757
|
-
|
|
2809
|
+
Zs as defineAll
|
|
2758
2810
|
};
|