react-semaphor 0.1.531 → 0.1.533

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 (35) hide show
  1. package/dist/brand-studio/index.js +1 -1
  2. package/dist/chunks/{dashboard-BHMHze_t.js → dashboard-DUCg1mNJ.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-nHbT_XPG.js → dashboard-briefing-launcher-B0PuQUiR.js} +1401 -1383
  4. package/dist/chunks/{dashboard-controls-Chv8n1oV.js → dashboard-controls-Cl3fLg9W.js} +39 -39
  5. package/dist/chunks/{dashboard-json-XgY8U_hG.js → dashboard-json-BSOgXGwr.js} +1 -1
  6. package/dist/chunks/{edit-dashboard-visual-CcxZN7C6.js → edit-dashboard-visual-CQDyMxM7.js} +516 -516
  7. package/dist/chunks/{editor-action-buttons-CCzvDROJ.js → editor-action-buttons-BKVrZnRQ.js} +2 -2
  8. package/dist/chunks/{matrix-formatter-DDjECnMd.js → matrix-formatter-DY1y9odV.js} +2 -1
  9. package/dist/chunks/{pivot-header-presentation-BTOXdU6S.js → pivot-header-presentation-Bb6b3Ch2.js} +232 -210
  10. package/dist/chunks/{report-preferences-dialog-D2Tz_5WT.js → report-preferences-dialog-WDM7qWxV.js} +16 -16
  11. package/dist/chunks/{semaphor-ready-indicator-CpbyewzC.js → semaphor-ready-indicator-yZ0JtL4D.js} +36174 -36148
  12. package/dist/chunks/{slider-p0D5yTI_.js → slider-0mB67Lls.js} +3 -3
  13. package/dist/chunks/{switch-JmX27lNB.js → switch-D95vek6N.js} +1690 -1683
  14. package/dist/dashboard/index.js +1 -1
  15. package/dist/data-app-sdk/index.js +1 -1
  16. package/dist/format-utils/index.js +90 -89
  17. package/dist/index.js +120 -119
  18. package/dist/surfboard/index.js +1 -1
  19. package/dist/types/components/surfboard/filter/date-range-filter-v2.d.ts +2 -2
  20. package/dist/types/components/surfboard/filter/types.d.ts +9 -0
  21. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -6
  22. package/dist/types/lib/api/exports-api.d.ts +30 -3
  23. package/dist/types/lib/csv-download.d.ts +4 -2
  24. package/dist/types/lib/export-messages.d.ts +47 -0
  25. package/dist/types/lib/exports/bounded-request.d.ts +12 -0
  26. package/dist/types/lib/exports/export-status.d.ts +2 -0
  27. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  28. package/dist/types/lib/hooks/use-export-polling.d.ts +9 -1
  29. package/dist/types/lib/matrix-table/submit-matrix-delivery.d.ts +14 -2
  30. package/dist/types/lib/matrix-table/use-matrix.d.ts +4 -0
  31. package/dist/types/lib/stores/export-store.d.ts +11 -0
  32. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -0
  33. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +6 -0
  34. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +28 -4
  35. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
