react-semaphor 0.1.540 → 0.1.541

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.
Files changed (34) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/briefings/index.js +41 -38
  3. package/dist/chunks/{aggregate-table-row-presentation-BjK9YfMI.js → aggregate-table-row-presentation-B_vQjYR3.js} +319 -302
  4. package/dist/chunks/{assistant-chat-ya7xopaC.js → assistant-chat-D1fDZD6O.js} +3 -3
  5. package/dist/chunks/{dashboard-B6Bithfl.js → dashboard-B6IrON_Q.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-DJI-zfEq.js → dashboard-briefing-launcher-DwjFpewq.js} +4 -4
  7. package/dist/chunks/{dashboard-controls-Dh7HqoKy.js → dashboard-controls-C_BI28ME.js} +5 -5
  8. package/dist/chunks/{dashboard-json-BnmlB71h.js → dashboard-json-DDY15Trn.js} +1 -1
  9. package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-DP_Op5mu.js} +1168 -1166
  10. package/dist/chunks/{edit-dashboard-visual-CydOkSko.js → edit-dashboard-visual-CH2dzWW-.js} +4 -4
  11. package/dist/chunks/{index-CqMiAkay.js → index-DaQlghLY.js} +547 -511
  12. package/dist/chunks/{report-preferences-dialog-neMDolLg.js → report-preferences-dialog-DpNkFfQO.js} +5 -5
  13. package/dist/chunks/{saved-dashboard-context-CCrLpfSQ.js → saved-dashboard-context-CJ2WpoMF.js} +1 -1
  14. package/dist/chunks/{semaphor-ready-indicator--4DWtVBu.js → semaphor-ready-indicator-KT598QJq.js} +29621 -29528
  15. package/dist/chunks/{shelf-drop-preview-context-CpdB5ois.js → shelf-drop-preview-context-BxV3Fl8h.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-8g6Zhphh.js → use-create-flow-overlay-state-DdD12SMY.js} +2 -2
  17. package/dist/dashboard/index.js +1 -1
  18. package/dist/dashboard-authoring/index.js +582 -568
  19. package/dist/format-utils/index.js +117 -114
  20. package/dist/index.js +10 -10
  21. package/dist/pdf-export-policy/index.js +20 -10
  22. package/dist/surfboard/index.js +1 -1
  23. package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
  24. package/dist/types/briefings/index.d.ts +1 -0
  25. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  26. package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
  27. package/dist/types/lib/types/common-types.d.ts +7 -0
  28. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  29. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
  30. package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
  31. package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
  32. package/dist/types/shared/format-utils/index.d.ts +1 -0
  33. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
  34. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
- var ae = Object.defineProperty;
2
- var ne = (e, t, o) => t in e ? ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var N = (e, t, o) => ne(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { i as se, g as S, k as le, B as R, q as ie, A as ue, y as ce, s as me } from "./raw-temporal-D61lr48Y.js";
5
- import { h as G, m as _, i as j, j as de, k as X, l as b } from "./matrix-formatter-DQ8avoIQ.js";
1
+ var ne = Object.defineProperty;
2
+ var se = (e, t, a) => t in e ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
+ var V = (e, t, a) => se(e, typeof t != "symbol" ? t + "" : t, a);
4
+ import { i as le, g as L, k as ie, B as R, q as ue, A as ce, y as me, s as de } from "./raw-temporal-D61lr48Y.js";
5
+ import { h as G, m as _, i as X, j as fe, k as Z, l as b } from "./matrix-formatter-DQ8avoIQ.js";
6
6
  import { h as E } from "./csv-utils-GUfKyT1J.js";
7
- import { l as fe, aD as Z, w as M, A as ge, z as he } from "./validators-Ej1DdCXa.js";
7
+ import { l as ge, aD as W, w as k, A as F, z as he } from "./validators-Ej1DdCXa.js";
8
8
  import "./matrix-operation-contract-B8PBF1Gd.js";
9
9
  import "./analytics-base-schemas-BFAoRlkU.js";
10
10
  import "zod";
11
- import { g as W, p as v } from "./matrix-definition-DQDI2okF.js";
12
- import { PDF_SAFETY_LIMIT_EXCEEDED as K, getUtf8ByteLength as ye, FAST_PDF_POLICY as pe } from "../pdf-export-policy/index.js";
11
+ import { g as K, p as v } from "./matrix-definition-DQDI2okF.js";
12
+ import { PDF_SAFETY_LIMIT_EXCEEDED as Y, getUtf8ByteLength as ye, FAST_PDF_POLICY as pe } from "../pdf-export-policy/index.js";
13
13
  import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as we } from "../value-format-preferences/index.js";
14
14
  import { f as be, c as Te, g as ve } from "./temporal-bucket-D8JF7zKz.js";
