@umriss-ui/table 0.3.0 → 0.3.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
@@ -1,27 +1,27 @@
1
1
  import "./table.css";
2
- var Xt = Object.defineProperty;
3
- var Jt = (e, t, n) => t in e ? Xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var P = (e, t, n) => Jt(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { useState as z, useCallback as X, useMemo as j, useRef as Z, useId as se, useContext as Ue, useSyncExternalStore as Le, createContext as yt, useLayoutEffect as K } from "react";
6
- import { DEFAULT_FORMATS as Ct, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Se, DateRangePicker as Zt, FormField as rt, NumberInput as st, Popover as St, Button as ee, TagGroup as Nt, Tag as xt, Menu as At, MenuItem as Fe, MenuSeparator as en, VisuallyHidden as Re, useDensityFor as Tt, assess as tn, verdictWeight as Be, Select as nn, Input as on, DEFAULT_WORDING as rn, Badge as Ie, useFreshness as sn } from "@umriss-ui/core";
7
- import { jsx as l, jsxs as L, Fragment as J } from "react/jsx-runtime";
8
- import { createPortal as an } from "react-dom";
9
- function ln(e) {
10
- const [t, n] = z(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
2
+ var Jt = Object.defineProperty;
3
+ var Xt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var P = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
5
+ import { useState as j, useCallback as X, useMemo as $, useRef as re, useId as se, useContext as Ue, useSyncExternalStore as Re, createContext as kt, useLayoutEffect as W } from "react";
6
+ import { DEFAULT_FORMATS as St, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Ce, DateRangePicker as Zt, FormField as rt, NumberInput as st, Popover as Ct, Button as ee, TagGroup as Nt, Tag as xt, Menu as At, MenuItem as Fe, MenuSeparator as en, VisuallyHidden as Le, useDensityFor as Tt, AngleGlyph as tn, assess as nn, verdictWeight as Ee, Select as on, Input as rn, DEFAULT_WORDING as sn, Badge as Ie, useFreshness as an } from "@umriss-ui/core";
7
+ import { jsx as l, jsxs as O, Fragment as Q } from "react/jsx-runtime";
8
+ import { createPortal as ln } from "react-dom";
9
+ function cn(e) {
10
+ const [t, n] = j(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
11
11
  n((h) => {
12
- const f = new Set(h);
13
- return f.has(u) ? f.delete(u) : f.add(u), f;
12
+ const d = new Set(h);
13
+ return d.has(u) ? d.delete(u) : d.add(u), d;
14
14
  });
15
- }, []), s = j(
15
+ }, []), s = $(
16
16
  () => e.length > 0 && e.every((u) => t.has(u)),
17
17
  [e, t]
18
- ), i = j(
18
+ ), i = $(
19
19
  () => !s && e.some((u) => t.has(u)),
20
20
  [e, t, s]
21
21
  ), a = X(() => {
22
22
  n((u) => {
23
23
  const h = new Set(u);
24
- return e.length > 0 && e.every((b) => h.has(b)) ? e.forEach((b) => h.delete(b)) : e.forEach((b) => h.add(b)), h;
24
+ return e.length > 0 && e.every((m) => h.has(m)) ? e.forEach((m) => h.delete(m)) : e.forEach((m) => h.add(m)), h;
25
25
  });
26
26
  }, [e]), c = X(() => n(/* @__PURE__ */ new Set()), []);
27
27
  return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
@@ -38,7 +38,7 @@ function Ft(e, t) {
38
38
  return "empty";
39
39
  }
40
40
  const Ot = (e, t) => t ?? e === "number";
41
- function _e(e, t, n, o) {
41
+ function ye(e, t, n, o) {
42
42
  switch (Me(e)) {
43
43
  case "text":
44
44
  return e;
@@ -73,10 +73,10 @@ function ze(e, t) {
73
73
  }
74
74
  }
75
75
  }
76
- const cn = "ja", un = "nein";
77
- function Lt(e, t) {
76
+ const un = "ja", dn = "nein";
77
+ function Rt(e, t) {
78
78
  if (!Y(e)) {
79
- if (t) return Lt(t(e));
79
+ if (t) return Rt(t(e));
80
80
  switch (Me(e)) {
81
81
  case "text":
82
82
  return e;
@@ -85,14 +85,14 @@ function Lt(e, t) {
85
85
  case "date":
86
86
  return e.toISOString();
87
87
  case "boolean":
88
- return e ? cn : un;
88
+ return e ? un : dn;
89
89
  default:
90
90
  return;
91
91
  }
92
92
  }
93
93
  }
94
- const Xe = "absent", ge = (e) => Y(e) ? Xe : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, it = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
95
- function Je(e, t) {
94
+ const Je = "absent", ge = (e) => Y(e) ? Je : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, it = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
95
+ function Xe(e, t) {
96
96
  const n = t.map(e.read).filter((c) => !Y(c) && !(c instanceof Date && Number.isNaN(c.getTime()))), o = e.aggregate;
97
97
  if (typeof o == "function") return o(n, t);
98
98
  if (o === "count") return n.length;
@@ -113,87 +113,87 @@ function Je(e, t) {
113
113
  return [a(Math.min(...s)), a(Math.max(...s))];
114
114
  }
115
115
  }
116
- const Qe = 3, Ce = (e) => {
116
+ const Qe = 3, Se = (e) => {
117
117
  if (!Y(e))
118
118
  return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
119
119
  };
120
120
  function Pe(e, t, n) {
121
- const o = Ce(e), r = Ce(t);
121
+ const o = Se(e), r = Se(t);
122
122
  return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
123
123
  }
124
- function dn(e, t) {
125
- const n = t.compareText ?? Ct.compareText, o = (r, s, i) => {
126
- var w;
124
+ function fn(e, t) {
125
+ const n = t.compareText ?? St.compareText, o = (r, s, i) => {
126
+ var b;
127
127
  const a = /* @__PURE__ */ new Map(), c = t.levels[s];
128
128
  if (!c) return [];
129
129
  const u = /* @__PURE__ */ new Map();
130
130
  for (const g of r) {
131
- const v = c.value(g), N = ge(v);
132
- let C = u.get(N);
131
+ const y = c.value(g), S = ge(y);
132
+ let C = u.get(S);
133
133
  C || (C = {
134
- path: JSON.stringify([...i, N]),
135
- value: Y(v) ? void 0 : v,
134
+ path: JSON.stringify([...i, S]),
135
+ value: Y(y) ? void 0 : y,
136
136
  level: s,
137
137
  rows: [],
138
138
  groups: [],
139
139
  aggregates: {}
140
- }, u.set(N, C), a.set(C, [...i, N])), C.rows.push(g);
140
+ }, u.set(S, C), a.set(C, [...i, S])), C.rows.push(g);
141
141
  }
142
142
  for (const g of u.values())
143
- for (const v of t.aggregates ?? []) g.aggregates[v.id] = Je(v, g.rows);
144
- const h = (w = t.sort) == null ? void 0 : w.find(
143
+ for (const y of t.aggregates ?? []) g.aggregates[y.id] = Xe(y, g.rows);
144
+ const h = (b = t.sort) == null ? void 0 : b.find(
145
145
  (g) => {
146
- var v;
147
- return g.column === c.id || ((v = t.aggregates) == null ? void 0 : v.some((N) => N.id === g.column));
146
+ var y;
147
+ return g.column === c.id || ((y = t.aggregates) == null ? void 0 : y.some((S) => S.id === g.column));
148
148
  }
149
- ), f = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, b = h !== void 0 && h.column !== c.id ? h.column : void 0, p = (g) => {
150
- let v;
151
- for (const N of g.rows) {
152
- const C = c.order(N);
153
- Ce(C) !== void 0 && (v === void 0 || Pe(C, v, n) < 0) && (v = C);
149
+ ), d = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, m = h !== void 0 && h.column !== c.id ? h.column : void 0, w = (g) => {
150
+ let y;
151
+ for (const S of g.rows) {
152
+ const C = c.order(S);
153
+ Se(C) !== void 0 && (y === void 0 || Pe(C, y, n) < 0) && (y = C);
154
154
  }
155
- return v;
156
- }, k = (g) => {
157
- if (b === void 0) return c.order ? p(g) : g.value;
158
- const v = g.aggregates[b];
159
- return Array.isArray(v) ? v[0] : v;
160
- }, m = [...u.values()].sort((g, v) => {
161
- if (g.value === void 0 || v.value === void 0) return Pe(g.value, v.value, n);
162
- const N = k(g), C = k(v), D = Pe(N, C, n);
163
- return Ce(N) === void 0 || Ce(C) === void 0 ? D : D * f;
155
+ return y;
156
+ }, v = (g) => {
157
+ if (m === void 0) return c.order ? w(g) : g.value;
158
+ const y = g.aggregates[m];
159
+ return Array.isArray(y) ? y[0] : y;
160
+ }, p = [...u.values()].sort((g, y) => {
161
+ if (g.value === void 0 || y.value === void 0) return Pe(g.value, y.value, n);
162
+ const S = v(g), C = v(y), I = Pe(S, C, n);
163
+ return Se(S) === void 0 || Se(C) === void 0 ? I : I * d;
164
164
  });
165
- for (const g of m)
165
+ for (const g of p)
166
166
  g.groups = o(g.rows, s + 1, a.get(g));
167
- return m;
167
+ return p;
168
168
  };
169
169
  return o(e, 0, []);
170
170
  }
171
- function fn(e, t) {
171
+ function hn(e, t) {
172
172
  const n = /* @__PURE__ */ new Set(), o = (r) => {
173
173
  for (const s of r)
174
174
  n.add(s.path), o(s.groups);
175
175
  };
176
176
  return o(e), t.filter((r) => n.has(r));
177
177
  }
178
- const hn = (e) => (t) => {
178
+ const gn = (e) => (t) => {
179
179
  if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
180
180
  const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
181
181
  return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
182
182
  };
183
- function gn(e) {
183
+ function pn(e) {
184
184
  const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
185
185
  return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
186
186
  }
187
- function pn(e, t, n, o) {
187
+ function mn(e, t, n, o) {
188
188
  if (e === "year") return String(t.getFullYear());
189
189
  if (e === "month") return n.month(t);
190
190
  if (e === "week") {
191
- const { week: r, year: s } = gn(t);
191
+ const { week: r, year: s } = pn(t);
192
192
  return o.calendarWeek(r, s);
193
193
  }
194
194
  return n.date(t);
195
195
  }
196
- function mn(e, t) {
196
+ function wn(e, t) {
197
197
  const n = [], o = (r, s) => {
198
198
  for (const i of r) {
199
199
  const a = t.has(i.path);
@@ -205,12 +205,12 @@ function mn(e, t) {
205
205
  };
206
206
  return o(e, []), n;
207
207
  }
208
- function wn(e, t, n) {
208
+ function bn(e, t, n) {
209
209
  const o = n > 0 ? n : e.length || 1, r = Math.max(1, Math.ceil(e.length / o)), s = Math.min(Math.max(1, t), r), i = e.slice((s - 1) * o, s * o);
210
- return { lines: Rt(i), page: s, pageCount: r };
210
+ return { lines: Lt(i), page: s, pageCount: r };
211
211
  }
212
212
  const Ze = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
- function Rt(e) {
213
+ function Lt(e) {
214
214
  const t = e[0];
215
215
  if (!t) return [...e];
216
216
  const n = t.parents.map((r, s) => ({
@@ -227,9 +227,9 @@ function et(e, t) {
227
227
  ...e.filter((n) => !t.includes(n.id))
228
228
  ] : e;
229
229
  }
230
- const ke = (e) => e == null || typeof e == "number" && Number.isNaN(e), bn = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Ct.compareText(String(e), String(t));
230
+ const ve = (e) => e == null || typeof e == "number" && Number.isNaN(e), vn = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : St.compareText(String(e), String(t));
231
231
  function tt(e, t, n) {
232
- var T;
232
+ var x;
233
233
  const {
234
234
  search: o = "",
235
235
  filter: r,
@@ -238,300 +238,300 @@ function tt(e, t, n) {
238
238
  pageSize: a,
239
239
  hidden: c,
240
240
  order: u
241
- } = n, h = et(t, u), f = c != null && c.length ? h.filter((x) => x.hideable === !1 || !c.includes(x.id)) : h, b = o.trim().toLowerCase(), p = t.filter((x) => x.searchable && x.value), k = (x) => !b || p.some((_) => {
242
- const S = _.value(x);
243
- return !ke(S) && String(S).toLowerCase().includes(b);
244
- }), m = e.filter((x) => k(x) && (r ? r(x) : !0)), w = Array.isArray(s) ? s : s ? [s] : [], g = w.map((x) => {
245
- const _ = t.find((I) => I.id === x.column);
241
+ } = n, h = et(t, u), d = c != null && c.length ? h.filter((A) => A.hideable === !1 || !c.includes(A.id)) : h, m = o.trim().toLowerCase(), w = t.filter((A) => A.searchable && A.value), v = (A) => !m || w.some((_) => {
242
+ const F = _.value(A);
243
+ return !ve(F) && String(F).toLowerCase().includes(m);
244
+ }), p = e.filter((A) => v(A) && (r ? r(A) : !0)), b = Array.isArray(s) ? s : s ? [s] : [], g = b.map((A) => {
245
+ const _ = t.find((V) => V.id === A.column);
246
246
  if (!_ || !_.compare && !_.value) return null;
247
- const S = x.direction === "asc" ? 1 : -1, O = _.compare, A = _.value;
248
- return A ? (I, $) => {
249
- const G = A(I), W = A($);
250
- return ke(G) || ke(W) ? ke(G) === ke(W) ? 0 : ke(G) ? 1 : -1 : (O ? O(I, $) : bn(G, W)) * S;
251
- } : (I, $) => O(I, $) * S;
252
- }).filter((x) => x !== null);
253
- if (g.length > 0 && m.sort((x, _) => {
254
- for (const S of g) {
255
- const O = S(x, _);
256
- if (O !== 0) return O;
247
+ const F = A.direction === "asc" ? 1 : -1, R = _.compare, N = _.value;
248
+ return N ? (V, z) => {
249
+ const B = N(V), q = N(z);
250
+ return ve(B) || ve(q) ? ve(B) === ve(q) ? 0 : ve(B) ? 1 : -1 : (R ? R(V, z) : vn(B, q)) * F;
251
+ } : (V, z) => R(V, z) * F;
252
+ }).filter((A) => A !== null);
253
+ if (g.length > 0 && p.sort((A, _) => {
254
+ for (const F of g) {
255
+ const R = F(A, _);
256
+ if (R !== 0) return R;
257
257
  }
258
258
  return 0;
259
- }), (T = n.grouping) != null && T.levels.length) {
260
- const { folded: x, ..._ } = n.grouping, S = dn(m, { ..._, sort: w }), O = mn(S, x), A = wn(O, i, a ?? 0);
259
+ }), (x = n.grouping) != null && x.levels.length) {
260
+ const { folded: A, ..._ } = n.grouping, F = fn(p, { ..._, sort: b }), R = wn(F, A), N = bn(R, i, a ?? 0);
261
261
  return {
262
- columns: f,
263
- filtered: m,
264
- visible: Ze(A.lines),
265
- groups: S,
266
- lines: O,
267
- visibleLines: A.lines,
268
- page: A.page,
269
- pageCount: A.pageCount,
270
- columnCount: f.length
262
+ columns: d,
263
+ filtered: p,
264
+ visible: Ze(N.lines),
265
+ groups: F,
266
+ lines: R,
267
+ visibleLines: N.lines,
268
+ page: N.page,
269
+ pageCount: N.pageCount,
270
+ columnCount: d.length
271
271
  };
272
272
  }
273
- const v = a && a > 0 ? a : m.length || 1, N = Math.max(1, Math.ceil(m.length / v)), C = Math.min(Math.max(1, i), N), D = m.slice((C - 1) * v, C * v);
273
+ const y = a && a > 0 ? a : p.length || 1, S = Math.max(1, Math.ceil(p.length / y)), C = Math.min(Math.max(1, i), S), I = p.slice((C - 1) * y, C * y);
274
274
  return {
275
- columns: f,
276
- filtered: m,
277
- visible: D,
275
+ columns: d,
276
+ filtered: p,
277
+ visible: I,
278
278
  page: C,
279
- pageCount: N,
280
- columnCount: f.length
279
+ pageCount: S,
280
+ columnCount: d.length
281
281
  };
282
282
  }
283
- function kn(e, t, n) {
284
- const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] = z((i == null ? void 0 : i.search) ?? ""), [f, b] = z(() => {
285
- var F;
286
- return (F = i == null ? void 0 : i.sort) != null && F.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
287
- }), [p, k] = z((i == null ? void 0 : i.page) ?? 1), [m, w] = z(
283
+ function _n(e, t, n) {
284
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] = j((i == null ? void 0 : i.search) ?? ""), [d, m] = j(() => {
285
+ var T;
286
+ return (T = i == null ? void 0 : i.sort) != null && T.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
287
+ }), [w, v] = j((i == null ? void 0 : i.page) ?? 1), [p, b] = j(
288
288
  (i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
289
- ), [g, v] = z([]), [N, C] = z((i == null ? void 0 : i.hidden) ?? []), [D, T] = z((i == null ? void 0 : i.order) ?? []), [x, _] = z(() => {
289
+ ), [g, y] = j([]), [S, C] = j((i == null ? void 0 : i.hidden) ?? []), [I, x] = j((i == null ? void 0 : i.order) ?? []), [A, _] = j(() => {
290
290
  if (i != null && i.widths) return { ...i.widths };
291
- const F = {};
292
- for (const V of t)
293
- V.width !== void 0 && (F[V.id] = V.width);
294
- return F;
295
- }), S = a ? 0 : m, O = j(
291
+ const T = {};
292
+ for (const D of t)
293
+ D.width !== void 0 && (T[D.id] = D.width);
294
+ return T;
295
+ }), F = a ? 0 : p, R = $(
296
296
  () => tt(e, t, {
297
297
  search: u,
298
298
  filter: r,
299
- sort: f,
300
- page: p,
301
- pageSize: S,
302
- hidden: N,
303
- order: D,
299
+ sort: d,
300
+ page: w,
301
+ pageSize: F,
302
+ hidden: S,
303
+ order: I,
304
304
  grouping: c
305
305
  }),
306
- [e, t, u, r, f, p, S, N, D, c]
307
- ), A = Qt(a ? (O.lines ?? O.filtered).length : 0, {
306
+ [e, t, u, r, d, w, F, S, I, c]
307
+ ), N = Qt(a ? (R.lines ?? R.filtered).length : 0, {
308
308
  rowHeight: (a == null ? void 0 : a.rowHeight) ?? 0,
309
309
  overscan: a == null ? void 0 : a.overscan
310
- }), I = j(
311
- () => a && O.lines ? O.lines.slice(A.from, A.to) : O.visibleLines,
312
- [a, O.lines, O.visibleLines, A.from, A.to]
313
- ), $ = j(
314
- () => a ? I ? Ze(I) : O.filtered.slice(A.from, A.to) : O.visible,
315
- [a, I, O.filtered, O.visible, A.from, A.to]
316
- ), G = j(() => O.filtered.map(o), [O.filtered, o]), W = ln(G), ie = X((F) => {
317
- h(F), k(1);
318
- }, []), ae = X((F) => {
319
- w(F), k(1);
320
- }, []), de = X((F, V = !1) => {
321
- b((B) => {
322
- const oe = B.find((he) => he.column === F);
323
- if (!V) {
324
- const he = B.length === 1 && (oe == null ? void 0 : oe.direction) === "asc" ? "desc" : "asc";
325
- return [{ column: F, direction: he }];
310
+ }), V = $(
311
+ () => a && R.lines ? R.lines.slice(N.from, N.to) : R.visibleLines,
312
+ [a, R.lines, R.visibleLines, N.from, N.to]
313
+ ), z = $(
314
+ () => a ? V ? Ze(V) : R.filtered.slice(N.from, N.to) : R.visible,
315
+ [a, V, R.filtered, R.visible, N.from, N.to]
316
+ ), B = $(() => R.filtered.map(o), [R.filtered, o]), q = cn(B), ie = X((T) => {
317
+ h(T), v(1);
318
+ }, []), ae = X((T) => {
319
+ b(T), v(1);
320
+ }, []), de = X((T, D = !1) => {
321
+ m((E) => {
322
+ const ne = E.find((he) => he.column === T);
323
+ if (!D) {
324
+ const he = E.length === 1 && (ne == null ? void 0 : ne.direction) === "asc" ? "desc" : "asc";
325
+ return [{ column: T, direction: he }];
326
326
  }
327
- return oe ? oe.direction === "asc" ? B.map(
328
- (he) => he.column === F ? { column: F, direction: "desc" } : he
329
- ) : B.filter((he) => he.column !== F) : [...B, { column: F, direction: "asc" }];
330
- }), k(1);
331
- }, []), fe = X((F) => {
332
- v(
333
- (V) => V.includes(F) ? V.filter((B) => B !== F) : [...V, F]
327
+ return ne ? ne.direction === "asc" ? E.map(
328
+ (he) => he.column === T ? { column: T, direction: "desc" } : he
329
+ ) : E.filter((he) => he.column !== T) : [...E, { column: T, direction: "asc" }];
330
+ }), v(1);
331
+ }, []), fe = X((T) => {
332
+ y(
333
+ (D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
334
334
  );
335
335
  }, []), we = X(
336
- (F) => g.includes(F),
336
+ (T) => g.includes(T),
337
337
  [g]
338
- ), be = X((F) => {
338
+ ), be = X((T) => {
339
339
  C(
340
- (V) => V.includes(F) ? V.filter((B) => B !== F) : [...V, F]
340
+ (D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
341
341
  );
342
- }, []), ye = X((F, V) => {
343
- _((B) => {
344
- if (V === void 0) {
345
- if (!(F in B)) return B;
346
- const oe = { ...B };
347
- return delete oe[F], oe;
342
+ }, []), ke = X((T, D) => {
343
+ _((E) => {
344
+ if (D === void 0) {
345
+ if (!(T in E)) return E;
346
+ const ne = { ...E };
347
+ return delete ne[T], ne;
348
348
  }
349
- return { ...B, [F]: V };
349
+ return { ...E, [T]: D };
350
350
  });
351
351
  }, []), le = X(
352
- (F) => {
353
- var V;
354
- return (V = f.find((B) => B.column === F)) == null ? void 0 : V.direction;
352
+ (T) => {
353
+ var D;
354
+ return (D = d.find((E) => E.column === T)) == null ? void 0 : D.direction;
355
355
  },
356
- [f]
356
+ [d]
357
357
  ), te = X(
358
- (F) => {
359
- if (f.length < 2) return;
360
- const V = f.findIndex((B) => B.column === F);
361
- return V === -1 ? void 0 : V + 1;
358
+ (T) => {
359
+ if (d.length < 2) return;
360
+ const D = d.findIndex((E) => E.column === T);
361
+ return D === -1 ? void 0 : D + 1;
362
362
  },
363
- [f]
364
- ), y = j(
365
- () => et(t, D).filter((F) => F.label !== void 0 && F.hideable !== !1).map((F) => ({ id: F.id, label: F.label, visible: !N.includes(F.id) })),
366
- [t, D, N]
367
- ), R = n.pageSize ?? 10, q = j(() => {
368
- const F = {};
369
- for (const V of t)
370
- V.width !== void 0 && (F[V.id] = V.width);
371
- return F;
372
- }, [t]), H = j(() => {
373
- const F = {};
374
- for (const [V, B] of Object.entries(x))
375
- q[V] !== B && (F[V] = B);
376
- return F;
377
- }, [x, q]), M = j(
363
+ [d]
364
+ ), k = $(
365
+ () => et(t, I).filter((T) => T.label !== void 0 && T.hideable !== !1).map((T) => ({ id: T.id, label: T.label, visible: !S.includes(T.id) })),
366
+ [t, I, S]
367
+ ), L = n.pageSize ?? 10, K = $(() => {
368
+ const T = {};
369
+ for (const D of t)
370
+ D.width !== void 0 && (T[D.id] = D.width);
371
+ return T;
372
+ }, [t]), H = $(() => {
373
+ const T = {};
374
+ for (const [D, E] of Object.entries(A))
375
+ K[D] !== E && (T[D] = E);
376
+ return T;
377
+ }, [A, K]), M = $(
378
378
  () => s ? Array.isArray(s) ? s : [s] : [],
379
379
  [s]
380
- ), Q = f.length === M.length && f.every(
381
- (F, V) => {
382
- var B, oe;
383
- return F.column === ((B = M[V]) == null ? void 0 : B.column) && F.direction === ((oe = M[V]) == null ? void 0 : oe.direction);
380
+ ), J = d.length === M.length && d.every(
381
+ (T, D) => {
382
+ var E, ne;
383
+ return T.column === ((E = M[D]) == null ? void 0 : E.column) && T.direction === ((ne = M[D]) == null ? void 0 : ne.direction);
384
384
  }
385
- ), ne = j(
385
+ ), Z = $(
386
386
  () => ({
387
387
  ...u ? { search: u } : {},
388
- ...f.length && !Q ? { sort: f } : {},
388
+ ...d.length && !J ? { sort: d } : {},
389
389
  /* Without paging there is no page a view could carry - a page three in
390
390
  the view of a virtualised table would be a promise nobody redeems on
391
391
  opening. */
392
- ...!a && O.page > 1 ? { page: O.page } : {},
393
- ...!a && m !== R ? { pageSize: m } : {},
394
- ...N.length ? { hidden: N } : {},
395
- ...D.length ? { order: D } : {},
392
+ ...!a && R.page > 1 ? { page: R.page } : {},
393
+ ...!a && p !== L ? { pageSize: p } : {},
394
+ ...S.length ? { hidden: S } : {},
395
+ ...I.length ? { order: I } : {},
396
396
  ...Object.keys(H).length ? { widths: H } : {}
397
397
  }),
398
398
  [
399
399
  a,
400
400
  u,
401
- f,
402
- Q,
403
- O.page,
404
- m,
405
- R,
406
- N,
407
- D,
401
+ d,
402
+ J,
403
+ R.page,
404
+ p,
405
+ L,
406
+ S,
407
+ I,
408
408
  H
409
409
  ]
410
410
  );
411
411
  return {
412
- ...O,
413
- visible: $,
414
- visibleLines: I,
415
- virtual: a ? A : void 0,
416
- view: ne,
412
+ ...R,
413
+ visible: z,
414
+ visibleLines: V,
415
+ virtual: a ? N : void 0,
416
+ view: Z,
417
417
  search: u,
418
418
  setSearch: ie,
419
- sort: f,
419
+ sort: d,
420
420
  toggleSort: de,
421
421
  sortDirectionOf: le,
422
422
  sortRankOf: te,
423
- setPage: k,
424
- pageSize: m,
423
+ setPage: v,
424
+ pageSize: p,
425
425
  setPageSize: ae,
426
426
  expanded: g,
427
427
  toggleRow: fe,
428
428
  isExpanded: we,
429
- hidden: N,
429
+ hidden: S,
430
430
  toggleColumn: be,
431
- columnChoices: y,
432
- order: D,
433
- setOrder: T,
434
- widths: x,
435
- setWidth: ye,
436
- selection: W
431
+ columnChoices: k,
432
+ order: I,
433
+ setOrder: x,
434
+ widths: A,
435
+ setWidth: ke,
436
+ selection: q
437
437
  };
438
438
  }
439
- function vn() {
439
+ function yn() {
440
440
  var t;
441
441
  const e = import.meta;
442
442
  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;
443
443
  }
444
- const Mt = vn(), at = /* @__PURE__ */ new Set();
444
+ const Mt = yn(), at = /* @__PURE__ */ new Set();
445
445
  function pe(e, t) {
446
446
  !Mt || at.has(e) || (at.add(e), console.warn(`@umriss-ui/table: ${t}`));
447
447
  }
448
- const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_scroll_1wkkr_29 _scroll_1hv7a_40", Sn = "_footerTarget_1wkkr_36", Nn = "_table_1wkkr_40", xn = "_th_1wkkr_48 _ring_1hv7a_65", An = "_sticky_1wkkr_63", Tn = "_td_1wkkr_71", Fn = "_rowHeader_1wkkr_83", On = "_compact_1wkkr_99", Ln = "_numeric_1wkkr_114", Rn = "_absent_1wkkr_126", Mn = "_striped_1wkkr_130", Vn = "_stickyCell_1wkkr_154", Dn = "_sortButton_1wkkr_166 _ring_1hv7a_65", In = "_sortIndicator_1wkkr_191", Pn = "_sortArrow_1wkkr_198", Gn = "_sortArrowDesc_1wkkr_202", En = "_sortActive_1wkkr_210", Bn = "_sortRank_1wkkr_216", zn = "_thFlex_1wkkr_224", jn = "_footerKind_1wkkr_245", Hn = "_emptyCell_1wkkr_253", $n = "_empty_1wkkr_253", Kn = "_emptyTitle_1wkkr_269", Wn = "_skeleton_1wkkr_276", qn = "_toolbar_1wkkr_304 _text_1hv7a_23", Yn = "_toolbarGroup_1wkkr_318", Un = "_toolbarInfo_1wkkr_335", Xn = "_pagination_1wkkr_341 _text_1hv7a_23", Jn = "_paginationControls_1wkkr_354", Qn = "_pageSize_1wkkr_361", Zn = "_paginationStatus_1wkkr_373", eo = "_filterButton_1wkkr_382 _ring_1hv7a_65", to = "_filterActive_1wkkr_405", no = "_filterPanel_1wkkr_410", oo = "_filterContent_1wkkr_423 _scroll_1hv7a_40", ro = "_filterFooter_1wkkr_434", so = "_filterLabel_1wkkr_448", io = "_filterValue_1wkkr_458", ao = "_filteredCount_1wkkr_464", lo = "_rangeFields_1wkkr_475", co = "_rangePeriod_1wkkr_485", uo = "_conditions_1wkkr_491", fo = "_conditionButton_1wkkr_497", ho = "_condition_1wkkr_491", go = "_columnsPanel_1wkkr_521", po = "_columnsList_1wkkr_529", mo = "_columnsEntry_1wkkr_538", wo = "_move_1wkkr_550", bo = "_groupingChoice_1wkkr_585", ko = "_groupingHeading_1wkkr_591", vo = "_groupingOptions_1wkkr_600", _o = "_groupingOption_1wkkr_600 _ring_1hv7a_65", yo = "_groupingLevel_1wkkr_639", Co = "_groupingTag_1wkkr_644", So = "_groupingTrigger_1wkkr_651", No = "_groupingPrefix_1wkkr_656", xo = "_groupingPath_1wkkr_661", Ao = "_groupingSeparator_1wkkr_665", To = "_groupHeader_1wkkr_682", Fo = "_spanCell_1wkkr_723", Oo = "_groupFolded_1wkkr_772", Lo = "_spanValue_1wkkr_776", Ro = "_groupLabel_1wkkr_777", Mo = "_spanText_1wkkr_789", Vo = "_groupValue_1wkkr_790", Do = "_groupCount_1wkkr_797", Io = "_continued_1wkkr_811", Po = "_spanSelect_1wkkr_842", Go = "_fold_1wkkr_856", Eo = "_foldClosed_1wkkr_888", Bo = "_foldedCount_1wkkr_898", zo = "_shareHost_1wkkr_906", jo = "_shareBar_1wkkr_913", Ho = "_expander_1wkkr_925", $o = "_expanderOpen_1wkkr_956", Ko = "_detailRow_1wkkr_960", Wo = "_detailCell_1wkkr_960", qo = "_actionsCell_1wkkr_968", Yo = "_actions_1wkkr_968", Uo = "_grip_1wkkr_996", Xo = "_virtualBody_1wkkr_1037", Jo = "_virtualRow_1wkkr_1045", Qo = "_fillerRow_1wkkr_1050", Zo = "_control_1wkkr_145", d = {
449
- frame: _n,
450
- children: yn,
448
+ const kn = "_frame_19w57_11 _text_1hv7a_23", Sn = "_children_19w57_23", Cn = "_scroll_19w57_29 _scroll_1hv7a_40", Nn = "_footerTarget_19w57_36", xn = "_table_19w57_40", An = "_th_19w57_48 _ring_1hv7a_65", Tn = "_sticky_19w57_63", Fn = "_td_19w57_71", On = "_rowHeader_19w57_83", Rn = "_compact_19w57_99", Ln = "_numeric_19w57_114", Mn = "_absent_19w57_126", Vn = "_striped_19w57_130", Dn = "_stickyCell_19w57_154", In = "_sortButton_19w57_166 _ring_1hv7a_65", Pn = "_sortIndicator_19w57_194", Bn = "_sortArrow_19w57_201", Gn = "_sortArrowDesc_19w57_205", En = "_sortActive_19w57_213", zn = "_sortRank_19w57_219", Hn = "_thFlex_19w57_227", jn = "_footerKind_19w57_248", $n = "_emptyCell_19w57_256", Kn = "_empty_19w57_256", Wn = "_emptyTitle_19w57_272", qn = "_skeleton_19w57_279", Yn = "_toolbar_19w57_307 _text_1hv7a_23", Un = "_toolbarGroup_19w57_321", Jn = "_toolbarInfo_19w57_338", Xn = "_pagination_19w57_344 _text_1hv7a_23", Qn = "_paginationControls_19w57_357", Zn = "_pageSize_19w57_364", eo = "_paginationStatus_19w57_376", to = "_filterButton_19w57_385 _ring_1hv7a_65", no = "_filterActive_19w57_412", oo = "_filterPanel_19w57_417", ro = "_filterContent_19w57_430 _scroll_1hv7a_40", so = "_filterFooter_19w57_441", io = "_filterLabel_19w57_455", ao = "_filterValue_19w57_465", lo = "_filteredCount_19w57_471", co = "_rangeFields_19w57_482", uo = "_rangePeriod_19w57_492", fo = "_conditions_19w57_498", ho = "_conditionButton_19w57_504", go = "_condition_19w57_498", po = "_columnsPanel_19w57_528", mo = "_columnsList_19w57_536", wo = "_columnsEntry_19w57_545", bo = "_move_19w57_557", vo = "_groupingChoice_19w57_595", _o = "_groupingHeading_19w57_601", yo = "_groupingOptions_19w57_610", ko = "_groupingOption_19w57_610 _ring_1hv7a_65", So = "_groupingLevel_19w57_653", Co = "_groupingTag_19w57_658", No = "_groupingTrigger_19w57_665", xo = "_groupingPrefix_19w57_670", Ao = "_groupingPath_19w57_675", To = "_groupingSeparator_19w57_679", Fo = "_groupHeader_19w57_696", Oo = "_spanCell_19w57_737", Ro = "_groupFolded_19w57_786", Lo = "_spanValue_19w57_790", Mo = "_groupLabel_19w57_791", Vo = "_spanText_19w57_803", Do = "_groupValue_19w57_804", Io = "_groupCount_19w57_811", Po = "_continued_19w57_825", Bo = "_spanSelect_19w57_856", Go = "_fold_19w57_870", Eo = "_foldClosed_19w57_906", zo = "_foldedCount_19w57_916", Ho = "_shareHost_19w57_924", jo = "_shareBar_19w57_931", $o = "_expander_19w57_943", Ko = "_expanderOpen_19w57_978", Wo = "_detailRow_19w57_982", qo = "_detailCell_19w57_982", Yo = "_actionsCell_19w57_990", Uo = "_actions_19w57_990", Jo = "_grip_19w57_1018", Xo = "_virtualBody_19w57_1059", Qo = "_virtualRow_19w57_1071", Zo = "_fillerRow_19w57_1076", er = "_control_19w57_145", f = {
449
+ frame: kn,
450
+ children: Sn,
451
451
  scroll: Cn,
452
- footerTarget: Sn,
453
- table: Nn,
454
- th: xn,
455
- sticky: An,
456
- td: Tn,
457
- rowHeader: Fn,
458
- compact: On,
452
+ footerTarget: Nn,
453
+ table: xn,
454
+ th: An,
455
+ sticky: Tn,
456
+ td: Fn,
457
+ rowHeader: On,
458
+ compact: Rn,
459
459
  numeric: Ln,
460
- absent: Rn,
461
- striped: Mn,
462
- stickyCell: Vn,
463
- sortButton: Dn,
464
- sortIndicator: In,
465
- sortArrow: Pn,
460
+ absent: Mn,
461
+ striped: Vn,
462
+ stickyCell: Dn,
463
+ sortButton: In,
464
+ sortIndicator: Pn,
465
+ sortArrow: Bn,
466
466
  sortArrowDesc: Gn,
467
467
  sortActive: En,
468
- sortRank: Bn,
469
- thFlex: zn,
468
+ sortRank: zn,
469
+ thFlex: Hn,
470
470
  footerKind: jn,
471
- emptyCell: Hn,
472
- empty: $n,
473
- emptyTitle: Kn,
474
- skeleton: Wn,
475
- toolbar: qn,
476
- toolbarGroup: Yn,
477
- toolbarInfo: Un,
471
+ emptyCell: $n,
472
+ empty: Kn,
473
+ emptyTitle: Wn,
474
+ skeleton: qn,
475
+ toolbar: Yn,
476
+ toolbarGroup: Un,
477
+ toolbarInfo: Jn,
478
478
  pagination: Xn,
479
- paginationControls: Jn,
480
- pageSize: Qn,
481
- paginationStatus: Zn,
482
- filterButton: eo,
483
- filterActive: to,
484
- filterPanel: no,
485
- filterContent: oo,
486
- filterFooter: ro,
487
- filterLabel: so,
488
- filterValue: io,
489
- filteredCount: ao,
490
- rangeFields: lo,
491
- rangePeriod: co,
492
- conditions: uo,
493
- conditionButton: fo,
494
- condition: ho,
495
- columnsPanel: go,
496
- columnsList: po,
497
- columnsEntry: mo,
498
- move: wo,
499
- groupingChoice: bo,
500
- groupingHeading: ko,
501
- groupingOptions: vo,
502
- groupingOption: _o,
503
- groupingLevel: yo,
479
+ paginationControls: Qn,
480
+ pageSize: Zn,
481
+ paginationStatus: eo,
482
+ filterButton: to,
483
+ filterActive: no,
484
+ filterPanel: oo,
485
+ filterContent: ro,
486
+ filterFooter: so,
487
+ filterLabel: io,
488
+ filterValue: ao,
489
+ filteredCount: lo,
490
+ rangeFields: co,
491
+ rangePeriod: uo,
492
+ conditions: fo,
493
+ conditionButton: ho,
494
+ condition: go,
495
+ columnsPanel: po,
496
+ columnsList: mo,
497
+ columnsEntry: wo,
498
+ move: bo,
499
+ groupingChoice: vo,
500
+ groupingHeading: _o,
501
+ groupingOptions: yo,
502
+ groupingOption: ko,
503
+ groupingLevel: So,
504
504
  groupingTag: Co,
505
- groupingTrigger: So,
506
- groupingPrefix: No,
507
- groupingPath: xo,
508
- groupingSeparator: Ao,
509
- groupHeader: To,
510
- spanCell: Fo,
511
- groupFolded: Oo,
505
+ groupingTrigger: No,
506
+ groupingPrefix: xo,
507
+ groupingPath: Ao,
508
+ groupingSeparator: To,
509
+ groupHeader: Fo,
510
+ spanCell: Oo,
511
+ groupFolded: Ro,
512
512
  spanValue: Lo,
513
- groupLabel: Ro,
514
- spanText: Mo,
515
- groupValue: Vo,
516
- groupCount: Do,
517
- continued: Io,
518
- spanSelect: Po,
513
+ groupLabel: Mo,
514
+ spanText: Vo,
515
+ groupValue: Do,
516
+ groupCount: Io,
517
+ continued: Po,
518
+ spanSelect: Bo,
519
519
  fold: Go,
520
520
  foldClosed: Eo,
521
- foldedCount: Bo,
522
- shareHost: zo,
521
+ foldedCount: zo,
522
+ shareHost: Ho,
523
523
  shareBar: jo,
524
- expander: Ho,
525
- expanderOpen: $o,
526
- detailRow: Ko,
527
- detailCell: Wo,
528
- actionsCell: qo,
529
- actions: Yo,
530
- grip: Uo,
524
+ expander: $o,
525
+ expanderOpen: Ko,
526
+ detailRow: Wo,
527
+ detailCell: qo,
528
+ actionsCell: Yo,
529
+ actions: Uo,
530
+ grip: Jo,
531
531
  virtualBody: Xo,
532
- virtualRow: Jo,
533
- fillerRow: Qo,
534
- control: Zo
532
+ virtualRow: Qo,
533
+ fillerRow: Zo,
534
+ control: er
535
535
  };
536
536
  function Xs(e) {
537
537
  return e;
@@ -540,20 +540,20 @@ const Ne = /* @__PURE__ */ new WeakMap();
540
540
  function Vt(e, t) {
541
541
  return Ne.set(e, t), e;
542
542
  }
543
- const er = (e) => Ne.has(e);
543
+ const tr = (e) => Ne.has(e);
544
544
  function me(e) {
545
- return e === "list" ? sr : e === "range" ? hr : typeof e == "object" && e !== null ? e : void 0;
545
+ return e === "list" ? ir : e === "range" ? gr : typeof e == "object" && e !== null ? e : void 0;
546
546
  }
547
547
  function Dt(e, t) {
548
548
  if (t == null) return "empty";
549
549
  const n = Ne.get(e);
550
550
  return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
551
551
  }
552
- function tr(e, t, n) {
552
+ function nr(e, t, n) {
553
553
  var o;
554
554
  return Y(t) ? ((o = Ne.get(e)) == null ? void 0 : o.absentMatches(n)) ?? !1 : e.matches(t, n);
555
555
  }
556
- function nr(e, t, n) {
556
+ function or(e, t, n) {
557
557
  const o = Ne.get(e);
558
558
  return o ? o.describeIn(t, n) : e.describe(t);
559
559
  }
@@ -561,7 +561,7 @@ const lt = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : v
561
561
  const o = lt(t.value), r = lt(n.value);
562
562
  return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
563
563
  };
564
- function or(e, t, n) {
564
+ function rr(e, t, n) {
565
565
  const o = /* @__PURE__ */ new Map();
566
566
  let r = !1;
567
567
  for (const i of e) {
@@ -576,81 +576,81 @@ function or(e, t, n) {
576
576
  return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(It(n)).map(({ value: i }) => i), absent: r };
577
577
  }
578
578
  const ct = /* @__PURE__ */ new WeakMap();
579
- function je(e) {
579
+ function He(e) {
580
580
  let t = ct.get(e);
581
581
  return t || (t = new Set(e.map(ge)), ct.set(e, t)), t;
582
582
  }
583
- const He = (e, t) => Y(e) ? t.wording.cellAbsentValue : _e(e, t.format, t.formats, t.wording) ?? String(e);
584
- function rr({
583
+ const je = (e, t) => Y(e) ? t.wording.cellAbsentValue : ye(e, t.format, t.formats, t.wording) ?? String(e);
584
+ function sr({
585
585
  condition: e,
586
586
  setCondition: t,
587
587
  values: n,
588
588
  absentOccurs: o = !1,
589
589
  format: r
590
590
  }) {
591
- const s = ue(), i = U(), a = j(() => e ?? [], [e]), c = j(() => {
592
- const f = { formats: s, wording: i, format: r }, b = n.map((w) => ({ key: ge(w), text: He(w, f), value: w }));
593
- b.sort(It(s));
594
- const p = new Set(b.map((w) => w.key)), k = a.filter((w) => !Y(w) && !p.has(ge(w))).map((w) => ({ key: ge(w), text: He(w, f), value: w })), m = o || a.some(Y) ? [{ key: Xe, text: i.cellAbsentValue, value: null }] : [];
595
- return [...b, ...k, ...m];
596
- }, [n, a, o, r, s, i]), u = je(a), h = (f) => {
597
- const b = u.has(f.key) ? a.filter((p) => ge(p) !== f.key) : [...a, f.value];
598
- t(b.length > 0 ? b : null);
591
+ const s = ue(), i = U(), a = $(() => e ?? [], [e]), c = $(() => {
592
+ const d = { formats: s, wording: i, format: r }, m = n.map((b) => ({ key: ge(b), text: je(b, d), value: b }));
593
+ m.sort(It(s));
594
+ const w = new Set(m.map((b) => b.key)), v = a.filter((b) => !Y(b) && !w.has(ge(b))).map((b) => ({ key: ge(b), text: je(b, d), value: b })), p = o || a.some(Y) ? [{ key: Je, text: i.cellAbsentValue, value: null }] : [];
595
+ return [...m, ...v, ...p];
596
+ }, [n, a, o, r, s, i]), u = He(a), h = (d) => {
597
+ const m = u.has(d.key) ? a.filter((w) => ge(w) !== d.key) : [...a, d.value];
598
+ t(m.length > 0 ? m : null);
599
599
  };
600
- return /* @__PURE__ */ l("div", { className: d.filterContent, children: c.map((f) => /* @__PURE__ */ l(
601
- Se,
600
+ return /* @__PURE__ */ l("div", { className: f.filterContent, children: c.map((d) => /* @__PURE__ */ l(
601
+ Ce,
602
602
  {
603
- label: f.text,
604
- checked: u.has(f.key),
605
- onChange: () => h(f)
603
+ label: d.text,
604
+ checked: u.has(d.key),
605
+ onChange: () => h(d)
606
606
  },
607
- f.key
607
+ d.key
608
608
  )) });
609
609
  }
610
- const sr = Vt(
610
+ const ir = Vt(
611
611
  {
612
- matches: (e, t) => je(t).has(ge(e)),
613
- Input: rr,
612
+ matches: (e, t) => He(t).has(ge(e)),
613
+ Input: sr,
614
614
  describe: (e) => e.map((t) => Y(t) ? "–" : String(t)).join(", ")
615
615
  },
616
616
  {
617
617
  isCondition: (e) => Array.isArray(e),
618
618
  isEmpty: (e) => e.length === 0,
619
- absentMatches: (e) => je(e).has(Xe),
619
+ absentMatches: (e) => He(e).has(Je),
620
620
  /* From three values on the first two and how many more: a condition is one
621
621
  line in the table toolbar, not a list. */
622
622
  describeIn: (e, t) => {
623
- const n = e.map((r) => He(r, t));
623
+ const n = e.map((r) => je(r, t));
624
624
  if (n.length <= 2) return n.join(", ");
625
625
  const o = n.length - 2;
626
626
  return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
627
627
  }
628
628
  }
629
- ), ir = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), ar = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), ve = (e) => typeof e == "number" && Number.isFinite(e), ce = (e) => e instanceof Date && !Number.isNaN(e.getTime()), lr = (e) => ce(e) ? ir(e) : ve(e) ? e : void 0, cr = (e) => ce(e) ? { value: ar(e), open: !0 } : ve(e) ? { value: e, open: !1 } : void 0, Ae = (e, t) => ce(e) ? t.formats.date(e) : _e(e, t.format, t.formats, t.wording) ?? String(e);
630
- function ur({ condition: e, setCondition: t }) {
631
- const n = U(), [o, r] = z(null), s = o !== null, i = o ? o.from : ve(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : ve(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
632
- const f = { from: i, to: a, [u]: h };
633
- if (f.from !== null && f.to !== null && f.from > f.to) {
634
- r(f);
629
+ ), ar = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), lr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), _e = (e) => typeof e == "number" && Number.isFinite(e), ce = (e) => e instanceof Date && !Number.isNaN(e.getTime()), cr = (e) => ce(e) ? ar(e) : _e(e) ? e : void 0, ur = (e) => ce(e) ? { value: lr(e), open: !0 } : _e(e) ? { value: e, open: !1 } : void 0, Ae = (e, t) => ce(e) ? t.formats.date(e) : ye(e, t.format, t.formats, t.wording) ?? String(e);
630
+ function dr({ condition: e, setCondition: t }) {
631
+ const n = U(), [o, r] = j(null), s = o !== null, i = o ? o.from : _e(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : _e(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
632
+ const d = { from: i, to: a, [u]: h };
633
+ if (d.from !== null && d.to !== null && d.from > d.to) {
634
+ r(d);
635
635
  return;
636
636
  }
637
- if (r(null), f.from === null && f.to === null) {
637
+ if (r(null), d.from === null && d.to === null) {
638
638
  t(null);
639
639
  return;
640
640
  }
641
641
  t({
642
- ...f.from !== null ? { from: f.from } : {},
643
- ...f.to !== null ? { to: f.to } : {}
642
+ ...d.from !== null ? { from: d.from } : {},
643
+ ...d.to !== null ? { to: d.to } : {}
644
644
  });
645
645
  };
646
- return /* @__PURE__ */ L("div", { className: d.rangeFields, children: [
646
+ return /* @__PURE__ */ O("div", { className: f.rangeFields, children: [
647
647
  /* @__PURE__ */ l(rt, { label: n.filterFrom, children: /* @__PURE__ */ l(st, { size: "sm", value: i, invalid: s, onChange: (u) => c("from", u) }) }),
648
648
  /* @__PURE__ */ l(rt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ l(st, { size: "sm", value: a, onChange: (u) => c("to", u) }) })
649
649
  ] });
650
650
  }
651
- function dr({ condition: e, setCondition: t }) {
651
+ function fr({ condition: e, setCondition: t }) {
652
652
  const n = ce(e == null ? void 0 : e.from) && ce(e == null ? void 0 : e.to) ? { from: e.from, to: e.to } : null;
653
- return /* @__PURE__ */ l("div", { className: d.rangePeriod, children: /* @__PURE__ */ l(
653
+ return /* @__PURE__ */ l("div", { className: f.rangePeriod, children: /* @__PURE__ */ l(
654
654
  Zt,
655
655
  {
656
656
  size: "sm",
@@ -660,23 +660,23 @@ function dr({ condition: e, setCondition: t }) {
660
660
  }
661
661
  ) });
662
662
  }
663
- function fr(e) {
664
- return e.kind === "date" ? /* @__PURE__ */ l(dr, { ...e }) : /* @__PURE__ */ l(ur, { ...e });
663
+ function hr(e) {
664
+ return e.kind === "date" ? /* @__PURE__ */ l(fr, { ...e }) : /* @__PURE__ */ l(dr, { ...e });
665
665
  }
666
- const hr = Vt(
666
+ const gr = Vt(
667
667
  {
668
668
  matches: (e, t) => {
669
- const n = ce(e) ? e.getTime() : ve(e) ? e : void 0;
669
+ const n = ce(e) ? e.getTime() : _e(e) ? e : void 0;
670
670
  if (n === void 0) return !1;
671
- const o = lr(t.from), r = cr(t.to);
671
+ const o = cr(t.from), r = ur(t.to);
672
672
  return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
673
673
  },
674
- Input: fr,
674
+ Input: hr,
675
675
  describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
676
676
  },
677
677
  {
678
678
  isCondition: (e) => typeof e != "object" || e === null || Array.isArray(e) || e instanceof Date ? !1 : Object.entries(e).every(
679
- ([n, o]) => (n === "from" || n === "to") && (o === void 0 || ve(o) || ce(o))
679
+ ([n, o]) => (n === "from" || n === "to") && (o === void 0 || _e(o) || ce(o))
680
680
  ),
681
681
  isEmpty: (e) => e.from === void 0 && e.to === void 0,
682
682
  absentMatches: () => !1,
@@ -693,7 +693,7 @@ const hr = Vt(
693
693
  }
694
694
  }
695
695
  );
696
- class Ge {
696
+ class Be {
697
697
  constructor(t) {
698
698
  P(this, "entries", /* @__PURE__ */ new Map());
699
699
  /** Keys in the order of the running pass. */
@@ -743,12 +743,12 @@ const ut = (e) => JSON.stringify([
743
743
  e.group,
744
744
  e.groupable
745
745
  ]), dt = (e, t) => e == null ? void 0 : e[t];
746
- class gr {
746
+ class pr {
747
747
  constructor() {
748
- P(this, "columns", new Ge("data-umriss-column"));
749
- P(this, "actions", new Ge("data-umriss-action"));
748
+ P(this, "columns", new Be("data-umriss-column"));
749
+ P(this, "actions", new Be("data-umriss-action"));
750
750
  /** The group keys: values to group by that are no column. */
751
- P(this, "groupKeys", new Ge("data-umriss-groupkey"));
751
+ P(this, "groupKeys", new Be("data-umriss-groupkey"));
752
752
  P(this, "signatures", /* @__PURE__ */ new Map());
753
753
  /** The row detail: the presentation of the `RowDetail` that registered last. */
754
754
  P(this, "detail", null);
@@ -782,9 +782,10 @@ class gr {
782
782
  /** What body and unbound parts read. Every counter only rises, so the sum
783
783
  rises exactly when one of them rises. */
784
784
  P(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
785
- /** The group whose fold takes the focus after its line was drawn anew - a
786
- folded span is a new row, and the focus would otherwise be lost. */
787
- P(this, "pendingFoldFocus", null);
785
+ /** The focus a fold may hide: the focused element of a grouped line, the
786
+ group that line stands in, and its table - noted before the fold, since
787
+ afterwards the element may be gone and the focus lost. */
788
+ P(this, "focusBeforeFold", null);
788
789
  /** Whether the table lets itself be grouped at all (`<Table groupable>`). */
789
790
  P(this, "tableGroupable", !0);
790
791
  P(this, "groupingCache", null);
@@ -898,12 +899,17 @@ class gr {
898
899
  removeGroupKey(t) {
899
900
  this.groupKeys.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
900
901
  }
901
- requestFoldFocus(t) {
902
- this.pendingFoldFocus = t;
902
+ /** Notes where the focus stands - from the event that folds, never in a
903
+ render. */
904
+ noteFocusBeforeFold() {
905
+ var o;
906
+ const t = document.activeElement, n = (o = t == null ? void 0 : t.closest("tr[data-group]")) == null ? void 0 : o.dataset.group;
907
+ this.focusBeforeFold = t && n !== void 0 ? { element: t, group: n, table: t.closest("table") } : null;
903
908
  }
904
- /** Whether this group's fold is to take the focus now - once. */
905
- takeFoldFocus(t) {
906
- return this.pendingFoldFocus !== t ? !1 : (this.pendingFoldFocus = null, !0);
909
+ /** The focus noted before the last fold - once. */
910
+ takeFocusBeforeFold() {
911
+ const t = this.focusBeforeFold;
912
+ return this.focusBeforeFold = null, t;
907
913
  }
908
914
  setTableGroupable(t) {
909
915
  this.tableGroupable !== t && (this.tableGroupable = t, this.structure++);
@@ -936,8 +942,8 @@ class gr {
936
942
  value: (u) => {
937
943
  const h = c.read(u);
938
944
  if (h == null) return;
939
- const { ownGroupValue: f, group: b } = c.spec;
940
- return f ? f(h) : b ? hn(b)(h) : h;
945
+ const { ownGroupValue: d, group: m } = c.spec;
946
+ return d ? d(h) : m ? gn(m)(h) : h;
941
947
  },
942
948
  /* A value of one's own is a name; its groups stand by what they hold. */
943
949
  order: c.spec.ownGroupValue ? (u) => ze(c.read(u), c.spec.ownSortValue) : void 0
@@ -984,15 +990,15 @@ class gr {
984
990
  if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
985
991
  return this.modelCache.columns;
986
992
  const s = o.map((a) => {
987
- const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), f = c.searchable ?? u === "text", b = (p) => ze(a.read(p), c.ownSortValue);
993
+ const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), d = c.searchable ?? u === "text", m = (w) => ze(a.read(w), c.ownSortValue);
988
994
  return {
989
995
  id: c.id,
990
996
  label: c.label,
991
- value: h || f ? b : void 0,
997
+ value: h || d ? m : void 0,
992
998
  /* Text sorts with the provider's comparison, not with the built-in
993
999
  German one (spec, the table of defaults). */
994
- compare: u === "text" && !c.ownSortValue ? (p, k) => n.compareText(String(b(p)), String(b(k))) : void 0,
995
- searchable: f,
1000
+ compare: u === "text" && !c.ownSortValue ? (w, v) => n.compareText(String(m(w)), String(m(v))) : void 0,
1001
+ searchable: d,
996
1002
  hideable: !c.rowHeader,
997
1003
  resizable: c.resizable,
998
1004
  width: c.width
@@ -1027,7 +1033,7 @@ class gr {
1027
1033
  hidden: o.hidden,
1028
1034
  order: o.order,
1029
1035
  grouping: this.groupingFor(t)
1030
- }, s = tt(t.admitted, n, r), i = o.virtual ? pr(s, o.virtual.from, o.virtual.to) : s;
1036
+ }, s = tt(t.admitted, n, r), i = o.virtual ? mr(s, o.virtual.from, o.virtual.to) : s;
1031
1037
  return this.projectionCache = { hook: t, columns: n, projection: i }, i;
1032
1038
  }
1033
1039
  /* --- The hook's snapshot ---------------------------------------------------------- */
@@ -1098,15 +1104,15 @@ class gr {
1098
1104
  this.actions.entries.delete(t) && this.structure++;
1099
1105
  }
1100
1106
  }
1101
- function pr(e, t, n) {
1107
+ function mr(e, t, n) {
1102
1108
  if (!e.lines) return { ...e, visible: e.filtered.slice(t, n) };
1103
1109
  const o = e.lines.slice(t, n);
1104
1110
  return { ...e, visibleLines: o, visible: Ze(o) };
1105
1111
  }
1106
- const Pt = /* @__PURE__ */ new WeakMap(), mr = (e, t) => {
1112
+ const Pt = /* @__PURE__ */ new WeakMap(), wr = (e, t) => {
1107
1113
  Pt.set(e, t);
1108
- }, wr = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Pt.get(e) : void 0, E = (...e) => e.filter(Boolean).join(" ");
1109
- function Gt({
1114
+ }, br = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Pt.get(e) : void 0, G = (...e) => e.filter(Boolean).join(" ");
1115
+ function Bt({
1110
1116
  entry: e,
1111
1117
  registry: t,
1112
1118
  hook: n,
@@ -1116,55 +1122,55 @@ function Gt({
1116
1122
  setOpen: i,
1117
1123
  panelId: a
1118
1124
  }) {
1119
- const c = U(), u = ue(), { id: h, label: f, format: b } = e.spec, { values: p, absent: k } = j(() => or(n.admitted, e.read, u), [n.admitted, e, u]), m = me(e.spec.filter);
1120
- if (!m) return null;
1121
- const w = n.publicSnapshot, g = m.Input, v = er(m) ? { absentOccurs: k, format: b, kind: t.kindOf(e, n.rows) } : {}, N = () => {
1125
+ const c = U(), u = ue(), { id: h, label: d, format: m } = e.spec, { values: w, absent: v } = $(() => rr(n.admitted, e.read, u), [n.admitted, e, u]), p = me(e.spec.filter);
1126
+ if (!p) return null;
1127
+ const b = n.publicSnapshot, g = p.Input, y = tr(p) ? { absentOccurs: v, format: m, kind: t.kindOf(e, n.rows) } : {}, S = () => {
1122
1128
  var C;
1123
1129
  i(!1), (C = (r ?? o).current) == null || C.focus();
1124
1130
  };
1125
- return /* @__PURE__ */ L(
1126
- St,
1131
+ return /* @__PURE__ */ O(
1132
+ Ct,
1127
1133
  {
1128
1134
  open: s,
1129
1135
  onOpenChange: i,
1130
1136
  anchorRef: o,
1131
1137
  align: "end",
1132
1138
  role: "dialog",
1133
- ariaLabel: c.filterColumn(f),
1139
+ ariaLabel: c.filterColumn(d),
1134
1140
  id: a,
1135
- className: d.filterPanel,
1141
+ className: f.filterPanel,
1136
1142
  children: [
1137
1143
  /* @__PURE__ */ l(
1138
1144
  g,
1139
1145
  {
1140
- condition: w.filter[h] ?? null,
1141
- setCondition: (C) => w.setFilter(h, C),
1142
- values: p,
1143
- column: { id: h, label: f },
1144
- ...v
1146
+ condition: b.filter[h] ?? null,
1147
+ setCondition: (C) => b.setFilter(h, C),
1148
+ values: w,
1149
+ column: { id: h, label: d },
1150
+ ...y
1145
1151
  }
1146
1152
  ),
1147
- /* @__PURE__ */ L("div", { className: d.filterFooter, children: [
1148
- /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => w.setFilter(h, null), children: c.filterReset }),
1149
- /* @__PURE__ */ l(ee, { size: "sm", onClick: N, children: c.filterDone })
1153
+ /* @__PURE__ */ O("div", { className: f.filterFooter, children: [
1154
+ /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => b.setFilter(h, null), children: c.filterReset }),
1155
+ /* @__PURE__ */ l(ee, { size: "sm", onClick: S, children: c.filterDone })
1150
1156
  ] })
1151
1157
  ]
1152
1158
  }
1153
1159
  );
1154
1160
  }
1155
- function br({
1161
+ function vr({
1156
1162
  entry: e,
1157
1163
  registry: t,
1158
1164
  hook: n
1159
1165
  }) {
1160
- const o = U(), [r, s] = z(!1), i = Z(null), a = se(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
1161
- return /* @__PURE__ */ L(J, { children: [
1166
+ const o = U(), [r, s] = j(!1), i = re(null), a = se(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
1167
+ return /* @__PURE__ */ O(Q, { children: [
1162
1168
  /* @__PURE__ */ l(
1163
1169
  "button",
1164
1170
  {
1165
1171
  ref: i,
1166
1172
  type: "button",
1167
- className: E(d.filterButton, h && d.filterActive),
1173
+ className: G(f.filterButton, h && f.filterActive),
1168
1174
  "aria-label": o.filterColumn(u),
1169
1175
  "aria-haspopup": "dialog",
1170
1176
  "aria-expanded": r,
@@ -1184,7 +1190,7 @@ function br({
1184
1190
  }
1185
1191
  ),
1186
1192
  /* @__PURE__ */ l(
1187
- Gt,
1193
+ Bt,
1188
1194
  {
1189
1195
  entry: e,
1190
1196
  registry: t,
@@ -1197,51 +1203,51 @@ function br({
1197
1203
  )
1198
1204
  ] });
1199
1205
  }
1200
- function kr({ registry: e, hook: t }) {
1206
+ function _r({ registry: e, hook: t }) {
1201
1207
  const n = U(), o = ue(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1202
1208
  const a = e.columnById(s), c = a ? me(a.spec.filter) : void 0;
1203
1209
  if (!a || !c) return [];
1204
1210
  const u = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
1205
- return [{ entry: a, text: nr(c, i, u) }];
1211
+ return [{ entry: a, text: or(c, i, u) }];
1206
1212
  });
1207
- return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className: d.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(vr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
1213
+ return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(yr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
1208
1214
  }
1209
- function vr({
1215
+ function yr({
1210
1216
  entry: e,
1211
1217
  text: t,
1212
1218
  registry: n,
1213
1219
  hook: o
1214
1220
  }) {
1215
- const r = U(), [s, i] = z(!1), a = Z(null), c = Z(null), u = se(), { id: h, label: f } = e.spec;
1216
- return /* @__PURE__ */ L(J, { children: [
1221
+ const r = U(), [s, i] = j(!1), a = re(null), c = re(null), u = se(), { id: h, label: d } = e.spec;
1222
+ return /* @__PURE__ */ O(Q, { children: [
1217
1223
  /* @__PURE__ */ l(
1218
1224
  xt,
1219
1225
  {
1220
1226
  ref: a,
1221
- className: d.condition,
1227
+ className: f.condition,
1222
1228
  onRemove: () => o.publicSnapshot.setFilter(h, null),
1223
- removeLabel: r.removeConditionNamed(f, t),
1224
- children: /* @__PURE__ */ L(
1229
+ removeLabel: r.removeConditionNamed(d, t),
1230
+ children: /* @__PURE__ */ O(
1225
1231
  "button",
1226
1232
  {
1227
1233
  ref: c,
1228
1234
  type: "button",
1229
- className: d.conditionButton,
1230
- "aria-label": r.editConditionNamed(f, t),
1235
+ className: f.conditionButton,
1236
+ "aria-label": r.editConditionNamed(d, t),
1231
1237
  "aria-haspopup": "dialog",
1232
1238
  "aria-expanded": s,
1233
1239
  "aria-controls": s ? u : void 0,
1234
1240
  onClick: () => i(!s),
1235
1241
  children: [
1236
- /* @__PURE__ */ l("span", { className: d.filterLabel, children: f }),
1237
- /* @__PURE__ */ l("span", { className: d.filterValue, children: t })
1242
+ /* @__PURE__ */ l("span", { className: f.filterLabel, children: d }),
1243
+ /* @__PURE__ */ l("span", { className: f.filterValue, children: t })
1238
1244
  ]
1239
1245
  }
1240
1246
  )
1241
1247
  }
1242
1248
  ),
1243
1249
  /* @__PURE__ */ l(
1244
- Gt,
1250
+ Bt,
1245
1251
  {
1246
1252
  entry: e,
1247
1253
  registry: n,
@@ -1255,17 +1261,17 @@ function vr({
1255
1261
  )
1256
1262
  ] });
1257
1263
  }
1258
- const ft = ";", _r = `\r
1259
- `, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Et = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Sr = (e, t) => {
1264
+ const ft = ";", kr = `\r
1265
+ `, Sr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Gt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Nr = (e, t) => {
1260
1266
  var o;
1261
1267
  const n = (o = t.value) == null ? void 0 : o.call(t, e);
1262
- return n == null ? "" : Et(typeof n == "number" ? Cr(n) : String(n));
1268
+ return n == null ? "" : Gt(typeof n == "number" ? Cr(n) : String(n));
1263
1269
  };
1264
- function Nr(e, t) {
1265
- const n = t.map((r) => Et(r.label ?? r.id)).join(ft), o = e.map((r) => t.map((s) => Sr(r, s)).join(ft));
1266
- return yr + [n, ...o].join(_r);
1270
+ function xr(e, t) {
1271
+ const n = t.map((r) => Gt(r.label ?? r.id)).join(ft), o = e.map((r) => t.map((s) => Nr(r, s)).join(ft));
1272
+ return Sr + [n, ...o].join(kr);
1267
1273
  }
1268
- function Bt(e) {
1274
+ function Et(e) {
1269
1275
  const t = new Map(e.orderedColumns().map((o) => [o.spec.id, o])), n = e.projection().columns.map((o) => t.get(o.id)).filter((o) => o !== void 0);
1270
1276
  return e.withStickyHeaderFirst(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
1271
1277
  }
@@ -1273,41 +1279,41 @@ function zt(e) {
1273
1279
  e.setSearch("");
1274
1280
  for (const t of Object.keys(e.filter)) e.setFilter(t, null);
1275
1281
  }
1276
- function xr(e) {
1282
+ function Ar(e) {
1277
1283
  const t = e.hook;
1278
1284
  if (!t) return "";
1279
- const n = Bt(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
1285
+ const n = Et(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
1280
1286
  (o) => ({
1281
1287
  id: o.spec.id,
1282
1288
  label: o.spec.label,
1283
- value: (r) => Lt(o.read(r), o.spec.ownExportValue)
1289
+ value: (r) => Rt(o.read(r), o.spec.ownExportValue)
1284
1290
  })
1285
1291
  );
1286
- return Nr(e.projection().filtered, n);
1292
+ return xr(e.projection().filtered, n);
1287
1293
  }
1288
- const Ar = (e, t, n) => {
1294
+ const Tr = (e, t, n) => {
1289
1295
  var o;
1290
1296
  return ((o = e.groupingEntries(t.rows).find((r) => r.spec.id === n)) == null ? void 0 : o.spec.label) ?? n;
1291
1297
  };
1292
- function Tr({ registry: e, hook: t }) {
1298
+ function Fr({ registry: e, hook: t }) {
1293
1299
  const n = U(), o = e.groupingEntries(t.rows);
1294
1300
  if (o.length === 0) return null;
1295
1301
  const { grouping: r, setGrouping: s } = t.publicSnapshot;
1296
- return /* @__PURE__ */ L("section", { className: d.groupingChoice, "aria-label": n.grouping, children: [
1297
- /* @__PURE__ */ l("h3", { className: d.groupingHeading, children: n.grouping }),
1298
- /* @__PURE__ */ l("div", { className: d.groupingOptions, children: o.map((i) => {
1302
+ return /* @__PURE__ */ O("section", { className: f.groupingChoice, "aria-label": n.grouping, children: [
1303
+ /* @__PURE__ */ l("h3", { className: f.groupingHeading, children: n.grouping }),
1304
+ /* @__PURE__ */ l("div", { className: f.groupingOptions, children: o.map((i) => {
1299
1305
  const { id: a, label: c } = i.spec, u = r.indexOf(a), h = u !== -1;
1300
- return /* @__PURE__ */ L(
1306
+ return /* @__PURE__ */ O(
1301
1307
  "button",
1302
1308
  {
1303
1309
  type: "button",
1304
- className: d.groupingOption,
1310
+ className: f.groupingOption,
1305
1311
  "aria-label": n.groupBy(c),
1306
1312
  "aria-pressed": h,
1307
1313
  disabled: !h && r.length >= Qe,
1308
- onClick: () => s(h ? r.filter((f) => f !== a) : [...r, a]),
1314
+ onClick: () => s(h ? r.filter((d) => d !== a) : [...r, a]),
1309
1315
  children: [
1310
- h && /* @__PURE__ */ l("span", { className: d.groupingLevel, "aria-hidden": "true", children: u + 1 }),
1316
+ h && /* @__PURE__ */ l("span", { className: f.groupingLevel, "aria-hidden": "true", children: u + 1 }),
1311
1317
  c
1312
1318
  ]
1313
1319
  },
@@ -1316,20 +1322,20 @@ function Tr({ registry: e, hook: t }) {
1316
1322
  }) })
1317
1323
  ] });
1318
1324
  }
1319
- function Fr({ registry: e, hook: t }) {
1325
+ function Or({ registry: e, hook: t }) {
1320
1326
  const n = U(), o = t.publicSnapshot, { grouping: r } = o;
1321
1327
  if (r.length === 0) return null;
1322
- const s = r.map((i) => Ar(e, t, i));
1328
+ const s = r.map((i) => Tr(e, t, i));
1323
1329
  return (
1324
1330
  /* In a tag group, as the conditions stand: the tag is one stop, its button
1325
1331
  the thing one tabs to, and the ring stands on the tag. */
1326
- /* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: d.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ L(
1332
+ /* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: f.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ O(
1327
1333
  At,
1328
1334
  {
1329
- trigger: /* @__PURE__ */ L("button", { type: "button", className: E(d.conditionButton, d.groupingTrigger), children: [
1330
- /* @__PURE__ */ l("span", { className: d.groupingPrefix, children: n.groupedBy }),
1331
- s.map((i, a) => /* @__PURE__ */ L("span", { className: d.groupingPath, children: [
1332
- a > 0 && /* @__PURE__ */ l("span", { className: d.groupingSeparator, "aria-hidden": "true", children: "›" }),
1335
+ trigger: /* @__PURE__ */ O("button", { type: "button", className: G(f.conditionButton, f.groupingTrigger), children: [
1336
+ /* @__PURE__ */ l("span", { className: f.groupingPrefix, children: n.groupedBy }),
1337
+ s.map((i, a) => /* @__PURE__ */ O("span", { className: f.groupingPath, children: [
1338
+ a > 0 && /* @__PURE__ */ l("span", { className: f.groupingSeparator, "aria-hidden": "true", children: "›" }),
1333
1339
  i
1334
1340
  ] }, r[a]))
1335
1341
  ] }),
@@ -1343,7 +1349,7 @@ function Fr({ registry: e, hook: t }) {
1343
1349
  ) }) })
1344
1350
  );
1345
1351
  }
1346
- function jt({
1352
+ function Ht({
1347
1353
  registry: e,
1348
1354
  className: t,
1349
1355
  children: n,
@@ -1352,56 +1358,56 @@ function jt({
1352
1358
  const r = U(), s = ue(), i = (e == null ? void 0 : e.hook) ?? null;
1353
1359
  let a = null, c = null;
1354
1360
  if (e && i) {
1355
- const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, f = o ? [] : u.filtered.filter((p) => u.selection.isSelected(i.rowKey(p))), b = e.hasRowActions() ? e.actions.ordered().filter((p) => p.spec.bulk) : [];
1356
- a = /* @__PURE__ */ L(J, { children: [
1357
- /* @__PURE__ */ l(Fr, { registry: e, hook: i }),
1358
- /* @__PURE__ */ l(kr, { registry: e, hook: i })
1359
- ] }), c = /* @__PURE__ */ L("div", { className: d.toolbarGroup, children: [
1360
- /* @__PURE__ */ l("span", { role: "status", className: d.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
1361
+ const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, d = o ? [] : u.filtered.filter((w) => u.selection.isSelected(i.rowKey(w))), m = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
1362
+ a = /* @__PURE__ */ O(Q, { children: [
1363
+ /* @__PURE__ */ l(Or, { registry: e, hook: i }),
1364
+ /* @__PURE__ */ l(_r, { registry: e, hook: i })
1365
+ ] }), c = /* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
1366
+ /* @__PURE__ */ l("span", { role: "status", className: f.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
1361
1367
  h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(u), children: r.resetAll }),
1362
- f.length > 0 && /* @__PURE__ */ L(J, { children: [
1363
- /* @__PURE__ */ l("span", { className: d.toolbarInfo, children: r.selectedCount(f.length, s.count(f.length)) }),
1364
- b.map(({ key: p, spec: k }) => /* @__PURE__ */ l(
1368
+ d.length > 0 && /* @__PURE__ */ O(Q, { children: [
1369
+ /* @__PURE__ */ l("span", { className: f.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
1370
+ m.map(({ key: w, spec: v }) => /* @__PURE__ */ l(
1365
1371
  ee,
1366
1372
  {
1367
1373
  size: "sm",
1368
- variant: k.tone === "danger" ? "danger" : "secondary",
1369
- onClick: () => k.onSelect(f),
1370
- children: k.label
1374
+ variant: v.tone === "danger" ? "danger" : "secondary",
1375
+ onClick: () => v.onSelect(d),
1376
+ children: v.label
1371
1377
  },
1372
- p
1378
+ w
1373
1379
  ))
1374
1380
  ] })
1375
1381
  ] });
1376
1382
  }
1377
- return /* @__PURE__ */ L("div", { className: E(d.toolbar, t), children: [
1378
- /* @__PURE__ */ L("div", { className: d.toolbarGroup, children: [
1383
+ return /* @__PURE__ */ O("div", { className: G(f.toolbar, t), children: [
1384
+ /* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
1379
1385
  n,
1380
1386
  a
1381
1387
  ] }),
1382
1388
  c
1383
1389
  ] });
1384
1390
  }
1385
- const $e = yt(null), Or = () => () => {
1391
+ const $e = kt(null), Rr = () => () => {
1386
1392
  }, ht = () => 0;
1387
1393
  function xe(e) {
1388
1394
  var r;
1389
- const t = Ue($e), n = e ? wr(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
1390
- Le(
1391
- n ? n.subscribe : Or,
1395
+ const t = Ue($e), n = e ? br(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
1396
+ Re(
1397
+ n ? n.subscribe : Rr,
1392
1398
  n ? n.bodyVersion : ht,
1393
1399
  n ? n.bodyVersion : ht
1394
1400
  );
1395
1401
  const o = (r = n == null ? void 0 : n.hook) == null ? void 0 : r.publicSnapshot;
1396
1402
  return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
1397
1403
  }
1398
- function Ht({ wording: e }) {
1399
- return /* @__PURE__ */ L(J, { children: [
1400
- /* @__PURE__ */ l("span", { "aria-hidden": "true", className: d.absent, children: "—" }),
1401
- /* @__PURE__ */ l(Re, { children: e.cellAbsentValue })
1404
+ function jt({ wording: e }) {
1405
+ return /* @__PURE__ */ O(Q, { children: [
1406
+ /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
1407
+ /* @__PURE__ */ l(Le, { children: e.cellAbsentValue })
1402
1408
  ] });
1403
1409
  }
1404
- const Lr = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Rr = (e, t) => ({
1410
+ const Lr = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Mr = (e, t) => ({
1405
1411
  sum: t.footerSum,
1406
1412
  avg: t.footerAverage,
1407
1413
  min: t.footerMinimum,
@@ -1419,33 +1425,33 @@ function Ke({
1419
1425
  }) {
1420
1426
  const { aggregate: s, format: i, presentation: a } = e.spec;
1421
1427
  if (!s) return null;
1422
- const c = typeof s == "function" ? "own" : s, u = Je({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (p) => _e(p, i, n, o);
1423
- let f;
1424
- if (Y(u)) f = /* @__PURE__ */ l(Ht, { wording: o });
1425
- else if (c === "range" && i === "date" && Mr(u)) {
1426
- const [p, k] = u;
1427
- f = p.getTime() === k.getTime() ? n.date(p) : o.rangeFromTo(n.dateShort(p), n.dateShort(k));
1428
- } else if (c === "count" || c === "distinct") f = n.count(u);
1428
+ const c = typeof s == "function" ? "own" : s, u = Xe({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (w) => ye(w, i, n, o);
1429
+ let d;
1430
+ if (Y(u)) d = /* @__PURE__ */ l(jt, { wording: o });
1431
+ else if (c === "range" && i === "date" && Vr(u)) {
1432
+ const [w, v] = u;
1433
+ d = w.getTime() === v.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(v));
1434
+ } else if (c === "count" || c === "distinct") d = n.count(u);
1429
1435
  else if (c === "range") {
1430
- const [p, k] = u;
1431
- f = h(p) === h(k) ? h(p) : o.rangeFromTo(h(p) ?? "", h(k) ?? "");
1432
- } else c === "own" && a ? f = a(u, t[0]) : f = h(u);
1433
- const b = Lr[c];
1434
- return /* @__PURE__ */ L(J, { children: [
1435
- r && b && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: d.footerKind, children: b }),
1436
- r && /* @__PURE__ */ L(Re, { children: [
1437
- Rr(c, o),
1436
+ const [w, v] = u;
1437
+ d = h(w) === h(v) ? h(w) : o.rangeFromTo(h(w) ?? "", h(v) ?? "");
1438
+ } else c === "own" && a ? d = a(u, t[0]) : d = h(u);
1439
+ const m = Lr[c];
1440
+ return /* @__PURE__ */ O(Q, { children: [
1441
+ r && m && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.footerKind, children: m }),
1442
+ r && /* @__PURE__ */ O(Le, { children: [
1443
+ Mr(c, o),
1438
1444
  " "
1439
1445
  ] }),
1440
- f
1446
+ d
1441
1447
  ] });
1442
1448
  }
1443
- const Mr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
1449
+ const Vr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
1444
1450
  function $t(e, t) {
1445
1451
  const n = e.spec.aggregate;
1446
1452
  return n === "count" || n === "distinct" ? !0 : e.spec.rightAligned !== void 0 ? e.spec.rightAligned : Ft(t, e.read) === "number";
1447
1453
  }
1448
- function Vr(e, t) {
1454
+ function Dr(e, t) {
1449
1455
  const n = /* @__PURE__ */ new Map();
1450
1456
  for (const [o, r] of t) {
1451
1457
  const s = e.get(o);
@@ -1457,39 +1463,39 @@ function Kt(e, t) {
1457
1463
  const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
1458
1464
  return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
1459
1465
  }
1460
- const Dr = (e) => {
1466
+ const Ir = (e) => {
1461
1467
  const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
1462
1468
  for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
1463
1469
  t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
1464
1470
  return t;
1465
1471
  };
1466
- function Ir(e, t) {
1467
- const n = Z(null);
1468
- K(() => {
1472
+ function Pr(e, t) {
1473
+ const n = re(null);
1474
+ W(() => {
1469
1475
  const o = e.current;
1470
1476
  if (!o) return;
1471
- const r = Dr(o), s = n.current;
1477
+ const r = Ir(o), s = n.current;
1472
1478
  if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
1473
1479
  const i = Kt(o, "--u-duration-medium");
1474
1480
  if (i === 0 || typeof o.animate != "function") return;
1475
- const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Vr(s.positions, r);
1481
+ const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Dr(s.positions, r);
1476
1482
  for (const u of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1477
- const h = u.dataset.motion, f = c.get(h);
1478
- f !== void 0 ? u.animate([{ transform: `translateY(${f}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
1483
+ const h = u.dataset.motion, d = c.get(h);
1484
+ d !== void 0 ? u.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
1479
1485
  }
1480
1486
  });
1481
1487
  }
1482
- function Pr(e, t, n) {
1483
- const o = Z(t);
1484
- K(() => {
1488
+ function Br(e, t, n) {
1489
+ const o = re(t);
1490
+ W(() => {
1485
1491
  const r = e.current, s = o.current;
1486
1492
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1487
1493
  const i = Kt(r, "--u-duration-medium");
1488
1494
  if (i === 0) return;
1489
1495
  const a = performance.now();
1490
1496
  let c = requestAnimationFrame(function u(h) {
1491
- const f = Math.min(1, (h - a) / i), b = 1 - (1 - f) ** 3;
1492
- r.textContent = n(Math.round(s + (t - s) * b)), f < 1 && (c = requestAnimationFrame(u));
1497
+ const d = Math.min(1, (h - a) / i), m = 1 - (1 - d) ** 3;
1498
+ r.textContent = n(Math.round(s + (t - s) * m)), d < 1 && (c = requestAnimationFrame(u));
1493
1499
  });
1494
1500
  return () => {
1495
1501
  cancelAnimationFrame(c), r.textContent = n(t);
@@ -1499,73 +1505,65 @@ function Pr(e, t, n) {
1499
1505
  function Ve(e, t, n, o) {
1500
1506
  if (t === void 0) return o.groupNoValue;
1501
1507
  const r = e == null ? void 0 : e.spec;
1502
- if (r != null && r.group && t instanceof Date) return pn(r.group, t, n, o);
1508
+ if (r != null && r.group && t instanceof Date) return mn(r.group, t, n, o);
1503
1509
  const s = r != null && r.ownGroupValue || r == null ? void 0 : r.format;
1504
- return _e(t, s, n, o) ?? String(t);
1510
+ return ye(t, s, n, o) ?? String(t);
1505
1511
  }
1506
1512
  function We({ entry: e, group: t, formats: n, wording: o }) {
1507
1513
  const r = e == null ? void 0 : e.spec;
1508
- return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(J, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(J, { children: Ve(e, t.value, n, o) });
1514
+ return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(Q, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(Q, { children: Ve(e, t.value, n, o) });
1509
1515
  }
1510
1516
  function qe({
1511
1517
  group: e,
1512
1518
  parent: t,
1513
1519
  entry: n,
1514
1520
  open: o,
1515
- registry: r,
1516
- hook: s,
1517
- formats: i,
1518
- wording: a
1521
+ hook: r,
1522
+ formats: s,
1523
+ wording: i
1519
1524
  }) {
1520
- const c = Z(null);
1521
- K(() => {
1522
- c.current && r.takeFoldFocus(e.path) && c.current.focus();
1523
- });
1524
- const u = Ve(n, e.value, i, a), h = i.count(e.rows.length), f = () => {
1525
- r.requestFoldFocus(e.path), s.publicSnapshot.toggleFold(e.path);
1526
- }, b = (p) => {
1527
- if (p.altKey && (p.key === "ArrowLeft" || p.key === "ArrowRight")) {
1528
- p.preventDefault(), r.requestFoldFocus(e.path), gt(e, p.key === "ArrowLeft", s);
1525
+ const a = Ve(n, e.value, s, i), c = s.count(e.rows.length), u = () => r.publicSnapshot.toggleFold(e.path), h = (d) => {
1526
+ if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
1527
+ d.preventDefault(), gt(e, d.key === "ArrowLeft", r);
1529
1528
  return;
1530
1529
  }
1531
- if (p.key === "ArrowRight" && !o)
1532
- p.preventDefault(), f();
1533
- else if (p.key === "ArrowLeft") {
1534
- if (p.preventDefault(), o) f();
1530
+ if (d.key === "ArrowRight" && !o)
1531
+ d.preventDefault(), u();
1532
+ else if (d.key === "ArrowLeft") {
1533
+ if (d.preventDefault(), o) u();
1535
1534
  else if (t) {
1536
- const k = p.currentTarget.closest("table"), m = Array.from((k == null ? void 0 : k.querySelectorAll("[data-fold-path]")) ?? []).find(
1537
- (w) => w.dataset.foldPath === t.path
1535
+ const m = d.currentTarget.closest("table"), w = Array.from((m == null ? void 0 : m.querySelectorAll("[data-fold-path]")) ?? []).find(
1536
+ (v) => v.dataset.foldPath === t.path
1538
1537
  );
1539
- m == null || m.focus();
1538
+ w == null || w.focus();
1540
1539
  }
1541
1540
  }
1542
1541
  };
1543
1542
  return /* @__PURE__ */ l(
1544
1543
  "button",
1545
1544
  {
1546
- ref: c,
1547
1545
  type: "button",
1548
- className: E(d.fold, !o && d.foldClosed),
1546
+ className: G(f.fold, !o && f.foldClosed),
1549
1547
  "data-fold-path": e.path,
1550
1548
  "aria-expanded": o,
1551
- "aria-label": o ? a.foldGroup(u, h) : a.unfoldGroup(u, h),
1552
- onKeyDown: b,
1553
- onClick: (p) => {
1554
- if (!p.altKey) return f();
1555
- r.requestFoldFocus(e.path), gt(e, o, s);
1549
+ "aria-label": o ? i.foldGroup(a, c) : i.unfoldGroup(a, c),
1550
+ onKeyDown: h,
1551
+ onClick: (d) => {
1552
+ if (!d.altKey) return u();
1553
+ gt(e, o, r);
1556
1554
  },
1557
- children: /* @__PURE__ */ l("svg", { viewBox: "0 0 12 12", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3 4.5 6 7.5 9 4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
1555
+ children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2.5 3.75 5 6.25 7.5 3.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
1558
1556
  }
1559
1557
  );
1560
1558
  }
1561
1559
  function Gr({ value: e, formats: t }) {
1562
- const n = Z(null);
1563
- return Pr(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: d.groupCount, children: t.count(e) });
1560
+ const n = re(null);
1561
+ return Br(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: f.groupCount, children: t.count(e) });
1564
1562
  }
1565
1563
  function Ye({ group: e, entry: t, hook: n, formats: o, wording: r }) {
1566
1564
  const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((u) => s.isSelected(u)).length, c = a === i.length;
1567
1565
  return /* @__PURE__ */ l(
1568
- Se,
1566
+ Ce,
1569
1567
  {
1570
1568
  "aria-label": r.selectGroup(Ve(t, e.value, o, r)),
1571
1569
  checked: c,
@@ -1589,20 +1587,19 @@ function Er({
1589
1587
  line: e,
1590
1588
  entry: t,
1591
1589
  selectable: n,
1592
- registry: o,
1593
- hook: r,
1594
- formats: s,
1595
- wording: i
1590
+ hook: o,
1591
+ formats: r,
1592
+ wording: s
1596
1593
  }) {
1597
- const a = e.span;
1598
- return /* @__PURE__ */ l("td", { className: E(d.td, d.spanCell), children: e.first && /* @__PURE__ */ L("span", { className: d.spanValue, children: [
1599
- n && /* @__PURE__ */ l("span", { className: d.spanSelect, children: /* @__PURE__ */ l(Ye, { group: a, entry: t, hook: r, formats: s, wording: i }) }),
1600
- /* @__PURE__ */ l(qe, { group: a, parent: e.parents.at(-1), entry: t, open: !0, registry: o, hook: r, formats: s, wording: i }),
1601
- /* @__PURE__ */ L("span", { className: d.spanText, title: Ve(t, a.value, s, i), children: [
1602
- /* @__PURE__ */ l(We, { entry: t, group: a, formats: s, wording: i }),
1603
- e.continued && /* @__PURE__ */ l("span", { className: d.continued, children: i.groupContinued })
1594
+ const i = e.span;
1595
+ return /* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: e.first && /* @__PURE__ */ O("span", { className: f.spanValue, children: [
1596
+ n && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: i, entry: t, hook: o, formats: r, wording: s }) }),
1597
+ /* @__PURE__ */ l(qe, { group: i, parent: e.parents.at(-1), entry: t, open: !0, hook: o, formats: r, wording: s }),
1598
+ /* @__PURE__ */ O("span", { className: f.spanText, title: Ve(t, i.value, r, s), children: [
1599
+ /* @__PURE__ */ l(We, { entry: t, group: i, formats: r, wording: s }),
1600
+ e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: s.groupContinued })
1604
1601
  ] }),
1605
- /* @__PURE__ */ l("span", { className: d.groupCount, children: s.count(a.rows.length) })
1602
+ /* @__PURE__ */ l("span", { className: f.groupCount, children: r.count(i.rows.length) })
1606
1603
  ] }) });
1607
1604
  }
1608
1605
  function pt({
@@ -1617,64 +1614,64 @@ function pt({
1617
1614
  hasActions: c,
1618
1615
  total: u,
1619
1616
  siblings: h,
1620
- depth: f,
1621
- registry: b,
1622
- hook: p,
1623
- formats: k,
1624
- wording: m
1617
+ depth: d,
1618
+ hook: m,
1619
+ formats: w,
1620
+ wording: v
1625
1621
  }) {
1626
- const { group: w } = e, g = e.kind === "header", v = g && !p.publicSnapshot.folded.includes(w.path), N = s.findIndex((S) => S.spec.aggregate !== void 0), C = N === -1 ? s.length : N, D = s.slice(C), T = s.find((S) => S.spec.aggregate === "sum" && S.spec.share !== !1), x = n !== void 0, _ = /* @__PURE__ */ L("span", { className: d.groupLabel, children: [
1627
- /* @__PURE__ */ l(qe, { group: w, parent: e.parents.at(-1), entry: r, open: v, registry: b, hook: p, formats: k, wording: m }),
1628
- /* @__PURE__ */ l("span", { className: d.groupValue, children: /* @__PURE__ */ l(We, { entry: r, group: w, formats: k, wording: m }) }),
1629
- /* @__PURE__ */ l(Gr, { value: w.rows.length, formats: k }),
1630
- g && e.continued && /* @__PURE__ */ l("span", { className: d.continued, children: m.groupContinued })
1622
+ const { group: p } = e, b = e.kind === "header", g = b && !m.publicSnapshot.folded.includes(p.path), y = s.findIndex((_) => _.spec.aggregate !== void 0), S = y === -1 ? s.length : y, C = s.slice(S), I = s.find((_) => _.spec.aggregate === "sum" && _.spec.share !== !1), x = n !== void 0, A = /* @__PURE__ */ O("span", { className: f.groupLabel, children: [
1623
+ /* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: r, open: g, hook: m, formats: w, wording: v }),
1624
+ /* @__PURE__ */ l("span", { className: f.groupValue, children: /* @__PURE__ */ l(We, { entry: r, group: p, formats: w, wording: v }) }),
1625
+ /* @__PURE__ */ l(Gr, { value: p.rows.length, formats: w }),
1626
+ b && e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: v.groupContinued })
1631
1627
  ] });
1632
- return /* @__PURE__ */ L(
1628
+ return /* @__PURE__ */ O(
1633
1629
  "tr",
1634
1630
  {
1635
- className: E(g ? d.groupHeader : d.groupFolded, x && d.virtualRow),
1631
+ className: G(b ? f.groupHeader : f.groupFolded, x && f.virtualRow),
1636
1632
  "data-line": e.kind,
1637
- "data-level": w.level,
1638
- "data-motion": n !== void 0 || !(g && e.continued) ? `${e.kind}:${w.path}` : void 0,
1639
- "data-continued": g && e.continued ? "" : void 0,
1640
- "data-group-first": g ? void 0 : "",
1633
+ "data-level": p.level,
1634
+ "data-motion": n !== void 0 || !(b && e.continued) ? `${e.kind}:${p.path}` : void 0,
1635
+ "data-continued": b && e.continued ? "" : void 0,
1636
+ "data-group-first": b ? void 0 : "",
1637
+ "data-group": p.path,
1641
1638
  "data-row": x ? n : void 0,
1642
1639
  "aria-rowindex": x ? n + 2 : void 0,
1643
1640
  "data-index": t,
1644
- style: g ? { "--u-header-level": w.level } : void 0,
1645
- "aria-level": g ? w.level + 1 : f,
1646
- "aria-expanded": v,
1647
- "aria-posinset": h.indexOf(w) + 1 || void 0,
1641
+ style: b ? { "--u-header-level": p.level } : void 0,
1642
+ "aria-level": b ? p.level + 1 : d,
1643
+ "aria-expanded": g,
1644
+ "aria-posinset": h.indexOf(p) + 1 || void 0,
1648
1645
  "aria-setsize": h.length || void 0,
1649
1646
  children: [
1650
- Array.from({ length: i }, (S, O) => /* @__PURE__ */ l("td", { className: E(d.td, d.control), children: O === 0 && a && g && /* @__PURE__ */ l(Ye, { group: w, entry: r, hook: p, formats: k, wording: m }) }, `c${O}`)),
1651
- g ? /* @__PURE__ */ l("td", { className: d.td, colSpan: (o ? 1 : 0) + C, style: { paddingLeft: `calc(var(--u-space-3) + ${w.level * 20}px)` }, children: _ }) : /* @__PURE__ */ L(J, { children: [
1652
- /* @__PURE__ */ l("td", { className: E(d.td, d.spanCell), children: /* @__PURE__ */ L("span", { className: d.spanValue, children: [
1653
- a && /* @__PURE__ */ l("span", { className: d.spanSelect, children: /* @__PURE__ */ l(Ye, { group: w, entry: o, hook: p, formats: k, wording: m }) }),
1654
- /* @__PURE__ */ l(qe, { group: w, parent: e.parents.at(-1), entry: o, open: !1, registry: b, hook: p, formats: k, wording: m }),
1655
- /* @__PURE__ */ l("span", { className: d.spanText, children: /* @__PURE__ */ l(We, { entry: o, group: w, formats: k, wording: m }) }),
1656
- /* @__PURE__ */ l("span", { className: d.groupCount, children: k.count(w.rows.length) })
1647
+ Array.from({ length: i }, (_, F) => /* @__PURE__ */ l("td", { className: G(f.td, f.control), children: F === 0 && a && b && /* @__PURE__ */ l(Ye, { group: p, entry: r, hook: m, formats: w, wording: v }) }, `c${F}`)),
1648
+ b ? /* @__PURE__ */ l("td", { className: f.td, colSpan: (o ? 1 : 0) + S, style: { paddingLeft: `calc(var(--u-space-3) + ${p.level * 20}px)` }, children: A }) : /* @__PURE__ */ O(Q, { children: [
1649
+ /* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: /* @__PURE__ */ O("span", { className: f.spanValue, children: [
1650
+ a && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: p, entry: o, hook: m, formats: w, wording: v }) }),
1651
+ /* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: o, open: !1, hook: m, formats: w, wording: v }),
1652
+ /* @__PURE__ */ l("span", { className: f.spanText, children: /* @__PURE__ */ l(We, { entry: o, group: p, formats: w, wording: v }) }),
1653
+ /* @__PURE__ */ l("span", { className: f.groupCount, children: w.count(p.rows.length) })
1657
1654
  ] }) }),
1658
- C > 0 && /* @__PURE__ */ l("td", { className: E(d.td, d.foldedCount), colSpan: C, children: m.entries(w.rows.length, k.count(w.rows.length)) })
1655
+ S > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.foldedCount), colSpan: S, children: v.entries(p.rows.length, w.count(p.rows.length)) })
1659
1656
  ] }),
1660
- D.map((S) => /* @__PURE__ */ l(
1661
- Br,
1657
+ C.map((_) => /* @__PURE__ */ l(
1658
+ zr,
1662
1659
  {
1663
- entry: S,
1664
- group: w,
1665
- share: g && S === T,
1660
+ entry: _,
1661
+ group: p,
1662
+ share: b && _ === I,
1666
1663
  total: u,
1667
- formats: k,
1668
- wording: m
1664
+ formats: w,
1665
+ wording: v
1669
1666
  },
1670
- S.key
1667
+ _.key
1671
1668
  )),
1672
- c && /* @__PURE__ */ l("td", { className: d.td })
1669
+ c && /* @__PURE__ */ l("td", { className: f.td })
1673
1670
  ]
1674
1671
  }
1675
1672
  );
1676
1673
  }
1677
- function Br({
1674
+ function zr({
1678
1675
  entry: e,
1679
1676
  group: t,
1680
1677
  share: n,
@@ -1683,21 +1680,21 @@ function Br({
1683
1680
  wording: s
1684
1681
  }) {
1685
1682
  const { spec: i } = e;
1686
- if (!i.aggregate) return /* @__PURE__ */ l("td", { className: d.td });
1683
+ if (!i.aggregate) return /* @__PURE__ */ l("td", { className: f.td });
1687
1684
  let a = null;
1688
1685
  if (n && i.aggregate === "sum" && i.share !== !1) {
1689
- const c = Je({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
1686
+ const c = Xe({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
1690
1687
  if (typeof c == "number" && c > 0 && typeof u == "number" && u > 0) {
1691
1688
  const h = Math.min(1, u / c);
1692
- a = /* @__PURE__ */ l("span", { className: d.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
1689
+ a = /* @__PURE__ */ l("span", { className: f.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
1693
1690
  }
1694
1691
  }
1695
- return /* @__PURE__ */ l("td", { className: E(d.td, $t(e, t.rows) && d.numeric, d.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ L("span", { className: d.shareHost, children: [
1692
+ return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t.rows) && f.numeric, f.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ O("span", { className: f.shareHost, children: [
1696
1693
  /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }),
1697
1694
  a
1698
1695
  ] }) : /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }) });
1699
1696
  }
1700
- function zr(e) {
1697
+ function Hr(e) {
1701
1698
  const t = typeof e.value == "string" ? e.value : void 0;
1702
1699
  let n = e.id ?? t;
1703
1700
  return n === void 0 && (pe(`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 && pe(`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" && pe(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
@@ -1725,45 +1722,45 @@ function zr(e) {
1725
1722
  function jr(e, t, n, o, r) {
1726
1723
  if (!t) return n.rowKey(e);
1727
1724
  const s = t.read(e);
1728
- return Y(s) ? r.cellAbsentValue : _e(s, t.spec.format, o, r) ?? n.rowKey(e);
1725
+ return Y(s) ? r.cellAbsentValue : ye(s, t.spec.format, o, r) ?? n.rowKey(e);
1729
1726
  }
1730
1727
  const Oe = 34;
1731
- function Hr(e) {
1728
+ function $r(e) {
1732
1729
  function t(c) {
1733
- const u = se(), h = Ue($e), f = zr(c);
1734
- return e.registerColumn(u, f), K(
1730
+ const u = se(), h = Ue($e), d = Hr(c);
1731
+ return e.registerColumn(u, d), W(
1735
1732
  () => () => {
1736
1733
  e.removeColumn(u), e.commit();
1737
1734
  },
1738
1735
  [u]
1739
- ), K(() => {
1740
- e.ensureColumn(u, f), e.checkOrder(), e.commit();
1736
+ ), W(() => {
1737
+ e.ensureColumn(u, d), e.checkOrder(), e.commit();
1741
1738
  }), Mt && h && h.registry !== e && pe(
1742
- `foreign:${f.id}`,
1743
- `The column "${f.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
1739
+ `foreign:${d.id}`,
1740
+ `The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
1744
1741
  ), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-column": u });
1745
1742
  }
1746
1743
  function n({ children: c }) {
1747
1744
  const u = se();
1748
- return e.registerDetail(u, c), K(
1745
+ return e.registerDetail(u, c), W(
1749
1746
  () => () => {
1750
1747
  e.removeDetail(u), e.commit();
1751
1748
  },
1752
1749
  [u]
1753
- ), K(() => {
1750
+ ), W(() => {
1754
1751
  e.detail || e.registerDetail(u, c), e.commit();
1755
1752
  }), null;
1756
1753
  }
1757
1754
  function o({ children: c }) {
1758
1755
  const u = se();
1759
- return e.registerActionGroup(u), K(
1756
+ return e.registerActionGroup(u), W(
1760
1757
  () => () => {
1761
1758
  e.removeActionGroup(u), e.commit();
1762
1759
  },
1763
1760
  [u]
1764
- ), K(() => {
1761
+ ), W(() => {
1765
1762
  e.registerActionGroup(u), e.commit();
1766
- }), /* @__PURE__ */ l(J, { children: c });
1763
+ }), /* @__PURE__ */ l(Q, { children: c });
1767
1764
  }
1768
1765
  function r(c) {
1769
1766
  const u = se(), h = {
@@ -1772,17 +1769,17 @@ function Hr(e) {
1772
1769
  tone: c.tone ?? "default",
1773
1770
  onSelect: c.onSelect
1774
1771
  };
1775
- return e.registerAction(u, h), K(
1772
+ return e.registerAction(u, h), W(
1776
1773
  () => () => {
1777
1774
  e.removeAction(u), e.commit();
1778
1775
  },
1779
1776
  [u]
1780
- ), K(() => {
1777
+ ), W(() => {
1781
1778
  e.ensureAction(u, h), e.checkOrder(), e.commit();
1782
1779
  }), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-action": u });
1783
1780
  }
1784
1781
  function s(c) {
1785
- const u = se(), h = typeof c.value == "string" ? c.value : void 0, b = {
1782
+ const u = se(), h = typeof c.value == "string" ? c.value : void 0, m = {
1786
1783
  id: c.id ?? h ?? c.label,
1787
1784
  label: c.label,
1788
1785
  value: c.value,
@@ -1792,36 +1789,36 @@ function Hr(e) {
1792
1789
  group: c.group,
1793
1790
  groupable: !0
1794
1791
  };
1795
- return e.registerGroupKey(u, b), K(
1792
+ return e.registerGroupKey(u, m), W(
1796
1793
  () => () => {
1797
1794
  e.removeGroupKey(u), e.commit();
1798
1795
  },
1799
1796
  [u]
1800
- ), K(() => {
1801
- e.ensureGroupKey(u, b), e.checkOrder(), e.commit();
1797
+ ), W(() => {
1798
+ e.ensureGroupKey(u, m), e.checkOrder(), e.commit();
1802
1799
  }), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-groupkey": u });
1803
1800
  }
1804
1801
  function i(c) {
1805
1802
  e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1);
1806
- const u = Z(null), [h, f] = z(null);
1807
- K(() => {
1803
+ const u = re(null), [h, d] = j(null);
1804
+ W(() => {
1808
1805
  e.children = u.current, e.checkOrder(), e.commit();
1809
1806
  });
1810
- const b = j(() => ({ registry: e, footerTarget: h }), [h]);
1811
- return /* @__PURE__ */ l($e.Provider, { value: b, children: /* @__PURE__ */ L("div", { className: E(d.frame, c.className), children: [
1812
- /* @__PURE__ */ l("div", { ref: u, className: d.children, children: c.children }),
1813
- /* @__PURE__ */ l($r, { registry: e }),
1814
- /* @__PURE__ */ l(Kr, { registry: e, props: c }),
1815
- /* @__PURE__ */ l("div", { ref: f, className: d.footerTarget })
1807
+ const m = $(() => ({ registry: e, footerTarget: h }), [h]);
1808
+ return /* @__PURE__ */ l($e.Provider, { value: m, children: /* @__PURE__ */ O("div", { className: G(f.frame, c.className), children: [
1809
+ /* @__PURE__ */ l("div", { ref: u, className: f.children, children: c.children }),
1810
+ /* @__PURE__ */ l(Kr, { registry: e }),
1811
+ /* @__PURE__ */ l(Wr, { registry: e, props: c }),
1812
+ /* @__PURE__ */ l("div", { ref: d, className: f.footerTarget })
1816
1813
  ] }) });
1817
1814
  }
1818
1815
  const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
1819
- return mr(i, e), a;
1816
+ return wr(i, e), a;
1820
1817
  }
1821
- function $r({ registry: e }) {
1822
- return Le(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ l(jt, { registry: e, own: !0 });
1818
+ function Kr({ registry: e }) {
1819
+ return Re(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ l(Ht, { registry: e, own: !0 });
1823
1820
  }
1824
- function Kr({ registry: e, props: t }) {
1821
+ function Wr({ registry: e, props: t }) {
1825
1822
  const {
1826
1823
  selectable: n = !1,
1827
1824
  stickyHeader: o = !1,
@@ -1832,199 +1829,205 @@ function Kr({ registry: e, props: t }) {
1832
1829
  empty: c,
1833
1830
  loading: u = !1,
1834
1831
  rowProps: h,
1835
- ariaLabel: f
1832
+ ariaLabel: d
1836
1833
  } = t;
1837
- Le(e.subscribe, e.bodyVersion, e.bodyVersion);
1838
- const b = U(), p = ue(), k = Tt(i, "regular"), m = se(), w = Z(null);
1839
- K(() => {
1834
+ Re(e.subscribe, e.bodyVersion, e.bodyVersion);
1835
+ const m = U(), w = ue(), v = Tt(i, "regular"), p = se(), b = re(null);
1836
+ W(() => {
1840
1837
  var H, M;
1841
- const y = w.current;
1842
- if (!y || !o) return;
1843
- const R = ((H = y.tHead) == null ? void 0 : H.getBoundingClientRect().height) ?? 0, q = ((M = y.querySelector("tr[data-line='header']")) == null ? void 0 : M.getBoundingClientRect().height) ?? 0;
1844
- y.style.setProperty("--u-table-head", `${R}px`), y.style.setProperty("--u-table-group-header", `${q}px`), y.parentElement && mt(y.parentElement);
1838
+ const k = b.current;
1839
+ if (!k || !o) return;
1840
+ const L = ((H = k.tHead) == null ? void 0 : H.getBoundingClientRect().height) ?? 0, K = ((M = k.querySelector("tr[data-line='header']")) == null ? void 0 : M.getBoundingClientRect().height) ?? 0;
1841
+ k.style.setProperty("--u-table-head", `${L}px`), k.style.setProperty("--u-table-group-header", `${K}px`), k.parentElement && mt(k.parentElement);
1842
+ }), W(() => {
1843
+ const k = e.takeFocusBeforeFold(), L = b.current;
1844
+ if (!k || !L || k.table !== L || k.element.isConnected) return;
1845
+ const K = Array.from(L.querySelectorAll("[data-fold-path]")), H = JSON.parse(k.group);
1846
+ for (let M = H.length; M > 0; M--) {
1847
+ const J = JSON.stringify(H.slice(0, M)), Z = K.find((T) => T.dataset.foldPath === J);
1848
+ if (Z) return Z.focus();
1849
+ }
1845
1850
  });
1846
1851
  const g = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
1847
- Ir(w, g ? `${g.grouping.join("|")}#${g.folded.join("|")}` : "");
1848
- const v = e.hook;
1849
- if (!v) return null;
1850
- const N = v.publicSnapshot, C = e.projection(), D = e.rowHeader(), T = Bt(e), x = e.detail, _ = e.hasRowActions() ? e.actions.ordered() : [], S = v.companion.virtual, O = N.grouping, A = O.length > 0 ? C.visibleLines : void 0, I = A ? e.groupingEntries(v.rows) : [], $ = (y) => I.find((R) => R.spec.id === y), G = A && O.length > 1 ? $(O.at(-1)) : void 0, W = A ? T.filter((y) => !O.includes(y.spec.id)) : T, ie = (n ? 1 : 0) + (x ? 1 : 0), ae = ie + (G ? 1 : 0) + W.length + (_.length > 0 ? 1 : 0), de = ie * Oe, fe = (y) => r && y === D, we = C.visible, be = !u && W.some((y) => y.spec.aggregate), ye = N.search !== "" || Object.keys(N.filter).length > 0, le = (y, R, q, H) => /* @__PURE__ */ l(
1851
- Wr,
1852
+ Pr(b, g ? `${g.grouping.join("|")}#${g.folded.join("|")}` : "");
1853
+ const y = e.hook;
1854
+ if (!y) return null;
1855
+ const S = y.publicSnapshot, C = e.projection(), I = e.rowHeader(), x = Et(e), A = e.detail, _ = e.hasRowActions() ? e.actions.ordered() : [], F = y.companion.virtual, R = S.grouping, N = R.length > 0 ? C.visibleLines : void 0, V = N ? e.groupingEntries(y.rows) : [], z = (k) => V.find((L) => L.spec.id === k), B = N && R.length > 1 ? z(R.at(-1)) : void 0, q = N ? x.filter((k) => !R.includes(k.spec.id)) : x, ie = (n ? 1 : 0) + (A ? 1 : 0), ae = ie + (B ? 1 : 0) + q.length + (_.length > 0 ? 1 : 0), de = ie * Oe, fe = (k) => r && k === I, we = C.visible, be = !u && q.some((k) => k.spec.aggregate), ke = S.search !== "" || Object.keys(S.filter).length > 0, le = (k, L, K, H) => /* @__PURE__ */ l(
1856
+ qr,
1852
1857
  {
1853
- row: y,
1854
- index: R,
1855
- absolute: S ? q : void 0,
1858
+ row: k,
1859
+ index: L,
1860
+ absolute: F ? K : void 0,
1856
1861
  registry: e,
1857
- hook: v,
1858
- columns: W,
1862
+ hook: y,
1863
+ columns: q,
1859
1864
  line: H,
1860
- spanEntry: G,
1861
- header: D,
1865
+ spanEntry: B,
1866
+ header: I,
1862
1867
  selectable: n,
1863
1868
  actions: _,
1864
1869
  stickyRowHeader: r,
1865
1870
  rowHeaderLeft: de,
1866
1871
  columnCount: ae,
1867
1872
  rowProps: h,
1868
- baseId: m,
1869
- formats: p,
1870
- wording: b
1873
+ baseId: p,
1874
+ formats: w,
1875
+ wording: m
1871
1876
  },
1872
- v.rowKey(y)
1877
+ y.rowKey(k)
1873
1878
  );
1874
1879
  let te;
1875
1880
  if (u)
1876
- te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(Jr, { columns: ae }) });
1881
+ te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(Qr, { columns: ae }) });
1877
1882
  else if (C.filtered.length === 0)
1878
- te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className: d.emptyCell, children: /* @__PURE__ */ l("div", { className: d.empty, children: v.admitted.length > 0 && ye ? /* @__PURE__ */ L(J, { children: [
1879
- /* @__PURE__ */ l("p", { className: d.emptyTitle, children: b.nothingMatchesFilters }),
1880
- /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(N), children: b.resetAll })
1881
- ] }) : c ?? /* @__PURE__ */ l("p", { className: d.emptyTitle, children: b.noEntries }) }) }) }) });
1882
- else if (A) {
1883
- const y = S ? Rt(A).map((M) => M.kind === "folded" || !M.continued ? M : { ...M, continued: !1 }) : A, R = y.length - A.length, q = S && S.from > 0 ? S.fillerBefore / S.from : 0, H = (M, Q) => {
1884
- var V, B;
1885
- const ne = Q - R, F = S ? S.from + ne : ne;
1886
- return ne < 0 ? M.kind === "row" ? null : /* @__PURE__ */ l(
1883
+ te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className: f.emptyCell, children: /* @__PURE__ */ l("div", { className: f.empty, children: y.admitted.length > 0 && ke ? /* @__PURE__ */ O(Q, { children: [
1884
+ /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.nothingMatchesFilters }),
1885
+ /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(S), children: m.resetAll })
1886
+ ] }) : c ?? /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.noEntries }) }) }) }) });
1887
+ else if (N) {
1888
+ const k = F ? Lt(N).map((M) => M.kind === "folded" || !M.continued ? M : { ...M, continued: !1 }) : N, L = k.length - N.length, K = F && F.from > 0 ? F.fillerBefore / F.from : 0, H = (M, J) => {
1889
+ var D, E;
1890
+ const Z = J - L, T = F ? F.from + Z : Z;
1891
+ return Z < 0 ? M.kind === "row" ? null : /* @__PURE__ */ l(
1887
1892
  pt,
1888
1893
  {
1889
1894
  line: M,
1890
- index: Q,
1895
+ index: J,
1891
1896
  absolute: void 0,
1892
- spanEntry: G,
1893
- levelEntry: $(O[M.group.level]),
1894
- columns: W,
1897
+ spanEntry: B,
1898
+ levelEntry: z(R[M.group.level]),
1899
+ columns: q,
1895
1900
  controlColumns: ie,
1896
1901
  selectable: n,
1897
1902
  hasActions: _.length > 0,
1898
1903
  total: C.filtered,
1899
- siblings: ((V = M.parents.at(-1)) == null ? void 0 : V.groups) ?? C.groups ?? [],
1900
- depth: O.length,
1901
- registry: e,
1902
- hook: v,
1903
- formats: p,
1904
- wording: b
1904
+ siblings: ((D = M.parents.at(-1)) == null ? void 0 : D.groups) ?? C.groups ?? [],
1905
+ depth: R.length,
1906
+ hook: y,
1907
+ formats: w,
1908
+ wording: m
1905
1909
  },
1906
1910
  `${M.kind}:${M.group.path}:repeated`
1907
- ) : M.kind === "row" ? le(M.row, ne, F, M) : /* @__PURE__ */ l(
1911
+ ) : M.kind === "row" ? le(M.row, Z, T, M) : /* @__PURE__ */ l(
1908
1912
  pt,
1909
1913
  {
1910
1914
  line: M,
1911
- index: ne,
1912
- absolute: S ? F : void 0,
1913
- spanEntry: G,
1914
- levelEntry: $(O[M.group.level]),
1915
- columns: W,
1915
+ index: Z,
1916
+ absolute: F ? T : void 0,
1917
+ spanEntry: B,
1918
+ levelEntry: z(R[M.group.level]),
1919
+ columns: q,
1916
1920
  controlColumns: ie,
1917
1921
  selectable: n,
1918
1922
  hasActions: _.length > 0,
1919
1923
  total: C.filtered,
1920
- siblings: ((B = M.parents.at(-1)) == null ? void 0 : B.groups) ?? C.groups ?? [],
1921
- depth: O.length,
1922
- registry: e,
1923
- hook: v,
1924
- formats: p,
1925
- wording: b
1924
+ siblings: ((E = M.parents.at(-1)) == null ? void 0 : E.groups) ?? C.groups ?? [],
1925
+ depth: R.length,
1926
+ hook: y,
1927
+ formats: w,
1928
+ wording: m
1926
1929
  },
1927
1930
  `${M.kind}:${M.group.path}${M.kind === "header" && M.continued ? ":continued" : ""}`
1928
1931
  );
1929
1932
  };
1930
- te = S ? /* @__PURE__ */ l(
1931
- kt,
1933
+ te = F ? /* @__PURE__ */ l(
1934
+ vt,
1932
1935
  {
1933
- virtual: { ...S, fillerBefore: Math.max(0, S.fillerBefore - R * q) },
1936
+ virtual: { ...F, fillerBefore: Math.max(0, F.fillerBefore - L * K) },
1934
1937
  colSpan: ae,
1935
- children: y.map(H)
1938
+ children: k.map(H)
1936
1939
  }
1937
- ) : /* @__PURE__ */ l("tbody", { children: A.map(H) });
1938
- } else S ? te = /* @__PURE__ */ l(kt, { virtual: S, colSpan: ae, children: we.map((y, R) => le(y, R, S.from + R)) }) : te = /* @__PURE__ */ l("tbody", { children: we.map((y, R) => le(y, R, R)) });
1940
+ ) : /* @__PURE__ */ l("tbody", { children: N.map(H) });
1941
+ } else F ? te = /* @__PURE__ */ l(vt, { virtual: F, colSpan: ae, children: we.map((k, L) => le(k, L, F.from + L)) }) : te = /* @__PURE__ */ l("tbody", { children: we.map((k, L) => le(k, L, L)) });
1939
1942
  return /* @__PURE__ */ l(
1940
1943
  "div",
1941
1944
  {
1942
- ref: S == null ? void 0 : S.scrollRef,
1943
- onScroll: (y) => {
1944
- S == null || S.onScroll(), A && o && mt(y.currentTarget);
1945
+ ref: F == null ? void 0 : F.scrollRef,
1946
+ onScroll: (k) => {
1947
+ F == null || F.onScroll(), N && o && mt(k.currentTarget);
1945
1948
  },
1946
- className: d.scroll,
1949
+ className: f.scroll,
1947
1950
  style: a ? { maxHeight: a } : void 0,
1948
- children: /* @__PURE__ */ L(
1951
+ children: /* @__PURE__ */ O(
1949
1952
  "table",
1950
1953
  {
1951
- ref: w,
1952
- role: A ? "treegrid" : void 0,
1953
- "data-depth": A ? O.length : void 0,
1954
- style: A ? { "--u-header-levels": O.length - 1 } : void 0,
1955
- "aria-label": f,
1956
- "aria-rowcount": S ? (C.lines ?? C.filtered).length + 1 + (be ? 1 : 0) : void 0,
1954
+ ref: b,
1955
+ role: N ? "treegrid" : void 0,
1956
+ "data-depth": N ? R.length : void 0,
1957
+ style: N ? { "--u-header-levels": R.length - 1 } : void 0,
1958
+ "aria-label": d,
1959
+ "aria-rowcount": F ? (C.lines ?? C.filtered).length + 1 + (be ? 1 : 0) : void 0,
1957
1960
  "aria-busy": u || void 0,
1958
- className: E(
1959
- d.table,
1960
- k === "compact" && d.compact,
1961
- o && d.sticky,
1962
- s && d.striped
1961
+ className: G(
1962
+ f.table,
1963
+ v === "compact" && f.compact,
1964
+ o && f.sticky,
1965
+ s && f.striped
1963
1966
  ),
1964
1967
  children: [
1965
- /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ L("tr", { "aria-rowindex": S ? 1 : void 0, children: [
1968
+ /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? 1 : void 0, children: [
1966
1969
  n && /* @__PURE__ */ l(
1967
1970
  "th",
1968
1971
  {
1969
1972
  scope: "col",
1970
- className: E(d.th, d.control, r && d.stickyCell),
1973
+ className: G(f.th, f.control, r && f.stickyCell),
1971
1974
  style: r ? { left: 0 } : void 0,
1972
1975
  children: /* @__PURE__ */ l(
1973
- Se,
1976
+ Ce,
1974
1977
  {
1975
- "aria-label": b.selectAllRows,
1976
- checked: N.selection.allSelected,
1977
- indeterminate: N.selection.someSelected,
1978
- onChange: N.selection.toggleAll
1978
+ "aria-label": m.selectAllRows,
1979
+ checked: S.selection.allSelected,
1980
+ indeterminate: S.selection.someSelected,
1981
+ onChange: S.selection.toggleAll
1979
1982
  }
1980
1983
  )
1981
1984
  }
1982
1985
  ),
1983
- x && /* @__PURE__ */ l(
1986
+ A && /* @__PURE__ */ l(
1984
1987
  "td",
1985
1988
  {
1986
- className: E(d.th, d.control, r && d.stickyCell),
1989
+ className: G(f.th, f.control, r && f.stickyCell),
1987
1990
  style: r ? { left: (n ? 1 : 0) * Oe } : void 0
1988
1991
  }
1989
1992
  ),
1990
- G && (e.columnById(G.spec.id) === G ? /* @__PURE__ */ l(wt, { entry: G, registry: e, hook: v, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: d.th, children: G.spec.label })),
1991
- W.map((y) => /* @__PURE__ */ l(
1993
+ B && (e.columnById(B.spec.id) === B ? /* @__PURE__ */ l(wt, { entry: B, registry: e, hook: y, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: f.th, children: B.spec.label })),
1994
+ q.map((k) => /* @__PURE__ */ l(
1992
1995
  wt,
1993
1996
  {
1994
- entry: y,
1997
+ entry: k,
1995
1998
  registry: e,
1996
- hook: v,
1997
- sticky: fe(y),
1999
+ hook: y,
2000
+ sticky: fe(k),
1998
2001
  left: de
1999
2002
  },
2000
- y.key
2003
+ k.key
2001
2004
  )),
2002
- _.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: E(d.th, d.actionsCell), children: /* @__PURE__ */ l(Re, { children: b.rowActions }) })
2005
+ _.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: G(f.th, f.actionsCell), children: /* @__PURE__ */ l(Le, { children: m.rowActions }) })
2003
2006
  ] }) }),
2004
2007
  te,
2005
- be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ L("tr", { "aria-rowindex": S ? (C.lines ?? C.filtered).length + 2 : void 0, children: [
2006
- Array.from({ length: ie }, (y, R) => /* @__PURE__ */ l(
2008
+ be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? (C.lines ?? C.filtered).length + 2 : void 0, children: [
2009
+ Array.from({ length: ie }, (k, L) => /* @__PURE__ */ l(
2007
2010
  "td",
2008
2011
  {
2009
- className: E(d.td, d.control, r && d.stickyCell),
2010
- style: r ? { left: R * Oe } : void 0
2012
+ className: G(f.td, f.control, r && f.stickyCell),
2013
+ style: r ? { left: L * Oe } : void 0
2011
2014
  },
2012
- R
2015
+ L
2013
2016
  )),
2014
- G && /* @__PURE__ */ l("td", { className: d.td }),
2015
- W.map((y) => /* @__PURE__ */ l(
2016
- Yr,
2017
+ B && /* @__PURE__ */ l("td", { className: f.td }),
2018
+ q.map((k) => /* @__PURE__ */ l(
2019
+ Ur,
2017
2020
  {
2018
- entry: y,
2021
+ entry: k,
2019
2022
  rows: C.filtered,
2020
- formats: p,
2021
- wording: b,
2022
- sticky: fe(y),
2023
+ formats: w,
2024
+ wording: m,
2025
+ sticky: fe(k),
2023
2026
  left: de
2024
2027
  },
2025
- y.key
2028
+ k.key
2026
2029
  )),
2027
- _.length > 0 && /* @__PURE__ */ l("td", { className: d.td })
2030
+ _.length > 0 && /* @__PURE__ */ l("td", { className: f.td })
2028
2031
  ] }) })
2029
2032
  ]
2030
2033
  }
@@ -2045,85 +2048,86 @@ function wt({
2045
2048
  sticky: o,
2046
2049
  left: r
2047
2050
  }) {
2048
- const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Ot(a, s.rightAligned), u = t.isSortable(e, n.rows), h = s.id, f = i.sort.findIndex((T) => T.column === h), b = f === -1 ? void 0 : i.sort[f].direction, p = i.sort.length > 1 && f !== -1 ? f + 1 : void 0, k = i.widths[h], m = 48, w = (T) => {
2049
- T.stopPropagation(), T.preventDefault();
2050
- const x = T.currentTarget, _ = x.closest("th");
2051
+ const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Ot(a, s.rightAligned), u = t.isSortable(e, n.rows), h = s.id, d = i.sort.findIndex((x) => x.column === h), m = d === -1 ? void 0 : i.sort[d].direction, w = i.sort.length > 1 && d !== -1 ? d + 1 : void 0, v = i.widths[h], p = 48, b = (x) => {
2052
+ x.stopPropagation(), x.preventDefault();
2053
+ const A = x.currentTarget, _ = A.closest("th");
2051
2054
  if (!_) return;
2052
- const S = T.clientX, O = _.getBoundingClientRect().width, A = T.pointerId;
2053
- x.setPointerCapture(A);
2054
- const I = (G) => {
2055
- G.pointerId === A && i.setWidth(h, Math.max(m, O + (G.clientX - S)));
2056
- }, $ = (G) => {
2057
- G.pointerId === A && (x.removeEventListener("pointermove", I), x.removeEventListener("pointerup", $), x.removeEventListener("pointercancel", $), x.hasPointerCapture(A) && x.releasePointerCapture(A));
2055
+ const F = x.clientX, R = _.getBoundingClientRect().width, N = x.pointerId;
2056
+ A.setPointerCapture(N);
2057
+ const V = (B) => {
2058
+ B.pointerId === N && i.setWidth(h, Math.max(p, R + (B.clientX - F)));
2059
+ }, z = (B) => {
2060
+ B.pointerId === N && (A.removeEventListener("pointermove", V), A.removeEventListener("pointerup", z), A.removeEventListener("pointercancel", z), A.hasPointerCapture(N) && A.releasePointerCapture(N));
2058
2061
  };
2059
- x.addEventListener("pointermove", I), x.addEventListener("pointerup", $), x.addEventListener("pointercancel", $);
2060
- }, g = (T) => {
2061
- const x = T == null ? void 0 : T.parentElement, _ = T == null ? void 0 : T.closest("table");
2062
- if (!T || !x || !_) return;
2063
- const S = Array.from(x.children).indexOf(T), O = x.children.length, A = { cell: T.style.width, table: _.style.width };
2064
- T.style.width = "", _.style.width = "auto";
2065
- let I = 0;
2066
- for (const $ of Array.from(_.rows)) {
2067
- if ($.cells.length !== O) continue;
2068
- const G = $.cells[S];
2069
- G && (I = Math.max(I, G.scrollWidth));
2062
+ A.addEventListener("pointermove", V), A.addEventListener("pointerup", z), A.addEventListener("pointercancel", z);
2063
+ }, g = (x) => {
2064
+ const A = x == null ? void 0 : x.parentElement, _ = x == null ? void 0 : x.closest("table");
2065
+ if (!x || !A || !_) return;
2066
+ const F = Array.from(A.children).indexOf(x), R = A.children.length, N = { cell: x.style.width, table: _.style.width };
2067
+ x.style.width = "", _.style.width = "auto";
2068
+ let V = 0;
2069
+ for (const z of Array.from(_.rows)) {
2070
+ if (z.cells.length !== R) continue;
2071
+ const B = z.cells[F];
2072
+ B && (V = Math.max(V, B.scrollWidth));
2070
2073
  }
2071
- T.style.width = A.cell, _.style.width = A.table, I > 0 && i.setWidth(h, Math.max(m, I + 1));
2072
- }, v = (T) => {
2073
- if (!s.resizable || !T.altKey) return;
2074
- const x = T.key === "ArrowRight", _ = T.key === "ArrowLeft", S = T.key === "Home";
2075
- if (!x && !_ && !S) return;
2076
- T.preventDefault();
2077
- const O = T.currentTarget;
2078
- if (S) {
2079
- g(O);
2074
+ x.style.width = N.cell, _.style.width = N.table, V > 0 && i.setWidth(h, Math.max(p, V + 1));
2075
+ }, y = (x) => {
2076
+ if (!s.resizable || !x.altKey) return;
2077
+ const A = x.key === "ArrowRight", _ = x.key === "ArrowLeft", F = x.key === "Home";
2078
+ if (!A && !_ && !F) return;
2079
+ x.preventDefault();
2080
+ const R = x.currentTarget;
2081
+ if (F) {
2082
+ g(R);
2080
2083
  return;
2081
2084
  }
2082
- const A = O.getBoundingClientRect().width, I = T.shiftKey ? 32 : 8;
2083
- i.setWidth(h, Math.max(m, A + (x ? I : -I)));
2084
- }, N = u ? /* @__PURE__ */ L(
2085
+ const N = R.getBoundingClientRect().width, V = x.shiftKey ? 32 : 8;
2086
+ i.setWidth(h, Math.max(p, N + (A ? V : -V)));
2087
+ }, S = u ? /* @__PURE__ */ O(
2085
2088
  "button",
2086
2089
  {
2087
2090
  type: "button",
2088
- className: d.sortButton,
2089
- onClick: (T) => i.toggleSort(h, T.shiftKey || T.metaKey),
2091
+ className: f.sortButton,
2092
+ onClick: (x) => i.toggleSort(h, x.shiftKey || x.metaKey),
2090
2093
  children: [
2091
2094
  /* @__PURE__ */ l("span", { children: s.label }),
2092
- p !== void 0 && /* @__PURE__ */ l("span", { className: d.sortRank, "aria-hidden": "true", children: p }),
2093
- /* @__PURE__ */ l("span", { className: E(d.sortIndicator, b && d.sortActive), "aria-hidden": "true", children: b ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", className: E(d.sortArrow, b === "desc" && d.sortArrowDesc), children: /* @__PURE__ */ l("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ L("svg", { viewBox: "0 0 10 12", width: "10", height: "12", children: [
2094
- /* @__PURE__ */ l("path", { d: "M2.4 4.4 5 1.8l2.6 2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
2095
- /* @__PURE__ */ l("path", { d: "M2.4 7.6 5 10.2l2.6-2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
2096
- ] }) })
2095
+ w !== void 0 && /* @__PURE__ */ l("span", { className: f.sortRank, "aria-hidden": "true", children: w }),
2096
+ /* @__PURE__ */ l("span", { className: G(f.sortIndicator, m && f.sortActive), "aria-hidden": "true", children: m ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: G(f.sortArrow, m === "desc" && f.sortArrowDesc), children: /* @__PURE__ */ l("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
2097
+ /* Drawn in the nominal box and set in the 12 pixels the indicator
2098
+ has always taken, so that the head does not move. */
2099
+ /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2.8 3.7 5 1.5l2.2 2.2M2.8 6.3 5 8.5l2.2-2.2", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
2100
+ ) })
2097
2101
  ]
2098
2102
  }
2099
- ) : s.label, C = b === "asc" ? "ascending" : b === "desc" ? "descending" : "none", D = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
2100
- return /* @__PURE__ */ L(
2103
+ ) : s.label, C = m === "asc" ? "ascending" : m === "desc" ? "descending" : "none", I = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
2104
+ return /* @__PURE__ */ O(
2101
2105
  "th",
2102
2106
  {
2103
2107
  scope: "col",
2104
2108
  "data-column": h,
2105
2109
  "aria-sort": u ? C : void 0,
2106
2110
  tabIndex: s.resizable && !u ? 0 : void 0,
2107
- onKeyDown: v,
2108
- className: E(d.th, c && d.numeric, o && d.stickyCell),
2111
+ onKeyDown: y,
2112
+ className: G(f.th, c && f.numeric, o && f.stickyCell),
2109
2113
  style: {
2110
- ...k !== void 0 ? { width: k } : {},
2114
+ ...v !== void 0 ? { width: v } : {},
2111
2115
  ...o ? { left: r } : {}
2112
2116
  },
2113
2117
  children: [
2114
- D ? /* @__PURE__ */ L("span", { className: d.thFlex, children: [
2115
- N,
2116
- /* @__PURE__ */ l(br, { entry: e, registry: t, hook: n })
2117
- ] }) : N,
2118
+ I ? /* @__PURE__ */ O("span", { className: f.thFlex, children: [
2119
+ S,
2120
+ /* @__PURE__ */ l(vr, { entry: e, registry: t, hook: n })
2121
+ ] }) : S,
2118
2122
  s.resizable && /* @__PURE__ */ l(
2119
2123
  "span",
2120
2124
  {
2121
2125
  role: "presentation",
2122
- className: d.grip,
2123
- onPointerDown: w,
2124
- onClick: (T) => T.stopPropagation(),
2125
- onDoubleClick: (T) => {
2126
- T.stopPropagation(), g(T.currentTarget.closest("th"));
2126
+ className: f.grip,
2127
+ onPointerDown: b,
2128
+ onClick: (x) => x.stopPropagation(),
2129
+ onDoubleClick: (x) => {
2130
+ x.stopPropagation(), g(x.currentTarget.closest("th"));
2127
2131
  }
2128
2132
  }
2129
2133
  )
@@ -2131,7 +2135,7 @@ function wt({
2131
2135
  }
2132
2136
  );
2133
2137
  }
2134
- function Wr({
2138
+ function qr({
2135
2139
  row: e,
2136
2140
  index: t,
2137
2141
  absolute: n,
@@ -2143,88 +2147,89 @@ function Wr({
2143
2147
  actions: c,
2144
2148
  stickyRowHeader: u,
2145
2149
  rowHeaderLeft: h,
2146
- columnCount: f,
2147
- rowProps: b,
2148
- baseId: p,
2149
- formats: k,
2150
- wording: m,
2151
- line: w,
2150
+ columnCount: d,
2151
+ rowProps: m,
2152
+ baseId: w,
2153
+ formats: v,
2154
+ wording: p,
2155
+ line: b,
2152
2156
  spanEntry: g
2153
2157
  }) {
2154
- const v = Ue(Wt), N = r.publicSnapshot, C = r.rowKey(e), D = jr(e, i, r, k, m), T = o.detail, x = T !== null && N.expanded.includes(C), _ = `${p}-detail-${t}`, { className: S, ...O } = (b == null ? void 0 : b(e)) ?? {}, A = n !== void 0;
2155
- return /* @__PURE__ */ L(J, { children: [
2156
- /* @__PURE__ */ L(
2158
+ const y = Ue(Wt), S = r.publicSnapshot, C = r.rowKey(e), I = jr(e, i, r, v, p), x = o.detail, A = x !== null && S.expanded.includes(C), _ = `${w}-detail-${t}`, { className: F, ...R } = (m == null ? void 0 : m(e)) ?? {}, N = n !== void 0, V = b ? b.span ?? b.parents.at(-1) : void 0;
2159
+ return /* @__PURE__ */ O(Q, { children: [
2160
+ /* @__PURE__ */ O(
2157
2161
  "tr",
2158
2162
  {
2159
- ...O,
2160
- className: E(S, A && d.virtualRow),
2161
- "data-row": A ? n : void 0,
2162
- "data-line": w ? "row" : void 0,
2163
+ ...R,
2164
+ className: G(F, N && f.virtualRow),
2165
+ "data-row": N ? n : void 0,
2166
+ "data-line": b ? "row" : void 0,
2163
2167
  "data-motion": C,
2164
- "data-group-first": w != null && w.first ? "" : void 0,
2165
- "aria-level": w ? w.parents.length + 1 : void 0,
2166
- "aria-posinset": w ? (w.span ?? w.parents.at(-1)).rows.indexOf(e) + 1 : void 0,
2167
- "aria-setsize": w ? (w.span ?? w.parents.at(-1)).rows.length : void 0,
2168
- tabIndex: A ? n === v ? 0 : -1 : void 0,
2169
- "data-even": A && n % 2 === 1 ? "" : void 0,
2170
- "aria-rowindex": A ? n + 2 : void 0,
2168
+ "data-group-first": b != null && b.first ? "" : void 0,
2169
+ "data-group": V == null ? void 0 : V.path,
2170
+ "aria-level": b ? b.parents.length + 1 : void 0,
2171
+ "aria-posinset": V ? V.rows.indexOf(e) + 1 : void 0,
2172
+ "aria-setsize": V == null ? void 0 : V.rows.length,
2173
+ tabIndex: N ? n === y ? 0 : -1 : void 0,
2174
+ "data-even": N && n % 2 === 1 ? "" : void 0,
2175
+ "aria-rowindex": N ? n + 2 : void 0,
2171
2176
  children: [
2172
2177
  a && /* @__PURE__ */ l(
2173
2178
  "td",
2174
2179
  {
2175
- className: E(d.td, d.control, u && d.stickyCell),
2180
+ className: G(f.td, f.control, u && f.stickyCell),
2176
2181
  style: u ? { left: 0 } : void 0,
2177
2182
  children: /* @__PURE__ */ l(
2178
- Se,
2183
+ Ce,
2179
2184
  {
2180
- "aria-label": m.selectRow(D),
2181
- checked: N.selection.isSelected(C),
2182
- onChange: () => N.selection.toggle(C)
2185
+ "aria-label": p.selectRow(I),
2186
+ checked: S.selection.isSelected(C),
2187
+ onChange: () => S.selection.toggle(C)
2183
2188
  }
2184
2189
  )
2185
2190
  }
2186
2191
  ),
2187
- T && /* @__PURE__ */ l(
2192
+ x && /* @__PURE__ */ l(
2188
2193
  "td",
2189
2194
  {
2190
- className: E(d.td, d.control, u && d.stickyCell),
2195
+ className: G(f.td, f.control, u && f.stickyCell),
2191
2196
  style: u ? { left: (a ? 1 : 0) * Oe } : void 0,
2192
2197
  children: /* @__PURE__ */ l(
2193
2198
  "button",
2194
2199
  {
2195
2200
  type: "button",
2196
- "aria-expanded": x,
2197
- "aria-controls": x ? _ : void 0,
2198
- "aria-label": x ? m.collapseRowNamed(D) : m.expandRowNamed(D),
2199
- className: E(d.expander, x && d.expanderOpen),
2200
- onClick: () => N.toggleRow(C),
2201
- children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3.5 1.5 7 5l-3.5 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2201
+ "aria-expanded": A,
2202
+ "aria-controls": A ? _ : void 0,
2203
+ "aria-label": A ? p.collapseRowNamed(I) : p.expandRowNamed(I),
2204
+ className: G(f.expander, A && f.expanderOpen),
2205
+ onClick: () => S.toggleRow(C),
2206
+ children: /* @__PURE__ */ l(tn, {})
2202
2207
  }
2203
2208
  )
2204
2209
  }
2205
2210
  ),
2206
- w && w.span && /* @__PURE__ */ l(Er, { line: { ...w, span: w.span }, entry: g, selectable: a, registry: o, hook: r, formats: k, wording: m }),
2207
- s.map((I) => /* @__PURE__ */ l(
2208
- qr,
2211
+ b && b.span && /* @__PURE__ */ l(Er, { line: { ...b, span: b.span }, entry: g, selectable: a, hook: r, formats: v, wording: p }),
2212
+ s.map((z) => /* @__PURE__ */ l(
2213
+ Yr,
2209
2214
  {
2210
- entry: I,
2215
+ entry: z,
2211
2216
  row: e,
2212
- kind: o.kindOf(I, r.rows),
2213
- sticky: u && I === i,
2217
+ kind: o.kindOf(z, r.rows),
2218
+ sticky: u && z === i,
2214
2219
  left: h,
2215
- formats: k,
2216
- wording: m
2220
+ formats: v,
2221
+ wording: p
2217
2222
  },
2218
- I.key
2223
+ z.key
2219
2224
  )),
2220
- c.length > 0 && /* @__PURE__ */ l("td", { className: E(d.td, d.actionsCell), children: /* @__PURE__ */ l(Xr, { actions: c, row: e, name: D, wording: m }) })
2225
+ c.length > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.actionsCell), children: /* @__PURE__ */ l(Xr, { actions: c, row: e, name: I, wording: p }) })
2221
2226
  ]
2222
2227
  }
2223
2228
  ),
2224
- x && T && /* @__PURE__ */ l("tr", { id: _, className: d.detailRow, children: /* @__PURE__ */ l("td", { colSpan: f, className: d.detailCell, children: T.presentation(e) }) })
2229
+ A && x && /* @__PURE__ */ l("tr", { id: _, className: f.detailRow, "data-group": V == null ? void 0 : V.path, children: /* @__PURE__ */ l("td", { colSpan: d, className: f.detailCell, children: x.presentation(e) }) })
2225
2230
  ] });
2226
2231
  }
2227
- function qr({
2232
+ function Yr({
2228
2233
  entry: e,
2229
2234
  row: t,
2230
2235
  kind: n,
@@ -2235,19 +2240,19 @@ function qr({
2235
2240
  }) {
2236
2241
  const { spec: a } = e, c = e.read(t), u = Ot(n, a.rightAligned);
2237
2242
  let h;
2238
- Y(c) ? h = /* @__PURE__ */ l(Ht, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = _e(c, a.format, s, i);
2239
- const f = a.rowHeader ? "th" : "td";
2243
+ Y(c) ? h = /* @__PURE__ */ l(jt, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = ye(c, a.format, s, i);
2244
+ const d = a.rowHeader ? "th" : "td";
2240
2245
  return /* @__PURE__ */ l(
2241
- f,
2246
+ d,
2242
2247
  {
2243
2248
  scope: a.rowHeader ? "row" : void 0,
2244
- className: E(d.td, u && d.numeric, a.rowHeader && d.rowHeader, o && d.stickyCell),
2249
+ className: G(f.td, u && f.numeric, a.rowHeader && f.rowHeader, o && f.stickyCell),
2245
2250
  style: o ? { left: r } : void 0,
2246
2251
  children: h
2247
2252
  }
2248
2253
  );
2249
2254
  }
2250
- function Yr({
2255
+ function Ur({
2251
2256
  entry: e,
2252
2257
  rows: t,
2253
2258
  formats: n,
@@ -2256,11 +2261,11 @@ function Yr({
2256
2261
  left: s
2257
2262
  }) {
2258
2263
  const i = r ? { left: s } : void 0;
2259
- if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: E(d.td, r && d.stickyCell), style: i });
2264
+ if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: G(f.td, r && f.stickyCell), style: i });
2260
2265
  const a = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
2261
- return /* @__PURE__ */ l("td", { className: E(d.td, $t(e, t) && d.numeric, r && d.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l(Ke, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
2266
+ return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t) && f.numeric, r && f.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l(Ke, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
2262
2267
  }
2263
- const Ur = 2;
2268
+ const Jr = 2;
2264
2269
  function Xr({
2265
2270
  actions: e,
2266
2271
  row: t,
@@ -2271,7 +2276,7 @@ function Xr({
2271
2276
  const i = s.onSelect;
2272
2277
  i(s.bulk ? [t] : t);
2273
2278
  };
2274
- return e.length <= Ur ? /* @__PURE__ */ l("div", { className: d.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
2279
+ return e.length <= Jr ? /* @__PURE__ */ l("div", { className: f.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
2275
2280
  ee,
2276
2281
  {
2277
2282
  size: "sm",
@@ -2281,7 +2286,7 @@ function Xr({
2281
2286
  children: i.label
2282
2287
  },
2283
2288
  s
2284
- )) }) : /* @__PURE__ */ l("div", { className: d.actions, children: /* @__PURE__ */ l(
2289
+ )) }) : /* @__PURE__ */ l("div", { className: f.actions, children: /* @__PURE__ */ l(
2285
2290
  At,
2286
2291
  {
2287
2292
  align: "end",
@@ -2290,42 +2295,42 @@ function Xr({
2290
2295
  }
2291
2296
  ) });
2292
2297
  }
2293
- function Jr({ columns: e, rows: t = 4 }) {
2298
+ function Qr({ columns: e, rows: t = 4 }) {
2294
2299
  const n = [72, 48, 60, 40, 56, 64];
2295
- return /* @__PURE__ */ l(J, { children: Array.from({ length: t }, (o, r) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ l("td", { className: d.td, children: /* @__PURE__ */ l("span", { className: d.skeleton, style: { width: `${n[(r + i) % n.length]}%` } }) }, i)) }, r)) });
2300
+ return /* @__PURE__ */ l(Q, { children: Array.from({ length: t }, (o, r) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ l("td", { className: f.td, children: /* @__PURE__ */ l("span", { className: f.skeleton, style: { width: `${n[(r + i) % n.length]}%` } }) }, i)) }, r)) });
2296
2301
  }
2297
- const Wt = yt(0);
2302
+ const Wt = kt(0);
2298
2303
  function bt({ height: e, colSpan: t }) {
2299
- return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: d.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
2304
+ return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: f.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
2300
2305
  }
2301
- function kt({
2306
+ function vt({
2302
2307
  virtual: e,
2303
2308
  colSpan: t,
2304
2309
  children: n
2305
2310
  }) {
2306
- const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = Z(null), [c, u] = z(0), h = (p, k) => {
2307
- a.current = k, u(k), i(k), requestAnimationFrame(() => {
2308
- var m;
2309
- (m = p.querySelector(`[data-row="${k}"]`)) == null || m.focus();
2311
+ const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] = j(0), h = (w, v) => {
2312
+ a.current = v, u(v), i(v), requestAnimationFrame(() => {
2313
+ var p;
2314
+ (p = w.querySelector(`[data-row="${v}"]`)) == null || p.focus();
2310
2315
  });
2311
- }, f = c >= e.from && c < e.to ? c : e.from, b = (p) => {
2312
- if (p.defaultPrevented || o === 0) return;
2313
- const k = p.target, m = k.closest("[data-row]");
2314
- if (m && k !== m) return;
2315
- const w = m ? Number(m.dataset.row) : a.current ?? -1;
2316
+ }, d = c >= e.from && c < e.to ? c : e.from, m = (w) => {
2317
+ if (w.defaultPrevented || o === 0) return;
2318
+ const v = w.target, p = v.closest("[data-row]");
2319
+ if (p && v !== p) return;
2320
+ const b = p ? Number(p.dataset.row) : a.current ?? -1;
2316
2321
  let g = null;
2317
- p.key === "ArrowDown" ? g = Math.min(o - 1, w + 1) : p.key === "ArrowUp" ? g = Math.max(0, w - 1) : p.key === "Home" ? g = 0 : p.key === "End" && (g = o - 1), !(g === null || g === w) && (p.preventDefault(), h(p.currentTarget, g));
2322
+ w.key === "ArrowDown" ? g = Math.min(o - 1, b + 1) : w.key === "ArrowUp" ? g = Math.max(0, b - 1) : w.key === "Home" ? g = 0 : w.key === "End" && (g = o - 1), !(g === null || g === b) && (w.preventDefault(), h(w.currentTarget, g));
2318
2323
  };
2319
2324
  return /* @__PURE__ */ l(
2320
2325
  "tbody",
2321
2326
  {
2322
- className: d.virtualBody,
2323
- onKeyDown: b,
2324
- onFocus: (p) => {
2325
- const k = p.target.closest("[data-row]");
2326
- k && u(Number(k.dataset.row));
2327
+ className: f.virtualBody,
2328
+ onKeyDown: m,
2329
+ onFocus: (w) => {
2330
+ const v = w.target.closest("[data-row]");
2331
+ v && u(Number(v.dataset.row));
2327
2332
  },
2328
- children: /* @__PURE__ */ L(Wt.Provider, { value: f, children: [
2333
+ children: /* @__PURE__ */ O(Wt.Provider, { value: d, children: [
2329
2334
  /* @__PURE__ */ l(bt, { height: r, colSpan: t }),
2330
2335
  n,
2331
2336
  /* @__PURE__ */ l(bt, { height: s, colSpan: t })
@@ -2333,46 +2338,46 @@ function kt({
2333
2338
  }
2334
2339
  );
2335
2340
  }
2336
- const Qr = "_verdict_a8pbv_6", Zr = "_glyph_a8pbv_13", es = "_value_a8pbv_23", ts = "_excess_a8pbv_28", Te = {
2337
- verdict: Qr,
2338
- glyph: Zr,
2339
- value: es,
2340
- excess: ts
2341
- }, vt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), ns = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, os = {
2341
+ const Zr = "_verdict_1mxfd_6", es = "_glyph_1mxfd_13", ts = "_value_1mxfd_23", ns = "_excess_1mxfd_28", Te = {
2342
+ verdict: Zr,
2343
+ glyph: es,
2344
+ value: ts,
2345
+ excess: ns
2346
+ }, _t = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), os = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, rs = {
2342
2347
  ok: "✓",
2343
2348
  unknown: "?",
2344
2349
  warning: "▲",
2345
2350
  alarm: "■"
2346
2351
  };
2347
- function rs({ reading: e, format: t }) {
2348
- const n = ue(), o = U(), { measured: r, assessment: s } = e, i = ns(s.verdict, o);
2349
- return /* @__PURE__ */ L("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
2350
- /* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: os[s.verdict] }),
2351
- /* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : vt(r, t, n) }),
2352
- s.excess !== void 0 && /* @__PURE__ */ L("span", { className: Te.excess, children: [
2352
+ function ss({ reading: e, format: t }) {
2353
+ const n = ue(), o = U(), { measured: r, assessment: s } = e, i = os(s.verdict, o);
2354
+ return /* @__PURE__ */ O("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
2355
+ /* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: rs[s.verdict] }),
2356
+ /* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : _t(r, t, n) }),
2357
+ s.excess !== void 0 && /* @__PURE__ */ O("span", { className: Te.excess, children: [
2353
2358
  "+",
2354
- vt(s.excess, t, n)
2359
+ _t(s.excess, t, n)
2355
2360
  ] }),
2356
- /* @__PURE__ */ l(Re, { children: i })
2361
+ /* @__PURE__ */ l(Le, { children: i })
2357
2362
  ] });
2358
2363
  }
2359
- const ss = (e) => e.measured, is = (e) => e.reduce(
2360
- (t, n) => !t || Be(n.assessment.verdict) > Be(t.assessment.verdict) ? n : t,
2364
+ const is = (e) => e.measured, as = (e) => e.reduce(
2365
+ (t, n) => !t || Ee(n.assessment.verdict) > Ee(t.assessment.verdict) ? n : t,
2361
2366
  void 0
2362
2367
  );
2363
- function as(e) {
2368
+ function ls(e) {
2364
2369
  return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: u, aggregate: h }) {
2365
- const f = JSON.stringify(s), b = j(() => {
2366
- const k = JSON.parse(f);
2367
- return (m) => {
2368
- const w = typeof o == "string" ? m == null ? void 0 : m[o] : o(m);
2370
+ const d = JSON.stringify(s), m = $(() => {
2371
+ const v = JSON.parse(d);
2372
+ return (p) => {
2373
+ const b = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
2369
2374
  return {
2370
- measured: typeof w == "number" && Number.isFinite(w) ? w : null,
2371
- assessment: tn(w, k)
2375
+ measured: typeof b == "number" && Number.isFinite(b) ? b : null,
2376
+ assessment: nn(b, v)
2372
2377
  };
2373
2378
  };
2374
- }, [o, f]), p = X(
2375
- (k) => a === "value" ? k.measured : Be(k.assessment.verdict),
2379
+ }, [o, d]), w = X(
2380
+ (v) => a === "value" ? v.measured : Ee(v.assessment.verdict),
2376
2381
  [a]
2377
2382
  );
2378
2383
  return /* @__PURE__ */ l(
@@ -2383,11 +2388,11 @@ function as(e) {
2383
2388
  numeric: !0,
2384
2389
  width: c,
2385
2390
  resizable: u,
2386
- value: b,
2387
- sortValue: p,
2388
- exportValue: ss,
2389
- aggregate: h === "worst" ? is : void 0,
2390
- children: (k) => /* @__PURE__ */ l(rs, { reading: k, format: i })
2391
+ value: m,
2392
+ sortValue: w,
2393
+ exportValue: is,
2394
+ aggregate: h === "worst" ? as : void 0,
2395
+ children: (v) => /* @__PURE__ */ l(ss, { reading: v, format: i })
2391
2396
  }
2392
2397
  );
2393
2398
  };
@@ -2402,7 +2407,7 @@ function Yt(e, t, n) {
2402
2407
  const s = Dt(r, n);
2403
2408
  return s === "foreign" && qt(t), s === "effective";
2404
2409
  }
2405
- function ls(e, t) {
2410
+ function cs(e, t) {
2406
2411
  if (e.length === 0) return;
2407
2412
  let n = -1, o = [];
2408
2413
  return (r) => {
@@ -2415,21 +2420,21 @@ function ls(e, t) {
2415
2420
  }
2416
2421
  return o.every(({ entry: s, condition: i }) => {
2417
2422
  const a = me(s.spec.filter);
2418
- return !a || tr(a, s.read(r), i);
2423
+ return !a || nr(a, s.read(r), i);
2419
2424
  });
2420
2425
  };
2421
2426
  }
2422
- function cs(e, t) {
2423
- const n = j(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = z(() => ({ source: e, result: n }));
2427
+ function us(e, t) {
2428
+ const n = $(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = j(() => ({ source: e, result: n }));
2424
2429
  if (!t) return e;
2425
2430
  const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
2426
2431
  return s || r({ source: e, result: n }), s ? o.result : n;
2427
2432
  }
2428
- function us(e, t) {
2429
- var a, c, u, h, f, b;
2433
+ function ds(e, t) {
2434
+ var a, c, u, h, d, m;
2430
2435
  if (t.size === 0) return e;
2431
- const n = (a = e.sort) == null ? void 0 : a.filter((p) => t.has(p.column)), o = (c = e.hidden) == null ? void 0 : c.filter((p) => t.has(p)), r = (u = e.order) == null ? void 0 : u.filter((p) => t.has(p)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([p]) => t.has(p))) : void 0;
2432
- return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.length) === ((f = e.hidden) == null ? void 0 : f.length) && (r == null ? void 0 : r.length) === ((b = e.order) == null ? void 0 : b.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
2436
+ const n = (a = e.sort) == null ? void 0 : a.filter((w) => t.has(w.column)), o = (c = e.hidden) == null ? void 0 : c.filter((w) => t.has(w)), r = (u = e.order) == null ? void 0 : u.filter((w) => t.has(w)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([w]) => t.has(w))) : void 0;
2437
+ return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.length) === ((d = e.hidden) == null ? void 0 : d.length) && (r == null ? void 0 : r.length) === ((m = e.order) == null ? void 0 : m.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
2433
2438
  ...e.search ? { search: e.search } : {},
2434
2439
  ...e.page ? { page: e.page } : {},
2435
2440
  ...e.pageSize ? { pageSize: e.pageSize } : {},
@@ -2439,78 +2444,78 @@ function us(e, t) {
2439
2444
  ...s && Object.keys(s).length ? { widths: s } : {}
2440
2445
  };
2441
2446
  }
2442
- const Ee = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], ds = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
2443
- function _t(e) {
2447
+ const Ge = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], fs = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
2448
+ function yt(e) {
2444
2449
  const t = [], n = (o) => {
2445
2450
  for (const r of o)
2446
2451
  t.push(r.path), n(r.groups);
2447
2452
  };
2448
2453
  return n(e ?? []), t;
2449
2454
  }
2450
- const fs = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
2451
- function hs(e, t) {
2455
+ const hs = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
2456
+ function gs(e, t) {
2452
2457
  const n = {};
2453
2458
  for (const o of e) o.width !== void 0 && (n[o.id] = o.width);
2454
2459
  return { ...n, ...t };
2455
2460
  }
2456
- function gs(e, t) {
2457
- const [n] = z(() => new gr()), [o] = z(() => {
2458
- const y = Hr(n);
2459
- return { ...y, VerdictColumn: as(y.Column) };
2461
+ function ps(e, t) {
2462
+ const [n] = j(() => new pr()), [o] = j(() => {
2463
+ const k = $r(n);
2464
+ return { ...k, VerdictColumn: ls(k.Column) };
2460
2465
  });
2461
- Le(n.subscribe, n.structureVersion, n.structureVersion);
2462
- const r = ue(), s = e, i = n.modelColumns(s, r), [a] = z(() => t.initialView), [c, u] = z(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), h = j(() => ls(c, n), [c, n]), f = t.preFilter ?? t.filter, b = cs(s, f), [p, k] = z(
2463
- () => a != null && a.grouping ? [...a.grouping] : Ee(t.defaultGrouping)
2464
- ), [m, w] = z(() => (a == null ? void 0 : a.folded) ?? []), g = n.orderedColumns().length + n.groupKeys.entries.size > 0, v = g ? n.effectiveGrouping(p, s) : p.slice(0, Qe), N = v.join("|"), C = j(() => new Set(m), [m]), D = v.length ? n.groupingModel(v, s) : null, T = j(
2465
- () => D && D.levels.length ? { ...D, folded: C, compareText: r.compareText } : void 0,
2466
+ Re(n.subscribe, n.structureVersion, n.structureVersion);
2467
+ const r = ue(), s = e, i = n.modelColumns(s, r), [a] = j(() => t.initialView), [c, u] = j(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), h = $(() => cs(c, n), [c, n]), d = t.preFilter ?? t.filter, m = us(s, d), [w, v] = j(
2468
+ () => a != null && a.grouping ? [...a.grouping] : Ge(t.defaultGrouping)
2469
+ ), [p, b] = j(() => (a == null ? void 0 : a.folded) ?? []), g = n.orderedColumns().length + n.groupKeys.entries.size > 0, y = g ? n.effectiveGrouping(w, s) : w.slice(0, Qe), S = y.join("|"), C = $(() => new Set(p), [p]), I = y.length ? n.groupingModel(y, s) : null, x = $(
2470
+ () => I && I.levels.length ? { ...I, folded: C, compareText: r.compareText } : void 0,
2466
2471
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
2467
- [D, C, r.compareText, N]
2468
- ), x = t.rowKey, _ = kn(b, i, {
2469
- rowKey: x,
2472
+ [I, C, r.compareText, S]
2473
+ ), A = t.rowKey, _ = _n(m, i, {
2474
+ rowKey: A,
2470
2475
  pageSize: t.pageSize,
2471
2476
  defaultSort: t.defaultSort,
2472
2477
  filter: h,
2473
2478
  initialView: a,
2474
2479
  virtual: t.virtual,
2475
- grouping: T
2476
- }), { setPage: S } = _, O = X(
2477
- (y, R) => {
2478
- let q = R == null;
2479
- if (!q && n.orderedColumns().length > 0) {
2480
- const H = n.columnById(y), M = H ? me(H.spec.filter) : void 0;
2480
+ grouping: x
2481
+ }), { setPage: F } = _, R = X(
2482
+ (k, L) => {
2483
+ let K = L == null;
2484
+ if (!K && n.orderedColumns().length > 0) {
2485
+ const H = n.columnById(k), M = H ? me(H.spec.filter) : void 0;
2481
2486
  if (!M) {
2482
2487
  pe(
2483
- `condition-without-filter:${y}`,
2484
- H ? `The column "${y}" has no filter; its condition is passed over.` : `No column is called "${y}"; its condition is passed over.`
2488
+ `condition-without-filter:${k}`,
2489
+ H ? `The column "${k}" has no filter; its condition is passed over.` : `No column is called "${k}"; its condition is passed over.`
2485
2490
  );
2486
2491
  return;
2487
2492
  }
2488
- const Q = Dt(M, R);
2489
- if (Q === "foreign") {
2490
- qt(y);
2493
+ const J = Dt(M, L);
2494
+ if (J === "foreign") {
2495
+ qt(k);
2491
2496
  return;
2492
2497
  }
2493
- q = Q === "empty";
2498
+ K = J === "empty";
2494
2499
  }
2495
2500
  u((H) => {
2496
- const M = H.findIndex(([Q]) => Q === y);
2497
- return q ? M === -1 ? H : H.filter((Q, ne) => ne !== M) : M === -1 ? [...H, [y, R]] : H.map((Q, ne) => ne === M ? [y, R] : Q);
2498
- }), S(1);
2501
+ const M = H.findIndex(([J]) => J === k);
2502
+ return K ? M === -1 ? H : H.filter((J, Z) => Z !== M) : M === -1 ? [...H, [k, L]] : H.map((J, Z) => Z === M ? [k, L] : J);
2503
+ }), F(1);
2499
2504
  },
2500
- [n, S]
2501
- ), A = new Set(n.orderedColumns().map((y) => y.spec.id)), [I, $] = z(() => /* @__PURE__ */ new Set());
2502
- if (!fs(I, A)) {
2503
- const y = new Set([...I].filter((R) => !A.has(R)));
2504
- $(A), c.some(([R]) => y.has(R)) && u((R) => R.filter(([q]) => !y.has(q)));
2505
+ [n, F]
2506
+ ), N = new Set(n.orderedColumns().map((k) => k.spec.id)), [V, z] = j(() => /* @__PURE__ */ new Set());
2507
+ if (!hs(V, N)) {
2508
+ const k = new Set([...V].filter((L) => !N.has(L)));
2509
+ z(N), c.some(([L]) => k.has(L)) && u((L) => L.filter(([K]) => !k.has(K)));
2505
2510
  }
2506
- const G = A.size === 0 ? c : c.filter(([y, R]) => Yt(n, y, R)), W = us(_.view, A), ie = G.length > 0 ? { ...W, conditions: Object.fromEntries(G) } : W, ae = A.size === 0 ? _.sort : _.sort.filter((y) => A.has(y.column)), de = g ? n.effectiveGrouping(Ee(t.defaultGrouping), s) : Ee(t.defaultGrouping), fe = _.groups ? fn(_.groups, m) : g ? [] : [...m], we = {
2511
+ const B = N.size === 0 ? c : c.filter(([k, L]) => Yt(n, k, L)), q = ds(_.view, N), ie = B.length > 0 ? { ...q, conditions: Object.fromEntries(B) } : q, ae = N.size === 0 ? _.sort : _.sort.filter((k) => N.has(k.column)), de = g ? n.effectiveGrouping(Ge(t.defaultGrouping), s) : Ge(t.defaultGrouping), fe = _.groups ? hn(_.groups, p) : g ? [] : [...p], we = {
2507
2512
  ...ie,
2508
- ...ds(v, de) ? {} : { grouping: v },
2513
+ ...fs(y, de) ? {} : { grouping: y },
2509
2514
  ...fe.length ? { folded: fe } : {}
2510
- }, be = (y) => {
2511
- k([...y]), S(1);
2512
- }, ye = (y) => {
2513
- _t(_.groups).includes(y) && w((R) => R.includes(y) ? R.filter((q) => q !== y) : [...R, y]);
2515
+ }, be = (k) => {
2516
+ v([...k]), F(1);
2517
+ }, ke = (k) => {
2518
+ yt(_.groups).includes(k) && (n.noteFocusBeforeFold(), b((L) => L.includes(k) ? L.filter((K) => K !== k) : [...L, k]));
2514
2519
  }, le = n.paginates() || t.virtual !== void 0, te = {
2515
2520
  rows: e,
2516
2521
  filtered: _.filtered,
@@ -2528,60 +2533,64 @@ function gs(e, t) {
2528
2533
  toggleColumn: _.toggleColumn,
2529
2534
  order: _.order,
2530
2535
  setOrder: _.setOrder,
2531
- widths: hs(i, _.widths),
2536
+ widths: gs(i, _.widths),
2532
2537
  setWidth: _.setWidth,
2533
2538
  expanded: _.expanded,
2534
2539
  toggleRow: _.toggleRow,
2535
- filter: Object.fromEntries(G),
2536
- setFilter: O,
2540
+ filter: Object.fromEntries(B),
2541
+ setFilter: R,
2537
2542
  selection: t.selection ?? _.selection,
2538
2543
  view: we,
2539
- grouping: v,
2544
+ grouping: y,
2540
2545
  setGrouping: be,
2541
2546
  folded: fe,
2542
- toggleFold: ye,
2543
- foldAll: () => w(_t(_.groups)),
2544
- unfoldAll: () => w([]),
2545
- asCsv: () => xr(n),
2547
+ toggleFold: ke,
2548
+ foldAll: () => {
2549
+ n.noteFocusBeforeFold(), b(yt(_.groups));
2550
+ },
2551
+ unfoldAll: () => {
2552
+ n.noteFocusBeforeFold(), b([]);
2553
+ },
2554
+ asCsv: () => Ar(n),
2546
2555
  virtual: t.virtual !== void 0
2547
2556
  };
2548
2557
  return n.setHook({
2549
2558
  rows: s,
2550
- admitted: b,
2559
+ admitted: m,
2551
2560
  modelColumns: i,
2552
2561
  companion: _,
2553
2562
  filter: h,
2554
- grouping: T,
2563
+ grouping: x,
2555
2564
  folded: C,
2556
2565
  publicSnapshot: te,
2557
- rowKey: x,
2566
+ rowKey: A,
2558
2567
  formats: r
2559
2568
  }), { ...te, ...o };
2560
2569
  }
2561
- function Js(e) {
2570
+ function Qs(e) {
2562
2571
  return e;
2563
2572
  }
2564
2573
  function nt(e, t) {
2565
2574
  const n = se();
2566
- e == null || e.register(t, n), K(() => {
2575
+ e == null || e.register(t, n), W(() => {
2567
2576
  if (e)
2568
2577
  return e.register(t, n), e.commit(), () => {
2569
2578
  e.remove(t, n), e.commit();
2570
2579
  };
2571
2580
  }, [e, t, n]);
2572
2581
  }
2573
- function Qs({ children: e, className: t, of: n }) {
2582
+ function Zs({ children: e, className: t, of: n }) {
2574
2583
  const o = xe(n);
2575
2584
  nt(o == null ? void 0 : o.registry, "toolbar");
2576
2585
  const r = o == null ? void 0 : o.registry;
2577
- return /* @__PURE__ */ l(jt, { registry: r ?? null, className: t, children: e });
2586
+ return /* @__PURE__ */ l(Ht, { registry: r ?? null, className: t, children: e });
2578
2587
  }
2579
- function Zs({ placeholder: e, "aria-label": t, className: n, of: o }) {
2588
+ function ei({ placeholder: e, "aria-label": t, className: n, of: o }) {
2580
2589
  const r = xe(o), s = U();
2581
2590
  if (nt(r == null ? void 0 : r.registry, "search"), !r) return null;
2582
2591
  const { snapshot: i } = r;
2583
2592
  return /* @__PURE__ */ l(
2584
- on,
2593
+ rn,
2585
2594
  {
2586
2595
  size: "sm",
2587
2596
  type: "search",
@@ -2595,26 +2604,26 @@ function Zs({ placeholder: e, "aria-label": t, className: n, of: o }) {
2595
2604
  }
2596
2605
  );
2597
2606
  }
2598
- function ei({ of: e }) {
2599
- var w;
2600
- const t = xe(e), n = U(), [o, r] = z(!1), s = Z(null), i = Z(null), a = se(), [c, u] = z(null);
2601
- if (K(() => {
2607
+ function ti({ of: e }) {
2608
+ var b;
2609
+ const t = xe(e), n = U(), [o, r] = j(!1), s = re(null), i = re(null), a = se(), [c, u] = j(null);
2610
+ if (W(() => {
2602
2611
  var C;
2603
2612
  if (!c || !i.current) return;
2604
2613
  const g = Array.from(i.current.children).find(
2605
- (D) => D.dataset.column === c.id
2606
- ), v = g == null ? void 0 : g.querySelector(`[data-direction="${c.direction}"]`), N = g == null ? void 0 : g.querySelector(
2614
+ (I) => I.dataset.column === c.id
2615
+ ), y = g == null ? void 0 : g.querySelector(`[data-direction="${c.direction}"]`), S = g == null ? void 0 : g.querySelector(
2607
2616
  `[data-direction="${c.direction === "forward" ? "backward" : "forward"}"]`
2608
2617
  );
2609
- (C = v && !v.disabled ? v : N) == null || C.focus();
2618
+ (C = y && !y.disabled ? y : S) == null || C.focus();
2610
2619
  }, [c]), !t) return null;
2611
- const { registry: h, snapshot: f } = t, b = h.hook, p = h.withStickyHeaderFirst(
2612
- et(h.modelColumns(b.rows, b.formats), f.order)
2613
- ), k = h.stickyRowHeader ? ((w = p[0]) == null ? void 0 : w.hideable) === !1 : !1, m = (g, v) => {
2614
- const N = p.map((D) => D.id), C = g + v;
2615
- C < 0 || C >= N.length || ([N[g], N[C]] = [N[C], N[g]], f.setOrder(N), u({ id: p[g].id, direction: v < 0 ? "forward" : "backward" }));
2620
+ const { registry: h, snapshot: d } = t, m = h.hook, w = h.withStickyHeaderFirst(
2621
+ et(h.modelColumns(m.rows, m.formats), d.order)
2622
+ ), v = h.stickyRowHeader ? ((b = w[0]) == null ? void 0 : b.hideable) === !1 : !1, p = (g, y) => {
2623
+ const S = w.map((I) => I.id), C = g + y;
2624
+ C < 0 || C >= S.length || ([S[g], S[C]] = [S[C], S[g]], d.setOrder(S), u({ id: w[g].id, direction: y < 0 ? "forward" : "backward" }));
2616
2625
  };
2617
- return /* @__PURE__ */ L(J, { children: [
2626
+ return /* @__PURE__ */ O(Q, { children: [
2618
2627
  /* @__PURE__ */ l(
2619
2628
  ee,
2620
2629
  {
@@ -2627,8 +2636,8 @@ function ei({ of: e }) {
2627
2636
  children: n.columns
2628
2637
  }
2629
2638
  ),
2630
- /* @__PURE__ */ L(
2631
- St,
2639
+ /* @__PURE__ */ O(
2640
+ Ct,
2632
2641
  {
2633
2642
  open: o,
2634
2643
  onOpenChange: r,
@@ -2637,53 +2646,53 @@ function ei({ of: e }) {
2637
2646
  role: "dialog",
2638
2647
  ariaLabel: n.arrangeColumns,
2639
2648
  id: a,
2640
- className: d.columnsPanel,
2649
+ className: f.columnsPanel,
2641
2650
  children: [
2642
- /* @__PURE__ */ l("ul", { ref: i, className: d.columnsList, "aria-label": n.arrangeColumns, children: p.map((g, v) => {
2643
- const N = g.label ?? g.id;
2644
- return /* @__PURE__ */ L("li", { className: d.columnsEntry, "data-column": g.id, children: [
2651
+ /* @__PURE__ */ l("ul", { ref: i, className: f.columnsList, "aria-label": n.arrangeColumns, children: w.map((g, y) => {
2652
+ const S = g.label ?? g.id;
2653
+ return /* @__PURE__ */ O("li", { className: f.columnsEntry, "data-column": g.id, children: [
2645
2654
  /* @__PURE__ */ l(
2646
- Se,
2655
+ Ce,
2647
2656
  {
2648
- label: N,
2649
- checked: !f.hidden.includes(g.id),
2657
+ label: S,
2658
+ checked: !d.hidden.includes(g.id),
2650
2659
  disabled: g.hideable === !1,
2651
- onChange: () => f.toggleColumn(g.id)
2660
+ onChange: () => d.toggleColumn(g.id)
2652
2661
  }
2653
2662
  ),
2654
2663
  /* @__PURE__ */ l(
2655
2664
  "button",
2656
2665
  {
2657
2666
  type: "button",
2658
- className: d.move,
2667
+ className: f.move,
2659
2668
  "data-direction": "forward",
2660
- "aria-label": n.columnForward(N),
2661
- disabled: v === 0 || k && v <= 1,
2662
- onClick: () => m(v, -1),
2663
- children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2669
+ "aria-label": n.columnForward(S),
2670
+ disabled: y === 0 || v && y <= 1,
2671
+ onClick: () => p(y, -1),
2672
+ children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
2664
2673
  }
2665
2674
  ),
2666
2675
  /* @__PURE__ */ l(
2667
2676
  "button",
2668
2677
  {
2669
2678
  type: "button",
2670
- className: d.move,
2679
+ className: f.move,
2671
2680
  "data-direction": "backward",
2672
- "aria-label": n.columnBackward(N),
2673
- disabled: v === p.length - 1 || k && v === 0,
2674
- onClick: () => m(v, 1),
2675
- children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2681
+ "aria-label": n.columnBackward(S),
2682
+ disabled: y === w.length - 1 || v && y === 0,
2683
+ onClick: () => p(y, 1),
2684
+ children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
2676
2685
  }
2677
2686
  )
2678
2687
  ] }, g.id);
2679
2688
  }) }),
2680
- /* @__PURE__ */ l(Tr, { registry: h, hook: b })
2689
+ /* @__PURE__ */ l(Fr, { registry: h, hook: m })
2681
2690
  ]
2682
2691
  }
2683
2692
  )
2684
2693
  ] });
2685
2694
  }
2686
- function ti({ filename: e, onExport: t, of: n }) {
2695
+ function ni({ filename: e, onExport: t, of: n }) {
2687
2696
  const o = xe(n), r = U();
2688
2697
  if (!o) return null;
2689
2698
  const { snapshot: s } = o;
@@ -2697,16 +2706,16 @@ function ti({ filename: e, onExport: t, of: n }) {
2697
2706
  u.href = c, u.download = e ?? r.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(c), 1e4);
2698
2707
  }, children: r.exportLabel });
2699
2708
  }
2700
- function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
2709
+ function oi({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
2701
2710
  const o = xe(n), r = U(), s = ue();
2702
2711
  if (nt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
2703
- const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, f) => h - f), u = /* @__PURE__ */ L("nav", { "aria-label": r.pagination, className: E(d.pagination, t), children: [
2712
+ const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, d) => h - d), u = /* @__PURE__ */ O("nav", { "aria-label": r.pagination, className: G(f.pagination, t), children: [
2704
2713
  /* @__PURE__ */ l("span", { children: r.entries(a, s.count(a)) }),
2705
- /* @__PURE__ */ L("div", { className: d.paginationControls, children: [
2706
- /* @__PURE__ */ L("label", { className: d.pageSize, children: [
2714
+ /* @__PURE__ */ O("div", { className: f.paginationControls, children: [
2715
+ /* @__PURE__ */ O("label", { className: f.pageSize, children: [
2707
2716
  r.rows,
2708
2717
  /* @__PURE__ */ l(
2709
- nn,
2718
+ on,
2710
2719
  {
2711
2720
  selectSize: "sm",
2712
2721
  value: i.pageSize,
@@ -2716,37 +2725,37 @@ function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
2716
2725
  }
2717
2726
  )
2718
2727
  ] }),
2719
- /* @__PURE__ */ l("span", { className: d.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
2728
+ /* @__PURE__ */ l("span", { className: f.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
2720
2729
  /* @__PURE__ */ l(ee, { size: "sm", disabled: i.page <= 1, onClick: () => i.setPage(i.page - 1), children: r.previousPage }),
2721
2730
  /* @__PURE__ */ l(ee, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
2722
2731
  ] })
2723
2732
  ] });
2724
- return o.inside ? o.footerTarget ? an(u, o.footerTarget) : null : u;
2733
+ return o.inside ? o.footerTarget ? ln(u, o.footerTarget) : null : u;
2725
2734
  }
2726
- const ps = ["high", "medium", "low"], ms = (e) => ps.indexOf(e), ws = (e) => e === "standing-unacknowledged" || e === "standing-acknowledged", De = (e) => e === "standing-acknowledged" || e === "cleared-acknowledged", bs = (e) => e === "cleared-acknowledged";
2727
- function ks(e, t) {
2735
+ const ms = ["high", "medium", "low"], ws = (e) => ms.indexOf(e), bs = (e) => e === "standing-unacknowledged" || e === "standing-acknowledged", De = (e) => e === "standing-acknowledged" || e === "cleared-acknowledged", vs = (e) => e === "cleared-acknowledged";
2736
+ function _s(e, t) {
2728
2737
  switch (t) {
2729
2738
  case "raised":
2730
2739
  return "standing-unacknowledged";
2731
2740
  case "acknowledged":
2732
- return ws(e) ? "standing-acknowledged" : "cleared-acknowledged";
2741
+ return bs(e) ? "standing-acknowledged" : "cleared-acknowledged";
2733
2742
  case "cleared":
2734
2743
  return De(e) ? "cleared-acknowledged" : "cleared-unacknowledged";
2735
2744
  }
2736
2745
  }
2737
- const oi = (e, t) => e.direction === "obere" ? t <= e.returnTo : t >= e.returnTo, ot = (e, t, n) => e > n - t && e <= n, ri = (e, t, n) => e.reduce((o, r) => o + (ot(r, t, n) ? 1 : 0), 0);
2738
- function vs(e, t, n) {
2746
+ const ri = (e, t) => e.direction === "obere" ? t <= e.returnTo : t >= e.returnTo, ot = (e, t, n) => e > n - t && e <= n, si = (e, t, n) => e.reduce((o, r) => o + (ot(r, t, n) ? 1 : 0), 0);
2747
+ function ys(e, t, n) {
2739
2748
  const o = /* @__PURE__ */ new Map();
2740
2749
  for (const r of e)
2741
2750
  ot(r.raised, t, n) && o.set(r.type, (o.get(r.type) ?? 0) + 1);
2742
2751
  return o;
2743
2752
  }
2744
- function _s(e) {
2753
+ function ks(e) {
2745
2754
  let t = Number.POSITIVE_INFINITY;
2746
2755
  for (const n of e) n < t && (t = n);
2747
2756
  return t;
2748
2757
  }
2749
- function ys(e) {
2758
+ function Ss(e) {
2750
2759
  let t = Number.NEGATIVE_INFINITY;
2751
2760
  for (const n of e) n > t && (t = n);
2752
2761
  return t;
@@ -2758,25 +2767,25 @@ function Cs(e, t, n) {
2758
2767
  return {
2759
2768
  // No spread: a flood is the case with many elements, and an argument list
2760
2769
  // of that size blows the call stack at some point. A loop cannot.
2761
- from: _s(r),
2762
- to: ys(r),
2770
+ from: ks(r),
2771
+ to: Ss(r),
2763
2772
  count: o.length,
2764
2773
  alarms: o.map((s) => s.id)
2765
2774
  };
2766
2775
  }
2767
- function Ss(e, t) {
2776
+ function Ns(e, t) {
2768
2777
  const n = new Set(t);
2769
2778
  return e.reduce(
2770
2779
  (o, r) => o + (n.has(r.id) && !De(r.lifecycle) ? 1 : 0),
2771
2780
  0
2772
2781
  );
2773
2782
  }
2774
- function si(e, t, n) {
2783
+ function ii(e, t, n) {
2775
2784
  const o = new Set(t);
2776
2785
  let r = 0;
2777
- return { alarms: e.map((i) => !o.has(i.id) || De(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: ks(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
2786
+ return { alarms: e.map((i) => !o.has(i.id) || De(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: _s(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
2778
2787
  }
2779
- const Ns = (e) => [
2788
+ const xs = (e) => [
2780
2789
  {
2781
2790
  id: "type",
2782
2791
  label: e.columnAlarm,
@@ -2794,16 +2803,16 @@ const Ns = (e) => [
2794
2803
  { id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
2795
2804
  { id: "age", label: e.columnAge, value: (t) => t.age },
2796
2805
  { id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
2797
- ], xs = Ns(rn), As = [
2806
+ ], As = xs(sn), Ts = [
2798
2807
  { column: "priority", direction: "asc" },
2799
2808
  { column: "acknowledgement", direction: "asc" },
2800
2809
  { column: "raised", direction: "desc" }
2801
- ], Ts = (e) => ({
2810
+ ], Fs = (e) => ({
2802
2811
  id: e,
2803
2812
  label: e,
2804
2813
  priority: "high"
2805
2814
  });
2806
- function ii(e, t = {}) {
2815
+ function ai(e, t = {}) {
2807
2816
  const {
2808
2817
  alarms: n,
2809
2818
  types: o,
@@ -2811,49 +2820,49 @@ function ii(e, t = {}) {
2811
2820
  chatter: s,
2812
2821
  flood: i,
2813
2822
  keepDone: a = !1,
2814
- columns: c = xs
2815
- } = e, u = new Map(o.map((m) => [m.id, m])), h = vs(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), f = i ? Cs(n, i, r) : null, b = new Set((f == null ? void 0 : f.alarms) ?? []), p = n.filter((m) => a || !bs(m.lifecycle)).map((m) => {
2816
- const w = u.get(m.type) ?? Ts(m.type), g = h.get(m.type) ?? 0;
2823
+ columns: c = As
2824
+ } = e, u = new Map(o.map((p) => [p.id, p])), h = ys(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Cs(n, i, r) : null, m = new Set((d == null ? void 0 : d.alarms) ?? []), w = n.filter((p) => a || !vs(p.lifecycle)).map((p) => {
2825
+ const b = u.get(p.type) ?? Fs(p.type), g = h.get(p.type) ?? 0;
2817
2826
  return {
2818
- id: m.id,
2819
- alarm: m,
2820
- type: w,
2821
- lifecycle: m.lifecycle,
2822
- priority: w.priority,
2823
- rank: ms(w.priority),
2824
- age: r - m.raised,
2825
- duration: (m.cleared ?? r) - m.raised,
2827
+ id: p.id,
2828
+ alarm: p,
2829
+ type: b,
2830
+ lifecycle: p.lifecycle,
2831
+ priority: b.priority,
2832
+ rank: ws(b.priority),
2833
+ age: r - p.raised,
2834
+ duration: (p.cleared ?? r) - p.raised,
2826
2835
  frequency: g,
2827
2836
  chatters: s !== void 0 && g >= s.atLeast,
2828
- inFlood: b.has(m.id)
2837
+ inFlood: m.has(p.id)
2829
2838
  };
2830
- }), k = tt(p, c, {
2839
+ }), v = tt(w, c, {
2831
2840
  ...t,
2832
- sort: t.sort === void 0 ? As : t.sort
2841
+ sort: t.sort === void 0 ? Ts : t.sort
2833
2842
  });
2834
2843
  return {
2835
- ...k,
2836
- flood: f,
2837
- standingUnacknowledged: k.filtered.reduce(
2838
- (m, w) => m + (w.lifecycle === "standing-unacknowledged" ? 1 : 0),
2844
+ ...v,
2845
+ flood: d,
2846
+ standingUnacknowledged: v.filtered.reduce(
2847
+ (p, b) => p + (b.lifecycle === "standing-unacknowledged" ? 1 : 0),
2839
2848
  0
2840
2849
  )
2841
2850
  };
2842
2851
  }
2843
- const Fs = "_list_alpwk_4 _text_1hv7a_23", Os = "_bar_alpwk_12", Ls = "_heading_alpwk_19", Rs = "_filler_alpwk_25", Ms = "_asOf_alpwk_29", Vs = "_live_alpwk_46", Ds = "_label_alpwk_51", Is = "_counter_alpwk_55", Ps = "_lifecycle_alpwk_59", Gs = "_empty_alpwk_63", Es = "_row_alpwk_70", re = {
2844
- list: Fs,
2845
- bar: Os,
2852
+ const Os = "_list_17f0w_4 _text_1hv7a_23", Rs = "_bar_17f0w_12", Ls = "_heading_17f0w_19", Ms = "_filler_17f0w_25", Vs = "_asOf_17f0w_29", Ds = "_live_17f0w_46", Is = "_label_17f0w_51", Ps = "_counter_17f0w_55", Bs = "_lifecycle_17f0w_59", Gs = "_empty_17f0w_63", Es = "_row_17f0w_70", oe = {
2853
+ list: Os,
2854
+ bar: Rs,
2846
2855
  heading: Ls,
2847
- filler: Rs,
2848
- asOf: Ms,
2849
- live: Vs,
2850
- label: Ds,
2851
- counter: Is,
2852
- lifecycle: Ps,
2856
+ filler: Ms,
2857
+ asOf: Vs,
2858
+ live: Ds,
2859
+ label: Is,
2860
+ counter: Ps,
2861
+ lifecycle: Bs,
2853
2862
  empty: Gs,
2854
2863
  row: Es
2855
2864
  };
2856
- function Bs(e, t) {
2865
+ function zs(e, t) {
2857
2866
  switch (e) {
2858
2867
  case "standing-unacknowledged":
2859
2868
  return t.lifecycleStandingUnacknowledged;
@@ -2865,26 +2874,26 @@ function Bs(e, t) {
2865
2874
  return t.lifecycleClearedAcknowledged;
2866
2875
  }
2867
2876
  }
2868
- function zs(e, t) {
2877
+ function Hs(e, t) {
2869
2878
  return e === "high" ? t.priorityHigh : e === "medium" ? t.priorityMedium : t.priorityLow;
2870
2879
  }
2871
2880
  function js(e) {
2872
2881
  return e === "high" ? "danger" : e === "medium" ? "warning" : "neutral";
2873
2882
  }
2874
- function Hs(e, t) {
2883
+ function $s(e, t) {
2875
2884
  const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60, s = [];
2876
2885
  return o > 0 && s.push(t.hoursShort(o)), (o === 0 || r > 0) && s.push(t.minutesShort(r)), s.join(" ");
2877
2886
  }
2878
- function ai(e) {
2887
+ function li(e) {
2879
2888
  const { asOf: t, freshness: n, ...o } = e;
2880
- return t === void 0 || n === void 0 ? /* @__PURE__ */ l(Ut, { ...o, freshness: null }) : /* @__PURE__ */ l($s, { ...o, asOf: t, ages: n });
2889
+ return t === void 0 || n === void 0 ? /* @__PURE__ */ l(Ut, { ...o, freshness: null }) : /* @__PURE__ */ l(Ks, { ...o, asOf: t, ages: n });
2881
2890
  }
2882
- function $s({
2891
+ function Ks({
2883
2892
  asOf: e,
2884
2893
  ages: t,
2885
2894
  ...n
2886
2895
  }) {
2887
- const o = sn(e, t);
2896
+ const o = an(e, t);
2888
2897
  return /* @__PURE__ */ l(Ut, { ...n, freshness: o });
2889
2898
  }
2890
2899
  function Ut({
@@ -2896,37 +2905,37 @@ function Ut({
2896
2905
  freshness: s,
2897
2906
  ...i
2898
2907
  }) {
2899
- const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: f, Column: b } = gs(e.visible, { rowKey: (g) => g.id, selection: t }), p = j(() => e.filtered.map((g) => g.alarm), [e.filtered]), k = j(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), m = j(() => Ss(p, k), [p, k]), w = Tt(o, "compact");
2900
- return /* @__PURE__ */ L("div", { className: [re.list, r].filter(Boolean).join(" "), ...i, children: [
2901
- /* @__PURE__ */ L("div", { className: re.bar, children: [
2902
- /* @__PURE__ */ l("span", { className: re.heading, children: a.alarms }),
2908
+ const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: d, Column: m } = ps(e.visible, { rowKey: (g) => g.id, selection: t }), w = $(() => e.filtered.map((g) => g.alarm), [e.filtered]), v = $(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), p = $(() => Ns(w, v), [w, v]), b = Tt(o, "compact");
2909
+ return /* @__PURE__ */ O("div", { className: [oe.list, r].filter(Boolean).join(" "), ...i, children: [
2910
+ /* @__PURE__ */ O("div", { className: oe.bar, children: [
2911
+ /* @__PURE__ */ l("span", { className: oe.heading, children: a.alarms }),
2903
2912
  e.flood !== null && /* @__PURE__ */ l(Ie, { tone: "warning", children: a.floodHint(e.flood.count) }),
2904
- u && s !== null && /* @__PURE__ */ L("span", { className: re.asOf, "data-freshness": s.freshness, children: [
2913
+ u && s !== null && /* @__PURE__ */ O("span", { className: oe.asOf, "data-freshness": s.freshness, children: [
2905
2914
  s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
2906
2915
  s.age !== null && ` · ${c.relative(s.age)}`
2907
2916
  ] }),
2908
- /* @__PURE__ */ l("span", { className: re.filler }),
2909
- t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: m === 0, onClick: () => n(k), children: m === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(m) })
2917
+ /* @__PURE__ */ l("span", { className: oe.filler }),
2918
+ t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: p === 0, onClick: () => n(v), children: p === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(p) })
2910
2919
  ] }),
2911
- /* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: re.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
2912
- /* @__PURE__ */ L(
2913
- f,
2920
+ /* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: oe.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
2921
+ /* @__PURE__ */ O(
2922
+ d,
2914
2923
  {
2915
2924
  ariaLabel: a.alarms,
2916
2925
  selectable: t !== void 0,
2917
- density: w,
2926
+ density: b,
2918
2927
  stickyHeader: !0,
2919
- rowProps: (g) => ({ className: re.row, "data-lifecycle": g.lifecycle, "data-priority": g.priority }),
2920
- empty: /* @__PURE__ */ l("span", { className: re.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
2928
+ rowProps: (g) => ({ className: oe.row, "data-lifecycle": g.lifecycle, "data-priority": g.priority }),
2929
+ empty: /* @__PURE__ */ l("span", { className: oe.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
2921
2930
  children: [
2922
- /* @__PURE__ */ l(b, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, v) => /* @__PURE__ */ L(J, { children: [
2923
- /* @__PURE__ */ l("span", { className: re.label, children: g }),
2924
- v.chatters && /* @__PURE__ */ l(Ie, { tone: "warning", pill: !0, className: re.counter, children: a.chatterHint(v.frequency) })
2931
+ /* @__PURE__ */ l(m, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, y) => /* @__PURE__ */ O(Q, { children: [
2932
+ /* @__PURE__ */ l("span", { className: oe.label, children: g }),
2933
+ y.chatters && /* @__PURE__ */ l(Ie, { tone: "warning", pill: !0, className: oe.counter, children: a.chatterHint(y.frequency) })
2925
2934
  ] }) }),
2926
- /* @__PURE__ */ l(b, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g) => /* @__PURE__ */ l("span", { className: re.lifecycle, children: Bs(g, a) }) }),
2927
- /* @__PURE__ */ l(b, { value: "priority", label: a.columnPriority, sortable: !1, children: (g) => /* @__PURE__ */ l(Ie, { tone: js(g), children: zs(g, a) }) }),
2935
+ /* @__PURE__ */ l(m, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g) => /* @__PURE__ */ l("span", { className: oe.lifecycle, children: zs(g, a) }) }),
2936
+ /* @__PURE__ */ l(m, { value: "priority", label: a.columnPriority, sortable: !1, children: (g) => /* @__PURE__ */ l(Ie, { tone: js(g), children: Hs(g, a) }) }),
2928
2937
  /* @__PURE__ */ l(
2929
- b,
2938
+ m,
2930
2939
  {
2931
2940
  id: "raised",
2932
2941
  label: a.columnRaised,
@@ -2935,38 +2944,38 @@ function Ut({
2935
2944
  sortable: !1
2936
2945
  }
2937
2946
  ),
2938
- /* @__PURE__ */ l(b, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => Hs(g, a) }),
2939
- /* @__PURE__ */ l(b, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
2947
+ /* @__PURE__ */ l(m, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => $s(g, a) }),
2948
+ /* @__PURE__ */ l(m, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
2940
2949
  ]
2941
2950
  }
2942
2951
  )
2943
2952
  ] });
2944
2953
  }
2945
2954
  export {
2946
- xs as ALARM_COLUMNS,
2947
- ai as AlarmList,
2948
- ei as ColumnMenu,
2949
- As as DEFAULT_ORDER,
2950
- ti as Export,
2951
- ps as PRIORITIES,
2952
- ni as Pagination,
2953
- Zs as Search,
2954
- Qs as Toolbar,
2955
- si as acknowledge,
2956
- Ns as alarmColumns,
2957
- ii as alarmModel,
2958
- Js as column,
2955
+ As as ALARM_COLUMNS,
2956
+ li as AlarmList,
2957
+ ti as ColumnMenu,
2958
+ Ts as DEFAULT_ORDER,
2959
+ ni as Export,
2960
+ ms as PRIORITIES,
2961
+ oi as Pagination,
2962
+ ei as Search,
2963
+ Zs as Toolbar,
2964
+ ii as acknowledge,
2965
+ xs as alarmColumns,
2966
+ ai as alarmModel,
2967
+ Qs as column,
2959
2968
  Xs as columnFilter,
2960
- Ss as countAcknowledgeable,
2961
- ri as countInWindow,
2969
+ Ns as countAcknowledgeable,
2970
+ si as countInWindow,
2962
2971
  Cs as detectFlood,
2963
- vs as frequencyByType,
2964
- oi as hasReturned,
2972
+ ys as frequencyByType,
2973
+ ri as hasReturned,
2965
2974
  De as isAcknowledged,
2966
- bs as isDone,
2967
- ws as isStanding,
2968
- ks as nextLifecycleState,
2969
- ms as priorityRank,
2970
- gs as useTable,
2971
- ln as useTableSelection
2975
+ vs as isDone,
2976
+ bs as isStanding,
2977
+ _s as nextLifecycleState,
2978
+ ws as priorityRank,
2979
+ ps as useTable,
2980
+ cn as useTableSelection
2972
2981
  };