@wral/hsot-data 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1724 @@
1
+ const j = globalThis, it = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, nt = /* @__PURE__ */ Symbol(), gt = /* @__PURE__ */ new WeakMap();
2
+ let Pt = class {
3
+ constructor(t, e, s) {
4
+ if (this._$cssResult$ = !0, s !== nt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
+ this.cssText = t, this.t = e;
6
+ }
7
+ get styleSheet() {
8
+ let t = this.o;
9
+ const e = this.t;
10
+ if (it && t === void 0) {
11
+ const s = e !== void 0 && e.length === 1;
12
+ s && (t = gt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && gt.set(e, t));
13
+ }
14
+ return t;
15
+ }
16
+ toString() {
17
+ return this.cssText;
18
+ }
19
+ };
20
+ const Vt = (r) => new Pt(typeof r == "string" ? r : r + "", void 0, nt), w = (r, ...t) => {
21
+ const e = r.length === 1 ? r[0] : t.reduce((s, a, o) => s + ((i) => {
22
+ if (i._$cssResult$ === !0) return i.cssText;
23
+ if (typeof i == "number") return i;
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
+ })(a) + r[o + 1], r[0]);
26
+ return new Pt(e, r, nt);
27
+ }, qt = (r, t) => {
28
+ if (it) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
29
+ else for (const e of t) {
30
+ const s = document.createElement("style"), a = j.litNonce;
31
+ a !== void 0 && s.setAttribute("nonce", a), s.textContent = e.cssText, r.appendChild(s);
32
+ }
33
+ }, $t = it ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
34
+ let e = "";
35
+ for (const s of t.cssRules) e += s.cssText;
36
+ return Vt(e);
37
+ })(r) : r;
38
+ const { is: Yt, defineProperty: Kt, getOwnPropertyDescriptor: Zt, getOwnPropertyNames: Jt, getOwnPropertySymbols: Qt, getPrototypeOf: Xt } = Object, Y = globalThis, vt = Y.trustedTypes, te = vt ? vt.emptyScript : "", ee = Y.reactiveElementPolyfillSupport, D = (r, t) => r, at = { toAttribute(r, t) {
39
+ switch (t) {
40
+ case Boolean:
41
+ r = r ? te : null;
42
+ break;
43
+ case Object:
44
+ case Array:
45
+ r = r == null ? r : JSON.stringify(r);
46
+ }
47
+ return r;
48
+ }, fromAttribute(r, t) {
49
+ let e = r;
50
+ switch (t) {
51
+ case Boolean:
52
+ e = r !== null;
53
+ break;
54
+ case Number:
55
+ e = r === null ? null : Number(r);
56
+ break;
57
+ case Object:
58
+ case Array:
59
+ try {
60
+ e = JSON.parse(r);
61
+ } catch {
62
+ e = null;
63
+ }
64
+ }
65
+ return e;
66
+ } }, Dt = (r, t) => !Yt(r, t), yt = { attribute: !0, type: String, converter: at, reflect: !1, useDefault: !1, hasChanged: Dt };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Y.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let T = class extends HTMLElement {
69
+ static addInitializer(t) {
70
+ this._$Ei(), (this.l ??= []).push(t);
71
+ }
72
+ static get observedAttributes() {
73
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
+ }
75
+ static createProperty(t, e = yt) {
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(), a = this.getPropertyDescriptor(t, s, e);
78
+ a !== void 0 && Kt(this.prototype, t, a);
79
+ }
80
+ }
81
+ static getPropertyDescriptor(t, e, s) {
82
+ const { get: a, set: o } = Zt(this.prototype, t) ?? { get() {
83
+ return this[e];
84
+ }, set(i) {
85
+ this[e] = i;
86
+ } };
87
+ return { get: a, set(i) {
88
+ const n = a?.call(this);
89
+ o?.call(this, i), this.requestUpdate(t, n, s);
90
+ }, configurable: !0, enumerable: !0 };
91
+ }
92
+ static getPropertyOptions(t) {
93
+ return this.elementProperties.get(t) ?? yt;
94
+ }
95
+ static _$Ei() {
96
+ if (this.hasOwnProperty(D("elementProperties"))) return;
97
+ const t = Xt(this);
98
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
+ }
100
+ static finalize() {
101
+ if (this.hasOwnProperty(D("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
103
+ const e = this.properties, s = [...Jt(e), ...Qt(e)];
104
+ for (const a of s) this.createProperty(a, e[a]);
105
+ }
106
+ const t = this[Symbol.metadata];
107
+ if (t !== null) {
108
+ const e = litPropertyMetadata.get(t);
109
+ if (e !== void 0) for (const [s, a] of e) this.elementProperties.set(s, a);
110
+ }
111
+ this._$Eh = /* @__PURE__ */ new Map();
112
+ for (const [e, s] of this.elementProperties) {
113
+ const a = this._$Eu(e, s);
114
+ a !== void 0 && this._$Eh.set(a, e);
115
+ }
116
+ this.elementStyles = this.finalizeStyles(this.styles);
117
+ }
118
+ static finalizeStyles(t) {
119
+ const e = [];
120
+ if (Array.isArray(t)) {
121
+ const s = new Set(t.flat(1 / 0).reverse());
122
+ for (const a of s) e.unshift($t(a));
123
+ } else t !== void 0 && e.push($t(t));
124
+ return e;
125
+ }
126
+ static _$Eu(t, e) {
127
+ const s = e.attribute;
128
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
129
+ }
130
+ constructor() {
131
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
132
+ }
133
+ _$Ev() {
134
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
135
+ }
136
+ addController(t) {
137
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
138
+ }
139
+ removeController(t) {
140
+ this._$EO?.delete(t);
141
+ }
142
+ _$E_() {
143
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
144
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
145
+ t.size > 0 && (this._$Ep = t);
146
+ }
147
+ createRenderRoot() {
148
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
+ return qt(t, this.constructor.elementStyles), t;
150
+ }
151
+ connectedCallback() {
152
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
153
+ }
154
+ enableUpdating(t) {
155
+ }
156
+ disconnectedCallback() {
157
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
158
+ }
159
+ attributeChangedCallback(t, e, s) {
160
+ this._$AK(t, s);
161
+ }
162
+ _$ET(t, e) {
163
+ const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
164
+ if (a !== void 0 && s.reflect === !0) {
165
+ const o = (s.converter?.toAttribute !== void 0 ? s.converter : at).toAttribute(e, s.type);
166
+ this._$Em = t, o == null ? this.removeAttribute(a) : this.setAttribute(a, o), this._$Em = null;
167
+ }
168
+ }
169
+ _$AK(t, e) {
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 : at;
173
+ this._$Em = a;
174
+ const n = i.fromAttribute(e, o.type);
175
+ this[a] = n ?? this._$Ej?.get(a) ?? n, this._$Em = null;
176
+ }
177
+ }
178
+ requestUpdate(t, e, s, a = !1, o) {
179
+ if (t !== void 0) {
180
+ const i = this.constructor;
181
+ if (a === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Dt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
182
+ this.C(t, e, s);
183
+ }
184
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
185
+ }
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
+ }
189
+ async _$EP() {
190
+ this.isUpdatePending = !0;
191
+ try {
192
+ await this._$ES;
193
+ } catch (e) {
194
+ Promise.reject(e);
195
+ }
196
+ const t = this.scheduleUpdate();
197
+ return t != null && await t, !this.isUpdatePending;
198
+ }
199
+ scheduleUpdate() {
200
+ return this.performUpdate();
201
+ }
202
+ performUpdate() {
203
+ if (!this.isUpdatePending) return;
204
+ if (!this.hasUpdated) {
205
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
206
+ for (const [a, o] of this._$Ep) this[a] = o;
207
+ this._$Ep = void 0;
208
+ }
209
+ const s = this.constructor.elementProperties;
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
+ }
214
+ }
215
+ let t = !1;
216
+ const e = this._$AL;
217
+ try {
218
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(e)) : this._$EM();
219
+ } catch (s) {
220
+ throw t = !1, this._$EM(), s;
221
+ }
222
+ t && this._$AE(e);
223
+ }
224
+ willUpdate(t) {
225
+ }
226
+ _$AE(t) {
227
+ this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
228
+ }
229
+ _$EM() {
230
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
231
+ }
232
+ get updateComplete() {
233
+ return this.getUpdateComplete();
234
+ }
235
+ getUpdateComplete() {
236
+ return this._$ES;
237
+ }
238
+ shouldUpdate(t) {
239
+ return !0;
240
+ }
241
+ update(t) {
242
+ this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
243
+ }
244
+ updated(t) {
245
+ }
246
+ firstUpdated(t) {
247
+ }
248
+ };
249
+ T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[D("elementProperties")] = /* @__PURE__ */ new Map(), T[D("finalized")] = /* @__PURE__ */ new Map(), ee?.({ ReactiveElement: T }), (Y.reactiveElementVersions ??= []).push("2.1.2");
250
+ const lt = globalThis, bt = (r) => r, G = lt.trustedTypes, wt = G ? G.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Rt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Bt = "?" + _, se = `<${Bt}>`, A = document, B = () => A.createComment(""), z = (r) => r === null || typeof r != "object" && typeof r != "function", ct = Array.isArray, ae = (r) => ct(r) || typeof r?.[Symbol.iterator] == "function", et = `[
251
+ \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, xt = /-->/g, _t = />/g, k = RegExp(`>|${et}(?:([^\\s"'>=/]+)(${et}*=${et}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), kt = /'/g, St = /"/g, zt = /^(?:script|style|textarea|title)$/i, Ot = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), d = Ot(1), At = Ot(2), I = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Tt = /* @__PURE__ */ new WeakMap(), S = A.createTreeWalker(A, 129);
253
+ function Nt(r, t) {
254
+ if (!ct(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
+ return wt !== void 0 ? wt.createHTML(t) : t;
256
+ }
257
+ const re = (r, t) => {
258
+ const e = r.length - 1, s = [];
259
+ let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = E;
260
+ for (let n = 0; n < e; n++) {
261
+ const l = r[n];
262
+ let p, h, c = -1, f = 0;
263
+ for (; f < l.length && (i.lastIndex = f, h = i.exec(l), h !== null); ) f = i.lastIndex, i === E ? h[1] === "!--" ? i = xt : h[1] !== void 0 ? i = _t : h[2] !== void 0 ? (zt.test(h[2]) && (a = RegExp("</" + h[2], "g")), i = k) : h[3] !== void 0 && (i = k) : i === k ? h[0] === ">" ? (i = a ?? E, c = -1) : h[1] === void 0 ? c = -2 : (c = i.lastIndex - h[2].length, p = h[1], i = h[3] === void 0 ? k : h[3] === '"' ? St : kt) : i === St || i === kt ? i = k : i === xt || i === _t ? i = E : (i = k, a = void 0);
264
+ const u = i === k && r[n + 1].startsWith("/>") ? " " : "";
265
+ o += i === E ? l + se : c >= 0 ? (s.push(p), l.slice(0, c) + Rt + l.slice(c) + _ + u) : l + _ + (c === -2 ? n : u);
266
+ }
267
+ return [Nt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
268
+ };
269
+ class O {
270
+ constructor({ strings: t, _$litType$: e }, s) {
271
+ let a;
272
+ this.parts = [];
273
+ let o = 0, i = 0;
274
+ const n = t.length - 1, l = this.parts, [p, h] = re(t, e);
275
+ if (this.el = O.createElement(p, s), S.currentNode = this.el.content, e === 2 || e === 3) {
276
+ const c = this.el.content.firstChild;
277
+ c.replaceWith(...c.childNodes);
278
+ }
279
+ for (; (a = S.nextNode()) !== null && l.length < n; ) {
280
+ if (a.nodeType === 1) {
281
+ if (a.hasAttributes()) for (const c of a.getAttributeNames()) if (c.endsWith(Rt)) {
282
+ const f = h[i++], u = a.getAttribute(c).split(_), v = /([.?@])?(.*)/.exec(f);
283
+ l.push({ type: 1, index: o, name: v[2], strings: u, ctor: v[1] === "." ? ie : v[1] === "?" ? ne : v[1] === "@" ? le : K }), a.removeAttribute(c);
284
+ } else c.startsWith(_) && (l.push({ type: 6, index: o }), a.removeAttribute(c));
285
+ if (zt.test(a.tagName)) {
286
+ const c = a.textContent.split(_), f = c.length - 1;
287
+ if (f > 0) {
288
+ a.textContent = G ? G.emptyScript : "";
289
+ for (let u = 0; u < f; u++) a.append(c[u], B()), S.nextNode(), l.push({ type: 2, index: ++o });
290
+ a.append(c[f], B());
291
+ }
292
+ }
293
+ } else if (a.nodeType === 8) if (a.data === Bt) l.push({ type: 2, index: o });
294
+ else {
295
+ let c = -1;
296
+ for (; (c = a.data.indexOf(_, c + 1)) !== -1; ) l.push({ type: 7, index: o }), c += _.length - 1;
297
+ }
298
+ o++;
299
+ }
300
+ }
301
+ static createElement(t, e) {
302
+ const s = A.createElement("template");
303
+ return s.innerHTML = t, s;
304
+ }
305
+ }
306
+ function C(r, t, e = r, s) {
307
+ if (t === I) return t;
308
+ let a = s !== void 0 ? e._$Co?.[s] : e._$Cl;
309
+ const o = z(t) ? void 0 : t._$litDirective$;
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 = C(r, a._$AS(r, t.values), a, s)), t;
311
+ }
312
+ class oe {
313
+ constructor(t, e) {
314
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
315
+ }
316
+ get parentNode() {
317
+ return this._$AM.parentNode;
318
+ }
319
+ get _$AU() {
320
+ return this._$AM._$AU;
321
+ }
322
+ u(t) {
323
+ const { el: { content: e }, parts: s } = this._$AD, a = (t?.creationScope ?? A).importNode(e, !0);
324
+ S.currentNode = a;
325
+ let o = S.nextNode(), i = 0, n = 0, l = s[0];
326
+ for (; l !== void 0; ) {
327
+ if (i === l.index) {
328
+ let p;
329
+ l.type === 2 ? p = new U(o, o.nextSibling, this, t) : l.type === 1 ? p = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (p = new ce(o, this, t)), this._$AV.push(p), l = s[++n];
330
+ }
331
+ i !== l?.index && (o = S.nextNode(), i++);
332
+ }
333
+ return S.currentNode = A, a;
334
+ }
335
+ p(t) {
336
+ let e = 0;
337
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
338
+ }
339
+ }
340
+ class U {
341
+ get _$AU() {
342
+ return this._$AM?._$AU ?? this._$Cv;
343
+ }
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
+ }
347
+ get parentNode() {
348
+ let t = this._$AA.parentNode;
349
+ const e = this._$AM;
350
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
351
+ }
352
+ get startNode() {
353
+ return this._$AA;
354
+ }
355
+ get endNode() {
356
+ return this._$AB;
357
+ }
358
+ _$AI(t, e = this) {
359
+ t = C(this, t, e), z(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ae(t) ? this.k(t) : this._(t);
360
+ }
361
+ O(t) {
362
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
363
+ }
364
+ T(t) {
365
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
366
+ }
367
+ _(t) {
368
+ this._$AH !== m && z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
369
+ }
370
+ $(t) {
371
+ const { values: e, _$litType$: s } = t, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(Nt(s.h, s.h[0]), this.options)), s);
372
+ if (this._$AH?._$AD === a) this._$AH.p(e);
373
+ else {
374
+ const o = new oe(a, this), i = o.u(this.options);
375
+ o.p(e), this.T(i), this._$AH = o;
376
+ }
377
+ }
378
+ _$AC(t) {
379
+ let e = Tt.get(t.strings);
380
+ return e === void 0 && Tt.set(t.strings, e = new O(t)), e;
381
+ }
382
+ k(t) {
383
+ ct(this._$AH) || (this._$AH = [], this._$AR());
384
+ const e = this._$AH;
385
+ let s, a = 0;
386
+ for (const o of t) a === e.length ? e.push(s = new U(this.O(B()), this.O(B()), 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
+ }
389
+ _$AR(t = this._$AA.nextSibling, e) {
390
+ for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
391
+ const s = bt(t).nextSibling;
392
+ bt(t).remove(), t = s;
393
+ }
394
+ }
395
+ setConnected(t) {
396
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
397
+ }
398
+ }
399
+ class K {
400
+ get tagName() {
401
+ return this.element.tagName;
402
+ }
403
+ get _$AU() {
404
+ return this._$AM._$AU;
405
+ }
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
+ }
409
+ _$AI(t, e = this, s, a) {
410
+ const o = this.strings;
411
+ let i = !1;
412
+ if (o === void 0) t = C(this, t, e, 0), i = !z(t) || t !== this._$AH && t !== I, i && (this._$AH = t);
413
+ else {
414
+ const n = t;
415
+ let l, p;
416
+ for (t = o[0], l = 0; l < o.length - 1; l++) p = C(this, n[s + l], e, l), p === I && (p = this._$AH[l]), i ||= !z(p) || p !== this._$AH[l], p === m ? t = m : t !== m && (t += (p ?? "") + o[l + 1]), this._$AH[l] = p;
417
+ }
418
+ i && !a && this.j(t);
419
+ }
420
+ j(t) {
421
+ t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
422
+ }
423
+ }
424
+ class ie extends K {
425
+ constructor() {
426
+ super(...arguments), this.type = 3;
427
+ }
428
+ j(t) {
429
+ this.element[this.name] = t === m ? void 0 : t;
430
+ }
431
+ }
432
+ class ne extends K {
433
+ constructor() {
434
+ super(...arguments), this.type = 4;
435
+ }
436
+ j(t) {
437
+ this.element.toggleAttribute(this.name, !!t && t !== m);
438
+ }
439
+ }
440
+ class le extends K {
441
+ constructor(t, e, s, a, o) {
442
+ super(t, e, s, a, o), this.type = 5;
443
+ }
444
+ _$AI(t, e = this) {
445
+ if ((t = C(this, t, e, 0) ?? m) === I) return;
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
+ }
449
+ handleEvent(t) {
450
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
451
+ }
452
+ }
453
+ class ce {
454
+ constructor(t, e, s) {
455
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
456
+ }
457
+ get _$AU() {
458
+ return this._$AM._$AU;
459
+ }
460
+ _$AI(t) {
461
+ C(this, t);
462
+ }
463
+ }
464
+ const de = lt.litHtmlPolyfillSupport;
465
+ de?.(O, U), (lt.litHtmlVersions ??= []).push("3.3.3");
466
+ const he = (r, t, e) => {
467
+ const s = e?.renderBefore ?? t;
468
+ let a = s._$litPart$;
469
+ if (a === void 0) {
470
+ const o = e?.renderBefore ?? null;
471
+ s._$litPart$ = a = new U(t.insertBefore(B(), o), o, void 0, e ?? {});
472
+ }
473
+ return a._$AI(r), a;
474
+ };
475
+ const dt = globalThis;
476
+ class R extends T {
477
+ constructor() {
478
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
+ }
480
+ createRenderRoot() {
481
+ const t = super.createRenderRoot();
482
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
483
+ }
484
+ update(t) {
485
+ const e = this.render();
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = he(e, this.renderRoot, this.renderOptions);
487
+ }
488
+ connectedCallback() {
489
+ super.connectedCallback(), this._$Do?.setConnected(!0);
490
+ }
491
+ disconnectedCallback() {
492
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
+ }
494
+ render() {
495
+ return I;
496
+ }
497
+ }
498
+ R._$litElement$ = !0, R.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: R });
499
+ const pe = dt.litElementPolyfillSupport;
500
+ pe?.({ LitElement: R });
501
+ (dt.litElementVersions ??= []).push("4.2.2");
502
+ const me = 50;
503
+ function fe(r = {}) {
504
+ const t = Object.entries(r).filter(([, s]) => s != null && s !== "");
505
+ if (!t.length) return "";
506
+ const e = new URLSearchParams();
507
+ return t.forEach(([s, a]) => e.set(s, String(a))), `?${e.toString()}`;
508
+ }
509
+ function ue({ 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
+ async function o(n) {
513
+ const l = { Accept: "application/json" };
514
+ t && (l.Authorization = `Bearer ${t}`);
515
+ const p = await a(`${s}${n}`, { headers: l });
516
+ if (!p.ok) {
517
+ const h = new Error(`api-hsot ${p.status} on ${n}`);
518
+ throw h.status = p.status, h;
519
+ }
520
+ return p.json();
521
+ }
522
+ async function i(n, l = {}) {
523
+ const p = [];
524
+ let h = null;
525
+ for (let c = 0; c < me; c += 1) {
526
+ const f = fe(h ? { ...l, cursor: h } : l), u = await o(`${n}${f}`);
527
+ if (p.push(...u.items || []), h = u.nextCursor || null, !h) break;
528
+ }
529
+ return { items: p, total: p.length, nextCursor: null };
530
+ }
531
+ return {
532
+ listSchools: (n) => i("/schools", n),
533
+ getSchool: (n) => o(`/schools/${n}`),
534
+ listTeams: (n) => i("/teams", n),
535
+ getTeam: (n) => o(`/teams/${n}`),
536
+ listConferences: (n) => i("/conferences", n),
537
+ listPlayers: (n) => i("/players", n),
538
+ listRosters: (n) => i("/rosters", n),
539
+ listGames: (n) => i("/games", n),
540
+ getGame: (n) => o(`/games/${n}`),
541
+ listTournaments: (n) => i("/tournaments", n),
542
+ listSeedings: (n, l) => i(`/tournaments/${n}/seedings`, l),
543
+ listRankings: (n) => i("/rankings", n),
544
+ listSports: () => o("/sports")
545
+ };
546
+ }
547
+ class b extends R {
548
+ static properties = {
549
+ api: { type: String },
550
+ refreshInterval: { type: Number, attribute: "refresh-interval" },
551
+ data: { state: !0 },
552
+ loading: { state: !0 },
553
+ error: { state: !0 }
554
+ };
555
+ constructor() {
556
+ super(), this.api = "", this.refreshInterval = 0, this.data = null, this.loading = !1, this.error = "", this._client = null, this._refreshId = null;
557
+ }
558
+ /** Injected client wins; otherwise build a fetch client from the api attribute. */
559
+ set client(t) {
560
+ this._client = t, this.isConnected && this.load();
561
+ }
562
+ get client() {
563
+ return this._client ? this._client : this.api ? ue({ baseUrl: this.api }) : null;
564
+ }
565
+ connectedCallback() {
566
+ super.connectedCallback(), this._setupInterval();
567
+ }
568
+ disconnectedCallback() {
569
+ super.disconnectedCallback(), this._clearInterval();
570
+ }
571
+ firstUpdated() {
572
+ this.load();
573
+ }
574
+ updated(t) {
575
+ t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval();
576
+ }
577
+ async load() {
578
+ const t = this.client;
579
+ if (!t) {
580
+ this.error = "not-configured";
581
+ return;
582
+ }
583
+ this.loading = !0, this.error = "";
584
+ try {
585
+ this.data = await this.fetchData(t);
586
+ } catch (e) {
587
+ console.error(`[${this.tagName.toLowerCase()}]`, e), this.error = "load-failed";
588
+ } finally {
589
+ this.loading = !1;
590
+ }
591
+ }
592
+ async fetchData(t) {
593
+ return null;
594
+ }
595
+ _setupInterval() {
596
+ this._clearInterval();
597
+ const t = Number(this.refreshInterval) || 0;
598
+ t > 0 && (this._refreshId = setInterval(() => this.load(), t));
599
+ }
600
+ _clearInterval() {
601
+ this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
602
+ }
603
+ render() {
604
+ return this.error === "not-configured" ? d`<div class="error">This component needs an <code>api</code> attribute (the api-hsot v1 base URL) or an injected client.</div>` : this.error ? d`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : d`<div class="loading" role="status">Loading…</div>`;
605
+ }
606
+ renderView() {
607
+ return d``;
608
+ }
609
+ }
610
+ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ge = w`
611
+ :host {
612
+ --hsot-red: var(--color-red, #D1232A);
613
+ --hsot-red-deep: var(--color-red-dark, #951C21);
614
+ --hsot-red-tint: #FAE9EA;
615
+ --hsot-black: var(--color-black, #030711);
616
+ --hsot-white: var(--color-white, #FFFFFF);
617
+ --hsot-gray-1: var(--color-gray-1, #F7F5F4);
618
+ --hsot-gray-2: var(--color-gray-2, #E7E5E4);
619
+ --hsot-gray-3: var(--color-gray-3, #D7D4D2);
620
+ --hsot-gray-4: var(--color-gray-4, #7C7C7C);
621
+ --hsot-gray-5: var(--color-gray-5, #6C6C6C);
622
+ --hsot-gray-6: var(--color-gray-6, #565454);
623
+ --hsot-gray-8: var(--color-gray-8, #263238);
624
+ --hsot-straw: var(--color-straw, #fff5ba);
625
+ --hsot-win: var(--color-green-dark, #66A208);
626
+ --hsot-loss: var(--color-red, #D1232A);
627
+ --hsot-tie: var(--color-gray-4, #7C7C7C);
628
+ --hsot-heading-font: var(--heading-font-family, 'IBM Plex Sans Condensed', 'Helvetica Neue', Helvetica, sans-serif);
629
+ --hsot-body-font: var(--body-font-family, Roboto, 'Helvetica Neue', Helvetica, sans-serif);
630
+ --hsot-radius-xs: var(--radius-xs, 0.15rem);
631
+ --hsot-radius-sm: var(--radius-sm, 0.3125rem);
632
+ --hsot-radius-md: var(--radius-md, 0.5rem);
633
+ display: block;
634
+ font-family: var(--hsot-body-font);
635
+ color: var(--hsot-black);
636
+ font-size: 1rem;
637
+ }
638
+ a { color: var(--hsot-red-deep); }
639
+ a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
640
+ outline: 2px solid var(--hsot-red);
641
+ outline-offset: 1px;
642
+ }
643
+ .mut { color: var(--hsot-gray-5); }
644
+ `, $e = w`
645
+ .band { background: var(--hsot-black); color: var(--hsot-white); }
646
+ .band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
647
+ .band h1, .band h2.bandtitle {
648
+ margin: 0; font-family: var(--hsot-heading-font); font-size: 2.4rem; font-weight: 500;
649
+ letter-spacing: -0.035em; line-height: 1.1; text-transform: capitalize; color: var(--hsot-white);
650
+ }
651
+ .band .sub { margin: 0.25rem 0 0.9rem; color: rgba(255,255,255,0.75); font-size: 0.95rem; }
652
+ .band nav.tabs {
653
+ display: flex; gap: 1rem; border-top: 1px solid rgba(255,255,255,0.2);
654
+ max-width: 1366px; margin: 0 auto; padding: 0 1.25rem; overflow-x: auto;
655
+ }
656
+ .band nav.tabs a, .band nav.tabs span {
657
+ font-family: var(--hsot-heading-font); font-weight: 500; font-size: 0.875rem;
658
+ text-transform: uppercase; text-decoration: none; color: var(--hsot-white);
659
+ padding: 0.55rem 0.15rem; white-space: nowrap; border-bottom: 3px solid transparent;
660
+ }
661
+ .band nav.tabs a.on { border-bottom-color: var(--hsot-red); }
662
+ .band nav.tabs span.off { color: rgba(255,255,255,0.45); cursor: not-allowed; }
663
+ @media (max-width: 720px) { .band h1, .band h2.bandtitle { font-size: 1.8rem; } }
664
+ `, ve = w`
665
+ .view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
666
+ .toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.1rem; }
667
+ .toolbar .spacer { flex: 1; }
668
+ .asof { font-size: 0.8125rem; color: var(--hsot-gray-5); }
669
+ button.chip {
670
+ font-family: var(--hsot-heading-font); font-weight: 500; font-size: 0.8125rem;
671
+ text-transform: uppercase; border: 1px solid var(--hsot-gray-3);
672
+ background: var(--hsot-white); color: var(--hsot-gray-6);
673
+ border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer;
674
+ }
675
+ button.chip.on { background: var(--hsot-red); border-color: var(--hsot-red); color: var(--hsot-white); }
676
+ button.chip[disabled] { opacity: 0.45; cursor: not-allowed; }
677
+ input[type=search], select {
678
+ font-family: var(--hsot-body-font); font-size: 0.9rem;
679
+ border: 1px solid var(--hsot-gray-3); border-radius: var(--hsot-radius-sm);
680
+ padding: 0.42rem 0.65rem; background: var(--hsot-white); color: inherit;
681
+ }
682
+ .card {
683
+ background: var(--hsot-white); border: 1px solid var(--hsot-gray-2);
684
+ border-radius: var(--hsot-radius-md); overflow: hidden; margin-bottom: 1.25rem;
685
+ }
686
+ .card .card-head {
687
+ display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
688
+ padding: 0.8rem 1rem 0.6rem; border-bottom: 3px solid var(--hsot-gray-2);
689
+ }
690
+ .card .card-head h2, .card .card-head h3 {
691
+ margin: 0; font-family: var(--hsot-heading-font); font-size: 1.25rem; color: var(--hsot-black);
692
+ }
693
+ .card .card-head .meta { font-size: 0.8125rem; color: var(--hsot-gray-5); }
694
+ .section-title {
695
+ color: var(--hsot-black); font-size: 1.0625rem; font-weight: 600; line-height: 1;
696
+ padding: 0 0 0.1875rem 1.25rem; position: relative; text-transform: uppercase;
697
+ font-family: var(--hsot-body-font); margin: 1.6rem 0 0.7rem;
698
+ }
699
+ .section-title::before {
700
+ color: var(--hsot-red); content: "·"; font-size: 2.5em; height: 1em; line-height: 1;
701
+ margin-right: 0.3125rem; position: absolute; top: -0.75rem; left: 0;
702
+ }
703
+ .empty { padding: 1.2rem 1rem; color: var(--hsot-gray-5); font-size: 0.9rem; }
704
+ .error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
705
+ .note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
706
+ .loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
707
+ `, ye = w`
708
+ .pill {
709
+ display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
710
+ font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
711
+ border-radius: var(--hsot-radius-md); padding: 0.14rem 0.45rem; vertical-align: middle;
712
+ }
713
+ .pill.class { background: var(--hsot-red-tint); color: var(--hsot-red-deep); }
714
+ .pill.live { background: var(--hsot-red); color: var(--hsot-white); animation: hsot-pulse 1.6s ease-in-out infinite; }
715
+ .pill.final { background: var(--hsot-gray-8); color: var(--hsot-white); }
716
+ .pill.sched { background: var(--hsot-white); color: var(--hsot-gray-6); border: 1px solid var(--hsot-gray-3); }
717
+ .pill.warn { background: var(--color-orange, #FF9505); color: var(--hsot-black); }
718
+ .pill.type { background: var(--hsot-gray-1); color: var(--hsot-gray-6); border: 1px solid var(--hsot-gray-2); }
719
+ .pill.champ { background: var(--hsot-straw); color: #6b5900; }
720
+ @keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
721
+ @media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
722
+ `, be = w`
723
+ .tablewrap { overflow-x: auto; }
724
+ table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
725
+ table.data th {
726
+ background: var(--hsot-black); color: var(--hsot-white);
727
+ border-right: 1px solid rgba(255,255,255,0.15); text-align: left;
728
+ font-weight: 500; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em;
729
+ padding: 8px 12px; white-space: nowrap;
730
+ }
731
+ table.data th:last-child { border-right: none; }
732
+ table.data thead { border-bottom: 3px solid var(--hsot-red); }
733
+ table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
734
+ table.data td { padding: 9px 12px; border-bottom: 1px solid var(--hsot-gray-2); white-space: nowrap; }
735
+ table.data tbody tr:last-child td { border-bottom: none; }
736
+ table.data tbody tr.rowlink { cursor: pointer; }
737
+ table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
738
+ table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
739
+ table.data td.teamcell a:hover { text-decoration: underline; }
740
+ `, we = w`
741
+ .swatch {
742
+ display: inline-flex; align-items: center; justify-content: center;
743
+ width: 26px; height: 26px; border-radius: 50%;
744
+ font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.55rem;
745
+ margin-right: 0.5rem; vertical-align: middle; flex: none;
746
+ }
747
+ .rankbadge { font-weight: 700; color: var(--hsot-red-deep); font-size: 0.8em; margin-right: 0.22rem; }
748
+ .dots { display: inline-flex; gap: 3px; }
749
+ .dot {
750
+ width: 17px; height: 17px; border-radius: 50%;
751
+ display: inline-flex; align-items: center; justify-content: center;
752
+ color: var(--hsot-white); font-family: var(--hsot-heading-font);
753
+ font-size: 0.6rem; font-weight: 700; text-decoration: none;
754
+ }
755
+ .dot.W { background: var(--hsot-win); }
756
+ .dot.L { background: var(--hsot-loss); }
757
+ .dot.T { background: var(--hsot-tie); }
758
+ `, xe = w`
759
+ ul.gamelist { list-style: none; margin: 0; padding: 0; }
760
+ .gamelist li {
761
+ display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
762
+ border-bottom: 1px solid var(--hsot-gray-2); font-size: 0.9rem; flex-wrap: wrap;
763
+ }
764
+ .gamelist li:last-child { border-bottom: none; }
765
+ .gamelist .d { width: 84px; flex: none; color: var(--hsot-gray-5); font-size: 0.8rem; }
766
+ .gamelist .res { width: 86px; flex: none; font-family: var(--hsot-heading-font); font-weight: 700; }
767
+ .gamelist .res .W { color: var(--hsot-win); }
768
+ .gamelist .res .L { color: var(--hsot-loss); }
769
+ .gamelist .res .T { color: var(--hsot-tie); }
770
+ .gamelist .opp { flex: 1; min-width: 180px; }
771
+ .gamelist .opp a { text-decoration: none; color: inherit; font-weight: 500; }
772
+ .gamelist .opp a:hover { text-decoration: underline; }
773
+ .gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
774
+ .gamelist a.box { font-size: 0.78rem; }
775
+ `, H = [ge, $e, ve, ye, be, we, xe];
776
+ function ht(r) {
777
+ return r.state !== "final" ? null : r.forfeit && r.forfeit !== "none" ? r.forfeit : r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
778
+ }
779
+ function M(r, t) {
780
+ 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)));
781
+ for (const o of a) {
782
+ const i = ht(o), n = o.gameType === "conference";
783
+ for (const l of ["home", "away"]) {
784
+ const p = l === "home" ? o.homeTeamId : o.awayTeamId;
785
+ if (!p) continue;
786
+ const h = s(p), c = l === "home" ? o.homeScore : o.awayScore, f = l === "home" ? o.awayScore : o.homeScore;
787
+ h.pf += c, h.pa += f;
788
+ let u = "T";
789
+ i === "tie" ? (h.t += 1, n && (h.ct += 1)) : i === l ? (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: c, their: f, opp: l === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
790
+ }
791
+ }
792
+ return e;
793
+ }
794
+ function Z(r) {
795
+ if (!r || !r.length) return "";
796
+ const t = r[r.length - 1].mark;
797
+ let e = 0;
798
+ for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
799
+ return t + e;
800
+ }
801
+ const It = (r, t, e) => {
802
+ const s = r + t + e;
803
+ return s ? (r + e / 2) / s : 0;
804
+ }, Ct = (r) => r.toFixed(3).replace("0.", ".");
805
+ function x(r, t = !1) {
806
+ if (!r) return "0-0";
807
+ const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
808
+ return `${e}-${s}${a ? `-${a}` : ""}`;
809
+ }
810
+ function Ft(r, t) {
811
+ return r.map((e) => {
812
+ const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
813
+ return { team: e, rec: s, confPct: It(s.cw, s.cl, s.ct), overallPct: It(s.w, s.l, s.t) };
814
+ }).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
815
+ }
816
+ function pt(r, t) {
817
+ 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;
818
+ }
819
+ function Et(r, t) {
820
+ const e = r[t];
821
+ return e && e.results.length ? e.results[e.results.length - 1] : null;
822
+ }
823
+ const st = {
824
+ game: "/{sport}/game/{id}/",
825
+ school: "/school/{id}/",
826
+ section: "/{sport}/{view}/"
827
+ };
828
+ function $(r, t) {
829
+ return String(r).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
830
+ }
831
+ function L(r) {
832
+ return {
833
+ game: r.getAttribute("game-href") || st.game,
834
+ school: r.getAttribute("school-href") || st.school,
835
+ section: r.getAttribute("section-href") || st.section
836
+ };
837
+ }
838
+ const J = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
839
+ function y(r, t) {
840
+ if (!r) return "TBD";
841
+ const [e, s, a] = String(r).split("-").map(Number);
842
+ return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
843
+ }
844
+ function Q(r) {
845
+ if (!r) return "";
846
+ const [t, e] = String(r).split(":").map(Number);
847
+ if (Number.isNaN(t)) return "";
848
+ const s = t >= 12 ? "PM" : "AM";
849
+ return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
850
+ }
851
+ function _e(r) {
852
+ return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
853
+ }
854
+ function X(r = /* @__PURE__ */ new Date()) {
855
+ const t = r.getFullYear();
856
+ return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
857
+ }
858
+ function rt(r = /* @__PURE__ */ new Date()) {
859
+ const t = (e) => String(e).padStart(2, "0");
860
+ return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
861
+ }
862
+ function mt(r) {
863
+ return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
864
+ }
865
+ function W(r) {
866
+ if (!r || !/^#[0-9a-fA-F]{6}$/.test(r)) return "#FFFFFF";
867
+ const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
868
+ return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
869
+ }
870
+ const ke = (r) => {
871
+ const t = ["th", "st", "nd", "rd"], e = r % 100;
872
+ return r + (t[(e - 20) % 10] || t[e] || t[0]);
873
+ };
874
+ function Se(r) {
875
+ if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
876
+ if (r.state === "final") {
877
+ const t = [];
878
+ 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(" · ")}` : ""}` };
879
+ }
880
+ 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" })} · ${Q(r.time)}`.replace(/ · $/, "") };
881
+ }
882
+ function Ut(r, t, e, s, a) {
883
+ const o = t[e];
884
+ if (!o) return null;
885
+ const i = /* @__PURE__ */ new Map();
886
+ for (const l of r || []) {
887
+ if (l.sport !== s || a && l.effectiveDate > a || l.gender && o.gender !== l.gender && o.gender !== "coed") continue;
888
+ const p = l.gender || "", h = i.get(p);
889
+ (!h || l.effectiveDate > h.effectiveDate) && i.set(p, l);
890
+ }
891
+ let n = null;
892
+ for (const l of i.values()) {
893
+ const p = (l.teamIds || []).indexOf(e);
894
+ p !== -1 && (!n || l.effectiveDate > n.effectiveDate) && (n = { poll: l, rank: p + 1 });
895
+ }
896
+ return n ? n.rank : null;
897
+ }
898
+ function Ae(r, t, e) {
899
+ if (!r) return { kind: "none", delta: 0 };
900
+ const s = (r.teamIds || []).indexOf(e) + 1;
901
+ if (!s) return { kind: "none", delta: 0 };
902
+ if (!t) return { kind: "same", delta: 0 };
903
+ const a = (t.teamIds || []).indexOf(e) + 1;
904
+ if (!a) return { kind: "new", delta: 0 };
905
+ const o = a - s;
906
+ return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
907
+ }
908
+ const N = (r, t) => {
909
+ const e = r.teamsById[t];
910
+ return e ? r.schoolsById[e.schoolId] : null;
911
+ }, P = (r, t) => N(r, t)?.name || "TBD", V = (r, t) => N(r, t)?.abbr || "TBD";
912
+ function F(r, t = 26) {
913
+ if (!r) return m;
914
+ const e = r.colorPrimary || "#030711", s = W(e);
915
+ return d`<span class="swatch" aria-hidden="true"
916
+ style="width:${t}px;height:${t}px;background:${e};color:${s};font-size:${Math.max(8, t * 0.28)}px"
917
+ >${mt(r)}</span>`;
918
+ }
919
+ function ft(r, t, e) {
920
+ const s = Ut(r.rankings, r.teamsById, t, r.sport, e);
921
+ return s ? d`<span class="rankbadge">#${s}</span>` : m;
922
+ }
923
+ function ot(r, t, e) {
924
+ const s = N(r, t);
925
+ return s ? d`${ft(r, t, e)}<a href=${$(r.hrefs.school, { id: s.id })}>${s.name}</a>` : d`<span class="mut">TBD</span>`;
926
+ }
927
+ function ut(r, t, e = 5) {
928
+ const s = r.records[t];
929
+ if (!s || !s.results.length) return d`<span class="mut">·</span>`;
930
+ const a = s.results.slice(-1 * e);
931
+ return d`<span class="dots" role="img" aria-label="last ${a.length} results">
932
+ ${a.map((o) => d`<a class="dot ${o.mark}"
933
+ title="${o.mark} ${o.my}-${o.their} vs ${P(r, o.opp)}"
934
+ href=${$(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
935
+ </span>`;
936
+ }
937
+ function q(r) {
938
+ const t = Se(r);
939
+ return d`<span class="pill ${t.kind}">${t.label}</span>`;
940
+ }
941
+ function Ht(r, t, e) {
942
+ if (!t) return d`<span class="mut">·</span>`;
943
+ const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
944
+ return d`${t.state === "live" ? d`<span class="pill live">Live</span> ` : d`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${V(r, s)}`;
945
+ }
946
+ class Mt extends b {
947
+ static styles = H;
948
+ static properties = {
949
+ ...b.properties,
950
+ sport: { type: String },
951
+ season: { type: String },
952
+ date: { type: String }
953
+ };
954
+ constructor() {
955
+ super(), this.sport = "football", this.season = "", this.date = "";
956
+ }
957
+ connectedCallback() {
958
+ if (super.connectedCallback(), !this.date) {
959
+ const t = new URLSearchParams(globalThis.location?.search || "").get("date");
960
+ this.date = t || rt();
961
+ }
962
+ }
963
+ async fetchData(t) {
964
+ const e = this.season || X(), [s, a, o, i, n] = await Promise.all([
965
+ t.listSchools(),
966
+ t.listTeams({ sport: this.sport }),
967
+ t.listConferences(),
968
+ t.listGames({ sport: this.sport, season: e }),
969
+ t.listRankings({ sport: this.sport })
970
+ ]);
971
+ return {
972
+ season: e,
973
+ schools: s.items,
974
+ teams: a.items,
975
+ conferences: o.items,
976
+ games: i.items,
977
+ rankings: n.items
978
+ };
979
+ }
980
+ get ctx() {
981
+ return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
982
+ teamsById: g(this.data.teams),
983
+ schoolsById: g(this.data.schools),
984
+ records: M(this.data.games),
985
+ rankings: this.data.rankings,
986
+ hrefs: L(this),
987
+ sport: this.sport
988
+ }, this._ctxData = this.data), this._ctx;
989
+ }
990
+ renderView() {
991
+ const t = this.ctx, e = g(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(), a = this.data.games.filter((i) => i.date === this.date).sort((i, n) => (i.state === "live" ? -1 : 1) - (n.state === "live" ? -1 : 1)), o = /* @__PURE__ */ new Map();
992
+ return a.forEach((i) => {
993
+ const n = i.gameType === "conference" && i.conferenceId ? e[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
994
+ o.has(n) || o.set(n, []), o.get(n).push(i);
995
+ }), d`
996
+ <div class="band">
997
+ <div class="inner">
998
+ <h1>${J(this.sport)} scores &amp; schedules</h1>
999
+ <p class="sub">${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${a.length} games</p>
1000
+ </div>
1001
+ </div>
1002
+ <div class="view">
1003
+ <div class="toolbar">
1004
+ <label class="asof" for="datesel">Date</label>
1005
+ <select id="datesel" @change=${(i) => {
1006
+ this.date = i.target.value;
1007
+ }}>
1008
+ ${s.map((i) => d`<option value=${i} ?selected=${i === this.date}>
1009
+ ${y(i, { weekday: "short", month: "short", day: "numeric" })}${i === rt() ? " · today" : ""}
1010
+ </option>`)}
1011
+ </select>
1012
+ <button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
1013
+ @click=${() => {
1014
+ this.date = s[s.indexOf(this.date) - 1];
1015
+ }}>← Prev</button>
1016
+ <button class="chip" ?disabled=${s.indexOf(this.date) < 0 || s.indexOf(this.date) >= s.length - 1}
1017
+ @click=${() => {
1018
+ this.date = s[s.indexOf(this.date) + 1];
1019
+ }}>Next →</button>
1020
+ <span class="spacer"></span>
1021
+ <span class="asof">Live games first · report a score to see it update here</span>
1022
+ </div>
1023
+ ${a.length ? m : d`<p class="empty">No ${this.sport} games on this date.</p>`}
1024
+ ${[...o.entries()].map(([i, n]) => d`
1025
+ <div class="section-title">${i}</div>
1026
+ <div class="card"><ul class="gamelist">
1027
+ ${n.map((l) => this.renderGame(t, l))}
1028
+ </ul></div>
1029
+ `)}
1030
+ </div>
1031
+ `;
1032
+ }
1033
+ renderGame(t, e) {
1034
+ const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` : Q(e.time);
1035
+ return d`
1036
+ <li>
1037
+ ${q(e)}
1038
+ <span class="opp">${ot(t, e.awayTeamId, e.date)} at ${ot(t, e.homeTeamId, e.date)}</span>
1039
+ <span class="res" style="width:auto">${s}</span>
1040
+ <span class="where">${e.venue || ""}</span>
1041
+ ${e.broadcast ? d`<span class="pill class">${e.broadcast}</span>` : m}
1042
+ <a class="box" href=${$(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
1043
+ </li>
1044
+ `;
1045
+ }
1046
+ }
1047
+ globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Mt);
1048
+ class Lt extends b {
1049
+ static styles = H;
1050
+ static properties = {
1051
+ ...b.properties,
1052
+ sport: { type: String },
1053
+ season: { type: String },
1054
+ classFilter: { state: !0 },
1055
+ query: { state: !0 }
1056
+ };
1057
+ constructor() {
1058
+ super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
1059
+ }
1060
+ async fetchData(t) {
1061
+ const e = this.season || X(), [s, a, o, i, n] = await Promise.all([
1062
+ t.listConferences({ active: !0 }),
1063
+ t.listSchools(),
1064
+ t.listTeams({ sport: this.sport }),
1065
+ t.listGames({ sport: this.sport, season: e }),
1066
+ t.listRankings({ sport: this.sport })
1067
+ ]);
1068
+ return {
1069
+ season: e,
1070
+ conferences: s.items,
1071
+ schools: a.items,
1072
+ teams: o.items,
1073
+ games: i.items,
1074
+ rankings: n.items
1075
+ };
1076
+ }
1077
+ get ctx() {
1078
+ return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1079
+ teamsById: g(this.data.teams),
1080
+ schoolsById: g(this.data.schools),
1081
+ records: M(this.data.games),
1082
+ rankings: this.data.rankings,
1083
+ hrefs: L(this),
1084
+ sport: this.sport
1085
+ }, this._ctxData = this.data), this._ctx;
1086
+ }
1087
+ renderView() {
1088
+ const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((a) => a.classifications || []))].slice(0, 9), s = this.data.conferences.filter((a) => a.active !== !1).filter((a) => this.classFilter === "All" || (a.classifications || []).includes(this.classFilter));
1089
+ return d`
1090
+ <div class="band">
1091
+ <div class="inner">
1092
+ <h1>${J(this.sport)} standings</h1>
1093
+ <p class="sub">${this.data.season} season · every conference, computed live from reported results</p>
1094
+ </div>
1095
+ </div>
1096
+ <div class="view">
1097
+ <div class="toolbar">
1098
+ <div role="group" aria-label="Classification filter">
1099
+ ${e.map((a) => d`<button class="chip ${this.classFilter === a ? "on" : ""}"
1100
+ @click=${() => {
1101
+ this.classFilter = a;
1102
+ }}>${a}</button>`)}
1103
+ </div>
1104
+ <input type="search" placeholder="Find a school…" aria-label="Find a school"
1105
+ .value=${this.query} @input=${(a) => {
1106
+ this.query = a.target.value;
1107
+ }}>
1108
+ <span class="spacer"></span>
1109
+ <span class="asof">Records through ${y(rt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
1110
+ </div>
1111
+ ${s.map((a) => this.renderConference(t, a))}
1112
+ </div>
1113
+ `;
1114
+ }
1115
+ renderConference(t, e) {
1116
+ const s = this.data.teams.filter((i) => i.conferenceId === e.id);
1117
+ if (!s.length) return m;
1118
+ const a = this.query.trim().toLowerCase(), o = Ft(s, t.records);
1119
+ return d`
1120
+ <div class="card">
1121
+ <div class="card-head">
1122
+ <h2>${e.name}</h2>
1123
+ ${(e.classifications || []).map((i) => d`<span class="pill class">${i}</span>`)}
1124
+ <span class="meta">${o.length} teams · membership derives from teams</span>
1125
+ </div>
1126
+ <div class="tablewrap"><table class="data">
1127
+ <thead><tr>
1128
+ <th>#</th><th>Team</th><th class="num">Conf</th><th class="num">Pct</th>
1129
+ <th class="num">Overall</th><th class="num">Pct</th><th class="num">PF</th><th class="num">PA</th><th class="num">Diff</th>
1130
+ <th>Streak</th><th>Last 5</th><th>Next</th>
1131
+ </tr></thead>
1132
+ <tbody>
1133
+ ${o.map((i, n) => this.renderRow(t, i, n, a))}
1134
+ </tbody>
1135
+ </table></div>
1136
+ </div>
1137
+ `;
1138
+ }
1139
+ renderRow(t, e, s, a) {
1140
+ const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
1141
+ if (a && !i.toLowerCase().includes(a)) return m;
1142
+ const n = e.rec.pf - e.rec.pa, l = pt(this.data.games, e.team.id), p = (e.team.championships || []).map((c) => d`
1143
+ <span class="pill champ" title="${c.season} ${c.title} champion">★ ${c.season} ${c.title}</span>`), h = () => {
1144
+ location.href = $(t.hrefs.school, { id: e.team.schoolId });
1145
+ };
1146
+ return d`
1147
+ <tr class="rowlink" @click=${(c) => {
1148
+ c.target.closest("a") || h();
1149
+ }}>
1150
+ <td class="mut">${s + 1}</td>
1151
+ <td class="teamcell">
1152
+ ${F(o)}${ft(t, e.team.id, null)}
1153
+ <a href=${$(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${p}
1154
+ </td>
1155
+ <td class="num">${x(e.rec, !0)}</td>
1156
+ <td class="num">${Ct(e.confPct)}</td>
1157
+ <td class="num">${x(e.rec)}</td>
1158
+ <td class="num">${Ct(e.overallPct)}</td>
1159
+ <td class="num">${e.rec.pf}</td>
1160
+ <td class="num">${e.rec.pa}</td>
1161
+ <td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
1162
+ <td>${Z(e.rec.results) || "·"}</td>
1163
+ <td>${ut(t, e.team.id)}</td>
1164
+ <td>${Ht(t, l, e.team.id)}</td>
1165
+ </tr>
1166
+ `;
1167
+ }
1168
+ }
1169
+ globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Lt);
1170
+ const Te = w`
1171
+ .hero1 {
1172
+ border-radius: var(--hsot-radius-md); color: var(--hsot-white);
1173
+ padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
1174
+ margin-bottom: 1.1rem; flex-wrap: wrap;
1175
+ }
1176
+ .hero1 .bigrank { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 3.4rem; line-height: 1; opacity: 0.9; }
1177
+ .hero1 h2 { margin: 0; font-family: var(--hsot-heading-font); font-size: 2rem; font-weight: 700; }
1178
+ .hero1 a { color: inherit; }
1179
+ .hero1 .facts { font-size: 0.95rem; opacity: 0.92; }
1180
+ .delta { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
1181
+ .delta.up { color: var(--hsot-win); }
1182
+ .delta.down { color: var(--hsot-loss); }
1183
+ .delta.same { color: var(--hsot-gray-4); }
1184
+ .delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
1185
+ .sparkline { vertical-align: middle; }
1186
+ `;
1187
+ class jt extends b {
1188
+ static styles = [...H, Te];
1189
+ static properties = {
1190
+ ...b.properties,
1191
+ sport: { type: String },
1192
+ gender: { type: String },
1193
+ season: { type: String },
1194
+ pollDate: { state: !0 }
1195
+ };
1196
+ constructor() {
1197
+ super(), this.sport = "football", this.gender = "", this.season = "", this.pollDate = "";
1198
+ }
1199
+ connectedCallback() {
1200
+ super.connectedCallback();
1201
+ const t = new URLSearchParams(globalThis.location?.search || "").get("poll");
1202
+ t && (this.pollDate = t);
1203
+ }
1204
+ async fetchData(t) {
1205
+ const e = this.season || X(), [s, a, o, i, n] = await Promise.all([
1206
+ t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
1207
+ t.listSchools(),
1208
+ t.listTeams({ sport: this.sport }),
1209
+ t.listConferences(),
1210
+ t.listGames({ sport: this.sport, season: e })
1211
+ ]), l = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, h) => h.effectiveDate.localeCompare(p.effectiveDate));
1212
+ return {
1213
+ season: e,
1214
+ polls: l,
1215
+ schools: a.items,
1216
+ teams: o.items,
1217
+ conferences: i.items,
1218
+ games: n.items
1219
+ };
1220
+ }
1221
+ get ctx() {
1222
+ return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1223
+ teamsById: g(this.data.teams),
1224
+ schoolsById: g(this.data.schools),
1225
+ records: M(this.data.games),
1226
+ rankings: this.data.polls,
1227
+ hrefs: L(this),
1228
+ sport: this.sport
1229
+ }, this._ctxData = this.data), this._ctx;
1230
+ }
1231
+ sparkline(t, e, s) {
1232
+ const n = e.map((c, f) => {
1233
+ const u = (c.teamIds || []).indexOf(t);
1234
+ if (u === -1) return null;
1235
+ const v = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, tt = 3 + u / 24 * 20;
1236
+ return { x: v, y: tt };
1237
+ }), l = [];
1238
+ let p = [];
1239
+ if (n.forEach((c) => {
1240
+ c ? p.push(c) : p.length && (l.push(p), p = []);
1241
+ }), p.length && l.push(p), !l.length) return m;
1242
+ const h = n[s];
1243
+ return d`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
1244
+ ${l.map((c) => At`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
1245
+ points=${c.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
1246
+ ${h ? At`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
1247
+ </svg>`;
1248
+ }
1249
+ movement(t, e, s) {
1250
+ const a = Ae(t, e, s);
1251
+ return a.kind === "up" ? d`<span class="delta up">▲ ${a.delta}</span>` : a.kind === "down" ? d`<span class="delta down">▼ ${a.delta}</span>` : a.kind === "new" ? d`<span class="delta new">NEW</span>` : a.kind === "same" ? d`<span class="delta same">—</span>` : d`<span class="delta same">·</span>`;
1252
+ }
1253
+ renderView() {
1254
+ const t = this.ctx, e = this.data.polls;
1255
+ if (!e.length) return d`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
1256
+ const s = Math.max(0, e.findIndex((c) => c.effectiveDate === this.pollDate)), a = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(a), l = g(this.data.conferences), p = (a.teamIds || [])[0], h = p ? N(t, p) : null;
1257
+ return d`
1258
+ <div class="band">
1259
+ <div class="inner">
1260
+ <h1>${J(this.sport)} Top 25</h1>
1261
+ <p class="sub">The HighSchoolOT poll · updated weekly · ${e.length} polls this season</p>
1262
+ </div>
1263
+ </div>
1264
+ <div class="view">
1265
+ <div class="toolbar">
1266
+ <label class="asof" for="pollsel">Poll of</label>
1267
+ <select id="pollsel" @change=${(c) => {
1268
+ this.pollDate = c.target.value;
1269
+ }}>
1270
+ ${e.map((c, f) => d`<option value=${c.effectiveDate} ?selected=${c === a}>
1271
+ ${y(c.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1272
+ </option>`)}
1273
+ </select>
1274
+ <button class="chip" ?disabled=${s >= e.length - 1}
1275
+ @click=${() => {
1276
+ this.pollDate = e[s + 1].effectiveDate;
1277
+ }}>← Older</button>
1278
+ <button class="chip" ?disabled=${s <= 0}
1279
+ @click=${() => {
1280
+ this.pollDate = e[s - 1].effectiveDate;
1281
+ }}>Newer →</button>
1282
+ <span class="spacer"></span>
1283
+ <span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
1284
+ </div>
1285
+ ${h ? this.renderHero(t, a, o, p, h, l) : m}
1286
+ <div class="card"><div class="tablewrap"><table class="data">
1287
+ <thead><tr>
1288
+ <th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
1289
+ <th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
1290
+ </tr></thead>
1291
+ <tbody>
1292
+ ${(a.teamIds || []).map((c, f) => f === 0 || !c ? m : this.renderRow(t, a, o, i, n, l, c, f + 1))}
1293
+ </tbody>
1294
+ </table></div></div>
1295
+ <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>
1296
+ </div>
1297
+ `;
1298
+ }
1299
+ renderHero(t, e, s, a, o, i) {
1300
+ const n = t.records[a], l = Et(t.records, a), p = i[t.teamsById[a]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1301
+ return d`
1302
+ <div class="hero1" style="background:${h}">
1303
+ <div class="bigrank">#1</div>
1304
+ ${F(o, 64)}
1305
+ <div>
1306
+ <h2><a href=${$(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
1307
+ <div class="facts">
1308
+ ${x(n)} overall${p ? d` · ${x(n, !0)} ${p.name}` : m}
1309
+ · streak ${Z(n?.results) || "·"}
1310
+ ${l ? d` · last: ${l.mark} ${l.my}-${l.their} vs ${V(t, l.opp)}` : m}
1311
+ &nbsp;${this.movement(e, s, a)}
1312
+ </div>
1313
+ </div>
1314
+ </div>
1315
+ `;
1316
+ }
1317
+ renderRow(t, e, s, a, o, i, n, l) {
1318
+ const p = N(t, n);
1319
+ if (!p) return m;
1320
+ const h = t.records[n], c = Et(t.records, n), f = pt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], v = () => {
1321
+ location.href = $(t.hrefs.school, { id: p.id });
1322
+ };
1323
+ return d`
1324
+ <tr class="rowlink" @click=${(tt) => {
1325
+ tt.target.closest("a") || v();
1326
+ }}>
1327
+ <td class="num" style="font-weight:700">${l}</td>
1328
+ <td>${this.movement(e, s, n)}</td>
1329
+ <td class="teamcell">${F(p)}<a href=${$(t.hrefs.school, { id: p.id })}>${p.name}</a>
1330
+ <span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
1331
+ <td class="num">${x(h)}</td>
1332
+ <td class="mut">${u?.name || "Independent"}</td>
1333
+ <td>${c ? d`<a class="box" style="text-decoration:none" href=${$(t.hrefs.game, { sport: this.sport, id: c.gameId })}>
1334
+ <b style="color:${c.mark === "W" ? "var(--hsot-win)" : c.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${c.mark}</b>
1335
+ ${c.my}-${c.their} vs ${V(t, c.opp)}</a>` : d`<span class="mut">·</span>`}</td>
1336
+ <td>${Ht(t, f, n)}</td>
1337
+ <td>${this.sparkline(n, a, o)}</td>
1338
+ </tr>
1339
+ `;
1340
+ }
1341
+ }
1342
+ globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", jt);
1343
+ const Ie = w`
1344
+ .schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
1345
+ .schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
1346
+ .schoolhero .crest {
1347
+ width: 84px; height: 84px; border-radius: 50%; flex: none;
1348
+ display: flex; align-items: center; justify-content: center;
1349
+ font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.5rem;
1350
+ border: 3px solid rgba(255,255,255,0.6);
1351
+ }
1352
+ .schoolhero h1 { margin: 0; font-family: var(--hsot-heading-font); font-size: 2.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
1353
+ .schoolhero .mascot { font-size: 1.05rem; opacity: 0.85; font-family: var(--hsot-heading-font); text-transform: uppercase; letter-spacing: 0.06em; }
1354
+ .schoolhero .facts { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin-top: 0.55rem; font-size: 0.85rem; opacity: 0.95; }
1355
+ .schoolhero .facts b { font-weight: 500; opacity: 0.75; margin-right: 0.3rem; font-family: var(--hsot-heading-font); text-transform: uppercase; font-size: 0.72rem; }
1356
+ .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 0 0 1rem; }
1357
+ .tile { background: var(--hsot-white); border: 1px solid var(--hsot-gray-2); border-radius: var(--hsot-radius-md); padding: 0.75rem 0.9rem; }
1358
+ .tile .k { font-family: var(--hsot-heading-font); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; font-weight: 700; color: var(--hsot-red-deep); }
1359
+ .tile .v { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.7rem; line-height: 1.15; color: var(--hsot-black); }
1360
+ .tile .s { font-size: 0.78rem; color: var(--hsot-gray-5); }
1361
+ .cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
1362
+ @media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
1363
+ `;
1364
+ class Gt extends b {
1365
+ static styles = [...H, Ie];
1366
+ static properties = {
1367
+ ...b.properties,
1368
+ schoolId: { type: String, attribute: "school-id" },
1369
+ sport: { type: String },
1370
+ season: { type: String },
1371
+ activeTeamId: { state: !0 }
1372
+ };
1373
+ constructor() {
1374
+ super(), this.schoolId = "", this.sport = "", this.season = "", this.activeTeamId = "";
1375
+ }
1376
+ connectedCallback() {
1377
+ super.connectedCallback();
1378
+ const t = new URLSearchParams(globalThis.location?.search || "").get("sport");
1379
+ t && !this.sport && (this.sport = t);
1380
+ }
1381
+ async fetchData(t) {
1382
+ const e = this.season || X(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find((v) => v.sport === (this.sport || "football")) || o[0] || null, [n, l, p, h, c, f, u] = await Promise.all([
1383
+ i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
1384
+ i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
1385
+ t.listSchools(),
1386
+ t.listConferences(),
1387
+ i ? t.listRankings({ sport: i.sport }) : Promise.resolve({ items: [] }),
1388
+ i ? t.listRosters({ teamId: i.id }) : Promise.resolve({ items: [] }),
1389
+ i ? t.listPlayers() : Promise.resolve({ items: [] })
1390
+ ]);
1391
+ return {
1392
+ season: e,
1393
+ school: s,
1394
+ teams: o,
1395
+ active: i,
1396
+ games: n.items,
1397
+ allTeams: l.items,
1398
+ schools: p.items,
1399
+ conferences: h.items,
1400
+ rankings: c.items,
1401
+ roster: f.items.find((v) => v.season === e) || null,
1402
+ players: u.items
1403
+ };
1404
+ }
1405
+ get ctx() {
1406
+ return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1407
+ teamsById: g(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
1408
+ schoolsById: g(this.data.schools),
1409
+ records: M(this.data.games),
1410
+ rankings: this.data.rankings,
1411
+ hrefs: L(this),
1412
+ sport: this.data.active?.sport || "football"
1413
+ }, this._ctxData = this.data), this._ctx;
1414
+ }
1415
+ switchSport(t) {
1416
+ this.sport = t, this.load();
1417
+ }
1418
+ renderView() {
1419
+ const { school: t, teams: e, active: s, season: a } = this.data;
1420
+ if (!t) return d`<div class="view"><p class="empty">School not found.</p></div>`;
1421
+ const o = this.ctx, i = W(t.colorPrimary || "#030711"), n = (t.adm || [])[0], l = g(this.data.conferences), p = s ? l[s.conferenceId] : null;
1422
+ return d`
1423
+ <div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
1424
+ <div class="inner">
1425
+ <div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${W(t.colorSecondary || "#7C7C7C")}">${mt(t)}</div>
1426
+ <div style="min-width:260px">
1427
+ <h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
1428
+ <div class="facts">
1429
+ ${t.location ? d`<span><b>Location</b>${t.location}${t.county ? d` · ${t.county} County` : m}</span>` : m}
1430
+ ${t.association ? d`<span><b>League</b>${t.association}${t.classification ? d` · ${t.classification}` : m}</span>` : m}
1431
+ ${p ? d`<span><b>Conference</b>${p.name}</span>` : m}
1432
+ ${n ? d`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
1433
+ ${t.openingYear ? d`<span><b>Opened</b>${t.openingYear}</span>` : m}
1434
+ ${t.areaCode ? d`<span><b>Area</b>${t.areaCode}</span>` : m}
1435
+ ${t.tagSlug ? d`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
1436
+ </div>
1437
+ </div>
1438
+ </div>
1439
+ </div>
1440
+ <div class="band">
1441
+ <nav class="tabs" aria-label="Teams">
1442
+ ${e.map((h) => h.id === s?.id ? d`<a class="on" href="#" @click=${(c) => c.preventDefault()}>${h.name}</a>` : d`<a href="#" @click=${(c) => {
1443
+ c.preventDefault(), this.switchSport(h.sport);
1444
+ }}>${h.name}</a>`)}
1445
+ </nav>
1446
+ </div>
1447
+ <div class="view">
1448
+ ${s ? this.renderTeam(o, s, p, a) : d`<p class="empty">No teams recorded for this school yet.</p>`}
1449
+ </div>
1450
+ `;
1451
+ }
1452
+ renderTeam(t, e, s, a) {
1453
+ 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((c) => c.conferenceId === s.id) : [], l = s ? Ft(n, t.records).findIndex((c) => c.team.id === e.id) + 1 : 0, p = Ut(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((c) => c.homeTeamId === e.id || c.awayTeamId === e.id).sort((c, f) => String(c.date).localeCompare(String(f.date)));
1454
+ return d`
1455
+ <div class="tiles">
1456
+ <div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
1457
+ <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
1458
+ <div class="s">${l ? `${ke(l)} of ${n.length}` : "·"}</div></div>
1459
+ <div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
1460
+ <div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
1461
+ <div class="tile"><div class="k">Streak</div><div class="v">${Z(o.results) || "·"}</div>
1462
+ <div class="s">last 5: ${ut(t, e.id)}</div></div>
1463
+ <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
1464
+ <div class="s"><a href=${$(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
1465
+ </div>
1466
+ ${(e.championships || []).length ? d`
1467
+ <div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
1468
+ ${e.championships.map((c) => d`<span class="pill champ">★ ${c.season} ${c.title} champion${c.classification ? ` · ${c.classification}` : ""}${c.region ? ` · ${c.region}` : ""}</span>`)}
1469
+ </div>` : m}
1470
+ <div class="cols">
1471
+ <div>
1472
+ <div class="section-title">Schedule &amp; results</div>
1473
+ <div class="card">
1474
+ ${h.length ? d`<ul class="gamelist">${h.map((c) => this.renderGameRow(t, e, c))}</ul>` : d`<p class="empty">No ${e.sport} games recorded for ${a}.</p>`}
1475
+ </div>
1476
+ </div>
1477
+ <div>
1478
+ <div class="section-title">Roster · ${a}</div>
1479
+ <div class="card">${this.renderRoster(a)}</div>
1480
+ </div>
1481
+ </div>
1482
+ `;
1483
+ }
1484
+ renderGameRow(t, e, s) {
1485
+ const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
1486
+ let l = d`<span class="mut">${Q(s.time)}</span>`;
1487
+ if (s.state === "final") {
1488
+ const h = ht(s), c = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
1489
+ l = d`<span class=${c}>${c}</span> ${i}-${n}${s.finish === "overtime" ? d` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? d` <span class="mut">FF</span>` : m}`;
1490
+ } else s.state === "live" && (l = d`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
1491
+ const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1492
+ return d`
1493
+ <li>
1494
+ <span class="d">${y(s.date)}</span>
1495
+ ${q(s)}
1496
+ <span class="res">${l}</span>
1497
+ <span class="opp">${a ? "vs" : "at"} ${ot(t, o, s.date)}
1498
+ <span class="pill type">${p}</span>
1499
+ ${s.broadcast ? d`<span class="pill class">${s.broadcast}</span>` : m}
1500
+ </span>
1501
+ <span class="where">${s.venue || ""}</span>
1502
+ <a class="box" href=${$(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
1503
+ </li>
1504
+ `;
1505
+ }
1506
+ renderRoster(t) {
1507
+ const e = this.data.roster;
1508
+ if (!e)
1509
+ return d`<p class="empty">Roster not published for ${t}.</p>`;
1510
+ const s = g(this.data.players), a = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
1511
+ return d`
1512
+ <div class="tablewrap"><table class="data">
1513
+ <thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th></tr></thead>
1514
+ <tbody>
1515
+ ${a.map((o) => {
1516
+ const i = s[o.playerId];
1517
+ return i ? d`<tr>
1518
+ <td class="num mut">${o.number ?? "·"}</td>
1519
+ <td style="font-weight:500">${i.firstName} ${i.lastName}</td>
1520
+ <td>${o.position || "·"}</td>
1521
+ <td class="mut">${i.classOf || "·"}</td>
1522
+ <td class="num">${_e(i.heightIn)}</td>
1523
+ <td class="num">${i.weightLb || "·"}</td>
1524
+ </tr>` : m;
1525
+ })}
1526
+ </tbody>
1527
+ </table></div>
1528
+ `;
1529
+ }
1530
+ }
1531
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Gt);
1532
+ const Ce = w`
1533
+ .breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
1534
+ .breadcrumbs a { text-decoration: none; }
1535
+ .scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
1536
+ .scorehead .teamblock { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
1537
+ .scorehead .teamblock.right { flex-direction: row-reverse; text-align: right; }
1538
+ .scorehead .crest {
1539
+ width: 58px; height: 58px; border-radius: 50%; flex: none;
1540
+ display: flex; align-items: center; justify-content: center;
1541
+ font-family: var(--hsot-heading-font); font-weight: 700; color: var(--hsot-white);
1542
+ }
1543
+ .scorehead .tname { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }
1544
+ .scorehead .tname a { color: inherit; text-decoration: none; }
1545
+ .scorehead .trec { font-size: 0.8rem; color: var(--hsot-gray-5); }
1546
+ .scorehead .mid { text-align: center; }
1547
+ .scorehead .bigscore { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--hsot-black); white-space: nowrap; }
1548
+ .scorehead .status { margin-top: 0.3rem; font-size: 0.8rem; color: var(--hsot-gray-5); }
1549
+ .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
1550
+ .ctxcard { padding: 0.85rem 1rem; }
1551
+ .ctxcard .who { font-family: var(--hsot-heading-font); font-weight: 700; margin-bottom: 0.4rem; }
1552
+ .ctxcard .row { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.85rem; }
1553
+ @media (max-width: 640px) {
1554
+ .scorehead { grid-template-columns: 1fr; text-align: center; }
1555
+ .scorehead .teamblock, .scorehead .teamblock.right { flex-direction: column; text-align: center; }
1556
+ .cols { grid-template-columns: 1fr; }
1557
+ }
1558
+ `;
1559
+ class Wt extends b {
1560
+ static styles = [...H, Ce];
1561
+ static properties = {
1562
+ ...b.properties,
1563
+ gameId: { type: String, attribute: "game-id" }
1564
+ };
1565
+ constructor() {
1566
+ super(), this.gameId = "";
1567
+ }
1568
+ async fetchData(t) {
1569
+ const e = await t.getGame(this.gameId), [s, a, o, i, n] = await Promise.all([
1570
+ t.listSchools(),
1571
+ t.listTeams({ sport: e.sport }),
1572
+ t.listConferences(),
1573
+ t.listRankings({ sport: e.sport }),
1574
+ t.listGames({ sport: e.sport, season: e.season })
1575
+ ]);
1576
+ return {
1577
+ game: e,
1578
+ schools: s.items,
1579
+ teams: a.items,
1580
+ conferences: o.items,
1581
+ rankings: i.items,
1582
+ games: n.items
1583
+ };
1584
+ }
1585
+ get ctx() {
1586
+ return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1587
+ teamsById: g(this.data.teams),
1588
+ schoolsById: g(this.data.schools),
1589
+ records: M(this.data.games),
1590
+ rankings: this.data.rankings,
1591
+ hrefs: L(this),
1592
+ sport: this.data.game.sport
1593
+ }, this._ctxData = this.data), this._ctx;
1594
+ }
1595
+ renderView() {
1596
+ const t = this.data.game;
1597
+ if (!t) return d`<div class="view"><p class="empty">Game not found.</p></div>`;
1598
+ const e = this.ctx, s = g(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 = ht(t), n = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", l = t.conferenceId ? s[t.conferenceId] : null, p = 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));
1599
+ return d`
1600
+ <div class="view">
1601
+ <p class="breadcrumbs">
1602
+ <a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>${J(t.sport)}</a> /
1603
+ <a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
1604
+ ${P(e, t.awayTeamId)} at ${P(e, t.homeTeamId)}
1605
+ </p>
1606
+ <div class="card">
1607
+ <div class="scorehead">
1608
+ ${this.teamBlock(e, t, t.awayTeamId, a, !1)}
1609
+ <div class="mid">
1610
+ <div class="bigscore">
1611
+ <span style=${n("away")}>${t.awayScore}</span>
1612
+ <span class="mut" style="font-size:1.6rem">–</span>
1613
+ <span style=${n("home")}>${t.homeScore}</span>
1614
+ </div>
1615
+ <div class="status">${q(t)}</div>
1616
+ <div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? d` · ${Q(t.time)}` : m} · ${t.venue || "Venue TBD"}
1617
+ ${t.broadcast ? d` · <span class="pill class">${t.broadcast}</span>` : m}</div>
1618
+ <div class="status">
1619
+ <span class="pill type">${t.gameType === "conference" ? `${l?.name || "Conference"} game` : t.gameType}</span>
1620
+ ${t.label ? d`<span class="pill type">Bracket ${t.label}</span>` : m}
1621
+ ${(t.tags || []).map((h) => d`<span class="pill type">${h}</span>`)}
1622
+ </div>
1623
+ </div>
1624
+ ${this.teamBlock(e, t, t.homeTeamId, o, !0)}
1625
+ </div>
1626
+ ${this.renderLineScore(t, a, o)}
1627
+ ${t.notes ? d`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
1628
+ </div>
1629
+ ${t.storyAssetId || t.videoAssetId ? d`
1630
+ <div class="section-title">Coverage</div>
1631
+ <div class="card" style="padding:0.8rem 1rem;display:flex;gap:0.5rem;flex-wrap:wrap;align-items:center">
1632
+ ${t.storyAssetId ? d`<span class="pill class" title="Game.storyAssetId">Game story · ${t.storyAssetId}</span>` : m}
1633
+ ${t.videoAssetId ? d`<span class="pill class" title="Game.videoAssetId">Highlights · ${t.videoAssetId}</span>` : m}
1634
+ <span class="asof">Story and video ride the Game resource as Studio asset references.</span>
1635
+ </div>` : m}
1636
+ <div class="section-title">Season context</div>
1637
+ <div class="cols">
1638
+ ${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h, c]) => this.renderContext(e, h, c))}
1639
+ </div>
1640
+ ${p.length ? d`
1641
+ <div class="section-title">Head to head this season</div>
1642
+ <div class="card"><ul class="gamelist">
1643
+ ${p.map((h) => d`<li>
1644
+ <span class="d">${y(h.date)}</span>${q(h)}
1645
+ <span class="opp">${P(e, h.awayTeamId)} ${h.awayScore}, ${P(e, h.homeTeamId)} ${h.homeScore}</span>
1646
+ <a class="box" href=${$(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
1647
+ </li>`)}
1648
+ </ul></div>` : m}
1649
+ </div>
1650
+ `;
1651
+ }
1652
+ teamBlock(t, e, s, a, o) {
1653
+ if (!a) return d`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
1654
+ const i = t.teamsById[s], n = t.records[s];
1655
+ return d`
1656
+ <div class="teamblock ${o ? "right" : ""}">
1657
+ <span class="crest" style="background:${a.colorPrimary || "#030711"};color:${W(a.colorPrimary || "#030711")}">${mt(a)}</span>
1658
+ <div>
1659
+ <div class="tname">${ft(t, s, e.date)}<a href=${$(t.hrefs.school, { id: a.id })}>${a.name}</a></div>
1660
+ <div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ? d` · ${x(n, !0)} conf` : m}</div>
1661
+ </div>
1662
+ </div>
1663
+ `;
1664
+ }
1665
+ renderLineScore(t, e, s) {
1666
+ const a = t.periodScores || [];
1667
+ if (!a.length)
1668
+ return d`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
1669
+ const o = Math.max(4, ...a.map((p) => p.period)), i = (p) => p <= 4 ? String(p) : `OT${p > 5 ? p - 4 : ""}`, n = (p, h) => {
1670
+ const c = a.find((f) => f.period === h);
1671
+ return c ? c[p] : t.state === "final" ? 0 : "·";
1672
+ }, l = (p, h, c) => d`
1673
+ <tr>
1674
+ <td class="teamcell">${F(p, 20)}${p?.abbr || "TBD"}</td>
1675
+ ${Array.from({ length: o }, (f, u) => d`<td class="num">${n(h, u + 1)}</td>`)}
1676
+ <td class="num" style="font-weight:700">${c}</td>
1677
+ </tr>`;
1678
+ return d`
1679
+ <div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
1680
+ <table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
1681
+ <thead><tr><th>Team</th>${Array.from({ length: o }, (p, h) => d`<th class="num">${i(h + 1)}</th>`)}<th class="num">T</th></tr></thead>
1682
+ <tbody>
1683
+ ${l(e, "away", t.awayScore)}
1684
+ ${l(s, "home", t.homeScore)}
1685
+ </tbody>
1686
+ </table>
1687
+ </div>
1688
+ `;
1689
+ }
1690
+ renderContext(t, e, s) {
1691
+ if (!s) return m;
1692
+ const a = t.records[e], o = pt(this.data.games, e);
1693
+ return d`
1694
+ <div class="card ctxcard">
1695
+ <div class="who">${F(s)}${s.name}</div>
1696
+ <div class="row">
1697
+ <span>Last 5: ${ut(t, e)}</span>
1698
+ <span>Streak: <b>${a ? Z(a.results) : "·"}</b></span>
1699
+ <span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
1700
+ <span>Next: ${o ? d`${y(o.date, { month: "numeric", day: "numeric" })}
1701
+ ${o.homeTeamId === e ? "vs" : "at"} ${V(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
1702
+ </div>
1703
+ </div>
1704
+ `;
1705
+ }
1706
+ }
1707
+ globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Wt);
1708
+ const Ee = {
1709
+ "hsot-scores": Mt,
1710
+ "hsot-standings": Lt,
1711
+ "hsot-rankings": jt,
1712
+ "hsot-school": Gt,
1713
+ "hsot-boxscore": Wt
1714
+ };
1715
+ function Pe() {
1716
+ const r = globalThis?.customElements;
1717
+ if (r)
1718
+ for (const [t, e] of Object.entries(Ee))
1719
+ r.get(t) || r.define(t, e);
1720
+ }
1721
+ typeof window < "u" && globalThis.customElements && Pe();
1722
+ export {
1723
+ Pe as defineAll
1724
+ };