15
- import { z as Se, g as Le } from "./zoned-wall-clock-MulfA26h.js";
16
- function Ce(e, t, o) {
17
- const a = {
15
+ import { z as Le, g as Se } from "./zoned-wall-clock-MulfA26h.js";
16
+ function Ce(e, t, a) {
17
+ const o = {
18
18
  ...t,
19
- locale: t.locale ?? o
19
+ locale: t.locale ?? a
20
20
  };
21
- if (a.type === "number")
22
- return S(e, a);
23
- const { prefix: r, suffix: s, ...n } = a;
24
- return `${r ?? ""}${S(e, {
21
+ if (o.type === "number")
22
+ return L(e, o);
23
+ const { prefix: r, suffix: s, ...n } = o;
24
+ return `${r ?? ""}${L(e, {
25
25
  ...n,
26
- negativeStyle: a.type === "currency" ? a.negativeStyle : "minus"
26
+ negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
27
27
  })}${s ?? ""}`;
28
28
  }
29
- function P(e, t, o) {
30
- return e === null ? { value: e, text: null } : !t || !se(t) && t.type !== "duration" ? {
29
+ function x(e, t, a) {
30
+ return e === null ? { value: e, text: null } : !t || !le(t) && t.type !== "duration" ? {
31
31
  value: e,
32
- text: S(e, { type: "number", locale: o })
32
+ text: L(e, { type: "number", locale: a })
33
33
  } : t.type === "duration" ? {
34
34
  value: e,
35
- text: le(e, {
35
+ text: ie(e, {
36
36
  inputUnit: t.inputUnit,
37
37
  outputStyle: t.outputStyle,
38
38
  largestUnit: t.largestUnit,
@@ -42,84 +42,84 @@ function P(e, t, o) {
42
42
  suffix: t.suffix,
43
43
  negativeInParentheses: t.negativeStyle === "parentheses"
44
44
  })
45
- } : { value: e, text: Ce(e, t, o) };
45
+ } : { value: e, text: Ce(e, t, a) };
46
46
  }
47
- function U(e, t, o, a) {
48
- return e === null ? { value: e, text: null } : a === "percent" ? {
47
+ function U(e, t, a, o) {
48
+ return e === null ? { value: e, text: null } : o === "percent" ? {
49
49
  value: e,
50
- text: S(e, {
50
+ text: L(e, {
51
51
  type: "percent",
52
- locale: o,
52
+ locale: a,
53
53
  minimumFractionDigits: t,
54
54
  maximumFractionDigits: t,
55
55
  percentValueMode: "fraction"
56
56
  })
57
57
  } : {
58
58
  value: e,
59
- text: S(e, {
59
+ text: L(e, {
60
60
  type: "number",
61
- locale: o,
61
+ locale: a,
62
62
  minimumFractionDigits: t,
63
63
  maximumFractionDigits: t,
64
64
  suffix: "×"
65
65
  })
66
66
  };
67
67
  }
68
- function V(e, t) {
68
+ function O(e, t) {
69
69
  if (e === void 0) return t;
70
70
  if (!Number.isInteger(e) || e < 0 || e > 6)
71
71
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
72
72
  return e;
73
73
  }
74
- function Tt(e, t) {
75
- const o = {
74
+ function St(e, t) {
75
+ const a = {
76
76
  mode: t.displayMode,
77
- current: P(
77
+ current: x(
78
78
  e.currentValue,
79
79
  t.metricFormat,
80
80
  t.locale
81
81
  ),
82
- comparison: P(
82
+ comparison: x(
83
83
  e.comparisonValue,
84
84
  t.metricFormat,
85
85
  t.locale
86
86
  )
87
87
  };
88
- return (t.displayMode === "difference" || t.displayMode === "both") && (o.difference = P(
88
+ return (t.displayMode === "difference" || t.displayMode === "both") && (a.difference = x(
89
89
  e.delta,
90
90
  t.metricFormat,
91
91
  t.locale
92
- )), (t.displayMode === "percent_change" || t.displayMode === "both") && (o.percentChange = U(
92
+ )), (t.displayMode === "percent_change" || t.displayMode === "both") && (a.percentChange = U(
93
93
  e.percentChange,
94
- V(t.precision, 1),
94
+ O(t.precision, 1),
95
95
  t.locale,
96
96
  "percent"
97
- )), t.displayMode === "ratio" && (o.ratio = U(
97
+ )), t.displayMode === "ratio" && (a.ratio = U(
98
98
  e.ratio,
99
- V(t.precision, 2),
99
+ O(t.precision, 2),
100
100
  t.locale,
101
101
  "ratio"
102
- )), o;
102
+ )), a;
103
103
  }
104
- const ke = 1e4, vt = 1e6, St = 5e6, Lt = 1024 ** 3, Ct = 1024 ** 3;
105
- function kt(e) {
106
- return e > ke;
104
+ const Me = 1e4, Ct = 1e6, Mt = 5e6, At = 1024 ** 3, kt = 1024 ** 3;
105
+ function $t(e) {
106
+ return e > Me;
107
107
  }
108
- const At = {
108
+ const Et = {
109
109
  rowLabels: "tabular",
110
110
  subtotals: "after"
111
111
  };
112
- function Mt(e, t) {
113
- const o = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, a = e.totals.rows;
112
+ function xt(e, t) {
113
+ const a = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
114
114
  return {
115
115
  ...e,
116
- layout: o,
116
+ layout: a,
117
117
  totals: {
118
118
  ...e.totals,
119
119
  rows: {
120
- ...a,
120
+ ...o,
121
121
  levels: Object.fromEntries(
122
- Object.entries(a.levels).map(([r, s]) => [
122
+ Object.entries(o.levels).map(([r, s]) => [
123
123
  r,
124
124
  { ...s, position: t.subtotals }
125
125
  ])
@@ -129,27 +129,27 @@ function Mt(e, t) {
129
129
  };
130
130
  }
131
131
  const Ae = 2;
132
- function Me(e) {
133
- return typeof e == "number" ? Number.isInteger(e) : Z(e) ? !e.value.includes(".") : !0;
132
+ function ke(e) {
133
+ return typeof e == "number" ? Number.isInteger(e) : W(e) ? !e.value.includes(".") : !0;
134
134
  }
135
- function $e(e, t, o) {
136
- const a = e.descriptors.measures.filter(
137
- (n) => o.measureFormats[n.id] === void 0 && n.semanticFormat === void 0 && fe(n.column.dataType) === "number"
135
+ function $e(e, t, a) {
136
+ const o = e.descriptors.measures.filter(
137
+ (n) => a.measureFormats[n.id] === void 0 && n.semanticFormat === void 0 && ge(n.column.dataType) === "number"
138
138
  );
139
- if (a.length === 0) return o;
139
+ if (o.length === 0) return a;
140
140
  const r = /* @__PURE__ */ new Set();
141
141
  e.columns.forEach((n, l) => {
142
142
  if (!(n.kind !== "measure" || r.has(n.measureId)))
143
143
  for (const c of t) {
144
144
  const i = c.values[l];
145
- if ((i == null ? void 0 : i.kind) === "value" && !Me(i.value)) {
145
+ if ((i == null ? void 0 : i.kind) === "value" && !ke(i.value)) {
146
146
  r.add(n.measureId);
147
147
  return;
148
148
  }
149
149
  }
150
150
  });
151
- const s = { ...o.measureFormats };
152
- for (const { id: n } of a) {
151
+ const s = { ...a.measureFormats };
152
+ for (const { id: n } of o) {
153
153
  const l = r.has(n) ? Ae : 0;
154
154
  s[n] = {
155
155
  type: "number",
@@ -158,25 +158,25 @@ function $e(e, t, o) {
158
158
  useGrouping: !0
159
159
  };
160
160
  }
161
- return { ...o, measureFormats: s };
161
+ return { ...a, measureFormats: s };
162
162
  }
163
- function k(e) {
164
- return M(e.slice(0, -1));
163
+ function M(e) {
164
+ return k(e.slice(0, -1));
165
165
  }
166
166
  function Ee(e, t) {
167
- return t.length > e.length && M(t.slice(0, e.length)) === M(e);
168
- }
169
- function Pe(e) {
170
- return e.map((t, o) => {
171
- if (o === 0 || t.kind !== "layout") return !1;
172
- const a = e[o - 1];
173
- if (a.kind !== "layout") return !1;
174
- if (t.role !== "member" || Ee(a.rowPath, t.rowPath)) return !0;
175
- const r = e[o - 2];
176
- return a.role === "member" && (!r || r.kind !== "layout" || r.role !== "member" || k(r.rowPath) !== k(a.rowPath)) && t.rowPath.length === a.rowPath.length && k(t.rowPath) === k(a.rowPath);
167
+ return t.length > e.length && k(t.slice(0, e.length)) === k(e);
168
+ }
169
+ function xe(e) {
170
+ return e.map((t, a) => {
171
+ if (a === 0 || t.kind !== "layout") return !1;
172
+ const o = e[a - 1];
173
+ if (o.kind !== "layout") return !1;
174
+ if (t.role !== "member" || Ee(o.rowPath, t.rowPath)) return !0;
175
+ const r = e[a - 2];
176
+ return o.role === "member" && (!r || r.kind !== "layout" || r.role !== "member" || M(r.rowPath) !== M(o.rowPath)) && t.rowPath.length === o.rowPath.length && M(t.rowPath) === M(o.rowPath);
177
177
  });
178
178
  }
179
- const xe = "pdf-group-continuation";
179
+ const Pe = "pdf-group-continuation";
180
180
  function _e(e) {
181
181
  if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
182
182
  return !0;
@@ -185,21 +185,21 @@ function _e(e) {
185
185
  return !0;
186
186
  return !1;
187
187
  }
188
- function Y(e, t, o) {
189
- return !(o != null && o.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || Z(t.value)) ? e : E(e);
188
+ function q(e, t, a) {
189
+ return !(a != null && a.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || W(t.value)) ? e : E(e);
190
190
  }
191
- function Ie(e, t, o) {
192
- const a = G(e.descriptors, t.presentation, o), r = e.columns.map((u) => {
191
+ function Ie(e, t, a) {
192
+ const o = G(e.descriptors, t.presentation, a), r = e.columns.map((u) => {
193
193
  var m;
194
- return u.kind === "measure" && ((m = a.measureSemantics.get(u.measureId)) == null ? void 0 : m.isNumeric) === !0;
195
- }), s = (u) => _([u], a.levels), n = (u, m, d) => j(u, m, t.presentation.totals[d], a.levels), l = e.columns.map((u) => {
194
+ return u.kind === "measure" && ((m = o.measureSemantics.get(u.measureId)) == null ? void 0 : m.isNumeric) === !0;
195
+ }), s = (u) => _([u], o.levels), n = (u, m, d) => X(u, m, t.presentation.totals[d], o.levels), l = e.columns.map((u) => {
196
196
  if (u.kind !== "measure") return u.label;
197
197
  const m = u.columnPath.map(s);
198
198
  return u.role !== "member" && m.push(n(u.columnPath, u.role, "columns")), [...m, u.label].join(" / ");
199
199
  }), c = Math.min(t.spec.columns.length, Math.max(
200
200
  0,
201
201
  ...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
202
- )), i = Array.from({ length: c + 1 }, (u, m) => e.columns.map((d) => m === c ? d.label : d.kind !== "measure" ? "" : m < d.columnPath.length ? s(d.columnPath[m]) : m === d.columnPath.length && d.role !== "member" ? n(d.columnPath, d.role, "columns") : "")), g = (u, m) => de({
202
+ )), i = Array.from({ length: c + 1 }, (u, m) => e.columns.map((d) => m === c ? d.label : d.kind !== "measure" ? "" : m < d.columnPath.length ? s(d.columnPath[m]) : m === d.columnPath.length && d.role !== "member" ? n(d.columnPath, d.role, "columns") : "")), g = (u, m) => fe({
203
203
  path: u.rowPath,
204
204
  role: u.kind === "layout" ? u.role : "member",
205
205
  levelCount: Math.max(1, t.spec.rows.length),
@@ -214,16 +214,16 @@ function Ie(e, t, o) {
214
214
  return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${n(u.rowPath, u.role, "rows")}`;
215
215
  if (y.kind === "level") {
216
216
  const C = t.spec.rows.findIndex((oe) => oe.id === y.levelId), w = d[C];
217
- return w != null && w.visible ? w.total ? n(u.rowPath, u.role, "rows") : _(w.path, a.levels) : "";
217
+ return w != null && w.visible ? w.total ? n(u.rowPath, u.role, "rows") : _(w.path, o.levels) : "";
218
218
  }
219
- const L = u.values[p], T = a.measures.get(y.measureId);
220
- if (L.kind === "value" && !T)
219
+ const S = u.values[p], T = o.measures.get(y.measureId);
220
+ if (S.kind === "value" && !T)
221
221
  throw new Error("Matrix value is missing its measure descriptor.");
222
- return X(L, T, t.presentation.absence);
222
+ return Z(S, T, t.presentation.absence);
223
223
  });
224
224
  }, h = (u, m) => f(u, m).map((d, y) => {
225
225
  const p = e.columns[y];
226
- return p.kind === "measure" ? Y(d, u.values[y], a.measureSemantics.get(p.measureId)) : E(d);
226
+ return p.kind === "measure" ? q(d, u.values[y], o.measureSemantics.get(p.measureId)) : E(d);
227
227
  });
