@wral/hsot-data 0.1.9 → 0.1.11
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 +3 -1
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +573 -563
- package/dist/{hsot-school-search-D1W24ixG.js → hsot-school-search-CBbEB6gv.js} +352 -342
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const V = globalThis, nt = V.ShadowRoot && (V.ShadyCSS === void 0 || V.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = /* @__PURE__ */ Symbol(), wt = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let
|
|
2
|
+
let Nt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
4
|
if (this._$cssResult$ = !0, s !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
@@ -17,53 +17,53 @@ let Ft = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e =
|
|
20
|
+
const re = (r) => new Nt(typeof r == "string" ? r : r + "", void 0, lt), b = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce((s, a, o) => s + ((i) => {
|
|
22
22
|
if (i._$cssResult$ === !0) return i.cssText;
|
|
23
23
|
if (typeof i == "number") return i;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
}, ae = (
|
|
28
|
-
if (nt)
|
|
25
|
+
})(a) + r[o + 1], r[0]);
|
|
26
|
+
return new Nt(e, r, lt);
|
|
27
|
+
}, ae = (r, t) => {
|
|
28
|
+
if (nt) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"),
|
|
31
|
-
|
|
30
|
+
const s = document.createElement("style"), a = V.litNonce;
|
|
31
|
+
a !== void 0 && s.setAttribute("nonce", a), s.textContent = e.cssText, r.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
}, xt = nt ? (
|
|
33
|
+
}, xt = nt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is:
|
|
36
|
+
return re(e);
|
|
37
|
+
})(r) : r;
|
|
38
|
+
const { is: oe, defineProperty: ie, getOwnPropertyDescriptor: ne, getOwnPropertyNames: le, getOwnPropertySymbols: ce, getPrototypeOf: he } = Object, X = globalThis, kt = X.trustedTypes, de = kt ? kt.emptyScript : "", pe = X.reactiveElementPolyfillSupport, B = (r, t) => r, it = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
r = r ? de : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
45
|
-
|
|
45
|
+
r = r == null ? r : JSON.stringify(r);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, fromAttribute(
|
|
49
|
-
let e =
|
|
47
|
+
return r;
|
|
48
|
+
}, fromAttribute(r, t) {
|
|
49
|
+
let e = r;
|
|
50
50
|
switch (t) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
e =
|
|
52
|
+
e = r !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
e =
|
|
55
|
+
e = r === null ? null : Number(r);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
e = JSON.parse(
|
|
60
|
+
e = JSON.parse(r);
|
|
61
61
|
} catch {
|
|
62
62
|
e = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
66
|
+
} }, Ut = (r, t) => !oe(r, t), _t = { attribute: !0, type: String, converter: it, reflect: !1, useDefault: !1, hasChanged: Ut };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), X.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let I = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -74,18 +74,18 @@ let I = class extends HTMLElement {
|
|
|
74
74
|
}
|
|
75
75
|
static createProperty(t, e = _t) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), a = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
a !== void 0 && ie(this.prototype, t, a);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: a, set: o } = ne(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const n =
|
|
87
|
+
return { get: a, set(i) {
|
|
88
|
+
const n = a?.call(this);
|
|
89
89
|
o?.call(this, i), this.requestUpdate(t, n, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
@@ -94,24 +94,24 @@ let I = class extends HTMLElement {
|
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(B("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = he(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
101
|
if (this.hasOwnProperty(B("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(B("properties"))) {
|
|
103
|
-
const e = this.properties, s = [...
|
|
104
|
-
for (const
|
|
103
|
+
const e = this.properties, s = [...le(e), ...ce(e)];
|
|
104
|
+
for (const a of s) this.createProperty(a, e[a]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [s,
|
|
109
|
+
if (e !== void 0) for (const [s, a] of e) this.elementProperties.set(s, a);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
112
|
for (const [e, s] of this.elementProperties) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const a = this._$Eu(e, s);
|
|
114
|
+
a !== void 0 && this._$Eh.set(a, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
@@ -119,7 +119,7 @@ let I = class extends HTMLElement {
|
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
121
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
-
for (const
|
|
122
|
+
for (const a of s) e.unshift(xt(a));
|
|
123
123
|
} else t !== void 0 && e.push(xt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
@@ -160,31 +160,31 @@ let I = class extends HTMLElement {
|
|
|
160
160
|
this._$AK(t, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const s = this.constructor.elementProperties.get(t),
|
|
164
|
-
if (
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
|
|
164
|
+
if (a !== void 0 && s.reflect === !0) {
|
|
165
165
|
const o = (s.converter?.toAttribute !== void 0 ? s.converter : it).toAttribute(e, s.type);
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(a) : this.setAttribute(a, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const s = this.constructor,
|
|
171
|
-
if (
|
|
172
|
-
const o = s.getPropertyOptions(
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, a = s._$Eh.get(t);
|
|
171
|
+
if (a !== void 0 && this._$Em !== a) {
|
|
172
|
+
const o = s.getPropertyOptions(a), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : it;
|
|
173
|
+
this._$Em = a;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[a] = n ?? this._$Ej?.get(a) ?? n, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(t, e, s,
|
|
178
|
+
requestUpdate(t, e, s, a = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const i = this.constructor;
|
|
181
|
-
if (
|
|
181
|
+
if (a === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Ut)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)),
|
|
186
|
+
C(t, e, { useDefault: s, reflect: a, wrapped: o }, i) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), a === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let I = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [
|
|
206
|
+
for (const [a, o] of this._$Ep) this[a] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [
|
|
211
|
-
const { wrapped: i } = o, n = this[
|
|
212
|
-
i !== !0 || this._$AL.has(
|
|
210
|
+
if (s.size > 0) for (const [a, o] of s) {
|
|
211
|
+
const { wrapped: i } = o, n = this[a];
|
|
212
|
+
i !== !0 || this._$AL.has(a) || n === void 0 || this.C(a, void 0, o, n);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,54 +246,54 @@ let I = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(),
|
|
250
|
-
const ct = globalThis, St = (
|
|
251
|
-
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g,
|
|
253
|
-
function
|
|
254
|
-
if (!ht(
|
|
249
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(), pe?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ct = globalThis, St = (r) => r, Y = ct.trustedTypes, At = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ot = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ht = "?" + k, me = `<${Ht}>`, T = document, F = () => T.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", ht = Array.isArray, fe = (r) => ht(r) || typeof r?.[Symbol.iterator] == "function", at = `[
|
|
251
|
+
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), c = Lt(1), Pt = Lt(2), P = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
|
+
function jt(r, t) {
|
|
254
|
+
if (!ht(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return At !== void 0 ? At.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const e =
|
|
259
|
-
let
|
|
257
|
+
const ue = (r, t) => {
|
|
258
|
+
const e = r.length - 1, s = [];
|
|
259
|
+
let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = R;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
|
-
const d =
|
|
262
|
-
let
|
|
263
|
-
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === R ? h[1] === "!--" ? i = Tt : h[1] !== void 0 ? i = It : h[2] !== void 0 ? (
|
|
264
|
-
const u = i === S &&
|
|
265
|
-
o += i === R ? d +
|
|
261
|
+
const d = r[n];
|
|
262
|
+
let l, h, p = -1, f = 0;
|
|
263
|
+
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === R ? h[1] === "!--" ? i = Tt : h[1] !== void 0 ? i = It : h[2] !== void 0 ? (Mt.test(h[2]) && (a = RegExp("</" + h[2], "g")), i = S) : h[3] !== void 0 && (i = S) : i === S ? h[0] === ">" ? (i = a ?? R, p = -1) : h[1] === void 0 ? p = -2 : (p = i.lastIndex - h[2].length, l = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Et : Ct) : i === Et || i === Ct ? i = S : i === Tt || i === It ? i = R : (i = S, a = void 0);
|
|
264
|
+
const u = i === S && r[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === R ? d + me : p >= 0 ? (s.push(l), d.slice(0, p) + Ot + d.slice(p) + k + u) : d + k + (p === -2 ? n : u);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [jt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
269
|
class U {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
|
-
let
|
|
271
|
+
let a;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1, d = this.parts, [
|
|
275
|
-
if (this.el = U.createElement(
|
|
274
|
+
const n = t.length - 1, d = this.parts, [l, h] = ue(t, e);
|
|
275
|
+
if (this.el = U.createElement(l, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const f = h[i++], u =
|
|
283
|
-
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ?
|
|
284
|
-
} else p.startsWith(k) && (d.push({ type: 6, index: o }),
|
|
285
|
-
if (
|
|
286
|
-
const p =
|
|
279
|
+
for (; (a = A.nextNode()) !== null && d.length < n; ) {
|
|
280
|
+
if (a.nodeType === 1) {
|
|
281
|
+
if (a.hasAttributes()) for (const p of a.getAttributeNames()) if (p.endsWith(Ot)) {
|
|
282
|
+
const f = h[i++], u = a.getAttribute(p).split(k), $ = /([.?@])?(.*)/.exec(f);
|
|
283
|
+
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? ve : $[1] === "?" ? $e : $[1] === "@" ? be : tt }), a.removeAttribute(p);
|
|
284
|
+
} else p.startsWith(k) && (d.push({ type: 6, index: o }), a.removeAttribute(p));
|
|
285
|
+
if (Mt.test(a.tagName)) {
|
|
286
|
+
const p = a.textContent.split(k), f = p.length - 1;
|
|
287
287
|
if (f > 0) {
|
|
288
|
-
|
|
289
|
-
for (let u = 0; u < f; u++)
|
|
290
|
-
|
|
288
|
+
a.textContent = Y ? Y.emptyScript : "";
|
|
289
|
+
for (let u = 0; u < f; u++) a.append(p[u], F()), A.nextNode(), d.push({ type: 2, index: ++o });
|
|
290
|
+
a.append(p[f], F());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (a.nodeType === 8) if (a.data === Ht) d.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let p = -1;
|
|
296
|
-
for (; (p =
|
|
296
|
+
for (; (p = a.data.indexOf(k, p + 1)) !== -1; ) d.push({ type: 7, index: o }), p += k.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
@@ -303,13 +303,13 @@ class U {
|
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function D(
|
|
306
|
+
function D(r, t, e = r, s) {
|
|
307
307
|
if (t === P) return t;
|
|
308
|
-
let
|
|
308
|
+
let a = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
309
|
const o = N(t) ? void 0 : t._$litDirective$;
|
|
310
|
-
return
|
|
310
|
+
return a?.constructor !== o && (a?._$AO?.(!1), o === void 0 ? a = void 0 : (a = new o(r), a._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = a : e._$Cl = a), a !== void 0 && (t = D(r, a._$AS(r, t.values), a, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class ge {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,17 +320,17 @@ class ue {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
324
|
-
A.currentNode =
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, a = (t?.creationScope ?? T).importNode(e, !0);
|
|
324
|
+
A.currentNode = a;
|
|
325
325
|
let o = A.nextNode(), i = 0, n = 0, d = s[0];
|
|
326
326
|
for (; d !== void 0; ) {
|
|
327
327
|
if (i === d.index) {
|
|
328
|
-
let
|
|
329
|
-
d.type === 2 ?
|
|
328
|
+
let l;
|
|
329
|
+
d.type === 2 ? l = new M(o, o.nextSibling, this, t) : d.type === 1 ? l = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (l = new ye(o, this, t)), this._$AV.push(l), d = s[++n];
|
|
330
330
|
}
|
|
331
331
|
i !== d?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
333
|
-
return A.currentNode = T,
|
|
333
|
+
return A.currentNode = T, a;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
@@ -341,8 +341,8 @@ class M {
|
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(t, e, s,
|
|
345
|
-
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options =
|
|
344
|
+
constructor(t, e, s, a) {
|
|
345
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = a, this._$Cv = a?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let t = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class M {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t = D(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
359
|
+
t = D(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : fe(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -368,10 +368,10 @@ class M {
|
|
|
368
368
|
this._$AH !== m && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t,
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
371
|
+
const { values: e, _$litType$: s } = t, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(jt(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === a) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new ge(a, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
@@ -382,9 +382,9 @@ class M {
|
|
|
382
382
|
k(t) {
|
|
383
383
|
ht(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
|
-
let s,
|
|
386
|
-
for (const o of t)
|
|
387
|
-
|
|
385
|
+
let s, a = 0;
|
|
386
|
+
for (const o of t) a === e.length ? e.push(s = new M(this.O(F()), this.O(F()), this, this.options)) : s = e[a], s._$AI(o), a++;
|
|
387
|
+
a < e.length && (this._$AR(s && s._$AB.nextSibling, a), e.length = a);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
@@ -403,25 +403,25 @@ class tt {
|
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s,
|
|
407
|
-
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
406
|
+
constructor(t, e, s, a, o) {
|
|
407
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = a, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
|
|
408
408
|
}
|
|
409
|
-
_$AI(t, e = this, s,
|
|
409
|
+
_$AI(t, e = this, s, a) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let i = !1;
|
|
412
412
|
if (o === void 0) t = D(this, t, e, 0), i = !N(t) || t !== this._$AH && t !== P, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const n = t;
|
|
415
|
-
let d,
|
|
416
|
-
for (t = o[0], d = 0; d < o.length - 1; d++)
|
|
415
|
+
let d, l;
|
|
416
|
+
for (t = o[0], d = 0; d < o.length - 1; d++) l = D(this, n[s + d], e, d), l === P && (l = this._$AH[d]), i ||= !N(l) || l !== this._$AH[d], l === m ? t = m : t !== m && (t += (l ?? "") + o[d + 1]), this._$AH[d] = l;
|
|
417
417
|
}
|
|
418
|
-
i && !
|
|
418
|
+
i && !a && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class ve extends tt {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ge extends tt {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class $e extends tt {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class ve extends tt {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(t, e, s,
|
|
442
|
-
super(t, e, s,
|
|
440
|
+
class be extends tt {
|
|
441
|
+
constructor(t, e, s, a, o) {
|
|
442
|
+
super(t, e, s, a, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
445
|
if ((t = D(this, t, e, 0) ?? m) === P) return;
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
446
|
+
const s = this._$AH, a = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || a);
|
|
447
|
+
a && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class ye {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -461,16 +461,16 @@ class be {
|
|
|
461
461
|
D(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const we = ct.litHtmlPolyfillSupport;
|
|
465
|
+
we?.(U, M), (ct.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const xe = (r, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
468
|
+
let a = s._$litPart$;
|
|
469
|
+
if (a === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ =
|
|
471
|
+
s._$litPart$ = a = new M(t.insertBefore(F(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return a._$AI(r), a;
|
|
474
474
|
};
|
|
475
475
|
const dt = globalThis;
|
|
476
476
|
class E extends I {
|
|
@@ -483,7 +483,7 @@ class E extends I {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = xe(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -496,37 +496,37 @@ class E extends I {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
E._$litElement$ = !0, E.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: E });
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
const ke = dt.litElementPolyfillSupport;
|
|
500
|
+
ke?.({ LitElement: E });
|
|
501
501
|
(dt.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const t = Object.entries(
|
|
502
|
+
const _e = 50;
|
|
503
|
+
function Se(r = {}) {
|
|
504
|
+
const t = Object.entries(r).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
|
-
return t.forEach(([s,
|
|
507
|
+
return t.forEach(([s, a]) => e.set(s, String(a))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
const s =
|
|
509
|
+
function Ae({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
510
|
+
if (!r) throw new Error("createClient requires a baseUrl");
|
|
511
|
+
const s = r.replace(/\/+$/, ""), a = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
513
513
|
const d = { Accept: "application/json" };
|
|
514
514
|
t && (d.Authorization = `Bearer ${t}`);
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const h = new Error(`api-hsot ${
|
|
518
|
-
throw h.status =
|
|
515
|
+
const l = await a(`${s}${n}`, { headers: d });
|
|
516
|
+
if (!l.ok) {
|
|
517
|
+
const h = new Error(`api-hsot ${l.status} on ${n}`);
|
|
518
|
+
throw h.status = l.status, h;
|
|
519
519
|
}
|
|
520
|
-
return
|
|
520
|
+
return l.json();
|
|
521
521
|
}
|
|
522
522
|
async function i(n, d = {}) {
|
|
523
|
-
const
|
|
523
|
+
const l = [];
|
|
524
524
|
let h = null;
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const f =
|
|
527
|
-
if (
|
|
525
|
+
for (let p = 0; p < _e; p += 1) {
|
|
526
|
+
const f = Se(h ? { ...d, cursor: h } : d), u = await o(`${n}${f}`);
|
|
527
|
+
if (l.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
|
-
return { items:
|
|
529
|
+
return { items: l, total: l.length, nextCursor: null };
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
532
|
listSchools: (n) => i("/schools", n),
|
|
@@ -549,109 +549,120 @@ const ot = {
|
|
|
549
549
|
school: "/school/{id}/",
|
|
550
550
|
section: "/{sport}/{view}/"
|
|
551
551
|
};
|
|
552
|
-
function g(
|
|
553
|
-
return String(
|
|
552
|
+
function g(r, t) {
|
|
553
|
+
return String(r).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
554
|
}
|
|
555
|
-
function L(
|
|
555
|
+
function L(r) {
|
|
556
556
|
return {
|
|
557
|
-
game:
|
|
558
|
-
school:
|
|
559
|
-
section:
|
|
557
|
+
game: r.getAttribute("game-href") || ot.game,
|
|
558
|
+
school: r.getAttribute("school-href") || ot.school,
|
|
559
|
+
section: r.getAttribute("section-href") || ot.section
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
const z = (
|
|
563
|
-
function y(
|
|
564
|
-
if (!
|
|
565
|
-
const [e, s,
|
|
566
|
-
return !e || !s || !
|
|
562
|
+
const z = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
|
|
563
|
+
function y(r, t) {
|
|
564
|
+
if (!r) return "TBD";
|
|
565
|
+
const [e, s, a] = String(r).split("-").map(Number);
|
|
566
|
+
return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
567
|
}
|
|
568
|
-
function pt(
|
|
569
|
-
if (!
|
|
570
|
-
const [t, e] = String(
|
|
568
|
+
function pt(r) {
|
|
569
|
+
if (!r) return "";
|
|
570
|
+
const [t, e] = String(r).split(":").map(Number);
|
|
571
571
|
if (Number.isNaN(t)) return "";
|
|
572
572
|
const s = t >= 12 ? "PM" : "AM";
|
|
573
573
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
575
|
+
function Te(r) {
|
|
576
|
+
return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
|
|
577
577
|
}
|
|
578
|
-
function et(
|
|
579
|
-
const t =
|
|
580
|
-
return
|
|
578
|
+
function et(r = /* @__PURE__ */ new Date()) {
|
|
579
|
+
const t = r.getFullYear();
|
|
580
|
+
return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
581
581
|
}
|
|
582
|
-
function mt(
|
|
582
|
+
function mt(r = /* @__PURE__ */ new Date()) {
|
|
583
583
|
const t = (e) => String(e).padStart(2, "0");
|
|
584
|
-
return `${
|
|
584
|
+
return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
const e = [...new Set((
|
|
586
|
+
function Ie(r, t = mt()) {
|
|
587
|
+
const e = [...new Set((r || []).filter(Boolean))].sort();
|
|
588
588
|
if (!e.length || e.includes(t)) return t;
|
|
589
|
-
const s = e.filter((
|
|
589
|
+
const s = e.filter((a) => a < t);
|
|
590
590
|
return s.length ? s[s.length - 1] : e[0];
|
|
591
591
|
}
|
|
592
|
-
function ft(
|
|
593
|
-
return
|
|
592
|
+
function ft(r) {
|
|
593
|
+
return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
594
594
|
}
|
|
595
|
-
function K(
|
|
596
|
-
if (!
|
|
597
|
-
const t = parseInt(
|
|
598
|
-
return 0.299 * e + 0.587 * s + 0.114 *
|
|
595
|
+
function K(r) {
|
|
596
|
+
if (!r || !/^#[0-9a-fA-F]{6}$/.test(r)) return "#FFFFFF";
|
|
597
|
+
const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
|
|
598
|
+
return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
const t = ["th", "st", "nd", "rd"], e =
|
|
602
|
-
return
|
|
600
|
+
const Ce = (r) => {
|
|
601
|
+
const t = ["th", "st", "nd", "rd"], e = r % 100;
|
|
602
|
+
return r + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
603
603
|
};
|
|
604
|
-
function
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
function zt(r, t) {
|
|
605
|
+
const e = (o) => {
|
|
606
|
+
const i = /^\d+/.exec(String(o ?? ""));
|
|
607
|
+
return i ? Number(i[0]) : null;
|
|
608
|
+
}, s = e(r), a = e(t);
|
|
609
|
+
return s !== null && a !== null && s !== a ? a - s : s !== null && a === null ? -1 : s === null && a !== null ? 1 : String(r ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
|
|
610
|
+
}
|
|
611
|
+
function Ee(r, t) {
|
|
612
|
+
const e = (s) => String(s?.name ?? s ?? "");
|
|
613
|
+
return e(r).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
614
|
+
}
|
|
615
|
+
function Wt(r) {
|
|
616
|
+
if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
|
|
617
|
+
if (r.state === "final") {
|
|
607
618
|
const t = [];
|
|
608
|
-
return
|
|
619
|
+
return r.finish === "overtime" && t.push("OT"), r.finish === "shootout" && t.push("PK-SO"), r.forfeit && r.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
609
620
|
}
|
|
610
|
-
return
|
|
621
|
+
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${pt(r.time)}`.replace(/ · $/, "") };
|
|
611
622
|
}
|
|
612
|
-
const
|
|
613
|
-
function _(
|
|
614
|
-
let t = String(
|
|
623
|
+
const Pe = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
624
|
+
function _(r) {
|
|
625
|
+
let t = String(r || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
615
626
|
const e = t.indexOf("#");
|
|
616
627
|
let s = "";
|
|
617
628
|
e !== -1 && (s = t.slice(e).split("?")[0], t = t.slice(0, e));
|
|
618
|
-
let
|
|
619
|
-
return
|
|
629
|
+
let a = t.split("?")[0] + s;
|
|
630
|
+
return a = a.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), a = a.replace(/^\/(?=#)/, ""), a.length > 1 && (a = a.replace(/\/+$/, "")), a.toLowerCase();
|
|
620
631
|
}
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
if (!
|
|
624
|
-
const t = (
|
|
625
|
-
return _((
|
|
632
|
+
function qt() {
|
|
633
|
+
const r = globalThis.location;
|
|
634
|
+
if (!r) return "";
|
|
635
|
+
const t = (r.hash || "").startsWith("#/") ? r.hash : "";
|
|
636
|
+
return _((r.pathname || "") + t);
|
|
626
637
|
}
|
|
627
|
-
function
|
|
638
|
+
function De(r, t, e) {
|
|
628
639
|
if (!e) return null;
|
|
629
|
-
const s = _(
|
|
640
|
+
const s = _(r);
|
|
630
641
|
if (!s) return null;
|
|
631
|
-
const
|
|
632
|
-
if (s ===
|
|
642
|
+
const a = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
|
|
643
|
+
if (s === a || s.startsWith(`${a}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
633
644
|
const i = _(g(t.section, { sport: e, view: "" }));
|
|
634
645
|
if (s === i) return "";
|
|
635
646
|
if (!s.startsWith(`${i}/`)) return null;
|
|
636
647
|
const n = s.slice(i.length + 1), d = n.split("/");
|
|
637
|
-
return d.length > 2 || d.some((
|
|
648
|
+
return d.length > 2 || d.some((l) => !/^[a-z][a-z-]*$/.test(l)) || Pe.has(d[0]) ? null : n;
|
|
638
649
|
}
|
|
639
|
-
function
|
|
640
|
-
const s = (i) => g(e.section, { sport:
|
|
650
|
+
function ze(r, t, e) {
|
|
651
|
+
const s = (i) => g(e.section, { sport: r, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
|
|
641
652
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
642
653
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
643
654
|
] : [{ label: "Standings", href: s("standings") }];
|
|
644
655
|
return [
|
|
645
|
-
{ label: `${z(
|
|
656
|
+
{ label: `${z(r)} Home`, href: s("") },
|
|
646
657
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
647
658
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
648
659
|
...o,
|
|
649
660
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
650
661
|
];
|
|
651
662
|
}
|
|
652
|
-
function
|
|
663
|
+
function Re(r, t = qt()) {
|
|
653
664
|
const e = _(t);
|
|
654
|
-
for (const s of
|
|
665
|
+
for (const s of r.querySelectorAll(':scope > a[slot="nav"]'))
|
|
655
666
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
656
667
|
}
|
|
657
668
|
class w extends E {
|
|
@@ -673,7 +684,7 @@ class w extends E {
|
|
|
673
684
|
this._client = t, this.isConnected && this.load();
|
|
674
685
|
}
|
|
675
686
|
get client() {
|
|
676
|
-
return this._client ? this._client : this.api ?
|
|
687
|
+
return this._client ? this._client : this.api ? Ae({ baseUrl: this.api }) : null;
|
|
677
688
|
}
|
|
678
689
|
connectedCallback() {
|
|
679
690
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -685,7 +696,7 @@ class w extends E {
|
|
|
685
696
|
this.load();
|
|
686
697
|
}
|
|
687
698
|
updated(t) {
|
|
688
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
699
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Re(this);
|
|
689
700
|
}
|
|
690
701
|
async load() {
|
|
691
702
|
const t = this.client;
|
|
@@ -714,13 +725,13 @@ class w extends E {
|
|
|
714
725
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
715
726
|
}
|
|
716
727
|
render() {
|
|
717
|
-
return this.error === "not-configured" ?
|
|
728
|
+
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>`;
|
|
718
729
|
}
|
|
719
730
|
renderView() {
|
|
720
|
-
return
|
|
731
|
+
return c``;
|
|
721
732
|
}
|
|
722
733
|
}
|
|
723
|
-
const v = (
|
|
734
|
+
const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), Be = b`
|
|
724
735
|
:host {
|
|
725
736
|
--hsot-red: var(--color-red, #D1232A);
|
|
726
737
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -758,7 +769,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
758
769
|
outline-offset: 1px;
|
|
759
770
|
}
|
|
760
771
|
.mut { color: var(--hsot-gray-5); }
|
|
761
|
-
`,
|
|
772
|
+
`, Fe = b`
|
|
762
773
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
763
774
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
764
775
|
.band h1, .band h2.bandtitle {
|
|
@@ -807,7 +818,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
807
818
|
@media (max-width: 720px) {
|
|
808
819
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
809
820
|
}
|
|
810
|
-
`,
|
|
821
|
+
`, Ne = b`
|
|
811
822
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
812
823
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
813
824
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -871,7 +882,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
871
882
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
872
883
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
873
884
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
874
|
-
`,
|
|
885
|
+
`, Ue = b`
|
|
875
886
|
.pill {
|
|
876
887
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
877
888
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -886,7 +897,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
886
897
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
887
898
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
888
899
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
889
|
-
`,
|
|
900
|
+
`, Oe = b`
|
|
890
901
|
.tablewrap { overflow-x: auto; }
|
|
891
902
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
892
903
|
table.data th {
|
|
@@ -904,7 +915,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
904
915
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
905
916
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
906
917
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
907
|
-
`,
|
|
918
|
+
`, He = b`
|
|
908
919
|
.swatch {
|
|
909
920
|
display: inline-flex; align-items: center; justify-content: center;
|
|
910
921
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -928,7 +939,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
928
939
|
.dot.W { background: var(--hsot-win); }
|
|
929
940
|
.dot.L { background: var(--hsot-loss); }
|
|
930
941
|
.dot.T { background: var(--hsot-tie); }
|
|
931
|
-
`,
|
|
942
|
+
`, Me = b`
|
|
932
943
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
933
944
|
.gamelist li {
|
|
934
945
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -978,21 +989,21 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
978
989
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
979
990
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
980
991
|
.gamelist a.box { font-size: 0.78rem; }
|
|
981
|
-
`, j = [
|
|
982
|
-
function ut(
|
|
983
|
-
return
|
|
992
|
+
`, j = [Be, Fe, Ne, Ue, Oe, He, Me];
|
|
993
|
+
function ut(r) {
|
|
994
|
+
return r.state !== "final" ? null : r.forfeit === "home" ? "away" : r.forfeit === "away" || r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
|
|
984
995
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
996
|
+
function Le(r) {
|
|
997
|
+
return r && (r.forfeit === "home" || r.forfeit === "away") ? r.forfeit : null;
|
|
987
998
|
}
|
|
988
|
-
function W(
|
|
989
|
-
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]),
|
|
990
|
-
for (const o of
|
|
999
|
+
function W(r, t) {
|
|
1000
|
+
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), a = r.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
|
|
1001
|
+
for (const o of a) {
|
|
991
1002
|
const i = ut(o), n = o.gameType === "conference";
|
|
992
1003
|
for (const d of ["home", "away"]) {
|
|
993
|
-
const
|
|
994
|
-
if (!
|
|
995
|
-
const h = s(
|
|
1004
|
+
const l = d === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1005
|
+
if (!l) continue;
|
|
1006
|
+
const h = s(l), p = d === "home" ? o.homeScore : o.awayScore, f = d === "home" ? o.awayScore : o.homeScore;
|
|
996
1007
|
h.pf += p, h.pa += f;
|
|
997
1008
|
let u = "T";
|
|
998
1009
|
i === "tie" ? (h.t += 1, n && (h.ct += 1)) : i === d ? (h.w += 1, n && (h.cw += 1), u = "W") : (h.l += 1, n && (h.cl += 1), u = "L"), h.results.push({ gameId: o.id, date: o.date, mark: u, my: p, their: f, opp: d === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
|
|
@@ -1000,91 +1011,91 @@ function W(a, t) {
|
|
|
1000
1011
|
}
|
|
1001
1012
|
return e;
|
|
1002
1013
|
}
|
|
1003
|
-
function st(
|
|
1004
|
-
if (!
|
|
1005
|
-
const t =
|
|
1014
|
+
function st(r) {
|
|
1015
|
+
if (!r || !r.length) return "";
|
|
1016
|
+
const t = r[r.length - 1].mark;
|
|
1006
1017
|
let e = 0;
|
|
1007
|
-
for (let s =
|
|
1018
|
+
for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
|
|
1008
1019
|
return t + e;
|
|
1009
1020
|
}
|
|
1010
|
-
const
|
|
1011
|
-
const s =
|
|
1012
|
-
return s ? (
|
|
1013
|
-
},
|
|
1014
|
-
function x(
|
|
1015
|
-
if (!
|
|
1016
|
-
const e = t ?
|
|
1017
|
-
return `${e}-${s}${
|
|
1018
|
-
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1021
|
+
const Rt = (r, t, e) => {
|
|
1022
|
+
const s = r + t + e;
|
|
1023
|
+
return s ? (r + e / 2) / s : 0;
|
|
1024
|
+
}, Bt = (r) => r.toFixed(3).replace("0.", ".");
|
|
1025
|
+
function x(r, t = !1) {
|
|
1026
|
+
if (!r) return "0-0";
|
|
1027
|
+
const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
|
|
1028
|
+
return `${e}-${s}${a ? `-${a}` : ""}`;
|
|
1029
|
+
}
|
|
1030
|
+
function Gt(r, t) {
|
|
1031
|
+
return r.map((e) => {
|
|
1021
1032
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1022
|
-
return { team: e, rec: s, confPct:
|
|
1033
|
+
return { team: e, rec: s, confPct: Rt(s.cw, s.cl, s.ct), overallPct: Rt(s.w, s.l, s.t) };
|
|
1023
1034
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
1024
1035
|
}
|
|
1025
|
-
function gt(
|
|
1026
|
-
return
|
|
1036
|
+
function gt(r, t) {
|
|
1037
|
+
return r.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
|
|
1027
1038
|
}
|
|
1028
|
-
function
|
|
1029
|
-
const e =
|
|
1039
|
+
function Ft(r, t) {
|
|
1040
|
+
const e = r[t];
|
|
1030
1041
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
1031
1042
|
}
|
|
1032
|
-
function vt(
|
|
1043
|
+
function vt(r, t, e, s, a) {
|
|
1033
1044
|
const o = t[e];
|
|
1034
1045
|
if (!o) return null;
|
|
1035
1046
|
const i = /* @__PURE__ */ new Map();
|
|
1036
|
-
for (const d of
|
|
1037
|
-
if (d.sport !== s ||
|
|
1038
|
-
const
|
|
1039
|
-
(!h || d.effectiveDate > h.effectiveDate) && i.set(
|
|
1047
|
+
for (const d of r || []) {
|
|
1048
|
+
if (d.sport !== s || a && d.effectiveDate > a || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
|
|
1049
|
+
const l = d.gender || "", h = i.get(l);
|
|
1050
|
+
(!h || d.effectiveDate > h.effectiveDate) && i.set(l, d);
|
|
1040
1051
|
}
|
|
1041
1052
|
let n = null;
|
|
1042
1053
|
for (const d of i.values()) {
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1054
|
+
const l = (d.teamIds || []).indexOf(e);
|
|
1055
|
+
l !== -1 && (!n || d.effectiveDate > n.effectiveDate) && (n = { poll: d, rank: l + 1 });
|
|
1045
1056
|
}
|
|
1046
1057
|
return n ? n.rank : null;
|
|
1047
1058
|
}
|
|
1048
|
-
function
|
|
1049
|
-
if (!
|
|
1050
|
-
const s = (
|
|
1059
|
+
function je(r, t, e) {
|
|
1060
|
+
if (!r) return { kind: "none", delta: 0 };
|
|
1061
|
+
const s = (r.teamIds || []).indexOf(e) + 1;
|
|
1051
1062
|
if (!s) return { kind: "none", delta: 0 };
|
|
1052
1063
|
if (!t) return { kind: "same", delta: 0 };
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1055
|
-
const o =
|
|
1064
|
+
const a = (t.teamIds || []).indexOf(e) + 1;
|
|
1065
|
+
if (!a) return { kind: "new", delta: 0 };
|
|
1066
|
+
const o = a - s;
|
|
1056
1067
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1057
1068
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return /^https?:\/\//i.test(String(
|
|
1069
|
+
function We(r) {
|
|
1070
|
+
return /^https?:\/\//i.test(String(r || ""));
|
|
1060
1071
|
}
|
|
1061
|
-
function
|
|
1062
|
-
if (!
|
|
1072
|
+
function Vt(r, { w: t, h: e } = {}) {
|
|
1073
|
+
if (!We(r)) return "";
|
|
1063
1074
|
const s = [];
|
|
1064
1075
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1065
|
-
const
|
|
1066
|
-
return `${
|
|
1076
|
+
const a = r.includes("?") ? "&" : "?";
|
|
1077
|
+
return `${r}${a}${s.join("&")}`;
|
|
1067
1078
|
}
|
|
1068
|
-
function Q(
|
|
1079
|
+
function Q(r, t) {
|
|
1069
1080
|
const e = t * 2;
|
|
1070
|
-
return
|
|
1081
|
+
return Vt(r?.logoAssetId, { w: e, h: e });
|
|
1071
1082
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1083
|
+
function qe(r, t) {
|
|
1084
|
+
return Vt(r?.photoAssetId, { w: t * 2 });
|
|
1074
1085
|
}
|
|
1075
|
-
function $t(
|
|
1076
|
-
const o =
|
|
1077
|
-
return
|
|
1086
|
+
function $t(r, t, { title: e, sub: s, teams: a }) {
|
|
1087
|
+
const o = qt(), n = !!r.querySelector(':scope > a[slot="nav"]') || De(o, t.hrefs, t.sport) !== null;
|
|
1088
|
+
return c`
|
|
1078
1089
|
<div class="band section">
|
|
1079
1090
|
<div class="inner">
|
|
1080
1091
|
<h1>${e}</h1>
|
|
1081
|
-
${s ?
|
|
1092
|
+
${s ? c`<p class="sub">${s}</p>` : m}
|
|
1082
1093
|
</div>
|
|
1083
|
-
${n ?
|
|
1094
|
+
${n ? c`
|
|
1084
1095
|
<nav class="sectionnav" aria-label="${z(t.sport)} section">
|
|
1085
1096
|
<div class="navrow">
|
|
1086
1097
|
<slot name="nav">
|
|
1087
|
-
${
|
|
1098
|
+
${ze(t.sport, a, t.hrefs).map((d) => c`<a href=${d.href}
|
|
1088
1099
|
aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
|
|
1089
1100
|
</slot>
|
|
1090
1101
|
</div>
|
|
@@ -1092,60 +1103,60 @@ function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
|
1092
1103
|
</div>
|
|
1093
1104
|
`;
|
|
1094
1105
|
}
|
|
1095
|
-
const O = (
|
|
1096
|
-
const e =
|
|
1097
|
-
return e ?
|
|
1098
|
-
}, C = (
|
|
1099
|
-
function H(
|
|
1100
|
-
if (!
|
|
1101
|
-
const e = Q(
|
|
1106
|
+
const O = (r, t) => {
|
|
1107
|
+
const e = r.teamsById[t];
|
|
1108
|
+
return e ? r.schoolsById[e.schoolId] : null;
|
|
1109
|
+
}, C = (r, t) => O(r, t)?.name || "TBD", Z = (r, t) => O(r, t)?.abbr || "TBD";
|
|
1110
|
+
function H(r, t = 26) {
|
|
1111
|
+
if (!r) return m;
|
|
1112
|
+
const e = Q(r, t);
|
|
1102
1113
|
if (e)
|
|
1103
|
-
return
|
|
1114
|
+
return c`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1104
1115
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1105
|
-
const s =
|
|
1106
|
-
return
|
|
1107
|
-
style="width:${t}px;height:${t}px;background:${s};color:${
|
|
1108
|
-
>${ft(
|
|
1109
|
-
}
|
|
1110
|
-
function bt(
|
|
1111
|
-
const s = vt(
|
|
1112
|
-
return s ?
|
|
1113
|
-
}
|
|
1114
|
-
function
|
|
1115
|
-
const s = O(
|
|
1116
|
-
return s ?
|
|
1117
|
-
}
|
|
1118
|
-
function yt(
|
|
1119
|
-
const s =
|
|
1120
|
-
if (!s || !s.results.length) return
|
|
1121
|
-
const
|
|
1122
|
-
return
|
|
1123
|
-
${
|
|
1124
|
-
title="${o.mark} ${o.my}-${o.their} vs ${C(
|
|
1125
|
-
href=${g(
|
|
1116
|
+
const s = r.colorPrimary || "#030711", a = K(s);
|
|
1117
|
+
return c`<span class="swatch" aria-hidden="true"
|
|
1118
|
+
style="width:${t}px;height:${t}px;background:${s};color:${a};font-size:${Math.max(8, t * 0.28)}px"
|
|
1119
|
+
>${ft(r)}</span>`;
|
|
1120
|
+
}
|
|
1121
|
+
function bt(r, t, e) {
|
|
1122
|
+
const s = vt(r.rankings, r.teamsById, t, r.sport, e);
|
|
1123
|
+
return s ? c`<span class="rankbadge">#${s}</span>` : m;
|
|
1124
|
+
}
|
|
1125
|
+
function Yt(r, t, e) {
|
|
1126
|
+
const s = O(r, t);
|
|
1127
|
+
return s ? c`${bt(r, t, e)}<a href=${g(r.hrefs.school, { id: s.id })}>${s.name}</a>` : c`<span class="mut">TBD</span>`;
|
|
1128
|
+
}
|
|
1129
|
+
function yt(r, t, e = 5) {
|
|
1130
|
+
const s = r.records[t];
|
|
1131
|
+
if (!s || !s.results.length) return c`<span class="mut">·</span>`;
|
|
1132
|
+
const a = s.results.slice(-1 * e);
|
|
1133
|
+
return c`<span class="dots" role="img" aria-label="last ${a.length} results">
|
|
1134
|
+
${a.map((o) => c`<a class="dot ${o.mark}"
|
|
1135
|
+
title="${o.mark} ${o.my}-${o.their} vs ${C(r, o.opp)}"
|
|
1136
|
+
href=${g(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1126
1137
|
</span>`;
|
|
1127
1138
|
}
|
|
1128
|
-
function q(
|
|
1129
|
-
return
|
|
1139
|
+
function q(r, t) {
|
|
1140
|
+
return r.querySelector(':scope > [slot="rail"]') ? c`<div class="view withrail">
|
|
1130
1141
|
<div class="viewmain">${t}</div>
|
|
1131
1142
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1132
|
-
</div>` :
|
|
1143
|
+
</div>` : c`<div class="view">${t}</div>`;
|
|
1133
1144
|
}
|
|
1134
|
-
function G(
|
|
1135
|
-
if (!
|
|
1136
|
-
const t =
|
|
1137
|
-
return
|
|
1145
|
+
function G(r) {
|
|
1146
|
+
if (!r.promoImage) return m;
|
|
1147
|
+
const t = c`<img src=${r.promoImage} alt=${r.promoAlt || "Sponsor"}>`;
|
|
1148
|
+
return c`<div class="promo">${r.promoHref ? c`<a href=${r.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1138
1149
|
}
|
|
1139
|
-
function J(
|
|
1140
|
-
const t =
|
|
1141
|
-
return
|
|
1150
|
+
function J(r) {
|
|
1151
|
+
const t = Wt(r);
|
|
1152
|
+
return c`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1142
1153
|
}
|
|
1143
|
-
function
|
|
1144
|
-
if (!t) return
|
|
1145
|
-
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId,
|
|
1146
|
-
return
|
|
1154
|
+
function Kt(r, t, e) {
|
|
1155
|
+
if (!t) return c`<span class="mut">·</span>`;
|
|
1156
|
+
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
|
|
1157
|
+
return c`${t.state === "live" ? c`<span class="pill live">Live</span> ` : c`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${Z(r, s)}`;
|
|
1147
1158
|
}
|
|
1148
|
-
class
|
|
1159
|
+
class Qt extends w {
|
|
1149
1160
|
static styles = j;
|
|
1150
1161
|
static properties = {
|
|
1151
1162
|
...w.properties,
|
|
@@ -1164,17 +1175,17 @@ class Kt extends w {
|
|
|
1164
1175
|
this._datePinned = !!this.date;
|
|
1165
1176
|
}
|
|
1166
1177
|
async fetchData(t) {
|
|
1167
|
-
const e = this.season || et(), [s,
|
|
1178
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1168
1179
|
t.listSchools(),
|
|
1169
1180
|
t.listTeams({ sport: this.sport }),
|
|
1170
1181
|
t.listConferences(),
|
|
1171
1182
|
t.listGames({ sport: this.sport, season: e }),
|
|
1172
1183
|
t.listRankings({ sport: this.sport })
|
|
1173
1184
|
]);
|
|
1174
|
-
return this._datePinned || (this.date =
|
|
1185
|
+
return this._datePinned || (this.date = Ie(i.items.map((d) => d.date)), this._datePinned = !0), {
|
|
1175
1186
|
season: e,
|
|
1176
1187
|
schools: s.items,
|
|
1177
|
-
teams:
|
|
1188
|
+
teams: a.items,
|
|
1178
1189
|
conferences: o.items,
|
|
1179
1190
|
games: i.items,
|
|
1180
1191
|
rankings: n.items
|
|
@@ -1191,30 +1202,30 @@ class Kt extends w {
|
|
|
1191
1202
|
}, this._ctxData = this.data), this._ctx;
|
|
1192
1203
|
}
|
|
1193
1204
|
renderView() {
|
|
1194
|
-
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((
|
|
1195
|
-
const h = [
|
|
1196
|
-
return h.length ? Math.min(...h) :
|
|
1197
|
-
}, i = this.data.games.filter((
|
|
1198
|
-
i.sort((
|
|
1205
|
+
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(), a = Number.MAX_SAFE_INTEGER, o = (l) => {
|
|
1206
|
+
const h = [l.awayTeamId, l.homeTeamId].map((p) => vt(t.rankings, t.teamsById, p, this.sport, l.date)).filter(Boolean);
|
|
1207
|
+
return h.length ? Math.min(...h) : a;
|
|
1208
|
+
}, i = this.data.games.filter((l) => l.date === this.date), n = new Map(i.map((l) => [l, o(l)]));
|
|
1209
|
+
i.sort((l, h) => (l.state === "live" ? 0 : 1) - (h.state === "live" ? 0 : 1) || n.get(l) - n.get(h));
|
|
1199
1210
|
const d = /* @__PURE__ */ new Map();
|
|
1200
|
-
return i.forEach((
|
|
1201
|
-
const h =
|
|
1202
|
-
d.has(h) || d.set(h, []), d.get(h).push(
|
|
1203
|
-
}),
|
|
1211
|
+
return i.forEach((l) => {
|
|
1212
|
+
const h = l.gameType === "conference" && l.conferenceId ? e[l.conferenceId]?.name || "Conference" : l.gameType === "playoff" ? "Playoffs" : l.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1213
|
+
d.has(h) || d.set(h, []), d.get(h).push(l);
|
|
1214
|
+
}), c`
|
|
1204
1215
|
${$t(this, t, {
|
|
1205
|
-
title:
|
|
1206
|
-
sub:
|
|
1216
|
+
title: c`${z(this.sport)} scores & schedules`,
|
|
1217
|
+
sub: c`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${i.length} games`,
|
|
1207
1218
|
teams: this.data.teams
|
|
1208
1219
|
})}
|
|
1209
|
-
${q(this,
|
|
1220
|
+
${q(this, c`
|
|
1210
1221
|
${G(this)}
|
|
1211
1222
|
<div class="toolbar">
|
|
1212
1223
|
<label class="asof" for="datesel">Date</label>
|
|
1213
|
-
<select id="datesel" @change=${(
|
|
1214
|
-
this.date =
|
|
1224
|
+
<select id="datesel" @change=${(l) => {
|
|
1225
|
+
this.date = l.target.value;
|
|
1215
1226
|
}}>
|
|
1216
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((
|
|
1217
|
-
${y(
|
|
1227
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((l) => c`<option value=${l} ?selected=${l === this.date}>
|
|
1228
|
+
${y(l, { weekday: "short", month: "short", day: "numeric" })}${l === mt() ? " · today" : ""}
|
|
1218
1229
|
</option>`)}
|
|
1219
1230
|
</select>
|
|
1220
1231
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1228,9 +1239,9 @@ class Kt extends w {
|
|
|
1228
1239
|
<span class="spacer"></span>
|
|
1229
1240
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1230
1241
|
</div>
|
|
1231
|
-
${i.length ? m :
|
|
1232
|
-
${[...d.entries()].map(([
|
|
1233
|
-
<div class="section-title">${
|
|
1242
|
+
${i.length ? m : c`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1243
|
+
${[...d.entries()].map(([l, h]) => c`
|
|
1244
|
+
<div class="section-title">${l}</div>
|
|
1234
1245
|
<div class="card"><ul class="gamelist">
|
|
1235
1246
|
${h.map((p) => this.renderGame(t, p))}
|
|
1236
1247
|
</ul></div>
|
|
@@ -1242,21 +1253,21 @@ class Kt extends w {
|
|
|
1242
1253
|
// a lone score column on the far right read as detached from the teams).
|
|
1243
1254
|
// Scheduled games carry their start time on the status pill alone.
|
|
1244
1255
|
renderGame(t, e) {
|
|
1245
|
-
const s = e.state === "final" || e.state === "live",
|
|
1246
|
-
return
|
|
1256
|
+
const s = e.state === "final" || e.state === "live", a = (i, n, d = m) => c`<span class="side">${Yt(t, i, e.date)}${s ? c`<span class="score">${n}</span>` : m}${d}</span>`, o = Le(e);
|
|
1257
|
+
return c`
|
|
1247
1258
|
<li>
|
|
1248
1259
|
${J(e)}
|
|
1249
|
-
<span class="opp matchup">${
|
|
1250
|
-
${o ?
|
|
1260
|
+
<span class="opp matchup">${a(e.awayTeamId, e.awayScore, c`<span class="at">at</span>`)}${a(e.homeTeamId, e.homeScore)}</span>
|
|
1261
|
+
${o ? c`<span class="ff">${C(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1251
1262
|
<span class="where">${e.venue || ""}</span>
|
|
1252
|
-
${e.broadcast ?
|
|
1263
|
+
${e.broadcast ? c`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1253
1264
|
<a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1254
1265
|
</li>
|
|
1255
1266
|
`;
|
|
1256
1267
|
}
|
|
1257
1268
|
}
|
|
1258
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1259
|
-
class
|
|
1269
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Qt);
|
|
1270
|
+
class Zt extends w {
|
|
1260
1271
|
static styles = j;
|
|
1261
1272
|
static properties = {
|
|
1262
1273
|
...w.properties,
|
|
@@ -1269,7 +1280,7 @@ class Qt extends w {
|
|
|
1269
1280
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1270
1281
|
}
|
|
1271
1282
|
async fetchData(t) {
|
|
1272
|
-
const e = this.season || et(), [s,
|
|
1283
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1273
1284
|
t.listConferences({ active: !0 }),
|
|
1274
1285
|
t.listSchools(),
|
|
1275
1286
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1279,7 +1290,7 @@ class Qt extends w {
|
|
|
1279
1290
|
return {
|
|
1280
1291
|
season: e,
|
|
1281
1292
|
conferences: s.items,
|
|
1282
|
-
schools:
|
|
1293
|
+
schools: a.items,
|
|
1283
1294
|
teams: o.items,
|
|
1284
1295
|
games: i.items,
|
|
1285
1296
|
rankings: n.items
|
|
@@ -1296,42 +1307,42 @@ class Qt extends w {
|
|
|
1296
1307
|
}, this._ctxData = this.data), this._ctx;
|
|
1297
1308
|
}
|
|
1298
1309
|
renderView() {
|
|
1299
|
-
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((
|
|
1300
|
-
return
|
|
1310
|
+
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((a) => a.classifications || []))].sort(zt)].slice(0, 9), s = this.data.conferences.filter((a) => a.active !== !1).filter((a) => this.classFilter === "All" || (a.classifications || []).includes(this.classFilter)).sort(Ee);
|
|
1311
|
+
return c`
|
|
1301
1312
|
${$t(this, t, {
|
|
1302
|
-
title:
|
|
1303
|
-
sub:
|
|
1313
|
+
title: c`${z(this.sport)} standings`,
|
|
1314
|
+
sub: c`${this.data.season} season · every conference, computed live from reported results`,
|
|
1304
1315
|
teams: this.data.teams
|
|
1305
1316
|
})}
|
|
1306
|
-
${q(this,
|
|
1317
|
+
${q(this, c`
|
|
1307
1318
|
${G(this)}
|
|
1308
1319
|
<div class="toolbar">
|
|
1309
1320
|
<div role="group" aria-label="Classification filter">
|
|
1310
|
-
${e.map((
|
|
1321
|
+
${e.map((a) => c`<button class="chip ${this.classFilter === a ? "on" : ""}"
|
|
1311
1322
|
@click=${() => {
|
|
1312
|
-
this.classFilter =
|
|
1313
|
-
}}>${
|
|
1323
|
+
this.classFilter = a;
|
|
1324
|
+
}}>${a}</button>`)}
|
|
1314
1325
|
</div>
|
|
1315
1326
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
1316
|
-
.value=${this.query} @input=${(
|
|
1317
|
-
this.query =
|
|
1327
|
+
.value=${this.query} @input=${(a) => {
|
|
1328
|
+
this.query = a.target.value;
|
|
1318
1329
|
}}>
|
|
1319
1330
|
<span class="spacer"></span>
|
|
1320
1331
|
<span class="asof">Records through ${y(mt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1321
1332
|
</div>
|
|
1322
|
-
${s.map((
|
|
1333
|
+
${s.map((a) => this.renderConference(t, a))}
|
|
1323
1334
|
`)}
|
|
1324
1335
|
`;
|
|
1325
1336
|
}
|
|
1326
1337
|
renderConference(t, e) {
|
|
1327
1338
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1328
1339
|
if (!s.length) return m;
|
|
1329
|
-
const
|
|
1330
|
-
return
|
|
1340
|
+
const a = this.query.trim().toLowerCase(), o = Gt(s, t.records);
|
|
1341
|
+
return c`
|
|
1331
1342
|
<div class="card">
|
|
1332
1343
|
<div class="card-head">
|
|
1333
1344
|
<h2>${e.name}</h2>
|
|
1334
|
-
${
|
|
1345
|
+
${[...e.classifications || []].sort(zt).map((i) => c`<span class="pill class">${i}</span>`)}
|
|
1335
1346
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1336
1347
|
</div>
|
|
1337
1348
|
<div class="tablewrap"><table class="data">
|
|
@@ -1341,44 +1352,43 @@ class Qt extends w {
|
|
|
1341
1352
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1342
1353
|
</tr></thead>
|
|
1343
1354
|
<tbody>
|
|
1344
|
-
${o.map((i, n) => this.renderRow(t, i, n,
|
|
1355
|
+
${o.map((i, n) => this.renderRow(t, i, n, a))}
|
|
1345
1356
|
</tbody>
|
|
1346
1357
|
</table></div>
|
|
1347
1358
|
</div>
|
|
1348
1359
|
`;
|
|
1349
1360
|
}
|
|
1350
|
-
renderRow(t, e, s,
|
|
1361
|
+
renderRow(t, e, s, a) {
|
|
1351
1362
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1352
|
-
if (
|
|
1353
|
-
const n = e.rec.pf - e.rec.pa, d = gt(this.data.games, e.team.id),
|
|
1354
|
-
<span class="pill champ" title="${p.season} ${p.title} champion">★ ${p.season} ${p.title}</span>`), h = () => {
|
|
1363
|
+
if (a && !i.toLowerCase().includes(a)) return m;
|
|
1364
|
+
const n = e.rec.pf - e.rec.pa, d = gt(this.data.games, e.team.id), l = () => {
|
|
1355
1365
|
location.href = g(t.hrefs.school, { id: e.team.schoolId });
|
|
1356
1366
|
};
|
|
1357
|
-
return
|
|
1358
|
-
<tr class="rowlink" @click=${(
|
|
1359
|
-
|
|
1367
|
+
return c`
|
|
1368
|
+
<tr class="rowlink" @click=${(h) => {
|
|
1369
|
+
h.target.closest("a") || l();
|
|
1360
1370
|
}}>
|
|
1361
1371
|
<td class="mut">${s + 1}</td>
|
|
1362
1372
|
<td class="teamcell">
|
|
1363
1373
|
${H(o)}${bt(t, e.team.id, null)}
|
|
1364
|
-
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a>
|
|
1374
|
+
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a>
|
|
1365
1375
|
</td>
|
|
1366
1376
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1367
|
-
<td class="num">${
|
|
1377
|
+
<td class="num">${Bt(e.confPct)}</td>
|
|
1368
1378
|
<td class="num">${x(e.rec)}</td>
|
|
1369
|
-
<td class="num">${
|
|
1379
|
+
<td class="num">${Bt(e.overallPct)}</td>
|
|
1370
1380
|
<td class="num">${e.rec.pf}</td>
|
|
1371
1381
|
<td class="num">${e.rec.pa}</td>
|
|
1372
1382
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1373
1383
|
<td>${st(e.rec.results) || "·"}</td>
|
|
1374
1384
|
<td>${yt(t, e.team.id)}</td>
|
|
1375
|
-
<td>${
|
|
1385
|
+
<td>${Kt(t, d, e.team.id)}</td>
|
|
1376
1386
|
</tr>
|
|
1377
1387
|
`;
|
|
1378
1388
|
}
|
|
1379
1389
|
}
|
|
1380
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1381
|
-
const
|
|
1390
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Zt);
|
|
1391
|
+
const Ge = b`
|
|
1382
1392
|
.hero1 {
|
|
1383
1393
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1384
1394
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1395,8 +1405,8 @@ const We = b`
|
|
|
1395
1405
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1396
1406
|
.sparkline { vertical-align: middle; }
|
|
1397
1407
|
`;
|
|
1398
|
-
class
|
|
1399
|
-
static styles = [...j,
|
|
1408
|
+
class Jt extends w {
|
|
1409
|
+
static styles = [...j, Ge];
|
|
1400
1410
|
static properties = {
|
|
1401
1411
|
...w.properties,
|
|
1402
1412
|
sport: { type: String },
|
|
@@ -1413,17 +1423,17 @@ class Zt extends w {
|
|
|
1413
1423
|
t && (this.pollDate = t);
|
|
1414
1424
|
}
|
|
1415
1425
|
async fetchData(t) {
|
|
1416
|
-
const e = this.season || et(), [s,
|
|
1426
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1417
1427
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1418
1428
|
t.listSchools(),
|
|
1419
1429
|
t.listTeams({ sport: this.sport }),
|
|
1420
1430
|
t.listConferences(),
|
|
1421
1431
|
t.listGames({ sport: this.sport, season: e })
|
|
1422
|
-
]), d = s.items.filter((
|
|
1432
|
+
]), d = s.items.filter((l) => !this.gender || !l.gender || l.gender === this.gender).sort((l, h) => h.effectiveDate.localeCompare(l.effectiveDate));
|
|
1423
1433
|
return {
|
|
1424
1434
|
season: e,
|
|
1425
1435
|
polls: d,
|
|
1426
|
-
schools:
|
|
1436
|
+
schools: a.items,
|
|
1427
1437
|
teams: o.items,
|
|
1428
1438
|
conferences: i.items,
|
|
1429
1439
|
games: n.items
|
|
@@ -1443,42 +1453,42 @@ class Zt extends w {
|
|
|
1443
1453
|
const n = e.map((p, f) => {
|
|
1444
1454
|
const u = (p.teamIds || []).indexOf(t);
|
|
1445
1455
|
if (u === -1) return null;
|
|
1446
|
-
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1447
|
-
return { x: $, y:
|
|
1456
|
+
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, rt = 3 + u / 24 * 20;
|
|
1457
|
+
return { x: $, y: rt };
|
|
1448
1458
|
}), d = [];
|
|
1449
|
-
let
|
|
1459
|
+
let l = [];
|
|
1450
1460
|
if (n.forEach((p) => {
|
|
1451
|
-
p ?
|
|
1452
|
-
}),
|
|
1461
|
+
p ? l.push(p) : l.length && (d.push(l), l = []);
|
|
1462
|
+
}), l.length && d.push(l), !d.length) return m;
|
|
1453
1463
|
const h = n[s];
|
|
1454
|
-
return
|
|
1464
|
+
return c`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1455
1465
|
${d.map((p) => Pt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1456
1466
|
points=${p.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1457
1467
|
${h ? Pt`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1458
1468
|
</svg>`;
|
|
1459
1469
|
}
|
|
1460
1470
|
movement(t, e, s) {
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1471
|
+
const a = je(t, e, s);
|
|
1472
|
+
return a.kind === "up" ? c`<span class="delta up">▲ ${a.delta}</span>` : a.kind === "down" ? c`<span class="delta down">▼ ${a.delta}</span>` : a.kind === "new" ? c`<span class="delta new">NEW</span>` : a.kind === "same" ? c`<span class="delta same">—</span>` : c`<span class="delta same">·</span>`;
|
|
1463
1473
|
}
|
|
1464
1474
|
renderView() {
|
|
1465
1475
|
const t = this.ctx, e = this.data.polls;
|
|
1466
|
-
if (!e.length) return
|
|
1467
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)),
|
|
1468
|
-
return
|
|
1476
|
+
if (!e.length) return c`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1477
|
+
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), a = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(a), d = v(this.data.conferences), l = (a.teamIds || [])[0], h = l ? O(t, l) : null;
|
|
1478
|
+
return c`
|
|
1469
1479
|
${$t(this, t, {
|
|
1470
|
-
title:
|
|
1471
|
-
sub:
|
|
1480
|
+
title: c`${z(this.sport)} Top 25`,
|
|
1481
|
+
sub: c`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1472
1482
|
teams: this.data.teams
|
|
1473
1483
|
})}
|
|
1474
|
-
${q(this,
|
|
1484
|
+
${q(this, c`
|
|
1475
1485
|
${G(this)}
|
|
1476
1486
|
<div class="toolbar">
|
|
1477
1487
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1478
1488
|
<select id="pollsel" @change=${(p) => {
|
|
1479
1489
|
this.pollDate = p.target.value;
|
|
1480
1490
|
}}>
|
|
1481
|
-
${e.map((p, f) =>
|
|
1491
|
+
${e.map((p, f) => c`<option value=${p.effectiveDate} ?selected=${p === a}>
|
|
1482
1492
|
${y(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1483
1493
|
</option>`)}
|
|
1484
1494
|
</select>
|
|
@@ -1493,65 +1503,65 @@ class Zt extends w {
|
|
|
1493
1503
|
<span class="spacer"></span>
|
|
1494
1504
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1495
1505
|
</div>
|
|
1496
|
-
${h ? this.renderHero(t,
|
|
1506
|
+
${h ? this.renderHero(t, a, o, l, h, d) : m}
|
|
1497
1507
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1498
1508
|
<thead><tr>
|
|
1499
1509
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1500
1510
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1501
1511
|
</tr></thead>
|
|
1502
1512
|
<tbody>
|
|
1503
|
-
${(
|
|
1513
|
+
${(a.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, a, o, i, n, d, p, f + 1))}
|
|
1504
1514
|
</tbody>
|
|
1505
1515
|
</table></div></div>
|
|
1506
1516
|
<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>
|
|
1507
1517
|
`)}
|
|
1508
1518
|
`;
|
|
1509
1519
|
}
|
|
1510
|
-
renderHero(t, e, s,
|
|
1511
|
-
const n = t.records[
|
|
1512
|
-
return
|
|
1520
|
+
renderHero(t, e, s, a, o, i) {
|
|
1521
|
+
const n = t.records[a], d = Ft(t.records, a), l = i[t.teamsById[a]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1522
|
+
return c`
|
|
1513
1523
|
<div class="hero1" style="background:${h}">
|
|
1514
1524
|
<div class="bigrank">#1</div>
|
|
1515
1525
|
${H(o, 64)}
|
|
1516
1526
|
<div>
|
|
1517
1527
|
<h2><a href=${g(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1518
1528
|
<div class="facts">
|
|
1519
|
-
${x(n)} overall${
|
|
1529
|
+
${x(n)} overall${l ? c` · ${x(n, !0)} ${l.name}` : m}
|
|
1520
1530
|
· streak ${st(n?.results) || "·"}
|
|
1521
|
-
${d ?
|
|
1522
|
-
${this.movement(e, s,
|
|
1531
|
+
${d ? c` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
|
|
1532
|
+
${this.movement(e, s, a)}
|
|
1523
1533
|
</div>
|
|
1524
1534
|
</div>
|
|
1525
1535
|
</div>
|
|
1526
1536
|
`;
|
|
1527
1537
|
}
|
|
1528
|
-
renderRow(t, e, s,
|
|
1529
|
-
const
|
|
1530
|
-
if (!
|
|
1531
|
-
const h = t.records[n], p =
|
|
1532
|
-
location.href = g(t.hrefs.school, { id:
|
|
1538
|
+
renderRow(t, e, s, a, o, i, n, d) {
|
|
1539
|
+
const l = O(t, n);
|
|
1540
|
+
if (!l) return m;
|
|
1541
|
+
const h = t.records[n], p = Ft(t.records, n), f = gt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
|
|
1542
|
+
location.href = g(t.hrefs.school, { id: l.id });
|
|
1533
1543
|
};
|
|
1534
|
-
return
|
|
1535
|
-
<tr class="rowlink" @click=${(
|
|
1536
|
-
|
|
1544
|
+
return c`
|
|
1545
|
+
<tr class="rowlink" @click=${(rt) => {
|
|
1546
|
+
rt.target.closest("a") || $();
|
|
1537
1547
|
}}>
|
|
1538
1548
|
<td class="num" style="font-weight:700">${d}</td>
|
|
1539
1549
|
<td>${this.movement(e, s, n)}</td>
|
|
1540
|
-
<td class="teamcell">${H(
|
|
1541
|
-
<span class="mut" style="font-size:0.78rem">${
|
|
1550
|
+
<td class="teamcell">${H(l)}<a href=${g(t.hrefs.school, { id: l.id })}>${l.name}</a>
|
|
1551
|
+
<span class="mut" style="font-size:0.78rem">${l.mascot || ""}</span></td>
|
|
1542
1552
|
<td class="num">${x(h)}</td>
|
|
1543
1553
|
<td class="mut">${u?.name || "Independent"}</td>
|
|
1544
|
-
<td>${p ?
|
|
1554
|
+
<td>${p ? c`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1545
1555
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1546
|
-
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` :
|
|
1547
|
-
<td>${
|
|
1548
|
-
<td>${this.sparkline(n,
|
|
1556
|
+
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : c`<span class="mut">·</span>`}</td>
|
|
1557
|
+
<td>${Kt(t, f, n)}</td>
|
|
1558
|
+
<td>${this.sparkline(n, a, o)}</td>
|
|
1549
1559
|
</tr>
|
|
1550
1560
|
`;
|
|
1551
1561
|
}
|
|
1552
1562
|
}
|
|
1553
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1554
|
-
const
|
|
1563
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Jt);
|
|
1564
|
+
const Ve = b`
|
|
1555
1565
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1556
1566
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1557
1567
|
.schoolhero .crest {
|
|
@@ -1580,8 +1590,8 @@ const qe = b`
|
|
|
1580
1590
|
.rosterphoto { display: block; width: 100%; height: auto; background: var(--hsot-gray-1); border-bottom: 1px solid var(--hsot-gray-2); }
|
|
1581
1591
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1582
1592
|
`;
|
|
1583
|
-
class
|
|
1584
|
-
static styles = [...j,
|
|
1593
|
+
class Xt extends w {
|
|
1594
|
+
static styles = [...j, Ve];
|
|
1585
1595
|
static properties = {
|
|
1586
1596
|
...w.properties,
|
|
1587
1597
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1598,7 +1608,7 @@ class Jt extends w {
|
|
|
1598
1608
|
t && !this.sport && (this.sport = t);
|
|
1599
1609
|
}
|
|
1600
1610
|
async fetchData(t) {
|
|
1601
|
-
const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, d,
|
|
1611
|
+
const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, d, l, h, p, f, u] = await Promise.all([
|
|
1602
1612
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1603
1613
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1604
1614
|
t.listSchools(),
|
|
@@ -1616,7 +1626,7 @@ class Jt extends w {
|
|
|
1616
1626
|
active: i,
|
|
1617
1627
|
games: n.items,
|
|
1618
1628
|
allTeams: d.items,
|
|
1619
|
-
schools:
|
|
1629
|
+
schools: l.items,
|
|
1620
1630
|
conferences: h.items,
|
|
1621
1631
|
rankings: p.items,
|
|
1622
1632
|
roster: f.items.find(($) => $.season === e) || null,
|
|
@@ -1637,87 +1647,87 @@ class Jt extends w {
|
|
|
1637
1647
|
this.sport = t, this.load();
|
|
1638
1648
|
}
|
|
1639
1649
|
renderView() {
|
|
1640
|
-
const { school: t, teams: e, active: s, season:
|
|
1641
|
-
if (!t) return
|
|
1642
|
-
const o = this.ctx, i = K(t.colorPrimary || "#030711"), n = (t.adm || [])[0], d = v(this.data.conferences),
|
|
1643
|
-
return
|
|
1650
|
+
const { school: t, teams: e, active: s, season: a } = this.data;
|
|
1651
|
+
if (!t) return c`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1652
|
+
const o = this.ctx, i = K(t.colorPrimary || "#030711"), n = (t.adm || [])[0], d = v(this.data.conferences), l = s ? d[s.conferenceId] : null;
|
|
1653
|
+
return c`
|
|
1644
1654
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1645
1655
|
<div class="inner">
|
|
1646
|
-
${Q(t, 84) ?
|
|
1656
|
+
${Q(t, 84) ? c`<img class="crest logo" alt="" loading="lazy" src=${Q(t, 84)} />` : c`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${K(t.colorSecondary || "#7C7C7C")}">${ft(t)}</div>`}
|
|
1647
1657
|
<div style="min-width:260px">
|
|
1648
1658
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1649
1659
|
<div class="facts">
|
|
1650
|
-
${t.location ?
|
|
1651
|
-
${t.association ?
|
|
1652
|
-
${
|
|
1653
|
-
${n ?
|
|
1654
|
-
${t.openingYear ?
|
|
1655
|
-
${t.areaCode ?
|
|
1660
|
+
${t.location ? c`<span><b>Location</b>${t.location}${t.county ? c` · ${t.county} County` : m}</span>` : m}
|
|
1661
|
+
${t.association ? c`<span><b>League</b>${t.association}${t.classification ? c` · ${t.classification}` : m}</span>` : m}
|
|
1662
|
+
${l ? c`<span><b>Conference</b>${l.name}</span>` : m}
|
|
1663
|
+
${n ? c`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
|
|
1664
|
+
${t.openingYear ? c`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1665
|
+
${t.areaCode ? c`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1656
1666
|
</div>
|
|
1657
1667
|
</div>
|
|
1658
1668
|
</div>
|
|
1659
1669
|
</div>
|
|
1660
1670
|
<div class="band">
|
|
1661
1671
|
<nav class="tabs" aria-label="Teams">
|
|
1662
|
-
${e.map((h) => h.id === s?.id ?
|
|
1672
|
+
${e.map((h) => h.id === s?.id ? c`<a class="on" href="#" @click=${(p) => p.preventDefault()}>${h.name}</a>` : c`<a href="#" @click=${(p) => {
|
|
1663
1673
|
p.preventDefault(), this.switchSport(h.sport);
|
|
1664
1674
|
}}>${h.name}</a>`)}
|
|
1665
1675
|
</nav>
|
|
1666
1676
|
</div>
|
|
1667
|
-
${q(this,
|
|
1677
|
+
${q(this, c`
|
|
1668
1678
|
${G(this)}
|
|
1669
|
-
${s ? this.renderTeam(o, s,
|
|
1679
|
+
${s ? this.renderTeam(o, s, l, a) : c`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1670
1680
|
`)}
|
|
1671
1681
|
`;
|
|
1672
1682
|
}
|
|
1673
|
-
renderTeam(t, e, s,
|
|
1674
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ?
|
|
1675
|
-
return
|
|
1683
|
+
renderTeam(t, e, s, a) {
|
|
1684
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? Gt(n, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, l = vt(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, f) => String(p.date).localeCompare(String(f.date)));
|
|
1685
|
+
return c`
|
|
1676
1686
|
<div class="tiles">
|
|
1677
1687
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1678
1688
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1679
|
-
<div class="s">${d ? `${
|
|
1689
|
+
<div class="s">${d ? `${Ce(d)} of ${n.length}` : "·"}</div></div>
|
|
1680
1690
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1681
1691
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1682
1692
|
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
1683
1693
|
<div class="s">last 5: ${yt(t, e.id)}</div></div>
|
|
1684
|
-
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${
|
|
1694
|
+
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${l ? `#${l}` : "NR"}</div>
|
|
1685
1695
|
<div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1686
1696
|
</div>
|
|
1687
|
-
${(e.championships || []).length ?
|
|
1697
|
+
${(e.championships || []).length ? c`
|
|
1688
1698
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1689
|
-
${e.championships.map((p) =>
|
|
1699
|
+
${e.championships.map((p) => c`<span class="pill champ">★ ${p.season} ${p.title} champion${p.classification ? ` · ${p.classification}` : ""}${p.region ? ` · ${p.region}` : ""}</span>`)}
|
|
1690
1700
|
</div>` : m}
|
|
1691
1701
|
<div class="cols">
|
|
1692
1702
|
<div>
|
|
1693
1703
|
<div class="section-title">Schedule & results</div>
|
|
1694
1704
|
<div class="card">
|
|
1695
|
-
${h.length ?
|
|
1705
|
+
${h.length ? c`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : c`<p class="empty">No ${e.sport} games recorded for ${a}.</p>`}
|
|
1696
1706
|
</div>
|
|
1697
1707
|
</div>
|
|
1698
1708
|
<div>
|
|
1699
|
-
<div class="section-title">Roster · ${
|
|
1700
|
-
<div class="card">${this.renderRoster(e,
|
|
1709
|
+
<div class="section-title">Roster · ${a}</div>
|
|
1710
|
+
<div class="card">${this.renderRoster(e, a)}</div>
|
|
1701
1711
|
</div>
|
|
1702
1712
|
</div>
|
|
1703
1713
|
`;
|
|
1704
1714
|
}
|
|
1705
1715
|
renderGameRow(t, e, s) {
|
|
1706
|
-
const
|
|
1707
|
-
let d =
|
|
1716
|
+
const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
|
|
1717
|
+
let d = c`<span class="mut">${pt(s.time)}</span>`;
|
|
1708
1718
|
if (s.state === "final") {
|
|
1709
|
-
const h = ut(s), p = h === "tie" ? "T" : h === (
|
|
1710
|
-
d =
|
|
1711
|
-
} else s.state === "live" && (d =
|
|
1712
|
-
const
|
|
1713
|
-
return
|
|
1719
|
+
const h = ut(s), p = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
|
|
1720
|
+
d = c`<span class=${p}>${p}</span> ${i}-${n}${s.finish === "overtime" ? c` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? c` <span class="mut">FF</span>` : m}`;
|
|
1721
|
+
} else s.state === "live" && (d = c`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1722
|
+
const l = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1723
|
+
return c`
|
|
1714
1724
|
<li>
|
|
1715
1725
|
<span class="d">${y(s.date)}</span>
|
|
1716
|
-
${
|
|
1726
|
+
${Wt(s).kind === "sched" ? m : J(s)}
|
|
1717
1727
|
<span class="res">${d}</span>
|
|
1718
|
-
<span class="opp">${
|
|
1719
|
-
<span class="pill type">${
|
|
1720
|
-
${s.broadcast ?
|
|
1728
|
+
<span class="opp">${a ? "vs" : "at"} ${Yt(t, o, s.date)}
|
|
1729
|
+
<span class="pill type">${l}</span>
|
|
1730
|
+
${s.broadcast ? c`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1721
1731
|
</span>
|
|
1722
1732
|
<span class="where">${s.venue || ""}</span>
|
|
1723
1733
|
<a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
@@ -1727,24 +1737,24 @@ class Jt extends w {
|
|
|
1727
1737
|
renderRoster(t, e) {
|
|
1728
1738
|
const s = this.data.roster;
|
|
1729
1739
|
if (!s)
|
|
1730
|
-
return
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1733
|
-
${
|
|
1740
|
+
return c`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1741
|
+
const a = qe(s, 560), o = this.data.school?.name || "", i = v(this.data.players), n = s.entries.slice().sort((l, h) => (l.number || 0) - (h.number || 0)), d = n.some((l) => i[l.playerId]?.college);
|
|
1742
|
+
return c`
|
|
1743
|
+
${a ? c`<img class="rosterphoto" src=${a} loading="lazy" decoding="async"
|
|
1734
1744
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1735
1745
|
<div class="tablewrap"><table class="data">
|
|
1736
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${d ?
|
|
1746
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${d ? c`<th>College</th>` : m}</tr></thead>
|
|
1737
1747
|
<tbody>
|
|
1738
|
-
${n.map((
|
|
1739
|
-
const h = i[
|
|
1740
|
-
return h ?
|
|
1741
|
-
<td class="num mut">${
|
|
1748
|
+
${n.map((l) => {
|
|
1749
|
+
const h = i[l.playerId];
|
|
1750
|
+
return h ? c`<tr>
|
|
1751
|
+
<td class="num mut">${l.number ?? "·"}</td>
|
|
1742
1752
|
<td style="font-weight:500">${h.firstName} ${h.lastName}</td>
|
|
1743
|
-
<td>${
|
|
1753
|
+
<td>${l.position || "·"}</td>
|
|
1744
1754
|
<td class="mut">${h.classOf || "·"}</td>
|
|
1745
|
-
<td class="num">${
|
|
1755
|
+
<td class="num">${Te(h.heightIn)}</td>
|
|
1746
1756
|
<td class="num">${h.weightLb || "·"}</td>
|
|
1747
|
-
${d ?
|
|
1757
|
+
${d ? c`<td>${h.college || "·"}</td>` : m}
|
|
1748
1758
|
</tr>` : m;
|
|
1749
1759
|
})}
|
|
1750
1760
|
</tbody>
|
|
@@ -1752,37 +1762,37 @@ class Jt extends w {
|
|
|
1752
1762
|
`;
|
|
1753
1763
|
}
|
|
1754
1764
|
}
|
|
1755
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1756
|
-
const
|
|
1757
|
-
function
|
|
1758
|
-
return
|
|
1765
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Xt);
|
|
1766
|
+
const Ye = "https://api.wral.com/search";
|
|
1767
|
+
function Ke(r) {
|
|
1768
|
+
return r.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1759
1769
|
}
|
|
1760
|
-
function
|
|
1761
|
-
const e = String(
|
|
1770
|
+
function Qe(r, t) {
|
|
1771
|
+
const e = String(r || Ye).replace(/\/+$/, ""), s = new URLSearchParams({ query: Ke(t), sort: "score", lang: "en" });
|
|
1762
1772
|
return `${e}/v1/query?${s}`;
|
|
1763
1773
|
}
|
|
1764
|
-
function
|
|
1774
|
+
function te(r) {
|
|
1765
1775
|
try {
|
|
1766
|
-
const t = new URL(
|
|
1776
|
+
const t = new URL(r);
|
|
1767
1777
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
1768
1778
|
const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
|
|
1769
1779
|
return {
|
|
1770
|
-
uri:
|
|
1771
|
-
title: s ?
|
|
1780
|
+
uri: r,
|
|
1781
|
+
title: s ? r : decodeURIComponent(e).replace(/-/g, " "),
|
|
1772
1782
|
photos: !0
|
|
1773
1783
|
};
|
|
1774
1784
|
}
|
|
1775
1785
|
} catch {
|
|
1776
1786
|
}
|
|
1777
|
-
return { uri:
|
|
1787
|
+
return { uri: r, title: r };
|
|
1778
1788
|
}
|
|
1779
|
-
async function
|
|
1780
|
-
const
|
|
1781
|
-
if (!
|
|
1782
|
-
const o = await
|
|
1783
|
-
return t.map((n) => i.get(n) ||
|
|
1789
|
+
async function Ze(r, t, e) {
|
|
1790
|
+
const a = await ((...n) => fetch(...n))(Qe(r, t));
|
|
1791
|
+
if (!a.ok) throw new Error(`search answered ${a.status}`);
|
|
1792
|
+
const o = await a.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1793
|
+
return t.map((n) => i.get(n) || te(n));
|
|
1784
1794
|
}
|
|
1785
|
-
const
|
|
1795
|
+
const Je = b`
|
|
1786
1796
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1787
1797
|
.breadcrumbs a { text-decoration: none; }
|
|
1788
1798
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1821,8 +1831,8 @@ const Qe = b`
|
|
|
1821
1831
|
.cols { grid-template-columns: 1fr; }
|
|
1822
1832
|
}
|
|
1823
1833
|
`;
|
|
1824
|
-
class
|
|
1825
|
-
static styles = [...j,
|
|
1834
|
+
class ee extends w {
|
|
1835
|
+
static styles = [...j, Je];
|
|
1826
1836
|
static properties = {
|
|
1827
1837
|
...w.properties,
|
|
1828
1838
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1836,7 +1846,7 @@ class te extends w {
|
|
|
1836
1846
|
super(), this.gameId = "", this.searchApi = "";
|
|
1837
1847
|
}
|
|
1838
1848
|
async fetchData(t) {
|
|
1839
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [
|
|
1849
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [a, o, i, n, d, l] = await Promise.all([
|
|
1840
1850
|
t.listSchools(),
|
|
1841
1851
|
t.listTeams({ sport: e.sport }),
|
|
1842
1852
|
t.listConferences(),
|
|
@@ -1844,16 +1854,16 @@ class te extends w {
|
|
|
1844
1854
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1845
1855
|
// A search outage must not blank the box score — degrade to bare
|
|
1846
1856
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1847
|
-
s.length ?
|
|
1857
|
+
s.length ? Ze(this.searchApi, s).catch(() => s.map(te)) : Promise.resolve([])
|
|
1848
1858
|
]);
|
|
1849
1859
|
return {
|
|
1850
1860
|
game: e,
|
|
1851
|
-
schools:
|
|
1861
|
+
schools: a.items,
|
|
1852
1862
|
teams: o.items,
|
|
1853
1863
|
conferences: i.items,
|
|
1854
1864
|
rankings: n.items,
|
|
1855
1865
|
games: d.items,
|
|
1856
|
-
coverage:
|
|
1866
|
+
coverage: l
|
|
1857
1867
|
};
|
|
1858
1868
|
}
|
|
1859
1869
|
get ctx() {
|
|
@@ -1868,10 +1878,10 @@ class te extends w {
|
|
|
1868
1878
|
}
|
|
1869
1879
|
renderView() {
|
|
1870
1880
|
const t = this.data.game;
|
|
1871
|
-
if (!t) return
|
|
1872
|
-
const e = this.ctx, s = v(this.data.conferences),
|
|
1873
|
-
return
|
|
1874
|
-
${q(this,
|
|
1881
|
+
if (!t) return c`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1882
|
+
const e = this.ctx, s = v(this.data.conferences), a = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ut(t), n = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", d = t.conferenceId ? s[t.conferenceId] : null, l = this.data.games.filter((h) => h.id !== t.id && h.state === "final" && h.gameType !== "scrimmage" && (h.homeTeamId === t.homeTeamId && h.awayTeamId === t.awayTeamId || h.homeTeamId === t.awayTeamId && h.awayTeamId === t.homeTeamId));
|
|
1883
|
+
return c`
|
|
1884
|
+
${q(this, c`
|
|
1875
1885
|
${G(this)}
|
|
1876
1886
|
<p class="breadcrumbs">
|
|
1877
1887
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${z(t.sport)}</a> /
|
|
@@ -1880,7 +1890,7 @@ class te extends w {
|
|
|
1880
1890
|
</p>
|
|
1881
1891
|
<div class="card">
|
|
1882
1892
|
<div class="scorehead">
|
|
1883
|
-
${this.teamBlock(e, t, t.awayTeamId,
|
|
1893
|
+
${this.teamBlock(e, t, t.awayTeamId, a, !1)}
|
|
1884
1894
|
<div class="mid">
|
|
1885
1895
|
<div class="bigscore">
|
|
1886
1896
|
<span style=${n("away")}>${t.awayScore}</span>
|
|
@@ -1888,29 +1898,29 @@ class te extends w {
|
|
|
1888
1898
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1889
1899
|
</div>
|
|
1890
1900
|
<div class="status">${J(t)}</div>
|
|
1891
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ?
|
|
1892
|
-
${t.broadcast ?
|
|
1901
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? c` · ${pt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1902
|
+
${t.broadcast ? c` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1893
1903
|
<div class="status">
|
|
1894
1904
|
<span class="pill type">${t.gameType === "conference" ? `${d?.name || "Conference"} game` : t.gameType}</span>
|
|
1895
|
-
${t.label ?
|
|
1896
|
-
${(t.tags || []).map((h) =>
|
|
1905
|
+
${t.label ? c`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
1906
|
+
${(t.tags || []).map((h) => c`<span class="pill type">${h}</span>`)}
|
|
1897
1907
|
</div>
|
|
1898
1908
|
</div>
|
|
1899
1909
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1900
1910
|
</div>
|
|
1901
|
-
${this.renderLineScore(t,
|
|
1902
|
-
${t.notes ?
|
|
1911
|
+
${this.renderLineScore(t, a, o)}
|
|
1912
|
+
${t.notes ? c`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1903
1913
|
</div>
|
|
1904
|
-
${(this.data.coverage || []).length ?
|
|
1914
|
+
${(this.data.coverage || []).length ? c`
|
|
1905
1915
|
<div class="section-title">Coverage</div>
|
|
1906
1916
|
<div class="covgrid">
|
|
1907
|
-
${this.data.coverage.map((h) =>
|
|
1917
|
+
${this.data.coverage.map((h) => c`
|
|
1908
1918
|
<a class="card covcard" href=${h.uri}>
|
|
1909
|
-
${h.image ?
|
|
1919
|
+
${h.image ? c`<img class="covimg" src=${h.image} alt="" loading="lazy" />` : m}
|
|
1910
1920
|
<div class="covbody">
|
|
1911
|
-
<div class="covtitle">${h.videoDuration ?
|
|
1912
|
-
${h.description ?
|
|
1913
|
-
${h.author || h.publishedTime ?
|
|
1921
|
+
<div class="covtitle">${h.videoDuration ? c`<span class="pill live" style="animation:none">Video</span> ` : m}${h.photos ? c`<span class="pill live" style="animation:none">Photos</span> ` : m}${h.title || h.uri}</div>
|
|
1922
|
+
${h.description ? c`<p class="covdesc">${h.description}</p>` : m}
|
|
1923
|
+
${h.author || h.publishedTime ? c`
|
|
1914
1924
|
<div class="covmeta">${[h.author, h.publishedTime ? new Date(h.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1915
1925
|
` : m}
|
|
1916
1926
|
</div>
|
|
@@ -1919,12 +1929,12 @@ class te extends w {
|
|
|
1919
1929
|
</div>` : m}
|
|
1920
1930
|
<div class="section-title">Season context</div>
|
|
1921
1931
|
<div class="cols">
|
|
1922
|
-
${[[t.awayTeamId,
|
|
1932
|
+
${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h, p]) => this.renderContext(e, h, p))}
|
|
1923
1933
|
</div>
|
|
1924
|
-
${
|
|
1934
|
+
${l.length ? c`
|
|
1925
1935
|
<div class="section-title">Head to head this season</div>
|
|
1926
1936
|
<div class="card"><ul class="gamelist">
|
|
1927
|
-
${
|
|
1937
|
+
${l.map((h) => c`<li>
|
|
1928
1938
|
<span class="d">${y(h.date)}</span>${J(h)}
|
|
1929
1939
|
<span class="opp">${C(e, h.awayTeamId)} ${h.awayScore}, ${C(e, h.homeTeamId)} ${h.homeScore}</span>
|
|
1930
1940
|
<a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
|
|
@@ -1933,36 +1943,36 @@ class te extends w {
|
|
|
1933
1943
|
`)}
|
|
1934
1944
|
`;
|
|
1935
1945
|
}
|
|
1936
|
-
teamBlock(t, e, s,
|
|
1937
|
-
if (!
|
|
1938
|
-
const i = t.teamsById[s], n = t.records[s], d = Q(
|
|
1939
|
-
return
|
|
1946
|
+
teamBlock(t, e, s, a, o) {
|
|
1947
|
+
if (!a) return c`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1948
|
+
const i = t.teamsById[s], n = t.records[s], d = Q(a, 58);
|
|
1949
|
+
return c`
|
|
1940
1950
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1941
|
-
${d ?
|
|
1951
|
+
${d ? c`<img class="crest logo" alt="" loading="lazy" src=${d} />` : c`<span class="crest" style="background:${a.colorPrimary || "#030711"};color:${K(a.colorPrimary || "#030711")}">${ft(a)}</span>`}
|
|
1942
1952
|
<div>
|
|
1943
|
-
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id:
|
|
1944
|
-
<div class="trec">${
|
|
1953
|
+
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: a.id })}>${a.name}</a></div>
|
|
1954
|
+
<div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ? c` · ${x(n, !0)} conf` : m}</div>
|
|
1945
1955
|
</div>
|
|
1946
1956
|
</div>
|
|
1947
1957
|
`;
|
|
1948
1958
|
}
|
|
1949
1959
|
renderLineScore(t, e, s) {
|
|
1950
|
-
const
|
|
1951
|
-
if (!
|
|
1952
|
-
return
|
|
1953
|
-
const o = Math.max(4, ...
|
|
1954
|
-
const p =
|
|
1955
|
-
return p ? p[
|
|
1956
|
-
}, d = (
|
|
1960
|
+
const a = t.periodScores || [];
|
|
1961
|
+
if (!a.length)
|
|
1962
|
+
return c`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1963
|
+
const o = Math.max(4, ...a.map((l) => l.period)), i = (l) => l <= 4 ? String(l) : `OT${l > 5 ? l - 4 : ""}`, n = (l, h) => {
|
|
1964
|
+
const p = a.find((f) => f.period === h);
|
|
1965
|
+
return p ? p[l] : t.state === "final" ? 0 : "·";
|
|
1966
|
+
}, d = (l, h, p) => c`
|
|
1957
1967
|
<tr>
|
|
1958
|
-
<td class="teamcell">${H(
|
|
1959
|
-
${Array.from({ length: o }, (f, u) =>
|
|
1968
|
+
<td class="teamcell">${H(l, 20)}${l?.abbr || "TBD"}</td>
|
|
1969
|
+
${Array.from({ length: o }, (f, u) => c`<td class="num">${n(h, u + 1)}</td>`)}
|
|
1960
1970
|
<td class="num" style="font-weight:700">${p}</td>
|
|
1961
1971
|
</tr>`;
|
|
1962
|
-
return
|
|
1972
|
+
return c`
|
|
1963
1973
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1964
1974
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1965
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (
|
|
1975
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (l, h) => c`<th class="num">${i(h + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1966
1976
|
<tbody>
|
|
1967
1977
|
${d(e, "away", t.awayScore)}
|
|
1968
1978
|
${d(s, "home", t.homeScore)}
|
|
@@ -1973,24 +1983,24 @@ class te extends w {
|
|
|
1973
1983
|
}
|
|
1974
1984
|
renderContext(t, e, s) {
|
|
1975
1985
|
if (!s) return m;
|
|
1976
|
-
const
|
|
1977
|
-
return
|
|
1986
|
+
const a = t.records[e], o = gt(this.data.games, e);
|
|
1987
|
+
return c`
|
|
1978
1988
|
<div class="card ctxcard">
|
|
1979
1989
|
<div class="who">${H(s)}${s.name}</div>
|
|
1980
1990
|
<div class="row">
|
|
1981
1991
|
<span>Last 5: ${yt(t, e)}</span>
|
|
1982
|
-
<span>Streak: <b>${
|
|
1983
|
-
<span>PF/PA: <b>${
|
|
1984
|
-
<span>Next: ${o ?
|
|
1992
|
+
<span>Streak: <b>${a ? st(a.results) : "·"}</b></span>
|
|
1993
|
+
<span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
|
|
1994
|
+
<span>Next: ${o ? c`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1985
1995
|
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1986
1996
|
</div>
|
|
1987
1997
|
</div>
|
|
1988
1998
|
`;
|
|
1989
1999
|
}
|
|
1990
2000
|
}
|
|
1991
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1992
|
-
const
|
|
1993
|
-
class
|
|
2001
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", ee);
|
|
2002
|
+
const Xe = 250, ts = 2;
|
|
2003
|
+
class se extends E {
|
|
1994
2004
|
static properties = {
|
|
1995
2005
|
api: { type: String },
|
|
1996
2006
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2070,11 +2080,11 @@ class ee extends E {
|
|
|
2070
2080
|
}
|
|
2071
2081
|
onInput(t) {
|
|
2072
2082
|
const e = t.target.value.trim();
|
|
2073
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2083
|
+
if (clearTimeout(this.debounceTimer), e.length < ts) {
|
|
2074
2084
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2075
2085
|
return;
|
|
2076
2086
|
}
|
|
2077
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2087
|
+
this.debounceTimer = setTimeout(() => this.search(e), Xe);
|
|
2078
2088
|
}
|
|
2079
2089
|
async search(t) {
|
|
2080
2090
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2084,8 +2094,8 @@ class ee extends E {
|
|
|
2084
2094
|
});
|
|
2085
2095
|
if (!s.ok)
|
|
2086
2096
|
return;
|
|
2087
|
-
const
|
|
2088
|
-
this.results =
|
|
2097
|
+
const a = await s.json();
|
|
2098
|
+
this.results = a.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
2089
2099
|
} catch (e) {
|
|
2090
2100
|
e.name !== "AbortError" && console.warn("school search failed", e);
|
|
2091
2101
|
}
|
|
@@ -2119,36 +2129,36 @@ class ee extends E {
|
|
|
2119
2129
|
return [t.location, t.county && `${t.county} County`].filter(Boolean).join(" — ");
|
|
2120
2130
|
}
|
|
2121
2131
|
renderOption(t, e) {
|
|
2122
|
-
const s = this.where(t),
|
|
2132
|
+
const s = this.where(t), a = (o) => {
|
|
2123
2133
|
o.preventDefault(), this.go(t);
|
|
2124
2134
|
};
|
|
2125
|
-
return
|
|
2135
|
+
return c`
|
|
2126
2136
|
<li
|
|
2127
2137
|
id="school-option-${e}"
|
|
2128
2138
|
role="option"
|
|
2129
2139
|
aria-selected="${e === this.activeIndex ? "true" : "false"}"
|
|
2130
|
-
@pointerdown="${
|
|
2140
|
+
@pointerdown="${a}"
|
|
2131
2141
|
@mousemove="${() => {
|
|
2132
2142
|
this.activeIndex = e;
|
|
2133
2143
|
}}"
|
|
2134
2144
|
>
|
|
2135
2145
|
<span class="name">${t.name}</span>
|
|
2136
|
-
${s ?
|
|
2146
|
+
${s ? c`<span class="where">${s}</span>` : m}
|
|
2137
2147
|
</li>
|
|
2138
2148
|
`;
|
|
2139
2149
|
}
|
|
2140
2150
|
renderListbox() {
|
|
2141
|
-
const t = this.searched && !this.results.length, e =
|
|
2142
|
-
return
|
|
2151
|
+
const t = this.searched && !this.results.length, e = c`<li class="empty">No schools found</li>`;
|
|
2152
|
+
return c`
|
|
2143
2153
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2144
|
-
${this.results.map((s,
|
|
2154
|
+
${this.results.map((s, a) => this.renderOption(s, a))}
|
|
2145
2155
|
${t ? e : m}
|
|
2146
2156
|
</ul>
|
|
2147
2157
|
`;
|
|
2148
2158
|
}
|
|
2149
2159
|
render() {
|
|
2150
2160
|
const t = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
|
|
2151
|
-
return
|
|
2161
|
+
return c`
|
|
2152
2162
|
<input
|
|
2153
2163
|
type="text"
|
|
2154
2164
|
role="combobox"
|
|
@@ -2167,22 +2177,22 @@ class ee extends E {
|
|
|
2167
2177
|
`;
|
|
2168
2178
|
}
|
|
2169
2179
|
}
|
|
2170
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2171
|
-
const
|
|
2172
|
-
"hsot-scores":
|
|
2173
|
-
"hsot-standings":
|
|
2174
|
-
"hsot-rankings":
|
|
2175
|
-
"hsot-school":
|
|
2176
|
-
"hsot-boxscore":
|
|
2177
|
-
"hsot-school-search":
|
|
2180
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", se);
|
|
2181
|
+
const es = {
|
|
2182
|
+
"hsot-scores": Qt,
|
|
2183
|
+
"hsot-standings": Zt,
|
|
2184
|
+
"hsot-rankings": Jt,
|
|
2185
|
+
"hsot-school": Xt,
|
|
2186
|
+
"hsot-boxscore": ee,
|
|
2187
|
+
"hsot-school-search": se
|
|
2178
2188
|
};
|
|
2179
|
-
function
|
|
2180
|
-
const
|
|
2181
|
-
if (
|
|
2182
|
-
for (const [t, e] of Object.entries(
|
|
2183
|
-
|
|
2189
|
+
function ss() {
|
|
2190
|
+
const r = globalThis?.customElements;
|
|
2191
|
+
if (r)
|
|
2192
|
+
for (const [t, e] of Object.entries(es))
|
|
2193
|
+
r.get(t) || r.define(t, e);
|
|
2184
2194
|
}
|
|
2185
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2195
|
+
typeof window < "u" && globalThis.customElements && ss();
|
|
2186
2196
|
export {
|
|
2187
|
-
|
|
2197
|
+
ss as defineAll
|
|
2188
2198
|
};
|