react-semaphor 0.1.602 → 0.1.603
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/analytics-protocol/index.js +415 -375
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
- package/dist/chunks/{assistant-chat-BWF3GYip.js → assistant-chat-B6hNQI1t.js} +146 -146
- package/dist/chunks/{bookmark-impact-BF3iRx5a.js → bookmark-impact-Ba2PLcGp.js} +3 -3
- package/dist/chunks/{bookmark-state-CBSTdW6q.js → bookmark-state-n7AaNzR_.js} +517 -516
- package/dist/chunks/{card-filter-builder-B8XHwMY6.js → card-filter-builder-Y22HizVx.js} +104 -104
- package/dist/chunks/{comparison-window-caption-W83qB4V5.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
- package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
- package/dist/chunks/{dashboard-DG5EIYYB.js → dashboard-BghI99oY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CBSrhyWZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +103 -103
- package/dist/chunks/{dashboard-controls-D6ECO4N1.js → dashboard-controls-CtFXlyjV.js} +53 -53
- package/dist/chunks/{dashboard-json-DrJftBSL.js → dashboard-json-DfGBUtCd.js} +5 -5
- package/dist/chunks/dates-BnrXF4bb.js +185 -0
- package/dist/chunks/{edit-dashboard-visual-BDYAJIbb.js → edit-dashboard-visual-oxt3x1wb.js} +7976 -8184
- package/dist/chunks/{filter-line-BXT6y303.js → filter-line-Cy5YYqRL.js} +27 -27
- package/dist/chunks/{filter-reach-copy-BukhZmzm.js → filter-reach-copy-CE_ZX147.js} +1590 -1729
- package/dist/chunks/{filter-value-text-D3-bf3_b.js → filter-value-text-fWvSDwkl.js} +11 -11
- package/dist/chunks/{index-BW0yozjs.js → index-D5rxbtS4.js} +24 -24
- package/dist/chunks/{layout-grid-Ds0diMeY.js → layout-grid-9LndRoLa.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CgQgVeeI.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
- package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js} +3 -2
- package/dist/chunks/{metric-comparison-zMylnIkc.js → metric-comparison-B0FR-Q8I.js} +184 -125
- package/dist/chunks/{paintbrush-CX8pao1j.js → paintbrush-58FQYY-y.js} +1 -1
- package/dist/chunks/{palette-CuA0HlzF.js → palette-Be62Tkoa.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-C8KL7hPx.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
- package/dist/chunks/{pivot-result-identity-C1AOH1PS.js → pivot-result-identity-CAP4--iq.js} +1 -1
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
- package/dist/chunks/{report-preferences-dialog-CbuVNDGi.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
- package/dist/chunks/{report-runtime-context-E7USjN7E.js → report-runtime-context-c77_KF9v.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-CULCE_hM.js → resolve-dashboard-input-context-Rtl1ffmE.js} +7115 -6963
- package/dist/chunks/{save-BKHlDONy.js → save-C5A0JnEV.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-C1WlOx5z.js → saved-dashboard-context-tcyTU8jm.js} +193 -207
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
- package/dist/chunks/{semaphor-ready-indicator-CBIRcDWs.js → semaphor-ready-indicator-FBvunj6S.js} +35550 -35273
- package/dist/chunks/{shelf-drop-preview-context-xR69SMA8.js → shelf-drop-preview-context-QKStrcK9.js} +6 -6
- package/dist/chunks/{stored-dashboard-BuM8vnWf.js → stored-dashboard-CHozcAY9.js} +621 -616
- package/dist/chunks/{style-sheet-parts-Bt9ZNre8.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
- package/dist/chunks/{table-export-sheet-DVljtHkG.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
- package/dist/chunks/{token-types-D_xKgyVS.js → token-types-XbM6QByy.js} +1 -1
- package/dist/chunks/{upload-Dll_M7XQ.js → upload-H15d7uHK.js} +1 -1
- package/dist/chunks/{validators-ClWHpYql.js → validators-Baf3VIf5.js} +3 -3
- package/dist/chunks/{variable-draft-CDGGl53R.js → variable-draft-C2y8Jp6Z.js} +3 -3
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2466 -2343
- package/dist/format-utils/index.js +205 -204
- package/dist/index.js +20 -20
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { a6 as
|
|
2
|
-
import { z as
|
|
3
|
-
import { Q as
|
|
4
|
-
import { D as
|
|
5
|
-
import "./analytics-base-schemas-
|
|
6
|
-
import { a as
|
|
7
|
-
import { r as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
1
|
+
import { a6 as J, f as Le, k as qe, aE as je } from "./validators-Baf3VIf5.js";
|
|
2
|
+
import { z as f } from "zod";
|
|
3
|
+
import { Q as j, E as Be, q as Ue } from "./matrix-operation-contract-DPBj69D8.js";
|
|
4
|
+
import { c as ze, D as We, b as be, e as Qe, r as B, a as Ye, k as Ge } from "./metric-comparison-B0FR-Q8I.js";
|
|
5
|
+
import "./analytics-base-schemas-DsUh5Q3C.js";
|
|
6
|
+
import { a as D } from "./applied-constraints-DU-wndZ7.js";
|
|
7
|
+
import { r as Je } from "./pivot-result-identity-CAP4--iq.js";
|
|
8
|
+
const se = 8, ae = 6, $ = Object.freeze([]);
|
|
9
|
+
function He(e) {
|
|
10
10
|
switch (e.type) {
|
|
11
11
|
case "table":
|
|
12
12
|
case "chart":
|
|
13
|
-
return e.card ? [e.card] :
|
|
13
|
+
return e.card ? [e.card] : $;
|
|
14
14
|
case "kpi":
|
|
15
|
-
return Array.isArray(e.cards) ? e.cards :
|
|
15
|
+
return Array.isArray(e.cards) ? e.cards : $;
|
|
16
16
|
default:
|
|
17
|
-
return
|
|
17
|
+
return $;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Xe(e, t) {
|
|
21
21
|
switch (e.type) {
|
|
22
22
|
case "table":
|
|
23
23
|
case "chart": {
|
|
@@ -34,7 +34,7 @@ function Je(e, t) {
|
|
|
34
34
|
return e;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function F(e) {
|
|
38
38
|
var n;
|
|
39
39
|
const t = [];
|
|
40
40
|
for (const r of e.sheets || []) {
|
|
@@ -51,7 +51,7 @@ function _(e) {
|
|
|
51
51
|
card: i
|
|
52
52
|
});
|
|
53
53
|
for (const a of ((n = r.document) == null ? void 0 : n.sections) || [])
|
|
54
|
-
for (const i of
|
|
54
|
+
for (const i of He(a))
|
|
55
55
|
t.push({
|
|
56
56
|
kind: "documentSectionCard",
|
|
57
57
|
sheetId: s,
|
|
@@ -62,28 +62,28 @@ function _(e) {
|
|
|
62
62
|
}
|
|
63
63
|
return t;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function sn(e, t, n) {
|
|
66
66
|
let r = !1;
|
|
67
|
-
const s =
|
|
67
|
+
const s = Ze(e, (i) => i.id !== n.id ? i : (r = !0, i === n ? i : n));
|
|
68
68
|
if (r || !t) return s;
|
|
69
69
|
const a = (s.sheets || []).map(
|
|
70
70
|
(i) => i.id === t && i.kind !== "document" ? { ...i, cards: [...i.cards ?? [], n] } : i
|
|
71
71
|
);
|
|
72
72
|
return { ...s, sheets: a };
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Ze(e, t) {
|
|
75
75
|
const n = (s, a) => {
|
|
76
76
|
const i = s.map((o) => t(o, a(o)));
|
|
77
77
|
return i.every((o, c) => o === s[c]) ? s : i;
|
|
78
78
|
}, r = (e.sheets || []).map((s) => {
|
|
79
|
-
var
|
|
80
|
-
const a = s.id, i = s.cards && n(s.cards, (
|
|
81
|
-
if (!
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
}), c = (
|
|
85
|
-
(
|
|
86
|
-
), u = !!o && o.some((
|
|
79
|
+
var m, I, y;
|
|
80
|
+
const a = s.id, i = s.cards && n(s.cards, (l) => ({ kind: "sheetCard", sheetId: a, cardId: l.id, card: l })), o = (m = s.frames) == null ? void 0 : m.map((l) => {
|
|
81
|
+
if (!l.cards) return l;
|
|
82
|
+
const h = n(l.cards, (C) => ({ kind: "frameCard", sheetId: a, frameId: l.id, cardId: C.id, card: C }));
|
|
83
|
+
return h === l.cards ? l : { ...l, cards: h };
|
|
84
|
+
}), c = (y = (I = s.document) == null ? void 0 : I.sections) == null ? void 0 : y.map(
|
|
85
|
+
(l) => Xe(l, (h) => t(h, { kind: "documentSectionCard", sheetId: a, sectionId: l.id, cardId: h.id, card: h }))
|
|
86
|
+
), u = !!o && o.some((l, h) => l !== s.frames[h]), d = !!c && c.some((l, h) => l !== s.document.sections[h]);
|
|
87
87
|
return i === s.cards && !u && !d ? s : {
|
|
88
88
|
...s,
|
|
89
89
|
...i === s.cards ? {} : { cards: i },
|
|
@@ -93,11 +93,11 @@ function He(e, t) {
|
|
|
93
93
|
});
|
|
94
94
|
return r.every((s, a) => s === e.sheets[a]) ? e : { ...e, sheets: r };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function P(e) {
|
|
97
97
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
99
|
+
function an(e) {
|
|
100
|
+
if (!P(e))
|
|
101
101
|
return [{ path: "", message: "must be an object." }];
|
|
102
102
|
const t = [];
|
|
103
103
|
e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
|
|
@@ -105,13 +105,13 @@ function rn(e) {
|
|
|
105
105
|
if (!Array.isArray(n))
|
|
106
106
|
t.push({ path: "cards", message: "must be an array of KPI cards." });
|
|
107
107
|
else {
|
|
108
|
-
(n.length < 1 || n.length >
|
|
108
|
+
(n.length < 1 || n.length > se) && t.push({
|
|
109
109
|
path: "cards",
|
|
110
|
-
message: `must hold 1 to ${
|
|
110
|
+
message: `must hold 1 to ${se} KPI cards.`
|
|
111
111
|
});
|
|
112
112
|
const s = /* @__PURE__ */ new Set();
|
|
113
113
|
n.forEach((a, i) => {
|
|
114
|
-
if (
|
|
114
|
+
if (!P(a)) {
|
|
115
115
|
t.push({ path: `cards[${i}]`, message: "must be a card." });
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
@@ -125,45 +125,45 @@ function rn(e) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
const r = e.kpi;
|
|
128
|
-
return
|
|
128
|
+
return P(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
|
|
129
129
|
path: "kpi.layout",
|
|
130
130
|
message: "must be 'tiles' or 'lines'."
|
|
131
|
-
}) : r.layout === "tiles" && Array.isArray(n) && n.length >
|
|
131
|
+
}) : r.layout === "tiles" && Array.isArray(n) && n.length > ae && t.push({
|
|
132
132
|
path: "kpi.layout",
|
|
133
|
-
message: `must be 'lines' for more than ${
|
|
133
|
+
message: `must be 'lines' for more than ${ae} KPI cards.`
|
|
134
134
|
}), r.columns !== void 0 && r.columns !== 1 && r.columns !== 2 && t.push({ path: "kpi.columns", message: "must be 1 or 2." })) : t.push({ path: "kpi", message: "must be an object." }), t;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
136
|
+
const Se = "dashboardInput";
|
|
137
|
+
function ie(e) {
|
|
138
138
|
return e === "label" || e === "value" || e === "start" || e === "end" || e === "range";
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function et(e) {
|
|
141
141
|
return e === "generatedAt" || e === "pageNumber" || e === "pageCount";
|
|
142
142
|
}
|
|
143
143
|
function v(e) {
|
|
144
144
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
145
145
|
const t = e;
|
|
146
|
-
if (t.source === "input" || t.source ===
|
|
147
|
-
return typeof t.inputId == "string" &&
|
|
146
|
+
if (t.source === "input" || t.source === Se)
|
|
147
|
+
return typeof t.inputId == "string" && ie(t.export) ? { source: "input", inputId: t.inputId, export: t.export } : void 0;
|
|
148
148
|
if (t.source === "dashboardInputAlias")
|
|
149
|
-
return typeof t.variableName != "string" || t.export !== void 0 && !
|
|
149
|
+
return typeof t.variableName != "string" || t.export !== void 0 && !ie(t.export) ? void 0 : {
|
|
150
150
|
source: "dashboardInputAlias",
|
|
151
151
|
variableName: t.variableName,
|
|
152
152
|
...t.export ? { export: t.export } : {}
|
|
153
153
|
};
|
|
154
154
|
if (t.source === "documentMeta")
|
|
155
|
-
return
|
|
155
|
+
return et(t.key) ? { source: "documentMeta", key: t.key } : void 0;
|
|
156
156
|
if (t.source === "data")
|
|
157
157
|
return typeof t.variableId == "string" && typeof t.export == "string" ? { source: "data", variableId: t.variableId, export: t.export } : void 0;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function on(e, t) {
|
|
160
160
|
const n = v(e), r = v(t);
|
|
161
161
|
return !n || !r ? JSON.stringify(e) === JSON.stringify(t) : [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].every((a) => n[a] === r[a]);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function tt(e) {
|
|
164
164
|
return x(e) ? e.type === "variable" ? e.ref === void 0 ? [] : [e.ref] : e.type === "when" && x(e.test) && e.test.ref !== void 0 ? [e.test.ref] : [] : [];
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function nt(e, t) {
|
|
167
167
|
if (!x(e)) return e;
|
|
168
168
|
if (e.type === "variable" && e.ref !== void 0) {
|
|
169
169
|
const n = t(e.ref);
|
|
@@ -178,10 +178,10 @@ function et(e, t) {
|
|
|
178
178
|
function x(e) {
|
|
179
179
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return !!e && typeof e == "object" && e.source ===
|
|
181
|
+
function oe(e) {
|
|
182
|
+
return !!e && typeof e == "object" && e.source === Se;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function cn(e) {
|
|
185
185
|
return U(e);
|
|
186
186
|
}
|
|
187
187
|
function U(e) {
|
|
@@ -198,15 +198,15 @@ function U(e) {
|
|
|
198
198
|
let n;
|
|
199
199
|
const r = (a, i) => {
|
|
200
200
|
i !== t[a] && (n ?? (n = { ...t }), n[a] = i);
|
|
201
|
-
}, s =
|
|
201
|
+
}, s = nt(
|
|
202
202
|
t,
|
|
203
|
-
(a) =>
|
|
203
|
+
(a) => oe(a) ? v(a) ?? a : a
|
|
204
204
|
);
|
|
205
205
|
if (s !== t && (s.ref !== t.ref && r("ref", s.ref), s.test !== t.test && r("test", s.test)), t.inputAliases && typeof t.inputAliases == "object") {
|
|
206
206
|
const a = t.inputAliases;
|
|
207
207
|
let i = !1;
|
|
208
208
|
const o = Object.fromEntries(
|
|
209
|
-
Object.entries(a).map(([c, u]) =>
|
|
209
|
+
Object.entries(a).map(([c, u]) => oe(u) ? (i = !0, [c, v(u) ?? u]) : [c, u])
|
|
210
210
|
);
|
|
211
211
|
i && r("inputAliases", o);
|
|
212
212
|
}
|
|
@@ -214,14 +214,14 @@ function U(e) {
|
|
|
214
214
|
a === "ref" && t.type === "variable" || a === "test" && t.type === "when" || a === "inputAliases" || r(a, U(i));
|
|
215
215
|
return n ?? e;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function un(e) {
|
|
218
218
|
return b(e);
|
|
219
219
|
}
|
|
220
220
|
function b(e) {
|
|
221
221
|
const t = [];
|
|
222
222
|
for (const n of Array.isArray(e) ? e : [])
|
|
223
223
|
if (!(!n || typeof n != "object")) {
|
|
224
|
-
for (const r of
|
|
224
|
+
for (const r of tt(n)) {
|
|
225
225
|
const s = v(r);
|
|
226
226
|
s && t.push(s);
|
|
227
227
|
}
|
|
@@ -229,14 +229,14 @@ function b(e) {
|
|
|
229
229
|
}
|
|
230
230
|
return t;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function rt(e) {
|
|
233
233
|
var r;
|
|
234
234
|
const t = (r = e.preferences) == null ? void 0 : r.textVisualOptions, n = t == null ? void 0 : t.richContent;
|
|
235
235
|
return n && Array.isArray(n.blocks) ? n.blocks.flatMap(
|
|
236
236
|
(s) => (s == null ? void 0 : s.type) === "list" ? (Array.isArray(s.items) ? s.items : []).flatMap((a) => b(a)) : b(s == null ? void 0 : s.children)
|
|
237
237
|
) : b(t == null ? void 0 : t.content);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Ce(e, t) {
|
|
240
240
|
var s;
|
|
241
241
|
const n = [], r = { kind: "document", sheetId: e };
|
|
242
242
|
for (const a of ["header", "footer"])
|
|
@@ -250,45 +250,45 @@ function be(e, t) {
|
|
|
250
250
|
n.push({ ref: i, place: r, where: { kind: "section", sectionId: a.id } });
|
|
251
251
|
return n;
|
|
252
252
|
}
|
|
253
|
-
const
|
|
254
|
-
function
|
|
255
|
-
const t =
|
|
253
|
+
const ce = /* @__PURE__ */ new WeakMap();
|
|
254
|
+
function ge(e) {
|
|
255
|
+
const t = ce.get(e);
|
|
256
256
|
if (t) return t;
|
|
257
257
|
const n = [];
|
|
258
258
|
for (const r of e.sheets ?? []) {
|
|
259
259
|
if (r.kind === "document") {
|
|
260
|
-
r.document && n.push(...
|
|
260
|
+
r.document && n.push(...Ce(r.id, r.document));
|
|
261
261
|
continue;
|
|
262
262
|
}
|
|
263
263
|
const s = { kind: "sheet", sheetId: r.id }, a = [...r.cards ?? [], ...(r.frames ?? []).flatMap((i) => i.cards ?? [])];
|
|
264
264
|
for (const i of a)
|
|
265
265
|
if (i.type === "text")
|
|
266
|
-
for (const o of
|
|
266
|
+
for (const o of rt(i))
|
|
267
267
|
n.push({ ref: o, place: s, where: { kind: "card", cardId: i.id } });
|
|
268
268
|
}
|
|
269
|
-
return
|
|
269
|
+
return ce.set(e, n), n;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ke(e, t) {
|
|
272
272
|
return e.kind === t.kind && e.sheetId === t.sheetId;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
const n =
|
|
276
|
-
return t ? n.filter((r) =>
|
|
274
|
+
function we(e, t) {
|
|
275
|
+
const n = ge(e);
|
|
276
|
+
return t ? n.filter((r) => ke(r.place, t)) : [...n];
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function st(e, t) {
|
|
279
279
|
const n = [];
|
|
280
|
-
for (const { ref: r, place: s } of
|
|
281
|
-
r.source !== "data" || r.variableId !== t || n.some((a) =>
|
|
280
|
+
for (const { ref: r, place: s } of ge(e))
|
|
281
|
+
r.source !== "data" || r.variableId !== t || n.some((a) => ke(a, s)) || n.push(s);
|
|
282
282
|
return n;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function dn(e, t) {
|
|
285
285
|
const n = /* @__PURE__ */ new Set();
|
|
286
|
-
for (const { ref: r } of
|
|
286
|
+
for (const { ref: r } of we(e, t))
|
|
287
287
|
r.source === "data" && n.add(r.variableId);
|
|
288
288
|
return [...n];
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
const n =
|
|
290
|
+
function ln(e, t) {
|
|
291
|
+
const n = Ce("", e).filter(
|
|
292
292
|
({ ref: r }) => r.source === "input" && r.inputId === t
|
|
293
293
|
);
|
|
294
294
|
return {
|
|
@@ -299,24 +299,24 @@ function un(e, t) {
|
|
|
299
299
|
).size
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
const n =
|
|
302
|
+
function Ae(e, t) {
|
|
303
|
+
const n = st(e, t);
|
|
304
304
|
return n.length ? n.map((r) => ({
|
|
305
305
|
sheetId: r.sheetId,
|
|
306
306
|
cardId: t,
|
|
307
307
|
sheetKind: r.kind === "document" ? "document" : "dashboard"
|
|
308
308
|
})) : (e.sheets ?? []).filter((r) => r.kind !== "document").map((r) => ({ sheetId: r.id, cardId: t, sheetKind: "dashboard" }));
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function g(e, t) {
|
|
311
311
|
var r;
|
|
312
|
-
if (!
|
|
312
|
+
if (!ct(e, t))
|
|
313
313
|
return !1;
|
|
314
314
|
const n = e.scope;
|
|
315
315
|
switch (n.kind) {
|
|
316
316
|
case "allSheets":
|
|
317
|
-
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !
|
|
317
|
+
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !ot(n.exceptSheetIds, t) && !le(n.exceptCardIds, t);
|
|
318
318
|
case "sheets":
|
|
319
|
-
return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !
|
|
319
|
+
return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !le(n.exceptCardIds, t);
|
|
320
320
|
case "cards":
|
|
321
321
|
return !!t.cardId && n.cardIds.includes(t.cardId);
|
|
322
322
|
case "documentSections":
|
|
@@ -325,8 +325,8 @@ function C(e, t) {
|
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
if (
|
|
328
|
+
function fn(e, t) {
|
|
329
|
+
if (g(e, {
|
|
330
330
|
sheetId: t.sheetId,
|
|
331
331
|
sheetKind: t.sheetKind
|
|
332
332
|
}))
|
|
@@ -334,7 +334,7 @@ function dn(e, t) {
|
|
|
334
334
|
switch (e.scope.kind) {
|
|
335
335
|
case "cards":
|
|
336
336
|
for (const n of [...t.cardIds, ...t.variableIds ?? []])
|
|
337
|
-
if (
|
|
337
|
+
if (g(e, {
|
|
338
338
|
sheetId: t.sheetId,
|
|
339
339
|
cardId: n,
|
|
340
340
|
sheetKind: t.sheetKind
|
|
@@ -347,17 +347,17 @@ function dn(e, t) {
|
|
|
347
347
|
return !1;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
const
|
|
351
|
-
function
|
|
352
|
-
const t =
|
|
350
|
+
const ue = /* @__PURE__ */ new WeakMap();
|
|
351
|
+
function at(e) {
|
|
352
|
+
const t = ue.get(e);
|
|
353
353
|
if (t) return t;
|
|
354
354
|
const n = /* @__PURE__ */ new Map();
|
|
355
|
-
for (const a of
|
|
355
|
+
for (const a of F(e)) {
|
|
356
356
|
const i = n.get(a.sheetId) ?? /* @__PURE__ */ new Set();
|
|
357
357
|
i.add(a.cardId), n.set(a.sheetId, i);
|
|
358
358
|
}
|
|
359
359
|
const r = /* @__PURE__ */ new Map();
|
|
360
|
-
for (const { ref: a, place: i } of
|
|
360
|
+
for (const { ref: a, place: i } of we(e)) {
|
|
361
361
|
if (a.source !== "data") continue;
|
|
362
362
|
const o = r.get(i.sheetId) ?? /* @__PURE__ */ new Set();
|
|
363
363
|
o.add(a.variableId), r.set(i.sheetId, o);
|
|
@@ -370,48 +370,48 @@ function rt(e) {
|
|
|
370
370
|
cardIds: n.get(a.id) ?? /* @__PURE__ */ new Set(),
|
|
371
371
|
variableIds: r.get(a.id) ?? /* @__PURE__ */ new Set()
|
|
372
372
|
});
|
|
373
|
-
return
|
|
373
|
+
return ue.set(e, s), s;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function mn(e, t) {
|
|
376
376
|
var s, a;
|
|
377
|
-
const n = /* @__PURE__ */ new Set(), r =
|
|
377
|
+
const n = /* @__PURE__ */ new Set(), r = at(e);
|
|
378
378
|
for (const i of r.values())
|
|
379
|
-
|
|
379
|
+
g(t, {
|
|
380
380
|
sheetId: i.sheetId,
|
|
381
381
|
sheetKind: i.sheetKind
|
|
382
382
|
}) && n.add(`sheet:${i.sheetId}`);
|
|
383
|
-
for (const i of
|
|
384
|
-
|
|
383
|
+
for (const i of F(e))
|
|
384
|
+
g(t, {
|
|
385
385
|
sheetId: i.sheetId,
|
|
386
386
|
cardId: i.cardId,
|
|
387
387
|
...i.kind === "documentSectionCard" ? { sectionId: i.sectionId } : {},
|
|
388
388
|
sheetKind: ((s = r.get(i.sheetId)) == null ? void 0 : s.sheetKind) ?? "dashboard"
|
|
389
389
|
}) && n.add(`card:${i.cardId}`);
|
|
390
390
|
for (const i of e.variables ?? [])
|
|
391
|
-
|
|
392
|
-
(o) =>
|
|
391
|
+
Ae(e, i.id).some(
|
|
392
|
+
(o) => g(t, o)
|
|
393
393
|
) && n.add(`card:${i.id}`);
|
|
394
394
|
for (const i of e.sheets ?? [])
|
|
395
395
|
if (i.kind === "document")
|
|
396
396
|
for (const o of ((a = i.document) == null ? void 0 : a.sections) ?? [])
|
|
397
|
-
|
|
397
|
+
g(t, {
|
|
398
398
|
sheetId: i.id,
|
|
399
399
|
sectionId: o.id,
|
|
400
400
|
sheetKind: "document"
|
|
401
401
|
}) && n.add(`section:${o.id}`);
|
|
402
402
|
return n;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function pn(e) {
|
|
405
405
|
return e.kind === "filter" && e.scope.kind === "cards";
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function hn(e, t) {
|
|
408
408
|
var a, i, o;
|
|
409
409
|
const n = (c) => {
|
|
410
410
|
var u, d;
|
|
411
|
-
return
|
|
411
|
+
return de(c, t.removedSheetIds, t.renamedSheetIds, !1, (u = t.copiedTab) == null ? void 0 : u.sheetIds, (d = t.copiedTab) == null ? void 0 : d.mode);
|
|
412
412
|
}, r = (c) => {
|
|
413
413
|
var u, d;
|
|
414
|
-
return
|
|
414
|
+
return de(
|
|
415
415
|
c,
|
|
416
416
|
t.removedCardIds,
|
|
417
417
|
t.renamedCardIds,
|
|
@@ -459,25 +459,25 @@ function mn(e, t) {
|
|
|
459
459
|
default:
|
|
460
460
|
return e;
|
|
461
461
|
}
|
|
462
|
-
return
|
|
462
|
+
return it(e, s) ? e : s;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function de(e, t, n, r, s, a) {
|
|
465
465
|
let i = e;
|
|
466
466
|
return t != null && t.size && (i = i.filter((o) => !t.has(o))), r && (i = i.filter((o) => n == null ? void 0 : n.has(o))), n != null && n.size && (i = i.map((o) => n.get(o) ?? o)), s != null && s.size && (i = a === "extend" ? [.../* @__PURE__ */ new Set([...i, ...i.flatMap((o) => s.has(o) ? [s.get(o)] : [])])] : i.map((o) => s.get(o) ?? o)), i;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function it(e, t) {
|
|
469
469
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function ot(e, t) {
|
|
472
472
|
return !!t.sheetId && !!(e != null && e.includes(t.sheetId));
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function le(e, t) {
|
|
475
475
|
return !!t.cardId && !!(e != null && e.includes(t.cardId));
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function ct(e, t) {
|
|
478
478
|
return t.sheetKind !== "document" || !e.compatibility || e.compatibility.source === "documentInput" ? !0 : e.compatibility.source === "cardInlineFilter" || e.compatibility.source === "cardControl" ? !!t.cardId && e.compatibility.cardId === t.cardId : !1;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function yn(e, t, n) {
|
|
481
481
|
switch (e.kind) {
|
|
482
482
|
case "sheets":
|
|
483
483
|
return e.sheetIds.length > 0 && e.sheetIds.every((r) => r === t);
|
|
@@ -489,25 +489,25 @@ function pn(e, t, n) {
|
|
|
489
489
|
return !1;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function In(e) {
|
|
493
493
|
return e.kind === "sheets" && e.sheetIds.length === 0 || e.kind === "cards" && e.cardIds.length === 0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ut(e) {
|
|
496
496
|
return e.kind === "allSheets" || e.kind === "sheets" ? e.exceptCardIds ?? [] : [];
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function bn(e) {
|
|
499
499
|
return e.kind === "allSheets" ? e.exceptSheetIds ?? [] : [];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Sn(e, t) {
|
|
502
502
|
var a;
|
|
503
503
|
if (e.kind !== "allSheets" && e.kind !== "sheets" || !((a = e.exceptCardIds) != null && a.includes(t))) return e;
|
|
504
504
|
const n = e.exceptCardIds.filter((i) => i !== t), { exceptCardIds: r, ...s } = e;
|
|
505
505
|
return n.length ? { ...s, exceptCardIds: n } : s;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Cn(e, t, n) {
|
|
508
508
|
var o;
|
|
509
509
|
if (t.kind !== "allSheets" && t.kind !== "sheets") return t;
|
|
510
|
-
const r =
|
|
510
|
+
const r = ut(e), s = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" && fe(e) ? [...n].filter((c) => {
|
|
511
511
|
var u;
|
|
512
512
|
return !((u = e.exceptSheetIds) != null && u.includes(c));
|
|
513
513
|
}) : [], a = [...n].filter((c) => !s.includes(c));
|
|
@@ -520,7 +520,7 @@ function bn(e, t, n) {
|
|
|
520
520
|
const i = e.kind === "allSheets" ? ((o = e.exceptSheetIds) == null ? void 0 : o.filter((c) => n.has(c))) ?? [] : [];
|
|
521
521
|
return {
|
|
522
522
|
kind: "allSheets",
|
|
523
|
-
...e.kind === "allSheets" &&
|
|
523
|
+
...e.kind === "allSheets" && fe(e) ? {
|
|
524
524
|
...e.sheetKinds ? { sheetKinds: e.sheetKinds } : {},
|
|
525
525
|
...i.length ? { exceptSheetIds: i } : {}
|
|
526
526
|
} : s.length ? {
|
|
@@ -530,11 +530,11 @@ function bn(e, t, n) {
|
|
|
530
530
|
...r.length ? { exceptCardIds: [...r] } : {}
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function fe(e) {
|
|
534
534
|
var t;
|
|
535
535
|
return e.kind === "allSheets" && (!((t = e.sheetKinds) != null && t.length) || e.sheetKinds.includes("document"));
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function gn(e, t) {
|
|
538
538
|
switch (e.kind) {
|
|
539
539
|
case "allSheets":
|
|
540
540
|
case "sheets": {
|
|
@@ -547,32 +547,32 @@ function Sn(e, t) {
|
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
function
|
|
550
|
+
const dt = 6;
|
|
551
|
+
function kn(e) {
|
|
552
552
|
if (!(e === void 0 || !Number.isFinite(e)) && Number.isInteger(e))
|
|
553
|
-
return Math.max(0, Math.min(
|
|
553
|
+
return Math.max(0, Math.min(dt, e));
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function ve(e) {
|
|
556
556
|
var t;
|
|
557
|
-
return ((t = e == null ? void 0 : e.comparison) == null ? void 0 : t.mode) === "explicit" ? e.comparison.spec : void 0;
|
|
557
|
+
return ((t = e == null ? void 0 : e.comparison) == null ? void 0 : t.mode) === "explicit" ? be(e.comparison.spec) : void 0;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
|
|
561
|
-
return
|
|
559
|
+
function lt(e) {
|
|
560
|
+
const t = ve(e);
|
|
561
|
+
return t ? ze(t) : "none";
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
const t =
|
|
563
|
+
function wn(e) {
|
|
564
|
+
const t = ve(e);
|
|
565
565
|
return (t == null ? void 0 : t.kind) === "target" ? t.targetValue : void 0;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) ||
|
|
567
|
+
function An(e) {
|
|
568
|
+
return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) || We;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function H(e, t) {
|
|
571
571
|
const n = Object.entries(e || {}).filter(
|
|
572
572
|
([a, i]) => i.output.outputId === a
|
|
573
573
|
);
|
|
574
574
|
if (!t.name) return;
|
|
575
|
-
const r =
|
|
575
|
+
const r = B({
|
|
576
576
|
...t,
|
|
577
577
|
name: t.name
|
|
578
578
|
}), s = n.filter(
|
|
@@ -580,17 +580,17 @@ function J(e, t) {
|
|
|
580
580
|
);
|
|
581
581
|
return s.length === 1 ? s[0][1] : void 0;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
const n =
|
|
583
|
+
function vn(e, t) {
|
|
584
|
+
const n = H(e, t);
|
|
585
585
|
return {
|
|
586
|
-
comparisonKind: (n == null ? void 0 : n.type) ??
|
|
586
|
+
comparisonKind: (n == null ? void 0 : n.type) ?? lt(t),
|
|
587
587
|
metadata: n
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
return (e == null ? void 0 : e.showComparison) ??
|
|
590
|
+
function Tn(e) {
|
|
591
|
+
return (e == null ? void 0 : e.showComparison) ?? Qe.showComparison;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function En(e) {
|
|
594
594
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
595
595
|
return Object.entries(e || {}).forEach(([c, u]) => {
|
|
596
596
|
const d = u.output;
|
|
@@ -611,14 +611,14 @@ function vn(e) {
|
|
|
611
611
|
comparisonSeriesLabels: o
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
const
|
|
615
|
-
function
|
|
614
|
+
const ft = "SEMAPHOR_CALCULATED_FIELD";
|
|
615
|
+
function X(e, t, n) {
|
|
616
616
|
if (n && (t === "groupby" || t === "pivotby"))
|
|
617
617
|
return n;
|
|
618
618
|
if (t === "metric" && e.name === "*" && !e.expression)
|
|
619
619
|
return e.alias || "count";
|
|
620
620
|
if (e.alias) return e.alias;
|
|
621
|
-
const r = e.entityName && e.entityName !==
|
|
621
|
+
const r = e.entityName && e.entityName !== ft ? e.entityName : void 0;
|
|
622
622
|
if (e.role === "metric") {
|
|
623
623
|
let s = e.aggregate || "metric";
|
|
624
624
|
if (e.expression) {
|
|
@@ -632,23 +632,23 @@ function H(e, t, n) {
|
|
|
632
632
|
}
|
|
633
633
|
return r && r !== e.name ? `${r}_${e.name}` : e.name;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return
|
|
635
|
+
function Te(e) {
|
|
636
|
+
return X(e, "detail");
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function mt(e) {
|
|
639
639
|
const t = e.label;
|
|
640
640
|
return t && e.labelCount === 1 && (t === e.rawKey || !e.rawKeys.has(t)) ? t : e.rawKey;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Kn(e) {
|
|
643
643
|
const t = [
|
|
644
644
|
...(e.groupByColumns ?? []).map((o) => ({ field: o, role: "groupby" })),
|
|
645
645
|
...(e.metricColumns ?? []).map((o) => ({ field: o, role: "metric" })),
|
|
646
646
|
...(e.pivotByColumns ?? []).map((o) => ({ field: o, role: "pivotby" })),
|
|
647
647
|
...(e.detailColumns ?? []).map((o) => ({ field: o, role: "detail" }))
|
|
648
|
-
], n =
|
|
648
|
+
], n = Ee(e.detailColumns ?? []), r = new Map((e.detailColumns ?? []).map((o, c) => [o, c])), s = new Map(
|
|
649
649
|
t.map(({ field: o, role: c }) => [
|
|
650
650
|
o,
|
|
651
|
-
c === "detail" ? n[r.get(o)] :
|
|
651
|
+
c === "detail" ? n[r.get(o)] : X(o, c)
|
|
652
652
|
])
|
|
653
653
|
), a = new Set(s.values()), i = /* @__PURE__ */ new Map();
|
|
654
654
|
for (const { field: o } of t)
|
|
@@ -656,7 +656,7 @@ function Tn(e) {
|
|
|
656
656
|
return new Map(
|
|
657
657
|
t.map(({ field: o }) => [
|
|
658
658
|
o,
|
|
659
|
-
|
|
659
|
+
mt({
|
|
660
660
|
label: o.label,
|
|
661
661
|
labelCount: o.label ? i.get(o.label) ?? 0 : 0,
|
|
662
662
|
rawKey: s.get(o),
|
|
@@ -665,8 +665,8 @@ function Tn(e) {
|
|
|
665
665
|
])
|
|
666
666
|
);
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const t = e.map((s) =>
|
|
668
|
+
function Ee(e) {
|
|
669
|
+
const t = e.map((s) => Te(s)), n = new Set(t), r = /* @__PURE__ */ new Map();
|
|
670
670
|
return t.forEach((s, a) => {
|
|
671
671
|
r.has(s) || r.set(s, a);
|
|
672
672
|
}), t.map((s, a) => {
|
|
@@ -676,76 +676,76 @@ function ve(e) {
|
|
|
676
676
|
return n.add(`${s}_${i}`), `${s}_${i}`;
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Nn(e) {
|
|
680
680
|
const t = e.detailColumns;
|
|
681
681
|
if (!t || t.length < 2) return e;
|
|
682
|
-
const n =
|
|
682
|
+
const n = Ee(t);
|
|
683
683
|
let r = !1;
|
|
684
|
-
const s = t.map((a, i) =>
|
|
684
|
+
const s = t.map((a, i) => Te(a) === n[i] ? a : (r = !0, { ...a, alias: n[i] }));
|
|
685
685
|
return r ? { ...e, detailColumns: s } : e;
|
|
686
686
|
}
|
|
687
|
-
const
|
|
688
|
-
function
|
|
689
|
-
return
|
|
687
|
+
const Ke = "text", R = 100, pt = 10, S = "value", Ne = ["previous", "change", "percentChange"];
|
|
688
|
+
function ht(e) {
|
|
689
|
+
return Ne.includes(e);
|
|
690
690
|
}
|
|
691
|
-
const
|
|
692
|
-
function
|
|
691
|
+
const yt = ["up", "down", "flat"];
|
|
692
|
+
function On(e, t, n) {
|
|
693
693
|
const { signWords: r, absolute: s, percent: a, ...i } = t ?? {};
|
|
694
694
|
return e !== "change" && e !== "percentChange" ? i : {
|
|
695
695
|
...i,
|
|
696
|
-
...(n == null ? void 0 : n.signWords) === void 0 ? { signWords:
|
|
696
|
+
...(n == null ? void 0 : n.signWords) === void 0 ? { signWords: yt } : {},
|
|
697
697
|
...(n == null ? void 0 : n.absolute) === void 0 ? { absolute: !0 } : {},
|
|
698
698
|
...e === "percentChange" && (n == null ? void 0 : n.percent) === void 0 ? { percent: !0 } : {}
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Z(e) {
|
|
702
702
|
var r, s, a, i;
|
|
703
703
|
if (e.get.kind !== "aggregate" || (r = e.query.sql) != null && r.trim()) return;
|
|
704
704
|
const t = (i = (a = (s = e.query.config) == null ? void 0 : s.metricColumns) == null ? void 0 : a[0]) == null ? void 0 : i.comparison;
|
|
705
705
|
if ((t == null ? void 0 : t.mode) !== "explicit") return;
|
|
706
|
-
const n = t.spec;
|
|
707
|
-
return n.kind === "
|
|
706
|
+
const n = be(t.spec);
|
|
707
|
+
return n.kind === "shift" ? n : void 0;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function me(e, t) {
|
|
710
710
|
if (t === "preview" && e.get.kind !== "aggregate")
|
|
711
|
-
return
|
|
711
|
+
return R + 1;
|
|
712
712
|
switch (e.get.kind) {
|
|
713
713
|
case "only":
|
|
714
714
|
return 2;
|
|
715
715
|
case "list":
|
|
716
|
-
return
|
|
716
|
+
return R + 1;
|
|
717
717
|
default:
|
|
718
718
|
return 1;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
const
|
|
721
|
+
const pe = {
|
|
722
722
|
answer: /* @__PURE__ */ new WeakMap(),
|
|
723
723
|
preview: /* @__PURE__ */ new WeakMap()
|
|
724
724
|
};
|
|
725
|
-
function
|
|
725
|
+
function It(e, t = "answer") {
|
|
726
726
|
var a;
|
|
727
|
-
const n =
|
|
727
|
+
const n = pe[t].get(e);
|
|
728
728
|
if (n) return n;
|
|
729
729
|
const { query: r } = e, s = {
|
|
730
730
|
id: e.id,
|
|
731
731
|
title: e.name,
|
|
732
|
-
type:
|
|
732
|
+
type: Ke,
|
|
733
733
|
respondsToSelections: !1,
|
|
734
|
-
dataVariableId: e.id,
|
|
735
734
|
// The viewer's dashboard comparison never changes a variable: its own
|
|
736
|
-
// measure says whether it compares (P3b-03)
|
|
737
|
-
|
|
735
|
+
// measure says whether it compares (P3b-03); the request builder gives a
|
|
736
|
+
// variable no Date filter comparison (compare-with CW-D22).
|
|
737
|
+
dataVariableId: e.id,
|
|
738
738
|
...r.connectionId ? { connectionId: r.connectionId } : {},
|
|
739
739
|
...r.dataSource ? { dataSource: r.dataSource } : {},
|
|
740
740
|
...r.calculatedFields ? { calculatedFields: r.calculatedFields } : {},
|
|
741
|
-
...(a = r.sql) != null && a.trim() ? { sql: r.sql, config: { rowLimit:
|
|
741
|
+
...(a = r.sql) != null && a.trim() ? { sql: r.sql, config: { rowLimit: me(e, t) } } : { config: { ...r.config, rowLimit: me(e, t) } }
|
|
742
742
|
};
|
|
743
|
-
return
|
|
743
|
+
return pe[t].set(e, s), s;
|
|
744
744
|
}
|
|
745
745
|
function Dn(e) {
|
|
746
|
-
return e.type ===
|
|
746
|
+
return e.type === Ke && typeof e.dataVariableId == "string" && e.dataVariableId.length > 0;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Mn(e, t, n) {
|
|
749
749
|
var r;
|
|
750
750
|
if (n === S && ((r = e.query.sql) != null && r.trim())) {
|
|
751
751
|
const s = Object.keys(t)[0];
|
|
@@ -754,78 +754,78 @@ function Nn(e, t, n) {
|
|
|
754
754
|
return n in t ? t[n] : void 0;
|
|
755
755
|
}
|
|
756
756
|
function z(e) {
|
|
757
|
-
const t =
|
|
757
|
+
const t = J(e);
|
|
758
758
|
return t === "string" || t === "unknown" ? "text" : t;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function bt(e) {
|
|
761
761
|
return typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : "text";
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function St(e, t, n, r) {
|
|
764
764
|
var i, o;
|
|
765
|
-
const s =
|
|
765
|
+
const s = Je(r, e.id, t);
|
|
766
766
|
return [
|
|
767
767
|
s == null ? void 0 : s.outputKey,
|
|
768
768
|
s == null ? void 0 : s.rawKey,
|
|
769
|
-
t === "metric" ? ((o = (i = r == null ? void 0 : r.byMetricAlias) == null ? void 0 : i[
|
|
770
|
-
|
|
769
|
+
t === "metric" ? ((o = (i = r == null ? void 0 : r.byMetricAlias) == null ? void 0 : i[B(e)]) == null ? void 0 : o.outputKey) ?? B(e) : void 0,
|
|
770
|
+
X(e, t === "metric" ? "metric" : "groupby"),
|
|
771
771
|
e.label,
|
|
772
772
|
e.name
|
|
773
773
|
].find((c) => !!c && n.has(c));
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function xn(e, t) {
|
|
776
776
|
var r;
|
|
777
777
|
if (e.get.kind === "aggregate")
|
|
778
|
-
return
|
|
778
|
+
return Z(e) ? [S, ...Ne] : [S];
|
|
779
779
|
if (e.get.kind === "list") return [S];
|
|
780
780
|
if ((r = e.query.sql) != null && r.trim()) return [...t ?? []];
|
|
781
781
|
const n = e.query.config;
|
|
782
|
-
return
|
|
782
|
+
return Ct([
|
|
783
783
|
...((n == null ? void 0 : n.groupByColumns) ?? []).map((s) => s.name),
|
|
784
784
|
...((n == null ? void 0 : n.metricColumns) ?? []).map((s) => s.name)
|
|
785
785
|
]);
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function Rn(e, t) {
|
|
788
788
|
var a, i, o, c;
|
|
789
789
|
if (e.get.kind === "list") return "list";
|
|
790
790
|
if ((a = e.query.sql) != null && a.trim()) return;
|
|
791
791
|
const n = e.query.config, r = (u, d) => {
|
|
792
792
|
if (!u) return;
|
|
793
|
-
const
|
|
794
|
-
return
|
|
793
|
+
const m = d === "metric" ? j(u) : u.dataType;
|
|
794
|
+
return J(m) === "unknown" ? void 0 : z(m);
|
|
795
795
|
};
|
|
796
796
|
if (e.get.kind === "aggregate")
|
|
797
|
-
return
|
|
797
|
+
return ht(t) && Z(e) ? "number" : t === S ? r((i = n == null ? void 0 : n.metricColumns) == null ? void 0 : i[0], "metric") : void 0;
|
|
798
798
|
const s = (o = n == null ? void 0 : n.groupByColumns) == null ? void 0 : o.find((u) => u.name === t);
|
|
799
799
|
return s ? r(s, "groupby") : r((c = n == null ? void 0 : n.metricColumns) == null ? void 0 : c.find((u) => u.name === t), "metric");
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Ct(e) {
|
|
802
802
|
return [...new Set(e)];
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
var
|
|
804
|
+
function gt(e, t, n) {
|
|
805
|
+
var l, h, C;
|
|
806
806
|
const r = t[0] ?? {}, s = new Set(
|
|
807
|
-
(
|
|
807
|
+
(l = n.columns) != null && l.length ? n.columns.map((p) => p.key) : Object.keys(r)
|
|
808
808
|
), a = new Map(
|
|
809
|
-
(n.columns ?? []).map((
|
|
810
|
-
), i = (
|
|
811
|
-
if ((
|
|
812
|
-
return [...s].map((
|
|
813
|
-
const o = e.query.config ?? {}, c = [], u = s.size === 1 ? [...s][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list",
|
|
814
|
-
if (c.some((
|
|
815
|
-
const K =
|
|
809
|
+
(n.columns ?? []).map((p) => [p.key, p.dataType])
|
|
810
|
+
), i = (p, k) => a.has(p) ? z(a.get(p)) : k !== void 0 ? z(k) : bt(r[p]);
|
|
811
|
+
if ((h = e.query.sql) != null && h.trim())
|
|
812
|
+
return [...s].map((p) => ({ part: p, key: p, type: i(p, void 0) }));
|
|
813
|
+
const o = e.query.config ?? {}, c = [], u = s.size === 1 ? [...s][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list", m = (p, k, re) => {
|
|
814
|
+
if (c.some((Pe) => Pe.part === re)) return;
|
|
815
|
+
const K = St(p, k, s, n.columnKeyMap) ?? (d ? u : void 0);
|
|
816
816
|
if (!K) return;
|
|
817
|
-
const
|
|
818
|
-
c.push({ part:
|
|
819
|
-
},
|
|
817
|
+
const $e = k === "metric" ? i(K, j(p)) : i(K, p.dataType);
|
|
818
|
+
c.push({ part: re, key: K, type: $e });
|
|
819
|
+
}, I = o.metricColumns ?? [];
|
|
820
820
|
if (e.get.kind === "aggregate") {
|
|
821
|
-
const
|
|
822
|
-
return
|
|
821
|
+
const p = I[0] ? (C = H(n.comparisonMetadata, I[0])) == null ? void 0 : C.output.currentColumnKey : void 0;
|
|
822
|
+
return p && s.has(p) ? c.push({ part: S, key: p, type: i(p, j(I[0])) }) : I[0] && m(I[0], "metric", S), c;
|
|
823
823
|
}
|
|
824
|
-
const
|
|
824
|
+
const y = o.groupByColumns ?? [];
|
|
825
825
|
if (e.get.kind === "list")
|
|
826
|
-
return
|
|
827
|
-
for (const
|
|
828
|
-
for (const
|
|
826
|
+
return y[0] && m(y[0], "groupby", S), c;
|
|
827
|
+
for (const p of y) m(p, "groupby", p.name);
|
|
828
|
+
for (const p of I) m(p, "metric", p.name);
|
|
829
829
|
return c;
|
|
830
830
|
}
|
|
831
831
|
function W(e, t) {
|
|
@@ -834,9 +834,9 @@ function W(e, t) {
|
|
|
834
834
|
function w(e) {
|
|
835
835
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function _n(e) {
|
|
838
838
|
if (!w(e)) return {};
|
|
839
|
-
const t = w(e.data) ? e.data : e, n =
|
|
839
|
+
const t = w(e.data) ? e.data : e, n = D(e).length ? D(e) : D(t), r = w(t.metadata) ? t.metadata : void 0;
|
|
840
840
|
return {
|
|
841
841
|
...t.records !== void 0 ? { records: t.records } : {},
|
|
842
842
|
...Array.isArray(t.columns) ? { columns: t.columns } : {},
|
|
@@ -846,21 +846,21 @@ function Mn(e) {
|
|
|
846
846
|
...typeof t.error == "string" && t.error ? { error: t.error } : {}
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Fn(e, t, n = "answer") {
|
|
850
850
|
var d;
|
|
851
851
|
const r = (Array.isArray(t.records) ? t.records : []).filter(
|
|
852
|
-
(
|
|
853
|
-
), s =
|
|
852
|
+
(m) => !!m && typeof m == "object"
|
|
853
|
+
), s = D(t), a = n === "preview" ? { matched: r.length > R ? "beyondCap" : r.length } : {};
|
|
854
854
|
if (!r.length) return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
855
|
-
const i =
|
|
855
|
+
const i = gt(e, r, t);
|
|
856
856
|
if (e.get.kind === "list") {
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
859
|
-
const
|
|
857
|
+
const m = i[0], I = r.length > R, y = m ? r.map((h) => W(h[m.key], m.type)).filter((h) => h.value !== null) : [];
|
|
858
|
+
if (!y.length && !I) return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
859
|
+
const l = Math.max(1, e.get.limit ?? pt);
|
|
860
860
|
return {
|
|
861
861
|
status: "listed",
|
|
862
|
-
items:
|
|
863
|
-
more:
|
|
862
|
+
items: y.slice(0, l),
|
|
863
|
+
more: I ? "beyondCap" : Math.max(0, y.length - l),
|
|
864
864
|
filterReach: s,
|
|
865
865
|
...a
|
|
866
866
|
};
|
|
@@ -868,11 +868,11 @@ function Rn(e, t, n = "answer") {
|
|
|
868
868
|
if (e.get.kind === "only" && r.length > 1)
|
|
869
869
|
return { status: "none", why: "moreThanOne", filterReach: s, ...a };
|
|
870
870
|
const o = r[0], c = Object.fromEntries(
|
|
871
|
-
i.map((
|
|
871
|
+
i.map((m) => [m.part, W(o[m.key], m.type)])
|
|
872
872
|
);
|
|
873
873
|
if (e.get.kind === "aggregate" && ((d = c[S]) == null ? void 0 : d.value) == null)
|
|
874
874
|
return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
875
|
-
const u =
|
|
875
|
+
const u = Z(e) ? kt(e, o, t) : void 0;
|
|
876
876
|
return {
|
|
877
877
|
status: "answered",
|
|
878
878
|
parts: u && "parts" in u ? { ...c, ...u.parts } : c,
|
|
@@ -881,14 +881,14 @@ function Rn(e, t, n = "answer") {
|
|
|
881
881
|
...a
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function kt(e, t, n) {
|
|
885
885
|
var o, c;
|
|
886
|
-
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], s = r ?
|
|
886
|
+
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], s = r ? H(n.comparisonMetadata, r) : void 0, a = s == null ? void 0 : s.output;
|
|
887
887
|
if (!a || a.availability.status !== "available" || !a.comparisonColumnKey)
|
|
888
888
|
return { unavailable: (a == null ? void 0 : a.availability.status) === "unavailable" ? a.availability.reason : "temporal_binding_missing" };
|
|
889
889
|
const i = (u) => {
|
|
890
|
-
const d = t[u],
|
|
891
|
-
return W(typeof
|
|
890
|
+
const d = t[u], m = typeof d == "string" && d.trim() !== "" ? Number(d) : d;
|
|
891
|
+
return W(typeof m == "number" && !Number.isFinite(m) ? null : m, "number");
|
|
892
892
|
};
|
|
893
893
|
return {
|
|
894
894
|
parts: {
|
|
@@ -898,16 +898,16 @@ function Ct(e, t, n) {
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
const
|
|
902
|
-
function
|
|
903
|
-
const t =
|
|
901
|
+
const he = /* @__PURE__ */ new WeakMap();
|
|
902
|
+
function ee(e) {
|
|
903
|
+
const t = he.get(e);
|
|
904
904
|
if (t) return t;
|
|
905
905
|
const n = new Map(
|
|
906
906
|
(e.sheets ?? []).map(
|
|
907
907
|
(a) => [a.id, a.kind === "document" ? "document" : "dashboard"]
|
|
908
908
|
)
|
|
909
909
|
), r = [
|
|
910
|
-
...
|
|
910
|
+
...F(e).map(
|
|
911
911
|
(a) => ({
|
|
912
912
|
kind: "card",
|
|
913
913
|
id: a.cardId,
|
|
@@ -922,22 +922,22 @@ function Z(e) {
|
|
|
922
922
|
kind: "variable",
|
|
923
923
|
id: a.id,
|
|
924
924
|
variable: a,
|
|
925
|
-
card:
|
|
925
|
+
card: It(a)
|
|
926
926
|
})
|
|
927
927
|
)
|
|
928
928
|
], s = { targets: r, byId: new Map(r.map((a) => [a.id, a])) };
|
|
929
|
-
return
|
|
929
|
+
return he.set(e, s), s;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
931
|
+
function wt(e) {
|
|
932
|
+
return ee(e).targets;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
934
|
+
function Vn(e, t) {
|
|
935
|
+
return ee(e).byId.get(t);
|
|
936
936
|
}
|
|
937
|
-
function
|
|
938
|
-
return
|
|
937
|
+
function At(e, t) {
|
|
938
|
+
return ee(e).byId.has(t);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function vt(e, t) {
|
|
941
941
|
return t.kind === "card" ? [
|
|
942
942
|
{
|
|
943
943
|
sheetId: t.sheetId,
|
|
@@ -945,22 +945,22 @@ function wt(e, t) {
|
|
|
945
945
|
sheetKind: t.sheetKind,
|
|
946
946
|
...t.sectionId ? { sectionId: t.sectionId } : {}
|
|
947
947
|
}
|
|
948
|
-
] :
|
|
948
|
+
] : Ae(e, t.id);
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
return
|
|
952
|
-
(r) =>
|
|
950
|
+
function Tt(e, t, n) {
|
|
951
|
+
return vt(e, n).some(
|
|
952
|
+
(r) => g(t, r)
|
|
953
953
|
);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
return
|
|
957
|
-
(n) => n.kind === "variable" &&
|
|
955
|
+
function $n(e, t) {
|
|
956
|
+
return wt(e).filter(
|
|
957
|
+
(n) => n.kind === "variable" && Tt(e, t, n)
|
|
958
958
|
);
|
|
959
959
|
}
|
|
960
|
-
const
|
|
961
|
-
function
|
|
960
|
+
const Et = ["new", "edit", "delete", "create", "update", "remove"];
|
|
961
|
+
function Oe(e, t) {
|
|
962
962
|
return (e.sheets || []).flatMap(
|
|
963
|
-
(n) =>
|
|
963
|
+
(n) => F({ sheets: [n] }).filter(t).map((r) => ({
|
|
964
964
|
card: r.card,
|
|
965
965
|
sheet: n,
|
|
966
966
|
...r.kind === "frameCard" && { frameId: r.frameId },
|
|
@@ -971,22 +971,22 @@ function Ke(e, t) {
|
|
|
971
971
|
);
|
|
972
972
|
}
|
|
973
973
|
function T(e) {
|
|
974
|
-
return
|
|
974
|
+
return Oe(e, (t) => t.kind !== "documentSectionCard");
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function Pn(e) {
|
|
977
977
|
return [
|
|
978
978
|
...T(e),
|
|
979
|
-
...
|
|
979
|
+
...Oe(e, (t) => t.kind === "documentSectionCard")
|
|
980
980
|
];
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function Ln(e) {
|
|
983
983
|
return T(e).map((t) => t.card);
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
return n && t === n ? !0 : !
|
|
985
|
+
function qn(e, t, n) {
|
|
986
|
+
return n && t === n ? !0 : !At(e, t);
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ?
|
|
988
|
+
function jn(e) {
|
|
989
|
+
return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? Et.includes(e.toLowerCase()) ? {
|
|
990
990
|
isValid: !1,
|
|
991
991
|
error: `"${e}" is a reserved keyword and cannot be used`
|
|
992
992
|
} : { isValid: !0 } : {
|
|
@@ -997,27 +997,27 @@ function Ln(e) {
|
|
|
997
997
|
error: "Card ID can only contain letters, numbers, hyphens, and underscores"
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Bn(e, t) {
|
|
1001
1001
|
var n;
|
|
1002
|
-
return (n =
|
|
1002
|
+
return (n = Kt(e, t)) == null ? void 0 : n.card;
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function Kt(e, t) {
|
|
1005
1005
|
for (const n of T(e))
|
|
1006
1006
|
if (n.card.id === t)
|
|
1007
1007
|
return n;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function Un(e, t) {
|
|
1010
1010
|
for (const n of e.sheets || [])
|
|
1011
1011
|
for (const r of n.frames || [])
|
|
1012
1012
|
for (const s of r.cards || [])
|
|
1013
1013
|
if (s.id === t)
|
|
1014
1014
|
return { card: s, sheet: n };
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1016
|
+
const _ = {
|
|
1017
1017
|
includeMetricFilterDatasets: !0,
|
|
1018
1018
|
preferQualifiedIdentity: !1
|
|
1019
1019
|
};
|
|
1020
|
-
function
|
|
1020
|
+
function Q(e) {
|
|
1021
1021
|
if (!e) return;
|
|
1022
1022
|
if (e.kind === "semantic")
|
|
1023
1023
|
return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
|
|
@@ -1028,12 +1028,12 @@ function De(e) {
|
|
|
1028
1028
|
label: e.label
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Nt(e) {
|
|
1032
1032
|
var n;
|
|
1033
|
-
const t =
|
|
1033
|
+
const t = Q(e.source);
|
|
1034
1034
|
return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Ot(e) {
|
|
1037
1037
|
return [
|
|
1038
1038
|
e.id,
|
|
1039
1039
|
e.qualifiedEntityName,
|
|
@@ -1043,36 +1043,36 @@ function Kt(e) {
|
|
|
1043
1043
|
e.name,
|
|
1044
1044
|
// Source-only fields from different datasets can otherwise share a key
|
|
1045
1045
|
// and the second dataset would be silently dropped.
|
|
1046
|
-
|
|
1046
|
+
Nt(e)
|
|
1047
1047
|
].join("|");
|
|
1048
1048
|
}
|
|
1049
1049
|
function Dt(e) {
|
|
1050
1050
|
return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function zn(e) {
|
|
1053
1053
|
return e.entityName || e.qualifiedEntityName || "";
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Mt(e) {
|
|
1056
1056
|
var t, n;
|
|
1057
1057
|
return !!(e.expression || e.derivedField || (n = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && n.length);
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
return
|
|
1059
|
+
function xt(e) {
|
|
1060
|
+
return Le(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Mt(e);
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function N(e, t) {
|
|
1063
1063
|
const n = Dt(t);
|
|
1064
1064
|
e.found.has(n) || e.found.set(n, t);
|
|
1065
1065
|
}
|
|
1066
1066
|
function E(e, t) {
|
|
1067
|
-
var
|
|
1067
|
+
var d, m, I;
|
|
1068
1068
|
if (!e) return;
|
|
1069
|
-
const n =
|
|
1069
|
+
const n = Ot(e);
|
|
1070
1070
|
if (t.visitedFields.has(n)) return;
|
|
1071
1071
|
t.visitedFields.add(n);
|
|
1072
|
-
const r =
|
|
1072
|
+
const r = xt(e);
|
|
1073
1073
|
if (!r) {
|
|
1074
|
-
const y = !e.entityName && !e.qualifiedEntityName ?
|
|
1075
|
-
|
|
1074
|
+
const y = !e.entityName && !e.qualifiedEntityName ? Q(e.source) : void 0;
|
|
1075
|
+
N(
|
|
1076
1076
|
t,
|
|
1077
1077
|
y || {
|
|
1078
1078
|
// May be empty for qualified-only metadata; identity then comes from
|
|
@@ -1084,50 +1084,51 @@ function E(e, t) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
);
|
|
1086
1086
|
}
|
|
1087
|
-
t.includeMetricFilterDatasets && "parameters" in e && ((
|
|
1088
|
-
const s = (
|
|
1087
|
+
t.includeMetricFilterDatasets && "parameters" in e && ((d = e.parameters) != null && d.filters) && te(e.parameters.filters, t);
|
|
1088
|
+
const s = (m = e.calculatedFormula) == null ? void 0 : m.inputFields, a = !!(s && s.length > 0);
|
|
1089
1089
|
a && s.forEach((y) => E(y, t));
|
|
1090
1090
|
let i = !1, o = !1;
|
|
1091
|
-
const c = a || (
|
|
1091
|
+
const c = a || (I = e.derivedField) == null ? void 0 : I.inputs;
|
|
1092
1092
|
if (c && Object.keys(c).length > 0)
|
|
1093
1093
|
for (const y of Object.values(c)) {
|
|
1094
|
-
const
|
|
1095
|
-
if (!
|
|
1094
|
+
const l = y.field.source;
|
|
1095
|
+
if (!l) {
|
|
1096
1096
|
a || (o = !0);
|
|
1097
1097
|
continue;
|
|
1098
1098
|
}
|
|
1099
|
-
if (
|
|
1099
|
+
if (l.kind === "sql") {
|
|
1100
1100
|
o = !0;
|
|
1101
1101
|
continue;
|
|
1102
1102
|
}
|
|
1103
|
-
if (
|
|
1104
|
-
|
|
1105
|
-
entityName:
|
|
1106
|
-
entityId:
|
|
1107
|
-
label:
|
|
1103
|
+
if (l.kind === "semantic")
|
|
1104
|
+
N(t, {
|
|
1105
|
+
entityName: l.datasetName,
|
|
1106
|
+
entityId: l.datasetId,
|
|
1107
|
+
label: l.label
|
|
1108
1108
|
});
|
|
1109
1109
|
else {
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
entityName:
|
|
1113
|
-
qualifiedEntityName:
|
|
1114
|
-
label:
|
|
1110
|
+
const h = [l.databaseName, l.schemaName, l.tableName].filter((C) => !!(C && C.trim())).join(".");
|
|
1111
|
+
N(t, {
|
|
1112
|
+
entityName: l.tableName,
|
|
1113
|
+
qualifiedEntityName: h.includes(".") ? h : void 0,
|
|
1114
|
+
label: l.label
|
|
1115
1115
|
});
|
|
1116
1116
|
}
|
|
1117
1117
|
i = !0;
|
|
1118
1118
|
}
|
|
1119
|
-
|
|
1119
|
+
const u = r && !a && !(c && Object.keys(c).length > 0) ? Q(e.source) : void 0;
|
|
1120
|
+
(u != null && u.entityName || u != null && u.qualifiedEntityName) && (N(t, u), i = !0), o && (t.complete = !1), r && !a && !i && (t.complete = !1);
|
|
1120
1121
|
}
|
|
1121
|
-
function
|
|
1122
|
+
function te(e, t) {
|
|
1122
1123
|
if (e && !t.visitedGroups.has(e.id)) {
|
|
1123
1124
|
t.visitedGroups.add(e.id);
|
|
1124
1125
|
for (const n of e.conditions || [])
|
|
1125
1126
|
E(n.field, t);
|
|
1126
1127
|
for (const n of e.groups || [])
|
|
1127
|
-
|
|
1128
|
+
te(n, t);
|
|
1128
1129
|
}
|
|
1129
1130
|
}
|
|
1130
|
-
function
|
|
1131
|
+
function V(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
1131
1132
|
return {
|
|
1132
1133
|
found: /* @__PURE__ */ new Map(),
|
|
1133
1134
|
complete: !0,
|
|
@@ -1136,54 +1137,54 @@ function F(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
|
1136
1137
|
includeMetricFilterDatasets: e
|
|
1137
1138
|
};
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
+
function ne(e, t) {
|
|
1140
1141
|
var r;
|
|
1141
1142
|
const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
|
|
1142
1143
|
return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
|
|
1143
1144
|
}
|
|
1144
|
-
function
|
|
1145
|
-
const t =
|
|
1145
|
+
function Wn(e) {
|
|
1146
|
+
const t = V(!1);
|
|
1146
1147
|
return E(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
|
|
1147
1148
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const a = { ...
|
|
1149
|
+
function De(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = _) {
|
|
1150
|
+
const a = { ..._, ...s }, i = V(a.includeMetricFilterDatasets, n, r);
|
|
1150
1151
|
E(e, i), i.found.forEach((o) => {
|
|
1151
|
-
const c =
|
|
1152
|
+
const c = ne(o, a.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1152
1153
|
c && t.add(c);
|
|
1153
1154
|
});
|
|
1154
1155
|
}
|
|
1155
|
-
function
|
|
1156
|
-
|
|
1156
|
+
function Qn(e, t) {
|
|
1157
|
+
De(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
|
|
1157
1158
|
preferQualifiedIdentity: !0
|
|
1158
1159
|
});
|
|
1159
1160
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const s =
|
|
1161
|
+
function Yn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1162
|
+
const s = V(!0, n, r);
|
|
1162
1163
|
E(e, s), s.found.forEach((a) => {
|
|
1163
|
-
const i =
|
|
1164
|
+
const i = ne(a, "qualifiedOnly");
|
|
1164
1165
|
i && t.add(i);
|
|
1165
1166
|
});
|
|
1166
1167
|
}
|
|
1167
|
-
function
|
|
1168
|
-
|
|
1168
|
+
function Gn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1169
|
+
De(e, t, n, r, {
|
|
1169
1170
|
includeMetricFilterDatasets: !1
|
|
1170
1171
|
});
|
|
1171
1172
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const a = { ...
|
|
1174
|
-
|
|
1175
|
-
const c =
|
|
1173
|
+
function Jn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = _) {
|
|
1174
|
+
const a = { ..._, ...s }, i = V(a.includeMetricFilterDatasets, n, r);
|
|
1175
|
+
te(e, i), i.found.forEach((o) => {
|
|
1176
|
+
const c = ne(o, a.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1176
1177
|
c && t.add(c);
|
|
1177
1178
|
});
|
|
1178
1179
|
}
|
|
1179
|
-
function
|
|
1180
|
+
function Hn(e, t) {
|
|
1180
1181
|
return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1181
1182
|
}
|
|
1182
|
-
const
|
|
1183
|
+
const Xn = {
|
|
1183
1184
|
database: null,
|
|
1184
1185
|
schema: null,
|
|
1185
1186
|
table: null
|
|
1186
|
-
},
|
|
1187
|
+
}, Zn = "__card_default__", Y = {
|
|
1187
1188
|
bookmarksPerViewerPerDashboard: 20,
|
|
1188
1189
|
bookmarkNameMaxChars: 100,
|
|
1189
1190
|
columnLabelMaxChars: 120,
|
|
@@ -1191,11 +1192,11 @@ const Jn = {
|
|
|
1191
1192
|
tableSettingsMaxBytes: 65536,
|
|
1192
1193
|
rememberedTableSettingsMaxBytes: 262144,
|
|
1193
1194
|
bookmarkStateMaxBytes: 65536
|
|
1194
|
-
},
|
|
1195
|
-
function
|
|
1195
|
+
}, Me = 1;
|
|
1196
|
+
function er(e) {
|
|
1196
1197
|
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
1197
1198
|
}
|
|
1198
|
-
function
|
|
1199
|
+
function Rt(e) {
|
|
1199
1200
|
const t = encodeURIComponent;
|
|
1200
1201
|
switch (e.kind) {
|
|
1201
1202
|
case "dimension":
|
|
@@ -1208,7 +1209,7 @@ function xt(e) {
|
|
|
1208
1209
|
return `result:${t(e.key)}`;
|
|
1209
1210
|
}
|
|
1210
1211
|
}
|
|
1211
|
-
function
|
|
1212
|
+
function O(e) {
|
|
1212
1213
|
if (e)
|
|
1213
1214
|
try {
|
|
1214
1215
|
return decodeURIComponent(e);
|
|
@@ -1216,47 +1217,47 @@ function D(e) {
|
|
|
1216
1217
|
return;
|
|
1217
1218
|
}
|
|
1218
1219
|
}
|
|
1219
|
-
function
|
|
1220
|
+
function _t(e) {
|
|
1220
1221
|
if (typeof e != "string") return;
|
|
1221
1222
|
const t = e.split(":");
|
|
1222
1223
|
let n;
|
|
1223
1224
|
if (t[0] === "dim" && t.length === 3) {
|
|
1224
|
-
const r = t[1], s =
|
|
1225
|
+
const r = t[1], s = O(t[2]);
|
|
1225
1226
|
(r === "detail" || r === "groupby") && s && (n = { kind: "dimension", role: r, fieldId: s });
|
|
1226
1227
|
} else if (t[0] === "metric" && t.length === 3) {
|
|
1227
|
-
const r =
|
|
1228
|
+
const r = O(t[1]), s = O(t[2]);
|
|
1228
1229
|
r && s && (n = { kind: "metric", metricId: r, metricAlias: s });
|
|
1229
1230
|
} else if (t[0] === "result" && t.length === 2) {
|
|
1230
|
-
const r =
|
|
1231
|
+
const r = O(t[1]);
|
|
1231
1232
|
r && (n = { kind: "result", key: r });
|
|
1232
1233
|
}
|
|
1233
|
-
return n &&
|
|
1234
|
-
}
|
|
1235
|
-
function
|
|
1236
|
-
return typeof e == "string" &&
|
|
1237
|
-
}
|
|
1238
|
-
const
|
|
1239
|
-
order:
|
|
1240
|
-
hidden:
|
|
1241
|
-
labels:
|
|
1242
|
-
sort:
|
|
1243
|
-
|
|
1244
|
-
columnId:
|
|
1245
|
-
direction:
|
|
1234
|
+
return n && Rt(n) === e ? n : void 0;
|
|
1235
|
+
}
|
|
1236
|
+
function M(e) {
|
|
1237
|
+
return typeof e == "string" && _t(e) !== void 0;
|
|
1238
|
+
}
|
|
1239
|
+
const ye = f.array(f.string()).max(2e3), Ft = f.object({
|
|
1240
|
+
order: ye.optional(),
|
|
1241
|
+
hidden: ye.optional(),
|
|
1242
|
+
labels: f.record(f.string(), f.string().max(Y.columnLabelMaxChars)).optional(),
|
|
1243
|
+
sort: f.array(
|
|
1244
|
+
f.object({
|
|
1245
|
+
columnId: f.string(),
|
|
1246
|
+
direction: f.enum(["asc", "desc"])
|
|
1246
1247
|
}).strict()
|
|
1247
1248
|
).max(2e3).optional(),
|
|
1248
|
-
widths:
|
|
1249
|
-
|
|
1250
|
-
|
|
1249
|
+
widths: f.record(
|
|
1250
|
+
f.string(),
|
|
1251
|
+
f.number().int().min(1).max(Y.columnWidthMaxPx)
|
|
1251
1252
|
).optional()
|
|
1252
1253
|
}).strict();
|
|
1253
1254
|
function G(e) {
|
|
1254
1255
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1255
1256
|
for (const r of e)
|
|
1256
|
-
!
|
|
1257
|
+
!M(r) || t.has(r) || (t.add(r), n.push(r));
|
|
1257
1258
|
return n;
|
|
1258
1259
|
}
|
|
1259
|
-
function
|
|
1260
|
+
function tr(e) {
|
|
1260
1261
|
if (!Array.isArray(e)) return;
|
|
1261
1262
|
const t = G(
|
|
1262
1263
|
e.filter((n) => typeof n == "string")
|
|
@@ -1268,74 +1269,74 @@ function xe(e) {
|
|
|
1268
1269
|
const t = e.order ? G(e.order) : void 0, n = e.hidden ? G(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
|
|
1269
1270
|
([c, u]) => {
|
|
1270
1271
|
const d = typeof u == "string" ? u.trim() : "";
|
|
1271
|
-
return
|
|
1272
|
+
return M(c) && d ? [
|
|
1272
1273
|
[
|
|
1273
1274
|
c,
|
|
1274
|
-
d.slice(0,
|
|
1275
|
+
d.slice(0, Y.columnLabelMaxChars)
|
|
1275
1276
|
]
|
|
1276
1277
|
] : [];
|
|
1277
1278
|
}
|
|
1278
|
-
), s = /* @__PURE__ */ new Set(), a = e.sort ? e.sort.filter((c) => !
|
|
1279
|
-
([c]) =>
|
|
1279
|
+
), s = /* @__PURE__ */ new Set(), a = e.sort ? e.sort.filter((c) => !M(c.columnId) || s.has(c.columnId) ? !1 : (s.add(c.columnId), !0)) : void 0, i = Object.entries(e.widths ?? {}).filter(
|
|
1280
|
+
([c]) => M(c)
|
|
1280
1281
|
), o = {};
|
|
1281
1282
|
return t != null && t.length && (o.order = t), n != null && n.length && (o.hidden = n), r.length && (o.labels = Object.fromEntries(r)), a && (o.sort = a.map(({ columnId: c, direction: u }) => ({
|
|
1282
1283
|
columnId: c,
|
|
1283
1284
|
direction: u
|
|
1284
1285
|
}))), i.length && (o.widths = Object.fromEntries(i)), Object.keys(o).length ? o : void 0;
|
|
1285
1286
|
}
|
|
1286
|
-
function
|
|
1287
|
+
function nr(e) {
|
|
1287
1288
|
var t, n;
|
|
1288
1289
|
return !!((t = e == null ? void 0 : e.order) != null && t.length) || !!((n = e == null ? void 0 : e.hidden) != null && n.length) || Object.keys((e == null ? void 0 : e.labels) ?? {}).length > 0 || Object.keys((e == null ? void 0 : e.widths) ?? {}).length > 0;
|
|
1289
1290
|
}
|
|
1290
|
-
function
|
|
1291
|
+
function Re(e) {
|
|
1291
1292
|
return xe(e) === void 0;
|
|
1292
1293
|
}
|
|
1293
|
-
function
|
|
1294
|
-
if (t !==
|
|
1294
|
+
function _e(e, t) {
|
|
1295
|
+
if (t !== Me)
|
|
1295
1296
|
return {
|
|
1296
1297
|
ok: !1,
|
|
1297
1298
|
error: `Unsupported table settings version ${t}.`
|
|
1298
1299
|
};
|
|
1299
|
-
const n =
|
|
1300
|
+
const n = Ft.safeParse(e);
|
|
1300
1301
|
return n.success ? {
|
|
1301
1302
|
ok: !0,
|
|
1302
1303
|
value: xe(n.data) ?? {}
|
|
1303
1304
|
} : { ok: !1, error: "Table settings are invalid." };
|
|
1304
1305
|
}
|
|
1305
|
-
function
|
|
1306
|
+
function rr(e, t, n) {
|
|
1306
1307
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
1307
1308
|
const r = {};
|
|
1308
1309
|
for (const [s, a] of Object.entries(
|
|
1309
1310
|
e
|
|
1310
1311
|
)) {
|
|
1311
1312
|
if (!n.has(s)) continue;
|
|
1312
|
-
const i =
|
|
1313
|
-
i.ok && !
|
|
1313
|
+
const i = _e(a, t);
|
|
1314
|
+
i.ok && !Re(i.value) && (r[s] = i.value);
|
|
1314
1315
|
}
|
|
1315
1316
|
return r;
|
|
1316
1317
|
}
|
|
1317
|
-
const
|
|
1318
|
+
const Vt = /* @__PURE__ */ new Set([
|
|
1318
1319
|
"table",
|
|
1319
1320
|
"detailTable"
|
|
1320
1321
|
]);
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1322
|
+
function Fe(e) {
|
|
1323
|
+
return Vt.has(e.type);
|
|
1323
1324
|
}
|
|
1324
|
-
function
|
|
1325
|
+
function $t(e) {
|
|
1325
1326
|
var t, n;
|
|
1326
|
-
return
|
|
1327
|
+
return Fe(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
|
|
1327
1328
|
}
|
|
1328
|
-
function
|
|
1329
|
+
function sr(e) {
|
|
1329
1330
|
return new Set(
|
|
1330
|
-
T(e).filter(({ card: t }) =>
|
|
1331
|
+
T(e).filter(({ card: t }) => Fe(t)).map(({ card: t }) => t.id)
|
|
1331
1332
|
);
|
|
1332
1333
|
}
|
|
1333
|
-
function
|
|
1334
|
+
function ar(e) {
|
|
1334
1335
|
return new Set(
|
|
1335
|
-
T(e).filter(({ card: t }) =>
|
|
1336
|
+
T(e).filter(({ card: t }) => $t(t)).map(({ card: t }) => t.id)
|
|
1336
1337
|
);
|
|
1337
1338
|
}
|
|
1338
|
-
const
|
|
1339
|
+
const Pt = {
|
|
1339
1340
|
date: /* @__PURE__ */ new Set([
|
|
1340
1341
|
"between",
|
|
1341
1342
|
"not between",
|
|
@@ -1374,14 +1375,14 @@ const Vt = {
|
|
|
1374
1375
|
]),
|
|
1375
1376
|
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
1376
1377
|
};
|
|
1377
|
-
function
|
|
1378
|
-
const t =
|
|
1378
|
+
function Lt(e) {
|
|
1379
|
+
const t = J(e);
|
|
1379
1380
|
return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
|
|
1380
1381
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return typeof t != "string" ? !1 :
|
|
1382
|
+
function ir(e, t) {
|
|
1383
|
+
return typeof t != "string" ? !1 : Pt[Lt(e)].has(t);
|
|
1383
1384
|
}
|
|
1384
|
-
const
|
|
1385
|
+
const qt = /* @__PURE__ */ new Set([
|
|
1385
1386
|
"=",
|
|
1386
1387
|
">",
|
|
1387
1388
|
"<",
|
|
@@ -1397,26 +1398,26 @@ const Pt = /* @__PURE__ */ new Set([
|
|
|
1397
1398
|
"is null",
|
|
1398
1399
|
"is not null"
|
|
1399
1400
|
]);
|
|
1400
|
-
function
|
|
1401
|
+
function jt(e, t) {
|
|
1401
1402
|
return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
1402
1403
|
}
|
|
1403
|
-
function
|
|
1404
|
-
const s =
|
|
1405
|
-
if (s &&
|
|
1404
|
+
function Bt(e, t, n, r) {
|
|
1405
|
+
const s = qe(e.relativeMeta);
|
|
1406
|
+
if (s && Ye(s).dataAnchored) {
|
|
1406
1407
|
r.push(
|
|
1407
1408
|
`${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
|
|
1408
1409
|
);
|
|
1409
1410
|
return;
|
|
1410
1411
|
}
|
|
1411
|
-
if (s && !
|
|
1412
|
+
if (s && !je(String(e.operation), s)) {
|
|
1412
1413
|
r.push(
|
|
1413
1414
|
`${n}.relativeMeta runs only under between, not between, before, after, on or before, or on or after.`
|
|
1414
1415
|
);
|
|
1415
1416
|
return;
|
|
1416
1417
|
}
|
|
1417
|
-
|
|
1418
|
+
Ut(e.operation, e.values, t, `${n}.values`, r);
|
|
1418
1419
|
}
|
|
1419
|
-
function
|
|
1420
|
+
function Ut(e, t, n, r, s) {
|
|
1420
1421
|
if (e === "is null" || e === "is not null") {
|
|
1421
1422
|
t.length !== 0 && s.push(`${r} must be empty for null filter operations.`);
|
|
1422
1423
|
return;
|
|
@@ -1442,46 +1443,46 @@ function Bt(e, t, n, r, s) {
|
|
|
1442
1443
|
return;
|
|
1443
1444
|
}
|
|
1444
1445
|
for (const a of t)
|
|
1445
|
-
if (!
|
|
1446
|
+
if (!jt(a, n)) {
|
|
1446
1447
|
s.push(
|
|
1447
1448
|
`${r} contains a value that is incompatible with valueType '${n}'.`
|
|
1448
1449
|
);
|
|
1449
1450
|
return;
|
|
1450
1451
|
}
|
|
1451
1452
|
}
|
|
1452
|
-
const L = 1,
|
|
1453
|
-
filterId:
|
|
1454
|
-
name:
|
|
1455
|
-
operation:
|
|
1456
|
-
valueType:
|
|
1457
|
-
values:
|
|
1453
|
+
const L = 1, or = ["PRIVATE", "TEAM", "DASHBOARD"], zt = f.object({
|
|
1454
|
+
filterId: f.string().min(1),
|
|
1455
|
+
name: f.string(),
|
|
1456
|
+
operation: f.string(),
|
|
1457
|
+
valueType: f.enum(["string", "number", "date", "boolean"]),
|
|
1458
|
+
values: f.array(f.unknown())
|
|
1458
1459
|
}).passthrough().superRefine((e, t) => {
|
|
1459
1460
|
const n = [];
|
|
1460
|
-
|
|
1461
|
+
qt.has(e.operation) ? Bt(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
|
|
1461
1462
|
for (const r of n) t.addIssue({ code: "custom", message: r });
|
|
1462
|
-
}), q =
|
|
1463
|
-
for (const n of
|
|
1463
|
+
}), q = f.unknown().superRefine((e, t) => {
|
|
1464
|
+
for (const n of Ge(e).errors)
|
|
1464
1465
|
t.addIssue({ code: "custom", message: n.message });
|
|
1465
|
-
}),
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
kind:
|
|
1466
|
+
}), Wt = f.discriminatedUnion("kind", [
|
|
1467
|
+
f.object({ kind: f.literal("filter"), filterValue: zt }).strict(),
|
|
1468
|
+
f.object({ kind: f.literal("control"), value: f.unknown() }).strict(),
|
|
1469
|
+
f.object({
|
|
1470
|
+
kind: f.literal("selection"),
|
|
1470
1471
|
selection: Be
|
|
1471
1472
|
}).strict()
|
|
1472
|
-
]),
|
|
1473
|
-
|
|
1474
|
-
status:
|
|
1475
|
-
value:
|
|
1473
|
+
]), Qt = f.union([
|
|
1474
|
+
f.object({
|
|
1475
|
+
status: f.literal("set"),
|
|
1476
|
+
value: Wt,
|
|
1476
1477
|
comparisonSelection: q.optional()
|
|
1477
1478
|
}).strict(),
|
|
1478
|
-
|
|
1479
|
-
status:
|
|
1479
|
+
f.object({
|
|
1480
|
+
status: f.literal("cleared"),
|
|
1480
1481
|
comparisonSelection: q.optional()
|
|
1481
1482
|
}).strict(),
|
|
1482
|
-
|
|
1483
|
-
]),
|
|
1484
|
-
function
|
|
1483
|
+
f.object({ comparisonSelection: q }).strict()
|
|
1484
|
+
]), Ve = ["bySheetId", "byCardId", "byDocumentSectionId"], Yt = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), Gt = /* @__PURE__ */ new Set(["shared", ...Ve]), A = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
1485
|
+
function Ie(e, t, n) {
|
|
1485
1486
|
if (e === void 0) return;
|
|
1486
1487
|
if (!A(e)) {
|
|
1487
1488
|
t.push({ target: "input", id: n });
|
|
@@ -1489,30 +1490,30 @@ function ye(e, t, n) {
|
|
|
1489
1490
|
}
|
|
1490
1491
|
const r = {};
|
|
1491
1492
|
for (const [s, a] of Object.entries(e)) {
|
|
1492
|
-
const i = s ?
|
|
1493
|
+
const i = s ? Qt.safeParse(a) : void 0;
|
|
1493
1494
|
i != null && i.success ? r[s] = i.data : t.push({
|
|
1494
|
-
target:
|
|
1495
|
+
target: Ue(s) ? "selection" : "input",
|
|
1495
1496
|
id: s
|
|
1496
1497
|
});
|
|
1497
1498
|
}
|
|
1498
1499
|
return Object.keys(r).length ? r : void 0;
|
|
1499
1500
|
}
|
|
1500
|
-
function
|
|
1501
|
+
function Jt(e, t) {
|
|
1501
1502
|
if (t !== L)
|
|
1502
1503
|
return { ok: !1, error: `Unsupported bookmark version ${t}.` };
|
|
1503
1504
|
if (!A(e) || e.version !== L)
|
|
1504
1505
|
return { ok: !1, error: "The bookmark state is invalid." };
|
|
1505
|
-
const n = [], r = Object.keys(e).filter((o) => !
|
|
1506
|
+
const n = [], r = Object.keys(e).filter((o) => !Yt.has(o));
|
|
1506
1507
|
let s;
|
|
1507
1508
|
typeof e.selectedSheetId == "string" && e.selectedSheetId ? s = e.selectedSheetId : e.selectedSheetId !== void 0 && n.push({ target: "sheet", id: String(e.selectedSheetId) });
|
|
1508
1509
|
const a = {};
|
|
1509
1510
|
if (A(e.inputs)) {
|
|
1510
1511
|
r.push(
|
|
1511
|
-
...Object.keys(e.inputs).filter((c) => !
|
|
1512
|
+
...Object.keys(e.inputs).filter((c) => !Gt.has(c)).map((c) => `inputs.${c}`)
|
|
1512
1513
|
);
|
|
1513
|
-
const o =
|
|
1514
|
+
const o = Ie(e.inputs.shared, n, "shared");
|
|
1514
1515
|
o && (a.shared = o);
|
|
1515
|
-
for (const c of
|
|
1516
|
+
for (const c of Ve) {
|
|
1516
1517
|
const u = e.inputs[c];
|
|
1517
1518
|
if (u === void 0) continue;
|
|
1518
1519
|
if (!A(u)) {
|
|
@@ -1520,9 +1521,9 @@ function Gt(e, t) {
|
|
|
1520
1521
|
continue;
|
|
1521
1522
|
}
|
|
1522
1523
|
const d = {};
|
|
1523
|
-
for (const [
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1524
|
+
for (const [m, I] of Object.entries(u)) {
|
|
1525
|
+
const y = Ie(I, n, `${c}.${m}`);
|
|
1526
|
+
y && (d[m] = y);
|
|
1526
1527
|
}
|
|
1527
1528
|
Object.keys(d).length && (a[c] = d);
|
|
1528
1529
|
}
|
|
@@ -1530,8 +1531,8 @@ function Gt(e, t) {
|
|
|
1530
1531
|
const i = {};
|
|
1531
1532
|
if (A(e.tableSettings))
|
|
1532
1533
|
for (const [o, c] of Object.entries(e.tableSettings)) {
|
|
1533
|
-
const u = o ?
|
|
1534
|
-
u != null && u.ok ?
|
|
1534
|
+
const u = o ? _e(c, Me) : void 0;
|
|
1535
|
+
u != null && u.ok ? Re(u.value) || (i[o] = u.value) : n.push({ target: "card", id: o });
|
|
1535
1536
|
}
|
|
1536
1537
|
else e.tableSettings !== void 0 && r.push("tableSettings");
|
|
1537
1538
|
return {
|
|
@@ -1546,121 +1547,121 @@ function Gt(e, t) {
|
|
|
1546
1547
|
unknownKeys: r
|
|
1547
1548
|
};
|
|
1548
1549
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const n =
|
|
1550
|
+
function cr(e, t) {
|
|
1551
|
+
const n = Jt(e, t);
|
|
1551
1552
|
return n.ok ? n.issues.some((r) => r.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : n.issues.length || n.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: n.value } : n;
|
|
1552
1553
|
}
|
|
1553
1554
|
export {
|
|
1554
|
-
|
|
1555
|
-
|
|
1555
|
+
Nn as $,
|
|
1556
|
+
Bn as A,
|
|
1556
1557
|
L as B,
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1558
|
+
Zn as C,
|
|
1559
|
+
F as D,
|
|
1560
|
+
Xn as E,
|
|
1561
|
+
Vn as F,
|
|
1562
|
+
dn as G,
|
|
1563
|
+
g as H,
|
|
1564
|
+
pn as I,
|
|
1565
|
+
Kn as J,
|
|
1566
|
+
He as K,
|
|
1567
|
+
Kt as L,
|
|
1568
|
+
wt as M,
|
|
1569
|
+
ut as N,
|
|
1570
|
+
bn as O,
|
|
1571
|
+
fe as P,
|
|
1572
|
+
at as Q,
|
|
1573
|
+
fn as R,
|
|
1574
|
+
we as S,
|
|
1575
|
+
Cn as T,
|
|
1576
|
+
xn as U,
|
|
1577
|
+
Y as V,
|
|
1578
|
+
kn as W,
|
|
1579
|
+
X,
|
|
1580
|
+
Te as Y,
|
|
1581
|
+
mt as Z,
|
|
1582
|
+
Ee as _,
|
|
1583
|
+
zn as a,
|
|
1583
1584
|
se as a0,
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1585
|
+
ae as a1,
|
|
1586
|
+
Xe as a2,
|
|
1587
|
+
sn as a3,
|
|
1588
|
+
Ze as a4,
|
|
1589
|
+
an as a5,
|
|
1589
1590
|
mn as a6,
|
|
1590
|
-
|
|
1591
|
-
|
|
1591
|
+
hn as a7,
|
|
1592
|
+
yn as a8,
|
|
1592
1593
|
In as a9,
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1594
|
+
ir as aA,
|
|
1595
|
+
qt as aB,
|
|
1596
|
+
Bt as aC,
|
|
1597
|
+
Ln as aD,
|
|
1598
|
+
cn as aE,
|
|
1599
|
+
nt as aF,
|
|
1599
1600
|
v as aG,
|
|
1600
1601
|
T as aH,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1602
|
+
lt as aI,
|
|
1603
|
+
H as aJ,
|
|
1604
|
+
An as aK,
|
|
1605
|
+
ie as aL,
|
|
1606
|
+
vn as aM,
|
|
1607
|
+
wn as aN,
|
|
1608
|
+
En as aO,
|
|
1609
|
+
Tn as aP,
|
|
1610
|
+
Pn as aQ,
|
|
1611
|
+
et as aR,
|
|
1612
|
+
qn as aS,
|
|
1613
|
+
jn as aT,
|
|
1614
|
+
Un as aU,
|
|
1615
|
+
on as aV,
|
|
1615
1616
|
Sn as aa,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1617
|
+
gn as ab,
|
|
1618
|
+
Ke as ac,
|
|
1619
|
+
R as ad,
|
|
1620
|
+
pt as ae,
|
|
1621
|
+
S as af,
|
|
1622
|
+
Ne as ag,
|
|
1623
|
+
ht as ah,
|
|
1624
|
+
yt as ai,
|
|
1625
|
+
On as aj,
|
|
1626
|
+
Z as ak,
|
|
1627
|
+
It as al,
|
|
1628
|
+
Dn as am,
|
|
1629
|
+
Mn as an,
|
|
1630
|
+
Rn as ao,
|
|
1631
|
+
_n as ap,
|
|
1632
|
+
Fn as aq,
|
|
1633
|
+
un as ar,
|
|
1634
|
+
st as as,
|
|
1635
|
+
ln as at,
|
|
1636
|
+
Ae as au,
|
|
1637
|
+
At as av,
|
|
1638
|
+
vt as aw,
|
|
1639
|
+
Tt as ax,
|
|
1640
|
+
$n as ay,
|
|
1641
|
+
Lt as az,
|
|
1642
|
+
Qn as b,
|
|
1643
|
+
De as c,
|
|
1644
|
+
Q as d,
|
|
1645
|
+
Yn as e,
|
|
1646
|
+
Gn as f,
|
|
1647
|
+
Jn as g,
|
|
1648
|
+
Hn as h,
|
|
1649
|
+
Jt as i,
|
|
1650
|
+
Me as j,
|
|
1651
|
+
_t as k,
|
|
1651
1652
|
xe as l,
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1653
|
+
er as m,
|
|
1654
|
+
tr as n,
|
|
1655
|
+
nr as o,
|
|
1656
|
+
cr as p,
|
|
1657
|
+
Re as q,
|
|
1658
|
+
Wn as r,
|
|
1659
|
+
_e as s,
|
|
1660
|
+
Rt as t,
|
|
1661
|
+
rr as u,
|
|
1662
|
+
Fe as v,
|
|
1663
|
+
$t as w,
|
|
1664
|
+
sr as x,
|
|
1665
|
+
ar as y,
|
|
1666
|
+
or as z
|
|
1666
1667
|
};
|