react-semaphor 0.1.352 → 0.1.354
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/chunks/{calendar-preferences-dialog-BP6VCs24.js → calendar-preferences-dialog-BlF7tQVO.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DqB0gRKY.js → calendar-preferences-dialog-C89peE7b.js} +1 -1
- package/dist/chunks/contracts-CoCOpd_i.js +11 -0
- package/dist/chunks/contracts-CtB2VONT.js +1 -0
- package/dist/chunks/{dashboard-briefing-launcher-DxLotfPa.js → dashboard-briefing-launcher-CzTXDvdU.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CE8bNT8E.js → dashboard-briefing-launcher-thntGohY.js} +3 -3
- package/dist/chunks/{dashboard-controls-B00gdNuz.js → dashboard-controls-DyPZNfmg.js} +3 -3
- package/dist/chunks/{dashboard-controls-DiRVwF2s.js → dashboard-controls-Pbm2gZA5.js} +1 -1
- package/dist/chunks/{dashboard-json-qKWjSofT.js → dashboard-json-B2qFCVuf.js} +1 -1
- package/dist/chunks/{dashboard-json-BvdoNEjb.js → dashboard-json-sLdO-LC1.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-B25Pk-Hr.js → edit-dashboard-visual-BTTIog61.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-ChpvAgup.js → edit-dashboard-visual-j17SdtRC.js} +1 -1
- package/dist/chunks/{index-D14U5QOC.js → index-Dh4zmLqk.js} +21309 -21093
- package/dist/chunks/{index-DYHvr2To.js → index-o6tGBWww.js} +206 -206
- package/dist/chunks/{resource-management-panel-BOW5JCor.js → resource-management-panel-CgQRI6g7.js} +2 -2
- package/dist/chunks/{resource-management-panel-ChEmFjoR.js → resource-management-panel-wn2UAr-d.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CZk4rrrw.js → use-create-flow-overlay-state-CATp6oTj.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-C5jxnrOJ.js → use-create-flow-overlay-state-CVwvTfpo.js} +2 -2
- package/dist/chunks/{use-visual-utils-DHBV770y.js → use-visual-utils-BVmHziAk.js} +1 -1
- package/dist/chunks/{use-visual-utils-ika7wXDI.js → use-visual-utils-YXOTwvaX.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +484 -440
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard-authoring.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,133 +1,127 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
"lg",
|
|
6
|
-
"md",
|
|
7
|
-
"sm",
|
|
8
|
-
"xs",
|
|
9
|
-
"xxs"
|
|
10
|
-
], P = 10;
|
|
1
|
+
import { D as B, a as ge } from "../chunks/contracts-CoCOpd_i.js";
|
|
2
|
+
import { a as be, b as E, p as Ie } from "../chunks/source-identity-qAmkNtEK.js";
|
|
3
|
+
import { v as re, c as ye } from "../chunks/validators-BnLhuIhd.js";
|
|
4
|
+
import { b as _e } from "../chunks/catalog-field-grounding-DoEBOXQd.js";
|
|
11
5
|
function _(e) {
|
|
12
6
|
return e && typeof e == "object" ? e : null;
|
|
13
7
|
}
|
|
14
|
-
function
|
|
8
|
+
function C(e) {
|
|
15
9
|
return typeof e == "string" ? e : null;
|
|
16
10
|
}
|
|
17
|
-
function
|
|
11
|
+
function we(e) {
|
|
18
12
|
var t, n, r;
|
|
19
13
|
return !!(e && typeof e == "object") && (((t = _(e)) == null ? void 0 : t.kind) === "semantic" || ((n = _(e)) == null ? void 0 : n.kind) === "physical" || ((r = _(e)) == null ? void 0 : r.kind) === "sql");
|
|
20
14
|
}
|
|
21
15
|
function V(e) {
|
|
22
|
-
return
|
|
16
|
+
return we(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
|
|
23
17
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
18
|
+
function _t(e) {
|
|
19
|
+
return be(e);
|
|
26
20
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
21
|
+
function ae(e, t) {
|
|
22
|
+
return E(e, t);
|
|
29
23
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
24
|
+
function ve(e, t) {
|
|
25
|
+
return Ie(e, t);
|
|
32
26
|
}
|
|
33
|
-
function
|
|
27
|
+
function P(e) {
|
|
34
28
|
const t = [];
|
|
35
29
|
for (const n of e) {
|
|
36
30
|
const r = t.findIndex(
|
|
37
|
-
(
|
|
31
|
+
(i) => ae(i, n)
|
|
38
32
|
);
|
|
39
|
-
r === -1 ? t.push(n) : t[r] =
|
|
33
|
+
r === -1 ? t.push(n) : t[r] = ve(
|
|
40
34
|
t[r],
|
|
41
35
|
n
|
|
42
36
|
);
|
|
43
37
|
}
|
|
44
38
|
return t;
|
|
45
39
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
40
|
+
function wt(e) {
|
|
41
|
+
return P(e)[0];
|
|
48
42
|
}
|
|
49
43
|
function O(e, t) {
|
|
50
|
-
return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !
|
|
44
|
+
return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !E(e, t) || !t.connectionId ? e : { ...e, connectionId: t.connectionId };
|
|
51
45
|
}
|
|
52
46
|
function j(e) {
|
|
53
47
|
return V(e) ? e : void 0;
|
|
54
48
|
}
|
|
55
|
-
function
|
|
49
|
+
function ne(e, t) {
|
|
56
50
|
if (!(e.kind !== "semantic" || e.connectionId))
|
|
57
51
|
return t.find(
|
|
58
|
-
(n) => (n == null ? void 0 : n.kind) === "semantic" &&
|
|
52
|
+
(n) => (n == null ? void 0 : n.kind) === "semantic" && E(e, n) && !!n.connectionId
|
|
59
53
|
);
|
|
60
54
|
}
|
|
61
|
-
function
|
|
55
|
+
function S(e, t) {
|
|
62
56
|
const n = j(e == null ? void 0 : e.source);
|
|
63
57
|
return n ? O(n, t) : void 0;
|
|
64
58
|
}
|
|
65
|
-
function
|
|
59
|
+
function Se({
|
|
66
60
|
explicitSource: e,
|
|
67
61
|
field: t,
|
|
68
62
|
defaultSource: n,
|
|
69
63
|
fallbackSources: r
|
|
70
64
|
}) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
const i = [n, ...r || []], a = j(e), o = a ? O(
|
|
66
|
+
a,
|
|
67
|
+
ne(a, i)
|
|
74
68
|
) : void 0;
|
|
75
69
|
if (o)
|
|
76
70
|
return o;
|
|
77
71
|
if (e !== void 0)
|
|
78
72
|
return;
|
|
79
|
-
const d =
|
|
73
|
+
const d = S(t, n), s = d ? O(
|
|
80
74
|
d,
|
|
81
|
-
|
|
75
|
+
ne(d, i)
|
|
82
76
|
) : void 0;
|
|
83
77
|
if (s)
|
|
84
78
|
return s;
|
|
85
79
|
if ((t == null ? void 0 : t.source) === void 0)
|
|
86
80
|
return j(n);
|
|
87
81
|
}
|
|
88
|
-
function
|
|
82
|
+
function vt(e, t) {
|
|
89
83
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
90
84
|
return !1;
|
|
91
|
-
const n =
|
|
92
|
-
return !n || !r ? !0 :
|
|
85
|
+
const n = S(e), r = S(t);
|
|
86
|
+
return !n || !r ? !0 : ae(n, r);
|
|
93
87
|
}
|
|
94
|
-
function
|
|
88
|
+
function k(e) {
|
|
95
89
|
var t;
|
|
96
|
-
return
|
|
90
|
+
return C((t = _(e)) == null ? void 0 : t.kind);
|
|
97
91
|
}
|
|
98
|
-
function
|
|
92
|
+
function ie(e) {
|
|
99
93
|
var t, n;
|
|
100
|
-
return
|
|
94
|
+
return k(e) !== "semantic" ? null : ((n = C((t = _(e)) == null ? void 0 : t.domainId)) == null ? void 0 : n.trim()) || null;
|
|
101
95
|
}
|
|
102
|
-
function
|
|
103
|
-
var t;
|
|
104
|
-
return x(e) !== "semantic" ? null : S((t = _(e)) == null ? void 0 : t.datasetName);
|
|
105
|
-
}
|
|
106
|
-
function Se(e) {
|
|
96
|
+
function Ce(e) {
|
|
107
97
|
var t;
|
|
108
|
-
return
|
|
98
|
+
return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetName);
|
|
109
99
|
}
|
|
110
100
|
function ke(e) {
|
|
111
101
|
var t;
|
|
112
|
-
return
|
|
102
|
+
return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetId);
|
|
113
103
|
}
|
|
114
104
|
function xe(e) {
|
|
115
105
|
var t;
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
function Ce(e) {
|
|
119
|
-
var t;
|
|
120
|
-
return x(e) !== "physical" ? "" : S((t = _(e)) == null ? void 0 : t.databaseName) || "";
|
|
106
|
+
return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.connectionId);
|
|
121
107
|
}
|
|
122
108
|
function De(e) {
|
|
123
109
|
var t;
|
|
124
|
-
return
|
|
110
|
+
return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.tableName);
|
|
125
111
|
}
|
|
126
112
|
function Ae(e) {
|
|
113
|
+
var t;
|
|
114
|
+
return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.databaseName) || "";
|
|
115
|
+
}
|
|
116
|
+
function Fe(e) {
|
|
117
|
+
var t;
|
|
118
|
+
return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.schemaName) || "";
|
|
119
|
+
}
|
|
120
|
+
function Te(e) {
|
|
127
121
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
128
122
|
return e.analyticsIntent.source;
|
|
129
123
|
}
|
|
130
|
-
function
|
|
124
|
+
function $e({
|
|
131
125
|
datasets: e,
|
|
132
126
|
requireAtLeastOne: t
|
|
133
127
|
}) {
|
|
@@ -135,24 +129,24 @@ function Fe({
|
|
|
135
129
|
return { ok: !1, issue: "invalid_dataset_count" };
|
|
136
130
|
if (e.length <= 1)
|
|
137
131
|
return { ok: !0 };
|
|
138
|
-
const n = e.map(
|
|
139
|
-
return n.some((
|
|
132
|
+
const n = e.map(ie), r = new Set(n.filter(Boolean));
|
|
133
|
+
return n.some((i) => !i) || r.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
|
|
140
134
|
}
|
|
141
|
-
function
|
|
135
|
+
function H(e, t) {
|
|
142
136
|
if (!t)
|
|
143
137
|
return !1;
|
|
144
138
|
if (t.kind === "semantic") {
|
|
145
|
-
const n =
|
|
146
|
-
return
|
|
139
|
+
const n = ke(e);
|
|
140
|
+
return ie(e) === t.domainId ? n && t.datasetId ? n === t.datasetId : Ce(e) === t.datasetName : !1;
|
|
147
141
|
}
|
|
148
|
-
return t.kind === "physical" ?
|
|
142
|
+
return t.kind === "physical" ? xe(e) === t.connectionId && De(e) === t.tableName && Ae(e) === (t.databaseName || "") && Fe(e) === (t.schemaName || "") : !1;
|
|
149
143
|
}
|
|
150
|
-
function
|
|
144
|
+
function St(e, t) {
|
|
151
145
|
return e.find(
|
|
152
|
-
(n) =>
|
|
146
|
+
(n) => H(n, t)
|
|
153
147
|
);
|
|
154
148
|
}
|
|
155
|
-
function
|
|
149
|
+
function p(e, t, n) {
|
|
156
150
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
157
151
|
}
|
|
158
152
|
function M(e) {
|
|
@@ -164,19 +158,19 @@ function M(e) {
|
|
|
164
158
|
}
|
|
165
159
|
return null;
|
|
166
160
|
}
|
|
167
|
-
function
|
|
161
|
+
function oe({
|
|
168
162
|
card: e,
|
|
169
163
|
datasets: t,
|
|
170
164
|
errors: n
|
|
171
165
|
}) {
|
|
172
166
|
if (e.type === "text")
|
|
173
167
|
return;
|
|
174
|
-
const r =
|
|
168
|
+
const r = Te(e);
|
|
175
169
|
if (!r) {
|
|
176
170
|
if (t.length <= 1)
|
|
177
171
|
return;
|
|
178
172
|
n.push(
|
|
179
|
-
|
|
173
|
+
p(
|
|
180
174
|
"missing_card_analytics_source",
|
|
181
175
|
"Multi-dataset dashboard cards must include analytics intent with a source so the materializer can choose the correct dataset.",
|
|
182
176
|
e.id
|
|
@@ -184,8 +178,8 @@ function ie({
|
|
|
184
178
|
);
|
|
185
179
|
return;
|
|
186
180
|
}
|
|
187
|
-
t.some((
|
|
188
|
-
|
|
181
|
+
t.some((i) => H(i, r)) || n.push(
|
|
182
|
+
p(
|
|
189
183
|
"invalid_card_analytics_source",
|
|
190
184
|
"Dashboard cards with an explicit analytics source must use one of the selected datasets.",
|
|
191
185
|
e.id
|
|
@@ -195,49 +189,49 @@ function ie({
|
|
|
195
189
|
function N(e) {
|
|
196
190
|
return e.map((t) => t == null ? void 0 : t.source).filter((t) => !!t);
|
|
197
191
|
}
|
|
198
|
-
function
|
|
192
|
+
function q(e) {
|
|
199
193
|
return Array.isArray(e) ? e.filter(
|
|
200
194
|
(t) => !!(t && typeof t == "object")
|
|
201
195
|
) : [];
|
|
202
196
|
}
|
|
203
|
-
function
|
|
197
|
+
function Me(e) {
|
|
204
198
|
return Array.isArray(e) ? e.filter(
|
|
205
199
|
(t) => !!(t && typeof t == "object")
|
|
206
200
|
) : [];
|
|
207
201
|
}
|
|
208
|
-
function
|
|
202
|
+
function Ne(e) {
|
|
209
203
|
var n;
|
|
210
204
|
if (!e)
|
|
211
205
|
return [];
|
|
212
206
|
const t = [e.source];
|
|
213
207
|
return e.kind === "metric" ? t.push(
|
|
214
208
|
...N([
|
|
215
|
-
...
|
|
209
|
+
...q(e.metrics),
|
|
216
210
|
e.primaryMetric,
|
|
217
211
|
e.dateField,
|
|
218
|
-
...
|
|
219
|
-
...
|
|
212
|
+
...q(e.dimensions),
|
|
213
|
+
...Me(e.filters).map((r) => r.field)
|
|
220
214
|
])
|
|
221
215
|
) : e.kind === "records" ? t.push(
|
|
222
216
|
...N([
|
|
223
|
-
...
|
|
217
|
+
...q(e.fields),
|
|
224
218
|
e.dateField,
|
|
225
219
|
(n = e.orderBy) == null ? void 0 : n.field
|
|
226
220
|
])
|
|
227
221
|
) : e.kind === "inputOptions" ? t.push(...N([e.field])) : e.kind === "sql" && t.push(...N(e.fields || [])), t;
|
|
228
222
|
}
|
|
229
|
-
function
|
|
223
|
+
function se({
|
|
230
224
|
card: e,
|
|
231
225
|
datasets: t,
|
|
232
226
|
errors: n
|
|
233
227
|
}) {
|
|
234
228
|
if (e.type !== "text") {
|
|
235
|
-
for (const r of
|
|
229
|
+
for (const r of Ne(e.analyticsIntent))
|
|
236
230
|
if (r && !t.some(
|
|
237
|
-
(
|
|
231
|
+
(i) => H(i, r)
|
|
238
232
|
)) {
|
|
239
233
|
n.push(
|
|
240
|
-
|
|
234
|
+
p(
|
|
241
235
|
"invalid_card_query_source",
|
|
242
236
|
"Dashboard card query field references must use one of the selected datasets.",
|
|
243
237
|
e.id
|
|
@@ -247,36 +241,36 @@ function oe({
|
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
}
|
|
250
|
-
function
|
|
244
|
+
function de({
|
|
251
245
|
card: e,
|
|
252
246
|
errors: t
|
|
253
247
|
}) {
|
|
254
248
|
if (e.type === "text" || !e.analyticsIntent)
|
|
255
249
|
return;
|
|
256
|
-
const n =
|
|
250
|
+
const n = re(e.analyticsIntent);
|
|
257
251
|
if (!n.ok)
|
|
258
252
|
for (const r of n.errors)
|
|
259
253
|
t.push(
|
|
260
|
-
|
|
254
|
+
p(
|
|
261
255
|
r.code,
|
|
262
256
|
r.path ? `${r.path}: ${r.message}` : r.message,
|
|
263
257
|
e.id
|
|
264
258
|
)
|
|
265
259
|
);
|
|
266
260
|
}
|
|
267
|
-
function
|
|
261
|
+
function ce({
|
|
268
262
|
datasets: e,
|
|
269
263
|
errors: t,
|
|
270
264
|
requireAtLeastOne: n
|
|
271
265
|
}) {
|
|
272
|
-
const r =
|
|
266
|
+
const r = $e({
|
|
273
267
|
datasets: e,
|
|
274
268
|
requireAtLeastOne: n
|
|
275
269
|
});
|
|
276
270
|
if (!r.ok) {
|
|
277
271
|
if (r.issue === "invalid_dataset_count") {
|
|
278
272
|
t.push(
|
|
279
|
-
|
|
273
|
+
p(
|
|
280
274
|
"invalid_dataset_count",
|
|
281
275
|
"Dashboard authoring requires at least one selected dataset."
|
|
282
276
|
)
|
|
@@ -284,21 +278,21 @@ function de({
|
|
|
284
278
|
return;
|
|
285
279
|
}
|
|
286
280
|
t.push(
|
|
287
|
-
|
|
281
|
+
p(
|
|
288
282
|
"invalid_multi_dataset_scope",
|
|
289
283
|
"Multi-dataset dashboard authoring is limited to semantic datasets from one domain."
|
|
290
284
|
)
|
|
291
285
|
);
|
|
292
286
|
}
|
|
293
287
|
}
|
|
294
|
-
function
|
|
295
|
-
var
|
|
288
|
+
function Be(e) {
|
|
289
|
+
var f, g;
|
|
296
290
|
const t = [];
|
|
297
291
|
if (!e || typeof e != "object")
|
|
298
292
|
return {
|
|
299
293
|
ok: !1,
|
|
300
294
|
errors: [
|
|
301
|
-
|
|
295
|
+
p(
|
|
302
296
|
"invalid_plan",
|
|
303
297
|
"Dashboard plan must be a structured object."
|
|
304
298
|
)
|
|
@@ -306,82 +300,82 @@ function Me(e) {
|
|
|
306
300
|
warnings: []
|
|
307
301
|
};
|
|
308
302
|
const n = e, r = [...n.warnings || []];
|
|
309
|
-
n.version !== 1 && t.push(
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
303
|
+
n.version !== 1 && t.push(p("invalid_version", "Dashboard plan version must be 1.")), (f = n.title) != null && f.trim() || t.push(p("missing_title", "Dashboard plan needs a title."));
|
|
304
|
+
const i = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.sheets) ? n.sheets : [];
|
|
305
|
+
ce({ datasets: i, errors: t, requireAtLeastOne: !0 }), a.length !== 1 && t.push(
|
|
306
|
+
p(
|
|
313
307
|
"invalid_sheet_count",
|
|
314
308
|
"MVP dashboard authoring creates exactly one dashboard sheet."
|
|
315
309
|
)
|
|
316
310
|
);
|
|
317
|
-
const o =
|
|
311
|
+
const o = a[0];
|
|
318
312
|
o && o.kind !== "dashboard" && t.push(
|
|
319
|
-
|
|
313
|
+
p("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
|
|
320
314
|
);
|
|
321
315
|
const d = (o == null ? void 0 : o.cards) || [];
|
|
322
|
-
d.length >
|
|
323
|
-
|
|
316
|
+
d.length > B && t.push(
|
|
317
|
+
p(
|
|
324
318
|
"too_many_cards",
|
|
325
|
-
`Generated dashboards can contain at most ${
|
|
319
|
+
`Generated dashboards can contain at most ${B} cards.`
|
|
326
320
|
)
|
|
327
321
|
);
|
|
328
322
|
const s = M(d.map((l) => l.id));
|
|
329
323
|
s && t.push(
|
|
330
|
-
|
|
324
|
+
p("duplicate_card_id", `Duplicate generated card id: ${s}.`)
|
|
331
325
|
);
|
|
332
326
|
const u = M(d.map((l) => l.frameId));
|
|
333
327
|
u && t.push(
|
|
334
|
-
|
|
328
|
+
p(
|
|
335
329
|
"duplicate_frame_id",
|
|
336
330
|
`Duplicate generated frame id: ${u}.`
|
|
337
331
|
)
|
|
338
332
|
);
|
|
339
333
|
for (const l of d)
|
|
340
|
-
(
|
|
341
|
-
|
|
334
|
+
(g = l.title) != null && g.trim() || t.push(p("missing_card_title", "Card title is required.", l.id)), l.type === "custom" && t.push(
|
|
335
|
+
p(
|
|
342
336
|
"custom_visual_out_of_scope",
|
|
343
337
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
344
338
|
l.id
|
|
345
339
|
)
|
|
346
340
|
), l.type !== "text" && !l.analyticsIntent && r.push(
|
|
347
|
-
|
|
341
|
+
p(
|
|
348
342
|
"missing_analytics_intent",
|
|
349
343
|
"Non-text card has no analytics intent and may be skipped by the app layer.",
|
|
350
344
|
l.id
|
|
351
345
|
)
|
|
352
|
-
),
|
|
353
|
-
const h = Array.isArray(n.filterInputs) ? n.filterInputs : [],
|
|
354
|
-
|
|
355
|
-
|
|
346
|
+
), oe({ card: l, datasets: i, errors: t }), de({ card: l, errors: t }), se({ card: l, datasets: i, errors: t });
|
|
347
|
+
const h = Array.isArray(n.filterInputs) ? n.filterInputs : [], I = h.map((l) => l.id), w = M(I);
|
|
348
|
+
w && t.push(
|
|
349
|
+
p(
|
|
356
350
|
"duplicate_input_id",
|
|
357
|
-
`Duplicate dashboard input id: ${
|
|
351
|
+
`Duplicate dashboard input id: ${w}.`
|
|
358
352
|
)
|
|
359
353
|
);
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
354
|
+
const v = h.map((l) => l.variableName).filter(Boolean) || [], y = M(v);
|
|
355
|
+
y && t.push(
|
|
356
|
+
p(
|
|
363
357
|
"duplicate_input_variable",
|
|
364
|
-
`Duplicate dashboard input variable name: ${
|
|
358
|
+
`Duplicate dashboard input variable name: ${y}.`
|
|
365
359
|
)
|
|
366
360
|
);
|
|
367
|
-
const
|
|
368
|
-
for (const l of
|
|
361
|
+
const c = Array.isArray(n.calculatedFields) ? n.calculatedFields : [];
|
|
362
|
+
for (const l of c)
|
|
369
363
|
l.scope === "domain" && l.reuseOnly !== !0 && t.push(
|
|
370
|
-
|
|
364
|
+
p(
|
|
371
365
|
"domain_calculated_field_create_out_of_scope",
|
|
372
366
|
`Creating domain calculated field "${l.name}" is outside MVP.`
|
|
373
367
|
)
|
|
374
368
|
);
|
|
375
369
|
return { ok: t.length === 0, errors: t, warnings: r };
|
|
376
370
|
}
|
|
377
|
-
function
|
|
371
|
+
function Pe(e) {
|
|
378
372
|
var o;
|
|
379
373
|
const t = [];
|
|
380
374
|
if (!e || typeof e != "object")
|
|
381
375
|
return {
|
|
382
376
|
ok: !1,
|
|
383
377
|
errors: [
|
|
384
|
-
|
|
378
|
+
p(
|
|
385
379
|
"invalid_change_plan",
|
|
386
380
|
"Dashboard change plan must be a structured object."
|
|
387
381
|
)
|
|
@@ -390,38 +384,38 @@ function Ne(e) {
|
|
|
390
384
|
};
|
|
391
385
|
const n = e, r = [...n.warnings || []];
|
|
392
386
|
n.version !== 1 && t.push(
|
|
393
|
-
|
|
387
|
+
p("invalid_version", "Dashboard change plan version must be 1.")
|
|
394
388
|
), (o = n.dashboardId) != null && o.trim() || t.push(
|
|
395
|
-
|
|
389
|
+
p("missing_dashboard_id", "Dashboard change plan needs a dashboard id.")
|
|
396
390
|
);
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
for (const d of
|
|
391
|
+
const i = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.operations) ? n.operations : [];
|
|
392
|
+
ce({ datasets: i, errors: t, requireAtLeastOne: !1 });
|
|
393
|
+
for (const d of a) {
|
|
400
394
|
if (d.kind === "unsupported") {
|
|
401
395
|
r.push(
|
|
402
|
-
|
|
396
|
+
p("unsupported_operation", d.reason || d.requestedAction)
|
|
403
397
|
);
|
|
404
398
|
continue;
|
|
405
399
|
}
|
|
406
400
|
d.kind === "addCard" && d.card.type === "custom" && t.push(
|
|
407
|
-
|
|
401
|
+
p(
|
|
408
402
|
"custom_visual_out_of_scope",
|
|
409
403
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
410
404
|
d.card.id
|
|
411
405
|
)
|
|
412
|
-
), d.kind === "addCard" && (
|
|
406
|
+
), d.kind === "addCard" && (oe({
|
|
413
407
|
card: d.card,
|
|
414
|
-
datasets:
|
|
408
|
+
datasets: i,
|
|
415
409
|
errors: t
|
|
416
|
-
}),
|
|
410
|
+
}), de({
|
|
417
411
|
card: d.card,
|
|
418
412
|
errors: t
|
|
419
|
-
}),
|
|
413
|
+
}), se({
|
|
420
414
|
card: d.card,
|
|
421
|
-
datasets:
|
|
415
|
+
datasets: i,
|
|
422
416
|
errors: t
|
|
423
417
|
})), d.kind === "addCalculatedField" && d.field.scope === "domain" && d.field.reuseOnly !== !0 && t.push(
|
|
424
|
-
|
|
418
|
+
p(
|
|
425
419
|
"domain_calculated_field_create_out_of_scope",
|
|
426
420
|
`Creating domain calculated field "${d.field.name}" is outside MVP.`
|
|
427
421
|
)
|
|
@@ -429,47 +423,47 @@ function Ne(e) {
|
|
|
429
423
|
}
|
|
430
424
|
return { ok: t.length === 0, errors: t, warnings: r };
|
|
431
425
|
}
|
|
432
|
-
const
|
|
426
|
+
const Ve = {
|
|
433
427
|
lg: 48,
|
|
434
428
|
md: 36,
|
|
435
429
|
sm: 24,
|
|
436
430
|
xs: 12,
|
|
437
431
|
xxs: 6
|
|
438
432
|
};
|
|
439
|
-
function
|
|
440
|
-
let n = 0, r = 0,
|
|
441
|
-
return e.map((
|
|
442
|
-
const o = Math.min(
|
|
443
|
-
n > 0 && n + o > t && (n = 0, r +=
|
|
433
|
+
function ze(e, t) {
|
|
434
|
+
let n = 0, r = 0, i = 0;
|
|
435
|
+
return e.map((a) => {
|
|
436
|
+
const o = Math.min(a.w, t);
|
|
437
|
+
n > 0 && n + o > t && (n = 0, r += i, i = 0);
|
|
444
438
|
const d = {
|
|
445
|
-
i:
|
|
439
|
+
i: a.frameId,
|
|
446
440
|
x: n,
|
|
447
441
|
y: r,
|
|
448
442
|
w: o,
|
|
449
|
-
h:
|
|
450
|
-
minW: Math.min(
|
|
451
|
-
minH:
|
|
443
|
+
h: a.h,
|
|
444
|
+
minW: Math.min(a.minW, t),
|
|
445
|
+
minH: a.minH,
|
|
452
446
|
static: !1
|
|
453
447
|
};
|
|
454
|
-
return n += o,
|
|
448
|
+
return n += o, i = Math.max(i, a.h), d;
|
|
455
449
|
});
|
|
456
450
|
}
|
|
457
|
-
function
|
|
458
|
-
const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"),
|
|
459
|
-
return { kpis: n, introText: o, charts: r, tables:
|
|
451
|
+
function qe(e) {
|
|
452
|
+
const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"), i = t.filter((s) => s.role === "table"), a = t.filter((s) => s.role === "text"), o = a.slice(0, 1), d = a.slice(o.length);
|
|
453
|
+
return { kpis: n, introText: o, charts: r, tables: i, supportingText: d };
|
|
460
454
|
}
|
|
461
|
-
function
|
|
455
|
+
function Re(e, t, n) {
|
|
462
456
|
return t === "xxs" || t === "xs" ? n : t === "sm" ? Math.min(12, n) : t === "md" ? e <= 1 || e === 2 ? 18 : 12 : e <= 1 || e === 2 ? 24 : e === 3 ? 16 : 12;
|
|
463
457
|
}
|
|
464
|
-
function
|
|
458
|
+
function Le(e, t, n, r) {
|
|
465
459
|
return n === "xxs" || n === "xs" || n === "sm" || n === "md" || t === 1 || t % 2 === 1 && e === 0 ? r : r / 2;
|
|
466
460
|
}
|
|
467
|
-
function
|
|
468
|
-
const { item: t, band: n, index: r, bandCount:
|
|
461
|
+
function Oe(e) {
|
|
462
|
+
const { item: t, band: n, index: r, bandCount: i, breakpoint: a, columns: o } = e;
|
|
469
463
|
return n === "kpi" ? {
|
|
470
464
|
...t,
|
|
471
465
|
band: n,
|
|
472
|
-
w:
|
|
466
|
+
w: Re(i, a, o),
|
|
473
467
|
h: 15,
|
|
474
468
|
minW: Math.min(6, o),
|
|
475
469
|
minH: 12
|
|
@@ -477,84 +471,84 @@ function qe(e) {
|
|
|
477
471
|
...t,
|
|
478
472
|
band: n,
|
|
479
473
|
w: o,
|
|
480
|
-
h:
|
|
474
|
+
h: a === "xxs" || a === "xs" ? 34 : 38,
|
|
481
475
|
minW: Math.min(12, o),
|
|
482
476
|
minH: 18
|
|
483
477
|
} : n === "introText" ? {
|
|
484
478
|
...t,
|
|
485
479
|
band: n,
|
|
486
480
|
w: o,
|
|
487
|
-
h:
|
|
481
|
+
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
488
482
|
minW: Math.min(12, o),
|
|
489
483
|
minH: 8
|
|
490
484
|
} : n === "supportingText" ? {
|
|
491
485
|
...t,
|
|
492
486
|
band: n,
|
|
493
|
-
w:
|
|
494
|
-
h:
|
|
487
|
+
w: a === "lg" ? o / 2 : o,
|
|
488
|
+
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
495
489
|
minW: Math.min(12, o),
|
|
496
490
|
minH: 8
|
|
497
491
|
} : {
|
|
498
492
|
...t,
|
|
499
493
|
band: n,
|
|
500
|
-
w:
|
|
501
|
-
h:
|
|
494
|
+
w: Le(r, i, a, o),
|
|
495
|
+
h: a === "xxs" || a === "xs" ? 28 : 30,
|
|
502
496
|
minW: Math.min(12, o),
|
|
503
497
|
minH: 16
|
|
504
498
|
};
|
|
505
499
|
}
|
|
506
500
|
function D(e, t, n, r) {
|
|
507
501
|
return e.map(
|
|
508
|
-
(
|
|
509
|
-
item:
|
|
502
|
+
(i, a) => Oe({
|
|
503
|
+
item: i,
|
|
510
504
|
band: t,
|
|
511
|
-
index:
|
|
505
|
+
index: a,
|
|
512
506
|
bandCount: e.length,
|
|
513
507
|
breakpoint: n,
|
|
514
508
|
columns: r
|
|
515
509
|
})
|
|
516
510
|
);
|
|
517
511
|
}
|
|
518
|
-
function
|
|
519
|
-
const t =
|
|
512
|
+
function K(e) {
|
|
513
|
+
const t = qe(e);
|
|
520
514
|
return Object.fromEntries(
|
|
521
|
-
|
|
522
|
-
const r =
|
|
515
|
+
ge.map((n) => {
|
|
516
|
+
const r = Ve[n], i = [
|
|
523
517
|
...D(t.introText, "introText", n, r),
|
|
524
518
|
...D(t.kpis, "kpi", n, r),
|
|
525
519
|
...D(t.charts, "chart", n, r),
|
|
526
520
|
...D(t.tables, "table", n, r),
|
|
527
521
|
...D(t.supportingText, "supportingText", n, r)
|
|
528
522
|
];
|
|
529
|
-
return [n,
|
|
523
|
+
return [n, ze(i, r)];
|
|
530
524
|
})
|
|
531
525
|
);
|
|
532
526
|
}
|
|
533
|
-
function
|
|
534
|
-
const t =
|
|
527
|
+
function je(e) {
|
|
528
|
+
const t = _e(e);
|
|
535
529
|
return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
|
|
536
530
|
}
|
|
537
|
-
function
|
|
531
|
+
function We(e) {
|
|
538
532
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
539
533
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
534
|
+
function Ee(e) {
|
|
535
|
+
return We(e) && typeof e.filterId == "string" && typeof e.operation == "string" && Array.isArray(e.values);
|
|
542
536
|
}
|
|
543
|
-
function
|
|
537
|
+
function He(e) {
|
|
544
538
|
return e.filter(
|
|
545
539
|
(t) => typeof t == "string" || typeof t == "number"
|
|
546
540
|
);
|
|
547
541
|
}
|
|
548
|
-
function
|
|
542
|
+
function Ke(e) {
|
|
549
543
|
return e.filter(
|
|
550
544
|
(t) => t instanceof Date || typeof t == "string"
|
|
551
545
|
);
|
|
552
546
|
}
|
|
553
|
-
function
|
|
547
|
+
function G(e, t) {
|
|
554
548
|
if (t === void 0)
|
|
555
549
|
return;
|
|
556
|
-
const n =
|
|
557
|
-
if (
|
|
550
|
+
const n = je(e.dataType), r = e.operation || "in";
|
|
551
|
+
if (Ee(t))
|
|
558
552
|
return {
|
|
559
553
|
...t,
|
|
560
554
|
filterId: e.id,
|
|
@@ -575,26 +569,26 @@ function K(e, t) {
|
|
|
575
569
|
fieldMeta: e.fieldMeta,
|
|
576
570
|
semanticContext: e.semanticContext
|
|
577
571
|
};
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
572
|
+
const i = Array.isArray(t) ? t : [t], a = n === "date" ? Ke(i) : He(i);
|
|
573
|
+
if (a.length !== 0 && !((r === "between" || r === "not between") && a.length < 2))
|
|
580
574
|
return {
|
|
581
575
|
filterId: e.id,
|
|
582
576
|
name: e.column,
|
|
583
577
|
operation: r,
|
|
584
578
|
valueType: n,
|
|
585
|
-
values:
|
|
579
|
+
values: a,
|
|
586
580
|
dataType: e.dataType,
|
|
587
581
|
fieldMeta: e.fieldMeta,
|
|
588
582
|
semanticContext: e.semanticContext
|
|
589
583
|
};
|
|
590
584
|
}
|
|
591
|
-
function
|
|
585
|
+
function le(e, t, n) {
|
|
592
586
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
593
587
|
}
|
|
594
|
-
function
|
|
588
|
+
function Ge(e, t, n) {
|
|
595
589
|
const r = (t || []).filter(
|
|
596
|
-
(
|
|
597
|
-
).map((
|
|
590
|
+
(i) => i.scope === "card" && i.targetCardId === n
|
|
591
|
+
).map((i) => i.field).filter(Boolean);
|
|
598
592
|
return r.length === 0 ? e : {
|
|
599
593
|
...e,
|
|
600
594
|
calculatedFields: [
|
|
@@ -603,76 +597,126 @@ function Ke(e, t, n) {
|
|
|
603
597
|
]
|
|
604
598
|
};
|
|
605
599
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
600
|
+
function W(e, t) {
|
|
601
|
+
return Array.from(
|
|
602
|
+
new Set(
|
|
603
|
+
(e || []).map((n) => t.get(n)).filter((n) => !!n)
|
|
604
|
+
)
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
function Ue(e, t) {
|
|
608
|
+
if ((e == null ? void 0 : e.kind) !== "cards")
|
|
609
|
+
return e;
|
|
610
|
+
const n = W(e.cardIds, t);
|
|
611
|
+
return n.length > 0 ? { ...e, cardIds: n } : null;
|
|
612
|
+
}
|
|
613
|
+
function Je(e, t) {
|
|
614
|
+
return !e.applyToCardIds && !e.excludeCardIds ? e : {
|
|
615
|
+
...e,
|
|
616
|
+
...e.applyToCardIds ? {
|
|
617
|
+
applyToCardIds: W(
|
|
618
|
+
e.applyToCardIds,
|
|
619
|
+
t
|
|
620
|
+
)
|
|
621
|
+
} : {},
|
|
622
|
+
...e.excludeCardIds ? {
|
|
623
|
+
excludeCardIds: W(
|
|
624
|
+
e.excludeCardIds,
|
|
625
|
+
t
|
|
626
|
+
)
|
|
627
|
+
} : {}
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
function Qe(e, t) {
|
|
631
|
+
const n = {}, r = [];
|
|
608
632
|
return {
|
|
609
|
-
inputs: (e.filterInputs || []).
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
633
|
+
inputs: (e.filterInputs || []).flatMap(
|
|
634
|
+
(a, o) => {
|
|
635
|
+
const d = Ue(a.scope, t);
|
|
636
|
+
if (d === null)
|
|
637
|
+
return r.push(
|
|
638
|
+
le(
|
|
639
|
+
"filter_input_scope_empty",
|
|
640
|
+
`Filter input "${a.label}" was skipped because all scoped cards were skipped during query validation.`
|
|
641
|
+
)
|
|
642
|
+
), [];
|
|
643
|
+
const s = G(
|
|
644
|
+
a.filter,
|
|
645
|
+
a.defaultValue
|
|
646
|
+
);
|
|
647
|
+
return s && (n.shared ?? (n.shared = {}), n.shared[a.id] = {
|
|
648
|
+
status: "set",
|
|
649
|
+
value: {
|
|
650
|
+
kind: "filter",
|
|
651
|
+
filterValue: s
|
|
652
|
+
}
|
|
653
|
+
}), [
|
|
654
|
+
{
|
|
655
|
+
id: a.id,
|
|
656
|
+
kind: "filter",
|
|
657
|
+
label: a.label,
|
|
658
|
+
variableName: a.variableName,
|
|
659
|
+
scope: d || { kind: "allSheets", sheetKinds: ["dashboard"] },
|
|
660
|
+
runtimeScope: "shared",
|
|
661
|
+
presentation: {
|
|
662
|
+
placement: "toolbar",
|
|
663
|
+
order: o
|
|
664
|
+
},
|
|
665
|
+
exports: ["label", "value", "start", "end", "range"],
|
|
666
|
+
filter: Je(a.filter, t)
|
|
667
|
+
}
|
|
668
|
+
];
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
warnings: r,
|
|
672
|
+
defaultInputValues: n.shared && Object.keys(n.shared).length > 0 ? n : void 0
|
|
636
673
|
};
|
|
637
674
|
}
|
|
638
|
-
function
|
|
639
|
-
var
|
|
640
|
-
const t =
|
|
675
|
+
function Ct(e) {
|
|
676
|
+
var v, y;
|
|
677
|
+
const t = Be(e.plan);
|
|
641
678
|
if (!t.ok)
|
|
642
679
|
throw new Error(
|
|
643
680
|
t.errors.map((c) => c.message).join(`
|
|
644
681
|
`) || "Dashboard plan is invalid."
|
|
645
682
|
);
|
|
646
|
-
const n = e.plan.sheets[0], r = [...t.warnings],
|
|
683
|
+
const n = e.plan.sheets[0], r = [...t.warnings], i = [], a = new Map(
|
|
647
684
|
e.cardArtifacts.map((c) => [c.planCardId, c])
|
|
648
|
-
), o =
|
|
685
|
+
), o = new Map(
|
|
686
|
+
e.cardArtifacts.map((c) => [
|
|
687
|
+
c.planCardId,
|
|
688
|
+
c.card.id
|
|
689
|
+
])
|
|
690
|
+
), d = [];
|
|
649
691
|
for (const c of n.cards) {
|
|
650
|
-
const
|
|
651
|
-
if (!
|
|
652
|
-
const
|
|
692
|
+
const f = a.get(c.id);
|
|
693
|
+
if (!f) {
|
|
694
|
+
const l = le(
|
|
653
695
|
"missing_card_artifact",
|
|
654
696
|
`Card "${c.title}" was skipped because no generated artifact was supplied.`,
|
|
655
697
|
c.id
|
|
656
698
|
);
|
|
657
|
-
|
|
699
|
+
i.push(l);
|
|
658
700
|
continue;
|
|
659
701
|
}
|
|
660
|
-
r.push(...
|
|
661
|
-
const
|
|
662
|
-
|
|
702
|
+
r.push(...f.warnings || []);
|
|
703
|
+
const g = Ge(
|
|
704
|
+
f.card,
|
|
663
705
|
e.plan.calculatedFields,
|
|
664
706
|
c.id
|
|
665
707
|
);
|
|
666
|
-
|
|
708
|
+
d.push({
|
|
667
709
|
id: c.frameId,
|
|
668
|
-
cards: [
|
|
669
|
-
activeCardId:
|
|
710
|
+
cards: [g],
|
|
711
|
+
activeCardId: g.id
|
|
670
712
|
});
|
|
671
713
|
}
|
|
672
|
-
if (
|
|
714
|
+
if (d.length === 0)
|
|
673
715
|
throw new Error("Dashboard plan did not produce any persistable cards.");
|
|
674
|
-
const { inputs:
|
|
675
|
-
|
|
716
|
+
const { inputs: s, defaultInputValues: u, warnings: h } = Qe(e.plan, o);
|
|
717
|
+
r.push(...h);
|
|
718
|
+
const I = K(
|
|
719
|
+
n.cards.filter((c) => d.some((f) => f.id === c.frameId)).map((c) => ({
|
|
676
720
|
frameId: c.frameId,
|
|
677
721
|
priority: c.priority,
|
|
678
722
|
role: c.role
|
|
@@ -688,94 +732,94 @@ function _t(e) {
|
|
|
688
732
|
kind: "dashboard",
|
|
689
733
|
title: n.title,
|
|
690
734
|
description: n.description,
|
|
691
|
-
frames:
|
|
692
|
-
layouts:
|
|
693
|
-
calculatedFields: (
|
|
735
|
+
frames: d,
|
|
736
|
+
layouts: I,
|
|
737
|
+
calculatedFields: (v = e.plan.calculatedFields) == null ? void 0 : v.filter((c) => c.scope === "sheet" && c.field).map((c) => c.field)
|
|
694
738
|
}
|
|
695
739
|
],
|
|
696
740
|
calculatedFields: (y = e.plan.calculatedFields) == null ? void 0 : y.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
|
|
697
|
-
inputs:
|
|
698
|
-
...
|
|
699
|
-
}, warnings: r, skippedOperations:
|
|
741
|
+
inputs: s,
|
|
742
|
+
...u ? { defaultInputValues: u } : {}
|
|
743
|
+
}, warnings: r, skippedOperations: i };
|
|
700
744
|
}
|
|
701
|
-
function
|
|
745
|
+
function x(e, t, n) {
|
|
702
746
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
703
747
|
}
|
|
704
|
-
function
|
|
748
|
+
function Xe(e) {
|
|
705
749
|
return JSON.parse(JSON.stringify(e));
|
|
706
750
|
}
|
|
707
|
-
function
|
|
751
|
+
function Ye(e) {
|
|
708
752
|
var t;
|
|
709
753
|
return (t = e.sheets) == null ? void 0 : t.find(
|
|
710
754
|
(n) => (n.kind || "dashboard") === "dashboard"
|
|
711
755
|
);
|
|
712
756
|
}
|
|
713
|
-
function
|
|
757
|
+
function R(e, t) {
|
|
714
758
|
var n;
|
|
715
759
|
for (const r of e.sheets || [])
|
|
716
|
-
for (const
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
719
|
-
return { sheet: r, frame:
|
|
760
|
+
for (const i of r.frames || []) {
|
|
761
|
+
const a = (n = i.cards) == null ? void 0 : n.find((o) => o.id === t);
|
|
762
|
+
if (a)
|
|
763
|
+
return { sheet: r, frame: i, card: a };
|
|
720
764
|
}
|
|
721
765
|
return null;
|
|
722
766
|
}
|
|
723
|
-
function
|
|
767
|
+
function ue(e) {
|
|
724
768
|
var n, r;
|
|
725
769
|
const t = (r = (n = e.cards) == null ? void 0 : n[0]) == null ? void 0 : r.type;
|
|
726
770
|
return t === "kpi" ? "kpi" : t === "table" || t === "detailTable" || t === "pivotTable" ? "table" : t === "text" ? "text" : "chart";
|
|
727
771
|
}
|
|
728
|
-
function
|
|
772
|
+
function Ze(e) {
|
|
729
773
|
var t;
|
|
730
774
|
return new Map(
|
|
731
775
|
(((t = e.layouts) == null ? void 0 : t.lg) || []).map((n, r) => [n.i, r])
|
|
732
776
|
);
|
|
733
777
|
}
|
|
734
|
-
function
|
|
735
|
-
const n =
|
|
778
|
+
function fe(e, t = /* @__PURE__ */ new Map()) {
|
|
779
|
+
const n = Ze(e), r = Math.max(
|
|
736
780
|
n.size,
|
|
737
781
|
t.size
|
|
738
|
-
),
|
|
739
|
-
(
|
|
740
|
-
frameId:
|
|
741
|
-
role:
|
|
742
|
-
priority: t.get(
|
|
782
|
+
), i = (e.frames || []).map(
|
|
783
|
+
(a, o) => ({
|
|
784
|
+
frameId: a.id,
|
|
785
|
+
role: ue(a),
|
|
786
|
+
priority: t.get(a.id) ?? n.get(a.id) ?? r + o
|
|
743
787
|
})
|
|
744
788
|
);
|
|
745
|
-
e.layouts =
|
|
789
|
+
e.layouts = K(i);
|
|
746
790
|
}
|
|
747
|
-
function
|
|
791
|
+
function et(e) {
|
|
748
792
|
return Object.values(e.layouts || {}).some((t) => t.length > 0);
|
|
749
793
|
}
|
|
750
|
-
function
|
|
751
|
-
if (!
|
|
752
|
-
|
|
794
|
+
function tt(e, t) {
|
|
795
|
+
if (!et(e)) {
|
|
796
|
+
fe(e);
|
|
753
797
|
return;
|
|
754
798
|
}
|
|
755
|
-
const n =
|
|
756
|
-
{ frameId: t.id, role:
|
|
799
|
+
const n = K([
|
|
800
|
+
{ frameId: t.id, role: ue(t), priority: 0 }
|
|
757
801
|
]);
|
|
758
802
|
e.layouts ?? (e.layouts = {});
|
|
759
|
-
for (const [r,
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
803
|
+
for (const [r, i] of Object.entries(n)) {
|
|
804
|
+
const a = e.layouts[r] || [];
|
|
805
|
+
if (a.some((s) => s.i === t.id))
|
|
762
806
|
continue;
|
|
763
|
-
const o =
|
|
807
|
+
const o = i[0];
|
|
764
808
|
if (!o)
|
|
765
809
|
continue;
|
|
766
|
-
const d =
|
|
810
|
+
const d = a.reduce(
|
|
767
811
|
(s, u) => Math.max(s, u.y + u.h),
|
|
768
812
|
0
|
|
769
813
|
);
|
|
770
814
|
e.layouts[r] = [
|
|
771
|
-
...
|
|
815
|
+
...a,
|
|
772
816
|
{ ...o, y: d }
|
|
773
817
|
];
|
|
774
818
|
}
|
|
775
819
|
}
|
|
776
|
-
function
|
|
820
|
+
function nt(e, t) {
|
|
777
821
|
var r;
|
|
778
|
-
const n =
|
|
822
|
+
const n = G(
|
|
779
823
|
t.filter,
|
|
780
824
|
t.defaultValue
|
|
781
825
|
);
|
|
@@ -787,17 +831,17 @@ function Ze(e, t) {
|
|
|
787
831
|
}
|
|
788
832
|
});
|
|
789
833
|
}
|
|
790
|
-
function
|
|
834
|
+
function kt(e) {
|
|
791
835
|
var d;
|
|
792
|
-
const t =
|
|
836
|
+
const t = Pe(e.changePlan);
|
|
793
837
|
if (!t.ok)
|
|
794
838
|
throw new Error(
|
|
795
839
|
t.errors.map((s) => s.message).join(`
|
|
796
840
|
`) || "Dashboard change plan is invalid."
|
|
797
841
|
);
|
|
798
|
-
const n =
|
|
842
|
+
const n = Xe(e.dashboard), r = [...t.warnings], i = [], a = new Map(
|
|
799
843
|
e.cardArtifacts.map((s) => [s.planCardId, s])
|
|
800
|
-
), o =
|
|
844
|
+
), o = Ye(n);
|
|
801
845
|
if (!o)
|
|
802
846
|
throw new Error("Dashboard has no editable dashboard sheet.");
|
|
803
847
|
o.frames ?? (o.frames = []);
|
|
@@ -805,25 +849,25 @@ function wt(e) {
|
|
|
805
849
|
switch (s.kind) {
|
|
806
850
|
case "addCard": {
|
|
807
851
|
if ((o.frames || []).reduce(
|
|
808
|
-
(
|
|
809
|
-
var
|
|
810
|
-
return
|
|
852
|
+
(w, v) => {
|
|
853
|
+
var y;
|
|
854
|
+
return w + (((y = v.cards) == null ? void 0 : y.length) || 0);
|
|
811
855
|
},
|
|
812
856
|
0
|
|
813
|
-
) >=
|
|
814
|
-
|
|
815
|
-
|
|
857
|
+
) >= B) {
|
|
858
|
+
i.push(
|
|
859
|
+
x(
|
|
816
860
|
"generated_card_limit_reached",
|
|
817
|
-
`
|
|
861
|
+
`AI refinement is capped at ${B} cards.`,
|
|
818
862
|
s.card.id
|
|
819
863
|
)
|
|
820
864
|
);
|
|
821
865
|
break;
|
|
822
866
|
}
|
|
823
|
-
const h =
|
|
867
|
+
const h = a.get(s.card.id);
|
|
824
868
|
if (!h) {
|
|
825
|
-
|
|
826
|
-
|
|
869
|
+
i.push(
|
|
870
|
+
x(
|
|
827
871
|
"missing_card_artifact",
|
|
828
872
|
`Card "${s.card.title}" was skipped because no generated artifact was supplied.`,
|
|
829
873
|
s.card.id
|
|
@@ -831,12 +875,12 @@ function wt(e) {
|
|
|
831
875
|
);
|
|
832
876
|
break;
|
|
833
877
|
}
|
|
834
|
-
const
|
|
878
|
+
const I = {
|
|
835
879
|
id: s.card.frameId,
|
|
836
880
|
cards: [h.card],
|
|
837
881
|
activeCardId: h.card.id
|
|
838
882
|
};
|
|
839
|
-
o.frames.push(
|
|
883
|
+
o.frames.push(I), tt(o, I);
|
|
840
884
|
break;
|
|
841
885
|
}
|
|
842
886
|
case "addFilterInput": {
|
|
@@ -858,7 +902,7 @@ function wt(e) {
|
|
|
858
902
|
exports: ["label", "value", "start", "end", "range"],
|
|
859
903
|
filter: s.input.filter
|
|
860
904
|
};
|
|
861
|
-
n.inputs.push(u),
|
|
905
|
+
n.inputs.push(u), nt(n, s.input);
|
|
862
906
|
break;
|
|
863
907
|
}
|
|
864
908
|
case "addCalculatedField": {
|
|
@@ -867,9 +911,9 @@ function wt(e) {
|
|
|
867
911
|
else if (s.field.scope === "sheet" && s.field.field)
|
|
868
912
|
o.calculatedFields ?? (o.calculatedFields = []), o.calculatedFields.push(s.field.field);
|
|
869
913
|
else if (s.field.scope === "card" && s.field.field) {
|
|
870
|
-
const u = s.field.targetCardId ?
|
|
871
|
-
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) :
|
|
872
|
-
|
|
914
|
+
const u = s.field.targetCardId ? R(n, s.field.targetCardId) : null;
|
|
915
|
+
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : i.push(
|
|
916
|
+
x(
|
|
873
917
|
"missing_calculated_field_target",
|
|
874
918
|
`Calculated field "${s.field.name}" needs a valid target card.`
|
|
875
919
|
)
|
|
@@ -878,10 +922,10 @@ function wt(e) {
|
|
|
878
922
|
break;
|
|
879
923
|
}
|
|
880
924
|
case "renameCard": {
|
|
881
|
-
const u =
|
|
925
|
+
const u = R(n, s.cardId);
|
|
882
926
|
if (!u) {
|
|
883
|
-
|
|
884
|
-
|
|
927
|
+
i.push(
|
|
928
|
+
x(
|
|
885
929
|
"card_not_found",
|
|
886
930
|
`Card "${s.cardId}" could not be renamed because it was not found.`,
|
|
887
931
|
s.cardId
|
|
@@ -895,35 +939,35 @@ function wt(e) {
|
|
|
895
939
|
case "reorderCards": {
|
|
896
940
|
const u = /* @__PURE__ */ new Map();
|
|
897
941
|
for (let h = 0; h < s.cardIds.length; h += 1) {
|
|
898
|
-
const
|
|
899
|
-
|
|
942
|
+
const I = s.cardIds[h], w = R(n, I);
|
|
943
|
+
w && u.set(w.frame.id, h);
|
|
900
944
|
}
|
|
901
|
-
|
|
945
|
+
fe(o, u);
|
|
902
946
|
break;
|
|
903
947
|
}
|
|
904
948
|
case "reuseCalculatedField":
|
|
905
949
|
r.push(
|
|
906
|
-
|
|
950
|
+
x(
|
|
907
951
|
"reused_calculated_field",
|
|
908
952
|
`Calculated field "${s.fieldId}" is reused by reference.`
|
|
909
953
|
)
|
|
910
954
|
);
|
|
911
955
|
break;
|
|
912
956
|
case "unsupported":
|
|
913
|
-
|
|
914
|
-
|
|
957
|
+
i.push(
|
|
958
|
+
x("unsupported_operation", s.reason || s.requestedAction)
|
|
915
959
|
);
|
|
916
960
|
break;
|
|
917
961
|
}
|
|
918
|
-
return { dashboard: n, warnings: r, skippedOperations:
|
|
962
|
+
return { dashboard: n, warnings: r, skippedOperations: i };
|
|
919
963
|
}
|
|
920
|
-
function
|
|
964
|
+
function b(e, t, n) {
|
|
921
965
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
922
966
|
}
|
|
923
967
|
function F(e, t) {
|
|
924
968
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
925
969
|
}
|
|
926
|
-
function
|
|
970
|
+
function pe(e, t) {
|
|
927
971
|
if (!t.has(e))
|
|
928
972
|
return t.add(e), e;
|
|
929
973
|
let n = 2, r = `${e}-${n}`;
|
|
@@ -934,17 +978,17 @@ function ue(e, t) {
|
|
|
934
978
|
function T(e) {
|
|
935
979
|
return !!(e && typeof e == "object");
|
|
936
980
|
}
|
|
937
|
-
function
|
|
981
|
+
function he(e) {
|
|
938
982
|
return Array.isArray(e.inputs) ? e.inputs.filter(
|
|
939
983
|
(t) => T(t) && typeof t.id == "string"
|
|
940
984
|
) : [];
|
|
941
985
|
}
|
|
942
|
-
function
|
|
986
|
+
function U(e) {
|
|
943
987
|
return Array.isArray(e.sections) ? e.sections.filter(
|
|
944
988
|
(t) => T(t)
|
|
945
989
|
) : [];
|
|
946
990
|
}
|
|
947
|
-
function
|
|
991
|
+
function J(e) {
|
|
948
992
|
return Array.isArray(e.views) ? e.views.filter(
|
|
949
993
|
(t) => T(t)
|
|
950
994
|
) : [];
|
|
@@ -954,95 +998,95 @@ function A(e) {
|
|
|
954
998
|
return [];
|
|
955
999
|
const t = [];
|
|
956
1000
|
for (const n of e) {
|
|
957
|
-
const r =
|
|
1001
|
+
const r = S(n);
|
|
958
1002
|
r && t.push(r);
|
|
959
1003
|
}
|
|
960
1004
|
return t;
|
|
961
1005
|
}
|
|
962
|
-
function
|
|
1006
|
+
function rt(e) {
|
|
963
1007
|
var r;
|
|
964
1008
|
if (!e)
|
|
965
1009
|
return [];
|
|
966
1010
|
const t = [];
|
|
967
1011
|
if (V(e.source) && t.push(e.source), e.kind === "metric") {
|
|
968
1012
|
t.push(...A(e.metrics));
|
|
969
|
-
const
|
|
970
|
-
|
|
1013
|
+
const i = S(e.dateField);
|
|
1014
|
+
i && t.push(i), t.push(...A(e.dimensions)), t.push(
|
|
971
1015
|
...A(
|
|
972
|
-
(r = e.filters) == null ? void 0 : r.map((
|
|
1016
|
+
(r = e.filters) == null ? void 0 : r.map((a) => a.field)
|
|
973
1017
|
)
|
|
974
1018
|
);
|
|
975
1019
|
} else if (e.kind === "records") {
|
|
976
|
-
const
|
|
977
|
-
|
|
1020
|
+
const i = S(e.dateField);
|
|
1021
|
+
i && t.push(i), t.push(...A(e.fields));
|
|
978
1022
|
} else if (e.kind === "inputOptions") {
|
|
979
|
-
const
|
|
980
|
-
|
|
1023
|
+
const i = S(e.field);
|
|
1024
|
+
i && t.push(i);
|
|
981
1025
|
} else e.kind === "sql" && t.push(...A(e.fields));
|
|
982
1026
|
const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
983
|
-
for (const
|
|
984
|
-
const
|
|
985
|
-
|
|
1027
|
+
for (const i of n) {
|
|
1028
|
+
const a = S(i.field);
|
|
1029
|
+
a && t.push(a);
|
|
986
1030
|
}
|
|
987
1031
|
return t;
|
|
988
1032
|
}
|
|
989
|
-
function
|
|
1033
|
+
function at(e) {
|
|
990
1034
|
const t = [];
|
|
991
|
-
for (const n of
|
|
992
|
-
const r =
|
|
1035
|
+
for (const n of he(e)) {
|
|
1036
|
+
const r = S(n.field);
|
|
993
1037
|
r && t.push(r);
|
|
994
1038
|
}
|
|
995
|
-
for (const n of
|
|
996
|
-
for (const r of
|
|
997
|
-
t.push(...
|
|
1039
|
+
for (const n of U(e))
|
|
1040
|
+
for (const r of J(n))
|
|
1041
|
+
t.push(...rt(r.analytics));
|
|
998
1042
|
return t;
|
|
999
1043
|
}
|
|
1000
|
-
function
|
|
1044
|
+
function it(e) {
|
|
1001
1045
|
var n;
|
|
1002
1046
|
const t = [];
|
|
1003
|
-
for (const r of
|
|
1004
|
-
for (const
|
|
1005
|
-
V((n =
|
|
1047
|
+
for (const r of U(e))
|
|
1048
|
+
for (const i of J(r))
|
|
1049
|
+
V((n = i.analytics) == null ? void 0 : n.source) && t.push(i.analytics.source);
|
|
1006
1050
|
return t;
|
|
1007
1051
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const n =
|
|
1052
|
+
function ot(e, t) {
|
|
1053
|
+
const n = P(e).filter(V);
|
|
1010
1054
|
if (n.length === 0)
|
|
1011
1055
|
return t.push(
|
|
1012
|
-
|
|
1056
|
+
b(
|
|
1013
1057
|
"missing_materializable_dataset",
|
|
1014
1058
|
"No semantic or physical source could be converted into the current dashboard authoring dataset reference."
|
|
1015
1059
|
)
|
|
1016
1060
|
), [];
|
|
1017
|
-
const r = n.every((
|
|
1061
|
+
const r = n.every((a) => a.kind === "semantic"), i = Array.from(
|
|
1018
1062
|
new Set(
|
|
1019
|
-
n.filter((
|
|
1063
|
+
n.filter((a) => a.kind === "semantic").map((a) => a.domainId)
|
|
1020
1064
|
)
|
|
1021
1065
|
);
|
|
1022
|
-
return n.length > 1 && (!r ||
|
|
1023
|
-
|
|
1066
|
+
return n.length > 1 && (!r || i.length !== 1) ? (t.push(
|
|
1067
|
+
b(
|
|
1024
1068
|
"multiple_datasets_out_of_scope",
|
|
1025
1069
|
"The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
|
|
1026
1070
|
)
|
|
1027
1071
|
), [n[0]]) : n;
|
|
1028
1072
|
}
|
|
1029
|
-
function
|
|
1030
|
-
const n =
|
|
1031
|
-
|
|
1073
|
+
function st(e, t) {
|
|
1074
|
+
const n = U(e), r = he(e), i = P(at(e)), a = P(
|
|
1075
|
+
it(e)
|
|
1032
1076
|
);
|
|
1033
1077
|
return {
|
|
1034
1078
|
sections: n,
|
|
1035
1079
|
inputs: r,
|
|
1036
|
-
sources:
|
|
1037
|
-
primarySources:
|
|
1038
|
-
defaultSource:
|
|
1039
|
-
datasets:
|
|
1080
|
+
sources: i,
|
|
1081
|
+
primarySources: a,
|
|
1082
|
+
defaultSource: a.length === 1 ? a[0] : void 0,
|
|
1083
|
+
datasets: ot(i, t)
|
|
1040
1084
|
};
|
|
1041
1085
|
}
|
|
1042
|
-
function
|
|
1043
|
-
return e &&
|
|
1086
|
+
function dt(e) {
|
|
1087
|
+
return e && re(e).ok ? e : void 0;
|
|
1044
1088
|
}
|
|
1045
|
-
function
|
|
1089
|
+
function ct(e) {
|
|
1046
1090
|
var t;
|
|
1047
1091
|
switch ((t = e.presentation) == null ? void 0 : t.kind) {
|
|
1048
1092
|
case "kpi":
|
|
@@ -1061,11 +1105,11 @@ function ot(e) {
|
|
|
1061
1105
|
return null;
|
|
1062
1106
|
}
|
|
1063
1107
|
}
|
|
1064
|
-
function
|
|
1108
|
+
function lt(e) {
|
|
1065
1109
|
var t, n, r;
|
|
1066
1110
|
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((n = e.presentation) == null ? void 0 : n.kind) === "table" ? "table" : ((r = e.presentation) == null ? void 0 : r.kind) === "text" ? "text" : "chart";
|
|
1067
1111
|
}
|
|
1068
|
-
function
|
|
1112
|
+
function ut(e) {
|
|
1069
1113
|
switch (e) {
|
|
1070
1114
|
case "not_in":
|
|
1071
1115
|
return "not in";
|
|
@@ -1077,54 +1121,54 @@ function dt(e) {
|
|
|
1077
1121
|
return e || "in";
|
|
1078
1122
|
}
|
|
1079
1123
|
}
|
|
1080
|
-
function
|
|
1124
|
+
function ft(e) {
|
|
1081
1125
|
return T(e.field) ? e.field.dataType === "datetime" ? "date" : e.field.dataType || "string" : "string";
|
|
1082
1126
|
}
|
|
1083
|
-
function
|
|
1127
|
+
function pt(e) {
|
|
1084
1128
|
if (!(!e || e.kind !== "physical"))
|
|
1085
1129
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
1086
1130
|
}
|
|
1087
|
-
function
|
|
1131
|
+
function ht(e, t, n, r, i, a) {
|
|
1088
1132
|
if (e.kind !== "filter")
|
|
1089
|
-
return
|
|
1090
|
-
|
|
1133
|
+
return a.push(
|
|
1134
|
+
b(
|
|
1091
1135
|
"control_inputs_deferred",
|
|
1092
1136
|
`Control input "${e.label}" is represented in the protocol but not yet materialized by the dashboard authoring adapter.`
|
|
1093
1137
|
)
|
|
1094
1138
|
), null;
|
|
1095
1139
|
if (!T(e.field) || typeof e.field.name != "string")
|
|
1096
|
-
return
|
|
1097
|
-
|
|
1140
|
+
return a.push(
|
|
1141
|
+
b(
|
|
1098
1142
|
"filter_requires_field",
|
|
1099
1143
|
`Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
|
|
1100
1144
|
)
|
|
1101
1145
|
), null;
|
|
1102
|
-
const o =
|
|
1146
|
+
const o = Se({
|
|
1103
1147
|
explicitSource: void 0,
|
|
1104
1148
|
field: e.field,
|
|
1105
1149
|
defaultSource: t,
|
|
1106
1150
|
fallbackSources: n
|
|
1107
1151
|
}), d = (o == null ? void 0 : o.kind) === "semantic" || (o == null ? void 0 : o.kind) === "physical" ? o.connectionId : void 0;
|
|
1108
1152
|
if (!d)
|
|
1109
|
-
return
|
|
1110
|
-
|
|
1153
|
+
return a.push(
|
|
1154
|
+
b(
|
|
1111
1155
|
"filter_requires_connection_id",
|
|
1112
1156
|
`Filter "${e.label}" needs a source connectionId before the dashboard compiler can materialize it.`
|
|
1113
1157
|
)
|
|
1114
1158
|
), null;
|
|
1115
1159
|
const h = {
|
|
1116
|
-
id: `filter-${
|
|
1160
|
+
id: `filter-${pe(
|
|
1117
1161
|
F(e.id, e.field.name),
|
|
1118
|
-
|
|
1162
|
+
i
|
|
1119
1163
|
)}`,
|
|
1120
1164
|
variableName: e.id,
|
|
1121
1165
|
connectionId: d,
|
|
1122
1166
|
title: e.label,
|
|
1123
1167
|
column: e.field.name,
|
|
1124
|
-
dataType:
|
|
1125
|
-
qualifiedTableName:
|
|
1168
|
+
dataType: ft(e),
|
|
1169
|
+
qualifiedTableName: pt(o),
|
|
1126
1170
|
sql: "",
|
|
1127
|
-
operation:
|
|
1171
|
+
operation: ut(e.operator),
|
|
1128
1172
|
type: e.multi === !1 ? "single" : "multiple",
|
|
1129
1173
|
location: "dashboard",
|
|
1130
1174
|
displayMode: "toolbar",
|
|
@@ -1145,7 +1189,7 @@ function ut(e, t, n, r, a, i) {
|
|
|
1145
1189
|
variableName: e.id,
|
|
1146
1190
|
scope: r,
|
|
1147
1191
|
filter: h,
|
|
1148
|
-
defaultValue:
|
|
1192
|
+
defaultValue: G(
|
|
1149
1193
|
h,
|
|
1150
1194
|
e.defaultValue
|
|
1151
1195
|
)
|
|
@@ -1154,26 +1198,26 @@ function ut(e, t, n, r, a, i) {
|
|
|
1154
1198
|
function L(e) {
|
|
1155
1199
|
const t = [], n = [];
|
|
1156
1200
|
for (const r of e.viewIds) {
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1201
|
+
const i = e.viewIdToCardId.get(r);
|
|
1202
|
+
i ? t.push(i) : n.push(r);
|
|
1159
1203
|
}
|
|
1160
1204
|
return n.length > 0 && e.warnings.push(
|
|
1161
|
-
|
|
1205
|
+
b(
|
|
1162
1206
|
"input_scope_view_not_found",
|
|
1163
1207
|
`Filter "${e.inputLabel}" referenced unknown view ids: ${n.join(", ")}.`
|
|
1164
1208
|
)
|
|
1165
1209
|
), Array.from(new Set(t));
|
|
1166
1210
|
}
|
|
1167
|
-
function
|
|
1168
|
-
var r,
|
|
1211
|
+
function mt(e) {
|
|
1212
|
+
var r, i;
|
|
1169
1213
|
if (!e.protocolScope) {
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1214
|
+
const a = Array.from(new Set(e.boundCardIds));
|
|
1215
|
+
return a.length > 0 && a.length < e.allCardIds.length ? { kind: "cards", cardIds: a } : void 0;
|
|
1172
1216
|
}
|
|
1173
1217
|
if (e.protocolScope.level === "dashboard") {
|
|
1174
1218
|
if (!((r = e.protocolScope.excludeViewIds) != null && r.length))
|
|
1175
1219
|
return;
|
|
1176
|
-
const
|
|
1220
|
+
const a = new Set(
|
|
1177
1221
|
L({
|
|
1178
1222
|
inputLabel: e.inputLabel,
|
|
1179
1223
|
viewIds: e.protocolScope.excludeViewIds,
|
|
@@ -1183,32 +1227,32 @@ function ft(e) {
|
|
|
1183
1227
|
);
|
|
1184
1228
|
return {
|
|
1185
1229
|
kind: "cards",
|
|
1186
|
-
cardIds: e.allCardIds.filter((o) => !
|
|
1230
|
+
cardIds: e.allCardIds.filter((o) => !a.has(o))
|
|
1187
1231
|
};
|
|
1188
1232
|
}
|
|
1189
1233
|
if (e.protocolScope.level === "view") {
|
|
1190
|
-
const
|
|
1234
|
+
const a = L({
|
|
1191
1235
|
inputLabel: e.inputLabel,
|
|
1192
1236
|
viewIds: e.protocolScope.viewIds,
|
|
1193
1237
|
viewIdToCardId: e.viewIdToCardId,
|
|
1194
1238
|
warnings: e.warnings
|
|
1195
1239
|
});
|
|
1196
|
-
return
|
|
1197
|
-
|
|
1240
|
+
return a.length === 0 ? (e.warnings.push(
|
|
1241
|
+
b(
|
|
1198
1242
|
"input_scope_has_no_materialized_cards",
|
|
1199
1243
|
`Filter "${e.inputLabel}" was deferred because its view scope does not match any materialized cards.`
|
|
1200
1244
|
)
|
|
1201
|
-
), null) : { kind: "cards", cardIds:
|
|
1245
|
+
), null) : { kind: "cards", cardIds: a };
|
|
1202
1246
|
}
|
|
1203
1247
|
const t = e.sectionIdToCardIds.get(e.protocolScope.sectionId) || [];
|
|
1204
1248
|
if (t.length === 0)
|
|
1205
1249
|
return e.warnings.push(
|
|
1206
|
-
|
|
1250
|
+
b(
|
|
1207
1251
|
"input_scope_section_not_found",
|
|
1208
1252
|
`Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
|
|
1209
1253
|
)
|
|
1210
1254
|
), null;
|
|
1211
|
-
if (!((
|
|
1255
|
+
if (!((i = e.protocolScope.excludeViewIds) != null && i.length))
|
|
1212
1256
|
return { kind: "cards", cardIds: t };
|
|
1213
1257
|
const n = new Set(
|
|
1214
1258
|
L({
|
|
@@ -1220,39 +1264,39 @@ function ft(e) {
|
|
|
1220
1264
|
);
|
|
1221
1265
|
return {
|
|
1222
1266
|
kind: "cards",
|
|
1223
|
-
cardIds: t.filter((
|
|
1267
|
+
cardIds: t.filter((a) => !n.has(a))
|
|
1224
1268
|
};
|
|
1225
1269
|
}
|
|
1226
|
-
function
|
|
1227
|
-
var
|
|
1228
|
-
const t = [], n =
|
|
1229
|
-
for (const
|
|
1230
|
-
t.push(
|
|
1231
|
-
for (const
|
|
1232
|
-
t.push(
|
|
1233
|
-
const r =
|
|
1270
|
+
function xt(e) {
|
|
1271
|
+
var v, y, c;
|
|
1272
|
+
const t = [], n = ye(e);
|
|
1273
|
+
for (const f of n.warnings)
|
|
1274
|
+
t.push(b(f.code, f.message));
|
|
1275
|
+
for (const f of n.errors)
|
|
1276
|
+
t.push(b(f.code, f.message));
|
|
1277
|
+
const r = st(e, t), i = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1234
1278
|
let h = 0;
|
|
1235
|
-
for (const [
|
|
1236
|
-
const l = typeof
|
|
1237
|
-
o.set(
|
|
1238
|
-
for (const [
|
|
1239
|
-
const
|
|
1240
|
-
m.id || `${l}-${m.title || `View ${
|
|
1241
|
-
`card-${
|
|
1279
|
+
for (const [f, g] of r.sections.entries()) {
|
|
1280
|
+
const l = typeof g.title == "string" ? g.title : `Section ${f + 1}`, Q = g.id || F(l, `section-${f + 1}`);
|
|
1281
|
+
o.set(Q, []);
|
|
1282
|
+
for (const [X, m] of J(g).entries()) {
|
|
1283
|
+
const Y = ct(m), z = F(
|
|
1284
|
+
m.id || `${l}-${m.title || `View ${X + 1}`}`,
|
|
1285
|
+
`card-${f + 1}-${X + 1}`
|
|
1242
1286
|
);
|
|
1243
|
-
if (!
|
|
1287
|
+
if (!Y) {
|
|
1244
1288
|
t.push(
|
|
1245
|
-
|
|
1289
|
+
b(
|
|
1246
1290
|
"unsupported_presentation",
|
|
1247
|
-
`Dashboard presentation "${((
|
|
1291
|
+
`Dashboard presentation "${((v = m.presentation) == null ? void 0 : v.kind) || "unknown"}" is not supported by the dashboard authoring adapter.`,
|
|
1248
1292
|
`card-${z}`
|
|
1249
1293
|
)
|
|
1250
1294
|
);
|
|
1251
1295
|
continue;
|
|
1252
1296
|
}
|
|
1253
|
-
if (((
|
|
1297
|
+
if (((y = m.analytics) == null ? void 0 : y.kind) === "sql") {
|
|
1254
1298
|
t.push(
|
|
1255
|
-
|
|
1299
|
+
b(
|
|
1256
1300
|
"sql_intent_deferred",
|
|
1257
1301
|
"SQL analytics intent is valid protocol, but the current dashboard authoring adapter only materializes semantic and physical config-card intents.",
|
|
1258
1302
|
`card-${z}`
|
|
@@ -1260,46 +1304,46 @@ function vt(e) {
|
|
|
1260
1304
|
);
|
|
1261
1305
|
continue;
|
|
1262
1306
|
}
|
|
1263
|
-
const
|
|
1264
|
-
m.id &&
|
|
1265
|
-
const
|
|
1266
|
-
for (const
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1307
|
+
const Z = pe(z, s), $ = `card-${Z}`;
|
|
1308
|
+
m.id && a.set(m.id, $), (c = o.get(Q)) == null || c.push($);
|
|
1309
|
+
const me = m.analytics && "inputs" in m.analytics ? m.analytics.inputs : void 0;
|
|
1310
|
+
for (const ee of me || []) {
|
|
1311
|
+
const te = d.get(ee.inputId) || [];
|
|
1312
|
+
te.push($), d.set(ee.inputId, te);
|
|
1269
1313
|
}
|
|
1270
|
-
|
|
1314
|
+
i.push({
|
|
1271
1315
|
id: $,
|
|
1272
|
-
frameId: `frame-${
|
|
1316
|
+
frameId: `frame-${Z}`,
|
|
1273
1317
|
title: m.title,
|
|
1274
1318
|
description: m.description,
|
|
1275
|
-
type:
|
|
1276
|
-
role:
|
|
1319
|
+
type: Y,
|
|
1320
|
+
role: lt(m),
|
|
1277
1321
|
priority: h,
|
|
1278
1322
|
section: l,
|
|
1279
|
-
analyticsIntent:
|
|
1323
|
+
analyticsIntent: dt(m.analytics),
|
|
1280
1324
|
text: m.text
|
|
1281
1325
|
}), h += 1;
|
|
1282
1326
|
}
|
|
1283
1327
|
}
|
|
1284
|
-
const
|
|
1285
|
-
const
|
|
1286
|
-
protocolScope:
|
|
1287
|
-
inputLabel:
|
|
1288
|
-
allCardIds:
|
|
1289
|
-
boundCardIds: d.get(
|
|
1290
|
-
viewIdToCardId:
|
|
1328
|
+
const I = r.inputs.map((f) => {
|
|
1329
|
+
const g = mt({
|
|
1330
|
+
protocolScope: f.scope,
|
|
1331
|
+
inputLabel: f.label,
|
|
1332
|
+
allCardIds: i.map((l) => l.id),
|
|
1333
|
+
boundCardIds: d.get(f.id) || [],
|
|
1334
|
+
viewIdToCardId: a,
|
|
1291
1335
|
sectionIdToCardIds: o,
|
|
1292
1336
|
warnings: t
|
|
1293
1337
|
});
|
|
1294
|
-
return
|
|
1295
|
-
|
|
1338
|
+
return g === null ? null : ht(
|
|
1339
|
+
f,
|
|
1296
1340
|
r.defaultSource,
|
|
1297
1341
|
r.sources,
|
|
1298
|
-
|
|
1342
|
+
g,
|
|
1299
1343
|
u,
|
|
1300
1344
|
t
|
|
1301
1345
|
);
|
|
1302
|
-
}).filter((
|
|
1346
|
+
}).filter((f) => !!f);
|
|
1303
1347
|
return { plan: {
|
|
1304
1348
|
version: 1,
|
|
1305
1349
|
id: `plan-${F(e.title, "dashboard")}`,
|
|
@@ -1312,35 +1356,35 @@ function vt(e) {
|
|
|
1312
1356
|
title: e.title,
|
|
1313
1357
|
description: e.description,
|
|
1314
1358
|
kind: "dashboard",
|
|
1315
|
-
cards:
|
|
1359
|
+
cards: i
|
|
1316
1360
|
}
|
|
1317
1361
|
],
|
|
1318
|
-
filterInputs:
|
|
1362
|
+
filterInputs: I.length ? I : void 0,
|
|
1319
1363
|
warnings: t.length ? t : void 0,
|
|
1320
|
-
unresolvedRequests: n.ok ? void 0 : n.errors.map((
|
|
1364
|
+
unresolvedRequests: n.ok ? void 0 : n.errors.map((f) => f.message)
|
|
1321
1365
|
}, warnings: t };
|
|
1322
1366
|
}
|
|
1323
1367
|
export {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1368
|
+
ge as DASHBOARD_AUTHORING_BREAKPOINTS,
|
|
1369
|
+
B as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
1370
|
+
kt as applyDashboardChangePlan,
|
|
1371
|
+
Ct as compileDashboardFromPlan,
|
|
1372
|
+
K as compileResponsiveDashboardLayouts,
|
|
1373
|
+
H as dashboardAuthoringDatasetMatchesSource,
|
|
1374
|
+
vt as dashboardAuthoringFieldsReferToSameTarget,
|
|
1375
|
+
S as dashboardAuthoringSourceFromField,
|
|
1376
|
+
_t as dashboardAuthoringSourceKey,
|
|
1377
|
+
ae as dashboardAuthoringSourcesReferToSameDataset,
|
|
1378
|
+
xt as dashboardPlanFromSemaphorDashboardIntent,
|
|
1379
|
+
St as findDashboardAuthoringDatasetForSource,
|
|
1380
|
+
Te as getDashboardAuthoringCardSource,
|
|
1337
1381
|
V as isMaterializableDashboardAuthoringSource,
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1382
|
+
we as isSemaphorSourceRef,
|
|
1383
|
+
P as mergeDashboardAuthoringSources,
|
|
1384
|
+
ve as preferDashboardAuthoringSourceMetadata,
|
|
1385
|
+
wt as preferredDashboardAuthoringSource,
|
|
1386
|
+
Se as resolveDashboardAuthoringSource,
|
|
1387
|
+
$e as validateDashboardAuthoringDatasetScope,
|
|
1388
|
+
Pe as validateDashboardChangePlan,
|
|
1389
|
+
Be as validateDashboardPlan
|
|
1346
1390
|
};
|