react-semaphor 0.1.584 → 0.1.585

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 (50) hide show
  1. package/dist/analytics-protocol/index.js +477 -440
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +2 -2
  4. package/dist/chunks/{assistant-chat-nmycV1Se.js → assistant-chat-BdbLmAnK.js} +7 -7
  5. package/dist/chunks/{bookmark-impact-CI3gmxi0.js → bookmark-impact-BhT3k379.js} +2 -2
  6. package/dist/chunks/{bookmark-state-D9-RFkDg.js → bookmark-state-CL4WEpgB.js} +2 -2
  7. package/dist/chunks/{card-filter-builder-C7QyPqRy.js → card-filter-builder-CEcKF6Fw.js} +50 -50
  8. package/dist/chunks/{comparison-window-caption-BAnsTI8y.js → comparison-window-caption-CoART8BC.js} +530 -633
  9. package/dist/chunks/{dashboard-inJy_V78.js → dashboard-MPku_x1M.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-DXs0XA1O.js → dashboard-briefing-launcher-CkFNlkr1.js} +8 -8
  11. package/dist/chunks/{dashboard-controls-6Zoo8d8Y.js → dashboard-controls-Clt4ovXS.js} +9 -9
  12. package/dist/chunks/{dashboard-json-D5eJhVA9.js → dashboard-json-DSmXazIg.js} +1 -1
  13. package/dist/chunks/{dates-B3_GWc_Y.js → dates-CYZW9owO.js} +6 -6
  14. package/dist/chunks/{edit-dashboard-visual-DR03SYeW.js → edit-dashboard-visual-Dn2ECRbX.js} +2751 -2686
  15. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  16. package/dist/chunks/{filter-reach-copy-CZwzrxBp.js → filter-reach-copy-CmJpPa4G.js} +1627 -1371
  17. package/dist/chunks/{filter-value-text-DtOvqcjn.js → filter-value-text-xefXzZlf.js} +10 -10
  18. package/dist/chunks/{index-BgT1L0p5.js → index-0WYn6RMz.js} +35 -35
  19. package/dist/chunks/{matrix-analytical-definition-Cs2v43FM.js → matrix-analytical-definition-QjBgUYhP.js} +382 -544
  20. package/dist/chunks/{metric-comparison-Be4uS3Ql.js → metric-comparison-ZmurmEIs.js} +2 -2
  21. package/dist/chunks/{pivot-header-presentation-uH06jiZD.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  22. package/dist/chunks/{pivot-result-contract-expectations-DvZY4eJM.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1010 -1005
  23. package/dist/chunks/{pivot-result-identity-BZexMfmL.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  24. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  25. package/dist/chunks/{report-preferences-dialog-DWeVe2so.js → report-preferences-dialog-BRaeufEi.js} +119 -119
  26. package/dist/chunks/{resolve-dashboard-input-context-uATCuOP7.js → resolve-dashboard-input-context-Cn9jumxl.js} +304 -299
  27. package/dist/chunks/{saved-dashboard-context-DSVV9iqW.js → saved-dashboard-context-CfqkUMzR.js} +5 -5
  28. package/dist/chunks/{semaphor-ready-indicator-B9vvRMnJ.js → semaphor-ready-indicator-D6WjdTGl.js} +19776 -19620
  29. package/dist/chunks/{shelf-drop-preview-context-BHOnp5Bo.js → shelf-drop-preview-context-Bbbrr9u4.js} +2 -2
  30. package/dist/chunks/{stored-dashboard-xc5iidHL.js → stored-dashboard-sPkTjxYf.js} +7 -7
  31. package/dist/chunks/{table-export-sheet-Cv_94obr.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  32. package/dist/chunks/{variable-draft-C3CjhsJQ.js → variable-draft-D1RotIEG.js} +3 -3
  33. package/dist/dashboard/index.js +2 -2
  34. package/dist/dashboard-authoring/index.js +707 -704
  35. package/dist/format-utils/index.js +145 -142
  36. package/dist/index.js +14 -14
  37. package/dist/style.css +1 -1
  38. package/dist/surfboard/index.js +2 -2
  39. package/dist/types/index.js +2 -2
  40. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  41. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  42. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +3 -0
  43. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +5 -2
  44. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +37 -4
  45. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  46. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  47. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  48. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  49. package/package.json +1 -1
  50. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
@@ -1,34 +1,32 @@
1
- import { aC as We, i as Ye, k as j, n as Ze, T as Me, aD as ie, aE as ke, aF as Je, aG as Ae, aH as Ne, ap as Qe, au as et, aq as tt, a as rt, b as B, a7 as pe, aj as nt, a5 as ot, ak as at, f as st, q as he, t as it, Z as be, $ as ct, a1 as lt, a8 as ut, aI as k, aJ as U } from "./pivot-result-contract-expectations-DvZY4eJM.js";
2
- import { h as W, e as mt, p as dt, k as ft } from "./export-file-format-C-tJsxsf.js";
3
- import { aU as K, a5 as pt, m as q, aT as ht, j as bt, r as Y } from "./validators-CJ8Jh0E8.js";
1
+ import { aE as He, i as ze, k as U, n as Ge, T as Pe, aF as ae, aG as $e, aH as qe, aI as Ie, aJ as Le, ar as Xe, aw as Ye, as as We, a as Je, b as B, a7 as de, al as Ze, a5 as Qe, am as et, f as tt, q as fe, t as rt, Z as pe, $ as nt, a1 as ot, a8 as at, aK as I, aL as K } from "./pivot-result-contract-expectations-Bx_BCu-7.js";
2
+ import { h as Y, e as st, p as it, k as ct } from "./export-file-format-C-tJsxsf.js";
3
+ import { aU as j, a5 as lt, m as q, aT as ut, r as mt } from "./validators-CJ8Jh0E8.js";
4
4
  import "./matrix-operation-contract-BM5TveR3.js";
5
5
  import "./analytics-base-schemas-BaIQrEzX.js";
6
- import { readPdfCapacityFacts as yt, PDF_SAFETY_LIMIT_EXCEEDED as ce, PDF_CAPACITY as M, PDF_NUMBER_COLUMN_TOO_WIDE as Re, getUtf8ByteLength as gt, FAST_PDF_POLICY as wt, isPdfCapacityRefusalCode as vt } from "../pdf-export-policy/index.js";
7
- import { p as Ct } from "./pivot-header-presentation-uH06jiZD.js";
8
- import { c as xt, b as ye } from "./pivot-result-identity-BZexMfmL.js";
9
- import { v as Tt, c as _t } from "./raw-temporal-value-DdT0s47W.js";
10
- import { a as Oe } from "./metric-comparison-Be4uS3Ql.js";
11
- import "../value-format-preferences/index.js";
12
- function Et(e, t, r) {
6
+ import { readPdfCapacityFacts as dt, PDF_SAFETY_LIMIT_EXCEEDED as se, PDF_CAPACITY as k, PDF_NUMBER_COLUMN_TOO_WIDE as Me, getUtf8ByteLength as ft, FAST_PDF_POLICY as pt, isPdfCapacityRefusalCode as ht } from "../pdf-export-policy/index.js";
7
+ import { p as bt } from "./pivot-header-presentation-CdeTU96P.js";
8
+ import { c as yt, b as he } from "./pivot-result-identity-Bvs6Uq3v.js";
9
+ import { v as gt } from "./raw-temporal-value-DH-feMc2.js";
10
+ function wt(e, t, r) {
13
11
  const n = {
14
12
  ...t,
15
13
  locale: t.locale ?? r
16
14
  };
17
15
  if (n.type === "number")
18
- return j(e, n);
19
- const { prefix: o, suffix: c, ...s } = n;
20
- return `${o ?? ""}${j(e, {
21
- ...s,
16
+ return U(e, n);
17
+ const { prefix: o, suffix: i, ...l } = n;
18
+ return `${o ?? ""}${U(e, {
19
+ ...l,
22
20
  negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
23
- })}${c ?? ""}`;
21
+ })}${i ?? ""}`;
24
22
  }
25
- function ee(e, t, r) {
26
- return e === null ? { value: e, text: null } : !t || !Ye(t) && t.type !== "duration" ? {
23
+ function Q(e, t, r) {
24
+ return e === null ? { value: e, text: null } : !t || !ze(t) && t.type !== "duration" ? {
27
25
  value: e,
28
- text: j(e, { type: "number", locale: r })
26
+ text: U(e, { type: "number", locale: r })
29
27
  } : t.type === "duration" ? {
30
28
  value: e,
31
- text: Ze(e, {
29
+ text: Ge(e, {
32
30
  inputUnit: t.inputUnit,
33
31
  outputStyle: t.outputStyle,
34
32
  largestUnit: t.largestUnit,
@@ -38,12 +36,12 @@ function ee(e, t, r) {
38
36
  suffix: t.suffix,
39
37
  negativeInParentheses: t.negativeStyle === "parentheses"
40
38
  })
41
- } : { value: e, text: Et(e, t, r) };
39
+ } : { value: e, text: wt(e, t, r) };
42
40
  }
43
- function ge(e, t, r, n) {
41
+ function be(e, t, r, n) {
44
42
  return e === null ? { value: e, text: null } : n === "percent" ? {
45
43
  value: e,
46
- text: j(e, {
44
+ text: U(e, {
47
45
  type: "percent",
48
46
  locale: r,
49
47
  minimumFractionDigits: t,
@@ -52,7 +50,7 @@ function ge(e, t, r, n) {
52
50
  })
53
51
  } : {
54
52
  value: e,
55
- text: j(e, {
53
+ text: U(e, {
56
54
  type: "number",
57
55
  locale: r,
58
56
  minimumFractionDigits: t,
@@ -61,55 +59,55 @@ function ge(e, t, r, n) {
61
59
  })
62
60
  };
63
61
  }
64
- function we(e, t) {
62
+ function ye(e, t) {
65
63
  if (e === void 0) return t;
66
64
  if (!Number.isInteger(e) || e < 0 || e > 6)
67
65
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
68
66
  return e;
69
67
  }
70
- function Nr(e, t) {
68
+ function Fr(e, t) {
71
69
  const r = {
72
70
  mode: t.displayMode,
73
- current: ee(
71
+ current: Q(
74
72
  e.currentValue,
75
73
  t.metricFormat,
76
74
  t.locale
77
75
  ),
78
- comparison: ee(
76
+ comparison: Q(
79
77
  e.comparisonValue,
80
78
  t.metricFormat,
81
79
  t.locale
82
80
  )
83
81
  };
84
- return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = ee(
82
+ return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = Q(
85
83
  e.delta,
86
- We(t.metricFormat),
84
+ He(t.metricFormat),
87
85
  t.locale
88
- )), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = ge(
86
+ )), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = be(
89
87
  e.percentChange,
90
- we(t.precision, 1),
88
+ ye(t.precision, 1),
91
89
  t.locale,
92
90
  "percent"
93
- )), t.displayMode === "ratio" && (r.ratio = ge(
91
+ )), t.displayMode === "ratio" && (r.ratio = be(
94
92
  e.ratio,
95
- we(t.precision, 2),
93
+ ye(t.precision, 2),
96
94
  t.locale,
97
95
  "ratio"
98
96
  )), r;
99
97
  }
100
- const $t = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
101
- function Ft(e) {
98
+ const xt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
99
+ function vt(e) {
102
100
  const { presentation: t } = e;
103
- return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? $t.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
101
+ return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? xt.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
104
102
  }
105
- function St(e) {
106
- const t = (o, c) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : c, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
103
+ function Ct(e) {
104
+ const t = (o, i) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : i, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
107
105
  return n === 0 ? "" : `.${"0".repeat(n)}`;
108
106
  }
109
- function te(e) {
107
+ function ee(e) {
110
108
  return `"${e.replace(/"/g, "")}"`;
111
109
  }
112
- function Lt(e) {
110
+ function _t(e) {
113
111
  let t;
114
112
  try {
115
113
  t = new Intl.NumberFormat(e.locale ?? "en-US", {
@@ -119,33 +117,33 @@ function Lt(e) {
119
117
  } catch {
120
118
  return;
121
119
  }
122
- const r = t.findIndex((c) => c.type === "currency"), n = t.findIndex((c) => c.type === "integer");
120
+ const r = t.findIndex((i) => i.type === "currency"), n = t.findIndex((i) => i.type === "integer");
123
121
  if (r < 0 || n < 0) return;
124
- const o = (c, s) => t.slice(c, s).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
122
+ const o = (i, l) => t.slice(i, l).filter((c) => c.type === "literal").map((c) => c.value.replace(/\s/g, " ")).join("");
125
123
  return r < n ? { side: "before", text: t[r].value + o(r + 1, n) } : {
126
124
  side: "after",
127
125
  text: o(n + 1, r) + t[r].value
128
126
  };
129
127
  }
130
- function Pt(e) {
131
- const t = St(e);
128
+ function Tt(e) {
129
+ const t = Ct(e);
132
130
  let r;
133
131
  if (e.type === "scientific")
134
132
  r = `0${t}E+00`;
135
133
  else {
136
134
  const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
137
135
  if (e.type === "currency") {
138
- const o = Lt(e);
139
- r = o ? o.side === "before" ? `${te(o.text)}${n}` : `${n}${te(o.text)}` : n;
140
- } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${te("%")}` : `${n}%` : r = n;
136
+ const o = _t(e);
137
+ r = o ? o.side === "before" ? `${ee(o.text)}${n}` : `${n}${ee(o.text)}` : n;
138
+ } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${ee("%")}` : `${n}%` : r = n;
141
139
  }
142
140
  return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
143
141
  }
144
- function It(e, t) {
142
+ function Et(e, t) {
145
143
  if (!e.formattedValues) return;
146
144
  const { presentation: r } = e;
147
145
  if (t === "number" || t === "by_value")
148
- return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Pt(r.format);
146
+ return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Tt(r.format);
149
147
  if (t === "date") {
150
148
  if ((r == null ? void 0 : r.kind) === "temporal_bucket")
151
149
  return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
@@ -153,8 +151,8 @@ function It(e, t) {
153
151
  return r.dateOnly ? "yyyy-mm-dd" : "yyyy-mm-dd hh:mm:ss";
154
152
  }
155
153
  }
156
- function ve(e) {
157
- const t = Ft(e), r = It(e, t);
154
+ function ge(e) {
155
+ const t = vt(e), r = Et(e, t);
158
156
  return Object.freeze({
159
157
  key: e.key,
160
158
  label: e.label,
@@ -162,18 +160,18 @@ function ve(e) {
162
160
  ...r === void 0 ? {} : { numberFormat: r }
163
161
  });
164
162
  }
165
- const Dt = 15, Mt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
166
- function Ue(e) {
167
- return Mt.test(e) ? e : void 0;
163
+ const Ft = 15, St = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
164
+ function De(e) {
165
+ return St.test(e) ? e : void 0;
168
166
  }
169
- function Ce(e) {
167
+ function we(e) {
170
168
  const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
171
- if (r.length > Dt) return !1;
169
+ if (r.length > Ft) return !1;
172
170
  const n = Number(e);
173
171
  return Number.isFinite(n) && (n !== 0 || r.length === 0);
174
172
  }
175
- const kt = Date.UTC(1900, 2, 1), At = Date.UTC(1e4, 0, 1), Nt = Date.UTC(1899, 11, 30), Rt = 864e5;
176
- function Ot(e) {
173
+ const Pt = Date.UTC(1900, 2, 1), $t = Date.UTC(1e4, 0, 1), It = Date.UTC(1899, 11, 30), Lt = 864e5;
174
+ function Mt(e) {
177
175
  const t = Date.UTC(
178
176
  e.year,
179
177
  e.month - 1,
@@ -182,20 +180,20 @@ function Ot(e) {
182
180
  e.minute,
183
181
  e.second
184
182
  );
185
- if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < kt || t >= At))
186
- return (t - Nt) / Rt;
183
+ if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Pt || t >= $t))
184
+ return (t - It) / Lt;
187
185
  }
188
186
  function xe(e, t, r) {
189
187
  if (typeof e == "number")
190
188
  return Number.isFinite(e) ? { kind: "number", text: t, value: e } : void 0;
191
- if (K(e))
192
- return Ce(e.value) ? { kind: "number", text: t, value: e } : void 0;
189
+ if (j(e))
190
+ return we(e.value) ? { kind: "number", text: t, value: e } : void 0;
193
191
  if (r && typeof e == "string") {
194
- const n = Ue(e);
195
- return n !== void 0 && Ce(n) ? { kind: "number", text: t, value: n } : void 0;
192
+ const n = De(e);
193
+ return n !== void 0 && we(n) ? { kind: "number", text: t, value: n } : void 0;
196
194
  }
197
195
  }
198
- function z(e) {
196
+ function H(e) {
199
197
  const { value: t, text: r, column: n } = e;
200
198
  if (r === "") return { kind: "empty" };
201
199
  const o = { kind: "text", text: r };
@@ -203,8 +201,8 @@ function z(e) {
203
201
  case "text":
204
202
  return o;
205
203
  case "date": {
206
- const c = e.wallClock ? Ot(e.wallClock) : void 0;
207
- return c === void 0 ? o : { kind: "date", text: r, serial: c };
204
+ const i = e.wallClock ? Mt(e.wallClock) : void 0;
205
+ return i === void 0 ? o : { kind: "date", text: r, serial: i };
208
206
  }
209
207
  case "number":
210
208
  return xe(t, r, !0) ?? o;
@@ -214,14 +212,14 @@ function z(e) {
214
212
  return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : xe(t, r, !1) ?? o;
215
213
  }
216
214
  }
217
- function Rr(e) {
215
+ function Sr(e) {
218
216
  return e.kind === "empty" ? "" : e.text;
219
217
  }
220
- const Or = {
218
+ const Pr = {
221
219
  rowLabels: "tabular",
222
220
  subtotals: "after"
223
221
  };
224
- function Ur(e, t) {
222
+ function $r(e, t) {
225
223
  const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
226
224
  return {
227
225
  ...e,
@@ -231,112 +229,112 @@ function Ur(e, t) {
231
229
  rows: {
232
230
  ...n,
233
231
  levels: Object.fromEntries(
234
- Object.entries(n.levels).map(([o, c]) => [
232
+ Object.entries(n.levels).map(([o, i]) => [
235
233
  o,
236
- { ...c, position: t.subtotals }
234
+ { ...i, position: t.subtotals }
237
235
  ])
238
236
  )
239
237
  }
240
238
  }
241
239
  };
242
240
  }
243
- const Ut = 2;
244
- function jt(e) {
245
- return typeof e == "number" ? Number.isInteger(e) : K(e) ? !e.value.includes(".") : !0;
241
+ const Dt = 2;
242
+ function kt(e) {
243
+ return typeof e == "number" ? Number.isInteger(e) : j(e) ? !e.value.includes(".") : !0;
246
244
  }
247
- function Kt(e, t, r) {
245
+ function At(e, t, r) {
248
246
  const n = e.descriptors.measures.filter(
249
- (s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && pt(s.column.dataType) === "number"
247
+ (l) => r.measureFormats[l.id] === void 0 && l.semanticFormat === void 0 && lt(l.column.dataType) === "number"
250
248
  );
251
249
  if (n.length === 0) return r;
252
250
  const o = /* @__PURE__ */ new Set();
253
- e.columns.forEach((s, l) => {
254
- if (!(s.kind !== "measure" || o.has(s.measureId)))
251
+ e.columns.forEach((l, c) => {
252
+ if (!(l.kind !== "measure" || o.has(l.measureId)))
255
253
  for (const f of t) {
256
- const h = f.values[l];
257
- if ((h == null ? void 0 : h.kind) === "value" && !jt(h.value)) {
258
- o.add(s.measureId);
254
+ const h = f.values[c];
255
+ if ((h == null ? void 0 : h.kind) === "value" && !kt(h.value)) {
256
+ o.add(l.measureId);
259
257
  return;
260
258
  }
261
259
  }
262
260
  });
263
- const c = { ...r.measureFormats };
264
- for (const { id: s } of n) {
265
- const l = o.has(s) ? Ut : 0;
266
- c[s] = {
261
+ const i = { ...r.measureFormats };
262
+ for (const { id: l } of n) {
263
+ const c = o.has(l) ? Dt : 0;
264
+ i[l] = {
267
265
  type: "number",
268
- minimumFractionDigits: l,
269
- maximumFractionDigits: l,
266
+ minimumFractionDigits: c,
267
+ maximumFractionDigits: c,
270
268
  useGrouping: !0
271
269
  };
272
270
  }
273
- return { ...r, measureFormats: c };
271
+ return { ...r, measureFormats: i };
274
272
  }
275
- function H(e) {
273
+ function z(e) {
276
274
  return q(e.slice(0, -1));
277
275
  }
278
- function Vt(e, t) {
276
+ function Nt(e, t) {
279
277
  return t.length > e.length && q(t.slice(0, e.length)) === q(e);
280
278
  }
281
- function Bt(e) {
279
+ function Ot(e) {
282
280
  return e.map((t, r) => {
283
281
  if (r === 0 || t.kind !== "layout") return !1;
284
282
  const n = e[r - 1];
285
283
  if (n.kind !== "layout") return !1;
286
- if (t.role !== "member" || Vt(n.rowPath, t.rowPath)) return !0;
284
+ if (t.role !== "member" || Nt(n.rowPath, t.rowPath)) return !0;
287
285
  const o = e[r - 2];
288
- return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || H(o.rowPath) !== H(n.rowPath)) && t.rowPath.length === n.rowPath.length && H(t.rowPath) === H(n.rowPath);
286
+ return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || z(o.rowPath) !== z(n.rowPath)) && t.rowPath.length === n.rowPath.length && z(t.rowPath) === z(n.rowPath);
289
287
  });
290
288
  }
291
- const zt = "pdf-group-continuation";
292
- function je(e, t, r) {
293
- return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || K(t.value)) ? e : W(e);
289
+ const Rt = "pdf-group-continuation";
290
+ function ke(e, t, r) {
291
+ return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || j(t.value)) ? e : Y(e);
294
292
  }
295
- function Ht(e, t, r) {
296
- const n = Me(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
293
+ function Ut(e, t, r) {
294
+ const n = Pe(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
297
295
  var a;
298
296
  return u.kind === "measure" && ((a = n.measureSemantics.get(u.measureId)) == null ? void 0 : a.isNumeric) === !0;
299
- }), c = (u) => ie([u], n.levels), s = (u, a, m) => ke(u, a, t.presentation.totals[m], n.levels), l = e.columns.map((u) => {
297
+ }), i = (u) => ae([u], n.levels), l = (u, a, m) => $e(u, a, t.presentation.totals[m], n.levels), c = e.columns.map((u) => {
300
298
  if (u.kind !== "measure") return u.label;
301
- const a = u.columnPath.map(c);
302
- return u.role !== "member" && a.push(s(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
299
+ const a = u.columnPath.map(i);
300
+ return u.role !== "member" && a.push(l(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
303
301
  }), f = Math.min(t.spec.columns.length, Math.max(
304
302
  0,
305
303
  ...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
306
- )), h = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? c(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? s(m.columnPath, m.role, "columns") : "")), d = (u, a) => Je({
304
+ )), h = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? i(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? l(m.columnPath, m.role, "columns") : "")), y = (u, a) => qe({
307
305
  path: u.rowPath,
308
306
  role: u.kind === "layout" ? u.role : "member",
309
307
  levelCount: Math.max(1, t.spec.rows.length),
310
308
  repeatLabels: t.presentation.layout.kind !== "tabular" || t.presentation.layout.repeatLabels,
311
309
  previousPath: a == null ? void 0 : a.rowPath
312
- }), p = (u, a) => {
310
+ }), w = (u, a) => {
313
311
  if (u.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
314
312
  if (u.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
315
- const m = d(u, a);
316
- return e.columns.map((y, b) => {
317
- if (y.kind === "hierarchy")
318
- return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${s(u.rowPath, u.role, "rows")}`;
319
- if (y.kind === "level") {
320
- const v = t.spec.rows.findIndex((S) => S.id === y.levelId), x = m[v];
321
- return x != null && x.visible ? x.total ? s(u.rowPath, u.role, "rows") : ie(x.path, n.levels) : "";
313
+ const m = y(u, a);
314
+ return e.columns.map((b, d) => {
315
+ if (b.kind === "hierarchy")
316
+ return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${l(u.rowPath, u.role, "rows")}`;
317
+ if (b.kind === "level") {
318
+ const x = t.spec.rows.findIndex((P) => P.id === b.levelId), v = m[x];
319
+ return v != null && v.visible ? v.total ? l(u.rowPath, u.role, "rows") : ae(v.path, n.levels) : "";
322
320
  }
323
- const C = u.values[b], w = n.measures.get(y.measureId);
324
- if (C.kind === "value" && !w)
321
+ const C = u.values[d], g = n.measures.get(b.measureId);
322
+ if (C.kind === "value" && !g)
325
323
  throw new Error("Matrix value is missing its measure descriptor.");
326
- return Ae(C, w, t.presentation.absence);
324
+ return Ie(C, g, t.presentation.absence);
327
325
  });
328
- }, T = (u, a) => p(u, a).map((m, y) => {
329
- const b = e.columns[y];
330
- return b.kind === "measure" ? je(m, u.values[y], n.measureSemantics.get(b.measureId)) : W(m);
326
+ }, T = (u, a) => w(u, a).map((m, b) => {
327
+ const d = e.columns[b];
328
+ return d.kind === "measure" ? ke(m, u.values[b], n.measureSemantics.get(d.measureId)) : Y(m);
331
329
  });
332
330
  return {
333
- headers: l,
331
+ headers: c,
334
332
  headerBands: h,
335
333
  numericColumns: o,
336
334
  /** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
337
335
  formatting: n,
338
336
  /** A row's cells; after `previous`, a tabular layout prints each label once. */
339
- row: (u, a) => p(u, a),
337
+ row: (u, a) => w(u, a),
340
338
  /**
341
339
  * Level columns whose group label the row above shows, so this row
342
340
  * continues the group (Plan 2, 2d, C8). Only a member row after a member
@@ -344,14 +342,14 @@ function Ht(e, t, r) {
344
342
  * above and below it.
345
343
  */
346
344
  continuedColumns: (u, a) => {
347
- const m = (b) => (b == null ? void 0 : b.kind) === "layout" && b.role === "member";
345
+ const m = (d) => (d == null ? void 0 : d.kind) === "layout" && d.role === "member";
348
346
  if (!m(u) || !m(a)) return [];
349
- const y = d(u, a);
350
- return e.columns.flatMap((b, C) => {
351
- var v;
352
- if (b.kind !== "level") return [];
353
- const w = t.spec.rows.findIndex((x) => x.id === b.levelId);
354
- return w < u.rowPath.length && ((v = y[w]) == null ? void 0 : v.visible) === !1 ? [C] : [];
347
+ const b = y(u, a);
348
+ return e.columns.flatMap((d, C) => {
349
+ var x;
350
+ if (d.kind !== "level") return [];
351
+ const g = t.spec.rows.findIndex((v) => v.id === d.levelId);
352
+ return g < u.rowPath.length && ((x = b[g]) == null ? void 0 : x.visible) === !1 ? [C] : [];
355
353
  });
356
354
  },
357
355
  csvRow: (u) => T(u),
@@ -362,80 +360,80 @@ function Ht(e, t, r) {
362
360
  * formatter state or an earlier worker. Without it, the first row prints
363
361
  * its labels.
364
362
  */
365
- csvRows: (u, a) => u.map((m, y) => T(m, y ? u[y - 1] : a ?? void 0))
363
+ csvRows: (u, a) => u.map((m, b) => T(m, b ? u[b - 1] : a ?? void 0))
366
364
  };
367
365
  }
368
- function jr(e) {
369
- return e.columns.map((t) => W(t.label));
366
+ function Ir(e) {
367
+ return e.columns.map((t) => Y(t.label));
370
368
  }
371
- function Kr(e, t, r) {
372
- return Gt(e, t, r).map((n, o) => {
373
- const c = t.columns[o];
374
- return c.kind === "measure" ? je(n, e.values[o], r.measureSemantics.get(c.measureId)) : W(n);
369
+ function Lr(e, t, r) {
370
+ return Kt(e, t, r).map((n, o) => {
371
+ const i = t.columns[o];
372
+ return i.kind === "measure" ? ke(n, e.values[o], r.measureSemantics.get(i.measureId)) : Y(n);
375
373
  });
376
374
  }
377
- function Gt(e, t, r) {
375
+ function Kt(e, t, r) {
378
376
  if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
379
377
  if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
380
378
  const n = [...e.rowPath, ...e.columnPath];
381
- return t.columns.map((o, c) => {
379
+ return t.columns.map((o, i) => {
382
380
  if (o.kind === "measure") {
383
- const l = e.values[c], f = r.measures.get(o.measureId);
384
- if (l.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
385
- return Ae(l, f, r.absence);
381
+ const c = e.values[i], f = r.measures.get(o.measureId);
382
+ if (c.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
383
+ return Ie(c, f, r.absence);
386
384
  }
387
- const s = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
388
- if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
389
- return ie([s], r.levels);
385
+ const l = o.kind === "level" ? n.find((c) => c.levelId === o.levelId) : void 0;
386
+ if (!l) throw new Error("Flat Matrix row does not match its frozen layout.");
387
+ return ae([l], r.levels);
390
388
  });
391
389
  }
392
- function qt(e) {
393
- const t = Ht(e.layout, e.request, e.report), r = e.layout.columns.map((s, l) => ({
394
- index: l,
395
- columnId: `matrix:${l}`,
396
- label: t.headers[l],
397
- isNumeric: t.numericColumns[l]
398
- })), n = (s, l, f) => ({
399
- text: s,
390
+ function jt(e) {
391
+ const t = Ut(e.layout, e.request, e.report), r = e.layout.columns.map((l, c) => ({
392
+ index: c,
393
+ columnId: `matrix:${c}`,
394
+ label: t.headers[c],
395
+ isNumeric: t.numericColumns[c]
396
+ })), n = (l, c, f) => ({
397
+ text: l,
400
398
  colspan: 1,
401
399
  rowspan: 1,
402
- columnId: r[l].columnId,
400
+ columnId: r[c].columnId,
403
401
  isHeader: f,
404
- isNumeric: r[l].isNumeric,
405
- className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
406
- }), o = [], c = e.layout.columns.findIndex((s) => s.kind === "measure");
407
- e.request.spec.columns.length && c >= 0 && o.push({
402
+ isNumeric: r[c].isNumeric,
403
+ className: r[c].isNumeric ? "numeric" : e.layout.columns[c].kind === "hierarchy" ? "matrix-hierarchy" : ""
404
+ }), o = [], i = e.layout.columns.findIndex((l) => l.kind === "measure");
405
+ e.request.spec.columns.length && i >= 0 && o.push({
408
406
  repeatHeader: !0,
409
407
  headerType: "pivot-axis",
410
408
  headerRowIndex: 0,
411
409
  cells: [
412
- ...c ? [{ ...n("", 0, !0), colspan: c }] : [],
410
+ ...i ? [{ ...n("", 0, !0), colspan: i }] : [],
413
411
  {
414
- ...n(e.request.spec.columns.map((s) => Ne(s, e.request.presentation)).join(" / "), c, !0),
415
- colspan: e.layout.columns.length - c,
412
+ ...n(e.request.spec.columns.map((l) => Le(l, e.request.presentation)).join(" / "), i, !0),
413
+ colspan: e.layout.columns.length - i,
416
414
  isNumeric: !1,
417
415
  className: ""
418
416
  }
419
417
  ]
420
418
  });
421
- for (const [s, l] of t.headerBands.entries())
419
+ for (const [l, c] of t.headerBands.entries())
422
420
  o.push({
423
421
  repeatHeader: !0,
424
- headerType: s === t.headerBands.length - 1 ? "metrics" : "pivot-level",
422
+ headerType: l === t.headerBands.length - 1 ? "metrics" : "pivot-level",
425
423
  headerRowIndex: o.length,
426
- cells: l.map((f, h) => n(f, h, !0))
424
+ cells: c.map((f, h) => n(f, h, !0))
427
425
  });
428
426
  return {
429
427
  headers: o,
430
- rows: e.rows.map((s, l) => {
431
- const f = new Set(t.continuedColumns(s, e.rows[l - 1]));
428
+ rows: e.rows.map((l, c) => {
429
+ const f = new Set(t.continuedColumns(l, e.rows[c - 1]));
432
430
  return {
433
- index: l,
434
- type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
435
- subtotalLevel: String(s.rowPath.length),
431
+ index: c,
432
+ type: l.kind === "layout" && l.role !== "member" ? "subtotal" : "data",
433
+ subtotalLevel: String(l.rowPath.length),
436
434
  // A tabular layout prints each label once unless it repeats them; the
437
435
  // blank cell continues its group, so a grid draws no rule above it.
438
- cells: t.row(s, e.rows[l - 1]).map((h, d) => f.has(d) ? { ...n(h, d, !1), className: zt } : n(h, d, !1))
436
+ cells: t.row(l, e.rows[c - 1]).map((h, y) => f.has(y) ? { ...n(h, y, !1), className: Rt } : n(h, y, !1))
439
437
  };
440
438
  }),
441
439
  grandTotal: null,
@@ -444,74 +442,74 @@ function qt(e) {
444
442
  tableType: "pivot",
445
443
  totalRows: e.rows.length,
446
444
  totalColumns: r.length,
447
- rowLevels: e.layout.columns.filter((s) => s.kind !== "measure").length,
445
+ rowLevels: e.layout.columns.filter((l) => l.kind !== "measure").length,
448
446
  pivotLevels: e.request.spec.columns.length,
449
447
  hasGrandTotal: !1,
450
- columnOrder: r.map((s) => s.columnId),
448
+ columnOrder: r.map((l) => l.columnId),
451
449
  columns: r
452
450
  }
453
451
  };
454
452
  }
455
- function Xt(e, t, r) {
456
- const { levels: n } = Me(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, c = [], s = [], l = e.columns.map((h, d) => {
453
+ function Vt(e, t, r) {
454
+ const { levels: n } = Pe(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, i = [], l = [], c = e.columns.map((h, y) => {
457
455
  if (h.kind !== "measure") return null;
458
- const p = o ? `${h.role}:${q(h.columnPath)}` : `measure:${d}`;
459
- let T = c.indexOf(p);
460
- return T < 0 && (T = c.push(p) - 1, s.push(o ? ke(h.columnPath, h.role, t.presentation.totals.columns, n) : h.label)), T;
456
+ const w = o ? `${h.role}:${q(h.columnPath)}` : `measure:${y}`;
457
+ let T = i.indexOf(w);
458
+ return T < 0 && (T = i.push(w) - 1, l.push(o ? $e(h.columnPath, h.role, t.presentation.totals.columns, n) : h.label)), T;
461
459
  }), f = t.spec.columns[t.spec.columns.length - 1];
462
460
  return {
463
- columnGroups: l,
464
- groupLabels: s,
461
+ columnGroups: c,
462
+ groupLabels: l,
465
463
  /** What bands name their groups by: the innermost column level, or "Measures". */
466
- groupLevelLabel: f ? Ne(f, t.presentation) : "Measures"
464
+ groupLevelLabel: f ? Le(f, t.presentation) : "Measures"
467
465
  };
468
466
  }
469
- function Vr(e) {
467
+ function Mr(e) {
470
468
  const { layout: t, rows: r, report: n } = e, o = {
471
469
  ...e.request,
472
- presentation: Kt(t, r, e.request.presentation)
473
- }, c = qt({ layout: t, rows: r, request: o, report: n }), s = Bt(r), l = Xt(t, o, n), f = {
474
- ...c,
475
- rows: c.rows.map((h, d) => ({ ...h, keepWithPrevious: s[d] })),
476
- metadata: { ...c.metadata, ...l }
470
+ presentation: At(t, r, e.request.presentation)
471
+ }, i = jt({ layout: t, rows: r, request: o, report: n }), l = Ot(r), c = Vt(t, o, n), f = {
472
+ ...i,
473
+ rows: i.rows.map((h, y) => ({ ...h, keepWithPrevious: l[y] })),
474
+ metadata: { ...i.metadata, ...c }
477
475
  };
478
- return { request: o, table: f, ...l };
476
+ return { request: o, table: f, ...c };
479
477
  }
480
- const F = (e) => e.toLocaleString("en-US"), G = (e) => `${F(Math.ceil(e / 1048576))} MB`, re = "export the data as CSV or Excel";
481
- function Br(e) {
482
- const t = yt(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${re}.` : "Add a filter to narrow it, then export again.";
478
+ const S = (e) => e.toLocaleString("en-US"), G = (e) => `${S(Math.ceil(e / 1048576))} MB`, te = "export the data as CSV or Excel";
479
+ function Dr(e) {
480
+ const t = dt(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${te}.` : "Add a filter to narrow it, then export again.";
483
481
  switch (e.code) {
484
482
  case "PDF_ROW_LIMIT_EXCEEDED": {
485
- const n = e.subject ?? "This table", o = t.rowLimit ?? M.maxTableRows;
486
- return t.rowCount !== void 0 ? `${n} has ${F(t.rowCount)} rows. A PDF holds up to ${F(o)} rows per table. ${r}` : `${n} has more than ${F(o)} rows, the most a PDF holds per table. ${r}`;
483
+ const n = e.subject ?? "This table", o = t.rowLimit ?? k.maxTableRows;
484
+ return t.rowCount !== void 0 ? `${n} has ${S(t.rowCount)} rows. A PDF holds up to ${S(o)} rows per table. ${r}` : `${n} has more than ${S(o)} rows, the most a PDF holds per table. ${r}`;
487
485
  }
488
486
  case "PDF_PAGE_LIMIT_EXCEEDED": {
489
- const n = e.subject ?? "This PDF", o = t.pageLimit ?? M.maxPages;
490
- return t.pageCount !== void 0 ? `${n} is ${F(t.pageCount)} pages. A PDF holds up to ${F(o)}. ${r}` : `${n} is longer than ${F(o)} pages, the most a PDF holds. ${r}`;
487
+ const n = e.subject ?? "This PDF", o = t.pageLimit ?? k.maxPages;
488
+ return t.pageCount !== void 0 ? `${n} is ${S(t.pageCount)} pages. A PDF holds up to ${S(o)}. ${r}` : `${n} is longer than ${S(o)} pages, the most a PDF holds. ${r}`;
491
489
  }
492
490
  case "PDF_SIZE_LIMIT_EXCEEDED": {
493
- const n = e.subject ?? "This PDF", o = t.byteLimit ?? M.maxFileBytes;
491
+ const n = e.subject ?? "This PDF", o = t.byteLimit ?? k.maxFileBytes;
494
492
  return t.bytes !== void 0 ? `${n} is ${G(t.bytes)}. A PDF file holds up to ${G(o)}. ${r}` : `${n} is larger than ${G(o)}, the most a PDF file holds. ${r}`;
495
493
  }
496
494
  case "PDF_CAPTURE_TOO_TALL":
497
- return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${re}` : ""}.`;
498
- case Re:
499
- return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${re}` : ""}.`;
500
- case ce:
501
- return `This PDF is over what a PDF holds: ${F(M.maxTableRows)} rows per table, ${F(
502
- M.maxPages
503
- )} pages and ${G(M.maxFileBytes)}. ${r}`;
495
+ return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${te}` : ""}.`;
496
+ case Me:
497
+ return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${te}` : ""}.`;
498
+ case se:
499
+ return `This PDF is over what a PDF holds: ${S(k.maxTableRows)} rows per table, ${S(
500
+ k.maxPages
501
+ )} pages and ${G(k.maxFileBytes)}. ${r}`;
504
502
  }
505
503
  }
506
- class Wt extends Error {
507
- constructor(t, r = ce) {
504
+ class Bt extends Error {
505
+ constructor(t, r = se) {
508
506
  super(t), this.code = r;
509
507
  }
510
508
  }
511
- function Yt(e) {
512
- return vt(e) || e === ce || e === Re;
509
+ function Ht(e) {
510
+ return ht(e) || e === se || e === Me;
513
511
  }
514
- function Te(e) {
512
+ function ve(e) {
515
513
  if (!e || typeof e != "object")
516
514
  return;
517
515
  const { error: t, message: r, detail: n } = e;
@@ -519,21 +517,21 @@ function Te(e) {
519
517
  if (typeof o == "string" && o.trim())
520
518
  return o.trim();
521
519
  }
522
- async function Zt(e) {
520
+ async function zt(e) {
523
521
  const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
524
522
  try {
525
523
  if (r.includes("application/json")) {
526
- const o = await e.json(), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
527
- return { message: Te(o) || t, code: c };
524
+ const o = await e.json(), i = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
525
+ return { message: ve(o) || t, code: i };
528
526
  }
529
527
  const n = await e.text();
530
528
  if (!n.trim())
531
529
  return { message: t };
532
530
  try {
533
- const o = JSON.parse(n), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
531
+ const o = JSON.parse(n), i = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
534
532
  return {
535
- message: Te(o) || n.trim(),
536
- code: c
533
+ message: ve(o) || n.trim(),
534
+ code: i
537
535
  };
538
536
  } catch {
539
537
  return { message: n.trim() };
@@ -542,9 +540,9 @@ async function Zt(e) {
542
540
  return { message: t };
543
541
  }
544
542
  }
545
- async function zr(e) {
543
+ async function kr(e) {
546
544
  if (!e.token) throw new Error("Missing auth token for PDF export");
547
- if (gt(e.serializedPayload) > wt.maxRequestBytes)
545
+ if (ft(e.serializedPayload) > pt.maxRequestBytes)
548
546
  throw new Error("Fast-path PDF request exceeds the structured body limit");
549
547
  const t = await (e.fetchImpl ?? fetch)(e.url, {
550
548
  method: "POST",
@@ -553,8 +551,8 @@ async function zr(e) {
553
551
  signal: e.signal
554
552
  });
555
553
  if (!t.ok) {
556
- const n = await Zt(t);
557
- throw Yt(n.code) ? new Wt(n.message, n.code) : new Error(n.message);
554
+ const n = await zt(t);
555
+ throw Ht(n.code) ? new Bt(n.message, n.code) : new Error(n.message);
558
556
  }
559
557
  const r = await t.json();
560
558
  if (r != null && r.error) throw new Error(r.error);
@@ -562,7 +560,7 @@ async function zr(e) {
562
560
  throw new Error("Fast-path PDF response missing download URL");
563
561
  return r;
564
562
  }
565
- const Hr = 1, Ke = ["loading", "measuring", "checking", "laidOut"], Jt = [
563
+ const Ar = 1, Ae = ["loading", "measuring", "checking", "laidOut"], Gt = [
566
564
  // Already emitted before these contracts; names kept.
567
565
  "document_matrix_too_large",
568
566
  "document_matrix_unavailable",
@@ -582,20 +580,20 @@ const Hr = 1, Ke = ["loading", "measuring", "checking", "laidOut"], Jt = [
582
580
  // PDF capacity contract PC-D3: more pages than one PDF holds.
583
581
  "document_page_limit_exceeded"
584
582
  ];
585
- function Gr(e) {
586
- return Jt.includes(e);
583
+ function Nr(e) {
584
+ return Gt.includes(e);
587
585
  }
588
- const Qt = 64, er = 120, tr = 3, rr = 80, nr = [...Ke, "noPageStack", "unknown"];
589
- function ne(e, t) {
586
+ const qt = 64, Xt = 120, Yt = 3, Wt = 80, Jt = [...Ae, "noPageStack", "unknown"];
587
+ function re(e, t) {
590
588
  return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
591
589
  }
592
- function $(e, t) {
590
+ function F(e, t) {
593
591
  return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
594
592
  }
595
- function oe(e, t) {
593
+ function ne(e, t) {
596
594
  return t.includes(e) ? e : void 0;
597
595
  }
598
- function or(e) {
596
+ function Zt(e) {
599
597
  let t = e;
600
598
  if (typeof e == "string")
601
599
  try {
@@ -604,29 +602,29 @@ function or(e) {
604
602
  return {};
605
603
  }
606
604
  if (!t || typeof t != "object" || Array.isArray(t)) return {};
607
- const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) => ne(c, rr)).filter((c) => c !== void 0).slice(0, tr) : [], o = {
608
- sectionId: ne(r.sectionId, Qt),
609
- sectionTitle: ne(r.sectionTitle, er),
610
- pageNumber: $(r.pageNumber, 1),
611
- rowCount: $(r.rowCount, 0),
612
- rowLimit: $(r.rowLimit, 1),
605
+ const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((i) => re(i, Wt)).filter((i) => i !== void 0).slice(0, Yt) : [], o = {
606
+ sectionId: re(r.sectionId, qt),
607
+ sectionTitle: re(r.sectionTitle, Xt),
608
+ pageNumber: F(r.pageNumber, 1),
609
+ rowCount: F(r.rowCount, 0),
610
+ rowLimit: F(r.rowLimit, 1),
613
611
  inputLabels: n.length ? n : void 0,
614
- overflowAxis: oe(r.overflowAxis, ["height", "width"]),
615
- overflowPx: $(r.overflowPx, 0),
616
- matrixLimit: oe(r.matrixLimit, ["rows", "bytes"]),
617
- layoutStage: oe(r.layoutStage, nr),
618
- loadingSectionCount: $(r.loadingSectionCount, 0),
619
- measuredRowCount: $(r.measuredRowCount, 0),
620
- totalRowCount: $(r.totalRowCount, 0),
621
- pageCount: $(r.pageCount, 0),
622
- pageLimit: $(r.pageLimit, 1)
612
+ overflowAxis: ne(r.overflowAxis, ["height", "width"]),
613
+ overflowPx: F(r.overflowPx, 0),
614
+ matrixLimit: ne(r.matrixLimit, ["rows", "bytes"]),
615
+ layoutStage: ne(r.layoutStage, Jt),
616
+ loadingSectionCount: F(r.loadingSectionCount, 0),
617
+ measuredRowCount: F(r.measuredRowCount, 0),
618
+ totalRowCount: F(r.totalRowCount, 0),
619
+ pageCount: F(r.pageCount, 0),
620
+ pageLimit: F(r.pageLimit, 1)
623
621
  };
624
622
  return Object.fromEntries(
625
- Object.entries(o).filter(([, c]) => c !== void 0)
623
+ Object.entries(o).filter(([, i]) => i !== void 0)
626
624
  );
627
625
  }
628
- function qr(e) {
629
- const t = or(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
626
+ function Or(e) {
627
+ const t = Zt(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
630
628
  switch (e.code) {
631
629
  case "document_section_setup":
632
630
  return `${r} is not set up to print.`;
@@ -666,13 +664,13 @@ function qr(e) {
666
664
  ].join("");
667
665
  }
668
666
  }
669
- function ar(e) {
670
- return Ke.includes(e);
667
+ function Qt(e) {
668
+ return Ae.includes(e);
671
669
  }
672
- function ae(e) {
670
+ function oe(e) {
673
671
  return typeof e == "number" && Number.isInteger(e) && e >= 0;
674
672
  }
675
- function Xr(e) {
673
+ function Rr(e) {
676
674
  let t = e;
677
675
  if (typeof e == "string")
678
676
  try {
@@ -681,28 +679,28 @@ function Xr(e) {
681
679
  return;
682
680
  }
683
681
  if (!t || typeof t != "object" || Array.isArray(t)) return;
684
- const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c } = t;
685
- if (!(!ar(r) || !ae(n) || o !== null && !ae(o) || c !== null && !ae(c)))
686
- return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c };
682
+ const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: i } = t;
683
+ if (!(!Qt(r) || !oe(n) || o !== null && !oe(o) || i !== null && !oe(i)))
684
+ return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: i };
687
685
  }
688
- function sr(e, t) {
686
+ function er(e, t) {
689
687
  return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
690
688
  }
691
- function Ve(e) {
689
+ function Ne(e) {
692
690
  return new Map(
693
691
  e.presentationExecutionSnapshot.resolvedFormats.flatMap(
694
- (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && sr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
692
+ (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && er(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
695
693
  )
696
694
  );
697
695
  }
698
- function Be(e) {
696
+ function Oe(e) {
699
697
  const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
700
698
  return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
701
699
  }
702
- function Wr(e) {
703
- return e.formatting.useFormattedValues !== !1 && Be(e.queryPayload) && Ve(e.formatting).size > 0;
700
+ function Ur(e) {
701
+ return e.formatting.useFormattedValues !== !1 && Oe(e.queryPayload) && Ne(e.formatting).size > 0;
704
702
  }
705
- function ir(e, t) {
703
+ function tr(e, t) {
706
704
  return e.map((r, n) => {
707
705
  if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
708
706
  throw new Error(
@@ -712,52 +710,52 @@ function ir(e, t) {
712
710
  return o === null || typeof o == "string" ? o : String(o);
713
711
  });
714
712
  }
715
- function cr(e) {
713
+ function rr(e) {
716
714
  if (e.formatting.useFormattedValues === !1)
717
715
  return {
718
716
  activatedColumnKeys: /* @__PURE__ */ new Set(),
719
717
  byColumnKey: /* @__PURE__ */ new Map()
720
718
  };
721
- const t = Ve(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
719
+ const t = Ne(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
722
720
  if (t.size === 0)
723
721
  return { activatedColumnKeys: r, byColumnKey: n };
724
722
  const o = new Map(
725
- e.columns.flatMap((l) => {
726
- const f = l.key || l.field;
727
- return f ? [[f, l]] : [];
723
+ e.columns.flatMap((c) => {
724
+ const f = c.key || c.field;
725
+ return f ? [[f, c]] : [];
728
726
  })
729
- ), c = Be(e.queryPayload), s = /* @__PURE__ */ new Map();
730
- for (const [l, f] of t) {
731
- const h = o.get(l);
732
- let d;
727
+ ), i = Oe(e.queryPayload), l = /* @__PURE__ */ new Map();
728
+ for (const [c, f] of t) {
729
+ const h = o.get(c);
730
+ let y;
733
731
  if (h != null && h.rawTemporal)
734
- d = Tt(h, {
732
+ y = gt(h, {
735
733
  metadataRequired: !0
736
- }), r.add(l);
737
- else if (c) {
738
- r.add(l);
739
- const p = Qe({
740
- columnKey: l,
741
- values: ir(e.records, l)
734
+ }), r.add(c);
735
+ else if (i) {
736
+ r.add(c);
737
+ const w = Xe({
738
+ columnKey: c,
739
+ values: tr(e.records, c)
742
740
  });
743
- s.set(l, p), p.status === "classified" && (d = p.metadata);
741
+ l.set(c, w), w.status === "classified" && (y = w.metadata);
744
742
  } else
745
743
  continue;
746
- d && n.set(l, {
747
- metadata: d,
744
+ y && n.set(c, {
745
+ metadata: y,
748
746
  format: f,
749
- formatValue: et({ metadata: d, format: f })
747
+ formatValue: Ye({ metadata: y, format: f })
750
748
  });
751
749
  }
752
750
  return {
753
751
  activatedColumnKeys: r,
754
752
  byColumnKey: n,
755
- ...c ? {
756
- sqlChunkEvidence: tt(s)
753
+ ...i ? {
754
+ sqlChunkEvidence: We(l)
757
755
  } : {}
758
756
  };
759
757
  }
760
- function lr(e) {
758
+ function nr(e) {
761
759
  if (!e.resolution.activatedColumnKeys.has(e.columnKey))
762
760
  return;
763
761
  if (e.value === void 0)
@@ -772,239 +770,239 @@ function lr(e) {
772
770
  const r = t.formatValue(e.value);
773
771
  return r.ok && r.wallClock ? { text: r.text, wallClock: r.wallClock } : { text: r.text };
774
772
  }
775
- function _e(e, t) {
773
+ function Ce(e, t) {
776
774
  const r = e.byColumnKey.get(t);
777
775
  return r ? r.metadata.valueKind === "date" : void 0;
778
776
  }
779
- const ur = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), mr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, dr = /^\d{4}-\d{2}-\d{2}$/, ze = "MM/dd/yyyy";
777
+ const or = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), ar = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, sr = /^\d{4}-\d{2}-\d{2}$/, Re = "MM/dd/yyyy";
780
778
  function X(e) {
781
779
  return typeof e == "object" && e !== null && !Array.isArray(e);
782
780
  }
783
- function O(e) {
781
+ function R(e) {
784
782
  return e.key || e.field || void 0;
785
783
  }
786
- function Ee(e) {
787
- return e == null ? "" : typeof e == "string" ? e : K(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
784
+ function _e(e) {
785
+ return e == null ? "" : typeof e == "string" ? e : j(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
788
786
  }
789
- function $e(e, t) {
787
+ function Te(e, t) {
790
788
  var n;
791
789
  const r = (n = e.columnSettings) == null ? void 0 : n[t];
792
790
  if (!(!X(r) || r.type !== "date"))
793
791
  return X(r.dateFormat) ? r.dateFormat : {};
794
792
  }
795
- function Fe(e) {
796
- return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || ze;
793
+ function Ee(e) {
794
+ return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Re;
797
795
  }
798
- function Se(e, t) {
796
+ function Fe(e, t) {
799
797
  return e && e !== "auto" ? e : t;
800
798
  }
801
- function fr(e) {
799
+ function ir(e) {
802
800
  return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
803
801
  }
804
- function pr(e) {
802
+ function cr(e) {
805
803
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
806
804
  if (typeof e != "string" || !e.trim()) return null;
807
805
  const t = Number(e);
808
806
  return Number.isFinite(t) ? t : null;
809
807
  }
810
- function hr(e) {
811
- const t = Ue(e);
808
+ function lr(e) {
809
+ const t = De(e);
812
810
  if (t !== void 0)
813
811
  try {
814
- return ht(t, /[.eE]/.test(t) ? "decimal" : "integer");
812
+ return ut(t, /[.eE]/.test(t) ? "decimal" : "integer");
815
813
  } catch {
816
814
  return;
817
815
  }
818
816
  }
819
- function br(e) {
817
+ function ur(e) {
820
818
  return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
821
819
  }
822
- function Yr(e) {
823
- const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) => rt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), s = (a) => ot({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
824
- function l(a) {
825
- var y;
826
- if ((y = t.visibleColumns) != null && y.length) return t.visibleColumns;
827
- const m = a.columns.map(O).filter((b) => !!b);
820
+ function Kr(e) {
821
+ const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, i = (a) => Je({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), l = (a) => Qe({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
822
+ function c(a) {
823
+ var b;
824
+ if ((b = t.visibleColumns) != null && b.length) return t.visibleColumns;
825
+ const m = a.columns.map(R).filter((d) => !!d);
828
826
  return m.length > 0 ? m : a.records[0] ? Object.keys(a.records[0]) : [];
829
827
  }
830
828
  function f(a, m) {
831
829
  return t.columnLabels && Object.prototype.hasOwnProperty.call(t.columnLabels, a) && t.columnLabels[a] || void 0 || h(m) || (m == null ? void 0 : m.label) || (m == null ? void 0 : m.headerName) || a;
832
830
  }
833
831
  function h(a, m) {
834
- const y = a == null ? void 0 : a.pivotIdentity;
835
- if (!y || !y.members || y.members.length === 0) return;
836
- const b = ye({ identity: y, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
837
- return Ct({
838
- members: b,
832
+ const b = a == null ? void 0 : a.pivotIdentity;
833
+ if (!b || !b.members || b.members.length === 0) return;
834
+ const d = he({ identity: b, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
835
+ return bt({
836
+ members: d,
839
837
  metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
840
838
  mode: n ? "formatted" : "canonical",
841
839
  resolveTemporalFormat: (C) => {
842
- const w = b.find((x) => x.fieldId === C);
843
- if (!(w != null && w.temporalBucket)) return;
844
- const v = pe({
840
+ const g = d.find((v) => v.fieldId === C);
841
+ if (!(g != null && g.temporalBucket)) return;
842
+ const x = de({
845
843
  snapshot: t.presentationExecutionSnapshot,
846
844
  scope: o,
847
845
  target: { kind: "field", fieldId: C, role: "pivotby" }
848
846
  });
849
- return v ? d(w.temporalBucket, v) : void 0;
847
+ return x ? y(g.temporalBucket, x) : void 0;
850
848
  }
851
849
  }).flattenedLabel;
852
850
  }
853
- function d(a, m) {
854
- return nt({
851
+ function y(a, m) {
852
+ return Ze({
855
853
  metadata: a,
856
854
  cardFormat: m,
857
855
  locale: m.locale,
858
856
  ...m.presentation.mode === "auto" ? { styles: m.presentation.styles } : {}
859
857
  }).format;
860
858
  }
861
- function p(a, m) {
862
- const { records: y, columns: b } = a, C = X(r.cardConfig) ? r.cardConfig : void 0, w = C == null ? void 0 : C.pivotByColumns, v = Array.isArray(w) ? w.flatMap(
863
- (i) => X(i) && typeof i.id == "string" && i.id ? [i.id] : []
859
+ function w(a, m) {
860
+ const { records: b, columns: d } = a, C = X(r.cardConfig) ? r.cardConfig : void 0, g = C == null ? void 0 : C.pivotByColumns, x = Array.isArray(g) ? g.flatMap(
861
+ (s) => X(s) && typeof s.id == "string" && s.id ? [s.id] : []
864
862
  ) : [];
865
- xt(
866
- b.map((i) => ({ key: O(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
867
- { expectedPivotFieldIds: v }
863
+ yt(
864
+ d.map((s) => ({ key: R(s) || "<unknown>", pivotIdentity: s.pivotIdentity })),
865
+ { expectedPivotFieldIds: x }
868
866
  );
869
- const x = l(a), S = new Map(
870
- b.flatMap((i) => {
871
- const g = O(i);
872
- return g ? [[g, i]] : [];
867
+ const v = c(a), P = new Map(
868
+ d.flatMap((s) => {
869
+ const p = R(s);
870
+ return p ? [[p, s]] : [];
873
871
  })
874
- ), Ge = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), I = cr({
875
- records: y,
876
- columns: b,
872
+ ), je = new Map(a.resultColumns.map((s) => [s.key, s.dataType])), M = rr({
873
+ records: b,
874
+ columns: d,
877
875
  formatting: t,
878
876
  queryPayload: r
879
- }), Z = new Map(
880
- b.flatMap((i) => {
881
- const g = O(i);
882
- return g && i.temporalBucket ? [[g, i.temporalBucket]] : [];
877
+ }), W = new Map(
878
+ d.flatMap((s) => {
879
+ const p = R(s);
880
+ return p && s.temporalBucket ? [[p, s.temporalBucket]] : [];
883
881
  })
884
- ), ue = /* @__PURE__ */ new Map();
885
- for (const i of x) {
886
- const g = pe({
882
+ ), ce = /* @__PURE__ */ new Map();
883
+ for (const s of v) {
884
+ const p = de({
887
885
  snapshot: t.presentationExecutionSnapshot,
888
886
  scope: o,
889
- target: { kind: "column", columnKey: i }
890
- }), _ = Z.get(i);
887
+ target: { kind: "column", columnKey: s }
888
+ }), _ = W.get(s);
891
889
  if (n) {
892
- if (g && !_) throw new Error(`Missing temporal bucket metadata for column "${i}"`);
893
- if (_ && !g) throw new Error(`Missing resolved temporal presentation for column "${i}"`);
890
+ if (p && !_) throw new Error(`Missing temporal bucket metadata for column "${s}"`);
891
+ if (_ && !p) throw new Error(`Missing resolved temporal presentation for column "${s}"`);
894
892
  }
895
- g && _ && ue.set(i, d(_, g));
893
+ p && _ && ce.set(s, y(_, p));
896
894
  }
897
- const J = x.map((i) => {
898
- const g = Ge.get(i), _ = g && ur.has(g) ? g : "unknown", E = n ? T(i, I, Z) : void 0, P = f(i, S.get(i)), A = n && I.activatedColumnKeys.has(i) && _e(I, i) === void 0;
895
+ const J = v.map((s) => {
896
+ const p = je.get(s), _ = p && or.has(p) ? p : "unknown", E = n ? T(s, M, W) : void 0, L = f(s, P.get(s)), A = n && M.activatedColumnKeys.has(s) && Ce(M, s) === void 0;
899
897
  return {
900
- key: i,
901
- label: P,
898
+ key: s,
899
+ label: L,
902
900
  dataType: _,
903
901
  ...E ? { presentation: E } : {},
904
- xlsx: ve({ key: i, label: P, formattedValues: n, dataType: _, presentation: E }),
902
+ xlsx: ge({ key: s, label: L, formattedValues: n, dataType: _, presentation: E }),
905
903
  ...A ? { xlsxPending: !0 } : {}
906
904
  };
907
905
  });
908
- function qe(i, g, _, E) {
909
- if (!n) return { text: Ee(i), value: i };
910
- const P = lr({ value: i, columnKey: g, rowIndex: _, resolution: I });
911
- if (P !== void 0) return { text: P.text, value: i, ...P.wallClock ? { wallClock: P.wallClock } : {} };
912
- const A = Z.get(g);
906
+ function Ve(s, p, _, E) {
907
+ if (!n) return { text: _e(s), value: s };
908
+ const L = nr({ value: s, columnKey: p, rowIndex: _, resolution: M });
909
+ if (L !== void 0) return { text: L.text, value: s, ...L.wallClock ? { wallClock: L.wallClock } : {} };
910
+ const A = W.get(p);
913
911
  if (A) {
914
- const L = ue.get(g);
915
- if (!L) throw new Error(`Missing resolved temporal presentation for column "${g}"`);
916
- if (i != null && typeof i != "string")
917
- throw new Error(`Canonical temporal column "${g}" must contain a string or null`);
918
- const N = i ?? null, R = at(N, A);
912
+ const $ = ce.get(p);
913
+ if (!$) throw new Error(`Missing resolved temporal presentation for column "${p}"`);
914
+ if (s != null && typeof s != "string")
915
+ throw new Error(`Canonical temporal column "${p}" must contain a string or null`);
916
+ const N = s ?? null, O = et(N, A);
919
917
  return {
920
- text: st({ value: N, metadata: A, format: L }),
921
- value: i,
922
- ...R ? { wallClock: R } : {}
918
+ text: tt({ value: N, metadata: A, format: $ }),
919
+ value: s,
920
+ ...O ? { wallClock: O } : {}
923
921
  };
924
922
  }
925
- if (i == null) return { text: "", value: i };
926
- const Q = s(g);
927
- if (Q && typeof i == "number" && Number.isFinite(i))
923
+ if (s == null) return { text: "", value: s };
924
+ const Z = l(p);
925
+ if (Z && typeof s == "number" && Number.isFinite(s))
928
926
  return {
929
- text: he(
930
- new Date(i).toISOString(),
931
- Q.pattern || ze,
932
- Se(Q.timezone, t.timezone),
927
+ text: fe(
928
+ new Date(s).toISOString(),
929
+ Z.pattern || Re,
930
+ Fe(Z.timezone, t.timezone),
933
931
  "UTC"
934
932
  ),
935
- value: i
933
+ value: s
936
934
  };
937
- const D = c(g);
938
- if (typeof i == "number")
939
- return { text: D ? B(i, D) : String(i), value: i };
940
- if (K(i))
941
- return { text: D ? B(i, D) : i.value, value: i };
942
- const V = $e(t, g);
943
- if (V && (i instanceof Date || typeof i == "string" && mr.test(i))) {
944
- const L = i instanceof Date ? i.toISOString() : i, N = typeof i == "string" && dr.test(i), R = N ? "UTC" : Se(V.timezone, t.timezone), de = N ? "UTC" : V.sourceTimezone || "auto", fe = it(L, R, de);
935
+ const D = i(p);
936
+ if (typeof s == "number")
937
+ return { text: D ? B(s, D) : String(s), value: s };
938
+ if (j(s))
939
+ return { text: D ? B(s, D) : s.value, value: s };
940
+ const V = Te(t, p);
941
+ if (V && (s instanceof Date || typeof s == "string" && ar.test(s))) {
942
+ const $ = s instanceof Date ? s.toISOString() : s, N = typeof s == "string" && sr.test(s), O = N ? "UTC" : Fe(V.timezone, t.timezone), ue = N ? "UTC" : V.sourceTimezone || "auto", me = rt($, O, ue);
945
943
  return {
946
- text: he(L, Fe(V), R, de),
947
- value: i,
948
- ...fe ? { wallClock: fe } : {}
944
+ text: fe($, Ee(V), O, ue),
945
+ value: s,
946
+ ...me ? { wallClock: me } : {}
949
947
  };
950
948
  }
951
- if (typeof i == "string" && D && E.dataType === "number") {
952
- const L = hr(i);
953
- if (L) return { text: B(L, D), value: i };
949
+ if (typeof s == "string" && D && E.dataType === "number") {
950
+ const $ = lr(s);
951
+ if ($) return { text: B($, D), value: s };
954
952
  }
955
- return { text: Ee(i), value: i };
953
+ return { text: _e(s), value: s };
956
954
  }
957
- const Xe = y.map(
958
- (i, g) => J.map((_) => {
959
- const E = qe(i[_.key], _.key, g, _);
960
- return z({ value: E.value, text: E.text, column: _.xlsx, wallClock: E.wallClock });
955
+ const Be = b.map(
956
+ (s, p) => J.map((_) => {
957
+ const E = Ve(s[_.key], _.key, p, _);
958
+ return H({ value: E.value, text: E.text, column: _.xlsx, wallClock: E.wallClock });
961
959
  })
962
- ), me = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
963
- if (me)
964
- for (const i of x) {
965
- const g = S.get(i);
966
- g != null && g.pivotIdentity && ye({ identity: g.pivotIdentity, columnKey: O(g) || i });
960
+ ), le = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
961
+ if (le)
962
+ for (const s of v) {
963
+ const p = P.get(s);
964
+ p != null && p.pivotIdentity && he({ identity: p.pivotIdentity, columnKey: R(p) || s });
967
965
  }
968
966
  return {
969
- ...me ? { header: J.map((i) => i.label) } : {},
967
+ ...le ? { header: J.map((s) => s.label) } : {},
970
968
  columns: J,
971
- rows: Xe,
972
- ...I.sqlChunkEvidence ? { rawTemporalClassification: I.sqlChunkEvidence } : {}
969
+ rows: Be,
970
+ ...M.sqlChunkEvidence ? { rawTemporalClassification: M.sqlChunkEvidence } : {}
973
971
  };
974
972
  }
975
- function T(a, m, y) {
973
+ function T(a, m, b) {
976
974
  if (m.activatedColumnKeys.has(a)) {
977
- const v = _e(m, a);
978
- return v === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: v };
975
+ const x = Ce(m, a);
976
+ return x === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: x };
979
977
  }
980
- const b = y.get(a);
981
- if (b) return { kind: "temporal_bucket", grain: br(b) };
982
- if (s(a)) return { kind: "text" };
983
- const C = $e(t, a);
984
- if (C) return { kind: "datetime", dateOnly: fr(Fe(C)) };
985
- const w = c(a);
986
- return w ? { kind: "measure", format: w } : void 0;
978
+ const d = b.get(a);
979
+ if (d) return { kind: "temporal_bucket", grain: ur(d) };
980
+ if (l(a)) return { kind: "text" };
981
+ const C = Te(t, a);
982
+ if (C) return { kind: "datetime", dateOnly: ir(Ee(C)) };
983
+ const g = i(a);
984
+ return g ? { kind: "measure", format: g } : void 0;
987
985
  }
988
986
  function u(a, m) {
989
987
  if (!Number.isInteger(m) || m < 0)
990
988
  throw new Error("totalRows must be a non-negative integer");
991
- return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((b) => {
992
- const w = Object.prototype.hasOwnProperty.call(a, b) ? a[b] : b === t.tableTotalsLabelColumnKey ? "Total" : null, v = n ? c(b) : void 0, x = ve({
993
- key: b,
994
- label: b,
989
+ return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((d) => {
990
+ const g = Object.prototype.hasOwnProperty.call(a, d) ? a[d] : d === t.tableTotalsLabelColumnKey ? "Total" : null, x = n ? i(d) : void 0, v = ge({
991
+ key: d,
992
+ label: d,
995
993
  formattedValues: n,
996
994
  dataType: "unknown",
997
- ...v ? { presentation: { kind: "measure", format: v } } : {}
995
+ ...x ? { presentation: { kind: "measure", format: x } } : {}
998
996
  });
999
- if (w == null) return { kind: "empty" };
1000
- if (!n) return z({ value: w, text: String(w), column: x });
1001
- const S = v ? pr(w) : null;
1002
- return z(v && S !== null ? { value: S, text: B(S, v), column: x } : { value: w, text: String(w), column: x });
997
+ if (g == null) return { kind: "empty" };
998
+ if (!n) return H({ value: g, text: String(g), column: v });
999
+ const P = x ? cr(g) : null;
1000
+ return H(x && P !== null ? { value: P, text: B(P, x), column: v } : { value: g, text: String(g), column: v });
1003
1001
  });
1004
1002
  }
1005
- return { format: p, totals: u };
1003
+ return { format: w, totals: u };
1006
1004
  }
1007
- const yr = /* @__PURE__ */ new Set([
1005
+ const mr = /* @__PURE__ */ new Set([
1008
1006
  "scope",
1009
1007
  "useFormattedValues",
1010
1008
  "timezone",
@@ -1019,96 +1017,96 @@ const yr = /* @__PURE__ */ new Set([
1019
1017
  "fileFormat",
1020
1018
  "title"
1021
1019
  ]);
1022
- function le(e) {
1020
+ function ie(e) {
1023
1021
  return e !== null && typeof e == "object" && !Array.isArray(e);
1024
1022
  }
1025
- function Le(e, t) {
1023
+ function Se(e, t) {
1026
1024
  if (e !== void 0) {
1027
- if (!le(e))
1025
+ if (!ie(e))
1028
1026
  throw new Error(`formatting.${t} must be an object`);
1029
1027
  return e;
1030
1028
  }
1031
1029
  }
1032
- function Zr(e) {
1033
- if (!le(e))
1030
+ function jr(e) {
1031
+ if (!ie(e))
1034
1032
  throw new Error("formatting must be an object");
1035
1033
  const t = ["reportContext", "resolvedFormats"].find(
1036
1034
  (a) => Object.prototype.hasOwnProperty.call(e, a)
1037
1035
  );
1038
1036
  if (t)
1039
- throw new be(
1037
+ throw new pe(
1040
1038
  `formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
1041
1039
  );
1042
- const r = Object.keys(e).find((a) => !yr.has(a));
1040
+ const r = Object.keys(e).find((a) => !mr.has(a));
1043
1041
  if (r)
1044
1042
  throw new Error(`formatting contains unknown property "${r}"`);
1045
1043
  const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
1046
1044
  if (!n)
1047
1045
  throw new Error("formatting.timezone must be a non-empty string");
1048
- const o = mt(e.delimiter);
1046
+ const o = st(e.delimiter);
1049
1047
  if (!o)
1050
1048
  throw new Error("formatting.delimiter must be a comma, semicolon or tab");
1051
- const c = dt(e.csvEncoding);
1052
- if (!c)
1049
+ const i = it(e.csvEncoding);
1050
+ if (!i)
1053
1051
  throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
1054
1052
  if (typeof e.includeHeaders != "boolean")
1055
1053
  throw new Error("formatting.includeHeaders must be a boolean");
1056
1054
  if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
1057
1055
  throw new Error("formatting.useFormattedValues must be a boolean");
1058
- const s = e.fileFormat === void 0 ? void 0 : ft(e.fileFormat);
1059
- if (e.fileFormat !== void 0 && !s)
1056
+ const l = e.fileFormat === void 0 ? void 0 : ct(e.fileFormat);
1057
+ if (e.fileFormat !== void 0 && !l)
1060
1058
  throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
1061
1059
  if (e.title !== void 0 && typeof e.title != "string")
1062
1060
  throw new Error("formatting.title must be a string");
1063
- const l = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
1064
- if (e.visibleColumns !== void 0 && !l)
1061
+ const c = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
1062
+ if (e.visibleColumns !== void 0 && !c)
1065
1063
  throw new Error("formatting.visibleColumns must be an array of strings");
1066
- const f = Le(e.columnLabels, "columnLabels");
1064
+ const f = Se(e.columnLabels, "columnLabels");
1067
1065
  if (f && Object.values(f).some((a) => typeof a != "string"))
1068
1066
  throw new Error("formatting.columnLabels values must be strings");
1069
- const h = Le(e.columnSettings, "columnSettings"), d = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
1070
- if (d === null)
1067
+ const h = Se(e.columnSettings, "columnSettings"), y = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
1068
+ if (y === null)
1071
1069
  throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
1072
- if (d && !(l != null && l.includes(d)))
1070
+ if (y && !(c != null && c.includes(y)))
1073
1071
  throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
1074
- const p = ct(e.scope, "formatting.scope");
1075
- if (!p.cardId || p.attachmentIndex !== void 0)
1072
+ const w = nt(e.scope, "formatting.scope");
1073
+ if (!w.cardId || w.attachmentIndex !== void 0)
1076
1074
  throw new Error("formatting.scope must identify exactly one dashboard card");
1077
- const T = e.useFormattedValues !== !1, u = lt(e.presentationExecutionSnapshot);
1075
+ const T = e.useFormattedValues !== !1, u = ot(e.presentationExecutionSnapshot);
1078
1076
  if (n !== u.reportContext.calendar.tz)
1079
1077
  throw new Error(
1080
1078
  "formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
1081
1079
  );
1082
1080
  try {
1083
- ut({
1081
+ at({
1084
1082
  snapshot: u,
1085
- expectedScope: { dashboardId: p.dashboardId, cardId: p.cardId },
1086
- visibleColumns: l,
1083
+ expectedScope: { dashboardId: w.dashboardId, cardId: w.cardId },
1084
+ visibleColumns: c,
1087
1085
  useFormattedValues: T
1088
1086
  });
1089
1087
  } catch (a) {
1090
- throw new be(
1088
+ throw new pe(
1091
1089
  `formatting.presentationExecutionSnapshot.${a instanceof Error ? a.message : String(a)}`
1092
1090
  );
1093
1091
  }
1094
1092
  return {
1095
- scope: { dashboardId: p.dashboardId, cardId: p.cardId },
1093
+ scope: { dashboardId: w.dashboardId, cardId: w.cardId },
1096
1094
  useFormattedValues: T,
1097
1095
  timezone: n,
1098
1096
  presentationExecutionSnapshot: u,
1099
1097
  delimiter: o,
1100
- csvEncoding: c,
1098
+ csvEncoding: i,
1101
1099
  includeHeaders: e.includeHeaders,
1102
1100
  ...h ? { columnSettings: h } : {},
1103
- ...l ? { visibleColumns: l } : {},
1101
+ ...c ? { visibleColumns: c } : {},
1104
1102
  ...f ? { columnLabels: f } : {},
1105
- ...d ? { tableTotalsLabelColumnKey: d } : {},
1106
- ...s ? { fileFormat: s } : {},
1103
+ ...y ? { tableTotalsLabelColumnKey: y } : {},
1104
+ ...l ? { fileFormat: l } : {},
1107
1105
  ...typeof e.title == "string" ? { title: e.title } : {}
1108
1106
  };
1109
1107
  }
1110
- function Jr(e) {
1111
- const t = e.formatOptions, r = (n) => le(n) ? n : void 0;
1108
+ function Vr(e) {
1109
+ const t = e.formatOptions, r = (n) => ie(n) ? n : void 0;
1112
1110
  return {
1113
1111
  scope: { dashboardId: e.dashboardId, cardId: e.cardId },
1114
1112
  useFormattedValues: t.useFormattedValues !== !1,
@@ -1125,187 +1123,90 @@ function Jr(e) {
1125
1123
  ...typeof e.title == "string" ? { title: e.title } : {}
1126
1124
  };
1127
1125
  }
1128
- const gr = /^\d{4}-\d{2}-\d{2}$/;
1129
- function He(e) {
1130
- const t = e.split(".");
1131
- return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((o) => o.charAt(0).toUpperCase() + o.slice(1).toLowerCase()).join(" ");
1132
- }
1133
- const Pe = 10;
1134
- function se(e, t) {
1135
- const r = e.slice(0, Pe).map(t).join(", "), n = e.length - Pe;
1136
- return n > 0 ? `${r}, and ${n} more` : r;
1137
- }
1138
- function wr(e) {
1139
- if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
1140
- return;
1141
- const t = Y(e.relativeMeta);
1142
- return t && Oe(t).printsByName ? t : void 0;
1143
- }
1144
- function vr(e, t) {
1145
- if (t !== "label") return wr(e);
1146
- if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
1147
- return Y(e.relativeMeta);
1148
- }
1149
- function Ie(e, t = {}) {
1150
- const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ?? He(r), l = vr(e, t.relativeDates);
1151
- if (l) {
1152
- const p = bt(l).label;
1153
- if (p)
1154
- return n === "between" ? `${s}: ${p}` : `${s} not in ${p}`;
1155
- }
1156
- if (!o || o.length === 0)
1157
- return n === "is null" ? `${s} is empty` : n === "is not null" ? `${s} is not empty` : "";
1158
- const f = Y(e.relativeMeta), h = e.temporalPrecision === "minute" || !!(f && Oe(f).subDay), d = (p) => {
1159
- if (c === "date" && p) {
1160
- const T = {
1161
- year: "numeric",
1162
- month: "short",
1163
- day: "numeric",
1164
- ...h ? {
1165
- hour: "numeric",
1166
- minute: "2-digit"
1167
- } : {}
1168
- };
1169
- if (typeof p == "string" && gr.test(p)) {
1170
- const [a, m, y] = p.split("-").map(Number);
1171
- return new Intl.DateTimeFormat(void 0, {
1172
- year: "numeric",
1173
- month: "short",
1174
- day: "numeric",
1175
- timeZone: "UTC"
1176
- }).format(new Date(Date.UTC(a, m - 1, y)));
1177
- }
1178
- if (typeof p == "string" && _t(p) === "wall_datetime") {
1179
- const [a, m, y, b, C] = p.split(/[-T :.]/).map(Number);
1180
- return new Intl.DateTimeFormat(void 0, {
1181
- ...T,
1182
- timeZone: "UTC"
1183
- }).format(new Date(Date.UTC(a, m - 1, y, b, C)));
1184
- }
1185
- const u = new Date(p);
1186
- if (!isNaN(u.getTime()))
1187
- try {
1188
- return new Intl.DateTimeFormat(void 0, {
1189
- ...T,
1190
- ...t.timezone ? { timeZone: t.timezone } : {}
1191
- }).format(u);
1192
- } catch {
1193
- return h ? u.toLocaleString(void 0, T) : u.toLocaleDateString(void 0, T);
1194
- }
1195
- }
1196
- return String(p);
1197
- };
1198
- switch (n) {
1199
- case "=":
1200
- return `${s}: ${d(o[0])}`;
1201
- case "!=":
1202
- return `${s} ≠ ${d(o[0])}`;
1203
- case ">":
1204
- return `${s} > ${d(o[0])}`;
1205
- case "<":
1206
- return `${s} < ${d(o[0])}`;
1207
- case ">=":
1208
- return `${s} ≥ ${d(o[0])}`;
1209
- case "<=":
1210
- return `${s} ≤ ${d(o[0])}`;
1211
- case "between":
1212
- case "not between": {
1213
- const p = `${d(o[0])} - ${d(o[1])}`;
1214
- return n === "between" ? `${s}: ${p}` : `${s} not in ${p}`;
1215
- }
1216
- case "in":
1217
- return o.length === 1 ? `${s}: ${d(o[0])}` : `${s}: ${se(o, d)}`;
1218
- case "not in":
1219
- return `${s} not in (${se(o, d)})`;
1220
- case "like":
1221
- return `${s} contains "${o[0]}"`;
1222
- case "not like":
1223
- return `${s} doesn't contain "${o[0]}"`;
1224
- default:
1225
- return `${s}: ${se(o, d)}`;
1226
- }
1227
- }
1228
- function Qr(e, t = {}) {
1229
- if (!e || e.length === 0)
1230
- return "";
1231
- const r = /* @__PURE__ */ new Map();
1232
- e.forEach((o) => {
1233
- const c = r.get(o.name) || [];
1234
- c.push(o), r.set(o.name, c);
1235
- });
1236
- const n = [];
1237
- return r.forEach((o, c) => {
1238
- if (o.length === 1) {
1239
- const s = Ie(o[0], t);
1240
- s && n.push(s);
1241
- } else {
1242
- const s = He(c), l = o.map((f) => Ie(f, t).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
1243
- l.length > 0 && n.push(`${s}: ${l.join(" and ")}`);
1244
- }
1245
- }), n.join(" | ");
1246
- }
1247
- function en(e) {
1248
- return ((e == null ? void 0 : e.filterValues) ?? []).filter(Cr).map(xr);
1126
+ function Br(e) {
1127
+ return ((e == null ? void 0 : e.filterValues) ?? []).filter(dr).map(fr);
1249
1128
  }
1250
- function Cr(e) {
1129
+ function dr(e) {
1251
1130
  return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
1252
1131
  }
1253
- function xr(e) {
1132
+ function fr(e) {
1254
1133
  if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
1255
- const { relativeMeta: t, ...r } = e, n = Y(t);
1134
+ const { relativeMeta: t, ...r } = e, n = mt(t);
1256
1135
  return n ? { ...r, relativeMeta: n } : r;
1257
1136
  }
1258
- const Tr = /* @__PURE__ */ new Set([
1137
+ const pr = /* @__PURE__ */ new Set([
1259
1138
  "day",
1260
1139
  "week",
1261
1140
  "month",
1262
1141
  "quarter",
1263
1142
  "year"
1264
1143
  ]);
1265
- function _r(e, t) {
1144
+ function hr(e, t) {
1266
1145
  try {
1267
- const r = k(
1268
- U(e),
1269
- t,
1270
- "yyyy-MM-dd"
1271
- ), [n, o, c] = r.split("-").map(Number), s = new Date(Date.UTC(n, o - 1, c));
1272
- return s.setUTCDate(s.getUTCDate() - 1), k(s, "UTC", "yyyy-MM-dd");
1146
+ const r = K(e), n = I(r, t, "yyyy-MM-dd");
1147
+ if (I(r, t, "HH:mm:ss.SSS") !== "00:00:00.000")
1148
+ return {
1149
+ date: n,
1150
+ time: I(r, t, "h:mm a")
1151
+ };
1152
+ const [o, i, l] = n.split("-").map(Number), c = new Date(Date.UTC(o, i - 1, l));
1153
+ return c.setUTCDate(c.getUTCDate() - 1), { date: I(c, "UTC", "yyyy-MM-dd") };
1273
1154
  } catch {
1274
1155
  return;
1275
1156
  }
1276
1157
  }
1277
- function tn(e, t, r, n = !1) {
1278
- const o = De(e, t, r);
1279
- if (o.start === o.end) return o.end;
1280
- const c = n ? De(e, t, r, !0) : o;
1281
- return `${c.start} – ${c.end}`;
1158
+ function Ue(e, t, r) {
1159
+ const n = hr(e.end, t);
1160
+ if (n)
1161
+ return {
1162
+ start: I(
1163
+ K(e.start),
1164
+ t,
1165
+ r ? "MMM d" : "MMM d, yyyy"
1166
+ ),
1167
+ endDate: I(
1168
+ K(`${n.date}T00:00:00Z`),
1169
+ "UTC",
1170
+ "MMM d, yyyy"
1171
+ ),
1172
+ ...n.time ? { endTime: n.time } : {}
1173
+ };
1174
+ }
1175
+ function Ke(e) {
1176
+ return !!(e && pr.has(e));
1282
1177
  }
1283
- function De(e, t, r, n = !1) {
1178
+ function Hr(e, t, r, n = !1) {
1179
+ if (Ke(r))
1180
+ try {
1181
+ const i = Ue(e, t, !1);
1182
+ if (i && i.start === i.endDate)
1183
+ return i.endTime ? `${i.endDate} until ${i.endTime}` : i.endDate;
1184
+ } catch {
1185
+ }
1186
+ const o = br(
1187
+ e,
1188
+ t,
1189
+ r,
1190
+ n
1191
+ );
1192
+ return `${o.start} – ${o.end}`;
1193
+ }
1194
+ function br(e, t, r, n = !1) {
1284
1195
  try {
1285
- if (r && Tr.has(r)) {
1286
- const o = _r(e.end, t);
1287
- if (o) {
1288
- const c = n ? "MMM d" : "MMM d, yyyy";
1196
+ if (Ke(r)) {
1197
+ const o = Ue(e, t, n);
1198
+ if (o)
1289
1199
  return {
1290
- start: k(
1291
- U(e.start),
1292
- t,
1293
- c
1294
- ),
1295
- end: k(
1296
- U(`${o}T00:00:00Z`),
1297
- "UTC",
1298
- "MMM d, yyyy"
1299
- )
1200
+ start: o.start,
1201
+ end: o.endTime ? `${o.endDate}, ${o.endTime}` : o.endDate
1300
1202
  };
1301
- }
1302
1203
  }
1303
1204
  if (r === "second" || r === "minute" || r === "hour") {
1304
1205
  const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
1305
1206
  return {
1306
- start: k(U(e.start), t, o),
1307
- end: `before ${k(
1308
- U(e.end),
1207
+ start: I(K(e.start), t, o),
1208
+ end: `before ${I(
1209
+ K(e.end),
1309
1210
  t,
1310
1211
  o
1311
1212
  )}`
@@ -1316,42 +1217,38 @@ function De(e, t, r, n = !1) {
1316
1217
  return { start: e.start, end: `before ${e.end}` };
1317
1218
  }
1318
1219
  export {
1319
- Zr as A,
1320
- Jr as B,
1321
- Wr as C,
1322
- Hr as D,
1323
- wr as E,
1324
- Pe as F,
1325
- Ie as G,
1326
- Qr as H,
1327
- en as I,
1328
- De as J,
1329
- Or as M,
1330
- zt as P,
1331
- Nr as a,
1332
- jr as b,
1333
- Kr as c,
1334
- qt as d,
1335
- Rr as e,
1336
- tn as f,
1337
- Vr as g,
1338
- Ur as h,
1339
- Ut as i,
1340
- Kt as j,
1341
- Bt as k,
1342
- Br as l,
1343
- Gt as m,
1344
- Wt as n,
1345
- Yt as o,
1346
- Ht as p,
1347
- Zt as q,
1348
- ve as r,
1349
- zr as s,
1350
- z as t,
1351
- Jt as u,
1352
- Gr as v,
1353
- or as w,
1354
- qr as x,
1355
- Xr as y,
1356
- Yr as z
1220
+ jr as A,
1221
+ Vr as B,
1222
+ Ur as C,
1223
+ Ar as D,
1224
+ Br as E,
1225
+ br as F,
1226
+ Pr as M,
1227
+ Rt as P,
1228
+ Fr as a,
1229
+ Ir as b,
1230
+ Lr as c,
1231
+ jt as d,
1232
+ Sr as e,
1233
+ Hr as f,
1234
+ Mr as g,
1235
+ $r as h,
1236
+ Dt as i,
1237
+ At as j,
1238
+ Ot as k,
1239
+ Dr as l,
1240
+ Kt as m,
1241
+ Bt as n,
1242
+ Ht as o,
1243
+ Ut as p,
1244
+ zt as q,
1245
+ ge as r,
1246
+ kr as s,
1247
+ H as t,
1248
+ Gt as u,
1249
+ Nr as v,
1250
+ Zt as w,
1251
+ Or as x,
1252
+ Rr as y,
1253
+ Kr as z
1357
1254
  };