228
228
  return {
229
229
  headers: l,
@@ -241,11 +241,11 @@ function Ie(e, t, o) {
241
241
  const d = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
242
242
  if (!d(u) || !d(m)) return [];
243
243
  const y = g(u, m);
244
- return e.columns.flatMap((p, L) => {
244
+ return e.columns.flatMap((p, S) => {
245
245
  var C;
246
246
  if (p.kind !== "level") return [];
247
247
  const T = t.spec.rows.findIndex((w) => w.id === p.levelId);
248
- return T < u.rowPath.length && ((C = y[T]) == null ? void 0 : C.visible) === !1 ? [L] : [];
248
+ return T < u.rowPath.length && ((C = y[T]) == null ? void 0 : C.visible) === !1 ? [S] : [];
249
249
  });
250
250
  },
251
251
  csvRow: (u) => h(u),
@@ -259,51 +259,51 @@ function Ie(e, t, o) {
259
259
  csvRows: (u, m) => u.map((d, y) => h(d, y ? u[y - 1] : m ?? void 0))
260
260
  };
261
261
  }
262
- function $t(e) {
262
+ function Pt(e) {
263
263
  return e.columns.map((t) => E(t.label));
264
264
  }
265
- function Et(e, t, o) {
265
+ function _t(e, t, a) {
266
266
  if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
267
267
  if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
268
- const a = [...e.rowPath, ...e.columnPath];
268
+ const o = [...e.rowPath, ...e.columnPath];
269
269
  return t.columns.map((r, s) => {
270
270
  if (r.kind === "measure") {
271
- const l = e.values[s], c = o.measures.get(r.measureId);
271
+ const l = e.values[s], c = a.measures.get(r.measureId);
272
272
  if (l.kind === "value" && !c) throw new Error("Matrix value is missing its measure descriptor.");
273
- return Y(
274
- X(l, c, o.absence),
273
+ return q(
274
+ Z(l, c, a.absence),
275
275
  l,
276
- o.measureSemantics.get(r.measureId)
276
+ a.measureSemantics.get(r.measureId)
277
277
  );
278
278
  }
279
- const n = r.kind === "level" ? a.find((l) => l.levelId === r.levelId) : void 0;
279
+ const n = r.kind === "level" ? o.find((l) => l.levelId === r.levelId) : void 0;
280
280
  if (!n) throw new Error("Flat Matrix row does not match its frozen layout.");
281
- return E(_([n], o.levels));
281
+ return E(_([n], a.levels));
282
282
  });
283
283
  }
284
284
  function De(e) {
285
- const t = Ie(e.layout, e.request, e.report), o = e.layout.columns.map((n, l) => ({
285
+ const t = Ie(e.layout, e.request, e.report), a = e.layout.columns.map((n, l) => ({
286
286
  index: l,
287
287
  columnId: `matrix:${l}`,
288
288
  label: t.headers[l],
289
289
  isNumeric: t.numericColumns[l]
290
- })), a = (n, l, c) => ({
290
+ })), o = (n, l, c) => ({
291
291
  text: n,
292
292
  colspan: 1,
293
293
  rowspan: 1,
294
- columnId: o[l].columnId,
294
+ columnId: a[l].columnId,
295
295
  isHeader: c,
296
- isNumeric: o[l].isNumeric,
297
- className: o[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
296
+ isNumeric: a[l].isNumeric,
297
+ className: a[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
298
298
  }), r = [], s = e.layout.columns.findIndex((n) => n.kind === "measure");
299
299
  e.request.spec.columns.length && s >= 0 && r.push({
300
300
  repeatHeader: !0,
301
301
  headerType: "pivot-axis",
302
302
  headerRowIndex: 0,
303
303
  cells: [
304
- ...s ? [{ ...a("", 0, !0), colspan: s }] : [],
304
+ ...s ? [{ ...o("", 0, !0), colspan: s }] : [],
305
305
  {
306
- ...a(e.request.spec.columns.map((n) => W(n, e.request.presentation)).join(" / "), s, !0),
306
+ ...o(e.request.spec.columns.map((n) => K(n, e.request.presentation)).join(" / "), s, !0),
307
307
  colspan: e.layout.columns.length - s,
308
308
  isNumeric: !1,
309
309
  className: ""
@@ -315,7 +315,7 @@ function De(e) {
315
315
  repeatHeader: !0,
316
316
  headerType: n === t.headerBands.length - 1 ? "metrics" : "pivot-level",
317
317
  headerRowIndex: r.length,
318
- cells: l.map((c, i) => a(c, i, !0))
318
+ cells: l.map((c, i) => o(c, i, !0))
319
319
  });
320
320
  return {
321
321
  headers: r,
@@ -327,7 +327,7 @@ function De(e) {
327
327
  subtotalLevel: String(n.rowPath.length),
328
328
  // A tabular layout prints each label once unless it repeats them; the
329
329
  // blank cell continues its group, so a grid draws no rule above it.
330
- cells: t.row(n, e.rows[l - 1]).map((i, g) => c.has(g) ? { ...a(i, g, !1), className: xe } : a(i, g, !1))
330
+ cells: t.row(n, e.rows[l - 1]).map((i, g) => c.has(g) ? { ...o(i, g, !1), className: Pe } : o(i, g, !1))
331
331
  };
332
332
  }),
333
333
  grandTotal: null,
@@ -335,34 +335,34 @@ function De(e) {
335
335
  metadata: {
336
336
  tableType: "pivot",
337
337
  totalRows: e.rows.length,
338
- totalColumns: o.length,
338
+ totalColumns: a.length,
339
339
  rowLevels: e.layout.columns.filter((n) => n.kind !== "measure").length,
340
340
  pivotLevels: e.request.spec.columns.length,
341
341
  hasGrandTotal: !1,
342
- columnOrder: o.map((n) => n.columnId),
343
- columns: o
342
+ columnOrder: a.map((n) => n.columnId),
343
+ columns: a
344
344
  }
345
345
  };
346
346
  }
347
- function Re(e, t, o) {
348
- const { levels: a } = G(e.descriptors, t.presentation, o), r = t.spec.columns.length > 0, s = [], n = [], l = e.columns.map((i, g) => {
347
+ function Re(e, t, a) {
348
+ const { levels: o } = G(e.descriptors, t.presentation, a), r = t.spec.columns.length > 0, s = [], n = [], l = e.columns.map((i, g) => {
349
349
  if (i.kind !== "measure") return null;
350
- const f = r ? `${i.role}:${M(i.columnPath)}` : `measure:${g}`;
350
+ const f = r ? `${i.role}:${k(i.columnPath)}` : `measure:${g}`;
351
351
  let h = s.indexOf(f);
352
- return h < 0 && (h = s.push(f) - 1, n.push(r ? j(i.columnPath, i.role, t.presentation.totals.columns, a) : i.label)), h;
352
+ return h < 0 && (h = s.push(f) - 1, n.push(r ? X(i.columnPath, i.role, t.presentation.totals.columns, o) : i.label)), h;
353
353
  }), c = t.spec.columns[t.spec.columns.length - 1];
354
354
  return {
355
355
  columnGroups: l,
356
356
  groupLabels: n,
357
357
  /** What bands name their groups by: the innermost column level, or "Measures". */
358
- groupLevelLabel: c ? W(c, t.presentation) : "Measures"
358
+ groupLevelLabel: c ? K(c, t.presentation) : "Measures"
359
359
  };
360
360
  }
361
- function Pt(e) {
362
- const { layout: t, rows: o, report: a } = e, r = {
361
+ function It(e) {
362
+ const { layout: t, rows: a, report: o } = e, r = {
363
363
  ...e.request,
364
- presentation: $e(t, o, e.request.presentation)
365
- }, s = De({ layout: t, rows: o, request: r, report: a }), n = Pe(o), l = Re(t, r, a), c = {
364
+ presentation: $e(t, a, e.request.presentation)
365
+ }, s = De({ layout: t, rows: a, request: r, report: o }), n = xe(a), l = Re(t, r, o), c = {
366
366
  ...s,
367
367
  rows: s.rows.map((i, g) => ({ ...i, keepWithPrevious: n[g] })),
368
368
  metadata: { ...s.metadata, ...l }
@@ -372,41 +372,41 @@ function Pt(e) {
372
372
  class Fe extends Error {
373
373
  constructor() {
374
374
  super(...arguments);
375
- N(this, "code", K);
375
+ V(this, "code", Y);
376
376
  }
377
377
  }
378
- function O(e) {
378
+ function B(e) {
379
379
  if (!e || typeof e != "object")
380
380
  return;
381
- const { error: t, message: o, detail: a } = e;
382
- for (const r of [t, o, a])
381
+ const { error: t, message: a, detail: o } = e;
382
+ for (const r of [t, a, o])
383
383
  if (typeof r == "string" && r.trim())
384
384
  return r.trim();
385
385
  }
386
386
  async function Ne(e) {
387
- const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), o = e.headers.get("content-type") || "";
387
+ const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), a = e.headers.get("content-type") || "";
388
388
  try {
389
- if (o.includes("application/json")) {
389
+ if (a.includes("application/json")) {
390
390
  const r = await e.json(), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
391
- return { message: O(r) || t, code: s };
391
+ return { message: B(r) || t, code: s };
392
392
  }
393
- const a = await e.text();
394
- if (!a.trim())
393
+ const o = await e.text();
394
+ if (!o.trim())
395
395
  return { message: t };
396
396
  try {
397
- const r = JSON.parse(a), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
397
+ const r = JSON.parse(o), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
398
398
  return {
399
- message: O(r) || a.trim(),
399
+ message: B(r) || o.trim(),
400
400
  code: s
401
401
  };
402
402
  } catch {
403
- return { message: a.trim() };
403
+ return { message: o.trim() };
404
404
  }
405
405
  } catch {
406
406
  return { message: t };
407
407
  }
408
408
  }
409
- async function xt(e) {
409
+ async function Dt(e) {
410
410
  if (!e.token) throw new Error("Missing auth token for PDF export");
411
411
  if (ye(e.serializedPayload) > pe.maxRequestBytes)
412
412
  throw new Error("Fast-path PDF request exceeds the structured body limit");
@@ -417,22 +417,22 @@ async function xt(e) {
417
417
  signal: e.signal
418
418
  });
419
419
  if (!t.ok) {
420
- const a = await Ne(t);
421
- throw a.code === K ? new Fe(a.message) : new Error(a.message);
420
+ const o = await Ne(t);
421
+ throw o.code === Y ? new Fe(o.message) : new Error(o.message);
422
422
  }
423
- const o = await t.json();
424
- if (o != null && o.error) throw new Error(o.error);
425
- if (typeof (o == null ? void 0 : o.url) != "string" || !o.url.trim())
423
+ const a = await t.json();
424
+ if (a != null && a.error) throw new Error(a.error);
425
+ if (typeof (a == null ? void 0 : a.url) != "string" || !a.url.trim())
426
426
  throw new Error("Fast-path PDF response missing download URL");
427
- return o;
427
+ return a;
428
428
  }
429
- const Ue = /* @__PURE__ */ new Set(["short", "medium", "long"]), Ve = /^(\d{4})-(\d{2})-(\d{2})$/, Oe = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, Be = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, F = " – ";
430
- function _t(e) {
429
+ const Ve = /* @__PURE__ */ new Set(["short", "medium", "long"]), Ue = /^(\d{4})-(\d{2})-(\d{2})$/, Oe = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, Be = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, N = " – ";
430
+ function Rt(e) {
431
431
  if (!ve(e)) return;
432
432
  const t = Object.keys(e);
433
433
  if (e.mode === "period_label" && t.length === 1)
434
434
  return { mode: "period_label" };
435
- if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Ue.has(e.dateStyle))
435
+ if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Ve.has(e.dateStyle))
436
436
  return { mode: "style", dateStyle: e.dateStyle };
437
437
  if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && ze(e.pattern) === null)
438
438
  return {
@@ -443,23 +443,23 @@ function _t(e) {
443
443
  }
444
444
  function ze(e) {
445
445
  try {
446
- return ce({ dialect: "semaphor_tokens", pattern: e }), null;
446
+ return me({ dialect: "semaphor_tokens", pattern: e }), null;
447
447
  } catch (t) {
448
448
  return t instanceof Error ? t.message : "The pattern is invalid.";
449
449
  }
450
450
  }
451
- function It(e) {
452
- const { value: t, part: o, presentation: a, preferences: r, calendar: s } = e;
453
- if ((a == null ? void 0 : a.mode) === "period_label" && t.periodLabel && o === "range")
451
+ function Ft(e) {
452
+ const { value: t, part: a, presentation: o, preferences: r, calendar: s } = e;
453
+ if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && a === "range")
454
454
  return { ok: !0, text: t.periodLabel };
455
- const [n, l] = t.bounds, i = l === void 0 || o === "start" ? [{ raw: n, role: "start" }] : o === "end" ? [{ raw: l, role: "end" }] : [
455
+ const [n, l] = t.bounds, i = l === void 0 || a === "start" ? [{ raw: n, role: "start" }] : a === "end" ? [{ raw: l, role: "end" }] : [
456
456
  { raw: n, role: "start" },
457
457
  { raw: l, role: "end" }
458
458
  ], g = i.map(({ raw: m }) => Ze(m, s.tz));
459
459
  if (g.some((m) => m === null))
460
460
  return {
461
461
  ok: !1,
462
- text: i.map(({ raw: m }) => m).join(F),
462
+ text: i.map(({ raw: m }) => m).join(N),
463
463
  diagnostic: {
464
464
  code: "invalid_temporal_input_value",
465
465
  message: "A date input bound is not a date or an instant."
@@ -468,89 +468,89 @@ function It(e) {
468
468
  const f = t.precision === "day" ? g.map(
469
469
  (m, d) => Ke(m, i[d].role, s.tz)
470
470
  ) : [], h = f.length > 0 && f.every((m) => m !== null) ? f : null;
471
- return { ok: !0, text: h ? Ge(h, a, r, s) : je(
471
+ return { ok: !0, text: h ? je(h, o, r, s) : Ge(
472
472
  g.map((m) => We(m, s.tz)),
473
- a,
473
+ o,
474
474
  r,
475
475
  s
476
476
  ) };
477
477
  }
478
- function Ge(e, t, o, a) {
478
+ function je(e, t, a, o) {
479
479
  const [r, s = r] = e;
480
480
  if ((t == null ? void 0 : t.mode) === "pattern")
481
- return J(
481
+ return Q(
482
482
  e.map(
483
- (c) => H(I(c), "date", t.pattern, o, a)
483
+ (c) => J(I(c), "date", t.pattern, a, o)
484
484
  )
485
485
  );
486
- const n = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : o.dateStyle;
486
+ const n = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : a.dateStyle;
487
487
  if (!t || t.mode === "period_label") {
488
- const c = Ye(r, s, a);
488
+ const c = Ye(r, s, o);
489
489
  if (c)
490
490
  return be({
491
491
  value: I(r),
492
492
  metadata: {
493
493
  kind: "temporal_bucket",
494
494
  granularity: c,
495
- calendar: { tz: a.tz, weekStart: a.weekStart ?? 1 }
495
+ calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
496
496
  },
497
497
  format: Te({
498
498
  metadata: {
499
499
  kind: "temporal_bucket",
500
500
  granularity: c,
501
- calendar: { tz: a.tz, weekStart: a.weekStart ?? 1 }
501
+ calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
502
502
  },
503
- locale: o.locale,
504
- styles: { dateStyle: n, dateTime: { ...o.dateTime } }
503
+ locale: a.locale,
504
+ styles: { dateStyle: n, dateTime: { ...a.dateTime } }
505
505
  }).format
506
506
  });
507
507
  }
508
- const l = new Intl.DateTimeFormat(o.locale, {
508
+ const l = new Intl.DateTimeFormat(a.locale, {
509
509
  calendar: "gregory",
510
510
  timeZone: "UTC",
511
511
  dateStyle: n
512
512
  });
513
- return He(r, s) ? l.format(A(r)) : q(l, A(r), A(s));
513
+ return He(r, s) ? l.format(A(r)) : H(l, A(r), A(s));
514
514
  }
515
- function je(e, t, o, a) {
515
+ function Ge(e, t, a, o) {
516
516
  if ((t == null ? void 0 : t.mode) === "pattern")
517
- return J(
517
+ return Q(
518
518
  e.map(
519
- (l) => H(
519
+ (l) => J(
520
520
  l.toISOString(),
521
521
  "instant",
522
522
  t.pattern,
523
- o,
524
- a
523
+ a,
524
+ o
525
525
  )
526
526
  )
527
527
  );
528
- const r = new Intl.DateTimeFormat(o.locale, {
528
+ const r = new Intl.DateTimeFormat(a.locale, {
529
529
  calendar: "gregory",
530
- timeZone: a.tz,
531
- dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : o.dateTime.dateStyle,
532
- timeStyle: o.dateTime.timeStyle
530
+ timeZone: o.tz,
531
+ dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : a.dateTime.dateStyle,
532
+ timeStyle: a.dateTime.timeStyle
533
533
  }), [s, n] = e;
534
- return n && n.getTime() !== s.getTime() ? q(r, s, n) : r.format(s);
534
+ return n && n.getTime() !== s.getTime() ? H(r, s, n) : r.format(s);
535
535
  }
536
- function q(e, t, o) {
537
- const a = e;
538
- return typeof a.formatRange == "function" ? a.formatRange(t, o) : `${e.format(t)}${F}${e.format(o)}`;
536
+ function H(e, t, a) {
537
+ const o = e;
538
+ return typeof o.formatRange == "function" ? o.formatRange(t, a) : `${e.format(t)}${N}${e.format(a)}`;
539
539
  }
540
- function H(e, t, o, a, r) {
541
- const s = ie({
540
+ function J(e, t, a, o, r) {
541
+ const s = ue({
542
542
  format: {
543
543
  type: "raw_temporal",
544
- presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: o }
544
+ presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: a }
545
545
  },
546
546
  // Temporal formatting reads no currency.
547
547
  preferences: {
548
- ...a,
548
+ ...o,
549
549
  defaultCurrency: we.defaultCurrency
550
550
  },
551
551
  calendar: { tz: r.tz }
552
- }), n = t === "date" && Xe(o) ? "instant" : t;
553
- return ue({
552
+ }), n = t === "date" && Xe(a) ? "instant" : t;
553
+ return ce({
554
554
  value: n === t ? e : R(`${e}T00:00:00`, r.tz).toISOString(),
555
555
  metadata: { kind: "raw_temporal", valueKind: n },
556
556
  format: s
@@ -559,34 +559,34 @@ function H(e, t, o, a, r) {
559
559
  function Xe(e) {
560
560
  return /HH|mm|ss/.test(e);
561
561
  }
562
- function J(e) {
563
- return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(F);
562
+ function Q(e) {
563
+ return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(N);
564
564
  }
565
565
  function Ze(e, t) {
566
- const o = Ve.exec(e);
567
- if (o) {
566
+ const a = Ue.exec(e);
567
+ if (a) {
568
568
  const r = {
569
- year: Number(o[1]),
570
- month: Number(o[2]),
571
- day: Number(o[3])
569
+ year: Number(a[1]),
570
+ month: Number(a[2]),
571
+ day: Number(a[3])
572
572
  };
573
573
  return Je(r) ? { kind: "date", date: r } : null;
574
574
  }
575
- const a = Be.test(e) ? new Date(e.replace(" ", "T")) : Oe.test(e) ? R(e.replace(" ", "T"), t) : null;
576
- return a && !Number.isNaN(a.getTime()) ? { kind: "instant", instant: a } : null;
575
+ const o = Be.test(e) ? new Date(e.replace(" ", "T")) : Oe.test(e) ? R(e.replace(" ", "T"), t) : null;
576
+ return o && !Number.isNaN(o.getTime()) ? { kind: "instant", instant: o } : null;
577
577
  }
578
578
  function We(e, t) {
579
579
  return e.kind === "instant" ? e.instant : R(`${I(e.date)}T00:00:00`, t);
580
580
  }
581
- function Ke(e, t, o) {
581
+ function Ke(e, t, a) {
582
582
  if (e.kind === "date") return e.date;
583
- const a = Se(e.instant, o), r = { year: a.year, month: a.month, day: a.day };
584
- if (a.hour === 0 && a.minute === 0 && a.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? r : qe(r, -1);
585
- const n = a.hour === 23 && a.minute === 59 && a.second === 59;
583
+ const o = Le(e.instant, a), r = { year: o.year, month: o.month, day: o.day };
584
+ if (o.hour === 0 && o.minute === 0 && o.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? r : qe(r, -1);
585
+ const n = o.hour === 23 && o.minute === 59 && o.second === 59;
586
586
  return t === "end" && n ? r : null;
587
587
  }
588
- function Ye(e, t, o) {
589
- return o.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Q(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
588
+ function Ye(e, t, a) {
589
+ return a.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== ee(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
590
590
  }
591
591
  function I(e) {
592
592
  return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
@@ -596,48 +596,53 @@ function A(e) {
596
596
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
597
597
  }
598
598
  function qe(e, t) {
599
- const o = A(e);
600
- return o.setUTCDate(o.getUTCDate() + t), {
601
- year: o.getUTCFullYear(),
602
- month: o.getUTCMonth() + 1,
603
- day: o.getUTCDate()
599
+ const a = A(e);
600
+ return a.setUTCDate(a.getUTCDate() + t), {
601
+ year: a.getUTCFullYear(),
602
+ month: a.getUTCMonth() + 1,
603
+ day: a.getUTCDate()
604
604
  };
605
605
  }
606
606
  function He(e, t) {
607
607
  return e.year === t.year && e.month === t.month && e.day === t.day;
608
608
  }
609
- function Q(e, t) {
609
+ function ee(e, t) {
610
610
  return new Date(Date.UTC(e, t, 0)).getUTCDate();
611
611
  }
612
612
  function Je(e) {
613
- return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Q(e.year, e.month);
613
+ return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= ee(e.year, e.month);
614
614
  }
615
615
  const Qe = /^\d{4}-\d{2}-\d{2}$/;
616
- function ee(e) {
616
+ function te(e) {
617
617
  const t = e.split(".");
618
618
  return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join(" ");
619
619
  }
620
- const B = 10;
621
- function x(e, t) {
622
- const o = e.slice(0, B).map(t).join(", "), a = e.length - B;
623
- return a > 0 ? `${o}, and ${a} more` : o;
620
+ const z = 10;
621
+ function P(e, t) {
622
+ const a = e.slice(0, z).map(t).join(", "), o = e.length - z;
623
+ return o > 0 ? `${a}, and ${o} more` : a;
624
624
  }
625
625
  function et(e) {
626
626
  if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
627
627
  return;
628
- const t = ge(e.relativeMeta);
628
+ const t = F(e.relativeMeta);
629
629
  if (t)
630
630
  return he(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
631
631
  }
632
- function z(e, t = {}) {
633
- const { name: o, operation: a, values: r, valueType: s } = e, n = t.label ?? ee(o), l = et(e);
632
+ function tt(e, t) {
633
+ if (t !== "label") return et(e);
634
+ if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
635
+ return F(e.relativeMeta);
636
+ }
637
+ function j(e, t = {}) {
638
+ const { name: a, operation: o, values: r, valueType: s } = e, n = t.label ?? te(a), l = tt(e, t.relativeDates);
634
639
  if (l) {
635
- const i = Le(l);
640
+ const i = Se(l);
636
641
  if (i)
637
- return a === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
642
+ return o === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
638
643
  }
639
644
  if (!r || r.length === 0)
640
- return a === "is null" ? `${n} is empty` : a === "is not null" ? `${n} is not empty` : "";
645
+ return o === "is null" ? `${n} is empty` : o === "is not null" ? `${n} is not empty` : "";
641
646
  const c = (i) => {
642
647
  if (s === "date" && i) {
643
648
  const g = e.temporalPrecision === "minute", f = {
@@ -658,7 +663,7 @@ function z(e, t = {}) {
658
663
  timeZone: "UTC"
659
664
  }).format(new Date(Date.UTC(u, m - 1, d)));
660
665
  }
661
- if (typeof i == "string" && me(i) === "wall_datetime") {
666
+ if (typeof i == "string" && de(i) === "wall_datetime") {
662
667
  const [u, m, d, y, p] = i.split(/[-T :.]/).map(Number);
663
668
  return new Intl.DateTimeFormat(void 0, {
664
669
  ...f,
@@ -678,7 +683,7 @@ function z(e, t = {}) {
678
683
  }
679
684
  return String(i);
680
685
  };
681
- switch (a) {
686
+ switch (o) {
682
687
  case "=":
683
688
  return `${n}: ${c(r[0])}`;
684
689
  case "!=":
@@ -694,73 +699,84 @@ function z(e, t = {}) {
694
699
  case "between":
695
700
  case "not between": {
696
701
  const i = `${c(r[0])} - ${c(r[1])}`;
697
- return a === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
702
+ return o === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
698
703
  }
699
704
  case "in":
700
- return r.length === 1 ? `${n}: ${c(r[0])}` : `${n}: ${x(r, c)}`;
705
+ return r.length === 1 ? `${n}: ${c(r[0])}` : `${n}: ${P(r, c)}`;
701
706
  case "not in":
702
- return `${n} not in (${x(r, c)})`;
707
+ return `${n} not in (${P(r, c)})`;
703
708
  case "like":
704
709
  return `${n} contains "${r[0]}"`;
705
710
  case "not like":
706
711
  return `${n} doesn't contain "${r[0]}"`;
707
712
  default:
708
- return `${n}: ${x(r, c)}`;
713
+ return `${n}: ${P(r, c)}`;
709
714
  }
710
715
  }
711
- function Dt(e, t = {}) {
716
+ function Nt(e, t = {}) {
712
717
  if (!e || e.length === 0)
713
718
  return "";
714
- const o = /* @__PURE__ */ new Map();
719
+ const a = /* @__PURE__ */ new Map();
715
720
  e.forEach((r) => {
716
- const s = o.get(r.name) || [];
717
- s.push(r), o.set(r.name, s);
721
+ const s = a.get(r.name) || [];
722
+ s.push(r), a.set(r.name, s);
718
723
  });
719
- const a = [];
720
- return o.forEach((r, s) => {
724
+ const o = [];
725
+ return a.forEach((r, s) => {
721
726
  if (r.length === 1) {
722
- const n = z(r[0], t);
723
- n && a.push(n);
727
+ const n = j(r[0], t);
728
+ n && o.push(n);
724
729
  } else {
725
- const n = ee(s), l = r.map((c) => z(c, t).replace(`${n}: `, "").replace(`${n} `, "")).filter(Boolean);
726
- l.length > 0 && a.push(`${n}: ${l.join(" and ")}`);
730
+ const n = te(s), l = r.map((c) => j(c, t).replace(`${n}: `, "").replace(`${n} `, "")).filter(Boolean);
731
+ l.length > 0 && o.push(`${n}: ${l.join(" and ")}`);
727
732
  }
728
- }), a.join(" | ");
733
+ }), o.join(" | ");
734
+ }
735
+ function Vt(e) {
736
+ return ((e == null ? void 0 : e.filterValues) ?? []).filter(rt).map(at);
729
737
  }
730
- const tt = /* @__PURE__ */ new Set([
738
+ function rt(e) {
739
+ return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
740
+ }
741
+ function at(e) {
742
+ if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
743
+ const { relativeMeta: t, ...a } = e, o = F(t);
744
+ return o ? { ...a, relativeMeta: o } : a;
745
+ }
746
+ const ot = /* @__PURE__ */ new Set([
731
747
  "day",
732
748
  "week",
733
749
  "month",
734
750
  "quarter",
735
751
  "year"
736
752
  ]);
737
- function rt(e, t) {
753
+ function nt(e, t) {
738
754
  try {
739
- const o = b(
755
+ const a = b(
740
756
  v(e),
741
757
  t,
742
758
  "yyyy-MM-dd"
743
- ), [a, r, s] = o.split("-").map(Number), n = new Date(Date.UTC(a, r - 1, s));
759
+ ), [o, r, s] = a.split("-").map(Number), n = new Date(Date.UTC(o, r - 1, s));
744
760
  return n.setUTCDate(n.getUTCDate() - 1), b(n, "UTC", "yyyy-MM-dd");
745
761
  } catch {
746
762
  return;
747
763
  }
748
764
  }
749
- function Rt(e, t, o, a = !1) {
750
- const r = ot(
765
+ function Ut(e, t, a, o = !1) {
766
+ const r = st(
751
767
  e,
752
768
  t,
753
- o,
754
- a
769
+ a,
770
+ o
755
771
  );
756
772
  return `${r.start} - ${r.end}`;
757
773
  }
758
- function ot(e, t, o, a = !1) {
774
+ function st(e, t, a, o = !1) {
759
775
  try {
760
- if (o && tt.has(o)) {
761
- const r = rt(e.end, t);
776
+ if (a && ot.has(a)) {
777
+ const r = nt(e.end, t);
762
778
  if (r) {
763
- const s = a ? "MMM d" : "MMM d, yyyy";
779
+ const s = o ? "MMM d" : "MMM d, yyyy";
764
780
  return {
765
781
  start: b(
766
782
  v(e.start),
@@ -775,8 +791,8 @@ function ot(e, t, o, a = !1) {
775
791
  };
776
792
  }
777
793
  }
778
- if (o === "second" || o === "minute" || o === "hour") {
779
- const r = a ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
794
+ if (a === "second" || a === "minute" || a === "hour") {
795
+ const r = o ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
780
796
  return {
781
797
  start: b(v(e.start), t, r),
782
798
  end: `before ${b(
@@ -790,15 +806,15 @@ function ot(e, t, o, a = !1) {
790
806
  }
791
807
  return { start: e.start, end: `before ${e.end}` };
792
808
  }
793
- const at = "__TOTAL__";
809
+ const lt = "__TOTAL__";
794
810
  function $(e) {
795
811
  return typeof e == "object" && e !== null && !Array.isArray(e);
796
812
  }
797
813
  function D(e) {
798
- return e === at;
814
+ return e === lt;
799
815
  }
800
- function Ft(e) {
801
- const t = /* @__PURE__ */ new Map(), o = (e.groupByColumns ?? []).map((r, s) => {
816
+ function Ot(e) {
817
+ const t = /* @__PURE__ */ new Map(), a = (e.groupByColumns ?? []).map((r, s) => {
802
818
  var i, g, f;
803
819
  if (!$(r))
804
820
  throw new Error(`Aggregate groupByColumns[${s}] is invalid`);
@@ -808,36 +824,36 @@ function Ft(e) {
808
824
  return [n, r.alias, r.name, c].forEach((h) => {
809
825
  typeof h == "string" && h.length > 0 && t.set(h, c);
810
826
  }), c;
811
- }), a = (e.rowAggregates ?? []).flatMap((r) => !$(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
827
+ }), o = (e.rowAggregates ?? []).flatMap((r) => !$(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
812
828
  {
813
829
  function: r.function,
814
830
  groupLevel: r.groupLevel === "ALL" ? "ALL" : t.get(r.groupLevel) || r.groupLevel,
815
831
  ...typeof r.label == "string" ? { label: r.label } : {}
816
832
  }
817
833
  ]);
818
- return { groupColumnKeys: o, rowAggregates: a };
834
+ return { groupColumnKeys: a, rowAggregates: o };
819
835
  }
820
- function te(e) {
836
+ function re(e) {
821
837
  return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
822
838
  }
823
- function nt(e) {
824
- var o;
839
+ function it(e) {
840
+ var a;
825
841
  if (e.customLabel) return e.customLabel;
826
- const t = te(e.aggregateFunction);
842
+ const t = re(e.aggregateFunction);
827
843
  if (e.levelValue !== void 0 && !D(e.levelValue)) {
828
844
  if (e.levelValue === null) {
829
- const r = (o = e.formatValue) == null ? void 0 : o.call(e, null);
845
+ const r = (a = e.formatValue) == null ? void 0 : a.call(e, null);
830
846
  return r ? `Subtotal ${r}` : `Subtotal ${t}`;
831
847
  }
832
- const a = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
833
- if (a) return `Subtotal (${a})`;
848
+ const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
849
+ if (o) return `Subtotal (${o})`;
834
850
  }
835
851
  return `Subtotal ${t}`;
836
852
  }
837
- function st(e, t) {
838
- return t || `Grand ${te(e)}`;
853
+ function ut(e, t) {
854
+ return t || `Grand ${re(e)}`;
839
855
  }
840
- function Nt(e) {
856
+ function Bt(e) {
841
857
  const t = e.context.groupColumnKeys.indexOf(e.columnKey);
842
858
  if (t < 0)
843
859
  throw new Error(
@@ -847,21 +863,21 @@ function Nt(e) {
847
863
  row: e.row,
848
864
  previousRow: e.previousRow,
849
865
  levelIndex: t,
850
- getValue: (o, a) => o[e.context.groupColumnKeys[a]]
866
+ getValue: (a, o) => a[e.context.groupColumnKeys[o]]
851
867
  });
852
868
  }
853
- function re(e) {
854
- var a, r;
855
- const t = e.context.groupColumnKeys, o = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
869
+ function ae(e) {
870
+ var o, r;
871
+ const t = e.context.groupColumnKeys, a = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
856
872
  if (e.row.isGrandTotal === !0) {
857
- const s = (a = e.context.rowAggregates.find(
873
+ const s = (o = e.context.rowAggregates.find(
858
874
  (n) => n.groupLevel === "ALL"
859
- )) == null ? void 0 : a.label;
875
+ )) == null ? void 0 : o.label;
860
876
  return {
861
877
  kind: "grand-total",
862
878
  cells: t.map((n, l) => ({
863
879
  columnKey: n,
864
- text: l === 0 ? st(o, s) : "",
880
+ text: l === 0 ? ut(a, s) : "",
865
881
  placement: l === 0 ? "label" : "empty",
866
882
  colSpan: l === 0 ? t.length : 1
867
883
  }))
@@ -876,7 +892,7 @@ function re(e) {
876
892
  `Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
877
893
  );
878
894
  const n = $(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = $(n == null ? void 0 : n.groupByValues) ? n.groupByValues : {}, c = (r = e.context.rowAggregates.find(
879
- (i) => i.groupLevel === e.row.subtotalLevel && i.function === o
895
+ (i) => i.groupLevel === e.row.subtotalLevel && i.function === a
880
896
  )) == null ? void 0 : r.label;
881
897
  return {
882
898
  kind: "subtotal",
@@ -899,8 +915,8 @@ function re(e) {
899
915
  }
900
916
  return {
901
917
  columnKey: i,
902
- text: nt({
903
- aggregateFunction: o,
918
+ text: it({
919
+ aggregateFunction: a,
904
920
  customLabel: c,
905
921
  levelValue: l[i],
906
922
  formatValue: (f) => e.formatLabelValue ? e.formatLabelValue(f, i) : String(e.formatValue(f, i) ?? "")
@@ -924,56 +940,57 @@ function re(e) {
924
940
  })
925
941
  };
926
942
  }
927
- function Ut(e) {
928
- const t = re(e).cells.find(
929
- (o) => o.columnKey === e.columnKey
943
+ function zt(e) {
944
+ const t = ae(e).cells.find(
945
+ (a) => a.columnKey === e.columnKey
930
946
  );
931
947
  if (!t)
932
948
  throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
933
949
  return t.text;
934
950
  }
935
- function Vt(e) {
936
- return re(e).cells.map((t) => t.text);
951
+ function jt(e) {
952
+ return ae(e).cells.map((t) => t.text);
937
953
  }
938
954
  export {
939
- at as A,
940
- Ft as B,
941
- nt as C,
942
- ke as D,
943
- st as E,
944
- vt as F,
945
- Nt as G,
946
- re as H,
947
- Ut as I,
948
- Vt as J,
949
- _e as K,
950
- ot as L,
951
- St as M,
952
- xe as P,
953
- Tt as a,
954
- Lt as b,
955
- Ct as c,
956
- Et as d,
955
+ lt as A,
956
+ D as B,
957
+ Ot as C,
958
+ Me as D,
959
+ it as E,
960
+ Ct as F,
961
+ ut as G,
962
+ Bt as H,
963
+ ae as I,
964
+ zt as J,
965
+ jt as K,
966
+ _e as L,
967
+ Mt as M,
968
+ st as N,
969
+ Pe as P,
970
+ St as a,
971
+ At as b,
972
+ kt as c,
973
+ _t as d,
957
974
  De as e,
958
- Rt as f,
959
- Pt as g,
960
- At as h,
961
- Mt as i,
975
+ Ut as f,
976
+ It as g,
977
+ Et as h,
978
+ xt as i,
962
979
  Ae as j,
963
980
  $e as k,
964
- Pe as l,
965
- $t as m,
981
+ xe as l,
982
+ Pt as m,
966
983
  Fe as n,
967
984
  Ne as o,
968
985
  Ie as p,
969
- xt as q,
970
- kt as r,
971
- _t as s,
972
- It as t,
973
- B as u,
986
+ Dt as q,
987
+ $t as r,
988
+ Rt as s,
989
+ Ft as t,
990
+ z as u,
974
991
  ze as v,
975
992
  et as w,
976
- z as x,
977
- Dt as y,
978
- D as z
993
+ j as x,
994
+ Nt as y,
995
+ Vt as z
979
996
  };