react-semaphor 0.1.543 → 0.1.544
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity/index.js +73 -0
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +51 -50
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-Bz4n1Lq6.js} +44 -44
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-BNLkCDml.js} +288 -288
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-BTkrN3W4.js} +467 -462
- package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +3725 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-8RyBTQUO.js} +530 -525
- package/dist/chunks/dashboard-g5a4DKWq.js +14 -0
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-7qT9jmfL.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-OwqCbrVp.js → document-dashboard-inputs-BC6p-ESg.js} +4 -4
- package/dist/chunks/{document-sheet-utils-BTb3VZxV.js → document-sheet-utils-Duo9uLoH.js} +11 -11
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-BfJwnRIZ.js} +249 -248
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{index-l5LclZvs.js → index-DkAyQvC6.js} +59 -58
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-CxJLkztA.js} +1 -1
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-DESvLiu9.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-CLiVi90c.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-Df7VpRVW.js} +195 -195
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-B-mQ--nV.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-DDAxk8us.js} +39892 -39380
- package/dist/chunks/{shelf-drop-preview-context-BGl_rxcW.js → shelf-drop-preview-context-BSRPwaED.js} +414 -371
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-CPfGAQ9X.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-BxzFviM-.js} +67 -78
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +72 -72
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +226 -223
- package/dist/index.js +266 -271
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/package.json +5 -1
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-BTkrN3W4.js}
RENAMED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var fe = (e, t, r) =>
|
|
4
|
-
import { i as
|
|
5
|
-
import { i as _e, m as te, j as De, k as
|
|
6
|
-
import {
|
|
7
|
-
import { aC as U, l as
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var et = (e, t, r) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var fe = (e, t, r) => et(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { i as tt, j as V, m as rt, Q as ne, f as Ie, F as $e, P as ot, r as nt, M as at, v as st, c as it, p as lt, J as ct, a as j, G as ut, I as mt } from "./temporal-bucket-D7NBrrtL.js";
|
|
5
|
+
import { i as _e, m as te, j as De, k as dt, l as Re, a as ge, d as ft, n as $ } from "./matrix-formatter-CxJLkztA.js";
|
|
6
|
+
import { h as Z, e as gt, p as pt, k as yt } from "./export-file-format-C-tJsxsf.js";
|
|
7
|
+
import { aC as U, l as ht, w as X, aB as bt, y as ae, x as wt } from "./validators-DMHTpf7a.js";
|
|
8
8
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
9
9
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
10
10
|
import "zod";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import { A as Pe, a as vt, t as pe, s as Tt, P as ye, l as Ct, o as xt, v as St, G as O } from "./pivot-result-lifecycle-DM4CyGKs.js";
|
|
12
|
+
import { PDF_SAFETY_LIMIT_EXCEEDED as Ne, getUtf8ByteLength as Et, FAST_PDF_POLICY as kt } from "../pdf-export-policy/index.js";
|
|
13
|
+
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as At } from "../value-format-preferences/index.js";
|
|
14
|
+
import { z as Lt, g as Ft } from "./zoned-wall-clock-MulfA26h.js";
|
|
15
|
+
import { p as Mt } from "./pivot-header-presentation-DHcx1XGQ.js";
|
|
16
|
+
import { d as It, c as he } from "./pivot-result-identity-DJhXXcns.js";
|
|
17
|
+
import { v as $t } from "./raw-temporal-contract-C51YG48G.js";
|
|
18
|
+
function _t(e, t, r) {
|
|
19
|
+
const o = {
|
|
19
20
|
...t,
|
|
20
21
|
locale: t.locale ?? r
|
|
21
22
|
};
|
|
22
|
-
if (
|
|
23
|
-
return V(e,
|
|
24
|
-
const { prefix:
|
|
25
|
-
return `${
|
|
23
|
+
if (o.type === "number")
|
|
24
|
+
return V(e, o);
|
|
25
|
+
const { prefix: n, suffix: i, ...a } = o;
|
|
26
|
+
return `${n ?? ""}${V(e, {
|
|
26
27
|
...a,
|
|
27
|
-
negativeStyle:
|
|
28
|
+
negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
|
|
28
29
|
})}${i ?? ""}`;
|
|
29
30
|
}
|
|
30
31
|
function q(e, t, r) {
|
|
31
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
32
|
+
return e === null ? { value: e, text: null } : !t || !tt(t) && t.type !== "duration" ? {
|
|
32
33
|
value: e,
|
|
33
34
|
text: V(e, { type: "number", locale: r })
|
|
34
35
|
} : t.type === "duration" ? {
|
|
35
36
|
value: e,
|
|
36
|
-
text:
|
|
37
|
+
text: rt(e, {
|
|
37
38
|
inputUnit: t.inputUnit,
|
|
38
39
|
outputStyle: t.outputStyle,
|
|
39
40
|
largestUnit: t.largestUnit,
|
|
@@ -43,10 +44,10 @@ function q(e, t, r) {
|
|
|
43
44
|
suffix: t.suffix,
|
|
44
45
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
45
46
|
})
|
|
46
|
-
} : { value: e, text:
|
|
47
|
+
} : { value: e, text: _t(e, t, r) };
|
|
47
48
|
}
|
|
48
|
-
function be(e, t, r,
|
|
49
|
-
return e === null ? { value: e, text: null } :
|
|
49
|
+
function be(e, t, r, o) {
|
|
50
|
+
return e === null ? { value: e, text: null } : o === "percent" ? {
|
|
50
51
|
value: e,
|
|
51
52
|
text: V(e, {
|
|
52
53
|
type: "percent",
|
|
@@ -72,7 +73,7 @@ function we(e, t) {
|
|
|
72
73
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
73
74
|
return e;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function mo(e, t) {
|
|
76
77
|
const r = {
|
|
77
78
|
mode: t.displayMode,
|
|
78
79
|
current: q(
|
|
@@ -102,19 +103,19 @@ function un(e, t) {
|
|
|
102
103
|
"ratio"
|
|
103
104
|
)), r;
|
|
104
105
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
106
|
+
const Dt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
107
|
+
function Rt(e) {
|
|
107
108
|
const { presentation: t } = e;
|
|
108
|
-
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" ?
|
|
109
|
+
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" ? Dt.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";
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
const t = (
|
|
112
|
-
return
|
|
111
|
+
function Pt(e) {
|
|
112
|
+
const t = (n, i) => Number.isInteger(n) ? Math.min(20, Math.max(0, n)) : i, r = t(e.minimumFractionDigits, 0), o = Math.max(r, t(e.maximumFractionDigits, 2));
|
|
113
|
+
return o === 0 ? "" : `.${"0".repeat(o)}`;
|
|
113
114
|
}
|
|
114
115
|
function J(e) {
|
|
115
116
|
return `"${e.replace(/"/g, "")}"`;
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function Nt(e) {
|
|
118
119
|
let t;
|
|
119
120
|
try {
|
|
120
121
|
t = new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
@@ -124,33 +125,33 @@ function Pt(e) {
|
|
|
124
125
|
} catch {
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
const r = t.findIndex((i) => i.type === "currency"),
|
|
128
|
-
if (r < 0 ||
|
|
129
|
-
const
|
|
130
|
-
return r <
|
|
128
|
+
const r = t.findIndex((i) => i.type === "currency"), o = t.findIndex((i) => i.type === "integer");
|
|
129
|
+
if (r < 0 || o < 0) return;
|
|
130
|
+
const n = (i, a) => t.slice(i, a).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
|
|
131
|
+
return r < o ? { side: "before", text: t[r].value + n(r + 1, o) } : {
|
|
131
132
|
side: "after",
|
|
132
|
-
text: o
|
|
133
|
+
text: n(o + 1, r) + t[r].value
|
|
133
134
|
};
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
const t =
|
|
136
|
+
function Ot(e) {
|
|
137
|
+
const t = Pt(e);
|
|
137
138
|
let r;
|
|
138
139
|
if (e.type === "scientific")
|
|
139
140
|
r = `0${t}E+00`;
|
|
140
141
|
else {
|
|
141
|
-
const
|
|
142
|
+
const o = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
|
|
142
143
|
if (e.type === "currency") {
|
|
143
|
-
const
|
|
144
|
-
r =
|
|
145
|
-
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${
|
|
144
|
+
const n = Nt(e);
|
|
145
|
+
r = n ? n.side === "before" ? `${J(n.text)}${o}` : `${o}${J(n.text)}` : o;
|
|
146
|
+
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${o}${J("%")}` : `${o}%` : r = o;
|
|
146
147
|
}
|
|
147
148
|
return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function Vt(e, t) {
|
|
150
151
|
if (!e.formattedValues) return;
|
|
151
152
|
const { presentation: r } = e;
|
|
152
153
|
if (t === "number" || t === "by_value")
|
|
153
|
-
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 :
|
|
154
|
+
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Ot(r.format);
|
|
154
155
|
if (t === "date") {
|
|
155
156
|
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
156
157
|
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
@@ -159,7 +160,7 @@ function Ot(e, t) {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
function ve(e) {
|
|
162
|
-
const t =
|
|
163
|
+
const t = Rt(e), r = Vt(e, t);
|
|
163
164
|
return Object.freeze({
|
|
164
165
|
key: e.key,
|
|
165
166
|
label: e.label,
|
|
@@ -167,18 +168,18 @@ function ve(e) {
|
|
|
167
168
|
...r === void 0 ? {} : { numberFormat: r }
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
|
-
const
|
|
171
|
+
const Ut = 15, Kt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
171
172
|
function Oe(e) {
|
|
172
|
-
return
|
|
173
|
+
return Kt.test(e) ? e : void 0;
|
|
173
174
|
}
|
|
174
175
|
function Te(e) {
|
|
175
176
|
const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
176
|
-
if (r.length >
|
|
177
|
-
const
|
|
178
|
-
return Number.isFinite(
|
|
177
|
+
if (r.length > Ut) return !1;
|
|
178
|
+
const o = Number(e);
|
|
179
|
+
return Number.isFinite(o) && (o !== 0 || r.length === 0);
|
|
179
180
|
}
|
|
180
|
-
const
|
|
181
|
-
function
|
|
181
|
+
const Bt = Date.UTC(1900, 2, 1), zt = Date.UTC(1e4, 0, 1), jt = Date.UTC(1899, 11, 30), Gt = 864e5;
|
|
182
|
+
function Ht(e) {
|
|
182
183
|
const t = Date.UTC(
|
|
183
184
|
e.year,
|
|
184
185
|
e.month - 1,
|
|
@@ -187,8 +188,8 @@ function Gt(e) {
|
|
|
187
188
|
e.minute,
|
|
188
189
|
e.second
|
|
189
190
|
);
|
|
190
|
-
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t <
|
|
191
|
-
return (t -
|
|
191
|
+
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Bt || t >= zt))
|
|
192
|
+
return (t - jt) / Gt;
|
|
192
193
|
}
|
|
193
194
|
function Ce(e, t, r) {
|
|
194
195
|
if (typeof e == "number")
|
|
@@ -196,52 +197,55 @@ function Ce(e, t, r) {
|
|
|
196
197
|
if (U(e))
|
|
197
198
|
return Te(e.value) ? { kind: "number", text: t, value: e } : void 0;
|
|
198
199
|
if (r && typeof e == "string") {
|
|
199
|
-
const
|
|
200
|
-
return
|
|
200
|
+
const o = Oe(e);
|
|
201
|
+
return o !== void 0 && Te(o) ? { kind: "number", text: t, value: o } : void 0;
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
function P(e) {
|
|
204
|
-
const { value: t, text: r, column:
|
|
205
|
+
const { value: t, text: r, column: o } = e;
|
|
205
206
|
if (r === "") return { kind: "empty" };
|
|
206
|
-
const
|
|
207
|
-
switch (
|
|
207
|
+
const n = { kind: "text", text: r };
|
|
208
|
+
switch (o.cellType) {
|
|
208
209
|
case "text":
|
|
209
|
-
return
|
|
210
|
+
return n;
|
|
210
211
|
case "date": {
|
|
211
|
-
const i = e.wallClock ?
|
|
212
|
-
return i === void 0 ?
|
|
212
|
+
const i = e.wallClock ? Ht(e.wallClock) : void 0;
|
|
213
|
+
return i === void 0 ? n : { kind: "date", text: r, serial: i };
|
|
213
214
|
}
|
|
214
215
|
case "number":
|
|
215
|
-
return Ce(t, r, !0) ??
|
|
216
|
+
return Ce(t, r, !0) ?? n;
|
|
216
217
|
case "boolean":
|
|
217
|
-
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } :
|
|
218
|
+
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : n;
|
|
218
219
|
case "by_value":
|
|
219
|
-
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ??
|
|
220
|
+
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ?? n;
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
|
-
function
|
|
223
|
+
function fo(e) {
|
|
223
224
|
return e.kind === "empty" ? "" : e.text;
|
|
224
225
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
return e >
|
|
226
|
+
const Ve = 1e4, Xt = 1e6, go = 5e6, po = 1024 ** 3, yo = 1024 ** 3;
|
|
227
|
+
function ho(e) {
|
|
228
|
+
return e > Ve;
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
+
function bo(e) {
|
|
231
|
+
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Ve ? "direct" : e.loadedRowCount <= Xt ? "background" : "blocked";
|
|
232
|
+
}
|
|
233
|
+
const wo = {
|
|
230
234
|
rowLabels: "tabular",
|
|
231
235
|
subtotals: "after"
|
|
232
236
|
};
|
|
233
|
-
function
|
|
234
|
-
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 },
|
|
237
|
+
function vo(e, t) {
|
|
238
|
+
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
|
|
235
239
|
return {
|
|
236
240
|
...e,
|
|
237
241
|
layout: r,
|
|
238
242
|
totals: {
|
|
239
243
|
...e.totals,
|
|
240
244
|
rows: {
|
|
241
|
-
...
|
|
245
|
+
...o,
|
|
242
246
|
levels: Object.fromEntries(
|
|
243
|
-
Object.entries(
|
|
244
|
-
|
|
247
|
+
Object.entries(o.levels).map(([n, i]) => [
|
|
248
|
+
n,
|
|
245
249
|
{ ...i, position: t.subtotals }
|
|
246
250
|
])
|
|
247
251
|
)
|
|
@@ -249,29 +253,29 @@ function bn(e, t) {
|
|
|
249
253
|
}
|
|
250
254
|
};
|
|
251
255
|
}
|
|
252
|
-
const
|
|
253
|
-
function
|
|
256
|
+
const Wt = 2;
|
|
257
|
+
function Yt(e) {
|
|
254
258
|
return typeof e == "number" ? Number.isInteger(e) : U(e) ? !e.value.includes(".") : !0;
|
|
255
259
|
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
258
|
-
(a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 &&
|
|
260
|
+
function Zt(e, t, r) {
|
|
261
|
+
const o = e.descriptors.measures.filter(
|
|
262
|
+
(a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 && ht(a.column.dataType) === "number"
|
|
259
263
|
);
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
264
|
+
if (o.length === 0) return r;
|
|
265
|
+
const n = /* @__PURE__ */ new Set();
|
|
262
266
|
e.columns.forEach((a, l) => {
|
|
263
|
-
if (!(a.kind !== "measure" ||
|
|
267
|
+
if (!(a.kind !== "measure" || n.has(a.measureId)))
|
|
264
268
|
for (const m of t) {
|
|
265
269
|
const u = m.values[l];
|
|
266
|
-
if ((u == null ? void 0 : u.kind) === "value" && !
|
|
267
|
-
|
|
270
|
+
if ((u == null ? void 0 : u.kind) === "value" && !Yt(u.value)) {
|
|
271
|
+
n.add(a.measureId);
|
|
268
272
|
return;
|
|
269
273
|
}
|
|
270
274
|
}
|
|
271
275
|
});
|
|
272
276
|
const i = { ...r.measureFormats };
|
|
273
|
-
for (const { id: a } of
|
|
274
|
-
const l =
|
|
277
|
+
for (const { id: a } of o) {
|
|
278
|
+
const l = n.has(a) ? Wt : 0;
|
|
275
279
|
i[a] = {
|
|
276
280
|
type: "number",
|
|
277
281
|
minimumFractionDigits: l,
|
|
@@ -284,21 +288,21 @@ function Yt(e, t, r) {
|
|
|
284
288
|
function G(e) {
|
|
285
289
|
return X(e.slice(0, -1));
|
|
286
290
|
}
|
|
287
|
-
function
|
|
291
|
+
function qt(e, t) {
|
|
288
292
|
return t.length > e.length && X(t.slice(0, e.length)) === X(e);
|
|
289
293
|
}
|
|
290
|
-
function
|
|
294
|
+
function Jt(e) {
|
|
291
295
|
return e.map((t, r) => {
|
|
292
296
|
if (r === 0 || t.kind !== "layout") return !1;
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
if (t.role !== "member" ||
|
|
296
|
-
const
|
|
297
|
-
return
|
|
297
|
+
const o = e[r - 1];
|
|
298
|
+
if (o.kind !== "layout") return !1;
|
|
299
|
+
if (t.role !== "member" || qt(o.rowPath, t.rowPath)) return !0;
|
|
300
|
+
const n = e[r - 2];
|
|
301
|
+
return o.role === "member" && (!n || n.kind !== "layout" || n.role !== "member" || G(n.rowPath) !== G(o.rowPath)) && t.rowPath.length === o.rowPath.length && G(t.rowPath) === G(o.rowPath);
|
|
298
302
|
});
|
|
299
303
|
}
|
|
300
|
-
const
|
|
301
|
-
function
|
|
304
|
+
const Qt = "pdf-group-continuation";
|
|
305
|
+
function er(e) {
|
|
302
306
|
if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
|
|
303
307
|
return !0;
|
|
304
308
|
for (let t = 0; t <= e.levelIndex; t++)
|
|
@@ -306,21 +310,21 @@ function Qt(e) {
|
|
|
306
310
|
return !0;
|
|
307
311
|
return !1;
|
|
308
312
|
}
|
|
309
|
-
function
|
|
313
|
+
function Ue(e, t, r) {
|
|
310
314
|
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || U(t.value)) ? e : Z(e);
|
|
311
315
|
}
|
|
312
|
-
function
|
|
313
|
-
const
|
|
316
|
+
function tr(e, t, r) {
|
|
317
|
+
const o = _e(e.descriptors, t.presentation, r), n = e.columns.map((d) => {
|
|
314
318
|
var s;
|
|
315
|
-
return d.kind === "measure" && ((s =
|
|
316
|
-
}), i = (d) => te([d],
|
|
319
|
+
return d.kind === "measure" && ((s = o.measureSemantics.get(d.measureId)) == null ? void 0 : s.isNumeric) === !0;
|
|
320
|
+
}), i = (d) => te([d], o.levels), a = (d, s, f) => De(d, s, t.presentation.totals[f], o.levels), l = e.columns.map((d) => {
|
|
317
321
|
if (d.kind !== "measure") return d.label;
|
|
318
322
|
const s = d.columnPath.map(i);
|
|
319
323
|
return d.role !== "member" && s.push(a(d.columnPath, d.role, "columns")), [...s, d.label].join(" / ");
|
|
320
324
|
}), m = Math.min(t.spec.columns.length, Math.max(
|
|
321
325
|
0,
|
|
322
326
|
...e.columns.map((d) => d.kind === "measure" ? d.columnPath.length + (d.role !== "member" ? 1 : 0) : 0)
|
|
323
|
-
)), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) =>
|
|
327
|
+
)), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) => dt({
|
|
324
328
|
path: d.rowPath,
|
|
325
329
|
role: d.kind === "layout" ? d.role : "member",
|
|
326
330
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -335,23 +339,23 @@ function er(e, t, r) {
|
|
|
335
339
|
return `${" ".repeat(Math.max(0, d.rowPath.length - 1))}${a(d.rowPath, d.role, "rows")}`;
|
|
336
340
|
if (b.kind === "level") {
|
|
337
341
|
const C = t.spec.rows.findIndex((F) => F.id === b.levelId), x = f[C];
|
|
338
|
-
return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path,
|
|
342
|
+
return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path, o.levels) : "";
|
|
339
343
|
}
|
|
340
|
-
const S = d.values[y], w =
|
|
344
|
+
const S = d.values[y], w = o.measures.get(b.measureId);
|
|
341
345
|
if (S.kind === "value" && !w)
|
|
342
346
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
343
347
|
return Re(S, w, t.presentation.absence);
|
|
344
348
|
});
|
|
345
349
|
}, v = (d, s) => p(d, s).map((f, b) => {
|
|
346
350
|
const y = e.columns[b];
|
|
347
|
-
return y.kind === "measure" ?
|
|
351
|
+
return y.kind === "measure" ? Ue(f, d.values[b], o.measureSemantics.get(y.measureId)) : Z(f);
|
|
348
352
|
});
|
|
349
353
|
return {
|
|
350
354
|
headers: l,
|
|
351
355
|
headerBands: u,
|
|
352
|
-
numericColumns:
|
|
356
|
+
numericColumns: n,
|
|
353
357
|
/** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
|
|
354
|
-
formatting:
|
|
358
|
+
formatting: o,
|
|
355
359
|
/** A row's cells; after `previous`, a tabular layout prints each label once. */
|
|
356
360
|
row: (d, s) => p(d, s),
|
|
357
361
|
/**
|
|
@@ -382,37 +386,37 @@ function er(e, t, r) {
|
|
|
382
386
|
csvRows: (d, s) => d.map((f, b) => v(f, b ? d[b - 1] : s ?? void 0))
|
|
383
387
|
};
|
|
384
388
|
}
|
|
385
|
-
function
|
|
389
|
+
function To(e) {
|
|
386
390
|
return e.columns.map((t) => Z(t.label));
|
|
387
391
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
390
|
-
const i = t.columns[
|
|
391
|
-
return i.kind === "measure" ?
|
|
392
|
+
function Co(e, t, r) {
|
|
393
|
+
return rr(e, t, r).map((o, n) => {
|
|
394
|
+
const i = t.columns[n];
|
|
395
|
+
return i.kind === "measure" ? Ue(o, e.values[n], r.measureSemantics.get(i.measureId)) : Z(o);
|
|
392
396
|
});
|
|
393
397
|
}
|
|
394
|
-
function
|
|
398
|
+
function rr(e, t, r) {
|
|
395
399
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
396
400
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
397
|
-
const
|
|
398
|
-
return t.columns.map((
|
|
399
|
-
if (
|
|
400
|
-
const l = e.values[i], m = r.measures.get(
|
|
401
|
+
const o = [...e.rowPath, ...e.columnPath];
|
|
402
|
+
return t.columns.map((n, i) => {
|
|
403
|
+
if (n.kind === "measure") {
|
|
404
|
+
const l = e.values[i], m = r.measures.get(n.measureId);
|
|
401
405
|
if (l.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
|
|
402
406
|
return Re(l, m, r.absence);
|
|
403
407
|
}
|
|
404
|
-
const a =
|
|
408
|
+
const a = n.kind === "level" ? o.find((l) => l.levelId === n.levelId) : void 0;
|
|
405
409
|
if (!a) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
406
410
|
return te([a], r.levels);
|
|
407
411
|
});
|
|
408
412
|
}
|
|
409
|
-
function
|
|
410
|
-
const t =
|
|
413
|
+
function or(e) {
|
|
414
|
+
const t = tr(e.layout, e.request, e.report), r = e.layout.columns.map((a, l) => ({
|
|
411
415
|
index: l,
|
|
412
416
|
columnId: `matrix:${l}`,
|
|
413
417
|
label: t.headers[l],
|
|
414
418
|
isNumeric: t.numericColumns[l]
|
|
415
|
-
})),
|
|
419
|
+
})), o = (a, l, m) => ({
|
|
416
420
|
text: a,
|
|
417
421
|
colspan: 1,
|
|
418
422
|
rowspan: 1,
|
|
@@ -420,15 +424,15 @@ function rr(e) {
|
|
|
420
424
|
isHeader: m,
|
|
421
425
|
isNumeric: r[l].isNumeric,
|
|
422
426
|
className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
423
|
-
}),
|
|
424
|
-
e.request.spec.columns.length && i >= 0 &&
|
|
427
|
+
}), n = [], i = e.layout.columns.findIndex((a) => a.kind === "measure");
|
|
428
|
+
e.request.spec.columns.length && i >= 0 && n.push({
|
|
425
429
|
repeatHeader: !0,
|
|
426
430
|
headerType: "pivot-axis",
|
|
427
431
|
headerRowIndex: 0,
|
|
428
432
|
cells: [
|
|
429
|
-
...i ? [{ ...
|
|
433
|
+
...i ? [{ ...o("", 0, !0), colspan: i }] : [],
|
|
430
434
|
{
|
|
431
|
-
...
|
|
435
|
+
...o(e.request.spec.columns.map((a) => Pe(a, e.request.presentation)).join(" / "), i, !0),
|
|
432
436
|
colspan: e.layout.columns.length - i,
|
|
433
437
|
isNumeric: !1,
|
|
434
438
|
className: ""
|
|
@@ -436,14 +440,14 @@ function rr(e) {
|
|
|
436
440
|
]
|
|
437
441
|
});
|
|
438
442
|
for (const [a, l] of t.headerBands.entries())
|
|
439
|
-
|
|
443
|
+
n.push({
|
|
440
444
|
repeatHeader: !0,
|
|
441
445
|
headerType: a === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
442
|
-
headerRowIndex:
|
|
443
|
-
cells: l.map((m, u) =>
|
|
446
|
+
headerRowIndex: n.length,
|
|
447
|
+
cells: l.map((m, u) => o(m, u, !0))
|
|
444
448
|
});
|
|
445
449
|
return {
|
|
446
|
-
headers:
|
|
450
|
+
headers: n,
|
|
447
451
|
rows: e.rows.map((a, l) => {
|
|
448
452
|
const m = new Set(t.continuedColumns(a, e.rows[l - 1]));
|
|
449
453
|
return {
|
|
@@ -452,7 +456,7 @@ function rr(e) {
|
|
|
452
456
|
subtotalLevel: String(a.rowPath.length),
|
|
453
457
|
// A tabular layout prints each label once unless it repeats them; the
|
|
454
458
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
455
|
-
cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...
|
|
459
|
+
cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...o(u, g, !1), className: Qt } : o(u, g, !1))
|
|
456
460
|
};
|
|
457
461
|
}),
|
|
458
462
|
grandTotal: null,
|
|
@@ -470,11 +474,11 @@ function rr(e) {
|
|
|
470
474
|
};
|
|
471
475
|
}
|
|
472
476
|
function nr(e, t, r) {
|
|
473
|
-
const { levels:
|
|
477
|
+
const { levels: o } = _e(e.descriptors, t.presentation, r), n = t.spec.columns.length > 0, i = [], a = [], l = e.columns.map((u, g) => {
|
|
474
478
|
if (u.kind !== "measure") return null;
|
|
475
|
-
const p =
|
|
479
|
+
const p = n ? `${u.role}:${X(u.columnPath)}` : `measure:${g}`;
|
|
476
480
|
let v = i.indexOf(p);
|
|
477
|
-
return v < 0 && (v = i.push(p) - 1, a.push(
|
|
481
|
+
return v < 0 && (v = i.push(p) - 1, a.push(n ? De(u.columnPath, u.role, t.presentation.totals.columns, o) : u.label)), v;
|
|
478
482
|
}), m = t.spec.columns[t.spec.columns.length - 1];
|
|
479
483
|
return {
|
|
480
484
|
columnGroups: l,
|
|
@@ -483,18 +487,18 @@ function nr(e, t, r) {
|
|
|
483
487
|
groupLevelLabel: m ? Pe(m, t.presentation) : "Measures"
|
|
484
488
|
};
|
|
485
489
|
}
|
|
486
|
-
function
|
|
487
|
-
const { layout: t, rows: r, report:
|
|
490
|
+
function xo(e) {
|
|
491
|
+
const { layout: t, rows: r, report: o } = e, n = {
|
|
488
492
|
...e.request,
|
|
489
|
-
presentation:
|
|
490
|
-
}, i =
|
|
493
|
+
presentation: Zt(t, r, e.request.presentation)
|
|
494
|
+
}, i = or({ layout: t, rows: r, request: n, report: o }), a = Jt(r), l = nr(t, n, o), m = {
|
|
491
495
|
...i,
|
|
492
496
|
rows: i.rows.map((u, g) => ({ ...u, keepWithPrevious: a[g] })),
|
|
493
497
|
metadata: { ...i.metadata, ...l }
|
|
494
498
|
};
|
|
495
|
-
return { request:
|
|
499
|
+
return { request: n, table: m, ...l };
|
|
496
500
|
}
|
|
497
|
-
class
|
|
501
|
+
class ar extends Error {
|
|
498
502
|
constructor() {
|
|
499
503
|
super(...arguments);
|
|
500
504
|
fe(this, "code", Ne);
|
|
@@ -503,37 +507,37 @@ class or extends Error {
|
|
|
503
507
|
function xe(e) {
|
|
504
508
|
if (!e || typeof e != "object")
|
|
505
509
|
return;
|
|
506
|
-
const { error: t, message: r, detail:
|
|
507
|
-
for (const
|
|
508
|
-
if (typeof
|
|
509
|
-
return
|
|
510
|
+
const { error: t, message: r, detail: o } = e;
|
|
511
|
+
for (const n of [t, r, o])
|
|
512
|
+
if (typeof n == "string" && n.trim())
|
|
513
|
+
return n.trim();
|
|
510
514
|
}
|
|
511
|
-
async function
|
|
515
|
+
async function sr(e) {
|
|
512
516
|
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
513
517
|
try {
|
|
514
518
|
if (r.includes("application/json")) {
|
|
515
|
-
const
|
|
516
|
-
return { message: xe(
|
|
519
|
+
const n = await e.json(), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
|
|
520
|
+
return { message: xe(n) || t, code: i };
|
|
517
521
|
}
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
522
|
+
const o = await e.text();
|
|
523
|
+
if (!o.trim())
|
|
520
524
|
return { message: t };
|
|
521
525
|
try {
|
|
522
|
-
const
|
|
526
|
+
const n = JSON.parse(o), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
|
|
523
527
|
return {
|
|
524
|
-
message: xe(
|
|
528
|
+
message: xe(n) || o.trim(),
|
|
525
529
|
code: i
|
|
526
530
|
};
|
|
527
531
|
} catch {
|
|
528
|
-
return { message:
|
|
532
|
+
return { message: o.trim() };
|
|
529
533
|
}
|
|
530
534
|
} catch {
|
|
531
535
|
return { message: t };
|
|
532
536
|
}
|
|
533
537
|
}
|
|
534
|
-
async function
|
|
538
|
+
async function So(e) {
|
|
535
539
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
536
|
-
if (
|
|
540
|
+
if (Et(e.serializedPayload) > kt.maxRequestBytes)
|
|
537
541
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
538
542
|
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
539
543
|
method: "POST",
|
|
@@ -542,8 +546,8 @@ async function Cn(e) {
|
|
|
542
546
|
signal: e.signal
|
|
543
547
|
});
|
|
544
548
|
if (!t.ok) {
|
|
545
|
-
const
|
|
546
|
-
throw
|
|
549
|
+
const o = await sr(t);
|
|
550
|
+
throw o.code === Ne ? new ar(o.message) : new Error(o.message);
|
|
547
551
|
}
|
|
548
552
|
const r = await t.json();
|
|
549
553
|
if (r != null && r.error) throw new Error(r.error);
|
|
@@ -551,36 +555,36 @@ async function Cn(e) {
|
|
|
551
555
|
throw new Error("Fast-path PDF response missing download URL");
|
|
552
556
|
return r;
|
|
553
557
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
556
|
-
if (!
|
|
558
|
+
const ir = /* @__PURE__ */ new Set(["short", "medium", "long"]), lr = /^(\d{4})-(\d{2})-(\d{2})$/, cr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ur = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, se = " – ";
|
|
559
|
+
function Eo(e) {
|
|
560
|
+
if (!ot(e)) return;
|
|
557
561
|
const t = Object.keys(e);
|
|
558
562
|
if (e.mode === "period_label" && t.length === 1)
|
|
559
563
|
return { mode: "period_label" };
|
|
560
|
-
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" &&
|
|
564
|
+
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ir.has(e.dateStyle))
|
|
561
565
|
return { mode: "style", dateStyle: e.dateStyle };
|
|
562
|
-
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" &&
|
|
566
|
+
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && mr(e.pattern) === null)
|
|
563
567
|
return {
|
|
564
568
|
mode: "pattern",
|
|
565
569
|
dialect: "semaphor_tokens",
|
|
566
570
|
pattern: e.pattern
|
|
567
571
|
};
|
|
568
572
|
}
|
|
569
|
-
function
|
|
573
|
+
function mr(e) {
|
|
570
574
|
try {
|
|
571
|
-
return
|
|
575
|
+
return st({ dialect: "semaphor_tokens", pattern: e }), null;
|
|
572
576
|
} catch (t) {
|
|
573
577
|
return t instanceof Error ? t.message : "The pattern is invalid.";
|
|
574
578
|
}
|
|
575
579
|
}
|
|
576
|
-
function
|
|
577
|
-
const { value: t, part: r, presentation:
|
|
578
|
-
if ((
|
|
580
|
+
function ko(e) {
|
|
581
|
+
const { value: t, part: r, presentation: o, preferences: n, calendar: i } = e;
|
|
582
|
+
if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && r === "range")
|
|
579
583
|
return { ok: !0, text: t.periodLabel };
|
|
580
584
|
const [a, l] = t.bounds, u = l === void 0 || r === "start" ? [{ raw: a, role: "start" }] : r === "end" ? [{ raw: l, role: "end" }] : [
|
|
581
585
|
{ raw: a, role: "start" },
|
|
582
586
|
{ raw: l, role: "end" }
|
|
583
|
-
], g = u.map(({ raw: s }) =>
|
|
587
|
+
], g = u.map(({ raw: s }) => pr(s, i.tz));
|
|
584
588
|
if (g.some((s) => s === null))
|
|
585
589
|
return {
|
|
586
590
|
ok: !1,
|
|
@@ -591,39 +595,39 @@ function Sn(e) {
|
|
|
591
595
|
}
|
|
592
596
|
};
|
|
593
597
|
const p = t.precision === "day" ? g.map(
|
|
594
|
-
(s, f) =>
|
|
598
|
+
(s, f) => hr(s, u[f].role, i.tz)
|
|
595
599
|
) : [], v = p.length > 0 && p.every((s) => s !== null) ? p : null;
|
|
596
|
-
return { ok: !0, text: v ?
|
|
597
|
-
g.map((s) =>
|
|
598
|
-
n,
|
|
600
|
+
return { ok: !0, text: v ? dr(v, o, n, i) : fr(
|
|
601
|
+
g.map((s) => yr(s, i.tz)),
|
|
599
602
|
o,
|
|
603
|
+
n,
|
|
600
604
|
i
|
|
601
605
|
) };
|
|
602
606
|
}
|
|
603
|
-
function
|
|
604
|
-
const [
|
|
607
|
+
function dr(e, t, r, o) {
|
|
608
|
+
const [n, i = n] = e;
|
|
605
609
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
606
|
-
return
|
|
610
|
+
return ze(
|
|
607
611
|
e.map(
|
|
608
|
-
(m) =>
|
|
612
|
+
(m) => Be(re(m), "date", t.pattern, r, o)
|
|
609
613
|
)
|
|
610
614
|
);
|
|
611
615
|
const a = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateStyle;
|
|
612
616
|
if (!t || t.mode === "period_label") {
|
|
613
|
-
const m =
|
|
617
|
+
const m = br(n, i, o);
|
|
614
618
|
if (m)
|
|
615
619
|
return Ie({
|
|
616
|
-
value: re(
|
|
620
|
+
value: re(n),
|
|
617
621
|
metadata: {
|
|
618
622
|
kind: "temporal_bucket",
|
|
619
623
|
granularity: m,
|
|
620
|
-
calendar: { tz:
|
|
624
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
621
625
|
},
|
|
622
626
|
format: $e({
|
|
623
627
|
metadata: {
|
|
624
628
|
kind: "temporal_bucket",
|
|
625
629
|
granularity: m,
|
|
626
|
-
calendar: { tz:
|
|
630
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
627
631
|
},
|
|
628
632
|
locale: r.locale,
|
|
629
633
|
styles: { dateStyle: a, dateTime: { ...r.dateTime } }
|
|
@@ -635,34 +639,34 @@ function mr(e, t, r, n) {
|
|
|
635
639
|
timeZone: "UTC",
|
|
636
640
|
dateStyle: a
|
|
637
641
|
});
|
|
638
|
-
return
|
|
642
|
+
return vr(n, i) ? l.format(H(n)) : Ke(l, H(n), H(i));
|
|
639
643
|
}
|
|
640
|
-
function
|
|
644
|
+
function fr(e, t, r, o) {
|
|
641
645
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
642
|
-
return
|
|
646
|
+
return ze(
|
|
643
647
|
e.map(
|
|
644
|
-
(l) =>
|
|
648
|
+
(l) => Be(
|
|
645
649
|
l.toISOString(),
|
|
646
650
|
"instant",
|
|
647
651
|
t.pattern,
|
|
648
652
|
r,
|
|
649
|
-
|
|
653
|
+
o
|
|
650
654
|
)
|
|
651
655
|
)
|
|
652
656
|
);
|
|
653
|
-
const
|
|
657
|
+
const n = new Intl.DateTimeFormat(r.locale, {
|
|
654
658
|
calendar: "gregory",
|
|
655
|
-
timeZone:
|
|
659
|
+
timeZone: o.tz,
|
|
656
660
|
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateTime.dateStyle,
|
|
657
661
|
timeStyle: r.dateTime.timeStyle
|
|
658
662
|
}), [i, a] = e;
|
|
659
|
-
return a && a.getTime() !== i.getTime() ?
|
|
663
|
+
return a && a.getTime() !== i.getTime() ? Ke(n, i, a) : n.format(i);
|
|
660
664
|
}
|
|
661
|
-
function
|
|
662
|
-
const
|
|
663
|
-
return typeof
|
|
665
|
+
function Ke(e, t, r) {
|
|
666
|
+
const o = e;
|
|
667
|
+
return typeof o.formatRange == "function" ? o.formatRange(t, r) : `${e.format(t)}${se}${e.format(r)}`;
|
|
664
668
|
}
|
|
665
|
-
function
|
|
669
|
+
function Be(e, t, r, o, n) {
|
|
666
670
|
const i = nt({
|
|
667
671
|
format: {
|
|
668
672
|
type: "raw_temporal",
|
|
@@ -670,48 +674,48 @@ function Ke(e, t, r, n, o) {
|
|
|
670
674
|
},
|
|
671
675
|
// Temporal formatting reads no currency.
|
|
672
676
|
preferences: {
|
|
673
|
-
...
|
|
674
|
-
defaultCurrency:
|
|
677
|
+
...o,
|
|
678
|
+
defaultCurrency: At.defaultCurrency
|
|
675
679
|
},
|
|
676
|
-
calendar: { tz:
|
|
677
|
-
}), a = t === "date" &&
|
|
678
|
-
return
|
|
679
|
-
value: a === t ? e :
|
|
680
|
+
calendar: { tz: n.tz }
|
|
681
|
+
}), a = t === "date" && gr(r) ? "instant" : t;
|
|
682
|
+
return at({
|
|
683
|
+
value: a === t ? e : ne(`${e}T00:00:00`, n.tz).toISOString(),
|
|
680
684
|
metadata: { kind: "raw_temporal", valueKind: a },
|
|
681
685
|
format: i
|
|
682
686
|
}).text;
|
|
683
687
|
}
|
|
684
|
-
function
|
|
688
|
+
function gr(e) {
|
|
685
689
|
return /HH|mm|ss/.test(e);
|
|
686
690
|
}
|
|
687
|
-
function
|
|
691
|
+
function ze(e) {
|
|
688
692
|
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(se);
|
|
689
693
|
}
|
|
690
|
-
function
|
|
691
|
-
const r =
|
|
694
|
+
function pr(e, t) {
|
|
695
|
+
const r = lr.exec(e);
|
|
692
696
|
if (r) {
|
|
693
|
-
const
|
|
697
|
+
const n = {
|
|
694
698
|
year: Number(r[1]),
|
|
695
699
|
month: Number(r[2]),
|
|
696
700
|
day: Number(r[3])
|
|
697
701
|
};
|
|
698
|
-
return
|
|
702
|
+
return Tr(n) ? { kind: "date", date: n } : null;
|
|
699
703
|
}
|
|
700
|
-
const
|
|
701
|
-
return
|
|
704
|
+
const o = ur.test(e) ? new Date(e.replace(" ", "T")) : cr.test(e) ? ne(e.replace(" ", "T"), t) : null;
|
|
705
|
+
return o && !Number.isNaN(o.getTime()) ? { kind: "instant", instant: o } : null;
|
|
702
706
|
}
|
|
703
|
-
function
|
|
704
|
-
return e.kind === "instant" ? e.instant :
|
|
707
|
+
function yr(e, t) {
|
|
708
|
+
return e.kind === "instant" ? e.instant : ne(`${re(e.date)}T00:00:00`, t);
|
|
705
709
|
}
|
|
706
|
-
function
|
|
710
|
+
function hr(e, t, r) {
|
|
707
711
|
if (e.kind === "date") return e.date;
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
710
|
-
const a =
|
|
711
|
-
return t === "end" && a ?
|
|
712
|
+
const o = Lt(e.instant, r), n = { year: o.year, month: o.month, day: o.day };
|
|
713
|
+
if (o.hour === 0 && o.minute === 0 && o.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? n : wr(n, -1);
|
|
714
|
+
const a = o.hour === 23 && o.minute === 59 && o.second === 59;
|
|
715
|
+
return t === "end" && a ? n : null;
|
|
712
716
|
}
|
|
713
|
-
function
|
|
714
|
-
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !==
|
|
717
|
+
function br(e, t, r) {
|
|
718
|
+
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== je(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
|
|
715
719
|
}
|
|
716
720
|
function re(e) {
|
|
717
721
|
return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
|
|
@@ -720,7 +724,7 @@ function H(e) {
|
|
|
720
724
|
const t = /* @__PURE__ */ new Date(0);
|
|
721
725
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
|
|
722
726
|
}
|
|
723
|
-
function
|
|
727
|
+
function wr(e, t) {
|
|
724
728
|
const r = H(e);
|
|
725
729
|
return r.setUTCDate(r.getUTCDate() + t), {
|
|
726
730
|
year: r.getUTCFullYear(),
|
|
@@ -728,87 +732,87 @@ function br(e, t) {
|
|
|
728
732
|
day: r.getUTCDate()
|
|
729
733
|
};
|
|
730
734
|
}
|
|
731
|
-
function
|
|
735
|
+
function vr(e, t) {
|
|
732
736
|
return e.year === t.year && e.month === t.month && e.day === t.day;
|
|
733
737
|
}
|
|
734
|
-
function
|
|
738
|
+
function je(e, t) {
|
|
735
739
|
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
736
740
|
}
|
|
737
|
-
function
|
|
738
|
-
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
741
|
+
function Tr(e) {
|
|
742
|
+
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= je(e.year, e.month);
|
|
739
743
|
}
|
|
740
|
-
const
|
|
744
|
+
const Cr = "__TOTAL__";
|
|
741
745
|
function W(e) {
|
|
742
746
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
743
747
|
}
|
|
744
|
-
function
|
|
745
|
-
return e ===
|
|
748
|
+
function oe(e) {
|
|
749
|
+
return e === Cr;
|
|
746
750
|
}
|
|
747
|
-
function
|
|
748
|
-
const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((
|
|
751
|
+
function xr(e) {
|
|
752
|
+
const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((n, i) => {
|
|
749
753
|
var u, g, p;
|
|
750
|
-
if (!W(
|
|
754
|
+
if (!W(n))
|
|
751
755
|
throw new Error(`Aggregate groupByColumns[${i}] is invalid`);
|
|
752
|
-
const a = typeof
|
|
756
|
+
const a = typeof n.id == "string" && n.id.length > 0 ? n.id : void 0, l = a ? (p = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : p[a] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof n.alias == "string" && n.alias.length > 0 ? n.alias : typeof n.name == "string" && n.name.length > 0 ? n.name : void 0);
|
|
753
757
|
if (!m)
|
|
754
758
|
throw new Error(`Aggregate groupByColumns[${i}] has no output key`);
|
|
755
|
-
return [a,
|
|
759
|
+
return [a, n.alias, n.name, m].forEach((v) => {
|
|
756
760
|
typeof v == "string" && v.length > 0 && t.set(v, m);
|
|
757
761
|
}), m;
|
|
758
|
-
}),
|
|
762
|
+
}), o = (e.rowAggregates ?? []).flatMap((n) => !W(n) || typeof n.function != "string" || typeof n.groupLevel != "string" ? [] : [
|
|
759
763
|
{
|
|
760
|
-
function:
|
|
761
|
-
groupLevel:
|
|
762
|
-
...typeof
|
|
764
|
+
function: n.function,
|
|
765
|
+
groupLevel: n.groupLevel === "ALL" ? "ALL" : t.get(n.groupLevel) || n.groupLevel,
|
|
766
|
+
...typeof n.label == "string" ? { label: n.label } : {}
|
|
763
767
|
}
|
|
764
768
|
]);
|
|
765
|
-
return { groupColumnKeys: r, rowAggregates:
|
|
769
|
+
return { groupColumnKeys: r, rowAggregates: o };
|
|
766
770
|
}
|
|
767
|
-
function
|
|
771
|
+
function Ge(e) {
|
|
768
772
|
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
769
773
|
}
|
|
770
|
-
function
|
|
774
|
+
function Sr(e) {
|
|
771
775
|
var r;
|
|
772
776
|
if (e.customLabel) return e.customLabel;
|
|
773
|
-
const t =
|
|
774
|
-
if (e.levelValue !== void 0 && !
|
|
777
|
+
const t = Ge(e.aggregateFunction);
|
|
778
|
+
if (e.levelValue !== void 0 && !oe(e.levelValue)) {
|
|
775
779
|
if (e.levelValue === null) {
|
|
776
|
-
const
|
|
777
|
-
return
|
|
780
|
+
const n = (r = e.formatValue) == null ? void 0 : r.call(e, null);
|
|
781
|
+
return n ? `Subtotal ${n}` : `Subtotal ${t}`;
|
|
778
782
|
}
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
783
|
+
const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
|
|
784
|
+
if (o) return `Subtotal (${o})`;
|
|
781
785
|
}
|
|
782
786
|
return `Subtotal ${t}`;
|
|
783
787
|
}
|
|
784
|
-
function
|
|
785
|
-
return t || `Grand ${
|
|
788
|
+
function Er(e, t) {
|
|
789
|
+
return t || `Grand ${Ge(e)}`;
|
|
786
790
|
}
|
|
787
|
-
function
|
|
791
|
+
function Ao(e) {
|
|
788
792
|
const t = e.context.groupColumnKeys.indexOf(e.columnKey);
|
|
789
793
|
if (t < 0)
|
|
790
794
|
throw new Error(
|
|
791
795
|
`Aggregate group column "${e.columnKey}" is unknown`
|
|
792
796
|
);
|
|
793
|
-
return
|
|
797
|
+
return er({
|
|
794
798
|
row: e.row,
|
|
795
799
|
previousRow: e.previousRow,
|
|
796
800
|
levelIndex: t,
|
|
797
|
-
getValue: (r,
|
|
801
|
+
getValue: (r, o) => r[e.context.groupColumnKeys[o]]
|
|
798
802
|
});
|
|
799
803
|
}
|
|
800
|
-
function
|
|
801
|
-
var
|
|
804
|
+
function He(e) {
|
|
805
|
+
var o, n;
|
|
802
806
|
const t = e.context.groupColumnKeys, r = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
803
807
|
if (e.row.isGrandTotal === !0) {
|
|
804
|
-
const i = (
|
|
808
|
+
const i = (o = e.context.rowAggregates.find(
|
|
805
809
|
(a) => a.groupLevel === "ALL"
|
|
806
|
-
)) == null ? void 0 :
|
|
810
|
+
)) == null ? void 0 : o.label;
|
|
807
811
|
return {
|
|
808
812
|
kind: "grand-total",
|
|
809
813
|
cells: t.map((a, l) => ({
|
|
810
814
|
columnKey: a,
|
|
811
|
-
text: l === 0 ?
|
|
815
|
+
text: l === 0 ? Er(r, i) : "",
|
|
812
816
|
placement: l === 0 ? "label" : "empty",
|
|
813
817
|
colSpan: l === 0 ? t.length : 1
|
|
814
818
|
}))
|
|
@@ -822,9 +826,9 @@ function Ge(e) {
|
|
|
822
826
|
throw new Error(
|
|
823
827
|
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
824
828
|
);
|
|
825
|
-
const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (
|
|
829
|
+
const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (n = e.context.rowAggregates.find(
|
|
826
830
|
(u) => u.groupLevel === e.row.subtotalLevel && u.function === r
|
|
827
|
-
)) == null ? void 0 :
|
|
831
|
+
)) == null ? void 0 : n.label;
|
|
828
832
|
return {
|
|
829
833
|
kind: "subtotal",
|
|
830
834
|
cells: t.map((u, g) => {
|
|
@@ -839,14 +843,14 @@ function Ge(e) {
|
|
|
839
843
|
const p = e.row[u];
|
|
840
844
|
return {
|
|
841
845
|
columnKey: u,
|
|
842
|
-
text: p === void 0 ||
|
|
846
|
+
text: p === void 0 || oe(p) ? "" : e.formatValue(p, u),
|
|
843
847
|
placement: "value",
|
|
844
848
|
colSpan: 1
|
|
845
849
|
};
|
|
846
850
|
}
|
|
847
851
|
return {
|
|
848
852
|
columnKey: u,
|
|
849
|
-
text:
|
|
853
|
+
text: Sr({
|
|
850
854
|
aggregateFunction: r,
|
|
851
855
|
customLabel: m,
|
|
852
856
|
levelValue: l[u],
|
|
@@ -864,128 +868,128 @@ function Ge(e) {
|
|
|
864
868
|
const a = e.row[i];
|
|
865
869
|
return {
|
|
866
870
|
columnKey: i,
|
|
867
|
-
text: a === void 0 ||
|
|
871
|
+
text: a === void 0 || oe(a) ? "" : e.formatValue(a, i),
|
|
868
872
|
placement: "value",
|
|
869
873
|
colSpan: 1
|
|
870
874
|
};
|
|
871
875
|
})
|
|
872
876
|
};
|
|
873
877
|
}
|
|
874
|
-
function
|
|
875
|
-
const t =
|
|
878
|
+
function Lo(e) {
|
|
879
|
+
const t = He(e).cells.find(
|
|
876
880
|
(r) => r.columnKey === e.columnKey
|
|
877
881
|
);
|
|
878
882
|
if (!t)
|
|
879
883
|
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
880
884
|
return t.text;
|
|
881
885
|
}
|
|
882
|
-
function Er(e) {
|
|
883
|
-
return Ge(e).cells.map((t) => t.text);
|
|
884
|
-
}
|
|
885
886
|
function kr(e) {
|
|
887
|
+
return He(e).cells.map((t) => t.text);
|
|
888
|
+
}
|
|
889
|
+
function Ar(e) {
|
|
886
890
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
887
891
|
}
|
|
888
|
-
function
|
|
892
|
+
function Lr(e, t) {
|
|
889
893
|
if ((e == null ? void 0 : e.cardType) !== "aggregateTable") return;
|
|
890
|
-
const r =
|
|
891
|
-
if (n !== void 0 && !Array.isArray(n))
|
|
892
|
-
throw new Error("Aggregate export groupByColumns is invalid");
|
|
894
|
+
const r = Ar(e.cardConfig) ? e.cardConfig : void 0, o = r == null ? void 0 : r.groupByColumns, n = r == null ? void 0 : r.rowAggregates;
|
|
893
895
|
if (o !== void 0 && !Array.isArray(o))
|
|
896
|
+
throw new Error("Aggregate export groupByColumns is invalid");
|
|
897
|
+
if (n !== void 0 && !Array.isArray(n))
|
|
894
898
|
throw new Error("Aggregate export rowAggregates is invalid");
|
|
895
|
-
return
|
|
896
|
-
groupByColumns:
|
|
897
|
-
rowAggregates:
|
|
899
|
+
return xr({
|
|
900
|
+
groupByColumns: o,
|
|
901
|
+
rowAggregates: n,
|
|
898
902
|
columnKeyMap: t
|
|
899
903
|
});
|
|
900
904
|
}
|
|
901
|
-
function
|
|
905
|
+
function Fr(e) {
|
|
902
906
|
if (!e.aggregateContext || !e.useFormattedValues || e.row.isSubtotal !== !0 && e.row.isGrandTotal !== !0)
|
|
903
907
|
return;
|
|
904
|
-
const t =
|
|
908
|
+
const t = kr({
|
|
905
909
|
row: e.row,
|
|
906
910
|
context: e.aggregateContext,
|
|
907
|
-
formatValue: (r,
|
|
911
|
+
formatValue: (r, o) => e.visibleColumnKeys.has(o) ? e.formatGroupValue(r, o) : ""
|
|
908
912
|
});
|
|
909
913
|
return new Map(
|
|
910
|
-
e.aggregateContext.groupColumnKeys.map((r,
|
|
914
|
+
e.aggregateContext.groupColumnKeys.map((r, o) => [
|
|
911
915
|
r,
|
|
912
|
-
t[
|
|
916
|
+
t[o]
|
|
913
917
|
])
|
|
914
918
|
);
|
|
915
919
|
}
|
|
916
|
-
function
|
|
920
|
+
function Mr(e, t) {
|
|
917
921
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
|
|
918
922
|
}
|
|
919
|
-
function
|
|
923
|
+
function Xe(e) {
|
|
920
924
|
return new Map(
|
|
921
925
|
e.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
922
|
-
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" &&
|
|
926
|
+
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" && Mr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
|
|
923
927
|
)
|
|
924
928
|
);
|
|
925
929
|
}
|
|
926
|
-
function
|
|
930
|
+
function We(e) {
|
|
927
931
|
const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
|
|
928
932
|
return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
|
|
929
933
|
}
|
|
930
|
-
function
|
|
931
|
-
return e.formatting.useFormattedValues !== !1 &&
|
|
934
|
+
function Fo(e) {
|
|
935
|
+
return e.formatting.useFormattedValues !== !1 && We(e.queryPayload) && Xe(e.formatting).size > 0;
|
|
932
936
|
}
|
|
933
|
-
function
|
|
934
|
-
return e.map((r,
|
|
937
|
+
function Ir(e, t) {
|
|
938
|
+
return e.map((r, o) => {
|
|
935
939
|
if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
|
|
936
940
|
throw new Error(
|
|
937
|
-
`missing_raw_temporal_result_contract: Row ${
|
|
941
|
+
`missing_raw_temporal_result_contract: Row ${o} is missing declared temporal column "${t}".`
|
|
938
942
|
);
|
|
939
|
-
const
|
|
940
|
-
return
|
|
943
|
+
const n = r[t];
|
|
944
|
+
return n === null || typeof n == "string" ? n : String(n);
|
|
941
945
|
});
|
|
942
946
|
}
|
|
943
|
-
function
|
|
947
|
+
function $r(e) {
|
|
944
948
|
if (e.formatting.useFormattedValues === !1)
|
|
945
949
|
return {
|
|
946
950
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
947
951
|
byColumnKey: /* @__PURE__ */ new Map()
|
|
948
952
|
};
|
|
949
|
-
const t =
|
|
953
|
+
const t = Xe(e.formatting), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
950
954
|
if (t.size === 0)
|
|
951
|
-
return { activatedColumnKeys: r, byColumnKey:
|
|
952
|
-
const
|
|
955
|
+
return { activatedColumnKeys: r, byColumnKey: o };
|
|
956
|
+
const n = new Map(
|
|
953
957
|
e.columns.flatMap((l) => {
|
|
954
958
|
const m = l.key || l.field;
|
|
955
959
|
return m ? [[m, l]] : [];
|
|
956
960
|
})
|
|
957
|
-
), i =
|
|
961
|
+
), i = We(e.queryPayload), a = /* @__PURE__ */ new Map();
|
|
958
962
|
for (const [l, m] of t) {
|
|
959
|
-
const u =
|
|
963
|
+
const u = n.get(l);
|
|
960
964
|
let g;
|
|
961
965
|
if (u != null && u.rawTemporal)
|
|
962
|
-
g =
|
|
966
|
+
g = $t(u, {
|
|
963
967
|
metadataRequired: !0
|
|
964
968
|
}), r.add(l);
|
|
965
969
|
else if (i) {
|
|
966
970
|
r.add(l);
|
|
967
|
-
const p =
|
|
971
|
+
const p = it({
|
|
968
972
|
columnKey: l,
|
|
969
|
-
values:
|
|
973
|
+
values: Ir(e.records, l)
|
|
970
974
|
});
|
|
971
975
|
a.set(l, p), p.status === "classified" && (g = p.metadata);
|
|
972
976
|
} else
|
|
973
977
|
continue;
|
|
974
|
-
g &&
|
|
978
|
+
g && o.set(l, {
|
|
975
979
|
metadata: g,
|
|
976
980
|
format: m,
|
|
977
|
-
formatValue:
|
|
981
|
+
formatValue: lt({ metadata: g, format: m })
|
|
978
982
|
});
|
|
979
983
|
}
|
|
980
984
|
return {
|
|
981
985
|
activatedColumnKeys: r,
|
|
982
|
-
byColumnKey:
|
|
986
|
+
byColumnKey: o,
|
|
983
987
|
...i ? {
|
|
984
|
-
sqlChunkEvidence:
|
|
988
|
+
sqlChunkEvidence: ct(a)
|
|
985
989
|
} : {}
|
|
986
990
|
};
|
|
987
991
|
}
|
|
988
|
-
function
|
|
992
|
+
function _r(e) {
|
|
989
993
|
if (!e.resolution.activatedColumnKeys.has(e.columnKey))
|
|
990
994
|
return;
|
|
991
995
|
if (e.value === void 0)
|
|
@@ -1004,7 +1008,7 @@ function Se(e, t) {
|
|
|
1004
1008
|
const r = e.byColumnKey.get(t);
|
|
1005
1009
|
return r ? r.metadata.valueKind === "date" : void 0;
|
|
1006
1010
|
}
|
|
1007
|
-
const
|
|
1011
|
+
const Dr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), Rr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, Pr = /^\d{4}-\d{2}-\d{2}$/, Ye = "MM/dd/yyyy";
|
|
1008
1012
|
function Y(e) {
|
|
1009
1013
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1010
1014
|
}
|
|
@@ -1015,40 +1019,40 @@ function Q(e) {
|
|
|
1015
1019
|
return e == null ? "" : typeof e == "string" ? e : U(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
1016
1020
|
}
|
|
1017
1021
|
function Ee(e, t) {
|
|
1018
|
-
var
|
|
1019
|
-
const r = (
|
|
1022
|
+
var o;
|
|
1023
|
+
const r = (o = e.columnSettings) == null ? void 0 : o[t];
|
|
1020
1024
|
if (!(!Y(r) || r.type !== "date"))
|
|
1021
1025
|
return Y(r.dateFormat) ? r.dateFormat : {};
|
|
1022
1026
|
}
|
|
1023
1027
|
function ke(e) {
|
|
1024
|
-
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format ||
|
|
1028
|
+
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Ye;
|
|
1025
1029
|
}
|
|
1026
1030
|
function Ae(e, t) {
|
|
1027
1031
|
return e && e !== "auto" ? e : t;
|
|
1028
1032
|
}
|
|
1029
|
-
function
|
|
1033
|
+
function Nr(e) {
|
|
1030
1034
|
return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
|
|
1031
1035
|
}
|
|
1032
|
-
function
|
|
1036
|
+
function Or(e) {
|
|
1033
1037
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
1034
1038
|
if (typeof e != "string" || !e.trim()) return null;
|
|
1035
1039
|
const t = Number(e);
|
|
1036
1040
|
return Number.isFinite(t) ? t : null;
|
|
1037
1041
|
}
|
|
1038
|
-
function
|
|
1042
|
+
function Vr(e) {
|
|
1039
1043
|
const t = Oe(e);
|
|
1040
1044
|
if (t !== void 0)
|
|
1041
1045
|
try {
|
|
1042
|
-
return
|
|
1046
|
+
return bt(t, /[.eE]/.test(t) ? "decimal" : "integer");
|
|
1043
1047
|
} catch {
|
|
1044
1048
|
return;
|
|
1045
1049
|
}
|
|
1046
1050
|
}
|
|
1047
|
-
function
|
|
1051
|
+
function Ur(e) {
|
|
1048
1052
|
return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
|
|
1049
1053
|
}
|
|
1050
|
-
function
|
|
1051
|
-
const { formatting: t, queryPayload: r } = e,
|
|
1054
|
+
function Mo(e) {
|
|
1055
|
+
const { formatting: t, queryPayload: r } = e, o = t.useFormattedValues, n = t.scope, i = (s) => vt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } }), a = (s) => Tt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } });
|
|
1052
1056
|
function l(s) {
|
|
1053
1057
|
var b;
|
|
1054
1058
|
if ((b = t.visibleColumns) != null && b.length) return t.visibleColumns;
|
|
@@ -1062,16 +1066,16 @@ function Ln(e) {
|
|
|
1062
1066
|
const b = s == null ? void 0 : s.pivotIdentity;
|
|
1063
1067
|
if (!b || !b.members || b.members.length === 0) return;
|
|
1064
1068
|
const y = he({ identity: b, columnKey: (s == null ? void 0 : s.key) || (s == null ? void 0 : s.field) || "" });
|
|
1065
|
-
return
|
|
1069
|
+
return Mt({
|
|
1066
1070
|
members: y,
|
|
1067
1071
|
metricLabel: (s == null ? void 0 : s.label) || (s == null ? void 0 : s.headerName),
|
|
1068
|
-
mode:
|
|
1072
|
+
mode: o ? "formatted" : "canonical",
|
|
1069
1073
|
resolveTemporalFormat: (S) => {
|
|
1070
1074
|
const w = y.find((x) => x.fieldId === S);
|
|
1071
1075
|
if (!(w != null && w.temporalBucket)) return;
|
|
1072
1076
|
const C = pe({
|
|
1073
1077
|
snapshot: t.presentationExecutionSnapshot,
|
|
1074
|
-
scope:
|
|
1078
|
+
scope: n,
|
|
1075
1079
|
target: { kind: "field", fieldId: S, role: "pivotby" }
|
|
1076
1080
|
});
|
|
1077
1081
|
return C ? g(w.temporalBucket, C) : void 0;
|
|
@@ -1092,7 +1096,7 @@ function Ln(e) {
|
|
|
1092
1096
|
const c = S == null ? void 0 : S.pivotByColumns, h = Array.isArray(c) ? c.flatMap(
|
|
1093
1097
|
(T) => Y(T) && typeof T.id == "string" && T.id ? [T.id] : []
|
|
1094
1098
|
) : [];
|
|
1095
|
-
|
|
1099
|
+
It(
|
|
1096
1100
|
y.map((T) => ({ key: N(T) || "<unknown>", pivotIdentity: T.pivotIdentity })),
|
|
1097
1101
|
{
|
|
1098
1102
|
expectedPivotFieldIds: h,
|
|
@@ -1105,7 +1109,7 @@ function Ln(e) {
|
|
|
1105
1109
|
const h = N(c);
|
|
1106
1110
|
return h ? [[h, c]] : [];
|
|
1107
1111
|
})
|
|
1108
|
-
), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M =
|
|
1112
|
+
), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M = $r({
|
|
1109
1113
|
records: b,
|
|
1110
1114
|
columns: y,
|
|
1111
1115
|
formatting: t,
|
|
@@ -1119,29 +1123,29 @@ function Ln(e) {
|
|
|
1119
1123
|
for (const c of w) {
|
|
1120
1124
|
const h = pe({
|
|
1121
1125
|
snapshot: t.presentationExecutionSnapshot,
|
|
1122
|
-
scope:
|
|
1126
|
+
scope: n,
|
|
1123
1127
|
target: { kind: "column", columnKey: c }
|
|
1124
1128
|
}), T = K.get(c);
|
|
1125
|
-
if (
|
|
1129
|
+
if (o) {
|
|
1126
1130
|
if (h && !T) throw new Error(`Missing temporal bucket metadata for column "${c}"`);
|
|
1127
1131
|
if (T && !h) throw new Error(`Missing resolved temporal presentation for column "${c}"`);
|
|
1128
1132
|
}
|
|
1129
1133
|
h && T && le.set(c, g(T, h));
|
|
1130
1134
|
}
|
|
1131
|
-
const
|
|
1132
|
-
const h = F.get(c), T = h &&
|
|
1135
|
+
const qe = K.size > 0 && e.cardType === "aggregateTable" ? Lr(r, s.columnKeyMap) : void 0, B = w.map((c) => {
|
|
1136
|
+
const h = F.get(c), T = h && Dr.has(h) ? h : "unknown", E = o ? v(c, M, K) : void 0, k = m(c, x.get(c)), A = o && M.activatedColumnKeys.has(c) && Se(M, c) === void 0;
|
|
1133
1137
|
return {
|
|
1134
1138
|
key: c,
|
|
1135
1139
|
label: k,
|
|
1136
1140
|
dataType: T,
|
|
1137
1141
|
...E ? { presentation: E } : {},
|
|
1138
|
-
xlsx: ve({ key: c, label: k, formattedValues:
|
|
1142
|
+
xlsx: ve({ key: c, label: k, formattedValues: o, dataType: T, presentation: E }),
|
|
1139
1143
|
...A ? { xlsxPending: !0 } : {}
|
|
1140
1144
|
};
|
|
1141
1145
|
});
|
|
1142
1146
|
function ce(c, h, T, E) {
|
|
1143
|
-
if (!
|
|
1144
|
-
const k =
|
|
1147
|
+
if (!o) return { text: Q(c), value: c };
|
|
1148
|
+
const k = _r({ value: c, columnKey: h, rowIndex: T, resolution: M });
|
|
1145
1149
|
if (k !== void 0) return { text: k.text, value: c, ...k.wallClock ? { wallClock: k.wallClock } : {} };
|
|
1146
1150
|
const A = K.get(h);
|
|
1147
1151
|
if (A) {
|
|
@@ -1149,7 +1153,7 @@ function Ln(e) {
|
|
|
1149
1153
|
if (!L) throw new Error(`Missing resolved temporal presentation for column "${h}"`);
|
|
1150
1154
|
if (c != null && typeof c != "string")
|
|
1151
1155
|
throw new Error(`Canonical temporal column "${h}" must contain a string or null`);
|
|
1152
|
-
const D = c ?? null, R =
|
|
1156
|
+
const D = c ?? null, R = ut(D, A);
|
|
1153
1157
|
return {
|
|
1154
1158
|
text: Ie({ value: D, metadata: A, format: L }),
|
|
1155
1159
|
value: c,
|
|
@@ -1162,7 +1166,7 @@ function Ln(e) {
|
|
|
1162
1166
|
return {
|
|
1163
1167
|
text: ge(
|
|
1164
1168
|
new Date(c).toISOString(),
|
|
1165
|
-
_.pattern ||
|
|
1169
|
+
_.pattern || Ye,
|
|
1166
1170
|
Ae(_.timezone, t.timezone),
|
|
1167
1171
|
"UTC"
|
|
1168
1172
|
),
|
|
@@ -1174,8 +1178,8 @@ function Ln(e) {
|
|
|
1174
1178
|
if (U(c))
|
|
1175
1179
|
return { text: I ? j(c, I) : c.value, value: c };
|
|
1176
1180
|
const z = Ee(t, h);
|
|
1177
|
-
if (z && (c instanceof Date || typeof c == "string" &&
|
|
1178
|
-
const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" &&
|
|
1181
|
+
if (z && (c instanceof Date || typeof c == "string" && Rr.test(c))) {
|
|
1182
|
+
const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" && Pr.test(c), R = D ? "UTC" : Ae(z.timezone, t.timezone), me = D ? "UTC" : z.sourceTimezone || "auto", de = ft(L, R, me);
|
|
1179
1183
|
return {
|
|
1180
1184
|
text: ge(L, ke(z), R, me),
|
|
1181
1185
|
value: c,
|
|
@@ -1183,16 +1187,16 @@ function Ln(e) {
|
|
|
1183
1187
|
};
|
|
1184
1188
|
}
|
|
1185
1189
|
if (typeof c == "string" && I && E.dataType === "number") {
|
|
1186
|
-
const L =
|
|
1190
|
+
const L = Vr(c);
|
|
1187
1191
|
if (L) return { text: j(L, I), value: c };
|
|
1188
1192
|
}
|
|
1189
1193
|
return { text: Q(c), value: c };
|
|
1190
1194
|
}
|
|
1191
|
-
const
|
|
1192
|
-
const T =
|
|
1195
|
+
const Je = b.map((c, h) => {
|
|
1196
|
+
const T = Fr({
|
|
1193
1197
|
row: c,
|
|
1194
|
-
aggregateContext:
|
|
1195
|
-
useFormattedValues:
|
|
1198
|
+
aggregateContext: qe,
|
|
1199
|
+
useFormattedValues: o,
|
|
1196
1200
|
visibleColumnKeys: C,
|
|
1197
1201
|
formatGroupValue: (E, k) => {
|
|
1198
1202
|
const A = B.find((_) => _.key === k);
|
|
@@ -1214,7 +1218,7 @@ function Ln(e) {
|
|
|
1214
1218
|
return {
|
|
1215
1219
|
...ue ? { header: B.map((c) => c.label) } : {},
|
|
1216
1220
|
columns: B,
|
|
1217
|
-
rows:
|
|
1221
|
+
rows: Je,
|
|
1218
1222
|
...M.sqlChunkEvidence ? { rawTemporalClassification: M.sqlChunkEvidence } : {}
|
|
1219
1223
|
};
|
|
1220
1224
|
}
|
|
@@ -1224,10 +1228,10 @@ function Ln(e) {
|
|
|
1224
1228
|
return C === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: C };
|
|
1225
1229
|
}
|
|
1226
1230
|
const y = b.get(s);
|
|
1227
|
-
if (y) return { kind: "temporal_bucket", grain:
|
|
1231
|
+
if (y) return { kind: "temporal_bucket", grain: Ur(y) };
|
|
1228
1232
|
if (a(s)) return { kind: "text" };
|
|
1229
1233
|
const S = Ee(t, s);
|
|
1230
|
-
if (S) return { kind: "datetime", dateOnly:
|
|
1234
|
+
if (S) return { kind: "datetime", dateOnly: Nr(ke(S)) };
|
|
1231
1235
|
const w = i(s);
|
|
1232
1236
|
return w ? { kind: "measure", format: w } : void 0;
|
|
1233
1237
|
}
|
|
@@ -1235,22 +1239,22 @@ function Ln(e) {
|
|
|
1235
1239
|
if (!Number.isInteger(f) || f < 0)
|
|
1236
1240
|
throw new Error("totalRows must be a non-negative integer");
|
|
1237
1241
|
return f === 0 ? void 0 : (t.visibleColumns ?? Object.keys(s)).map((y) => {
|
|
1238
|
-
const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C =
|
|
1242
|
+
const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C = o ? i(y) : void 0, x = ve({
|
|
1239
1243
|
key: y,
|
|
1240
1244
|
label: y,
|
|
1241
|
-
formattedValues:
|
|
1245
|
+
formattedValues: o,
|
|
1242
1246
|
dataType: "unknown",
|
|
1243
1247
|
...C ? { presentation: { kind: "measure", format: C } } : {}
|
|
1244
1248
|
});
|
|
1245
1249
|
if (w == null) return { kind: "empty" };
|
|
1246
|
-
if (!
|
|
1247
|
-
const F = C ?
|
|
1250
|
+
if (!o) return P({ value: w, text: String(w), column: x });
|
|
1251
|
+
const F = C ? Or(w) : null;
|
|
1248
1252
|
return P(C && F !== null ? { value: F, text: j(F, C), column: x } : { value: w, text: String(w), column: x });
|
|
1249
1253
|
});
|
|
1250
1254
|
}
|
|
1251
1255
|
return { format: p, totals: d };
|
|
1252
1256
|
}
|
|
1253
|
-
const
|
|
1257
|
+
const Kr = /* @__PURE__ */ new Set([
|
|
1254
1258
|
"scope",
|
|
1255
1259
|
"useFormattedValues",
|
|
1256
1260
|
"timezone",
|
|
@@ -1275,7 +1279,7 @@ function Le(e, t) {
|
|
|
1275
1279
|
return e;
|
|
1276
1280
|
}
|
|
1277
1281
|
}
|
|
1278
|
-
function
|
|
1282
|
+
function Io(e) {
|
|
1279
1283
|
if (!ie(e))
|
|
1280
1284
|
throw new Error("formatting must be an object");
|
|
1281
1285
|
const t = ["reportContext", "resolvedFormats"].find(
|
|
@@ -1285,23 +1289,23 @@ function Fn(e) {
|
|
|
1285
1289
|
throw new ye(
|
|
1286
1290
|
`formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
1287
1291
|
);
|
|
1288
|
-
const r = Object.keys(e).find((s) => !
|
|
1292
|
+
const r = Object.keys(e).find((s) => !Kr.has(s));
|
|
1289
1293
|
if (r)
|
|
1290
1294
|
throw new Error(`formatting contains unknown property "${r}"`);
|
|
1291
|
-
const
|
|
1292
|
-
if (!n)
|
|
1293
|
-
throw new Error("formatting.timezone must be a non-empty string");
|
|
1294
|
-
const o = pt(e.delimiter);
|
|
1295
|
+
const o = typeof e.timezone == "string" ? e.timezone.trim() : "";
|
|
1295
1296
|
if (!o)
|
|
1297
|
+
throw new Error("formatting.timezone must be a non-empty string");
|
|
1298
|
+
const n = gt(e.delimiter);
|
|
1299
|
+
if (!n)
|
|
1296
1300
|
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
1297
|
-
const i =
|
|
1301
|
+
const i = pt(e.csvEncoding);
|
|
1298
1302
|
if (!i)
|
|
1299
1303
|
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
1300
1304
|
if (typeof e.includeHeaders != "boolean")
|
|
1301
1305
|
throw new Error("formatting.includeHeaders must be a boolean");
|
|
1302
1306
|
if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
|
|
1303
1307
|
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
1304
|
-
const a = e.fileFormat === void 0 ? void 0 :
|
|
1308
|
+
const a = e.fileFormat === void 0 ? void 0 : yt(e.fileFormat);
|
|
1305
1309
|
if (e.fileFormat !== void 0 && !a)
|
|
1306
1310
|
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
1307
1311
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
@@ -1317,16 +1321,16 @@ function Fn(e) {
|
|
|
1317
1321
|
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
1318
1322
|
if (g && !(l != null && l.includes(g)))
|
|
1319
1323
|
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
1320
|
-
const p =
|
|
1324
|
+
const p = Ct(e.scope, "formatting.scope");
|
|
1321
1325
|
if (!p.cardId || p.attachmentIndex !== void 0)
|
|
1322
1326
|
throw new Error("formatting.scope must identify exactly one dashboard card");
|
|
1323
|
-
const v = e.useFormattedValues !== !1, d =
|
|
1324
|
-
if (
|
|
1327
|
+
const v = e.useFormattedValues !== !1, d = xt(e.presentationExecutionSnapshot);
|
|
1328
|
+
if (o !== d.reportContext.calendar.tz)
|
|
1325
1329
|
throw new Error(
|
|
1326
1330
|
"formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
|
|
1327
1331
|
);
|
|
1328
1332
|
try {
|
|
1329
|
-
|
|
1333
|
+
St({
|
|
1330
1334
|
snapshot: d,
|
|
1331
1335
|
expectedScope: { dashboardId: p.dashboardId, cardId: p.cardId },
|
|
1332
1336
|
visibleColumns: l,
|
|
@@ -1340,9 +1344,9 @@ function Fn(e) {
|
|
|
1340
1344
|
return {
|
|
1341
1345
|
scope: { dashboardId: p.dashboardId, cardId: p.cardId },
|
|
1342
1346
|
useFormattedValues: v,
|
|
1343
|
-
timezone:
|
|
1347
|
+
timezone: o,
|
|
1344
1348
|
presentationExecutionSnapshot: d,
|
|
1345
|
-
delimiter:
|
|
1349
|
+
delimiter: n,
|
|
1346
1350
|
csvEncoding: i,
|
|
1347
1351
|
includeHeaders: e.includeHeaders,
|
|
1348
1352
|
...u ? { columnSettings: u } : {},
|
|
@@ -1353,8 +1357,8 @@ function Fn(e) {
|
|
|
1353
1357
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1354
1358
|
};
|
|
1355
1359
|
}
|
|
1356
|
-
function
|
|
1357
|
-
const t = e.formatOptions, r = (
|
|
1360
|
+
function $o(e) {
|
|
1361
|
+
const t = e.formatOptions, r = (o) => ie(o) ? o : void 0;
|
|
1358
1362
|
return {
|
|
1359
1363
|
scope: { dashboardId: e.dashboardId, cardId: e.cardId },
|
|
1360
1364
|
useFormattedValues: t.useFormattedValues !== !1,
|
|
@@ -1371,37 +1375,37 @@ function Mn(e) {
|
|
|
1371
1375
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1372
1376
|
};
|
|
1373
1377
|
}
|
|
1374
|
-
const
|
|
1375
|
-
function
|
|
1378
|
+
const Br = /^\d{4}-\d{2}-\d{2}$/;
|
|
1379
|
+
function Ze(e) {
|
|
1376
1380
|
const t = e.split(".");
|
|
1377
|
-
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((
|
|
1381
|
+
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
|
|
1378
1382
|
}
|
|
1379
1383
|
const Fe = 10;
|
|
1380
1384
|
function ee(e, t) {
|
|
1381
|
-
const r = e.slice(0, Fe).map(t).join(", "),
|
|
1382
|
-
return
|
|
1385
|
+
const r = e.slice(0, Fe).map(t).join(", "), o = e.length - Fe;
|
|
1386
|
+
return o > 0 ? `${r}, and ${o} more` : r;
|
|
1383
1387
|
}
|
|
1384
|
-
function
|
|
1388
|
+
function zr(e) {
|
|
1385
1389
|
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
1386
1390
|
return;
|
|
1387
1391
|
const t = ae(e.relativeMeta);
|
|
1388
1392
|
if (t)
|
|
1389
|
-
return
|
|
1393
|
+
return wt(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
|
|
1390
1394
|
}
|
|
1391
|
-
function
|
|
1392
|
-
if (t !== "label") return
|
|
1395
|
+
function jr(e, t) {
|
|
1396
|
+
if (t !== "label") return zr(e);
|
|
1393
1397
|
if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
|
|
1394
1398
|
return ae(e.relativeMeta);
|
|
1395
1399
|
}
|
|
1396
1400
|
function Me(e, t = {}) {
|
|
1397
|
-
const { name: r, operation:
|
|
1401
|
+
const { name: r, operation: o, values: n, valueType: i } = e, a = t.label ?? Ze(r), l = jr(e, t.relativeDates);
|
|
1398
1402
|
if (l) {
|
|
1399
|
-
const u =
|
|
1403
|
+
const u = Ft(l);
|
|
1400
1404
|
if (u)
|
|
1401
|
-
return
|
|
1405
|
+
return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
|
|
1402
1406
|
}
|
|
1403
|
-
if (!
|
|
1404
|
-
return
|
|
1407
|
+
if (!n || n.length === 0)
|
|
1408
|
+
return o === "is null" ? `${a} is empty` : o === "is not null" ? `${a} is not empty` : "";
|
|
1405
1409
|
const m = (u) => {
|
|
1406
1410
|
if (i === "date" && u) {
|
|
1407
1411
|
const g = e.temporalPrecision === "minute", p = {
|
|
@@ -1413,7 +1417,7 @@ function Me(e, t = {}) {
|
|
|
1413
1417
|
minute: "2-digit"
|
|
1414
1418
|
} : {}
|
|
1415
1419
|
};
|
|
1416
|
-
if (typeof u == "string" &&
|
|
1420
|
+
if (typeof u == "string" && Br.test(u)) {
|
|
1417
1421
|
const [d, s, f] = u.split("-").map(Number);
|
|
1418
1422
|
return new Intl.DateTimeFormat(void 0, {
|
|
1419
1423
|
year: "numeric",
|
|
@@ -1422,7 +1426,7 @@ function Me(e, t = {}) {
|
|
|
1422
1426
|
timeZone: "UTC"
|
|
1423
1427
|
}).format(new Date(Date.UTC(d, s - 1, f)));
|
|
1424
1428
|
}
|
|
1425
|
-
if (typeof u == "string" &&
|
|
1429
|
+
if (typeof u == "string" && mt(u) === "wall_datetime") {
|
|
1426
1430
|
const [d, s, f, b, y] = u.split(/[-T :.]/).map(Number);
|
|
1427
1431
|
return new Intl.DateTimeFormat(void 0, {
|
|
1428
1432
|
...p,
|
|
@@ -1442,100 +1446,100 @@ function Me(e, t = {}) {
|
|
|
1442
1446
|
}
|
|
1443
1447
|
return String(u);
|
|
1444
1448
|
};
|
|
1445
|
-
switch (
|
|
1449
|
+
switch (o) {
|
|
1446
1450
|
case "=":
|
|
1447
|
-
return `${a}: ${m(
|
|
1451
|
+
return `${a}: ${m(n[0])}`;
|
|
1448
1452
|
case "!=":
|
|
1449
|
-
return `${a} ≠ ${m(
|
|
1453
|
+
return `${a} ≠ ${m(n[0])}`;
|
|
1450
1454
|
case ">":
|
|
1451
|
-
return `${a} > ${m(
|
|
1455
|
+
return `${a} > ${m(n[0])}`;
|
|
1452
1456
|
case "<":
|
|
1453
|
-
return `${a} < ${m(
|
|
1457
|
+
return `${a} < ${m(n[0])}`;
|
|
1454
1458
|
case ">=":
|
|
1455
|
-
return `${a} ≥ ${m(
|
|
1459
|
+
return `${a} ≥ ${m(n[0])}`;
|
|
1456
1460
|
case "<=":
|
|
1457
|
-
return `${a} ≤ ${m(
|
|
1461
|
+
return `${a} ≤ ${m(n[0])}`;
|
|
1458
1462
|
case "between":
|
|
1459
1463
|
case "not between": {
|
|
1460
|
-
const u = `${m(
|
|
1461
|
-
return
|
|
1464
|
+
const u = `${m(n[0])} - ${m(n[1])}`;
|
|
1465
|
+
return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
|
|
1462
1466
|
}
|
|
1463
1467
|
case "in":
|
|
1464
|
-
return
|
|
1468
|
+
return n.length === 1 ? `${a}: ${m(n[0])}` : `${a}: ${ee(n, m)}`;
|
|
1465
1469
|
case "not in":
|
|
1466
|
-
return `${a} not in (${ee(
|
|
1470
|
+
return `${a} not in (${ee(n, m)})`;
|
|
1467
1471
|
case "like":
|
|
1468
|
-
return `${a} contains "${
|
|
1472
|
+
return `${a} contains "${n[0]}"`;
|
|
1469
1473
|
case "not like":
|
|
1470
|
-
return `${a} doesn't contain "${
|
|
1474
|
+
return `${a} doesn't contain "${n[0]}"`;
|
|
1471
1475
|
default:
|
|
1472
|
-
return `${a}: ${ee(
|
|
1476
|
+
return `${a}: ${ee(n, m)}`;
|
|
1473
1477
|
}
|
|
1474
1478
|
}
|
|
1475
|
-
function
|
|
1479
|
+
function _o(e, t = {}) {
|
|
1476
1480
|
if (!e || e.length === 0)
|
|
1477
1481
|
return "";
|
|
1478
1482
|
const r = /* @__PURE__ */ new Map();
|
|
1479
|
-
e.forEach((
|
|
1480
|
-
const i = r.get(
|
|
1481
|
-
i.push(
|
|
1483
|
+
e.forEach((n) => {
|
|
1484
|
+
const i = r.get(n.name) || [];
|
|
1485
|
+
i.push(n), r.set(n.name, i);
|
|
1482
1486
|
});
|
|
1483
|
-
const
|
|
1484
|
-
return r.forEach((
|
|
1485
|
-
if (
|
|
1486
|
-
const a = Me(
|
|
1487
|
-
a &&
|
|
1487
|
+
const o = [];
|
|
1488
|
+
return r.forEach((n, i) => {
|
|
1489
|
+
if (n.length === 1) {
|
|
1490
|
+
const a = Me(n[0], t);
|
|
1491
|
+
a && o.push(a);
|
|
1488
1492
|
} else {
|
|
1489
|
-
const a =
|
|
1490
|
-
l.length > 0 &&
|
|
1493
|
+
const a = Ze(i), l = n.map((m) => Me(m, t).replace(`${a}: `, "").replace(`${a} `, "")).filter(Boolean);
|
|
1494
|
+
l.length > 0 && o.push(`${a}: ${l.join(" and ")}`);
|
|
1491
1495
|
}
|
|
1492
|
-
}),
|
|
1496
|
+
}), o.join(" | ");
|
|
1493
1497
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return ((e == null ? void 0 : e.filterValues) ?? []).filter(
|
|
1498
|
+
function Do(e) {
|
|
1499
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(Gr).map(Hr);
|
|
1496
1500
|
}
|
|
1497
|
-
function
|
|
1501
|
+
function Gr(e) {
|
|
1498
1502
|
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
1499
1503
|
}
|
|
1500
|
-
function
|
|
1504
|
+
function Hr(e) {
|
|
1501
1505
|
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
1502
|
-
const { relativeMeta: t, ...r } = e,
|
|
1503
|
-
return
|
|
1506
|
+
const { relativeMeta: t, ...r } = e, o = ae(t);
|
|
1507
|
+
return o ? { ...r, relativeMeta: o } : r;
|
|
1504
1508
|
}
|
|
1505
|
-
const
|
|
1509
|
+
const Xr = /* @__PURE__ */ new Set([
|
|
1506
1510
|
"day",
|
|
1507
1511
|
"week",
|
|
1508
1512
|
"month",
|
|
1509
1513
|
"quarter",
|
|
1510
1514
|
"year"
|
|
1511
1515
|
]);
|
|
1512
|
-
function
|
|
1516
|
+
function Wr(e, t) {
|
|
1513
1517
|
try {
|
|
1514
1518
|
const r = $(
|
|
1515
1519
|
O(e),
|
|
1516
1520
|
t,
|
|
1517
1521
|
"yyyy-MM-dd"
|
|
1518
|
-
), [
|
|
1522
|
+
), [o, n, i] = r.split("-").map(Number), a = new Date(Date.UTC(o, n - 1, i));
|
|
1519
1523
|
return a.setUTCDate(a.getUTCDate() - 1), $(a, "UTC", "yyyy-MM-dd");
|
|
1520
1524
|
} catch {
|
|
1521
1525
|
return;
|
|
1522
1526
|
}
|
|
1523
1527
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const
|
|
1528
|
+
function Ro(e, t, r, o = !1) {
|
|
1529
|
+
const n = Yr(
|
|
1526
1530
|
e,
|
|
1527
1531
|
t,
|
|
1528
1532
|
r,
|
|
1529
|
-
|
|
1533
|
+
o
|
|
1530
1534
|
);
|
|
1531
|
-
return `${
|
|
1535
|
+
return `${n.start} - ${n.end}`;
|
|
1532
1536
|
}
|
|
1533
|
-
function
|
|
1537
|
+
function Yr(e, t, r, o = !1) {
|
|
1534
1538
|
try {
|
|
1535
|
-
if (r &&
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1538
|
-
const i =
|
|
1539
|
+
if (r && Xr.has(r)) {
|
|
1540
|
+
const n = Wr(e.end, t);
|
|
1541
|
+
if (n) {
|
|
1542
|
+
const i = o ? "MMM d" : "MMM d, yyyy";
|
|
1539
1543
|
return {
|
|
1540
1544
|
start: $(
|
|
1541
1545
|
O(e.start),
|
|
@@ -1543,7 +1547,7 @@ function Wr(e, t, r, n = !1) {
|
|
|
1543
1547
|
i
|
|
1544
1548
|
),
|
|
1545
1549
|
end: $(
|
|
1546
|
-
O(`${
|
|
1550
|
+
O(`${n}T00:00:00Z`),
|
|
1547
1551
|
"UTC",
|
|
1548
1552
|
"MMM d, yyyy"
|
|
1549
1553
|
)
|
|
@@ -1551,13 +1555,13 @@ function Wr(e, t, r, n = !1) {
|
|
|
1551
1555
|
}
|
|
1552
1556
|
}
|
|
1553
1557
|
if (r === "second" || r === "minute" || r === "hour") {
|
|
1554
|
-
const
|
|
1558
|
+
const n = o ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
|
|
1555
1559
|
return {
|
|
1556
|
-
start: $(O(e.start), t,
|
|
1560
|
+
start: $(O(e.start), t, n),
|
|
1557
1561
|
end: `before ${$(
|
|
1558
1562
|
O(e.end),
|
|
1559
1563
|
t,
|
|
1560
|
-
|
|
1564
|
+
n
|
|
1561
1565
|
)}`
|
|
1562
1566
|
};
|
|
1563
1567
|
}
|
|
@@ -1566,53 +1570,54 @@ function Wr(e, t, r, n = !1) {
|
|
|
1566
1570
|
return { start: e.start, end: `before ${e.end}` };
|
|
1567
1571
|
}
|
|
1568
1572
|
export {
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1573
|
+
Mo as A,
|
|
1574
|
+
Io as B,
|
|
1575
|
+
$o as C,
|
|
1576
|
+
Ve as D,
|
|
1577
|
+
Fo as E,
|
|
1578
|
+
Xt as F,
|
|
1579
|
+
Fe as G,
|
|
1580
|
+
zr as H,
|
|
1581
|
+
Me as I,
|
|
1582
|
+
_o as J,
|
|
1583
|
+
Do as K,
|
|
1584
|
+
Cr as L,
|
|
1585
|
+
go as M,
|
|
1586
|
+
oe as N,
|
|
1583
1587
|
xr as O,
|
|
1584
|
-
|
|
1588
|
+
Qt as P,
|
|
1585
1589
|
Sr as Q,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1590
|
+
Er as R,
|
|
1591
|
+
Ao as S,
|
|
1592
|
+
He as T,
|
|
1593
|
+
Lo as U,
|
|
1594
|
+
kr as V,
|
|
1595
|
+
er as W,
|
|
1596
|
+
Yr as X,
|
|
1597
|
+
mo as a,
|
|
1598
|
+
po as b,
|
|
1599
|
+
yo as c,
|
|
1600
|
+
ho as d,
|
|
1601
|
+
fo as e,
|
|
1602
|
+
Ro as f,
|
|
1603
|
+
bo as g,
|
|
1604
|
+
To as h,
|
|
1605
|
+
Co as i,
|
|
1606
|
+
or as j,
|
|
1607
|
+
xo as k,
|
|
1608
|
+
wo as l,
|
|
1609
|
+
rr as m,
|
|
1610
|
+
vo as n,
|
|
1611
|
+
Wt as o,
|
|
1612
|
+
tr as p,
|
|
1613
|
+
Zt as q,
|
|
1609
1614
|
ve as r,
|
|
1610
|
-
|
|
1615
|
+
Jt as s,
|
|
1611
1616
|
P as t,
|
|
1612
1617
|
ar as u,
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
+
sr as v,
|
|
1619
|
+
So as w,
|
|
1620
|
+
Eo as x,
|
|
1621
|
+
mr as y,
|
|
1622
|
+
ko as z
|
|
1618
1623
|
};
|