- var U = Object.defineProperty;
2
- var X = (e, r, t) => r in e ? U(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var k = (e, r, t) => X(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { i as j } from "./raw-temporal-B0EuwEHr.js";
5
- import { e as L, i as K } from "./numeric-presentation-D2I9znLM.js";
6
- import { e as V, m as _, h as D, i as z, j as H } from "./matrix-formatter-DDjECnMd.js";
7
- import { i as S } from "./pivot-result-lifecycle-BxmATSFJ.js";
8
- import { F as W, bh as C, B as A } from "./validators-BS521dum.js";
1
+ var j = Object.defineProperty;
2
+ var z = (e, r, t) => r in e ? j(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var M = (e, r, t) => z(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { i as K } from "./raw-temporal-B0EuwEHr.js";
5
+ import { e as v, i as H } from "./numeric-presentation-D2I9znLM.js";
6
+ import { e as F, m as S, h as V, i as W, j as D } from "./matrix-formatter-DY1y9odV.js";
7
+ import { i as E } from "./pivot-result-lifecycle-BxmATSFJ.js";
8
+ import { F as Y, bh as O, B as T } from "./validators-BS521dum.js";
9
9
  import "./matrix-operation-contract-BotZ-6zT.js";
10
10
  import "zod";
11
- import { g as O } from "./matrix-definition-CiGRzEzt.js";
12
- import { PDF_SAFETY_LIMIT_EXCEEDED as N, getUtf8ByteLength as Y, FAST_PDF_POLICY as q } from "../pdf-export-policy/index.js";
13
- import { f as J } from "./temporal-bucket-DlFuhCnT.js";
14
- function Z(e, r, t) {
11
+ import { g as N } from "./matrix-definition-CiGRzEzt.js";
12
+ import { PDF_SAFETY_LIMIT_EXCEEDED as $, getUtf8ByteLength as q, FAST_PDF_POLICY as J } from "../pdf-export-policy/index.js";
13
+ import { f as Z } from "./temporal-bucket-DlFuhCnT.js";
14
+ function Q(e, r, t) {
15
15
  const a = {
16
16
  ...r,
17
17
  locale: r.locale ?? t
18
18
  };
19
19
  if (a.type === "number")
20
- return L(e, a);
20
+ return v(e, a);
21
21
  const { prefix: o, suffix: n, ...s } = a;
22
- return `${o ?? ""}${L(e, {
22
+ return `${o ?? ""}${v(e, {
23
23
  ...s,
24
24
  negativeStyle: a.type === "currency" ? a.negativeStyle : "minus"
25
25
  })}${n ?? ""}`;
26
26
  }
27
- function E(e, r, t) {
28
- return e === null ? { value: e, text: null } : !r || !j(r) && r.type !== "duration" ? {
27
+ function k(e, r, t) {
28
+ return e === null ? { value: e, text: null } : !r || !K(r) && r.type !== "duration" ? {
29
29
  value: e,
30
- text: L(e, { type: "number", locale: t })
30
+ text: v(e, { type: "number", locale: t })
31
31
  } : r.type === "duration" ? {
32
32
  value: e,
33
- text: K(e, {
33
+ text: H(e, {
34
34
  inputUnit: r.inputUnit,
35
35
  outputStyle: r.outputStyle,
36
36
  largestUnit: r.largestUnit,
@@ -40,12 +40,12 @@ function E(e, r, t) {
40
40
  suffix: r.suffix,
41
41
  negativeInParentheses: r.negativeStyle === "parentheses"
42
42
  })
43
- } : { value: e, text: Z(e, r, t) };
43
+ } : { value: e, text: Q(e, r, t) };
44
44
  }
45
45
  function I(e, r, t, a) {
46
46
  return e === null ? { value: e, text: null } : a === "percent" ? {
47
47
  value: e,
48
- text: L(e, {
48
+ text: v(e, {
49
49
  type: "percent",
50
50
  locale: t,
51
51
  minimumFractionDigits: r,
@@ -54,7 +54,7 @@ function I(e, r, t, a) {
54
54
  })
55
55
  } : {
56
56
  value: e,
57
- text: L(e, {
57
+ text: v(e, {
58
58
  type: "number",
59
59
  locale: t,
60
60
  minimumFractionDigits: r,
@@ -63,51 +63,51 @@ function I(e, r, t, a) {
63
63
  })
64
64
  };
65
65
  }
66
- function R(e, r) {
66
+ function _(e, r) {
67
67
  if (e === void 0) return r;
68
68
  if (!Number.isInteger(e) || e < 0 || e > 6)
69
69
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
70
70
  return e;
71
71
  }
72
- function Ee(e, r) {
72
+ function ke(e, r) {
73
73
  const t = {
74
74
  mode: r.displayMode,
75
- current: E(
75
+ current: k(
76
76
  e.currentValue,
77
77
  r.metricFormat,
78
78
  r.locale
79
79
  ),
80
- comparison: E(
80
+ comparison: k(
81
81
  e.comparisonValue,
82
82
  r.metricFormat,
83
83
  r.locale
84
84
  )
85
85
  };
86
- return (r.displayMode === "difference" || r.displayMode === "both") && (t.difference = E(
86
+ return (r.displayMode === "difference" || r.displayMode === "both") && (t.difference = k(
87
87
  e.delta,
88
88
  r.metricFormat,
89
89
  r.locale
90
90
  )), (r.displayMode === "percent_change" || r.displayMode === "both") && (t.percentChange = I(
91
91
  e.percentChange,
92
- R(r.precision, 1),
92
+ _(r.precision, 1),
93
93
  r.locale,
94
94
  "percent"
95
95
  )), r.displayMode === "ratio" && (t.ratio = I(
96
96
  e.ratio,
97
- R(r.precision, 2),
97
+ _(r.precision, 2),
98
98
  r.locale,
99
99
  "ratio"
100
100
  )), t;
101
101
  }
102
- const Q = 1e4, Me = 1e6, Se = 5e6, Ce = 1024 ** 3, _e = 1024 ** 3;
103
- function Ie(e) {
104
- return e > Q;
102
+ const ee = 1e4, Se = 1e6, Ce = 5e6, Ie = 1024 ** 3, _e = 1024 ** 3;
103
+ function Re(e) {
104
+ return e > ee;
105
105
  }
106
- const Re = {
106
+ const Fe = {
107
107
  rowLabels: "tabular",
108
108
  subtotals: "after"
109
109
  };
110
- function Fe(e, r) {
110
+ function Ve(e, r) {
111
111
  const t = r.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, a = e.totals.rows;
112
112
  return {
113
113
  ...e,
@@ -126,21 +126,21 @@ function Fe(e, r) {
126
126
  }
127
127
  };
128
128
  }
129
- const ee = 2;
130
- function re(e) {
131
- return typeof e == "number" ? Number.isInteger(e) : C(e) ? !e.value.includes(".") : !0;
129
+ const re = 2;
130
+ function te(e) {
131
+ return typeof e == "number" ? Number.isInteger(e) : O(e) ? !e.value.includes(".") : !0;
132
132
  }
133
- function te(e, r, t) {
133
+ function oe(e, r, t) {
134
134
  const a = e.descriptors.measures.filter(
135
- (s) => t.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && W(s.column.dataType) === "number"
135
+ (s) => t.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && Y(s.column.dataType) === "number"
136
136
  );
137
137
  if (a.length === 0) return t;
138
138
  const o = /* @__PURE__ */ new Set();
139
- e.columns.forEach((s, i) => {
139
+ e.columns.forEach((s, l) => {
140
140
  if (!(s.kind !== "measure" || o.has(s.measureId)))
141
141
  for (const m of r) {
142
- const u = m.values[i];
143
- if ((u == null ? void 0 : u.kind) === "value" && !re(u.value)) {
142
+ const u = m.values[l];
143
+ if ((u == null ? void 0 : u.kind) === "value" && !te(u.value)) {
144
144
  o.add(s.measureId);
145
145
  return;
146
146
  }
@@ -148,34 +148,34 @@ function te(e, r, t) {
148
148
  });
149
149
  const n = { ...t.measureFormats };
150
150
  for (const { id: s } of a) {
151
- const i = o.has(s) ? ee : 0;
151
+ const l = o.has(s) ? re : 0;
152
152
  n[s] = {
153
153
  type: "number",
154
- minimumFractionDigits: i,
155
- maximumFractionDigits: i,
154
+ minimumFractionDigits: l,
155
+ maximumFractionDigits: l,
156
156
  useGrouping: !0
157
157
  };
158
158
  }
159
159
  return { ...t, measureFormats: n };
160
160
  }
161
161
  function P(e) {
162
- return A(e.slice(0, -1));
162
+ return T(e.slice(0, -1));
163
163
  }
164
- function oe(e, r) {
165
- return r.length > e.length && A(r.slice(0, e.length)) === A(e);
164
+ function ae(e, r) {
165
+ return r.length > e.length && T(r.slice(0, e.length)) === T(e);
166
166
  }
167
- function ae(e) {
167
+ function se(e) {
168
168
  return e.map((r, t) => {
169
169
  if (t === 0 || r.kind !== "layout") return !1;
170
170
  const a = e[t - 1];
171
171
  if (a.kind !== "layout") return !1;
172
- if (r.role !== "member" || oe(a.rowPath, r.rowPath)) return !0;
172
+ if (r.role !== "member" || ae(a.rowPath, r.rowPath)) return !0;
173
173
  const o = e[t - 2];
174
174
  return a.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || P(o.rowPath) !== P(a.rowPath)) && r.rowPath.length === a.rowPath.length && P(r.rowPath) === P(a.rowPath);
175
175
  });
176
176
  }
177
- const se = "pdf-group-continuation";
178
- function ne(e) {
177
+ const ne = "pdf-group-continuation";
178
+ function le(e) {
179
179
  if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
180
180
  return !0;
181
181
  for (let r = 0; r <= e.levelIndex; r++)
@@ -183,94 +183,116 @@ function ne(e) {
183
183
  return !0;
184
184
  return !1;
185
185
  }
186
- function le(e, r, t) {
187
- const a = V(e.descriptors, r.presentation, t), o = e.columns.map((l) => {
186
+ function B(e, r, t) {
187
+ return !(t != null && t.hasTextAffixes) && r.kind === "value" && (typeof r.value == "number" || O(r.value)) ? e : E(e);
188
+ }
189
+ function ie(e, r, t) {
190
+ const a = F(e.descriptors, r.presentation, t), o = e.columns.map((i) => {
188
191
  var c;
189
- return l.kind === "measure" && ((c = a.measureSemantics.get(l.measureId)) == null ? void 0 : c.isNumeric) === !0;
190
- }), n = (l) => _([l], a.levels), s = (l, c, f) => D(l, c, r.presentation.totals[f], a.levels), i = e.columns.map((l) => {
191
- if (l.kind !== "measure") return l.label;
192
- const c = l.columnPath.map(n);
193
- return l.role !== "member" && c.push(s(l.columnPath, l.role, "columns")), [...c, l.label].join(" / ");
192
+ return i.kind === "measure" && ((c = a.measureSemantics.get(i.measureId)) == null ? void 0 : c.isNumeric) === !0;
193
+ }), n = (i) => S([i], a.levels), s = (i, c, f) => V(i, c, r.presentation.totals[f], a.levels), l = e.columns.map((i) => {
194
+ if (i.kind !== "measure") return i.label;
195
+ const c = i.columnPath.map(n);
196
+ return i.role !== "member" && c.push(s(i.columnPath, i.role, "columns")), [...c, i.label].join(" / ");
194
197
  }), m = Math.min(r.spec.columns.length, Math.max(
195
198
  0,
196
- ...e.columns.map((l) => l.kind === "measure" ? l.columnPath.length + (l.role !== "member" ? 1 : 0) : 0)
197
- )), u = Array.from({ length: m + 1 }, (l, c) => e.columns.map((f) => c === m ? f.label : f.kind !== "measure" ? "" : c < f.columnPath.length ? n(f.columnPath[c]) : c === f.columnPath.length && f.role !== "member" ? s(f.columnPath, f.role, "columns") : "")), g = (l, c) => z({
198
- path: l.rowPath,
199
- role: l.kind === "layout" ? l.role : "member",
199
+ ...e.columns.map((i) => i.kind === "measure" ? i.columnPath.length + (i.role !== "member" ? 1 : 0) : 0)
200
+ )), u = Array.from({ length: m + 1 }, (i, c) => e.columns.map((f) => c === m ? f.label : f.kind !== "measure" ? "" : c < f.columnPath.length ? n(f.columnPath[c]) : c === f.columnPath.length && f.role !== "member" ? s(f.columnPath, f.role, "columns") : "")), g = (i, c) => W({
201
+ path: i.rowPath,
202
+ role: i.kind === "layout" ? i.role : "member",
200
203
  levelCount: Math.max(1, r.spec.rows.length),
201
204
  repeatLabels: r.presentation.layout.kind !== "tabular" || r.presentation.layout.repeatLabels,
202
205
  previousPath: c == null ? void 0 : c.rowPath
203
- }), d = (l, c) => {
204
- if (l.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
205
- if (l.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
206
- const f = g(l, c);
207
- return e.columns.map((w, h) => {
208
- if (w.kind === "hierarchy")
209
- return `${" ".repeat(Math.max(0, l.rowPath.length - 1))}${s(l.rowPath, l.role, "rows")}`;
210
- if (w.kind === "level") {
211
- const y = r.spec.rows.findIndex((G) => G.id === w.levelId), v = f[y];
212
- return v != null && v.visible ? v.total ? s(l.rowPath, l.role, "rows") : _(v.path, a.levels) : "";
206
+ }), d = (i, c) => {
207
+ if (i.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
208
+ if (i.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
209
+ const f = g(i, c);
210
+ return e.columns.map((h, p) => {
211
+ if (h.kind === "hierarchy")
212
+ return `${" ".repeat(Math.max(0, i.rowPath.length - 1))}${s(i.rowPath, i.role, "rows")}`;
213
+ if (h.kind === "level") {
214
+ const L = r.spec.rows.findIndex((X) => X.id === h.levelId), b = f[L];
215
+ return b != null && b.visible ? b.total ? s(i.rowPath, i.role, "rows") : S(b.path, a.levels) : "";
213
216
  }
214
- const b = l.values[h], x = a.measures.get(w.measureId);
215
- if (b.kind === "value" && !x)
217
+ const x = i.values[p], y = a.measures.get(h.measureId);
218
+ if (x.kind === "value" && !y)
216
219
  throw new Error("Matrix value is missing its measure descriptor.");
217
- return H(b, x, r.presentation.absence);
220
+ return D(x, y, r.presentation.absence);
218
221
  });
219
- }, p = (l, c) => d(l, c).map((f, w) => {
220
- var y;
221
- const h = l.values[w], b = e.columns[w];
222
- return b.kind === "measure" && !((y = a.measureSemantics.get(b.measureId)) != null && y.hasTextAffixes) && h.kind === "value" && (typeof h.value == "number" || C(h.value)) ? f : S(f);
222
+ }, w = (i, c) => d(i, c).map((f, h) => {
223
+ const p = e.columns[h];
224
+ return p.kind === "measure" ? B(f, i.values[h], a.measureSemantics.get(p.measureId)) : E(f);
223
225
  });
224
226
  return {
225
- headers: i,
227
+ headers: l,
226
228
  headerBands: u,
227
229
  numericColumns: o,
228
230
  /** A row's cells; after `previous`, a tabular layout prints each label once. */
229
- row: (l, c) => d(l, c),
231
+ row: (i, c) => d(i, c),
230
232
  /**
231
233
  * Level columns whose group label the row above shows, so this row
232
234
  * continues the group (Plan 2, 2d, C8). Only a member row after a member
233
235
  * row continues one: a total prints as a band, and its rules stay whole
234
236
  * above and below it.
235
237
  */
236
- continuedColumns: (l, c) => {
237
- const f = (h) => (h == null ? void 0 : h.kind) === "layout" && h.role === "member";
238
- if (!f(l) || !f(c)) return [];
239
- const w = g(l, c);
240
- return e.columns.flatMap((h, b) => {
241
- var y;
242
- if (h.kind !== "level") return [];
243
- const x = r.spec.rows.findIndex((v) => v.id === h.levelId);
244
- return x < l.rowPath.length && ((y = w[x]) == null ? void 0 : y.visible) === !1 ? [b] : [];
238
+ continuedColumns: (i, c) => {
239
+ const f = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
240
+ if (!f(i) || !f(c)) return [];
241
+ const h = g(i, c);
242
+ return e.columns.flatMap((p, x) => {
243
+ var L;
244
+ if (p.kind !== "level") return [];
245
+ const y = r.spec.rows.findIndex((b) => b.id === p.levelId);
246
+ return y < i.rowPath.length && ((L = h[y]) == null ? void 0 : L.visible) === !1 ? [x] : [];
245
247
  });
246
248
  },
247
- csvRow: (l) => p(l),
248
- // Each committed batch starts with identifying labels. Retries are pure;
249
- // suppression never relies on mutable formatter state or an earlier worker.
250
- csvRows: (l) => l.map((c, f) => p(c, l[f - 1]))
249
+ csvRow: (i) => w(i),
250
+ /**
251
+ * `previousRow` is the row before `data[0]`, carried by the export's
252
+ * continuation, so a tabular layout prints each label once across the
253
+ * whole file. Retries are pure: suppression never relies on mutable
254
+ * formatter state or an earlier worker. Without it, the first row prints
255
+ * its labels.
256
+ */
257
+ csvRows: (i, c) => i.map((f, h) => w(f, h ? i[h - 1] : c ?? void 0))
251
258
  };
252
259
  }
253
- function Ve(e) {
254
- return e.columns.map((r) => S(r.label));
255
- }
256
260
  function De(e) {
257
- if (e.kind !== "flat") throw new Error("Raw Matrix CSV requires flat rows.");
258
- return e.values.map((r) => r.kind !== "value" ? null : C(r.value) ? r.value.value : typeof r.value == "string" ? S(r.value) : typeof r.value == "boolean" ? String(r.value) : r.value);
259
- }
260
- function ie(e) {
261
- const r = le(e.layout, e.request, e.report), t = e.layout.columns.map((s, i) => ({
262
- index: i,
263
- columnId: `matrix:${i}`,
264
- label: r.headers[i],
265
- isNumeric: r.numericColumns[i]
266
- })), a = (s, i, m) => ({
261
+ return e.columns.map((r) => E(r.label));
262
+ }
263
+ function Oe(e, r, t) {
264
+ if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
265
+ if (e.values.length !== r.columns.length) throw new Error("Matrix row does not match its frozen layout.");
266
+ const a = [...e.rowPath, ...e.columnPath];
267
+ return r.columns.map((o, n) => {
268
+ if (o.kind === "measure") {
269
+ const l = e.values[n], m = t.measures.get(o.measureId);
270
+ if (l.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
271
+ return B(
272
+ D(l, m, t.absence),
273
+ l,
274
+ t.measureSemantics.get(o.measureId)
275
+ );
276
+ }
277
+ const s = o.kind === "level" ? a.find((l) => l.levelId === o.levelId) : void 0;
278
+ if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
279
+ return E(S([s], t.levels));
280
+ });
281
+ }
282
+ function ue(e) {
283
+ const r = ie(e.layout, e.request, e.report), t = e.layout.columns.map((s, l) => ({
284
+ index: l,
285
+ columnId: `matrix:${l}`,
286
+ label: r.headers[l],
287
+ isNumeric: r.numericColumns[l]
288
+ })), a = (s, l, m) => ({
267
289
  text: s,
268
290
  colspan: 1,
269
291
  rowspan: 1,
270
- columnId: t[i].columnId,
292
+ columnId: t[l].columnId,
271
293
  isHeader: m,
272
- isNumeric: t[i].isNumeric,
273
- className: t[i].isNumeric ? "numeric" : e.layout.columns[i].kind === "hierarchy" ? "matrix-hierarchy" : ""
294
+ isNumeric: t[l].isNumeric,
295
+ className: t[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
274
296
  }), o = [], n = e.layout.columns.findIndex((s) => s.kind === "measure");
275
297
  e.request.spec.columns.length && n >= 0 && o.push({
276
298
  repeatHeader: !0,
@@ -279,31 +301,31 @@ function ie(e) {
279
301
  cells: [
280
302
  ...n ? [{ ...a("", 0, !0), colspan: n }] : [],
281
303
  {
282
- ...a(e.request.spec.columns.map((s) => O(s, e.request.presentation)).join(" / "), n, !0),
304
+ ...a(e.request.spec.columns.map((s) => N(s, e.request.presentation)).join(" / "), n, !0),
283
305
  colspan: e.layout.columns.length - n,
284
306
  isNumeric: !1,
285
307
  className: ""
286
308
  }
287
309
  ]
288
310
  });
289
- for (const [s, i] of r.headerBands.entries())
311
+ for (const [s, l] of r.headerBands.entries())
290
312
  o.push({
291
313
  repeatHeader: !0,
292
314
  headerType: s === r.headerBands.length - 1 ? "metrics" : "pivot-level",
293
315
  headerRowIndex: o.length,
294
- cells: i.map((m, u) => a(m, u, !0))
316
+ cells: l.map((m, u) => a(m, u, !0))
295
317
  });
296
318
  return {
297
319
  headers: o,
298
- rows: e.rows.map((s, i) => {
299
- const m = new Set(r.continuedColumns(s, e.rows[i - 1]));
320
+ rows: e.rows.map((s, l) => {
321
+ const m = new Set(r.continuedColumns(s, e.rows[l - 1]));
300
322
  return {
301
- index: i,
323
+ index: l,
302
324
  type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
303
325
  subtotalLevel: String(s.rowPath.length),
304
326
  // A tabular layout prints each label once unless it repeats them; the
305
327
  // blank cell continues its group, so a grid draws no rule above it.
306
- cells: r.row(s, e.rows[i - 1]).map((u, g) => m.has(g) ? { ...a(u, g, !1), className: se } : a(u, g, !1))
328
+ cells: r.row(s, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...a(u, g, !1), className: ne } : a(u, g, !1))
307
329
  };
308
330
  }),
309
331
  grandTotal: null,
@@ -320,38 +342,38 @@ function ie(e) {
320
342
  }
321
343
  };
322
344
  }
323
- function ue(e, r, t) {
324
- const { levels: a } = V(e.descriptors, r.presentation, t), o = r.spec.columns.length > 0, n = [], s = [], i = e.columns.map((u, g) => {
345
+ function ce(e, r, t) {
346
+ const { levels: a } = F(e.descriptors, r.presentation, t), o = r.spec.columns.length > 0, n = [], s = [], l = e.columns.map((u, g) => {
325
347
  if (u.kind !== "measure") return null;
326
- const d = o ? `${u.role}:${A(u.columnPath)}` : `measure:${g}`;
327
- let p = n.indexOf(d);
328
- return p < 0 && (p = n.push(d) - 1, s.push(o ? D(u.columnPath, u.role, r.presentation.totals.columns, a) : u.label)), p;
348
+ const d = o ? `${u.role}:${T(u.columnPath)}` : `measure:${g}`;
349
+ let w = n.indexOf(d);
350
+ return w < 0 && (w = n.push(d) - 1, s.push(o ? V(u.columnPath, u.role, r.presentation.totals.columns, a) : u.label)), w;
329
351
  }), m = r.spec.columns[r.spec.columns.length - 1];
330
352
  return {
331
- columnGroups: i,
353
+ columnGroups: l,
332
354
  groupLabels: s,
333
355
  /** What bands name their groups by: the innermost column level, or "Measures". */
334
- groupLevelLabel: m ? O(m, r.presentation) : "Measures"
356
+ groupLevelLabel: m ? N(m, r.presentation) : "Measures"
335
357
  };
336
358
  }
337
- function Oe(e) {
359
+ function Ne(e) {
338
360
  const { layout: r, rows: t, report: a } = e, o = {
339
361
  ...e.request,
340
- presentation: te(r, t, e.request.presentation)
341
- }, n = ie({ layout: r, rows: t, request: o, report: a }), s = ae(t), i = ue(r, o, a), m = {
362
+ presentation: oe(r, t, e.request.presentation)
363
+ }, n = ue({ layout: r, rows: t, request: o, report: a }), s = se(t), l = ce(r, o, a), m = {
342
364
  ...n,
343
365
  rows: n.rows.map((u, g) => ({ ...u, keepWithPrevious: s[g] })),
344
- metadata: { ...n.metadata, ...i }
366
+ metadata: { ...n.metadata, ...l }
345
367
  };
346
- return { request: o, table: m, ...i };
368
+ return { request: o, table: m, ...l };
347
369
  }
348
- class ce extends Error {
370
+ class me extends Error {
349
371
  constructor() {
350
372
  super(...arguments);
351
- k(this, "code", N);
373
+ M(this, "code", $);
352
374
  }
353
375
  }
354
- function F(e) {
376
+ function R(e) {
355
377
  if (!e || typeof e != "object")
356
378
  return;
357
379
  const { error: r, message: t, detail: a } = e;
@@ -359,12 +381,12 @@ function F(e) {
359
381
  if (typeof o == "string" && o.trim())
360
382
  return o.trim();
361
383
  }
362
- async function me(e) {
384
+ async function fe(e) {
363
385
  const r = `PDF request failed: ${e.status} ${e.statusText}`.trim(), t = e.headers.get("content-type") || "";
364
386
  try {
365
387
  if (t.includes("application/json")) {
366
388
  const o = await e.json(), n = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
367
- return { message: F(o) || r, code: n };
389
+ return { message: R(o) || r, code: n };
368
390
  }
369
391
  const a = await e.text();
370
392
  if (!a.trim())
@@ -372,7 +394,7 @@ async function me(e) {
372
394
  try {
373
395
  const o = JSON.parse(a), n = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
374
396
  return {
375
- message: F(o) || a.trim(),
397
+ message: R(o) || a.trim(),
376
398
  code: n
377
399
  };
378
400
  } catch {
@@ -382,9 +404,9 @@ async function me(e) {
382
404
  return { message: r };
383
405
  }
384
406
  }
385
- async function Ne(e) {
407
+ async function $e(e) {
386
408
  if (!e.token) throw new Error("Missing auth token for PDF export");
387
- if (Y(e.serializedPayload) > q.maxRequestBytes)
409
+ if (q(e.serializedPayload) > J.maxRequestBytes)
388
410
  throw new Error("Fast-path PDF request exceeds the structured body limit");
389
411
  const r = await (e.fetchImpl ?? fetch)(e.url, {
390
412
  method: "POST",
@@ -393,8 +415,8 @@ async function Ne(e) {
393
415
  signal: e.signal
394
416
  });
395
417
  if (!r.ok) {
396
- const a = await me(r);
397
- throw a.code === N ? new ce(a.message) : new Error(a.message);
418
+ const a = await fe(r);
419
+ throw a.code === $ ? new me(a.message) : new Error(a.message);
398
420
  }
399
421
  const t = await r.json();
400
422
  if (t != null && t.error) throw new Error(t.error);
@@ -402,25 +424,25 @@ async function Ne(e) {
402
424
  throw new Error("Fast-path PDF response missing download URL");
403
425
  return t;
404
426
  }
405
- const fe = "__TOTAL__";
406
- function T(e) {
427
+ const ge = "__TOTAL__";
428
+ function A(e) {
407
429
  return typeof e == "object" && e !== null && !Array.isArray(e);
408
430
  }
409
- function M(e) {
410
- return e === fe;
431
+ function C(e) {
432
+ return e === ge;
411
433
  }
412
- function $e(e) {
434
+ function Be(e) {
413
435
  const r = /* @__PURE__ */ new Map(), t = (e.groupByColumns ?? []).map((o, n) => {
414
436
  var u, g, d;
415
- if (!T(o))
437
+ if (!A(o))
416
438
  throw new Error(`Aggregate groupByColumns[${n}] is invalid`);
417
- const s = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0, i = s ? (d = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : d[s] : void 0, m = (i == null ? void 0 : i.outputKey) || (i == null ? void 0 : i.rawKey) || (typeof o.alias == "string" && o.alias.length > 0 ? o.alias : typeof o.name == "string" && o.name.length > 0 ? o.name : void 0);
439
+ const s = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0, l = s ? (d = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : d[s] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof o.alias == "string" && o.alias.length > 0 ? o.alias : typeof o.name == "string" && o.name.length > 0 ? o.name : void 0);
418
440
  if (!m)
419
441
  throw new Error(`Aggregate groupByColumns[${n}] has no output key`);
420
- return [s, o.alias, o.name, m].forEach((p) => {
421
- typeof p == "string" && p.length > 0 && r.set(p, m);
442
+ return [s, o.alias, o.name, m].forEach((w) => {
443
+ typeof w == "string" && w.length > 0 && r.set(w, m);
422
444
  }), m;
423
- }), a = (e.rowAggregates ?? []).flatMap((o) => !T(o) || typeof o.function != "string" || typeof o.groupLevel != "string" ? [] : [
445
+ }), a = (e.rowAggregates ?? []).flatMap((o) => !A(o) || typeof o.function != "string" || typeof o.groupLevel != "string" ? [] : [
424
446
  {
425
447
  function: o.function,
426
448
  groupLevel: o.groupLevel === "ALL" ? "ALL" : r.get(o.groupLevel) || o.groupLevel,
@@ -429,14 +451,14 @@ function $e(e) {
429
451
  ]);
430
452
  return { groupColumnKeys: t, rowAggregates: a };
431
453
  }
432
- function $(e) {
454
+ function G(e) {
433
455
  return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
434
456
  }
435
- function ge(e) {
457
+ function de(e) {
436
458
  var t;
437
459
  if (e.customLabel) return e.customLabel;
438
- const r = $(e.aggregateFunction);
439
- if (e.levelValue !== void 0 && !M(e.levelValue)) {
460
+ const r = G(e.aggregateFunction);
461
+ if (e.levelValue !== void 0 && !C(e.levelValue)) {
440
462
  if (e.levelValue === null) {
441
463
  const o = (t = e.formatValue) == null ? void 0 : t.call(e, null);
442
464
  return o ? `Subtotal ${o}` : `Subtotal ${r}`;
@@ -446,23 +468,23 @@ function ge(e) {
446
468
  }
447
469
  return `Subtotal ${r}`;
448
470
  }
449
- function de(e, r) {
450
- return r || `Grand ${$(e)}`;
471
+ function he(e, r) {
472
+ return r || `Grand ${G(e)}`;
451
473
  }
452
- function Be(e) {
474
+ function Ge(e) {
453
475
  const r = e.context.groupColumnKeys.indexOf(e.columnKey);
454
476
  if (r < 0)
455
477
  throw new Error(
456
478
  `Aggregate group column "${e.columnKey}" is unknown`
457
479
  );
458
- return ne({
480
+ return le({
459
481
  row: e.row,
460
482
  previousRow: e.previousRow,
461
483
  levelIndex: r,
462
484
  getValue: (t, a) => t[e.context.groupColumnKeys[a]]
463
485
  });
464
486
  }
465
- function B(e) {
487
+ function U(e) {
466
488
  var a, o;
467
489
  const r = e.context.groupColumnKeys, t = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
468
490
  if (e.row.isGrandTotal === !0) {
@@ -471,11 +493,11 @@ function B(e) {
471
493
  )) == null ? void 0 : a.label;
472
494
  return {
473
495
  kind: "grand-total",
474
- cells: r.map((s, i) => ({
496
+ cells: r.map((s, l) => ({
475
497
  columnKey: s,
476
- text: i === 0 ? de(t, n) : "",
477
- placement: i === 0 ? "label" : "empty",
478
- colSpan: i === 0 ? r.length : 1
498
+ text: l === 0 ? he(t, n) : "",
499
+ placement: l === 0 ? "label" : "empty",
500
+ colSpan: l === 0 ? r.length : 1
479
501
  }))
480
502
  };
481
503
  }
@@ -487,7 +509,7 @@ function B(e) {
487
509
  throw new Error(
488
510
  `Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
489
511
  );
490
- const s = T(e.row.subtotalContext) ? e.row.subtotalContext : void 0, i = T(s == null ? void 0 : s.groupByValues) ? s.groupByValues : {}, m = (o = e.context.rowAggregates.find(
512
+ const s = A(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = A(s == null ? void 0 : s.groupByValues) ? s.groupByValues : {}, m = (o = e.context.rowAggregates.find(
491
513
  (u) => u.groupLevel === e.row.subtotalLevel && u.function === t
492
514
  )) == null ? void 0 : o.label;
493
515
  return {
@@ -504,17 +526,17 @@ function B(e) {
504
526
  const d = e.row[u];
505
527
  return {
506
528
  columnKey: u,
507
- text: d === void 0 || M(d) ? "" : e.formatValue(d, u),
529
+ text: d === void 0 || C(d) ? "" : e.formatValue(d, u),
508
530
  placement: "value",
509
531
  colSpan: 1
510
532
  };
511
533
  }
512
534
  return {
513
535
  columnKey: u,
514
- text: ge({
536
+ text: de({
515
537
  aggregateFunction: t,
516
538
  customLabel: m,
517
- levelValue: i[u],
539
+ levelValue: l[u],
518
540
  formatValue: (d) => e.formatLabelValue ? e.formatLabelValue(d, u) : String(e.formatValue(d, u) ?? "")
519
541
  }),
520
542
  placement: "label",
@@ -529,44 +551,44 @@ function B(e) {
529
551
  const s = e.row[n];
530
552
  return {
531
553
  columnKey: n,
532
- text: s === void 0 || M(s) ? "" : e.formatValue(s, n),
554
+ text: s === void 0 || C(s) ? "" : e.formatValue(s, n),
533
555
  placement: "value",
534
556
  colSpan: 1
535
557
  };
536
558
  })
537
559
  };
538
560
  }
539
- function Ge(e) {
540
- const r = B(e).cells.find(
561
+ function Ue(e) {
562
+ const r = U(e).cells.find(
541
563
  (t) => t.columnKey === e.columnKey
542
564
  );
543
565
  if (!r)
544
566
  throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
545
567
  return r.text;
546
568
  }
547
- function Ue(e) {
548
- return B(e).cells.map((r) => r.text);
569
+ function Xe(e) {
570
+ return U(e).cells.map((r) => r.text);
549
571
  }
550
- class he extends Error {
572
+ class pe extends Error {
551
573
  constructor(t, a) {
552
574
  super(`${t}: ${a}`);
553
- k(this, "deliveryBlocking", !0);
575
+ M(this, "deliveryBlocking", !0);
554
576
  this.code = t, this.name = "PivotHeaderPresentationError";
555
577
  }
556
578
  }
557
- function Xe(e) {
579
+ function je(e) {
558
580
  var o;
559
581
  const r = e.mode ?? "formatted", t = e.members.map((n) => {
560
- var i;
582
+ var l;
561
583
  if (r === "canonical" || !n.temporalBucket)
562
584
  return n.value === null ? "" : String(n.value);
563
- const s = (i = e.resolveTemporalFormat) == null ? void 0 : i.call(e, n.fieldId);
585
+ const s = (l = e.resolveTemporalFormat) == null ? void 0 : l.call(e, n.fieldId);
564
586
  if (!s)
565
- throw new he(
587
+ throw new pe(
566
588
  "missing_resolved_temporal_format",
567
589
  `Missing resolved temporal presentation for pivot field "${n.fieldId}"`
568
590
  );
569
- return J({
591
+ return Z({
570
592
  value: n.value,
571
593
  metadata: n.temporalBucket,
572
594
  format: s
@@ -582,37 +604,37 @@ function Xe(e) {
582
604
  };
583
605
  }
584
606
  export {
585
- fe as A,
586
- Xe as B,
587
- ne as C,
588
- Q as D,
589
- Me as F,
590
- Se as M,
591
- se as P,
592
- Ce as a,
607
+ ge as A,
608
+ je as B,
609
+ le as C,
610
+ ee as D,
611
+ Se as F,
612
+ Ce as M,
613
+ ne as P,
614
+ Ie as a,
593
615
  _e as b,
594
- De as c,
595
- ie as d,
596
- Oe as e,
597
- Ee as f,
598
- Re as g,
599
- Fe as h,
600
- ee as i,
601
- te as j,
602
- ae as k,
603
- ce as l,
604
- Ve as m,
605
- me as n,
606
- Ne as o,
607
- le as p,
608
- M as q,
609
- Ie as r,
610
- $e as s,
611
- ge as t,
612
- de as u,
613
- Be as v,
614
- B as w,
615
- Ge as x,
616
- Ue as y,
617
- he as z
616
+ Oe as c,
617
+ ue as d,
618
+ Ne as e,
619
+ ke as f,
620
+ Fe as g,
621
+ Ve as h,
622
+ re as i,
623
+ oe as j,
624
+ se as k,
625
+ me as l,
626
+ De as m,
627
+ fe as n,
628
+ $e as o,
629
+ ie as p,
630
+ C as q,
631
+ Re as r,
632
+ Be as s,
633
+ de as t,
634
+ he as u,
635
+ Ge as v,
636
+ U as w,
637
+ Ue as x,
638
+ Xe as y,
639
+ pe as z
618
640
  };