@umriss-ui/table 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/table.js CHANGED
@@ -2,29 +2,29 @@ import "./table.css";
2
2
  var Tn = Object.defineProperty;
3
3
  var On = (e, t, n) => t in e ? Tn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
4
  var j = (e, t, n) => On(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { useState as W, useCallback as le, useMemo as q, useRef as ce, useId as me, useContext as je, useSyncExternalStore as We, createContext as pt, useLayoutEffect as X, useEffect as Wt } from "react";
5
+ import { useState as W, useCallback as ae, useMemo as q, useRef as ce, useId as me, useContext as je, useSyncExternalStore as We, createContext as pt, useLayoutEffect as X, useEffect as Wt } from "react";
6
6
  import { DEFAULT_FORMATS as qt, useVirtual as Mn, useFormats as be, useWording as re, Checkbox as Le, DateRangePicker as Fn, FormField as nt, NumberInput as ot, Tooltip as Ie, Popover as mt, Button as fe, TagGroup as Ut, Tag as Yt, Menu as Jt, MenuItem as Ke, MenuSeparator as Ln, VisuallyHidden as De, Select as Xt, DatePicker as Dn, Input as Qt, useDensityFor as Zt, AngleGlyph as Rn, assess as Pn, verdictWeight as rt, DEFAULT_WORDING as En, Badge as Pe, useFreshness as zn } from "@umriss-ui/core";
7
7
  import { jsx as u, jsxs as R, Fragment as ne } from "react/jsx-runtime";
8
8
  import { createPortal as In } from "react-dom";
9
9
  function Vn(e) {
10
- const [t, n] = W(/* @__PURE__ */ new Set()), o = le((a) => t.has(a), [t]), r = le((a) => {
10
+ const [t, n] = W(/* @__PURE__ */ new Set()), o = ae((l) => t.has(l), [t]), r = ae((l) => {
11
11
  n((f) => {
12
12
  const d = new Set(f);
13
- return d.has(a) ? d.delete(a) : d.add(a), d;
13
+ return d.has(l) ? d.delete(l) : d.add(l), d;
14
14
  });
15
15
  }, []), s = q(
16
- () => e.length > 0 && e.every((a) => t.has(a)),
16
+ () => e.length > 0 && e.every((l) => t.has(l)),
17
17
  [e, t]
18
18
  ), i = q(
19
- () => !s && e.some((a) => t.has(a)),
19
+ () => !s && e.some((l) => t.has(l)),
20
20
  [e, t, s]
21
- ), l = le(() => {
22
- n((a) => {
23
- const f = new Set(a);
21
+ ), a = ae(() => {
22
+ n((l) => {
23
+ const f = new Set(l);
24
24
  return e.length > 0 && e.every((p) => f.has(p)) ? e.forEach((p) => f.delete(p)) : e.forEach((p) => f.add(p)), f;
25
25
  });
26
- }, [e]), c = le(() => n(/* @__PURE__ */ new Set()), []);
27
- return { selected: t, isSelected: o, toggle: r, toggleAll: l, clear: c, allSelected: s, someSelected: i, count: t.size };
26
+ }, [e]), c = ae(() => n(/* @__PURE__ */ new Set()), []);
27
+ return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
28
28
  }
29
29
  const Q = (e) => e == null || typeof e == "number" && Number.isNaN(e);
30
30
  function qe(e) {
@@ -99,18 +99,18 @@ function vt(e, t) {
99
99
  if (o === "distinct") return new Set(n.map(ke)).size;
100
100
  const r = n.filter((c) => Tt(c) !== void 0);
101
101
  if (r.length === 0) return;
102
- const s = r.map((c) => Tt(c)), i = r[0] instanceof Date, l = (c) => i ? new Date(c) : c;
102
+ const s = r.map((c) => Tt(c)), i = r[0] instanceof Date, a = (c) => i ? new Date(c) : c;
103
103
  switch (o) {
104
104
  case "sum":
105
- return s.reduce((c, a) => c + a, 0);
105
+ return s.reduce((c, l) => c + l, 0);
106
106
  case "avg":
107
- return s.reduce((c, a) => c + a, 0) / s.length;
107
+ return s.reduce((c, l) => c + l, 0) / s.length;
108
108
  case "min":
109
- return l(Math.min(...s));
109
+ return a(Math.min(...s));
110
110
  case "max":
111
- return l(Math.max(...s));
111
+ return a(Math.max(...s));
112
112
  case "range":
113
- return [l(Math.min(...s)), l(Math.max(...s))];
113
+ return [a(Math.min(...s)), a(Math.max(...s))];
114
114
  }
115
115
  }
116
116
  const yt = 3, Ve = (e) => {
@@ -124,12 +124,12 @@ function Qe(e, t, n) {
124
124
  function $n(e, t) {
125
125
  const n = t.compareText ?? qt.compareText, o = (r, s, i) => {
126
126
  var O;
127
- const l = /* @__PURE__ */ new Map(), c = t.levels[s];
127
+ const a = /* @__PURE__ */ new Map(), c = t.levels[s];
128
128
  if (!c) return [];
129
- const a = /* @__PURE__ */ new Map();
129
+ const l = /* @__PURE__ */ new Map();
130
130
  for (const y of r) {
131
131
  const _ = c.value(y), L = ke(_);
132
- let g = a.get(L);
132
+ let g = l.get(L);
133
133
  g || (g = {
134
134
  path: JSON.stringify([...i, L]),
135
135
  value: Q(_) ? void 0 : _,
@@ -137,9 +137,9 @@ function $n(e, t) {
137
137
  rows: [],
138
138
  groups: [],
139
139
  aggregates: {}
140
- }, a.set(L, g), l.set(g, [...i, L])), g.rows.push(y);
140
+ }, l.set(L, g), a.set(g, [...i, L])), g.rows.push(y);
141
141
  }
142
- for (const y of a.values())
142
+ for (const y of l.values())
143
143
  for (const _ of t.aggregates ?? []) y.aggregates[_.id] = vt(_, y.rows);
144
144
  const f = (O = t.sort) == null ? void 0 : O.find(
145
145
  (y) => {
@@ -153,17 +153,17 @@ function $n(e, t) {
153
153
  Ve(g) !== void 0 && (_ === void 0 || Qe(g, _, n) < 0) && (_ = g);
154
154
  }
155
155
  return _;
156
- }, S = (y) => {
156
+ }, k = (y) => {
157
157
  if (p === void 0) return c.order ? b(y) : y.value;
158
158
  const _ = y.aggregates[p];
159
159
  return Array.isArray(_) ? _[0] : _;
160
- }, w = [...a.values()].sort((y, _) => {
160
+ }, w = [...l.values()].sort((y, _) => {
161
161
  if (y.value === void 0 || _.value === void 0) return Qe(y.value, _.value, n);
162
- const L = S(y), g = S(_), k = Qe(L, g, n);
163
- return Ve(L) === void 0 || Ve(g) === void 0 ? k : k * d;
162
+ const L = k(y), g = k(_), S = Qe(L, g, n);
163
+ return Ve(L) === void 0 || Ve(g) === void 0 ? S : S * d;
164
164
  });
165
165
  for (const y of w)
166
- y.groups = o(y.rows, s + 1, l.get(y));
166
+ y.groups = o(y.rows, s + 1, a.get(y));
167
167
  return w;
168
168
  };
169
169
  return o(e, 0, []);
@@ -196,11 +196,11 @@ function Wn(e, t, n, o) {
196
196
  function qn(e, t) {
197
197
  const n = [], o = (r, s) => {
198
198
  for (const i of r) {
199
- const l = t.has(i.path);
199
+ const a = t.has(i.path);
200
200
  if (i.groups.length === 0 && i.level === 0) {
201
- if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !l)
201
+ if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !a)
202
202
  for (const c of i.rows) n.push({ kind: "row", row: c, parents: [i], span: void 0, first: !1, continued: !1 });
203
- } else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }), l || o(i.groups, [...s, i])) : l ? n.push({ kind: "folded", group: i, parents: s }) : i.rows.forEach((c, a) => n.push({ kind: "row", row: c, parents: s, span: i, first: a === 0, continued: !1 }));
203
+ } else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }), a || o(i.groups, [...s, i])) : a ? n.push({ kind: "folded", group: i, parents: s }) : i.rows.forEach((c, l) => n.push({ kind: "row", row: c, parents: s, span: i, first: l === 0, continued: !1 }));
204
204
  }
205
205
  };
206
206
  return o(e, []), n;
@@ -235,12 +235,12 @@ function kt(e, t, n) {
235
235
  filter: r,
236
236
  sort: s = null,
237
237
  page: i = 1,
238
- pageSize: l,
238
+ pageSize: a,
239
239
  hidden: c,
240
- order: a
241
- } = n, f = xt(t, a), d = c != null && c.length ? f.filter((F) => F.hideable === !1 || !c.includes(F.id)) : f;
240
+ order: l
241
+ } = n, f = xt(t, l), d = c != null && c.length ? f.filter((F) => F.hideable === !1 || !c.includes(F.id)) : f;
242
242
  if (n.manual) {
243
- const { rowCount: F } = n.manual, m = l && l > 0 ? l : Math.max(F, 1), x = Math.max(1, Math.ceil(F / m)), A = F > 0 ? Math.min(Math.max(1, i), x) : Math.max(1, i);
243
+ const { rowCount: F } = n.manual, m = a && a > 0 ? a : Math.max(F, 1), x = Math.max(1, Math.ceil(F / m)), A = F > 0 ? Math.min(Math.max(1, i), x) : Math.max(1, i);
244
244
  return {
245
245
  columns: d,
246
246
  filtered: [...e],
@@ -250,10 +250,10 @@ function kt(e, t, n) {
250
250
  columnCount: d.length
251
251
  };
252
252
  }
253
- const p = o.trim().toLowerCase(), b = t.filter((F) => F.searchable && F.value), S = (F) => !p || b.some((m) => {
253
+ const p = o.trim().toLowerCase(), b = t.filter((F) => F.searchable && F.value), k = (F) => !p || b.some((m) => {
254
254
  const x = m.value(F);
255
255
  return !Me(x) && String(x).toLowerCase().includes(p);
256
- }), w = e.filter((F) => S(F) && (r ? r(F) : !0)), O = Array.isArray(s) ? s : s ? [s] : [], y = O.map((F) => {
256
+ }), w = e.filter((F) => k(F) && (r ? r(F) : !0)), O = Array.isArray(s) ? s : s ? [s] : [], y = O.map((F) => {
257
257
  const m = t.find((M) => M.id === F.column);
258
258
  if (!m || !m.compare && !m.value) return null;
259
259
  const x = F.direction === "asc" ? 1 : -1, A = m.compare, v = m.value;
@@ -269,7 +269,7 @@ function kt(e, t, n) {
269
269
  }
270
270
  return 0;
271
271
  }), (T = n.grouping) != null && T.levels.length) {
272
- const { folded: F, ...m } = n.grouping, x = $n(w, { ...m, sort: O }), A = qn(x, F), v = Un(A, i, l ?? 0);
272
+ const { folded: F, ...m } = n.grouping, x = $n(w, { ...m, sort: O }), A = qn(x, F), v = Un(A, i, a ?? 0);
273
273
  return {
274
274
  columns: d,
275
275
  filtered: w,
@@ -282,55 +282,55 @@ function kt(e, t, n) {
282
282
  columnCount: d.length
283
283
  };
284
284
  }
285
- const _ = l && l > 0 ? l : w.length || 1, L = Math.max(1, Math.ceil(w.length / _)), g = Math.min(Math.max(1, i), L), k = w.slice((g - 1) * _, g * _);
285
+ const _ = a && a > 0 ? a : w.length || 1, L = Math.max(1, Math.ceil(w.length / _)), g = Math.min(Math.max(1, i), L), S = w.slice((g - 1) * _, g * _);
286
286
  return {
287
287
  columns: d,
288
288
  filtered: w,
289
- visible: k,
289
+ visible: S,
290
290
  page: g,
291
291
  pageCount: L,
292
292
  columnCount: d.length
293
293
  };
294
294
  }
295
295
  function Jn(e, t, n) {
296
- const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, manual: a } = n, [f, d] = W((i == null ? void 0 : i.search) ?? ""), [p, b] = W(() => {
296
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c, manual: l } = n, [f, d] = W((i == null ? void 0 : i.search) ?? ""), [p, b] = W(() => {
297
297
  var D;
298
298
  return (D = i == null ? void 0 : i.sort) != null && D.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
299
- }), [S, w] = W((i == null ? void 0 : i.page) ?? 1), [O, y] = W(
299
+ }), [k, w] = W((i == null ? void 0 : i.page) ?? 1), [O, y] = W(
300
300
  (i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
301
- ), [_, L] = W([]), [g, k] = W((i == null ? void 0 : i.hidden) ?? []), [T, F] = W((i == null ? void 0 : i.order) ?? []), [m, x] = W(() => {
301
+ ), [_, L] = W([]), [g, S] = W((i == null ? void 0 : i.hidden) ?? []), [T, F] = W((i == null ? void 0 : i.order) ?? []), [m, x] = W(() => {
302
302
  if (i != null && i.widths) return { ...i.widths };
303
303
  const D = {};
304
304
  for (const G of t)
305
305
  G.width !== void 0 && (D[G.id] = G.width);
306
306
  return D;
307
- }), A = l ? 0 : O, v = q(
307
+ }), A = a ? 0 : O, v = q(
308
308
  () => kt(e, t, {
309
309
  search: f,
310
310
  filter: r,
311
311
  sort: p,
312
- page: S,
312
+ page: k,
313
313
  pageSize: A,
314
314
  hidden: g,
315
315
  order: T,
316
316
  grouping: c,
317
- manual: a
317
+ manual: l
318
318
  }),
319
- [e, t, f, r, p, S, A, g, T, c, a]
320
- ), M = Mn(l ? (v.lines ?? v.filtered).length : 0, {
321
- rowHeight: (l == null ? void 0 : l.rowHeight) ?? 0,
322
- overscan: l == null ? void 0 : l.overscan
319
+ [e, t, f, r, p, k, A, g, T, c, l]
320
+ ), M = Mn(a ? (v.lines ?? v.filtered).length : 0, {
321
+ rowHeight: (a == null ? void 0 : a.rowHeight) ?? 0,
322
+ overscan: a == null ? void 0 : a.overscan
323
323
  }), N = q(
324
- () => l && v.lines ? v.lines.slice(M.from, M.to) : v.visibleLines,
325
- [l, v.lines, v.visibleLines, M.from, M.to]
324
+ () => a && v.lines ? v.lines.slice(M.from, M.to) : v.visibleLines,
325
+ [a, v.lines, v.visibleLines, M.from, M.to]
326
326
  ), I = q(
327
- () => l ? N ? _t(N) : v.filtered.slice(M.from, M.to) : v.visible,
328
- [l, N, v.filtered, v.visible, M.from, M.to]
329
- ), P = q(() => v.filtered.map(o), [v.filtered, o]), $ = Vn(P), U = le((D) => {
327
+ () => a ? N ? _t(N) : v.filtered.slice(M.from, M.to) : v.visible,
328
+ [a, N, v.filtered, v.visible, M.from, M.to]
329
+ ), P = q(() => v.filtered.map(o), [v.filtered, o]), $ = Vn(P), U = ae((D) => {
330
330
  d(D), w(1);
331
- }, []), Z = le((D) => {
331
+ }, []), Z = ae((D) => {
332
332
  y(D), w(1);
333
- }, []), he = le((D, G = !1) => {
333
+ }, []), he = ae((D, G = !1) => {
334
334
  b((K) => {
335
335
  const C = K.find((E) => E.column === D);
336
336
  if (!G) {
@@ -341,18 +341,18 @@ function Jn(e, t, n) {
341
341
  (E) => E.column === D ? { column: D, direction: "desc" } : E
342
342
  ) : K.filter((E) => E.column !== D) : [...K, { column: D, direction: "asc" }];
343
343
  }), w(1);
344
- }, []), se = le((D) => {
344
+ }, []), se = ae((D) => {
345
345
  L(
346
346
  (G) => G.includes(D) ? G.filter((K) => K !== D) : [...G, D]
347
347
  );
348
- }, []), ve = le(
348
+ }, []), ve = ae(
349
349
  (D) => _.includes(D),
350
350
  [_]
351
- ), Se = le((D) => {
352
- k(
351
+ ), Se = ae((D) => {
352
+ S(
353
353
  (G) => G.includes(D) ? G.filter((K) => K !== D) : [...G, D]
354
354
  );
355
- }, []), Oe = le((D, G) => {
355
+ }, []), Oe = ae((D, G) => {
356
356
  x((K) => {
357
357
  if (G === void 0) {
358
358
  if (!(D in K)) return K;
@@ -361,13 +361,13 @@ function Jn(e, t, n) {
361
361
  }
362
362
  return { ...K, [D]: G };
363
363
  });
364
- }, []), Ce = le(
364
+ }, []), Ce = ae(
365
365
  (D) => {
366
366
  var G;
367
367
  return (G = p.find((K) => K.column === D)) == null ? void 0 : G.direction;
368
368
  },
369
369
  [p]
370
- ), ue = le(
370
+ ), ue = ae(
371
371
  (D) => {
372
372
  if (p.length < 2) return;
373
373
  const G = p.findIndex((K) => K.column === D);
@@ -402,14 +402,14 @@ function Jn(e, t, n) {
402
402
  /* Without paging there is no page a view could carry - a page three in
403
403
  the view of a virtualised table would be a promise nobody redeems on
404
404
  opening. */
405
- ...!l && v.page > 1 ? { page: v.page } : {},
406
- ...!l && O !== ge ? { pageSize: O } : {},
405
+ ...!a && v.page > 1 ? { page: v.page } : {},
406
+ ...!a && O !== ge ? { pageSize: O } : {},
407
407
  ...g.length ? { hidden: g } : {},
408
408
  ...T.length ? { order: T } : {},
409
409
  ...Object.keys(Ne).length ? { widths: Ne } : {}
410
410
  }),
411
411
  [
412
- l,
412
+ a,
413
413
  f,
414
414
  p,
415
415
  xe,
@@ -425,8 +425,8 @@ function Jn(e, t, n) {
425
425
  ...v,
426
426
  visible: I,
427
427
  visibleLines: N,
428
- virtual: l ? M : void 0,
429
- manual: a,
428
+ virtual: a ? M : void 0,
429
+ manual: l,
430
430
  view: J,
431
431
  search: f,
432
432
  setSearch: U,
@@ -484,14 +484,14 @@ function ro() {
484
484
  return typeof ((t = e.env) == null ? void 0 : t.DEV) == "boolean" ? e.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
485
485
  }
486
486
  const on = ro(), Ot = /* @__PURE__ */ new Set();
487
- function ae(e, t) {
487
+ function le(e, t) {
488
488
  !on || Ot.has(e) || (Ot.add(e), console.warn(`@umriss-ui/table: ${t}`));
489
489
  }
490
- const so = "_frame_1x6w6_11 _text_k1tvc_23", io = "_children_1x6w6_24", lo = "_scroll_1x6w6_33 _scroll_k1tvc_40", ao = "_footerTarget_1x6w6_41", co = "_table_1x6w6_45", uo = "_th_1x6w6_53 _ring_k1tvc_69", fo = "_sticky_1x6w6_68", ho = "_td_1x6w6_76", go = "_rowHeader_1x6w6_88", po = "_compact_1x6w6_104", mo = "_numeric_1x6w6_137", bo = "_absent_1x6w6_149", wo = "_striped_1x6w6_153", vo = "_pinned_1x6w6_180", yo = "_pinStartEdge_1x6w6_196", _o = "_pinEndEdge_1x6w6_197", xo = "_sortButton_1x6w6_227 _ring_k1tvc_69", ko = "_sortIndicator_1x6w6_252", So = "_sortArrow_1x6w6_259", Co = "_sortArrowDesc_1x6w6_263", No = "_sortActive_1x6w6_271", Ao = "_sortRank_1x6w6_277", To = "_thFlex_1x6w6_285", Oo = "_footerKind_1x6w6_310", Mo = "_emptyCell_1x6w6_318", Fo = "_empty_1x6w6_318", Lo = "_emptyTitle_1x6w6_334", Do = "_skeleton_1x6w6_343", Ro = "_toolbar_1x6w6_375 _text_k1tvc_23", Po = "_toolbarGroup_1x6w6_389", Eo = "_toolbarInfo_1x6w6_406", zo = "_pagination_1x6w6_412 _text_k1tvc_23", Io = "_paginationControls_1x6w6_425", Vo = "_pageSize_1x6w6_432", Bo = "_paginationStatus_1x6w6_444", Go = "_filterButton_1x6w6_453 _ring_k1tvc_69", $o = "_filterActive_1x6w6_480", Ho = "_filterPanel_1x6w6_485", Ko = "_filterContent_1x6w6_499 _scroll_k1tvc_40", jo = "_filterFooter_1x6w6_510", Wo = "_filterLabel_1x6w6_524", qo = "_filterValue_1x6w6_534", Uo = "_filteredCount_1x6w6_540", Yo = "_rangeFields_1x6w6_551", Jo = "_rangePeriod_1x6w6_561", Xo = "_conditions_1x6w6_567", Qo = "_conditionButton_1x6w6_573", Zo = "_condition_1x6w6_567", er = "_columnsPanel_1x6w6_598", tr = "_columnsList_1x6w6_607", nr = "_columnsEntry_1x6w6_616", or = "_move_1x6w6_628", rr = "_pinOn_1x6w6_666", sr = "_groupingChoice_1x6w6_676", ir = "_groupingHeading_1x6w6_684", lr = "_groupingOptions_1x6w6_693", ar = "_groupingOption_1x6w6_693 _ring_k1tvc_69", cr = "_groupingLevel_1x6w6_736", ur = "_groupingTag_1x6w6_741", dr = "_groupingTrigger_1x6w6_748", fr = "_groupingPrefix_1x6w6_754", hr = "_groupingPath_1x6w6_759", gr = "_groupingSeparator_1x6w6_763", pr = "_groupHeader_1x6w6_780", mr = "_spanCell_1x6w6_821", br = "_groupFolded_1x6w6_899", wr = "_spanValue_1x6w6_903", vr = "_groupLabel_1x6w6_904", yr = "_spanText_1x6w6_916", _r = "_groupValue_1x6w6_917", xr = "_groupCount_1x6w6_924", kr = "_continued_1x6w6_938", Sr = "_spanSelect_1x6w6_969", Cr = "_fold_1x6w6_983", Nr = "_foldClosed_1x6w6_1019", Ar = "_foldedCount_1x6w6_1029", Tr = "_shareHost_1x6w6_1037", Or = "_shareBar_1x6w6_1044", Mr = "_expander_1x6w6_1056", Fr = "_expanderOpen_1x6w6_1091", Lr = "_detailRow_1x6w6_1095", Dr = "_detailCell_1x6w6_1095", Rr = "_actionsCell_1x6w6_1103", Pr = "_actions_1x6w6_1103", Er = "_grip_1x6w6_1131", zr = "_virtualBody_1x6w6_1172", Ir = "_virtualRow_1x6w6_1188", Vr = "_fillerRow_1x6w6_1212", Br = "_grid_1x6w6_1225", Gr = "_editing_1x6w6_1241", $r = "_editingValue_1x6w6_1245", Hr = "_editor_1x6w6_1249", Kr = "_editorField_1x6w6_1260", jr = "_editorMessage_1x6w6_1278", Wr = "_control_1x6w6_168", h = {
490
+ const so = "_frame_1x6w6_11 _text_k1tvc_23", io = "_children_1x6w6_24", ao = "_scroll_1x6w6_33 _scroll_k1tvc_40", lo = "_footerTarget_1x6w6_41", co = "_table_1x6w6_45", uo = "_th_1x6w6_53 _ring_k1tvc_69", fo = "_sticky_1x6w6_68", ho = "_td_1x6w6_76", go = "_rowHeader_1x6w6_88", po = "_compact_1x6w6_104", mo = "_numeric_1x6w6_137", bo = "_absent_1x6w6_149", wo = "_striped_1x6w6_153", vo = "_pinned_1x6w6_180", yo = "_pinStartEdge_1x6w6_196", _o = "_pinEndEdge_1x6w6_197", xo = "_sortButton_1x6w6_227 _ring_k1tvc_69", ko = "_sortIndicator_1x6w6_252", So = "_sortArrow_1x6w6_259", Co = "_sortArrowDesc_1x6w6_263", No = "_sortActive_1x6w6_271", Ao = "_sortRank_1x6w6_277", To = "_thFlex_1x6w6_285", Oo = "_footerKind_1x6w6_310", Mo = "_emptyCell_1x6w6_318", Fo = "_empty_1x6w6_318", Lo = "_emptyTitle_1x6w6_334", Do = "_skeleton_1x6w6_343", Ro = "_toolbar_1x6w6_375 _text_k1tvc_23", Po = "_toolbarGroup_1x6w6_389", Eo = "_toolbarInfo_1x6w6_406", zo = "_pagination_1x6w6_412 _text_k1tvc_23", Io = "_paginationControls_1x6w6_425", Vo = "_pageSize_1x6w6_432", Bo = "_paginationStatus_1x6w6_444", Go = "_filterButton_1x6w6_453 _ring_k1tvc_69", $o = "_filterActive_1x6w6_480", Ho = "_filterPanel_1x6w6_485", Ko = "_filterContent_1x6w6_499 _scroll_k1tvc_40", jo = "_filterFooter_1x6w6_510", Wo = "_filterLabel_1x6w6_524", qo = "_filterValue_1x6w6_534", Uo = "_filteredCount_1x6w6_540", Yo = "_rangeFields_1x6w6_551", Jo = "_rangePeriod_1x6w6_561", Xo = "_conditions_1x6w6_567", Qo = "_conditionButton_1x6w6_573", Zo = "_condition_1x6w6_567", er = "_columnsPanel_1x6w6_598", tr = "_columnsList_1x6w6_607", nr = "_columnsEntry_1x6w6_616", or = "_move_1x6w6_628", rr = "_pinOn_1x6w6_666", sr = "_groupingChoice_1x6w6_676", ir = "_groupingHeading_1x6w6_684", ar = "_groupingOptions_1x6w6_693", lr = "_groupingOption_1x6w6_693 _ring_k1tvc_69", cr = "_groupingLevel_1x6w6_736", ur = "_groupingTag_1x6w6_741", dr = "_groupingTrigger_1x6w6_748", fr = "_groupingPrefix_1x6w6_754", hr = "_groupingPath_1x6w6_759", gr = "_groupingSeparator_1x6w6_763", pr = "_groupHeader_1x6w6_780", mr = "_spanCell_1x6w6_821", br = "_groupFolded_1x6w6_899", wr = "_spanValue_1x6w6_903", vr = "_groupLabel_1x6w6_904", yr = "_spanText_1x6w6_916", _r = "_groupValue_1x6w6_917", xr = "_groupCount_1x6w6_924", kr = "_continued_1x6w6_938", Sr = "_spanSelect_1x6w6_969", Cr = "_fold_1x6w6_983", Nr = "_foldClosed_1x6w6_1019", Ar = "_foldedCount_1x6w6_1029", Tr = "_shareHost_1x6w6_1037", Or = "_shareBar_1x6w6_1044", Mr = "_expander_1x6w6_1056", Fr = "_expanderOpen_1x6w6_1091", Lr = "_detailRow_1x6w6_1095", Dr = "_detailCell_1x6w6_1095", Rr = "_actionsCell_1x6w6_1103", Pr = "_actions_1x6w6_1103", Er = "_grip_1x6w6_1131", zr = "_virtualBody_1x6w6_1172", Ir = "_virtualRow_1x6w6_1188", Vr = "_fillerRow_1x6w6_1212", Br = "_grid_1x6w6_1225", Gr = "_editing_1x6w6_1241", $r = "_editingValue_1x6w6_1245", Hr = "_editor_1x6w6_1249", Kr = "_editorField_1x6w6_1260", jr = "_editorMessage_1x6w6_1278", Wr = "_control_1x6w6_168", h = {
491
491
  frame: so,
492
492
  children: io,
493
- scroll: lo,
494
- footerTarget: ao,
493
+ scroll: ao,
494
+ footerTarget: lo,
495
495
  table: co,
496
496
  th: uo,
497
497
  sticky: fo,
@@ -543,8 +543,8 @@ const so = "_frame_1x6w6_11 _text_k1tvc_23", io = "_children_1x6w6_24", lo = "_s
543
543
  pinOn: rr,
544
544
  groupingChoice: sr,
545
545
  groupingHeading: ir,
546
- groupingOptions: lr,
547
- groupingOption: ar,
546
+ groupingOptions: ar,
547
+ groupingOption: lr,
548
548
  groupingLevel: cr,
549
549
  groupingTag: ur,
550
550
  groupingTrigger: dr,
@@ -584,7 +584,7 @@ const so = "_frame_1x6w6_11 _text_k1tvc_23", io = "_children_1x6w6_24", lo = "_s
584
584
  editorMessage: jr,
585
585
  control: Wr
586
586
  };
587
- function dl(e) {
587
+ function ha(e) {
588
588
  return e;
589
589
  }
590
590
  const Be = /* @__PURE__ */ new WeakMap();
@@ -608,7 +608,7 @@ function Yr(e, t, n) {
608
608
  const o = Be.get(e);
609
609
  return o ? o.describeIn(t, n) : e.describe(t);
610
610
  }
611
- const Mt = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, ln = (e) => (t, n) => {
611
+ const Mt = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, an = (e) => (t, n) => {
612
612
  const o = Mt(t.value), r = Mt(n.value);
613
613
  return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
614
614
  };
@@ -616,22 +616,22 @@ function it(e, t, n) {
616
616
  const o = /* @__PURE__ */ new Map();
617
617
  let r = !1;
618
618
  for (const i of e) {
619
- const l = t(i);
620
- if (Q(l)) {
619
+ const a = t(i);
620
+ if (Q(a)) {
621
621
  r = !0;
622
622
  continue;
623
623
  }
624
- const c = l instanceof Date ? `date:${l.getTime()}` : typeof l == "object" || typeof l == "function" ? l : `${typeof l}:${String(l)}`;
625
- o.has(c) || o.set(c, l);
624
+ const c = a instanceof Date ? `date:${a.getTime()}` : typeof a == "object" || typeof a == "function" ? a : `${typeof a}:${String(a)}`;
625
+ o.has(c) || o.set(c, a);
626
626
  }
627
- return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(ln(n)).map(({ value: i }) => i), absent: r };
627
+ return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(an(n)).map(({ value: i }) => i), absent: r };
628
628
  }
629
629
  const Ft = /* @__PURE__ */ new WeakMap();
630
- function lt(e) {
630
+ function at(e) {
631
631
  let t = Ft.get(e);
632
632
  return t || (t = new Set(e.map(ke)), Ft.set(e, t)), t;
633
633
  }
634
- const at = (e, t) => Q(e) ? t.wording.cellAbsentValue : Re(e, t.format, t.formats, t.wording) ?? String(e);
634
+ const lt = (e, t) => Q(e) ? t.wording.cellAbsentValue : Re(e, t.format, t.formats, t.wording) ?? String(e);
635
635
  function Jr({
636
636
  condition: e,
637
637
  setCondition: t,
@@ -639,20 +639,20 @@ function Jr({
639
639
  absentOccurs: o = !1,
640
640
  format: r
641
641
  }) {
642
- const s = be(), i = re(), l = q(() => e ?? [], [e]), c = q(() => {
643
- const d = { formats: s, wording: i, format: r }, p = n.map((O) => ({ key: ke(O), text: at(O, d), value: O }));
644
- p.sort(ln(s));
645
- const b = new Set(p.map((O) => O.key)), S = l.filter((O) => !Q(O) && !b.has(ke(O))).map((O) => ({ key: ke(O), text: at(O, d), value: O })), w = o || l.some(Q) ? [{ key: wt, text: i.cellAbsentValue, value: null }] : [];
646
- return [...p, ...S, ...w];
647
- }, [n, l, o, r, s, i]), a = lt(l), f = (d) => {
648
- const p = a.has(d.key) ? l.filter((b) => ke(b) !== d.key) : [...l, d.value];
642
+ const s = be(), i = re(), a = q(() => e ?? [], [e]), c = q(() => {
643
+ const d = { formats: s, wording: i, format: r }, p = n.map((O) => ({ key: ke(O), text: lt(O, d), value: O }));
644
+ p.sort(an(s));
645
+ const b = new Set(p.map((O) => O.key)), k = a.filter((O) => !Q(O) && !b.has(ke(O))).map((O) => ({ key: ke(O), text: lt(O, d), value: O })), w = o || a.some(Q) ? [{ key: wt, text: i.cellAbsentValue, value: null }] : [];
646
+ return [...p, ...k, ...w];
647
+ }, [n, a, o, r, s, i]), l = at(a), f = (d) => {
648
+ const p = l.has(d.key) ? a.filter((b) => ke(b) !== d.key) : [...a, d.value];
649
649
  t(p.length > 0 ? p : null);
650
650
  };
651
651
  return /* @__PURE__ */ u("div", { className: h.filterContent, children: c.map((d) => /* @__PURE__ */ u(
652
652
  Le,
653
653
  {
654
654
  label: d.text,
655
- checked: a.has(d.key),
655
+ checked: l.has(d.key),
656
656
  onChange: () => f(d)
657
657
  },
658
658
  d.key
@@ -660,18 +660,18 @@ function Jr({
660
660
  }
661
661
  const Xr = rn(
662
662
  {
663
- matches: (e, t) => lt(t).has(ke(e)),
663
+ matches: (e, t) => at(t).has(ke(e)),
664
664
  Input: Jr,
665
665
  describe: (e) => e.map((t) => Q(t) ? "–" : String(t)).join(", ")
666
666
  },
667
667
  {
668
668
  isCondition: (e) => Array.isArray(e),
669
669
  isEmpty: (e) => e.length === 0,
670
- absentMatches: (e) => lt(e).has(wt),
670
+ absentMatches: (e) => at(e).has(wt),
671
671
  /* From three values on the first two and how many more: a condition is one
672
672
  line in the table toolbar, not a list. */
673
673
  describeIn: (e, t) => {
674
- const n = e.map((r) => at(r, t));
674
+ const n = e.map((r) => lt(r, t));
675
675
  if (n.length <= 2) return n.join(", ");
676
676
  const o = n.length - 2;
677
677
  return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
@@ -679,8 +679,8 @@ const Xr = rn(
679
679
  }
680
680
  ), Qr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Zr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), Fe = (e) => typeof e == "number" && Number.isFinite(e), we = (e) => e instanceof Date && !Number.isNaN(e.getTime()), es = (e) => we(e) ? Qr(e) : Fe(e) ? e : void 0, ts = (e) => we(e) ? { value: Zr(e), open: !0 } : Fe(e) ? { value: e, open: !1 } : void 0, $e = (e, t) => we(e) ? t.formats.date(e) : Re(e, t.format, t.formats, t.wording) ?? String(e);
681
681
  function ns({ condition: e, setCondition: t }) {
682
- const n = re(), [o, r] = W(null), s = o !== null, i = o ? o.from : Fe(e == null ? void 0 : e.from) ? e.from : null, l = o ? o.to : Fe(e == null ? void 0 : e.to) ? e.to : null, c = (a, f) => {
683
- const d = { from: i, to: l, [a]: f };
682
+ const n = re(), [o, r] = W(null), s = o !== null, i = o ? o.from : Fe(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : Fe(e == null ? void 0 : e.to) ? e.to : null, c = (l, f) => {
683
+ const d = { from: i, to: a, [l]: f };
684
684
  if (d.from !== null && d.to !== null && d.from > d.to) {
685
685
  r(d);
686
686
  return;
@@ -695,8 +695,8 @@ function ns({ condition: e, setCondition: t }) {
695
695
  });
696
696
  };
697
697
  return /* @__PURE__ */ R("div", { className: h.rangeFields, children: [
698
- /* @__PURE__ */ u(nt, { label: n.filterFrom, children: /* @__PURE__ */ u(ot, { size: "sm", value: i, invalid: s, onChange: (a) => c("from", a) }) }),
699
- /* @__PURE__ */ u(nt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ u(ot, { size: "sm", value: l, onChange: (a) => c("to", a) }) })
698
+ /* @__PURE__ */ u(nt, { label: n.filterFrom, children: /* @__PURE__ */ u(ot, { size: "sm", value: i, invalid: s, onChange: (l) => c("from", l) }) }),
699
+ /* @__PURE__ */ u(nt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ u(ot, { size: "sm", value: a, onChange: (l) => c("to", l) }) })
700
700
  ] });
701
701
  }
702
702
  function os({ condition: e, setCondition: t }) {
@@ -884,8 +884,8 @@ class is {
884
884
  key: t,
885
885
  spec: n,
886
886
  read: (i) => {
887
- const l = s.spec.value;
888
- return typeof l == "string" ? Dt(i, l) : l(i);
887
+ const a = s.spec.value;
888
+ return typeof a == "string" ? Dt(i, a) : a(i);
889
889
  }
890
890
  };
891
891
  this.columns.entries.set(t, s), this.structure++;
@@ -904,8 +904,8 @@ class is {
904
904
  const t = /* @__PURE__ */ new Set();
905
905
  let n = 0;
906
906
  for (const { spec: o } of this.columns.entries.values())
907
- t.has(o.id) && ae(`id:${o.id}`, `Two columns carry the id "${o.id}". The second one is passed over.`), t.add(o.id), o.rowHeader && n++;
908
- n > 1 && ae("rowHeader", "More than one column is `rowHeader`. A table has at most one row header; the first one holds.");
907
+ t.has(o.id) && le(`id:${o.id}`, `Two columns carry the id "${o.id}". The second one is passed over.`), t.add(o.id), o.rowHeader && n++;
908
+ n > 1 && le("rowHeader", "More than one column is `rowHeader`. A table has at most one row header; the first one holds.");
909
909
  }
910
910
  /** The table says during the render whether its row header sticks. Idempotent. */
911
911
  setStickyRowHeader(t) {
@@ -951,8 +951,8 @@ class is {
951
951
  key: t,
952
952
  spec: n,
953
953
  read: (i) => {
954
- const l = s.spec.value;
955
- return typeof l == "string" ? Dt(i, l) : l(i);
954
+ const a = s.spec.value;
955
+ return typeof a == "string" ? Dt(i, a) : a(i);
956
956
  }
957
957
  };
958
958
  this.groupKeys.entries.set(t, s), this.structure++;
@@ -990,7 +990,7 @@ class is {
990
990
  groupingEntries(t) {
991
991
  if (!this.tableGroupable) return [];
992
992
  if (this.manual)
993
- return this.orderedColumns().some((o) => o.spec.groupable === !0) && ae("manual-groupable-column", "`groupable` on a column is passed over in manual mode: the groups would be the page's, not the server's."), [];
993
+ return this.orderedColumns().some((o) => o.spec.groupable === !0) && le("manual-groupable-column", "`groupable` on a column is passed over in manual mode: the groups would be the page's, not the server's."), [];
994
994
  const n = /* @__PURE__ */ new Set();
995
995
  return [...this.orderedColumns(), ...this.groupKeys.ordered()].filter((o) => {
996
996
  if (n.has(o.spec.id)) return !1;
@@ -1008,26 +1008,26 @@ class is {
1008
1008
  /** The levels and aggregates for the model - the same identity as long as
1009
1009
  nothing changed that they read. */
1010
1010
  groupingModel(t, n) {
1011
- var l;
1011
+ var a;
1012
1012
  const o = [t.join("|"), this.structure, this.values].join(":");
1013
- if (((l = this.groupingCache) == null ? void 0 : l.key) === o) return this.groupingCache;
1014
- const r = this.groupingEntries(n), s = t.map((c) => r.find((a) => a.spec.id === c)).filter((c) => c !== void 0).map((c) => ({
1013
+ if (((a = this.groupingCache) == null ? void 0 : a.key) === o) return this.groupingCache;
1014
+ const r = this.groupingEntries(n), s = t.map((c) => r.find((l) => l.spec.id === c)).filter((c) => c !== void 0).map((c) => ({
1015
1015
  id: c.spec.id,
1016
- value: (a) => {
1017
- const f = c.read(a);
1016
+ value: (l) => {
1017
+ const f = c.read(l);
1018
1018
  if (f == null) return;
1019
1019
  const { ownGroupValue: d, group: p } = c.spec;
1020
1020
  return d ? d(f) : p ? Kn(p)(f) : f;
1021
1021
  },
1022
1022
  /* A value of one's own is a name; its groups stand by what they hold. */
1023
- order: c.spec.ownGroupValue ? (a) => st(c.read(a), c.spec.ownSortValue) : void 0
1023
+ order: c.spec.ownGroupValue ? (l) => st(c.read(l), c.spec.ownSortValue) : void 0
1024
1024
  })), i = this.orderedColumns().filter((c) => c.spec.aggregate !== void 0).map(
1025
1025
  (c) => ({
1026
1026
  id: c.spec.id,
1027
1027
  read: c.read,
1028
1028
  /* Read with the latest spec on every call: an aggregate of one's own
1029
1029
  written in the call is a new function on every render. */
1030
- aggregate: typeof c.spec.aggregate == "function" ? (a, f) => c.spec.aggregate(a, f) : c.spec.aggregate
1030
+ aggregate: typeof c.spec.aggregate == "function" ? (l, f) => c.spec.aggregate(l, f) : c.spec.aggregate
1031
1031
  })
1032
1032
  );
1033
1033
  return this.groupingCache = { key: o, levels: s, aggregates: i }, this.groupingCache;
@@ -1060,18 +1060,18 @@ class is {
1060
1060
  over the hook's calculation. */
1061
1061
  modelColumns(t, n) {
1062
1062
  var i;
1063
- const o = this.orderedColumns(), r = [this.structure, this.values, o.map((l) => l.key).join("|")].join(":");
1063
+ const o = this.orderedColumns(), r = [this.structure, this.values, o.map((a) => a.key).join("|")].join(":");
1064
1064
  if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
1065
1065
  return this.modelCache.columns;
1066
- const s = o.map((l) => {
1067
- const { spec: c } = l, a = this.kindOf(l, t), f = this.isSortable(l, t), d = c.searchable ?? a === "text", p = (b) => st(l.read(b), c.ownSortValue);
1066
+ const s = o.map((a) => {
1067
+ const { spec: c } = a, l = this.kindOf(a, t), f = this.isSortable(a, t), d = c.searchable ?? l === "text", p = (b) => st(a.read(b), c.ownSortValue);
1068
1068
  return {
1069
1069
  id: c.id,
1070
1070
  label: c.label,
1071
1071
  value: f || d ? p : void 0,
1072
1072
  /* Text sorts with the provider's comparison, not with the built-in
1073
1073
  German one (spec, the table of defaults). */
1074
- compare: a === "text" && !c.ownSortValue ? (b, S) => n.compareText(String(p(b)), String(p(S))) : void 0,
1074
+ compare: l === "text" && !c.ownSortValue ? (b, k) => n.compareText(String(p(b)), String(p(k))) : void 0,
1075
1075
  searchable: d,
1076
1076
  hideable: !c.rowHeader,
1077
1077
  resizable: c.resizable,
@@ -1093,11 +1093,11 @@ class is {
1093
1093
  /** The hook's projection when it calculated with the same columns - otherwise
1094
1094
  a new one, with the columns of this pass. */
1095
1095
  computedProjection() {
1096
- var l;
1096
+ var a;
1097
1097
  const t = this.hook, n = this.modelColumns(t.rows, t.formats), o = t.companion;
1098
1098
  if (n === t.modelColumns)
1099
1099
  return o;
1100
- if (((l = this.projectionCache) == null ? void 0 : l.hook) === t && this.projectionCache.columns === n) return this.projectionCache.projection;
1100
+ if (((a = this.projectionCache) == null ? void 0 : a.hook) === t && this.projectionCache.columns === n) return this.projectionCache.projection;
1101
1101
  const r = {
1102
1102
  search: o.search,
1103
1103
  filter: t.filter,
@@ -1108,7 +1108,7 @@ class is {
1108
1108
  order: o.order,
1109
1109
  grouping: this.groupingFor(t),
1110
1110
  manual: o.manual
1111
- }, s = kt(t.admitted, n, r), i = o.virtual ? ls(s, o.virtual.from, o.virtual.to) : s;
1111
+ }, s = kt(t.admitted, n, r), i = o.virtual ? as(s, o.virtual.from, o.virtual.to) : s;
1112
1112
  return this.projectionCache = { hook: t, columns: n, projection: i }, i;
1113
1113
  }
1114
1114
  /* --- The hook's snapshot ---------------------------------------------------------- */
@@ -1179,14 +1179,14 @@ class is {
1179
1179
  this.actions.entries.delete(t) && this.structure++;
1180
1180
  }
1181
1181
  }
1182
- function ls(e, t, n) {
1182
+ function as(e, t, n) {
1183
1183
  if (!e.lines) return { ...e, visible: e.filtered.slice(t, n) };
1184
1184
  const o = e.lines.slice(t, n);
1185
1185
  return { ...e, visibleLines: o, visible: _t(o) };
1186
1186
  }
1187
- const an = /* @__PURE__ */ new WeakMap(), as = (e, t) => {
1188
- an.set(e, t);
1189
- }, cs = (e) => typeof e == "function" || typeof e == "object" && e !== null ? an.get(e) : void 0, H = (...e) => e.filter(Boolean).join(" ");
1187
+ const ln = /* @__PURE__ */ new WeakMap(), ls = (e, t) => {
1188
+ ln.set(e, t);
1189
+ }, cs = (e) => typeof e == "function" || typeof e == "object" && e !== null ? ln.get(e) : void 0, H = (...e) => e.filter(Boolean).join(" ");
1190
1190
  function cn({
1191
1191
  entry: e,
1192
1192
  registry: t,
@@ -1195,30 +1195,30 @@ function cn({
1195
1195
  align: r,
1196
1196
  focus: s,
1197
1197
  open: i,
1198
- setOpen: l,
1198
+ setOpen: a,
1199
1199
  panelId: c
1200
1200
  }) {
1201
- const a = re(), f = be(), { id: d, label: p, format: b } = e.spec, { filterOptions: S } = n, w = S == null ? void 0 : S(d), { values: O, absent: y } = q(
1201
+ const l = re(), f = be(), { id: d, label: p, format: b } = e.spec, { filterOptions: k } = n, w = k == null ? void 0 : k(d), { values: O, absent: y } = q(
1202
1202
  () => w ? it(w, (F) => F, f) : it(n.admitted, e.read, f),
1203
1203
  [w, n.admitted, e, f]
1204
1204
  ), _ = Te(e.spec.filter);
1205
- if (n.publicSnapshot.manual && !w && e.spec.filter === "list" && ae(
1205
+ if (n.publicSnapshot.manual && !w && e.spec.filter === "list" && le(
1206
1206
  `manual-filter-options:${d}`,
1207
1207
  `The list filter of "${d}" offers only the values of the page in manual mode; \`filterOptions\` gives it the server's.`
1208
1208
  ), !_) return null;
1209
- const L = n.publicSnapshot, g = _.Input, k = qr(_) ? { absentOccurs: y, format: b, kind: t.kindOf(e, n.rows) } : {}, T = () => {
1209
+ const L = n.publicSnapshot, g = _.Input, S = qr(_) ? { absentOccurs: y, format: b, kind: t.kindOf(e, n.rows) } : {}, T = () => {
1210
1210
  var F;
1211
- l(!1), (F = (s ?? o).current) == null || F.focus();
1211
+ a(!1), (F = (s ?? o).current) == null || F.focus();
1212
1212
  };
1213
1213
  return /* @__PURE__ */ R(
1214
1214
  mt,
1215
1215
  {
1216
1216
  open: i,
1217
- onOpenChange: l,
1217
+ onOpenChange: a,
1218
1218
  anchorRef: o,
1219
1219
  align: r,
1220
1220
  role: "dialog",
1221
- ariaLabel: a.filterColumn(p),
1221
+ ariaLabel: l.filterColumn(p),
1222
1222
  id: c,
1223
1223
  className: h.filterPanel,
1224
1224
  children: [
@@ -1229,12 +1229,12 @@ function cn({
1229
1229
  setCondition: (F) => L.setFilter(d, F),
1230
1230
  values: O,
1231
1231
  column: { id: d, label: p },
1232
- ...k
1232
+ ...S
1233
1233
  }
1234
1234
  ),
1235
1235
  /* @__PURE__ */ R("div", { className: h.filterFooter, children: [
1236
- /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => L.setFilter(d, null), children: a.filterReset }),
1237
- /* @__PURE__ */ u(fe, { size: "sm", onClick: T, children: a.filterDone })
1236
+ /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => L.setFilter(d, null), children: l.filterReset }),
1237
+ /* @__PURE__ */ u(fe, { size: "sm", onClick: T, children: l.filterDone })
1238
1238
  ] })
1239
1239
  ]
1240
1240
  }
@@ -1245,17 +1245,17 @@ function us({
1245
1245
  registry: t,
1246
1246
  hook: n
1247
1247
  }) {
1248
- const o = re(), [r, s] = W(!1), i = ce(null), l = me(), { id: c, label: a } = e.spec, f = c in n.publicSnapshot.filter;
1248
+ const o = re(), [r, s] = W(!1), i = ce(null), a = me(), { id: c, label: l } = e.spec, f = c in n.publicSnapshot.filter;
1249
1249
  return /* @__PURE__ */ R(ne, { children: [
1250
1250
  /* @__PURE__ */ u(Ie, { content: o.filterHint, children: /* @__PURE__ */ u(
1251
1251
  "button",
1252
1252
  {
1253
1253
  type: "button",
1254
1254
  className: H(h.filterButton, f && h.filterActive),
1255
- "aria-label": o.filterColumn(a),
1255
+ "aria-label": o.filterColumn(l),
1256
1256
  "aria-haspopup": "dialog",
1257
1257
  "aria-expanded": r,
1258
- "aria-controls": r ? l : void 0,
1258
+ "aria-controls": r ? a : void 0,
1259
1259
  onClick: (d) => {
1260
1260
  i.current = d.currentTarget, s(!r);
1261
1261
  },
@@ -1282,17 +1282,17 @@ function us({
1282
1282
  align: "end",
1283
1283
  open: r,
1284
1284
  setOpen: s,
1285
- panelId: l
1285
+ panelId: a
1286
1286
  }
1287
1287
  )
1288
1288
  ] });
1289
1289
  }
1290
1290
  function ds({ registry: e, hook: t }) {
1291
1291
  const n = re(), o = be(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1292
- const l = e.columnById(s), c = l ? Te(l.spec.filter) : void 0;
1293
- if (!l || !c) return [];
1294
- const a = { formats: o, wording: n, format: l.spec.format, kind: e.kindOf(l, t.rows) };
1295
- return [{ entry: l, text: Yr(c, i, a) }];
1292
+ const a = e.columnById(s), c = a ? Te(a.spec.filter) : void 0;
1293
+ if (!a || !c) return [];
1294
+ const l = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
1295
+ return [{ entry: a, text: Yr(c, i, l) }];
1296
1296
  });
1297
1297
  return r.length === 0 ? null : /* @__PURE__ */ u(Ut, { "aria-label": n.conditions, className: h.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ u(fs, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
1298
1298
  }
@@ -1302,12 +1302,12 @@ function fs({
1302
1302
  registry: n,
1303
1303
  hook: o
1304
1304
  }) {
1305
- const r = re(), [s, i] = W(!1), l = ce(null), c = ce(null), a = me(), { id: f, label: d } = e.spec;
1305
+ const r = re(), [s, i] = W(!1), a = ce(null), c = ce(null), l = me(), { id: f, label: d } = e.spec;
1306
1306
  return /* @__PURE__ */ R(ne, { children: [
1307
1307
  /* @__PURE__ */ u(
1308
1308
  Yt,
1309
1309
  {
1310
- ref: l,
1310
+ ref: a,
1311
1311
  className: h.condition,
1312
1312
  onRemove: () => o.publicSnapshot.setFilter(f, null),
1313
1313
  removeLabel: r.removeConditionNamed(d, t),
@@ -1320,7 +1320,7 @@ function fs({
1320
1320
  "aria-label": r.editConditionNamed(d, t),
1321
1321
  "aria-haspopup": "dialog",
1322
1322
  "aria-expanded": s,
1323
- "aria-controls": s ? a : void 0,
1323
+ "aria-controls": s ? l : void 0,
1324
1324
  onClick: () => i(!s),
1325
1325
  children: [
1326
1326
  /* @__PURE__ */ u("span", { className: h.filterLabel, children: d }),
@@ -1336,12 +1336,12 @@ function fs({
1336
1336
  entry: e,
1337
1337
  registry: n,
1338
1338
  hook: o,
1339
- anchor: l,
1339
+ anchor: a,
1340
1340
  align: "start",
1341
1341
  focus: c,
1342
1342
  open: s,
1343
1343
  setOpen: i,
1344
- panelId: a
1344
+ panelId: l
1345
1345
  }
1346
1346
  )
1347
1347
  ] });
@@ -1387,7 +1387,7 @@ function ys({ registry: e, hook: t }) {
1387
1387
  return /* @__PURE__ */ R("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
1388
1388
  /* @__PURE__ */ u("h3", { className: h.groupingHeading, children: n.grouping }),
1389
1389
  /* @__PURE__ */ u("div", { className: h.groupingOptions, children: o.map((i) => {
1390
- const { id: l, label: c } = i.spec, a = r.indexOf(l), f = a !== -1;
1390
+ const { id: a, label: c } = i.spec, l = r.indexOf(a), f = l !== -1;
1391
1391
  return /* @__PURE__ */ R(
1392
1392
  "button",
1393
1393
  {
@@ -1396,13 +1396,13 @@ function ys({ registry: e, hook: t }) {
1396
1396
  "aria-label": n.groupBy(c),
1397
1397
  "aria-pressed": f,
1398
1398
  disabled: !f && r.length >= yt,
1399
- onClick: () => s(f ? r.filter((d) => d !== l) : [...r, l]),
1399
+ onClick: () => s(f ? r.filter((d) => d !== a) : [...r, a]),
1400
1400
  children: [
1401
- f && /* @__PURE__ */ u("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
1401
+ f && /* @__PURE__ */ u("span", { className: h.groupingLevel, "aria-hidden": "true", children: l + 1 }),
1402
1402
  c
1403
1403
  ]
1404
1404
  },
1405
- l
1405
+ a
1406
1406
  );
1407
1407
  }) })
1408
1408
  ] });
@@ -1419,13 +1419,13 @@ function _s({ registry: e, hook: t }) {
1419
1419
  {
1420
1420
  trigger: /* @__PURE__ */ R("button", { type: "button", className: H(h.conditionButton, h.groupingTrigger), children: [
1421
1421
  /* @__PURE__ */ u("span", { className: h.groupingPrefix, children: n.groupedBy }),
1422
- s.map((i, l) => /* @__PURE__ */ R("span", { className: h.groupingPath, children: [
1423
- l > 0 && /* @__PURE__ */ u("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
1422
+ s.map((i, a) => /* @__PURE__ */ R("span", { className: h.groupingPath, children: [
1423
+ a > 0 && /* @__PURE__ */ u("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
1424
1424
  i
1425
- ] }, r[l]))
1425
+ ] }, r[a]))
1426
1426
  ] }),
1427
1427
  children: [
1428
- r.map((i, l) => /* @__PURE__ */ u(Ke, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[l]) }, i)),
1428
+ r.map((i, a) => /* @__PURE__ */ u(Ke, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[a]) }, i)),
1429
1429
  /* @__PURE__ */ u(Ln, {}),
1430
1430
  /* @__PURE__ */ u(Ke, { onSelect: o.unfoldAll, children: n.unfoldAll }),
1431
1431
  /* @__PURE__ */ u(Ke, { onSelect: o.foldAll, children: n.foldAll })
@@ -1441,27 +1441,27 @@ function hn({
1441
1441
  own: o = !1
1442
1442
  }) {
1443
1443
  const r = re(), s = be(), i = (e == null ? void 0 : e.hook) ?? null;
1444
- let l = null, c = null;
1444
+ let a = null, c = null;
1445
1445
  if (e && i) {
1446
- const a = i.publicSnapshot, f = a.search !== "" || Object.keys(a.filter).length > 0, d = o ? [] : i.selectedRows ?? a.filtered.filter((b) => a.selection.isSelected(i.rowKey(b))), p = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
1447
- l = /* @__PURE__ */ R(ne, { children: [
1446
+ const l = i.publicSnapshot, f = l.search !== "" || Object.keys(l.filter).length > 0, d = o ? [] : i.selectedRows ?? l.filtered.filter((b) => l.selection.isSelected(i.rowKey(b))), p = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
1447
+ a = /* @__PURE__ */ R(ne, { children: [
1448
1448
  /* @__PURE__ */ u(_s, { registry: e, hook: i }),
1449
1449
  /* @__PURE__ */ u(ds, { registry: e, hook: i })
1450
1450
  ] }), c = /* @__PURE__ */ R("div", { className: h.toolbarGroup, children: [
1451
- /* @__PURE__ */ u("span", { role: "status", className: h.filteredCount, children: f ? a.manual ? (
1451
+ /* @__PURE__ */ u("span", { role: "status", className: h.filteredCount, children: f ? l.manual ? (
1452
1452
  /* The server counts the matches only; a total beside them would be a second request. */
1453
- r.entries(a.rowCount, s.count(a.rowCount))
1454
- ) : r.filteredOfTotal(s.count(a.filtered.length), s.count(i.admitted.length)) : "" }),
1455
- f && /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => fn(a), children: r.resetAll }),
1453
+ r.entries(l.rowCount, s.count(l.rowCount))
1454
+ ) : r.filteredOfTotal(s.count(l.filtered.length), s.count(i.admitted.length)) : "" }),
1455
+ f && /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => fn(l), children: r.resetAll }),
1456
1456
  d.length > 0 && /* @__PURE__ */ R(ne, { children: [
1457
1457
  /* @__PURE__ */ u("span", { className: h.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
1458
- p.map(({ key: b, spec: S }) => /* @__PURE__ */ u(
1458
+ p.map(({ key: b, spec: k }) => /* @__PURE__ */ u(
1459
1459
  fe,
1460
1460
  {
1461
1461
  size: "sm",
1462
- variant: S.tone === "danger" ? "danger" : "secondary",
1463
- onClick: () => S.onSelect(d),
1464
- children: S.label
1462
+ variant: k.tone === "danger" ? "danger" : "secondary",
1463
+ onClick: () => k.onSelect(d),
1464
+ children: k.label
1465
1465
  },
1466
1466
  b
1467
1467
  ))
@@ -1471,7 +1471,7 @@ function hn({
1471
1471
  return /* @__PURE__ */ R("div", { className: H(h.toolbar, t), children: [
1472
1472
  /* @__PURE__ */ R("div", { className: h.toolbarGroup, children: [
1473
1473
  n,
1474
- l
1474
+ a
1475
1475
  ] }),
1476
1476
  c
1477
1477
  ] });
@@ -1511,19 +1511,22 @@ function ut({
1511
1511
  wording: o,
1512
1512
  signed: r = !1
1513
1513
  }) {
1514
- const { aggregate: s, format: i, presentation: l } = e.spec;
1514
+ const { aggregate: s, format: i, presentation: a } = e.spec;
1515
1515
  if (!s) return null;
1516
- const c = typeof s == "function" ? "own" : s, a = vt({ id: e.spec.id, read: e.read, aggregate: s }, t), f = (b) => Re(b, i, n, o);
1516
+ const c = typeof s == "function" ? "own" : s, l = vt({ id: e.spec.id, read: e.read, aggregate: s }, t), f = (b) => Re(b, i, n, o);
1517
1517
  let d;
1518
- if (Q(a)) d = /* @__PURE__ */ u(gn, { wording: o });
1519
- else if (c === "range" && i === "date" && Cs(a)) {
1520
- const [b, S] = a;
1521
- d = b.getTime() === S.getTime() ? n.date(b) : o.rangeFromTo(n.dateShort(b), n.dateShort(S));
1522
- } else if (c === "count" || c === "distinct") d = n.count(a);
1518
+ if (Q(l)) d = /* @__PURE__ */ u(gn, { wording: o });
1519
+ else if ((c === "sum" || c === "avg") && i === void 0 && typeof l == "number") {
1520
+ const b = Math.max(0, ...t.map((k) => e.read(k)).filter(Cs).map(Ns));
1521
+ d = n.number(l, Math.min(10, c === "avg" ? b + 1 : b));
1522
+ } else if (c === "range" && i === "date" && As(l)) {
1523
+ const [b, k] = l;
1524
+ d = b.getTime() === k.getTime() ? n.date(b) : o.rangeFromTo(n.dateShort(b), n.dateShort(k));
1525
+ } else if (c === "count" || c === "distinct") d = n.count(l);
1523
1526
  else if (c === "range") {
1524
- const [b, S] = a;
1525
- d = f(b) === f(S) ? f(b) : o.rangeFromTo(f(b) ?? "", f(S) ?? "");
1526
- } else c === "own" && l ? d = l(a, t[0]) : d = f(a);
1527
+ const [b, k] = l;
1528
+ d = f(b) === f(k) ? f(b) : o.rangeFromTo(f(b) ?? "", f(k) ?? "");
1529
+ } else c === "own" && a ? d = a(l, t[0]) : d = f(l);
1527
1530
  const p = ks[c];
1528
1531
  return /* @__PURE__ */ R(ne, { children: [
1529
1532
  r && p && /* @__PURE__ */ u("span", { "aria-hidden": "true", className: h.footerKind, children: p }),
@@ -1534,12 +1537,16 @@ function ut({
1534
1537
  d
1535
1538
  ] });
1536
1539
  }
1537
- const Cs = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
1540
+ const Cs = (e) => typeof e == "number" && Number.isFinite(e), Ns = (e) => {
1541
+ var o;
1542
+ const [t = "", n = "0"] = e.toExponential().split("e");
1543
+ return Math.max(0, (((o = t.split(".")[1]) == null ? void 0 : o.length) ?? 0) - Number(n));
1544
+ }, As = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
1538
1545
  function pn(e, t) {
1539
1546
  const n = e.spec.aggregate;
1540
1547
  return n === "count" || n === "distinct" ? !0 : e.spec.rightAligned !== void 0 ? e.spec.rightAligned : en(t, e.read) === "number";
1541
1548
  }
1542
- function Ns(e, t) {
1549
+ function Ts(e, t) {
1543
1550
  const n = /* @__PURE__ */ new Map();
1544
1551
  for (const [o, r] of t) {
1545
1552
  const s = e.get(o);
@@ -1551,39 +1558,39 @@ function mn(e, t) {
1551
1558
  const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
1552
1559
  return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
1553
1560
  }
1554
- const As = (e) => {
1561
+ const Os = (e) => {
1555
1562
  const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
1556
1563
  for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
1557
1564
  t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
1558
1565
  return t;
1559
1566
  };
1560
- function Ts(e, t) {
1567
+ function Ms(e, t) {
1561
1568
  const n = ce(null);
1562
1569
  X(() => {
1563
1570
  const o = e.current;
1564
1571
  if (!o) return;
1565
- const r = As(o), s = n.current;
1572
+ const r = Os(o), s = n.current;
1566
1573
  if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
1567
1574
  const i = mn(o, "--u-duration-medium");
1568
1575
  if (i === 0 || typeof o.animate != "function") return;
1569
- const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Ns(s.positions, r);
1570
- for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1571
- const f = a.dataset.motion, d = c.get(f);
1572
- d !== void 0 ? a.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: l }) : s.positions.has(f) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: l });
1576
+ const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Ts(s.positions, r);
1577
+ for (const l of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1578
+ const f = l.dataset.motion, d = c.get(f);
1579
+ d !== void 0 ? l.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(f) || l.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
1573
1580
  }
1574
1581
  });
1575
1582
  }
1576
- function Os(e, t, n) {
1583
+ function Fs(e, t, n) {
1577
1584
  const o = ce(t);
1578
1585
  X(() => {
1579
1586
  const r = e.current, s = o.current;
1580
1587
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1581
1588
  const i = mn(r, "--u-duration-medium");
1582
1589
  if (i === 0) return;
1583
- const l = performance.now();
1584
- let c = requestAnimationFrame(function a(f) {
1585
- const d = Math.min(1, (f - l) / i), p = 1 - (1 - d) ** 3;
1586
- r.textContent = n(Math.round(s + (t - s) * p)), d < 1 && (c = requestAnimationFrame(a));
1590
+ const a = performance.now();
1591
+ let c = requestAnimationFrame(function l(f) {
1592
+ const d = Math.min(1, (f - a) / i), p = 1 - (1 - d) ** 3;
1593
+ r.textContent = n(Math.round(s + (t - s) * p)), d < 1 && (c = requestAnimationFrame(l));
1587
1594
  });
1588
1595
  return () => {
1589
1596
  cancelAnimationFrame(c), r.textContent = n(t);
@@ -1612,31 +1619,31 @@ function St(e, t, n = t) {
1612
1619
  }
1613
1620
  };
1614
1621
  }
1615
- const Ms = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1622
+ const Ls = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1616
1623
  function wn(e) {
1617
- const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)), f = t + (n ? 1 : 0), d = s.start > 0 ? s.start - f : 0;
1624
+ const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, a = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, l = Math.max(n || i === 0 ? 0 : 1, Math.min(a === -1 ? i : a, i - c)), f = t + (n ? 1 : 0), d = s.start > 0 ? s.start - f : 0;
1618
1625
  return {
1619
- lead: a,
1620
- labelColumns: s.start > 0 ? Math.min(a, d) : a,
1621
- countColumns: d > 0 ? Math.min(a, d) : a
1626
+ lead: l,
1627
+ labelColumns: s.start > 0 ? Math.min(l, d) : l,
1628
+ countColumns: d > 0 ? Math.min(l, d) : l
1622
1629
  };
1623
1630
  }
1624
1631
  function et(e, t) {
1625
- const n = Ms(t);
1632
+ const n = Ls(t);
1626
1633
  if (e === "cells") return Array.from({ length: n }, () => 1);
1627
1634
  if (e === "whole") return [n];
1628
- const { lead: o, labelColumns: r, countColumns: s } = wn(t), i = Array.from({ length: t.controls }, () => 1), l = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
1629
- return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...l] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...l];
1635
+ const { lead: o, labelColumns: r, countColumns: s } = wn(t), i = Array.from({ length: t.controls }, () => 1), a = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (l) => o - l > 0 ? [o - l] : [];
1636
+ return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...a] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...a];
1630
1637
  }
1631
1638
  const Ue = (e) => `row:${e}`;
1632
- function Fs({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1633
- const s = et("cells", e), i = et("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, f) => {
1634
- const d = n(a);
1635
- l.push({ key: Ue(d), cells: s, at: f, row: a }), o.has(d) && l.push({ key: `detail:${d}`, cells: i, at: f, row: a });
1639
+ function Ds({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1640
+ const s = et("cells", e), i = et("whole", e), a = [{ key: "head", cells: s, at: -1 }], c = (l, f) => {
1641
+ const d = n(l);
1642
+ a.push({ key: Ue(d), cells: s, at: f, row: l }), o.has(d) && a.push({ key: `detail:${d}`, cells: i, at: f, row: l });
1636
1643
  };
1637
- return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((a, f) => {
1638
- a.kind === "row" ? c(a.row, f) : l.push({ key: `${a.kind}:${a.group.path}`, cells: et(a.kind, e), at: f });
1639
- }), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
1644
+ return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((l, f) => {
1645
+ l.kind === "row" ? c(l.row, f) : a.push({ key: `${l.kind}:${l.group.path}`, cells: et(l.kind, e), at: f });
1646
+ }), a.length === 1 && a.push({ key: "empty", cells: i, at: -1 }), r && a.push({ key: "foot", cells: s, at: -1 }), a;
1640
1647
  }
1641
1648
  function vn(e, t) {
1642
1649
  let n = 0;
@@ -1648,23 +1655,23 @@ function vn(e, t) {
1648
1655
  return { index: 0, start: 0 };
1649
1656
  }
1650
1657
  const ze = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1651
- function Ls(e, t, n, o) {
1658
+ function Rs(e, t, n, o) {
1652
1659
  const r = e.length - 1, s = e[t.line];
1653
1660
  if (!s) return t;
1654
- const { index: i } = vn(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1661
+ const { index: i } = vn(s.cells, t.column), a = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1655
1662
  switch (n) {
1656
1663
  case "left":
1657
1664
  return i > 0 ? { line: t.line, column: ze(s.cells, i - 1) } : t;
1658
1665
  case "right":
1659
1666
  return i < s.cells.length - 1 ? { line: t.line, column: ze(s.cells, i + 1) } : t;
1660
1667
  case "up":
1661
- return l(t.line - 1);
1668
+ return a(t.line - 1);
1662
1669
  case "down":
1663
- return l(t.line + 1);
1670
+ return a(t.line + 1);
1664
1671
  case "pageUp":
1665
- return l(t.line - Math.max(1, o));
1672
+ return a(t.line - Math.max(1, o));
1666
1673
  case "pageDown":
1667
- return l(t.line + Math.max(1, o));
1674
+ return a(t.line + Math.max(1, o));
1668
1675
  case "lineStart":
1669
1676
  return { line: t.line, column: 0 };
1670
1677
  case "lineEnd":
@@ -1675,8 +1682,8 @@ function Ls(e, t, n, o) {
1675
1682
  return { line: r, column: ze(e[r].cells, e[r].cells.length - 1) };
1676
1683
  }
1677
1684
  }
1678
- function Ds(e, t, n, o) {
1679
- const r = e.flatMap((l, c) => l.cells.map((a, f) => ({ line: c, column: ze(l.cells, f) }))), s = r.findIndex((l) => l.line === t.line && l.column === vn(e[t.line].cells, t.column).start);
1685
+ function Ps(e, t, n, o) {
1686
+ const r = e.flatMap((a, c) => a.cells.map((l, f) => ({ line: c, column: ze(a.cells, f) }))), s = r.findIndex((a) => a.line === t.line && a.column === vn(e[t.line].cells, t.column).start);
1680
1687
  return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
1681
1688
  }
1682
1689
  function Et(e, t, n) {
@@ -1703,18 +1710,18 @@ function ft({
1703
1710
  formats: s,
1704
1711
  wording: i
1705
1712
  }) {
1706
- const l = Ye(n, e.value, s, i), c = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), f = (d) => {
1713
+ const a = Ye(n, e.value, s, i), c = s.count(e.rows.length), l = () => r.publicSnapshot.toggleFold(e.path), f = (d) => {
1707
1714
  if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
1708
1715
  d.preventDefault(), zt(e, d.key === "ArrowLeft", r);
1709
1716
  return;
1710
1717
  }
1711
1718
  if (d.key === "ArrowRight" && !o)
1712
- d.preventDefault(), a();
1719
+ d.preventDefault(), l();
1713
1720
  else if (d.key === "ArrowLeft") {
1714
- if (d.preventDefault(), o) a();
1721
+ if (d.preventDefault(), o) l();
1715
1722
  else if (t) {
1716
1723
  const p = d.currentTarget.closest("table"), b = Array.from((p == null ? void 0 : p.querySelectorAll("[data-fold-path]")) ?? []).find(
1717
- (S) => S.dataset.foldPath === t.path
1724
+ (k) => k.dataset.foldPath === t.path
1718
1725
  );
1719
1726
  b == null || b.focus();
1720
1727
  }
@@ -1727,44 +1734,44 @@ function ft({
1727
1734
  className: H(h.fold, !o && h.foldClosed),
1728
1735
  "data-fold-path": e.path,
1729
1736
  "aria-expanded": o,
1730
- "aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
1737
+ "aria-label": o ? i.foldGroup(a, c) : i.unfoldGroup(a, c),
1731
1738
  onKeyDown: f,
1732
1739
  onClick: (d) => {
1733
- if (!d.altKey) return a();
1740
+ if (!d.altKey) return l();
1734
1741
  zt(e, o, r);
1735
1742
  },
1736
1743
  children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M2.5 3.75 5 6.25 7.5 3.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
1737
1744
  }
1738
1745
  );
1739
1746
  }
1740
- function Rs({ value: e, formats: t }) {
1747
+ function Es({ value: e, formats: t }) {
1741
1748
  const n = ce(null);
1742
- return Os(n, e, t.count), /* @__PURE__ */ u("span", { ref: n, className: h.groupCount, children: t.count(e) });
1749
+ return Fs(n, e, t.count), /* @__PURE__ */ u("span", { ref: n, className: h.groupCount, children: t.count(e) });
1743
1750
  }
1744
1751
  function ht({ group: e, entry: t, hook: n, formats: o, wording: r }) {
1745
- const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
1752
+ const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((l) => s.isSelected(l)).length, c = a === i.length;
1746
1753
  return /* @__PURE__ */ u(
1747
1754
  Le,
1748
1755
  {
1749
1756
  "aria-label": r.selectGroup(Ye(t, e.value, o, r)),
1750
1757
  checked: c,
1751
- indeterminate: l > 0 && !c,
1758
+ indeterminate: a > 0 && !c,
1752
1759
  onChange: () => {
1753
- for (const a of i) s.isSelected(a) === c && s.toggle(a);
1760
+ for (const l of i) s.isSelected(l) === c && s.toggle(l);
1754
1761
  }
1755
1762
  }
1756
1763
  );
1757
1764
  }
1758
1765
  function zt(e, t, n) {
1759
1766
  const o = n.publicSnapshot, r = [], s = (i) => {
1760
- for (const l of i)
1761
- l.level === e.level ? r.push(l) : s(l.groups);
1767
+ for (const a of i)
1768
+ a.level === e.level ? r.push(a) : s(a.groups);
1762
1769
  };
1763
1770
  s(n.companion.groups ?? []);
1764
1771
  for (const i of r)
1765
1772
  o.folded.includes(i.path) !== t && o.toggleFold(i.path);
1766
1773
  }
1767
- function Ps({
1774
+ function zs({
1768
1775
  line: e,
1769
1776
  entry: t,
1770
1777
  selectable: n,
@@ -1773,15 +1780,15 @@ function Ps({
1773
1780
  formats: s,
1774
1781
  wording: i
1775
1782
  }) {
1776
- const l = e.span;
1783
+ const a = e.span;
1777
1784
  return /* @__PURE__ */ u("td", { className: H(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ R("span", { className: h.spanValue, children: [
1778
- n && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ht, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
1779
- /* @__PURE__ */ u(ft, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
1780
- /* @__PURE__ */ R("span", { className: h.spanText, title: Ye(t, l.value, s, i), children: [
1781
- /* @__PURE__ */ u(dt, { entry: t, group: l, formats: s, wording: i }),
1785
+ n && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ht, { group: a, entry: t, hook: r, formats: s, wording: i }) }),
1786
+ /* @__PURE__ */ u(ft, { group: a, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
1787
+ /* @__PURE__ */ R("span", { className: h.spanText, title: Ye(t, a.value, s, i), children: [
1788
+ /* @__PURE__ */ u(dt, { entry: t, group: a, formats: s, wording: i }),
1782
1789
  e.continued && /* @__PURE__ */ u("span", { className: h.continued, children: i.groupContinued })
1783
1790
  ] }),
1784
- /* @__PURE__ */ u("span", { className: h.groupCount, children: s.count(l.rows.length) })
1791
+ /* @__PURE__ */ u("span", { className: h.groupCount, children: s.count(a.rows.length) })
1785
1792
  ] }) });
1786
1793
  }
1787
1794
  function It({
@@ -1792,27 +1799,27 @@ function It({
1792
1799
  levelEntry: r,
1793
1800
  columns: s,
1794
1801
  controlColumns: i,
1795
- blocks: l,
1802
+ blocks: a,
1796
1803
  selectable: c,
1797
- hasActions: a,
1804
+ hasActions: l,
1798
1805
  total: f,
1799
1806
  siblings: d,
1800
1807
  depth: p,
1801
1808
  hook: b,
1802
- formats: S,
1809
+ formats: k,
1803
1810
  wording: w,
1804
1811
  grid: O
1805
1812
  }) {
1806
- const { group: y } = e, _ = e.kind === "header", L = _ && !b.publicSnapshot.folded.includes(y.path), { lead: g, labelColumns: k, countColumns: T } = wn({
1813
+ const { group: y } = e, _ = e.kind === "header", L = _ && !b.publicSnapshot.folded.includes(y.path), { lead: g, labelColumns: S, countColumns: T } = wn({
1807
1814
  controls: i,
1808
1815
  span: o !== void 0,
1809
1816
  aggregates: s.map((I) => I.spec.aggregate !== void 0),
1810
- actions: a,
1811
- blocks: l
1812
- }), F = s.slice(g), m = i + (o ? 1 : 0), x = (I, P = I) => St(l, I, P), A = (I) => g - I > 0 && /* @__PURE__ */ u("td", { className: h.td, colSpan: g - I }), v = s.find((I) => I.spec.aggregate === "sum" && I.spec.share !== !1), M = n !== void 0, N = /* @__PURE__ */ R("span", { className: h.groupLabel, children: [
1813
- /* @__PURE__ */ u(ft, { group: y, parent: e.parents.at(-1), entry: r, open: L, hook: b, formats: S, wording: w }),
1814
- /* @__PURE__ */ u("span", { className: h.groupValue, children: /* @__PURE__ */ u(dt, { entry: r, group: y, formats: S, wording: w }) }),
1815
- /* @__PURE__ */ u(Rs, { value: y.rows.length, formats: S }),
1817
+ actions: l,
1818
+ blocks: a
1819
+ }), F = s.slice(g), m = i + (o ? 1 : 0), x = (I, P = I) => St(a, I, P), A = (I) => g - I > 0 && /* @__PURE__ */ u("td", { className: h.td, colSpan: g - I }), v = s.find((I) => I.spec.aggregate === "sum" && I.spec.share !== !1), M = n !== void 0, N = /* @__PURE__ */ R("span", { className: h.groupLabel, children: [
1820
+ /* @__PURE__ */ u(ft, { group: y, parent: e.parents.at(-1), entry: r, open: L, hook: b, formats: k, wording: w }),
1821
+ /* @__PURE__ */ u("span", { className: h.groupValue, children: /* @__PURE__ */ u(dt, { entry: r, group: y, formats: k, wording: w }) }),
1822
+ /* @__PURE__ */ u(Es, { value: y.rows.length, formats: k }),
1816
1823
  _ && e.continued && /* @__PURE__ */ u("span", { className: h.continued, children: w.groupContinued })
1817
1824
  ] });
1818
1825
  return /* @__PURE__ */ R(
@@ -1835,27 +1842,27 @@ function It({
1835
1842
  "aria-posinset": d.indexOf(y) + 1 || void 0,
1836
1843
  "aria-setsize": d.length || void 0,
1837
1844
  children: [
1838
- Array.from({ length: i }, (I, P) => /* @__PURE__ */ u("td", { className: H(h.td, h.control, x(P).className), style: x(P).style, children: P === 0 && c && _ && /* @__PURE__ */ u(ht, { group: y, entry: r, hook: b, formats: S, wording: w }) }, `c${P}`)),
1845
+ Array.from({ length: i }, (I, P) => /* @__PURE__ */ u("td", { className: H(h.td, h.control, x(P).className), style: x(P).style, children: P === 0 && c && _ && /* @__PURE__ */ u(ht, { group: y, entry: r, hook: b, formats: k, wording: w }) }, `c${P}`)),
1839
1846
  _ ? /* @__PURE__ */ R(ne, { children: [
1840
1847
  /* @__PURE__ */ u(
1841
1848
  "td",
1842
1849
  {
1843
- className: H(h.td, x(i, m + k - 1).className),
1844
- colSpan: (o ? 1 : 0) + k,
1850
+ className: H(h.td, x(i, m + S - 1).className),
1851
+ colSpan: (o ? 1 : 0) + S,
1845
1852
  style: {
1846
- ...x(i, m + k - 1).style,
1853
+ ...x(i, m + S - 1).style,
1847
1854
  paddingLeft: `calc(var(--u-space-3) + ${y.level * 20}px)`
1848
1855
  },
1849
1856
  children: N
1850
1857
  }
1851
1858
  ),
1852
- A(k)
1859
+ A(S)
1853
1860
  ] }) : /* @__PURE__ */ R(ne, { children: [
1854
1861
  /* @__PURE__ */ u("td", { className: H(h.td, h.spanCell, x(i).className), style: x(i).style, children: /* @__PURE__ */ R("span", { className: h.spanValue, children: [
1855
- c && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ht, { group: y, entry: o, hook: b, formats: S, wording: w }) }),
1856
- /* @__PURE__ */ u(ft, { group: y, parent: e.parents.at(-1), entry: o, open: !1, hook: b, formats: S, wording: w }),
1857
- /* @__PURE__ */ u("span", { className: h.spanText, children: /* @__PURE__ */ u(dt, { entry: o, group: y, formats: S, wording: w }) }),
1858
- /* @__PURE__ */ u("span", { className: h.groupCount, children: S.count(y.rows.length) })
1862
+ c && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ht, { group: y, entry: o, hook: b, formats: k, wording: w }) }),
1863
+ /* @__PURE__ */ u(ft, { group: y, parent: e.parents.at(-1), entry: o, open: !1, hook: b, formats: k, wording: w }),
1864
+ /* @__PURE__ */ u("span", { className: h.spanText, children: /* @__PURE__ */ u(dt, { entry: o, group: y, formats: k, wording: w }) }),
1865
+ /* @__PURE__ */ u("span", { className: h.groupCount, children: k.count(y.rows.length) })
1859
1866
  ] }) }),
1860
1867
  T > 0 && /* @__PURE__ */ u(
1861
1868
  "td",
@@ -1863,30 +1870,30 @@ function It({
1863
1870
  className: H(h.td, h.foldedCount, x(m, m + T - 1).className),
1864
1871
  style: x(m, m + T - 1).style,
1865
1872
  colSpan: T,
1866
- children: w.entries(y.rows.length, S.count(y.rows.length))
1873
+ children: w.entries(y.rows.length, k.count(y.rows.length))
1867
1874
  }
1868
1875
  ),
1869
1876
  A(T)
1870
1877
  ] }),
1871
1878
  F.map((I, P) => /* @__PURE__ */ u(
1872
- Es,
1879
+ Is,
1873
1880
  {
1874
1881
  pin: x(m + g + P),
1875
1882
  entry: I,
1876
1883
  group: y,
1877
1884
  share: _ && I === v,
1878
1885
  total: f,
1879
- formats: S,
1886
+ formats: k,
1880
1887
  wording: w
1881
1888
  },
1882
1889
  I.key
1883
1890
  )),
1884
- a && /* @__PURE__ */ u("td", { className: H(h.td, x(l.count - 1).className), style: x(l.count - 1).style })
1891
+ l && /* @__PURE__ */ u("td", { className: H(h.td, x(a.count - 1).className), style: x(a.count - 1).style })
1885
1892
  ]
1886
1893
  }
1887
1894
  );
1888
1895
  }
1889
- function Es({
1896
+ function Is({
1890
1897
  entry: e,
1891
1898
  pin: t,
1892
1899
  group: n,
@@ -1895,22 +1902,22 @@ function Es({
1895
1902
  formats: s,
1896
1903
  wording: i
1897
1904
  }) {
1898
- const { spec: l } = e;
1899
- if (!l.aggregate) return /* @__PURE__ */ u("td", { className: H(h.td, t.className), style: t.style });
1905
+ const { spec: a } = e;
1906
+ if (!a.aggregate) return /* @__PURE__ */ u("td", { className: H(h.td, t.className), style: t.style });
1900
1907
  let c = null;
1901
- if (o && l.aggregate === "sum" && l.share !== !1) {
1902
- const a = vt({ id: l.id, read: e.read, aggregate: "sum" }, r), f = n.aggregates[l.id];
1903
- if (typeof a == "number" && a > 0 && typeof f == "number" && f > 0) {
1904
- const d = Math.min(1, f / a);
1908
+ if (o && a.aggregate === "sum" && a.share !== !1) {
1909
+ const l = vt({ id: a.id, read: e.read, aggregate: "sum" }, r), f = n.aggregates[a.id];
1910
+ if (typeof l == "number" && l > 0 && typeof f == "number" && f > 0) {
1911
+ const d = Math.min(1, f / l);
1905
1912
  c = /* @__PURE__ */ u("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(d * 64))}px` }, "aria-hidden": "true" });
1906
1913
  }
1907
1914
  }
1908
- return /* @__PURE__ */ u("td", { className: H(h.td, pn(e, n.rows) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ R("span", { className: h.shareHost, children: [
1915
+ return /* @__PURE__ */ u("td", { className: H(h.td, pn(e, n.rows) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof a.aggregate == "function" ? "own" : a.aggregate, children: c ? /* @__PURE__ */ R("span", { className: h.shareHost, children: [
1909
1916
  /* @__PURE__ */ u(ut, { entry: e, rows: n.rows, formats: s, wording: i }),
1910
1917
  c
1911
1918
  ] }) : /* @__PURE__ */ u(ut, { entry: e, rows: n.rows, formats: s, wording: i }) });
1912
1919
  }
1913
- class zs {
1920
+ class Vs {
1914
1921
  constructor() {
1915
1922
  j(this, "wish", null);
1916
1923
  }
@@ -1923,17 +1930,17 @@ class zs {
1923
1930
  return n && (this.wish = null), n;
1924
1931
  }
1925
1932
  }
1926
- function Is() {
1927
- const [e, t] = W({ active: null, widget: !1, editing: null }), [n] = W(() => new zs());
1933
+ function Bs() {
1934
+ const [e, t] = W({ active: null, widget: !1, editing: null }), [n] = W(() => new Vs());
1928
1935
  return { state: e, setState: t, focus: n };
1929
1936
  }
1930
1937
  const yn = pt(null);
1931
- function Vs(e, t) {
1938
+ function Gs(e, t) {
1932
1939
  const n = je(yn), o = n == null ? void 0 : n.editing;
1933
1940
  return o && o.line === Ue(e) && o.column === t ? n : null;
1934
1941
  }
1935
1942
  const _n = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]', Ee = "data-grid-tabindex";
1936
- function Bs(e, t) {
1943
+ function $s(e, t) {
1937
1944
  if (t && !e.hasAttribute(Ee))
1938
1945
  e.setAttribute(Ee, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
1939
1946
  else if (!t && e.hasAttribute(Ee)) {
@@ -1952,10 +1959,10 @@ function Vt(e, t) {
1952
1959
  if (!(t instanceof Element)) return null;
1953
1960
  const n = t.closest("td, th"), o = n == null ? void 0 : n.parentElement, r = o == null ? void 0 : o.dataset.gridLine;
1954
1961
  if (!n || !o || r === void 0 || o.closest("table") !== e) return null;
1955
- const { start: s, end: i } = Ct(o).find((l) => l.cell === n);
1962
+ const { start: s, end: i } = Ct(o).find((a) => a.cell === n);
1956
1963
  return { cell: n, line: r, column: s, end: i };
1957
1964
  }
1958
- function Gs({
1965
+ function Hs({
1959
1966
  table: e,
1960
1967
  grid: t,
1961
1968
  lines: n,
@@ -1966,19 +1973,19 @@ function Gs({
1966
1973
  var O;
1967
1974
  const s = e.current;
1968
1975
  if (!s) return;
1969
- const { active: i, widget: l, editing: c } = t.state, a = $s(i, n, o), f = (O = n[a.line]) == null ? void 0 : O.key, d = new Map(n.map((y, _) => [y.key, _]));
1976
+ const { active: i, widget: a, editing: c } = t.state, l = Ks(i, n, o), f = (O = n[l.line]) == null ? void 0 : O.key, d = new Map(n.map((y, _) => [y.key, _]));
1970
1977
  let p = null, b = null;
1971
1978
  for (const y of Array.from(s.querySelectorAll("tr[data-grid-line]"))) {
1972
1979
  const _ = y.dataset.gridLine, L = Ct(y);
1973
- for (const { cell: g, start: k, end: T } of L) {
1974
- const F = a.column >= k && a.column < T || g === L.at(-1).cell && a.column >= T;
1975
- F && _ === f && (p = g), F && b === null && _ !== "head" && (b = g), g.tabIndex = -1, r && _ !== "head" && !r({ line: d.get(_) ?? -1, column: k }) ? g.setAttribute("aria-readonly", "true") : g.removeAttribute("aria-readonly");
1976
- const m = g === p && (l || c !== null && c.line === _);
1977
- for (const x of Array.from(g.querySelectorAll(_n))) Bs(x, !m);
1980
+ for (const { cell: g, start: S, end: T } of L) {
1981
+ const F = l.column >= S && l.column < T || g === L.at(-1).cell && l.column >= T;
1982
+ F && _ === f && (p = g), F && b === null && _ !== "head" && (b = g), g.tabIndex = -1, r && _ !== "head" && !r({ line: d.get(_) ?? -1, column: S }) ? g.setAttribute("aria-readonly", "true") : g.removeAttribute("aria-readonly");
1983
+ const m = g === p && (a || c !== null && c.line === _);
1984
+ for (const x of Array.from(g.querySelectorAll(_n))) $s(x, !m);
1978
1985
  }
1979
1986
  }
1980
- const S = p ?? b ?? s.querySelector("tr[data-grid-line] > *");
1981
- S && (S.tabIndex = 0);
1987
+ const k = p ?? b ?? s.querySelector("tr[data-grid-line] > *");
1988
+ k && (k.tabIndex = 0);
1982
1989
  const w = t.focus.take(p !== null);
1983
1990
  if (w === "editor") {
1984
1991
  const y = p == null ? void 0 : p.querySelector("input, select, textarea, button");
@@ -1986,7 +1993,7 @@ function Gs({
1986
1993
  } else w === "cell" && (p == null || p.focus());
1987
1994
  }), null;
1988
1995
  }
1989
- function $s(e, t, n) {
1996
+ function Ks(e, t, n) {
1990
1997
  return e ? {
1991
1998
  line: Et(
1992
1999
  t.map((o) => o.key),
@@ -1996,7 +2003,7 @@ function $s(e, t, n) {
1996
2003
  column: Et(n, e.column, e.columnIndex)
1997
2004
  } : { line: Math.min(1, t.length - 1), column: 0 };
1998
2005
  }
1999
- const Hs = {
2006
+ const js = {
2000
2007
  ArrowLeft: "left",
2001
2008
  ArrowRight: "right",
2002
2009
  ArrowUp: "up",
@@ -2005,28 +2012,28 @@ const Hs = {
2005
2012
  End: "lineEnd",
2006
2013
  PageUp: "pageUp",
2007
2014
  PageDown: "pageDown"
2008
- }, Ks = (e) => (e == null ? void 0 : e.spec.edit) !== void 0;
2015
+ }, Ws = (e) => (e == null ? void 0 : e.spec.edit) !== void 0;
2009
2016
  function xn(e, t) {
2010
2017
  const n = (o) => Q(o) || o === "" ? null : o instanceof Date ? o.getTime() : o;
2011
2018
  return Object.is(n(e), n(t));
2012
2019
  }
2013
- function js(e) {
2014
- const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: i, onCellEdit: l, select: c } = e, { setState: a } = t, f = n.map((m) => m.key), d = (m) => {
2020
+ function qs(e) {
2021
+ const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: i, onCellEdit: a, select: c } = e, { setState: l } = t, f = n.map((m) => m.key), d = (m) => {
2015
2022
  var x;
2016
2023
  return (x = n.find((A) => A.key === m)) == null ? void 0 : x.row;
2017
2024
  }, p = (m) => {
2018
2025
  const x = n[m.line];
2019
2026
  return (x == null ? void 0 : x.row) !== void 0 && x.key === Ue(s(x.row)) ? { row: x.row } : null;
2020
- }, b = (m) => p(m) !== null && Ks(r(o[m.column] ?? "")), S = (m, x = t.state.active) => x && x.line === m.line && x.columnIndex >= m.column && x.columnIndex < m.end ? x.columnIndex : m.column, w = (m, x) => {
2027
+ }, b = (m) => p(m) !== null && Ws(r(o[m.column] ?? "")), k = (m, x = t.state.active) => x && x.line === m.line && x.columnIndex >= m.column && x.columnIndex < m.end ? x.columnIndex : m.column, w = (m, x) => {
2021
2028
  var N;
2022
2029
  const A = n[x.line];
2023
2030
  if (!A) return;
2024
- a((I) => ({ ...I, widget: !1, active: { line: A.key, column: o[x.column] ?? "", lineIndex: x.line, columnIndex: x.column } }));
2031
+ l((I) => ({ ...I, widget: !1, active: { line: A.key, column: o[x.column] ?? "", lineIndex: x.line, columnIndex: x.column } }));
2025
2032
  const v = Array.from(m.querySelectorAll("tr[data-grid-line]")).find((I) => I.dataset.gridLine === A.key), M = v ? (N = Ct(v).find((I) => x.column >= I.start && x.column < I.end)) == null ? void 0 : N.cell : void 0;
2026
2033
  M ? M.focus({ preventScroll: A.key === "head" }) : (t.focus.want("cell"), i && A.at >= 0 && i.showRow(A.at));
2027
2034
  }, O = (m, x) => {
2028
2035
  const A = n[m.line], v = r(o[m.column] ?? "");
2029
- t.focus.want("editor"), a((M) => ({
2036
+ t.focus.want("editor"), l((M) => ({
2030
2037
  ...M,
2031
2038
  active: { line: A.key, column: v.spec.id, lineIndex: m.line, columnIndex: m.column },
2032
2039
  editing: { line: A.key, column: v.spec.id, draft: x === void 0 ? v.read(A.row) : x, error: null }
@@ -2037,12 +2044,12 @@ function js(e) {
2037
2044
  if (!x) return !0;
2038
2045
  const A = r(x.column), v = d(x.line);
2039
2046
  if (!A || v === void 0)
2040
- return a((P) => ({ ...P, editing: null })), !0;
2047
+ return l((P) => ({ ...P, editing: null })), !0;
2041
2048
  const M = (I = (N = A.spec).validate) == null ? void 0 : I.call(N, m, v);
2042
- return M ? (a((P) => ({ ...P, editing: P.editing && { ...P.editing, draft: m, error: M } })), !1) : (xn(m, A.read(v)) || l == null || l({ rowKey: s(v), columnId: A.spec.id, value: m, row: v }), t.focus.want("cell"), a((P) => ({ ...P, editing: null })), !0);
2049
+ return M ? (l((P) => ({ ...P, editing: P.editing && { ...P.editing, draft: m, error: M } })), !1) : (xn(m, A.read(v)) || a == null || a({ rowKey: s(v), columnId: A.spec.id, value: m, row: v }), t.focus.want("cell"), l((P) => ({ ...P, editing: null })), !0);
2043
2050
  }, _ = () => {
2044
- t.focus.want("cell"), a((m) => ({ ...m, editing: null }));
2045
- }, L = (m) => a((x) => {
2051
+ t.focus.want("cell"), l((m) => ({ ...m, editing: null }));
2052
+ }, L = (m) => l((x) => {
2046
2053
  var M, N;
2047
2054
  if (!x.editing) return x;
2048
2055
  const A = r(x.editing.column), v = x.editing.error === null ? null : ((N = A == null ? void 0 : (M = A.spec).validate) == null ? void 0 : N.call(M, m, d(x.editing.line))) ?? null;
@@ -2053,7 +2060,7 @@ function js(e) {
2053
2060
  if (m.defaultPrevented) return;
2054
2061
  const A = Vt(x, m.target);
2055
2062
  if (!A) return;
2056
- const v = { line: f.indexOf(A.line), column: S(A) };
2063
+ const v = { line: f.indexOf(A.line), column: k(A) };
2057
2064
  if (v.line < 0) return;
2058
2065
  const M = t.state.editing;
2059
2066
  if (M && M.line === A.line && M.column === o[A.column]) {
@@ -2062,20 +2069,20 @@ function js(e) {
2062
2069
  else if (m.key === "Enter" && !(m.target instanceof HTMLButtonElement))
2063
2070
  m.preventDefault(), y(M.draft);
2064
2071
  else if (m.key === "Tab") {
2065
- const P = Ds(n, v, m.shiftKey, b), $ = y(M.draft);
2072
+ const P = Ps(n, v, m.shiftKey, b), $ = y(M.draft);
2066
2073
  if ((P || !$) && m.preventDefault(), !$) return;
2067
2074
  P ? O(P) : t.focus.want(null);
2068
2075
  }
2069
2076
  return;
2070
2077
  }
2071
2078
  if (m.target !== A.cell) {
2072
- (m.key === "Escape" || m.key === "F2") && (m.preventDefault(), a((P) => ({ ...P, widget: !1 })), A.cell.focus());
2079
+ (m.key === "Escape" || m.key === "F2") && (m.preventDefault(), l((P) => ({ ...P, widget: !1 })), A.cell.focus());
2073
2080
  return;
2074
2081
  }
2075
2082
  if (m.altKey || m.metaKey) return;
2076
- const N = m.ctrlKey ? { Home: "first", End: "last" }[m.key] : Hs[m.key];
2083
+ const N = m.ctrlKey ? { Home: "first", End: "last" }[m.key] : js[m.key];
2077
2084
  if (N) {
2078
- m.preventDefault(), w(x, Ls(n, v, N, Ws(A.cell, x)));
2085
+ m.preventDefault(), w(x, Rs(n, v, N, Us(A.cell, x)));
2079
2086
  return;
2080
2087
  }
2081
2088
  if (!m.ctrlKey) {
@@ -2090,7 +2097,7 @@ function js(e) {
2090
2097
  return;
2091
2098
  }
2092
2099
  const P = A.cell.querySelector(_n);
2093
- P && (m.preventDefault(), a(($) => ({ ...$, widget: !0 })), P.focus());
2100
+ P && (m.preventDefault(), l(($) => ({ ...$, widget: !0 })), P.focus());
2094
2101
  return;
2095
2102
  }
2096
2103
  if (m.key.length === 1 && b(v)) {
@@ -2098,7 +2105,7 @@ function js(e) {
2098
2105
  m.preventDefault(), O(v, P === "text" ? m.key : P === "number" && /\d/.test(m.key) ? Number(m.key) : void 0);
2099
2106
  }
2100
2107
  }
2101
- }, k = (m) => {
2108
+ }, S = (m) => {
2102
2109
  const x = Vt(m.currentTarget, m.target);
2103
2110
  if (!x) return;
2104
2111
  const A = f.indexOf(x.line), v = t.state.editing;
@@ -2106,8 +2113,8 @@ function js(e) {
2106
2113
  t.focus.want("editor");
2107
2114
  return;
2108
2115
  }
2109
- t.focus.want(null), a((M) => {
2110
- const N = S(x, M.active);
2116
+ t.focus.want(null), l((M) => {
2117
+ const N = k(x, M.active);
2111
2118
  return {
2112
2119
  ...M,
2113
2120
  widget: m.target !== x.cell,
@@ -2115,17 +2122,17 @@ function js(e) {
2115
2122
  };
2116
2123
  });
2117
2124
  }, T = (m) => {
2118
- m.currentTarget.contains(m.relatedTarget) || a((x) => x.widget ? { ...x, widget: !1 } : x);
2125
+ m.currentTarget.contains(m.relatedTarget) || l((x) => x.widget ? { ...x, widget: !1 } : x);
2119
2126
  }, F = { editing: t.state.editing, setDraft: L, commit: y };
2120
- return { onKeyDown: g, onFocus: k, onBlur: T, context: F, editable: b };
2127
+ return { onKeyDown: g, onFocus: S, onBlur: T, context: F, editable: b };
2121
2128
  }
2122
- function Ws(e, t) {
2129
+ function Us(e, t) {
2123
2130
  var s;
2124
2131
  const n = ((s = e.parentElement) == null ? void 0 : s.getBoundingClientRect().height) ?? 0, o = t.parentElement, r = Math.min((o == null ? void 0 : o.clientHeight) || window.innerHeight, window.innerHeight);
2125
2132
  return n > 0 ? Math.max(1, Math.floor(r / n) - 1) : 10;
2126
2133
  }
2127
- function qs({ entry: e, row: t, rowName: n, grid: o }) {
2128
- const r = be(), s = ce(null), { spec: i } = e, l = o.editing, c = l.draft, a = o.wording.editCell(i.label, n);
2134
+ function Ys({ entry: e, row: t, rowName: n, grid: o }) {
2135
+ const r = be(), s = ce(null), { spec: i } = e, a = o.editing, c = a.draft, l = o.wording.editCell(i.label, n);
2129
2136
  let f;
2130
2137
  if (typeof i.edit == "function")
2131
2138
  f = i.edit({
@@ -2133,8 +2140,8 @@ function qs({ entry: e, row: t, rowName: n, grid: o }) {
2133
2140
  onChange: o.setDraft,
2134
2141
  commit: (d) => o.commit(d === void 0 ? c : d),
2135
2142
  row: t,
2136
- invalid: l.error !== null,
2137
- label: a
2143
+ invalid: a.error !== null,
2144
+ label: l
2138
2145
  });
2139
2146
  else if (i.edit === "number")
2140
2147
  f = /* @__PURE__ */ u(ot, { size: "sm", value: typeof c == "number" ? c : null, onChange: o.setDraft });
@@ -2144,20 +2151,20 @@ function qs({ entry: e, row: t, rowName: n, grid: o }) {
2144
2151
  const d = i.editOptions ?? it(o.hook.admitted, e.read, r).values, p = d.findIndex((b) => xn(b, c));
2145
2152
  f = /* @__PURE__ */ R(Xt, { selectSize: "sm", value: p < 0 ? "" : String(p), onChange: (b) => o.setDraft(d[Number(b.target.value)]), children: [
2146
2153
  p < 0 && /* @__PURE__ */ u("option", { value: "" }),
2147
- d.map((b, S) => /* @__PURE__ */ u("option", { value: S, children: b instanceof Date ? r.date(b) : String(b) }, S))
2154
+ d.map((b, k) => /* @__PURE__ */ u("option", { value: k, children: b instanceof Date ? r.date(b) : String(b) }, k))
2148
2155
  ] });
2149
2156
  } else
2150
2157
  f = /* @__PURE__ */ u(Qt, { size: "sm", value: Q(c) ? "" : String(c), onChange: (d) => o.setDraft(d.target.value) });
2151
2158
  return /* @__PURE__ */ R("div", { ref: s, className: h.editor, children: [
2152
- /* @__PURE__ */ u(nt, { className: h.editorField, label: /* @__PURE__ */ u(De, { children: a }), error: l.error ?? void 0, children: f }),
2153
- /* @__PURE__ */ u(mt, { open: l.error !== null, onOpenChange: () => {
2154
- }, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ u("span", { "aria-hidden": "true", children: l.error }) })
2159
+ /* @__PURE__ */ u(nt, { className: h.editorField, label: /* @__PURE__ */ u(De, { children: l }), error: a.error ?? void 0, children: f }),
2160
+ /* @__PURE__ */ u(mt, { open: a.error !== null, onOpenChange: () => {
2161
+ }, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ u("span", { "aria-hidden": "true", children: a.error }) })
2155
2162
  ] });
2156
2163
  }
2157
- function Us(e) {
2164
+ function Js(e) {
2158
2165
  const t = typeof e.value == "string" ? e.value : void 0;
2159
2166
  let n = e.id ?? t;
2160
- return n === void 0 && (ae(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.footer !== void 0 && ae(`footer:${n}`, `The column "${n}" uses \`footer\`, which is called \`aggregate\` now. The old name goes with the next minor version.`), e.children !== void 0 && typeof e.children != "function" && ae(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
2167
+ return n === void 0 && (le(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.footer !== void 0 && le(`footer:${n}`, `The column "${n}" uses \`footer\`, which is called \`aggregate\` now. The old name goes with the next minor version.`), e.children !== void 0 && typeof e.children != "function" && le(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
2161
2168
  id: n,
2162
2169
  label: e.label,
2163
2170
  value: e.value,
@@ -2183,66 +2190,66 @@ function Us(e) {
2183
2190
  validate: e.validate
2184
2191
  };
2185
2192
  }
2186
- function Ys(e, t, n, o, r) {
2193
+ function Xs(e, t, n, o, r) {
2187
2194
  if (!t) return n.rowKey(e);
2188
2195
  const s = t.read(e);
2189
2196
  return Q(s) ? r.cellAbsentValue : Re(s, t.spec.format, o, r) ?? n.rowKey(e);
2190
2197
  }
2191
- function Js(e) {
2198
+ function Qs(e) {
2192
2199
  function t(c) {
2193
- const a = me(), f = je(ct), d = Us(c);
2194
- return e.registerColumn(a, d), X(
2200
+ const l = me(), f = je(ct), d = Js(c);
2201
+ return e.registerColumn(l, d), X(
2195
2202
  () => () => {
2196
- e.removeColumn(a), e.commit();
2203
+ e.removeColumn(l), e.commit();
2197
2204
  },
2198
- [a]
2205
+ [l]
2199
2206
  ), X(() => {
2200
- e.ensureColumn(a, d), e.checkOrder(), e.commit();
2201
- }), on && f && f.registry !== e && ae(
2207
+ e.ensureColumn(l, d), e.checkOrder(), e.commit();
2208
+ }), on && f && f.registry !== e && le(
2202
2209
  `foreign:${d.id}`,
2203
2210
  `The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
2204
- ), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-column": a });
2211
+ ), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-column": l });
2205
2212
  }
2206
2213
  function n({ children: c }) {
2207
- const a = me();
2208
- return e.registerDetail(a, c), X(
2214
+ const l = me();
2215
+ return e.registerDetail(l, c), X(
2209
2216
  () => () => {
2210
- e.removeDetail(a), e.commit();
2217
+ e.removeDetail(l), e.commit();
2211
2218
  },
2212
- [a]
2219
+ [l]
2213
2220
  ), X(() => {
2214
- e.detail || e.registerDetail(a, c), e.commit();
2221
+ e.detail || e.registerDetail(l, c), e.commit();
2215
2222
  }), null;
2216
2223
  }
2217
2224
  function o({ children: c }) {
2218
- const a = me();
2219
- return e.registerActionGroup(a), X(
2225
+ const l = me();
2226
+ return e.registerActionGroup(l), X(
2220
2227
  () => () => {
2221
- e.removeActionGroup(a), e.commit();
2228
+ e.removeActionGroup(l), e.commit();
2222
2229
  },
2223
- [a]
2230
+ [l]
2224
2231
  ), X(() => {
2225
- e.registerActionGroup(a), e.commit();
2232
+ e.registerActionGroup(l), e.commit();
2226
2233
  }), /* @__PURE__ */ u(ne, { children: c });
2227
2234
  }
2228
2235
  function r(c) {
2229
- const a = me(), f = {
2236
+ const l = me(), f = {
2230
2237
  label: c.children,
2231
2238
  bulk: c.bulk === !0,
2232
2239
  tone: c.tone ?? "default",
2233
2240
  onSelect: c.onSelect
2234
2241
  };
2235
- return e.registerAction(a, f), X(
2242
+ return e.registerAction(l, f), X(
2236
2243
  () => () => {
2237
- e.removeAction(a), e.commit();
2244
+ e.removeAction(l), e.commit();
2238
2245
  },
2239
- [a]
2246
+ [l]
2240
2247
  ), X(() => {
2241
- e.ensureAction(a, f), e.checkOrder(), e.commit();
2242
- }), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-action": a });
2248
+ e.ensureAction(l, f), e.checkOrder(), e.commit();
2249
+ }), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-action": l });
2243
2250
  }
2244
2251
  function s(c) {
2245
- const a = me(), f = typeof c.value == "string" ? c.value : void 0, p = {
2252
+ const l = me(), f = typeof c.value == "string" ? c.value : void 0, p = {
2246
2253
  id: c.id ?? f ?? c.label,
2247
2254
  label: c.label,
2248
2255
  value: c.value,
@@ -2252,50 +2259,50 @@ function Js(e) {
2252
2259
  group: c.group,
2253
2260
  groupable: !0
2254
2261
  };
2255
- return e.registerGroupKey(a, p), X(
2262
+ return e.registerGroupKey(l, p), X(
2256
2263
  () => () => {
2257
- e.removeGroupKey(a), e.commit();
2264
+ e.removeGroupKey(l), e.commit();
2258
2265
  },
2259
- [a]
2266
+ [l]
2260
2267
  ), X(() => {
2261
- e.ensureGroupKey(a, p), e.checkOrder(), e.commit();
2262
- }), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-groupkey": a });
2268
+ e.ensureGroupKey(l, p), e.checkOrder(), e.commit();
2269
+ }), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-groupkey": l });
2263
2270
  }
2264
2271
  function i(c) {
2265
- e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.manual && c.groupable === !0 && ae("manual-groupable", "`groupable` is passed over in manual mode: the groups would be the page's, not the server's.");
2266
- const a = ce(null), [f, d] = W(null);
2272
+ e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.manual && c.groupable === !0 && le("manual-groupable", "`groupable` is passed over in manual mode: the groups would be the page's, not the server's.");
2273
+ const l = ce(null), [f, d] = W(null);
2267
2274
  X(() => {
2268
- e.children = a.current, e.checkOrder(), e.commit();
2275
+ e.children = l.current, e.checkOrder(), e.commit();
2269
2276
  });
2270
2277
  const p = q(() => ({ registry: e, footerTarget: f }), [f]);
2271
2278
  return /* @__PURE__ */ u(ct.Provider, { value: p, children: /* @__PURE__ */ R("div", { className: H(h.frame, c.className), children: [
2272
- /* @__PURE__ */ u("div", { ref: a, className: h.children, children: c.children }),
2273
- /* @__PURE__ */ u(Xs, { registry: e }),
2274
- /* @__PURE__ */ u(Qs, { registry: e, props: c }),
2279
+ /* @__PURE__ */ u("div", { ref: l, className: h.children, children: c.children }),
2280
+ /* @__PURE__ */ u(Zs, { registry: e }),
2281
+ /* @__PURE__ */ u(ei, { registry: e, props: c }),
2275
2282
  /* @__PURE__ */ u("div", { ref: d, className: h.footerTarget })
2276
2283
  ] }) });
2277
2284
  }
2278
- const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
2279
- return as(i, e), l;
2285
+ const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
2286
+ return ls(i, e), a;
2280
2287
  }
2281
- function Xs({ registry: e }) {
2288
+ function Zs({ registry: e }) {
2282
2289
  return We(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ u(hn, { registry: e, own: !0 });
2283
2290
  }
2284
- function Qs({ registry: e, props: t }) {
2291
+ function ei({ registry: e, props: t }) {
2285
2292
  const {
2286
2293
  selectable: n = !1,
2287
2294
  stickyHeader: o = !1,
2288
2295
  striped: r = !1,
2289
2296
  density: s,
2290
2297
  maxHeight: i,
2291
- empty: l,
2298
+ empty: a,
2292
2299
  loading: c = !1,
2293
- rowProps: a,
2300
+ rowProps: l,
2294
2301
  ariaLabel: f,
2295
2302
  grid: d = !1
2296
2303
  } = t;
2297
2304
  We(e.subscribe, e.bodyVersion, e.bodyVersion);
2298
- const p = re(), b = be(), S = Zt(s, "regular"), w = me(), O = ce(null), y = Is();
2305
+ const p = re(), b = be(), k = Zt(s, "regular"), w = me(), O = ce(null), y = Bs();
2299
2306
  X(() => {
2300
2307
  var oe, B, z;
2301
2308
  const C = O.current;
@@ -2332,18 +2339,18 @@ function Qs({ registry: e, props: t }) {
2332
2339
  (ie == null ? void 0 : ie.cells.length) === E.widths.length && Array.from(ie.cells).forEach((B, z) => B.style.width = `${E.widths[z]}px`);
2333
2340
  });
2334
2341
  const L = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
2335
- Ts(O, L ? `${L.grouping.join("|")}#${L.folded.join("|")}` : "");
2342
+ Ms(O, L ? `${L.grouping.join("|")}#${L.folded.join("|")}` : "");
2336
2343
  const g = e.hook;
2337
2344
  if (!g) return null;
2338
- const k = g.publicSnapshot, T = e.projection(), F = e.rowHeader(), m = dn(e), x = e.detail, A = e.hasRowActions() ? e.actions.ordered() : [], v = g.companion.virtual, M = k.grouping, N = M.length > 0 ? T.visibleLines : void 0, I = N ? e.groupingEntries(g.rows) : [], P = (C) => I.find((E) => E.spec.id === C), $ = N && M.length > 1 ? P(M.at(-1)) : void 0, U = N ? m.filter((C) => !M.includes(C.spec.id)) : m, Z = (n ? 1 : 0) + (x ? 1 : 0), he = Z + ($ ? 1 : 0), se = he + U.length + (A.length > 0 ? 1 : 0), ve = e.pins(), Se = U.filter((C) => ve[C.spec.id] === "start").length, Oe = U.filter((C) => ve[C.spec.id] === "end").length, Ce = $ !== void 0 && ve[$.spec.id] === "start", ue = {
2345
+ const S = g.publicSnapshot, T = e.projection(), F = e.rowHeader(), m = dn(e), x = e.detail, A = e.hasRowActions() ? e.actions.ordered() : [], v = g.companion.virtual, M = S.grouping, N = M.length > 0 ? T.visibleLines : void 0, I = N ? e.groupingEntries(g.rows) : [], P = (C) => I.find((E) => E.spec.id === C), $ = N && M.length > 1 ? P(M.at(-1)) : void 0, U = N ? m.filter((C) => !M.includes(C.spec.id)) : m, Z = (n ? 1 : 0) + (x ? 1 : 0), he = Z + ($ ? 1 : 0), se = he + U.length + (A.length > 0 ? 1 : 0), ve = e.pins(), Se = U.filter((C) => ve[C.spec.id] === "start").length, Oe = U.filter((C) => ve[C.spec.id] === "end").length, Ce = $ !== void 0 && ve[$.spec.id] === "start", ue = {
2339
2346
  start: Se > 0 || Ce ? he + Se : 0,
2340
2347
  end: Oe > 0 ? Oe + (A.length > 0 ? 1 : 0) : 0,
2341
2348
  count: se
2342
- }, Y = (C, E = C) => St(ue, C, E), ge = T.visible, ye = !c && !k.manual && U.some((C) => C.spec.aggregate), Ne = k.search !== "" || Object.keys(k.filter).length > 0, _e = d ? Fs({
2349
+ }, Y = (C, E = C) => St(ue, C, E), ge = T.visible, ye = !c && !S.manual && U.some((C) => C.spec.aggregate), Ne = S.search !== "" || Object.keys(S.filter).length > 0, _e = d ? Ds({
2343
2350
  layout: { controls: Z, span: $ !== void 0, aggregates: U.map((C) => C.spec.aggregate !== void 0), actions: A.length > 0, blocks: ue },
2344
2351
  body: c ? { rows: [] } : N ? { lines: v ? T.lines : N } : { rows: v ? T.filtered : ge },
2345
2352
  rowKey: g.rowKey,
2346
- expanded: new Set(x ? k.expanded : []),
2353
+ expanded: new Set(x ? S.expanded : []),
2347
2354
  foot: ye
2348
2355
  }) : [], xe = [
2349
2356
  ...n ? ["#select"] : [],
@@ -2351,7 +2358,7 @@ function Qs({ registry: e, props: t }) {
2351
2358
  ...$ ? ["#span"] : [],
2352
2359
  ...U.map((C) => C.spec.id),
2353
2360
  ...A.length > 0 ? ["#actions"] : []
2354
- ], J = d ? js({
2361
+ ], J = d ? qs({
2355
2362
  grid: y,
2356
2363
  lines: _e,
2357
2364
  ids: xe,
@@ -2359,9 +2366,9 @@ function Qs({ registry: e, props: t }) {
2359
2366
  rowKey: g.rowKey,
2360
2367
  virtual: v,
2361
2368
  onCellEdit: t.onCellEdit,
2362
- select: n ? (C) => k.selection.toggle(g.rowKey(C)) : void 0
2369
+ select: n ? (C) => S.selection.toggle(g.rowKey(C)) : void 0
2363
2370
  }) : void 0, D = (C) => d ? C : void 0, G = (C, E, ie, oe) => /* @__PURE__ */ u(
2364
- ei,
2371
+ ni,
2365
2372
  {
2366
2373
  row: C,
2367
2374
  index: E,
@@ -2376,7 +2383,7 @@ function Qs({ registry: e, props: t }) {
2376
2383
  actions: A,
2377
2384
  blocks: ue,
2378
2385
  columnCount: se,
2379
- rowProps: a,
2386
+ rowProps: l,
2380
2387
  baseId: w,
2381
2388
  formats: b,
2382
2389
  wording: p,
@@ -2387,10 +2394,10 @@ function Qs({ registry: e, props: t }) {
2387
2394
  let K;
2388
2395
  if (c)
2389
2396
  K = /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u(
2390
- si,
2397
+ ai,
2391
2398
  {
2392
2399
  columns: se,
2393
- rows: k.manual ? ge.length || k.pageSize : void 0,
2400
+ rows: S.manual ? ge.length || S.pageSize : void 0,
2394
2401
  rightAligned: [
2395
2402
  ...Array.from({ length: Z + ($ ? 1 : 0) }, () => !1),
2396
2403
  ...U.map((C) => bt(e.kindOf(C, g.rows), C.spec.rightAligned))
@@ -2398,10 +2405,10 @@ function Qs({ registry: e, props: t }) {
2398
2405
  }
2399
2406
  ) });
2400
2407
  else if (T.filtered.length === 0)
2401
- K = /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { "data-grid-line": D("empty"), children: /* @__PURE__ */ u("td", { colSpan: se, className: h.emptyCell, children: /* @__PURE__ */ u("div", { className: h.empty, children: (k.manual || g.admitted.length > 0) && Ne ? /* @__PURE__ */ R(ne, { children: [
2408
+ K = /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { "data-grid-line": D("empty"), children: /* @__PURE__ */ u("td", { colSpan: se, className: h.emptyCell, children: /* @__PURE__ */ u("div", { className: h.empty, children: (S.manual || g.admitted.length > 0) && Ne ? /* @__PURE__ */ R(ne, { children: [
2402
2409
  /* @__PURE__ */ u("p", { className: h.emptyTitle, children: p.nothingMatchesFilters }),
2403
- /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => fn(k), children: p.resetAll })
2404
- ] }) : l ?? /* @__PURE__ */ u("p", { className: h.emptyTitle, children: p.noEntries }) }) }) }) });
2410
+ /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => fn(S), children: p.resetAll })
2411
+ ] }) : a ?? /* @__PURE__ */ u("p", { className: h.emptyTitle, children: p.noEntries }) }) }) }) });
2405
2412
  else if (N) {
2406
2413
  const C = v ? nn(N).map((B) => B.kind === "folded" || !B.continued ? B : { ...B, continued: !1 }) : N, E = C.length - N.length, ie = v && v.from > 0 ? v.fillerBefore / v.from : 0, oe = (B, z) => {
2407
2414
  var de, pe;
@@ -2487,7 +2494,7 @@ function Qs({ registry: e, props: t }) {
2487
2494
  "aria-busy": c || void 0,
2488
2495
  className: H(
2489
2496
  h.table,
2490
- S === "compact" && h.compact,
2497
+ k === "compact" && h.compact,
2491
2498
  o && h.sticky,
2492
2499
  r && h.striped,
2493
2500
  d && h.grid
@@ -2497,10 +2504,10 @@ function Qs({ registry: e, props: t }) {
2497
2504
  n && /* @__PURE__ */ u("th", { scope: "col", className: H(h.th, h.control, Y(0).className), style: Y(0).style, children: /* @__PURE__ */ u(
2498
2505
  Le,
2499
2506
  {
2500
- "aria-label": k.manual ? p.selectAllOnPage : p.selectAllRows,
2501
- checked: k.selection.allSelected,
2502
- indeterminate: k.selection.someSelected,
2503
- onChange: k.selection.toggleAll
2507
+ "aria-label": S.manual ? p.selectAllOnPage : p.selectAllRows,
2508
+ checked: S.selection.allSelected,
2509
+ indeterminate: S.selection.someSelected,
2510
+ onChange: S.selection.toggleAll
2504
2511
  }
2505
2512
  ) }),
2506
2513
  x && /* @__PURE__ */ u(
@@ -2527,7 +2534,7 @@ function Qs({ registry: e, props: t }) {
2527
2534
  Array.from({ length: Z }, (C, E) => /* @__PURE__ */ u("td", { className: H(h.td, h.control, Y(E).className), style: Y(E).style }, E)),
2528
2535
  $ && /* @__PURE__ */ u("td", { className: H(h.td, Y(Z).className), style: Y(Z).style }),
2529
2536
  U.map((C, E) => /* @__PURE__ */ u(
2530
- ni,
2537
+ ri,
2531
2538
  {
2532
2539
  entry: C,
2533
2540
  rows: T.filtered,
@@ -2543,7 +2550,7 @@ function Qs({ registry: e, props: t }) {
2543
2550
  }
2544
2551
  ),
2545
2552
  /* @__PURE__ */ u(
2546
- Zs,
2553
+ ti,
2547
2554
  {
2548
2555
  table: O,
2549
2556
  blocks: ue,
@@ -2551,7 +2558,7 @@ function Qs({ registry: e, props: t }) {
2551
2558
  }
2552
2559
  ),
2553
2560
  d && /* @__PURE__ */ u(
2554
- Gs,
2561
+ Hs,
2555
2562
  {
2556
2563
  table: O,
2557
2564
  grid: y,
@@ -2564,31 +2571,31 @@ function Qs({ registry: e, props: t }) {
2564
2571
  }
2565
2572
  );
2566
2573
  }
2567
- function Zs({
2574
+ function ti({
2568
2575
  table: e,
2569
2576
  blocks: t,
2570
2577
  pinnedKeys: n
2571
2578
  }) {
2572
2579
  const { start: o, end: r } = t, s = () => {
2573
- var d, p, b, S;
2574
- const i = e.current, l = i == null ? void 0 : i.parentElement;
2575
- if (!i || !l || (l.style.removeProperty("scroll-padding-left"), l.style.removeProperty("scroll-padding-right"), !o && !r)) return;
2580
+ var d, p, b, k;
2581
+ const i = e.current, a = i == null ? void 0 : i.parentElement;
2582
+ if (!i || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !o && !r)) return;
2576
2583
  const c = Array.from(((p = (d = i.tHead) == null ? void 0 : d.rows[0]) == null ? void 0 : p.cells) ?? []);
2577
- let a = 0;
2584
+ let l = 0;
2578
2585
  for (let w = 0; w < o; w++)
2579
- i.style.setProperty(`--u-table-pin-start-${w}`, `${a}px`), a += ((b = c[w]) == null ? void 0 : b.getBoundingClientRect().width) ?? 0;
2586
+ i.style.setProperty(`--u-table-pin-start-${w}`, `${l}px`), l += ((b = c[w]) == null ? void 0 : b.getBoundingClientRect().width) ?? 0;
2580
2587
  let f = 0;
2581
2588
  for (let w = 0; w < r; w++)
2582
- i.style.setProperty(`--u-table-pin-end-${w}`, `${f}px`), f += ((S = c[c.length - 1 - w]) == null ? void 0 : S.getBoundingClientRect().width) ?? 0;
2583
- i.style.setProperty("--u-table-pin-start", `${a}px`), i.style.setProperty("--u-table-pin-end", `${f}px`), a && l.style.setProperty("scroll-padding-left", `${a}px`), f && l.style.setProperty("scroll-padding-right", `${f}px`), kn(l);
2589
+ i.style.setProperty(`--u-table-pin-end-${w}`, `${f}px`), f += ((k = c[c.length - 1 - w]) == null ? void 0 : k.getBoundingClientRect().width) ?? 0;
2590
+ i.style.setProperty("--u-table-pin-start", `${l}px`), i.style.setProperty("--u-table-pin-end", `${f}px`), l && a.style.setProperty("scroll-padding-left", `${l}px`), f && a.style.setProperty("scroll-padding-right", `${f}px`), kn(a);
2584
2591
  };
2585
2592
  return X(s), Wt(() => {
2586
- var a, f;
2593
+ var l, f;
2587
2594
  const i = e.current;
2588
2595
  if (!i || !o && !r || typeof ResizeObserver > "u") return;
2589
- const l = new ResizeObserver(s), c = Array.from(((f = (a = i.tHead) == null ? void 0 : a.rows[0]) == null ? void 0 : f.cells) ?? []);
2590
- for (const d of [...c.slice(0, o), ...c.slice(c.length - r)]) l.observe(d);
2591
- return i.parentElement && l.observe(i.parentElement), () => l.disconnect();
2596
+ const a = new ResizeObserver(s), c = Array.from(((f = (l = i.tHead) == null ? void 0 : l.rows[0]) == null ? void 0 : f.cells) ?? []);
2597
+ for (const d of [...c.slice(0, o), ...c.slice(c.length - r)]) a.observe(d);
2598
+ return i.parentElement && a.observe(i.parentElement), () => a.disconnect();
2592
2599
  }, [e, o, r, t.count, n]), null;
2593
2600
  }
2594
2601
  function kn(e) {
@@ -2607,48 +2614,48 @@ function Gt({
2607
2614
  hook: n,
2608
2615
  pin: o
2609
2616
  }) {
2610
- const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = bt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, f = s.sort.findIndex((k) => k.column === a), d = f === -1 ? void 0 : s.sort[f].direction, p = s.sort.length > 1 && f !== -1 ? f + 1 : void 0, b = s.widths[a], S = 48, w = (k) => {
2611
- k.stopPropagation(), k.preventDefault();
2612
- const T = k.currentTarget, F = T.closest("th");
2617
+ const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), a = bt(i, r.rightAligned), c = t.isSortable(e, n.rows), l = r.id, f = s.sort.findIndex((S) => S.column === l), d = f === -1 ? void 0 : s.sort[f].direction, p = s.sort.length > 1 && f !== -1 ? f + 1 : void 0, b = s.widths[l], k = 48, w = (S) => {
2618
+ S.stopPropagation(), S.preventDefault();
2619
+ const T = S.currentTarget, F = T.closest("th");
2613
2620
  if (!F) return;
2614
- const m = k.clientX, x = F.getBoundingClientRect().width, A = k.pointerId;
2621
+ const m = S.clientX, x = F.getBoundingClientRect().width, A = S.pointerId;
2615
2622
  T.setPointerCapture(A);
2616
2623
  const v = (N) => {
2617
- N.pointerId === A && s.setWidth(a, Math.max(S, x + (N.clientX - m)));
2624
+ N.pointerId === A && s.setWidth(l, Math.max(k, x + (N.clientX - m)));
2618
2625
  }, M = (N) => {
2619
2626
  N.pointerId === A && (T.removeEventListener("pointermove", v), T.removeEventListener("pointerup", M), T.removeEventListener("pointercancel", M), T.hasPointerCapture(A) && T.releasePointerCapture(A));
2620
2627
  };
2621
2628
  T.addEventListener("pointermove", v), T.addEventListener("pointerup", M), T.addEventListener("pointercancel", M);
2622
- }, O = (k) => {
2623
- const T = k == null ? void 0 : k.parentElement, F = k == null ? void 0 : k.closest("table");
2624
- if (!k || !T || !F) return;
2625
- const m = Array.from(T.children).indexOf(k), x = T.children.length, A = { cell: k.style.width, table: F.style.width };
2626
- k.style.width = "", F.style.width = "auto";
2629
+ }, O = (S) => {
2630
+ const T = S == null ? void 0 : S.parentElement, F = S == null ? void 0 : S.closest("table");
2631
+ if (!S || !T || !F) return;
2632
+ const m = Array.from(T.children).indexOf(S), x = T.children.length, A = { cell: S.style.width, table: F.style.width };
2633
+ S.style.width = "", F.style.width = "auto";
2627
2634
  let v = 0;
2628
2635
  for (const M of Array.from(F.rows)) {
2629
2636
  if (M.cells.length !== x) continue;
2630
2637
  const N = M.cells[m];
2631
2638
  N && (v = Math.max(v, N.scrollWidth));
2632
2639
  }
2633
- k.style.width = A.cell, F.style.width = A.table, v > 0 && s.setWidth(a, Math.max(S, v + 1));
2634
- }, y = (k) => {
2635
- if (!r.resizable || !k.altKey) return;
2636
- const T = k.key === "ArrowRight", F = k.key === "ArrowLeft", m = k.key === "Home";
2640
+ S.style.width = A.cell, F.style.width = A.table, v > 0 && s.setWidth(l, Math.max(k, v + 1));
2641
+ }, y = (S) => {
2642
+ if (!r.resizable || !S.altKey) return;
2643
+ const T = S.key === "ArrowRight", F = S.key === "ArrowLeft", m = S.key === "Home";
2637
2644
  if (!T && !F && !m) return;
2638
- k.preventDefault();
2639
- const x = k.currentTarget;
2645
+ S.preventDefault();
2646
+ const x = S.currentTarget;
2640
2647
  if (m) {
2641
2648
  O(x);
2642
2649
  return;
2643
2650
  }
2644
- const A = x.getBoundingClientRect().width, v = k.shiftKey ? 32 : 8;
2645
- s.setWidth(a, Math.max(S, A + (T ? v : -v)));
2651
+ const A = x.getBoundingClientRect().width, v = S.shiftKey ? 32 : 8;
2652
+ s.setWidth(l, Math.max(k, A + (T ? v : -v)));
2646
2653
  }, _ = c ? /* @__PURE__ */ R(
2647
2654
  "button",
2648
2655
  {
2649
2656
  type: "button",
2650
2657
  className: h.sortButton,
2651
- onClick: (k) => s.toggleSort(a, k.shiftKey || k.metaKey),
2658
+ onClick: (S) => s.toggleSort(l, S.shiftKey || S.metaKey),
2652
2659
  children: [
2653
2660
  /* @__PURE__ */ u("span", { children: r.label }),
2654
2661
  p !== void 0 && /* @__PURE__ */ u("span", { className: h.sortRank, "aria-hidden": "true", children: p }),
@@ -2664,11 +2671,11 @@ function Gt({
2664
2671
  "th",
2665
2672
  {
2666
2673
  scope: "col",
2667
- "data-column": a,
2674
+ "data-column": l,
2668
2675
  "aria-sort": c ? L : void 0,
2669
2676
  tabIndex: r.resizable && !c ? 0 : void 0,
2670
2677
  onKeyDown: y,
2671
- className: H(h.th, l && h.numeric, o.className),
2678
+ className: H(h.th, a && h.numeric, o.className),
2672
2679
  style: {
2673
2680
  ...b !== void 0 ? { width: b } : {},
2674
2681
  ...o.style
@@ -2684,9 +2691,9 @@ function Gt({
2684
2691
  role: "presentation",
2685
2692
  className: h.grip,
2686
2693
  onPointerDown: w,
2687
- onClick: (k) => k.stopPropagation(),
2688
- onDoubleClick: (k) => {
2689
- k.stopPropagation(), O(k.currentTarget.closest("th"));
2694
+ onClick: (S) => S.stopPropagation(),
2695
+ onDoubleClick: (S) => {
2696
+ S.stopPropagation(), O(S.currentTarget.closest("th"));
2690
2697
  }
2691
2698
  }
2692
2699
  )
@@ -2694,7 +2701,7 @@ function Gt({
2694
2701
  }
2695
2702
  );
2696
2703
  }
2697
- function ei({
2704
+ function ni({
2698
2705
  row: e,
2699
2706
  index: t,
2700
2707
  absolute: n,
@@ -2702,19 +2709,19 @@ function ei({
2702
2709
  hook: r,
2703
2710
  columns: s,
2704
2711
  header: i,
2705
- selectable: l,
2712
+ selectable: a,
2706
2713
  actions: c,
2707
- blocks: a,
2714
+ blocks: l,
2708
2715
  columnCount: f,
2709
2716
  rowProps: d,
2710
2717
  baseId: p,
2711
2718
  formats: b,
2712
- wording: S,
2719
+ wording: k,
2713
2720
  line: w,
2714
2721
  spanEntry: O,
2715
2722
  grid: y
2716
2723
  }) {
2717
- const _ = je(Sn), L = r.publicSnapshot, g = r.rowKey(e), k = Ys(e, i, r, b, S), T = o.detail, F = T !== null && L.expanded.includes(g), m = `${p}-detail-${t}`, { className: x, ...A } = (d == null ? void 0 : d(e)) ?? {}, v = n !== void 0, M = w ? w.span ?? w.parents.at(-1) : void 0, N = (l ? 1 : 0) + (T ? 1 : 0), I = N + (O ? 1 : 0), P = ($) => St(a, $);
2724
+ const _ = je(Sn), L = r.publicSnapshot, g = r.rowKey(e), S = Xs(e, i, r, b, k), T = o.detail, F = T !== null && L.expanded.includes(g), m = `${p}-detail-${t}`, { className: x, ...A } = (d == null ? void 0 : d(e)) ?? {}, v = n !== void 0, M = w ? w.span ?? w.parents.at(-1) : void 0, N = (a ? 1 : 0) + (T ? 1 : 0), I = N + (O ? 1 : 0), P = ($) => St(l, $);
2718
2725
  return /* @__PURE__ */ R(ne, { children: [
2719
2726
  /* @__PURE__ */ R(
2720
2727
  "tr",
@@ -2724,7 +2731,7 @@ function ei({
2724
2731
  "data-row": v ? n : void 0,
2725
2732
  "data-line": w ? "row" : void 0,
2726
2733
  "data-motion": g,
2727
- "data-selected": l && L.selection.isSelected(g) ? "" : void 0,
2734
+ "data-selected": a && L.selection.isSelected(g) ? "" : void 0,
2728
2735
  "data-group-first": w != null && w.first ? "" : void 0,
2729
2736
  "data-group": M == null ? void 0 : M.path,
2730
2737
  "aria-level": w ? w.parents.length + 1 : void 0,
@@ -2735,10 +2742,10 @@ function ei({
2735
2742
  "data-even": v && n % 2 === 1 ? "" : void 0,
2736
2743
  "aria-rowindex": v ? n + 2 : void 0,
2737
2744
  children: [
2738
- l && /* @__PURE__ */ u("td", { className: H(h.td, h.control, P(0).className), style: P(0).style, children: /* @__PURE__ */ u(
2745
+ a && /* @__PURE__ */ u("td", { className: H(h.td, h.control, P(0).className), style: P(0).style, children: /* @__PURE__ */ u(
2739
2746
  Le,
2740
2747
  {
2741
- "aria-label": S.selectRow(k),
2748
+ "aria-label": k.selectRow(S),
2742
2749
  checked: L.selection.isSelected(g),
2743
2750
  onChange: () => L.selection.toggle(g)
2744
2751
  }
@@ -2749,46 +2756,46 @@ function ei({
2749
2756
  type: "button",
2750
2757
  "aria-expanded": F,
2751
2758
  "aria-controls": F ? m : void 0,
2752
- "aria-label": F ? S.collapseRowNamed(k) : S.expandRowNamed(k),
2759
+ "aria-label": F ? k.collapseRowNamed(S) : k.expandRowNamed(S),
2753
2760
  className: H(h.expander, F && h.expanderOpen),
2754
2761
  onClick: () => L.toggleRow(g),
2755
2762
  children: /* @__PURE__ */ u(Rn, {})
2756
2763
  }
2757
2764
  ) }),
2758
2765
  w && w.span && /* @__PURE__ */ u(
2759
- Ps,
2766
+ zs,
2760
2767
  {
2761
2768
  line: { ...w, span: w.span },
2762
2769
  entry: O,
2763
- selectable: l,
2770
+ selectable: a,
2764
2771
  pin: P(N),
2765
2772
  hook: r,
2766
2773
  formats: b,
2767
- wording: S
2774
+ wording: k
2768
2775
  }
2769
2776
  ),
2770
2777
  s.map(($, U) => /* @__PURE__ */ u(
2771
- ti,
2778
+ oi,
2772
2779
  {
2773
2780
  entry: $,
2774
2781
  row: e,
2775
2782
  kind: o.kindOf($, r.rows),
2776
2783
  pin: P(I + U),
2777
2784
  formats: b,
2778
- wording: S,
2785
+ wording: k,
2779
2786
  rowKey: g,
2780
- rowName: k
2787
+ rowName: S
2781
2788
  },
2782
2789
  $.key
2783
2790
  )),
2784
- c.length > 0 && /* @__PURE__ */ u("td", { className: H(h.td, h.actionsCell, P(f - 1).className), style: P(f - 1).style, children: /* @__PURE__ */ u(ri, { actions: c, row: e, name: k, wording: S }) })
2791
+ c.length > 0 && /* @__PURE__ */ u("td", { className: H(h.td, h.actionsCell, P(f - 1).className), style: P(f - 1).style, children: /* @__PURE__ */ u(ii, { actions: c, row: e, name: S, wording: k }) })
2785
2792
  ]
2786
2793
  }
2787
2794
  ),
2788
2795
  F && T && /* @__PURE__ */ u("tr", { id: m, className: h.detailRow, "data-group": M == null ? void 0 : M.path, "data-grid-line": y ? `detail:${g}` : void 0, children: /* @__PURE__ */ u("td", { colSpan: f, className: h.detailCell, children: T.presentation(e) }) })
2789
2796
  ] });
2790
2797
  }
2791
- function ti({
2798
+ function oi({
2792
2799
  entry: e,
2793
2800
  row: t,
2794
2801
  kind: n,
@@ -2796,11 +2803,11 @@ function ti({
2796
2803
  formats: r,
2797
2804
  wording: s,
2798
2805
  rowKey: i,
2799
- rowName: l
2806
+ rowName: a
2800
2807
  }) {
2801
- const { spec: c } = e, a = e.read(t), f = bt(n, c.rightAligned), d = Vs(i, c.id);
2808
+ const { spec: c } = e, l = e.read(t), f = bt(n, c.rightAligned), d = Gs(i, c.id);
2802
2809
  let p;
2803
- Q(a) ? p = /* @__PURE__ */ u(gn, { wording: s }) : c.presentation ? p = c.presentation(a, t) : p = Re(a, c.format, r, s);
2810
+ Q(l) ? p = /* @__PURE__ */ u(gn, { wording: s }) : c.presentation ? p = c.presentation(l, t) : p = Re(l, c.format, r, s);
2804
2811
  const b = c.rowHeader ? "th" : "td";
2805
2812
  return /* @__PURE__ */ u(
2806
2813
  b,
@@ -2809,13 +2816,13 @@ function ti({
2809
2816
  className: H(h.td, f && h.numeric, c.rowHeader && h.rowHeader, o.className, d && h.editing),
2810
2817
  style: o.style,
2811
2818
  children: d ? /* @__PURE__ */ R(ne, { children: [
2812
- /* @__PURE__ */ u(qs, { entry: e, row: t, rowName: l, grid: d }),
2819
+ /* @__PURE__ */ u(Ys, { entry: e, row: t, rowName: a, grid: d }),
2813
2820
  /* @__PURE__ */ u("span", { className: h.editingValue, "aria-hidden": "true", children: p })
2814
2821
  ] }) : p
2815
2822
  }
2816
2823
  );
2817
2824
  }
2818
- function ni({
2825
+ function ri({
2819
2826
  entry: e,
2820
2827
  rows: t,
2821
2828
  formats: n,
@@ -2826,8 +2833,8 @@ function ni({
2826
2833
  const s = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
2827
2834
  return /* @__PURE__ */ u("td", { className: H(h.td, pn(e, t) && h.numeric, r.className), style: r.style, "data-footer": s, children: /* @__PURE__ */ u(ut, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
2828
2835
  }
2829
- const oi = 2;
2830
- function ri({
2836
+ const si = 2;
2837
+ function ii({
2831
2838
  actions: e,
2832
2839
  row: t,
2833
2840
  name: n,
@@ -2837,7 +2844,7 @@ function ri({
2837
2844
  const i = s.onSelect;
2838
2845
  i(s.bulk ? [t] : t);
2839
2846
  };
2840
- return e.length <= oi ? /* @__PURE__ */ u("div", { className: h.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ u(
2847
+ return e.length <= si ? /* @__PURE__ */ u("div", { className: h.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ u(
2841
2848
  fe,
2842
2849
  {
2843
2850
  size: "sm",
@@ -2856,9 +2863,9 @@ function ri({
2856
2863
  }
2857
2864
  ) });
2858
2865
  }
2859
- function si({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2866
+ function ai({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2860
2867
  const o = [72, 48, 60, 40, 56, 64];
2861
- return /* @__PURE__ */ u(ne, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ u("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ u("td", { className: H(h.td, t[l] && h.numeric), children: /* @__PURE__ */ u("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
2868
+ return /* @__PURE__ */ u(ne, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ u("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, a) => /* @__PURE__ */ u("td", { className: H(h.td, t[a] && h.numeric), children: /* @__PURE__ */ u("span", { className: h.skeleton, style: { width: `${o[(s + a) % o.length]}%` } }) }, a)) }, s)) });
2862
2869
  }
2863
2870
  const Sn = pt(0);
2864
2871
  function $t({ height: e, colSpan: t }) {
@@ -2869,16 +2876,16 @@ function Ht({
2869
2876
  colSpan: t,
2870
2877
  children: n
2871
2878
  }) {
2872
- const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = ce(null), [c, a] = W(0), f = (b, S) => {
2873
- l.current = S, a(S), i(S), requestAnimationFrame(() => {
2879
+ const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = ce(null), [c, l] = W(0), f = (b, k) => {
2880
+ a.current = k, l(k), i(k), requestAnimationFrame(() => {
2874
2881
  var w;
2875
- (w = b.querySelector(`[data-row="${S}"]`)) == null || w.focus();
2882
+ (w = b.querySelector(`[data-row="${k}"]`)) == null || w.focus();
2876
2883
  });
2877
2884
  }, d = c >= e.from && c < e.to ? c : e.from, p = (b) => {
2878
2885
  if (b.defaultPrevented || o === 0) return;
2879
- const S = b.target, w = S.closest("[data-row]");
2880
- if (w && S !== w) return;
2881
- const O = w ? Number(w.dataset.row) : l.current ?? -1;
2886
+ const k = b.target, w = k.closest("[data-row]");
2887
+ if (w && k !== w) return;
2888
+ const O = w ? Number(w.dataset.row) : a.current ?? -1;
2882
2889
  let y = null;
2883
2890
  b.key === "ArrowDown" ? y = Math.min(o - 1, O + 1) : b.key === "ArrowUp" ? y = Math.max(0, O - 1) : b.key === "Home" ? y = 0 : b.key === "End" && (y = o - 1), !(y === null || y === O) && (b.preventDefault(), f(b.currentTarget, y));
2884
2891
  };
@@ -2888,8 +2895,8 @@ function Ht({
2888
2895
  className: h.virtualBody,
2889
2896
  onKeyDown: p,
2890
2897
  onFocus: (b) => {
2891
- const S = b.target.closest("[data-row]");
2892
- S && a(Number(S.dataset.row));
2898
+ const k = b.target.closest("[data-row]");
2899
+ k && l(Number(k.dataset.row));
2893
2900
  },
2894
2901
  children: /* @__PURE__ */ R(Sn.Provider, { value: d, children: [
2895
2902
  /* @__PURE__ */ u($t, { height: r, colSpan: t }),
@@ -2899,21 +2906,21 @@ function Ht({
2899
2906
  }
2900
2907
  );
2901
2908
  }
2902
- const ii = "_verdict_1mxfd_6", li = "_glyph_1mxfd_13", ai = "_value_1mxfd_23", ci = "_excess_1mxfd_28", He = {
2903
- verdict: ii,
2904
- glyph: li,
2905
- value: ai,
2906
- excess: ci
2907
- }, Kt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), ui = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, di = {
2909
+ const li = "_verdict_1mxfd_6", ci = "_glyph_1mxfd_13", ui = "_value_1mxfd_23", di = "_excess_1mxfd_28", He = {
2910
+ verdict: li,
2911
+ glyph: ci,
2912
+ value: ui,
2913
+ excess: di
2914
+ }, Kt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), fi = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, hi = {
2908
2915
  ok: "✓",
2909
2916
  unknown: "?",
2910
2917
  warning: "▲",
2911
2918
  alarm: "■"
2912
2919
  };
2913
- function fi({ reading: e, format: t }) {
2914
- const n = be(), o = re(), { measured: r, assessment: s } = e, i = ui(s.verdict, o);
2920
+ function gi({ reading: e, format: t }) {
2921
+ const n = be(), o = re(), { measured: r, assessment: s } = e, i = fi(s.verdict, o);
2915
2922
  return /* @__PURE__ */ R("span", { className: He.verdict, "data-verdict": s.verdict, title: i, children: [
2916
- /* @__PURE__ */ u("span", { "aria-hidden": "true", className: He.glyph, children: di[s.verdict] }),
2923
+ /* @__PURE__ */ u("span", { "aria-hidden": "true", className: He.glyph, children: hi[s.verdict] }),
2917
2924
  /* @__PURE__ */ u("span", { className: He.value, children: r === null ? o.statAbsentValue : Kt(r, t, n) }),
2918
2925
  s.excess !== void 0 && /* @__PURE__ */ R("span", { className: He.excess, children: [
2919
2926
  "+",
@@ -2922,12 +2929,12 @@ function fi({ reading: e, format: t }) {
2922
2929
  /* @__PURE__ */ u(De, { children: i })
2923
2930
  ] });
2924
2931
  }
2925
- const hi = (e) => e.measured, gi = (e) => e.reduce(
2932
+ const pi = (e) => e.measured, mi = (e) => e.reduce(
2926
2933
  (t, n) => !t || rt(n.assessment.verdict) > rt(t.assessment.verdict) ? n : t,
2927
2934
  void 0
2928
2935
  );
2929
- function pi(e) {
2930
- return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: f, aggregate: d }) {
2936
+ function bi(e) {
2937
+ return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: l, pin: f, aggregate: d }) {
2931
2938
  const p = JSON.stringify(s), b = q(() => {
2932
2939
  const w = JSON.parse(p);
2933
2940
  return (O) => {
@@ -2937,9 +2944,9 @@ function pi(e) {
2937
2944
  assessment: Pn(y, w)
2938
2945
  };
2939
2946
  };
2940
- }, [o, p]), S = le(
2941
- (w) => l === "value" ? w.measured : rt(w.assessment.verdict),
2942
- [l]
2947
+ }, [o, p]), k = ae(
2948
+ (w) => a === "value" ? w.measured : rt(w.assessment.verdict),
2949
+ [a]
2943
2950
  );
2944
2951
  return /* @__PURE__ */ u(
2945
2952
  e,
@@ -2948,18 +2955,18 @@ function pi(e) {
2948
2955
  label: r,
2949
2956
  numeric: !0,
2950
2957
  width: c,
2951
- resizable: a,
2958
+ resizable: l,
2952
2959
  pin: f,
2953
2960
  value: b,
2954
- sortValue: S,
2955
- exportValue: hi,
2956
- aggregate: d === "worst" ? gi : void 0,
2957
- children: (w) => /* @__PURE__ */ u(fi, { reading: w, format: i })
2961
+ sortValue: k,
2962
+ exportValue: pi,
2963
+ aggregate: d === "worst" ? mi : void 0,
2964
+ children: (w) => /* @__PURE__ */ u(gi, { reading: w, format: i })
2958
2965
  }
2959
2966
  );
2960
2967
  };
2961
2968
  }
2962
- const Cn = (e) => ae(
2969
+ const Cn = (e) => le(
2963
2970
  `condition-foreign:${e}`,
2964
2971
  `The condition for "${e}" is not of the kind of its filter and is passed over.`
2965
2972
  );
@@ -2969,33 +2976,33 @@ function Nn(e, t, n) {
2969
2976
  const s = sn(r, n);
2970
2977
  return s === "foreign" && Cn(t), s === "effective";
2971
2978
  }
2972
- function mi(e, t) {
2979
+ function wi(e, t) {
2973
2980
  if (e.length === 0) return;
2974
2981
  let n = -1, o = [];
2975
2982
  return (r) => {
2976
2983
  if (n !== t.structureVersion()) {
2977
2984
  n = t.structureVersion(), o = [];
2978
2985
  for (const [s, i] of e) {
2979
- const l = t.columnById(s);
2980
- l && Nn(t, s, i) && o.push({ entry: l, condition: i });
2986
+ const a = t.columnById(s);
2987
+ a && Nn(t, s, i) && o.push({ entry: a, condition: i });
2981
2988
  }
2982
2989
  }
2983
2990
  return o.every(({ entry: s, condition: i }) => {
2984
- const l = Te(s.spec.filter);
2985
- return !l || Ur(l, s.read(r), i);
2991
+ const a = Te(s.spec.filter);
2992
+ return !a || Ur(a, s.read(r), i);
2986
2993
  });
2987
2994
  };
2988
2995
  }
2989
- function bi(e, t) {
2996
+ function vi(e, t) {
2990
2997
  const n = q(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = W(() => ({ source: e, result: n }));
2991
2998
  if (!t) return e;
2992
- const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, l) => i === n[l]));
2999
+ const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
2993
3000
  return s || r({ source: e, result: n }), s ? o.result : n;
2994
3001
  }
2995
- function wi(e, t) {
2996
- var l, c, a, f, d, p;
3002
+ function yi(e, t) {
3003
+ var a, c, l, f, d, p;
2997
3004
  if (t.size === 0) return e;
2998
- const n = (l = e.sort) == null ? void 0 : l.filter((b) => t.has(b.column)), o = (c = e.hidden) == null ? void 0 : c.filter((b) => t.has(b)), r = (a = e.order) == null ? void 0 : a.filter((b) => t.has(b)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([b]) => t.has(b))) : void 0;
3005
+ const n = (a = e.sort) == null ? void 0 : a.filter((b) => t.has(b.column)), o = (c = e.hidden) == null ? void 0 : c.filter((b) => t.has(b)), r = (l = e.order) == null ? void 0 : l.filter((b) => t.has(b)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([b]) => t.has(b))) : void 0;
2999
3006
  return (n == null ? void 0 : n.length) === ((f = e.sort) == null ? void 0 : f.length) && (o == null ? void 0 : o.length) === ((d = e.hidden) == null ? void 0 : d.length) && (r == null ? void 0 : r.length) === ((p = e.order) == null ? void 0 : p.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
3000
3007
  ...e.search ? { search: e.search } : {},
3001
3008
  ...e.page ? { page: e.page } : {},
@@ -3006,7 +3013,7 @@ function wi(e, t) {
3006
3013
  ...s && Object.keys(s).length ? { widths: s } : {}
3007
3014
  };
3008
3015
  }
3009
- const tt = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], vi = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
3016
+ const tt = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], _i = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
3010
3017
  function jt(e) {
3011
3018
  const t = [], n = (o) => {
3012
3019
  for (const r of o)
@@ -3014,24 +3021,24 @@ function jt(e) {
3014
3021
  };
3015
3022
  return n(e ?? []), t;
3016
3023
  }
3017
- const yi = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3018
- function _i(e, t) {
3024
+ const xi = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3025
+ function ki(e, t) {
3019
3026
  const n = {};
3020
3027
  for (const o of e) o.width !== void 0 && (n[o.id] = o.width);
3021
3028
  return { ...n, ...t };
3022
3029
  }
3023
- function xi(e, t) {
3030
+ function Si(e, t) {
3024
3031
  var B;
3025
3032
  const [n] = W(() => new is()), [o] = W(() => {
3026
- const z = Js(n);
3027
- return { ...z, VerdictColumn: pi(z.Column) };
3033
+ const z = Qs(n);
3034
+ return { ...z, VerdictColumn: bi(z.Column) };
3028
3035
  });
3029
3036
  We(n.subscribe, n.structureVersion, n.structureVersion);
3030
- const r = be(), s = e, i = n.modelColumns(s, r), [l] = W(() => t.initialView), c = t.manual === !0, a = t.manual ? t.rowCount : 0, f = q(() => c ? { rowCount: a } : void 0, [c, a]);
3031
- n.setManual(c), c && ((t.preFilter ?? t.filter) && ae("manual-prefilter", "`preFilter` is passed over in manual mode: the server decides which rows the table has."), t.virtual && ae("manual-virtual", "`virtual` is passed over in manual mode: the table pages instead."), (t.defaultGrouping !== void 0 || (B = l == null ? void 0 : l.grouping) != null && B.length) && ae("manual-grouping", "A grouping is passed over in manual mode: the groups would be the page's, not the server's."));
3032
- const [d, p] = W(() => Object.entries((l == null ? void 0 : l.conditions) ?? {})), b = q(() => mi(d, n), [d, n]), S = t.preFilter ?? t.filter, w = bi(s, c ? void 0 : S), [O, y] = W(
3033
- () => l != null && l.grouping ? [...l.grouping] : tt(t.defaultGrouping)
3034
- ), [_, L] = W(() => (l == null ? void 0 : l.folded) ?? []), [g, k] = W(() => l != null && l.pinned ? { ...l.pinned } : null), T = n.orderedColumns().length + n.groupKeys.entries.size > 0, F = c ? [] : T ? n.effectiveGrouping(O, s) : O.slice(0, yt), m = F.join("|"), x = q(() => new Set(_), [_]), A = F.length ? n.groupingModel(F, s) : null, v = q(
3037
+ const r = be(), s = e, i = n.modelColumns(s, r), [a] = W(() => t.initialView), c = t.manual === !0, l = t.manual ? t.rowCount : 0, f = q(() => c ? { rowCount: l } : void 0, [c, l]);
3038
+ n.setManual(c), c && ((t.preFilter ?? t.filter) && le("manual-prefilter", "`preFilter` is passed over in manual mode: the server decides which rows the table has."), t.virtual && le("manual-virtual", "`virtual` is passed over in manual mode: the table pages instead."), (t.defaultGrouping !== void 0 || (B = a == null ? void 0 : a.grouping) != null && B.length) && le("manual-grouping", "A grouping is passed over in manual mode: the groups would be the page's, not the server's."));
3039
+ const [d, p] = W(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), b = q(() => wi(d, n), [d, n]), k = t.preFilter ?? t.filter, w = vi(s, c ? void 0 : k), [O, y] = W(
3040
+ () => a != null && a.grouping ? [...a.grouping] : tt(t.defaultGrouping)
3041
+ ), [_, L] = W(() => (a == null ? void 0 : a.folded) ?? []), [g, S] = W(() => a != null && a.pinned ? { ...a.pinned } : null), T = n.orderedColumns().length + n.groupKeys.entries.size > 0, F = c ? [] : T ? n.effectiveGrouping(O, s) : O.slice(0, yt), m = F.join("|"), x = q(() => new Set(_), [_]), A = F.length ? n.groupingModel(F, s) : null, v = q(
3035
3042
  () => A && A.levels.length ? { ...A, folded: x, compareText: r.compareText } : void 0,
3036
3043
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
3037
3044
  [A, x, r.compareText, m]
@@ -3040,17 +3047,17 @@ function xi(e, t) {
3040
3047
  pageSize: t.pageSize,
3041
3048
  defaultSort: t.defaultSort,
3042
3049
  filter: b,
3043
- initialView: l,
3050
+ initialView: a,
3044
3051
  virtual: c ? void 0 : t.virtual,
3045
3052
  grouping: v,
3046
3053
  manual: f
3047
- }), { setPage: I } = N, P = le(
3054
+ }), { setPage: I } = N, P = ae(
3048
3055
  (z, V) => {
3049
3056
  let ee = V == null;
3050
3057
  if (!ee && n.orderedColumns().length > 0) {
3051
3058
  const de = n.columnById(z), pe = de ? Te(de.spec.filter) : void 0;
3052
3059
  if (!pe) {
3053
- ae(
3060
+ le(
3054
3061
  `condition-without-filter:${z}`,
3055
3062
  de ? `The column "${z}" has no filter; its condition is passed over.` : `No column is called "${z}"; its condition is passed over.`
3056
3063
  );
@@ -3070,16 +3077,16 @@ function xi(e, t) {
3070
3077
  },
3071
3078
  [n, I]
3072
3079
  ), $ = new Set(n.orderedColumns().map((z) => z.spec.id)), [U, Z] = W(() => /* @__PURE__ */ new Set());
3073
- if (!yi(U, $)) {
3080
+ if (!xi(U, $)) {
3074
3081
  const z = new Set([...U].filter((V) => !$.has(V)));
3075
3082
  Z($), d.some(([V]) => z.has(V)) && p((V) => V.filter(([ee]) => !z.has(ee)));
3076
3083
  }
3077
- const he = $.size === 0 ? d : d.filter(([z, V]) => Nn(n, z, V)), se = wi(N.view, $), ve = he.length > 0 ? { ...se, conditions: Object.fromEntries(he) } : se, Se = $.size === 0 ? N.sort : N.sort.filter((z) => $.has(z.column)), Oe = c ? [] : T ? n.effectiveGrouping(tt(t.defaultGrouping), s) : tt(t.defaultGrouping), Ce = N.groups ? Hn(N.groups, _) : T ? [] : [..._], ue = n.declaredPins(), Y = to(g, ue, $), ge = {
3084
+ const he = $.size === 0 ? d : d.filter(([z, V]) => Nn(n, z, V)), se = yi(N.view, $), ve = he.length > 0 ? { ...se, conditions: Object.fromEntries(he) } : se, Se = $.size === 0 ? N.sort : N.sort.filter((z) => $.has(z.column)), Oe = c ? [] : T ? n.effectiveGrouping(tt(t.defaultGrouping), s) : tt(t.defaultGrouping), Ce = N.groups ? Hn(N.groups, _) : T ? [] : [..._], ue = n.declaredPins(), Y = to(g, ue, $), ge = {
3078
3085
  ...ve,
3079
- ...vi(F, Oe) ? {} : { grouping: F },
3086
+ ..._i(F, Oe) ? {} : { grouping: F },
3080
3087
  ...Ce.length ? { folded: Ce } : {},
3081
3088
  ...Y ? { pinned: Y } : {}
3082
- }, ye = (z, V) => k((ee) => Zn(ee ?? n.declaredPins(), z, V)), Ne = (z) => {
3089
+ }, ye = (z, V) => S((ee) => Zn(ee ?? n.declaredPins(), z, V)), Ne = (z) => {
3083
3090
  y([...z]), I(1);
3084
3091
  }, _e = (z) => {
3085
3092
  jt(N.groups).includes(z) && (n.noteFocusBeforeFold(), L((V) => V.includes(z) ? V.filter((ee) => ee !== z) : [...V, z]));
@@ -3126,7 +3133,7 @@ function xi(e, t) {
3126
3133
  setOrder: N.setOrder,
3127
3134
  pinned: g ?? ue,
3128
3135
  setPin: ye,
3129
- widths: _i(i, N.widths),
3136
+ widths: ki(i, N.widths),
3130
3137
  setWidth: N.setWidth,
3131
3138
  expanded: N.expanded,
3132
3139
  toggleRow: N.toggleRow,
@@ -3146,7 +3153,7 @@ function xi(e, t) {
3146
3153
  },
3147
3154
  asCsv: () => ws(n),
3148
3155
  virtual: xe,
3149
- rowCount: c ? a : N.filtered.length,
3156
+ rowCount: c ? l : N.filtered.length,
3150
3157
  manual: c
3151
3158
  };
3152
3159
  return n.setHook({
@@ -3165,7 +3172,7 @@ function xi(e, t) {
3165
3172
  selectedRows: ie
3166
3173
  }), { ...oe, ...o };
3167
3174
  }
3168
- function fl(e) {
3175
+ function ga(e) {
3169
3176
  return e;
3170
3177
  }
3171
3178
  function Nt(e, t) {
@@ -3177,13 +3184,13 @@ function Nt(e, t) {
3177
3184
  };
3178
3185
  }, [e, t, n]);
3179
3186
  }
3180
- function hl({ children: e, className: t, of: n }) {
3187
+ function pa({ children: e, className: t, of: n }) {
3181
3188
  const o = Ge(n);
3182
3189
  Nt(o == null ? void 0 : o.registry, "toolbar");
3183
3190
  const r = o == null ? void 0 : o.registry;
3184
3191
  return /* @__PURE__ */ u(hn, { registry: r ?? null, className: t, children: e });
3185
3192
  }
3186
- function gl({ placeholder: e, "aria-label": t, className: n, of: o }) {
3193
+ function ma({ placeholder: e, "aria-label": t, className: n, of: o }) {
3187
3194
  const r = Ge(o), s = re();
3188
3195
  if (Nt(r == null ? void 0 : r.registry, "search"), !r) return null;
3189
3196
  const { snapshot: i } = r;
@@ -3194,7 +3201,7 @@ function gl({ placeholder: e, "aria-label": t, className: n, of: o }) {
3194
3201
  type: "search",
3195
3202
  className: n,
3196
3203
  value: i.search,
3197
- onChange: (l) => i.setSearch(l.target.value),
3204
+ onChange: (a) => i.setSearch(a.target.value),
3198
3205
  clearable: !0,
3199
3206
  onClear: () => i.setSearch(""),
3200
3207
  placeholder: e ?? s.tableSearchPlaceholder,
@@ -3202,36 +3209,36 @@ function gl({ placeholder: e, "aria-label": t, className: n, of: o }) {
3202
3209
  }
3203
3210
  );
3204
3211
  }
3205
- function pl({ of: e }) {
3206
- const t = Ge(e), n = re(), [o, r] = W(!1), s = ce(null), i = ce(null), l = me(), [c, a] = W(null);
3212
+ function ba({ of: e }) {
3213
+ const t = Ge(e), n = re(), [o, r] = W(!1), s = ce(null), i = ce(null), a = me(), [c, l] = W(null);
3207
3214
  if (X(() => {
3208
- var k;
3215
+ var S;
3209
3216
  if (!c || !i.current) return;
3210
3217
  const _ = Array.from(i.current.children).find(
3211
3218
  (T) => T.dataset.column === c.id
3212
3219
  ), L = _ == null ? void 0 : _.querySelector(c.key), g = c.otherwise ? _ == null ? void 0 : _.querySelector(c.otherwise) : void 0;
3213
- (k = L && !L.disabled ? L : g) == null || k.focus();
3220
+ (S = L && !L.disabled ? L : g) == null || S.focus();
3214
3221
  }, [c]), !t) return null;
3215
- const { registry: f, snapshot: d } = t, p = f.hook, b = f.inPinOrder(xt(f.modelColumns(p.rows, p.formats), d.order)), S = f.pins(), w = (_, L) => {
3222
+ const { registry: f, snapshot: d } = t, p = f.hook, b = f.inPinOrder(xt(f.modelColumns(p.rows, p.formats), d.order)), k = f.pins(), w = (_, L) => {
3216
3223
  const g = b[_ + L];
3217
- return g !== void 0 && S[g.id] === S[b[_].id];
3224
+ return g !== void 0 && k[g.id] === k[b[_].id];
3218
3225
  }, O = (_, L) => {
3219
- const g = b.map((m) => m.id), k = _ + L;
3226
+ const g = b.map((m) => m.id), S = _ + L;
3220
3227
  if (!w(_, L)) return;
3221
- [g[_], g[k]] = [g[k], g[_]], d.setOrder(g);
3228
+ [g[_], g[S]] = [g[S], g[_]], d.setOrder(g);
3222
3229
  const [T, F] = L < 0 ? ["forward", "backward"] : ["backward", "forward"];
3223
- a({ id: b[_].id, key: `[data-direction="${T}"]`, otherwise: `[data-direction="${F}"]` });
3230
+ l({ id: b[_].id, key: `[data-direction="${T}"]`, otherwise: `[data-direction="${F}"]` });
3224
3231
  }, y = (_, L, g) => {
3225
- const k = S[_] === g;
3226
- return /* @__PURE__ */ u(Ie, { content: k ? n.unpinHint : g === "start" ? n.pinToStartHint : n.pinToEndHint, children: /* @__PURE__ */ u(
3232
+ const S = k[_] === g;
3233
+ return /* @__PURE__ */ u(Ie, { content: S ? n.unpinHint : g === "start" ? n.pinToStartHint : n.pinToEndHint, children: /* @__PURE__ */ u(
3227
3234
  "button",
3228
3235
  {
3229
3236
  type: "button",
3230
- className: H(h.move, k && h.pinOn),
3237
+ className: H(h.move, S && h.pinOn),
3231
3238
  "data-pin": g,
3232
- "aria-label": k ? n.unpinColumn(L) : g === "start" ? n.pinColumnToStart(L) : n.pinColumnToEnd(L),
3239
+ "aria-label": S ? n.unpinColumn(L) : g === "start" ? n.pinColumnToStart(L) : n.pinColumnToEnd(L),
3233
3240
  onClick: () => {
3234
- d.setPin(_, k ? null : g), a({ id: _, key: `[data-pin="${g}"]` });
3241
+ d.setPin(_, S ? null : g), l({ id: _, key: `[data-pin="${g}"]` });
3235
3242
  },
3236
3243
  children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ u(
3237
3244
  "path",
@@ -3255,7 +3262,7 @@ function pl({ of: e }) {
3255
3262
  size: "sm",
3256
3263
  "aria-haspopup": "dialog",
3257
3264
  "aria-expanded": o,
3258
- "aria-controls": o ? l : void 0,
3265
+ "aria-controls": o ? a : void 0,
3259
3266
  onClick: () => r(!o),
3260
3267
  children: n.columns
3261
3268
  }
@@ -3269,7 +3276,7 @@ function pl({ of: e }) {
3269
3276
  align: "start",
3270
3277
  role: "dialog",
3271
3278
  ariaLabel: n.arrangeColumns,
3272
- id: l,
3279
+ id: a,
3273
3280
  className: h.columnsPanel,
3274
3281
  children: [
3275
3282
  /* @__PURE__ */ u("ul", { ref: i, className: h.columnsList, "aria-label": n.arrangeColumns, children: b.map((_, L) => {
@@ -3318,25 +3325,25 @@ function pl({ of: e }) {
3318
3325
  )
3319
3326
  ] });
3320
3327
  }
3321
- function ml({ filename: e, onExport: t, of: n }) {
3328
+ function wa({ filename: e, onExport: t, of: n }) {
3322
3329
  const o = Ge(n), r = re();
3323
3330
  if (!o) return null;
3324
3331
  const { snapshot: s } = o;
3325
3332
  return /* @__PURE__ */ u(fe, { size: "sm", onClick: () => {
3326
- const l = s.asCsv();
3333
+ const a = s.asCsv();
3327
3334
  if (t) {
3328
- t(l);
3335
+ t(a);
3329
3336
  return;
3330
3337
  }
3331
- const c = URL.createObjectURL(new Blob([l], { type: "text/csv;charset=utf-8" })), a = document.createElement("a");
3332
- a.href = c, a.download = e ?? r.exportFileName, a.click(), setTimeout(() => URL.revokeObjectURL(c), 1e4);
3338
+ const c = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })), l = document.createElement("a");
3339
+ l.href = c, l.download = e ?? r.exportFileName, l.click(), setTimeout(() => URL.revokeObjectURL(c), 1e4);
3333
3340
  }, children: s.manual ? r.exportPageLabel : r.exportLabel });
3334
3341
  }
3335
- function bl({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
3342
+ function va({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
3336
3343
  const o = Ge(n), r = re(), s = be();
3337
3344
  if (Nt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
3338
- const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((f, d) => f - d), a = /* @__PURE__ */ R("nav", { "aria-label": r.pagination, className: H(h.pagination, t), children: [
3339
- /* @__PURE__ */ u("span", { children: r.entries(l, s.count(l)) }),
3345
+ const { snapshot: i } = o, a = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((f, d) => f - d), l = /* @__PURE__ */ R("nav", { "aria-label": r.pagination, className: H(h.pagination, t), children: [
3346
+ /* @__PURE__ */ u("span", { children: r.entries(a, s.count(a)) }),
3340
3347
  /* @__PURE__ */ R("div", { className: h.paginationControls, children: [
3341
3348
  /* @__PURE__ */ R("label", { className: h.pageSize, children: [
3342
3349
  r.rows,
@@ -3359,83 +3366,83 @@ function bl({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
3359
3366
  /* @__PURE__ */ u(fe, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
3360
3367
  ] })
3361
3368
  ] });
3362
- return o.inside ? o.footerTarget ? In(a, o.footerTarget) : null : a;
3369
+ return o.inside ? o.footerTarget ? In(l, o.footerTarget) : null : l;
3363
3370
  }
3364
- const ki = ["high", "medium", "low"], Si = (e) => ki.indexOf(e), Ci = (e) => e === "active-unacknowledged" || e === "active-acknowledged", Je = (e) => e === "active-acknowledged" || e === "resolved-acknowledged", Ni = (e) => e === "resolved-acknowledged";
3365
- function Ai(e, t) {
3371
+ const Ci = ["high", "medium", "low"], Ni = (e) => Ci.indexOf(e), Ai = (e) => e === "active-unacknowledged" || e === "active-acknowledged", Je = (e) => e === "active-acknowledged" || e === "resolved-acknowledged", Ti = (e) => e === "resolved-acknowledged";
3372
+ function Oi(e, t) {
3366
3373
  switch (t) {
3367
3374
  case "raised":
3368
3375
  return "active-unacknowledged";
3369
3376
  case "acknowledged":
3370
- return Ci(e) ? "active-acknowledged" : "resolved-acknowledged";
3377
+ return Ai(e) ? "active-acknowledged" : "resolved-acknowledged";
3371
3378
  case "resolved":
3372
3379
  return Je(e) ? "resolved-acknowledged" : "resolved-unacknowledged";
3373
3380
  }
3374
3381
  }
3375
- const Ti = [
3382
+ const Mi = [
3376
3383
  "in-service",
3377
3384
  "snoozed",
3378
3385
  "suppressed",
3379
3386
  "disabled"
3380
3387
  ], gt = (e) => e !== "in-service";
3381
- function Oi(e, t) {
3388
+ function Fi(e, t) {
3382
3389
  return e.availability === "snoozed" ? t >= e.snooze.until ? "in-service" : "snoozed" : e.availability ?? "in-service";
3383
3390
  }
3384
- function wl(e, t, n) {
3391
+ function ya(e, t, n) {
3385
3392
  return e.availability === "disabled" || e.availability === "suppressed" ? e : { ...e, availability: "snoozed", snooze: { until: t, by: n } };
3386
3393
  }
3387
- function vl(e) {
3394
+ function _a(e) {
3388
3395
  return e.availability !== "snoozed" ? e : { ...e, availability: "in-service", snooze: void 0 };
3389
3396
  }
3390
- function yl(e) {
3397
+ function xa(e) {
3391
3398
  return e.availability === "disabled" || e.availability === "suppressed" ? e : { ...e, availability: "disabled", snooze: void 0 };
3392
3399
  }
3393
- function _l(e) {
3400
+ function ka(e) {
3394
3401
  return e.availability !== "disabled" ? e : { ...e, availability: "in-service" };
3395
3402
  }
3396
- const xl = (e, t) => e.direction === "upper" ? t <= e.returnTo : t >= e.returnTo, At = (e, t, n) => e > n - t && e <= n, kl = (e, t, n) => e.reduce((o, r) => o + (At(r, t, n) ? 1 : 0), 0);
3397
- function Mi(e, t, n) {
3403
+ const Sa = (e, t) => e.direction === "upper" ? t <= e.returnTo : t >= e.returnTo, At = (e, t, n) => e > n - t && e <= n, Ca = (e, t, n) => e.reduce((o, r) => o + (At(r, t, n) ? 1 : 0), 0);
3404
+ function Li(e, t, n) {
3398
3405
  const o = /* @__PURE__ */ new Map();
3399
3406
  for (const r of e)
3400
3407
  At(r.raised, t, n) && o.set(r.type, (o.get(r.type) ?? 0) + 1);
3401
3408
  return o;
3402
3409
  }
3403
- function Fi(e) {
3410
+ function Di(e) {
3404
3411
  let t = Number.POSITIVE_INFINITY;
3405
3412
  for (const n of e) n < t && (t = n);
3406
3413
  return t;
3407
3414
  }
3408
- function Li(e) {
3415
+ function Ri(e) {
3409
3416
  let t = Number.NEGATIVE_INFINITY;
3410
3417
  for (const n of e) n > t && (t = n);
3411
3418
  return t;
3412
3419
  }
3413
- function Di(e, t, n) {
3420
+ function Pi(e, t, n) {
3414
3421
  const o = e.filter((s) => At(s.raised, t.windowMs, n));
3415
3422
  if (o.length < t.atLeast) return null;
3416
3423
  const r = o.map((s) => s.raised);
3417
3424
  return {
3418
3425
  // No spread: a flood is the case with many elements, and an argument list
3419
3426
  // of that size blows the call stack at some point. A loop cannot.
3420
- from: Fi(r),
3421
- to: Li(r),
3427
+ from: Di(r),
3428
+ to: Ri(r),
3422
3429
  count: o.length,
3423
3430
  alarms: o.map((s) => s.id)
3424
3431
  };
3425
3432
  }
3426
- function Ri(e, t) {
3433
+ function Ei(e, t) {
3427
3434
  const n = new Set(t);
3428
3435
  return e.reduce(
3429
3436
  (o, r) => o + (n.has(r.id) && !Je(r.lifecycle) ? 1 : 0),
3430
3437
  0
3431
3438
  );
3432
3439
  }
3433
- function Sl(e, t, n) {
3440
+ function Na(e, t, n) {
3434
3441
  const o = new Set(t);
3435
3442
  let r = 0;
3436
- return { alarms: e.map((i) => !o.has(i.id) || Je(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: Ai(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
3443
+ return { alarms: e.map((i) => !o.has(i.id) || Je(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: Oi(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
3437
3444
  }
3438
- const Pi = (e) => [
3445
+ const zi = (e) => [
3439
3446
  {
3440
3447
  id: "type",
3441
3448
  label: e.columnAlarm,
@@ -3446,7 +3453,7 @@ const Pi = (e) => [
3446
3453
  { id: "lifecycle", label: e.columnLifecycleState, value: (t) => t.lifecycle, searchable: !0 },
3447
3454
  /* The rank, like the priority: the column exists for the first level of the
3448
3455
  order. */
3449
- { id: "availability", label: e.columnAvailability, value: (t) => Ti.indexOf(t.availability) },
3456
+ { id: "availability", label: e.columnAvailability, value: (t) => Mi.indexOf(t.availability) },
3450
3457
  { id: "priority", label: e.columnPriority, value: (t) => t.rank },
3451
3458
  /* A column of its own instead of a glance at the lifecycle state: the second
3452
3459
  level of the order asks only about the acknowledgement and expressly not
@@ -3456,76 +3463,76 @@ const Pi = (e) => [
3456
3463
  { id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
3457
3464
  { id: "age", label: e.columnAge, value: (t) => t.age },
3458
3465
  { id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
3459
- ], Ei = Pi(En), zi = [
3466
+ ], Ii = zi(En), Vi = [
3460
3467
  { column: "availability", direction: "asc" },
3461
3468
  { column: "priority", direction: "asc" },
3462
3469
  { column: "acknowledgement", direction: "asc" },
3463
3470
  { column: "raised", direction: "desc" }
3464
- ], Ii = (e) => ({
3471
+ ], Bi = (e) => ({
3465
3472
  id: e,
3466
3473
  label: e,
3467
3474
  priority: "high"
3468
3475
  });
3469
- function Cl(e, t = {}) {
3476
+ function Aa(e, t = {}) {
3470
3477
  const {
3471
3478
  alarms: n,
3472
3479
  types: o,
3473
3480
  asOf: r,
3474
3481
  chatter: s,
3475
3482
  flood: i,
3476
- keepDone: l = !1,
3477
- columns: c = Ei
3478
- } = e, a = new Map(o.map((w) => [w.id, w])), f = Mi(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Di(n, i, r) : null, p = new Set((d == null ? void 0 : d.alarms) ?? []), b = n.filter((w) => l || !Ni(w.lifecycle)).map((w) => {
3479
- const O = a.get(w.type) ?? Ii(w.type), y = f.get(w.type) ?? 0;
3483
+ keepDone: a = !1,
3484
+ columns: c = Ii
3485
+ } = e, l = new Map(o.map((w) => [w.id, w])), f = Li(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Pi(n, i, r) : null, p = new Set((d == null ? void 0 : d.alarms) ?? []), b = n.filter((w) => a || !Ti(w.lifecycle)).map((w) => {
3486
+ const O = l.get(w.type) ?? Bi(w.type), y = f.get(w.type) ?? 0;
3480
3487
  return {
3481
3488
  id: w.id,
3482
3489
  alarm: w,
3483
3490
  type: O,
3484
3491
  lifecycle: w.lifecycle,
3485
- availability: Oi(w, r),
3492
+ availability: Fi(w, r),
3486
3493
  priority: O.priority,
3487
- rank: Si(O.priority),
3494
+ rank: Ni(O.priority),
3488
3495
  age: r - w.raised,
3489
3496
  duration: (w.resolved ?? r) - w.raised,
3490
3497
  frequency: y,
3491
3498
  chatters: s !== void 0 && y >= s.atLeast,
3492
3499
  inFlood: p.has(w.id)
3493
3500
  };
3494
- }), S = kt(b, c, {
3501
+ }), k = kt(b, c, {
3495
3502
  ...t,
3496
- sort: t.sort === void 0 ? zi : t.sort
3503
+ sort: t.sort === void 0 ? Vi : t.sort
3497
3504
  });
3498
3505
  return {
3499
- ...S,
3506
+ ...k,
3500
3507
  flood: d,
3501
- activeUnacknowledged: S.filtered.reduce(
3508
+ activeUnacknowledged: k.filtered.reduce(
3502
3509
  (w, O) => w + (O.lifecycle === "active-unacknowledged" && !gt(O.availability) ? 1 : 0),
3503
3510
  0
3504
3511
  ),
3505
- hiddenAlarms: S.filtered.reduce(
3512
+ hiddenAlarms: k.filtered.reduce(
3506
3513
  (w, O) => w + (gt(O.availability) ? 1 : 0),
3507
3514
  0
3508
3515
  )
3509
3516
  };
3510
3517
  }
3511
- const Vi = "_list_fm5vz_4 _text_k1tvc_23", Bi = "_bar_fm5vz_12", Gi = "_heading_fm5vz_19", $i = "_filler_fm5vz_25", Hi = "_asOf_fm5vz_29", Ki = "_live_fm5vz_46", ji = "_label_fm5vz_51", Wi = "_counter_fm5vz_55", qi = "_state_fm5vz_61", Ui = "_lifecycle_fm5vz_65", Yi = "_hidden_fm5vz_71", Ji = "_hiddenLabel_fm5vz_78", Xi = "_availability_fm5vz_84", Qi = "_empty_fm5vz_88", Zi = "_row_fm5vz_96", te = {
3512
- list: Vi,
3513
- bar: Bi,
3514
- heading: Gi,
3515
- filler: $i,
3516
- asOf: Hi,
3517
- live: Ki,
3518
- label: ji,
3519
- counter: Wi,
3520
- state: qi,
3521
- lifecycle: Ui,
3522
- hidden: Yi,
3523
- hiddenLabel: Ji,
3524
- availability: Xi,
3525
- empty: Qi,
3526
- row: Zi
3518
+ const Gi = "_list_fm5vz_4 _text_k1tvc_23", $i = "_bar_fm5vz_12", Hi = "_heading_fm5vz_19", Ki = "_filler_fm5vz_25", ji = "_asOf_fm5vz_29", Wi = "_live_fm5vz_46", qi = "_label_fm5vz_51", Ui = "_counter_fm5vz_55", Yi = "_state_fm5vz_61", Ji = "_lifecycle_fm5vz_65", Xi = "_hidden_fm5vz_71", Qi = "_hiddenLabel_fm5vz_78", Zi = "_availability_fm5vz_84", ea = "_empty_fm5vz_88", ta = "_row_fm5vz_96", te = {
3519
+ list: Gi,
3520
+ bar: $i,
3521
+ heading: Hi,
3522
+ filler: Ki,
3523
+ asOf: ji,
3524
+ live: Wi,
3525
+ label: qi,
3526
+ counter: Ui,
3527
+ state: Yi,
3528
+ lifecycle: Ji,
3529
+ hidden: Xi,
3530
+ hiddenLabel: Qi,
3531
+ availability: Zi,
3532
+ empty: ea,
3533
+ row: ta
3527
3534
  };
3528
- function el(e, t) {
3535
+ function na(e, t) {
3529
3536
  switch (e) {
3530
3537
  case "active-unacknowledged":
3531
3538
  return t.lifecycleActiveUnacknowledged;
@@ -3537,13 +3544,13 @@ function el(e, t) {
3537
3544
  return t.lifecycleResolvedAcknowledged;
3538
3545
  }
3539
3546
  }
3540
- function tl(e, t, n) {
3547
+ function oa(e, t, n) {
3541
3548
  switch (e.availability) {
3542
3549
  case "snoozed": {
3543
3550
  const o = e.alarm.snooze;
3544
3551
  if (!o) return null;
3545
- const r = new Date(o.until), s = new Date(e.alarm.raised + e.age), l = r.toDateString() === s.toDateString() ? n.time(r, !1) : n.dateTime(r, !1);
3546
- return { short: t.availabilitySnoozedShort, full: t.availabilitySnoozed(l, o.by) };
3552
+ const r = new Date(o.until), s = new Date(e.alarm.raised + e.age), a = r.toDateString() === s.toDateString() ? n.time(r, !1) : n.dateTime(r, !1);
3553
+ return { short: t.availabilitySnoozedShort, full: t.availabilitySnoozed(a, o.by) };
3547
3554
  }
3548
3555
  case "suppressed":
3549
3556
  return { short: t.availabilitySuppressed, full: t.availabilitySuppressed };
@@ -3553,21 +3560,21 @@ function tl(e, t, n) {
3553
3560
  return null;
3554
3561
  }
3555
3562
  }
3556
- function nl(e, t) {
3563
+ function ra(e, t) {
3557
3564
  return e === "high" ? t.priorityHigh : e === "medium" ? t.priorityMedium : t.priorityLow;
3558
3565
  }
3559
- function ol(e) {
3566
+ function sa(e) {
3560
3567
  return e === "high" ? "danger" : e === "medium" ? "warning" : "neutral";
3561
3568
  }
3562
- function rl(e, t) {
3569
+ function ia(e, t) {
3563
3570
  const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60, s = [];
3564
3571
  return o > 0 && s.push(t.hoursShort(o)), (o === 0 || r > 0) && s.push(t.minutesShort(r)), s.join(" ");
3565
3572
  }
3566
- function Nl(e) {
3573
+ function Ta(e) {
3567
3574
  const { asOf: t, freshness: n, ...o } = e;
3568
- return t === void 0 || n === void 0 ? /* @__PURE__ */ u(An, { ...o, freshness: null }) : /* @__PURE__ */ u(sl, { ...o, asOf: t, ages: n });
3575
+ return t === void 0 || n === void 0 ? /* @__PURE__ */ u(An, { ...o, freshness: null }) : /* @__PURE__ */ u(aa, { ...o, asOf: t, ages: n });
3569
3576
  }
3570
- function sl({
3577
+ function aa({
3571
3578
  asOf: e,
3572
3579
  ages: t,
3573
3580
  ...n
@@ -3583,35 +3590,35 @@ function An({
3583
3590
  className: r,
3584
3591
  freshness: s,
3585
3592
  hiddenOnly: i = !1,
3586
- onHiddenOnlyChange: l,
3593
+ onHiddenOnlyChange: a,
3587
3594
  ...c
3588
3595
  }) {
3589
- const a = re(), f = be(), d = s !== null, p = (s == null ? void 0 : s.freshness) === "lost", { Table: b, Column: S } = xi(e.visible, { rowKey: (g) => g.id, selection: t }), w = q(() => e.filtered.map((g) => g.alarm), [e.filtered]), O = q(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), y = q(() => Ri(w, O), [w, O]), _ = Zt(o, "compact"), L = a.hiddenAlarms(e.hiddenAlarms);
3596
+ const l = re(), f = be(), d = s !== null, p = (s == null ? void 0 : s.freshness) === "lost", { Table: b, Column: k } = Si(e.visible, { rowKey: (g) => g.id, selection: t }), w = q(() => e.filtered.map((g) => g.alarm), [e.filtered]), O = q(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), y = q(() => Ei(w, O), [w, O]), _ = Zt(o, "compact"), L = l.hiddenAlarms(e.hiddenAlarms);
3590
3597
  return /* @__PURE__ */ R("div", { className: [te.list, r].filter(Boolean).join(" "), ...c, children: [
3591
3598
  /* @__PURE__ */ R("div", { className: te.bar, children: [
3592
- /* @__PURE__ */ u("span", { className: te.heading, children: a.alarms }),
3593
- e.flood !== null && /* @__PURE__ */ u(Pe, { tone: "warning", children: a.floodHint(e.flood.count) }),
3599
+ /* @__PURE__ */ u("span", { className: te.heading, children: l.alarms }),
3600
+ e.flood !== null && /* @__PURE__ */ u(Pe, { tone: "warning", children: l.floodHint(e.flood.count) }),
3594
3601
  d && s !== null && /* @__PURE__ */ R("span", { className: te.asOf, "data-freshness": s.freshness, children: [
3595
- s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
3602
+ s.freshness === "lost" ? l.freshnessDisconnected : s.freshness === "stale" ? l.freshnessStale : l.freshnessFresh,
3596
3603
  s.age !== null && ` · ${f.relative(s.age)}`
3597
3604
  ] }),
3598
- l !== void 0 && (e.hiddenAlarms > 0 || i) ? /* @__PURE__ */ u(
3605
+ a !== void 0 && (e.hiddenAlarms > 0 || i) ? /* @__PURE__ */ u(
3599
3606
  Le,
3600
3607
  {
3601
3608
  className: te.hidden,
3602
3609
  checked: i,
3603
- onChange: (g) => l(g.currentTarget.checked),
3610
+ onChange: (g) => a(g.currentTarget.checked),
3604
3611
  label: /* @__PURE__ */ u("span", { className: te.hiddenLabel, children: L })
3605
3612
  }
3606
3613
  ) : e.hiddenAlarms > 0 && /* @__PURE__ */ u("span", { className: te.hidden, children: L }),
3607
3614
  /* @__PURE__ */ u("span", { className: te.filler }),
3608
- t !== void 0 && n !== void 0 && /* @__PURE__ */ u(fe, { variant: "primary", size: "sm", disabled: y === 0, onClick: () => n(O), children: y === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(y) })
3615
+ t !== void 0 && n !== void 0 && /* @__PURE__ */ u(fe, { variant: "primary", size: "sm", disabled: y === 0, onClick: () => n(O), children: y === 0 ? l.acknowledgeAlarm : l.acknowledgeAlarms(y) })
3609
3616
  ] }),
3610
- /* @__PURE__ */ u("div", { "aria-live": "polite", "aria-atomic": "true", className: te.live, children: a.activeUnacknowledged(e.activeUnacknowledged) }),
3617
+ /* @__PURE__ */ u("div", { "aria-live": "polite", "aria-atomic": "true", className: te.live, children: l.activeUnacknowledged(e.activeUnacknowledged) }),
3611
3618
  /* @__PURE__ */ R(
3612
3619
  b,
3613
3620
  {
3614
- ariaLabel: a.alarms,
3621
+ ariaLabel: l.alarms,
3615
3622
  selectable: t !== void 0,
3616
3623
  density: _,
3617
3624
  stickyHeader: !0,
@@ -3621,72 +3628,72 @@ function An({
3621
3628
  "data-priority": g.priority,
3622
3629
  "data-availability": g.availability
3623
3630
  }),
3624
- empty: /* @__PURE__ */ u("span", { className: te.empty, children: p ? a.noAlarmsDisconnected : a.noAlarms }),
3631
+ empty: /* @__PURE__ */ u("span", { className: te.empty, children: p ? l.noAlarmsDisconnected : l.noAlarms }),
3625
3632
  children: [
3626
- /* @__PURE__ */ u(S, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, k) => /* @__PURE__ */ R(ne, { children: [
3633
+ /* @__PURE__ */ u(k, { id: "type", label: l.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, S) => /* @__PURE__ */ R(ne, { children: [
3627
3634
  /* @__PURE__ */ u("span", { className: te.label, children: g }),
3628
- k.chatters && /* @__PURE__ */ u(Pe, { tone: "warning", pill: !0, className: te.counter, children: a.chatterHint(k.frequency) })
3635
+ S.chatters && /* @__PURE__ */ u(Pe, { tone: "warning", pill: !0, className: te.counter, children: l.chatterHint(S.frequency) })
3629
3636
  ] }) }),
3630
- /* @__PURE__ */ u(S, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g, k) => {
3631
- const T = tl(k, a, f), F = T === null ? null : T.short === T.full ? /* @__PURE__ */ u(Pe, { className: te.availability, children: T.short }) : /* @__PURE__ */ u(Ie, { content: T.full, children: /* @__PURE__ */ R(Pe, { className: te.availability, children: [
3637
+ /* @__PURE__ */ u(k, { value: "lifecycle", label: l.columnLifecycleState, sortable: !1, children: (g, S) => {
3638
+ const T = oa(S, l, f), F = T === null ? null : T.short === T.full ? /* @__PURE__ */ u(Pe, { className: te.availability, children: T.short }) : /* @__PURE__ */ u(Ie, { content: T.full, children: /* @__PURE__ */ R(Pe, { className: te.availability, children: [
3632
3639
  /* @__PURE__ */ u("span", { "aria-hidden": "true", children: T.short }),
3633
3640
  /* @__PURE__ */ u(De, { children: T.full })
3634
3641
  ] }) });
3635
3642
  return /* @__PURE__ */ R("span", { className: te.state, children: [
3636
3643
  F,
3637
- /* @__PURE__ */ u("span", { className: te.lifecycle, children: el(g, a) })
3644
+ /* @__PURE__ */ u("span", { className: te.lifecycle, children: na(g, l) })
3638
3645
  ] });
3639
3646
  } }),
3640
- /* @__PURE__ */ u(S, { value: "priority", label: a.columnPriority, sortable: !1, children: (g, k) => /* @__PURE__ */ u(Pe, { tone: gt(k.availability) ? "neutral" : ol(g), children: nl(g, a) }) }),
3647
+ /* @__PURE__ */ u(k, { value: "priority", label: l.columnPriority, sortable: !1, children: (g, S) => /* @__PURE__ */ u(Pe, { tone: gt(S.availability) ? "neutral" : sa(g), children: ra(g, l) }) }),
3641
3648
  /* @__PURE__ */ u(
3642
- S,
3649
+ k,
3643
3650
  {
3644
3651
  id: "raised",
3645
- label: a.columnRaised,
3652
+ label: l.columnRaised,
3646
3653
  value: (g) => new Date(g.alarm.raised),
3647
3654
  numeric: !0,
3648
3655
  sortable: !1
3649
3656
  }
3650
3657
  ),
3651
- /* @__PURE__ */ u(S, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => rl(g, a) }),
3652
- /* @__PURE__ */ u(S, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
3658
+ /* @__PURE__ */ u(k, { value: "duration", label: l.columnDuration, sortable: !1, children: (g) => ia(g, l) }),
3659
+ /* @__PURE__ */ u(k, { value: "frequency", label: l.columnFrequency, format: "count", sortable: !1 })
3653
3660
  ]
3654
3661
  }
3655
3662
  )
3656
3663
  ] });
3657
3664
  }
3658
3665
  export {
3659
- Ei as ALARM_COLUMNS,
3660
- Ti as AVAILABILITIES,
3661
- Nl as AlarmList,
3662
- pl as ColumnMenu,
3663
- zi as DEFAULT_ORDER,
3664
- ml as Export,
3665
- ki as PRIORITIES,
3666
- bl as Pagination,
3667
- gl as Search,
3668
- hl as Toolbar,
3669
- Sl as acknowledge,
3670
- Pi as alarmColumns,
3671
- Cl as alarmModel,
3672
- Oi as availabilityAt,
3673
- fl as column,
3674
- dl as columnFilter,
3675
- Ri as countAcknowledgeable,
3676
- kl as countInWindow,
3677
- Di as detectFlood,
3678
- yl as disable,
3679
- _l as enable,
3680
- Mi as frequencyByType,
3681
- xl as hasReturned,
3666
+ Ii as ALARM_COLUMNS,
3667
+ Mi as AVAILABILITIES,
3668
+ Ta as AlarmList,
3669
+ ba as ColumnMenu,
3670
+ Vi as DEFAULT_ORDER,
3671
+ wa as Export,
3672
+ Ci as PRIORITIES,
3673
+ va as Pagination,
3674
+ ma as Search,
3675
+ pa as Toolbar,
3676
+ Na as acknowledge,
3677
+ zi as alarmColumns,
3678
+ Aa as alarmModel,
3679
+ Fi as availabilityAt,
3680
+ ga as column,
3681
+ ha as columnFilter,
3682
+ Ei as countAcknowledgeable,
3683
+ Ca as countInWindow,
3684
+ Pi as detectFlood,
3685
+ xa as disable,
3686
+ ka as enable,
3687
+ Li as frequencyByType,
3688
+ Sa as hasReturned,
3682
3689
  Je as isAcknowledged,
3683
- Ci as isActive,
3684
- Ni as isDone,
3690
+ Ai as isActive,
3691
+ Ti as isDone,
3685
3692
  gt as isHidden,
3686
- Ai as nextLifecycleState,
3687
- Si as priorityRank,
3688
- wl as snooze,
3689
- vl as unsnooze,
3690
- xi as useTable,
3693
+ Oi as nextLifecycleState,
3694
+ Ni as priorityRank,
3695
+ ya as snooze,
3696
+ _a as unsnooze,
3697
+ Si as useTable,
3691
3698
  Vn as useTableSelection
3692
3699
  };