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