react-semaphor 0.1.419 → 0.1.421
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +28 -27
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/analyze-result-contract-B5Eeu7vD.js +1 -0
- package/dist/chunks/analyze-result-contract-sWcmvBOA.js +2070 -0
- package/dist/chunks/{calendar-preferences-dialog-f0Z7Kf-U.js → calendar-preferences-dialog-CscmhyuZ.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DIfAbE_y.js → calendar-preferences-dialog-cN3_2C-u.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-anh-Jy5v.js → dashboard-briefing-launcher-BYTBNetR.js} +4 -4
- package/dist/chunks/{dashboard-briefing-launcher-C3tNkGFG.js → dashboard-briefing-launcher-DmZkzIC3.js} +1 -1
- package/dist/chunks/{dashboard-controls-DQxlOxzy.js → dashboard-controls-9DFeKIP4.js} +1 -1
- package/dist/chunks/{dashboard-controls-8dCQaPaq.js → dashboard-controls-PhzuaTBj.js} +5 -5
- package/dist/chunks/{dashboard-json-i7Ae9KGD.js → dashboard-json-Cxhw2TZc.js} +3 -3
- package/dist/chunks/{dashboard-json-B309EInF.js → dashboard-json-DyRHI3mL.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-4HycwBHR.js → edit-dashboard-visual-3_jiBXsu.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-z3IqzYnj.js → edit-dashboard-visual-BigSJ3-x.js} +4 -4
- package/dist/chunks/{index-yxKWKFdr.js → index-BKDQw0aK.js} +2 -2
- package/dist/chunks/{index-B6DLEXRX.js → index-CH2ZzQo4.js} +5 -5
- package/dist/chunks/{switch-D6Ygf3wA.js → switch-CiOjVyVI.js} +1 -1
- package/dist/chunks/{switch-COWQU8aK.js → switch-TbCsyhv9.js} +1 -1
- package/dist/chunks/{update-policy-BzT2k4n6.js → update-policy-2MZ-Vf7v.js} +211 -187
- package/dist/chunks/update-policy-qpyAkOyO.js +3 -0
- package/dist/chunks/{use-create-flow-overlay-state-CX0D-6HM.js → use-create-flow-overlay-state-BzcJWNzh.js} +3 -3
- package/dist/chunks/{use-create-flow-overlay-state-DENfd7sW.js → use-create-flow-overlay-state-DUQmgb9H.js} +1 -1
- package/dist/chunks/{validators-Cxr9qbrR.js → validators-D0pfj3jJ.js} +93 -93
- package/dist/chunks/validators-Dj1Y-46V.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +14 -14
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +251 -139
- package/dist/data-app-codegen-node/index.js +806 -657
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +743 -693
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +51 -51
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +12 -5
- package/dist/types/dashboard-assistant.d.ts +0 -5
- package/dist/types/data-app-codegen-node.d.ts +12 -2
- package/dist/types/data-app-codegen.d.ts +12 -2
- package/dist/types/data-app-sdk-validation.d.ts +0 -5
- package/dist/types/data-app-sdk.d.ts +17 -5
- package/package.json +1 -1
- package/dist/chunks/analyze-result-contract-DdhEt99q.js +0 -2004
- package/dist/chunks/analyze-result-contract-DwRzl7yJ.js +0 -1
- package/dist/chunks/update-policy-VloD-0YM.js +0 -3
- package/dist/chunks/validators-BMQo93Y0.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { M as
|
|
7
|
-
import { X as
|
|
8
|
-
import { b as
|
|
1
|
+
import { toSemaphorInputSnapshots as jr, toSemaphorInputBinding as Hr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Pr, toSemaphorSqlIntent as Vr, toSemaphorInputOptionsIntent as Qr, toSemaphorRecordsIntent as Ur, toSemaphorAnalysisQueryOptions as Gr, toSemaphorAnalysisIntent as Jr, toSemaphorMetricIntent as Yr, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as hr, toSemaphorInputSpec as br } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as vr, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as xe, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Xr, useId as Sr, useCallback as D, useReducer as Zr } from "react";
|
|
4
|
+
import { I as et, L as rt } from "../chunks/analyze-result-contract-sWcmvBOA.js";
|
|
5
|
+
import { b as ao, M as lo } from "../chunks/analyze-result-contract-sWcmvBOA.js";
|
|
6
|
+
import { M as tt, a as nt, S as it, E as ot, C as st } from "../chunks/search-BHsQIWBV.js";
|
|
7
|
+
import { X as at, C as lt, j as dt } from "../chunks/x-CXDkqdur.js";
|
|
8
|
+
import { b as ut } from "../chunks/validators-D0pfj3jJ.js";
|
|
9
9
|
function me(e, r, t = {}) {
|
|
10
10
|
return {
|
|
11
11
|
...t,
|
|
@@ -13,13 +13,13 @@ function me(e, r, t = {}) {
|
|
|
13
13
|
role: r
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Gi(e) {
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Ji(e) {
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Yi = {
|
|
23
23
|
source: {
|
|
24
24
|
semantic(e) {
|
|
25
25
|
return {
|
|
@@ -57,7 +57,7 @@ const Hi = {
|
|
|
57
57
|
bindInput(e, r) {
|
|
58
58
|
return {
|
|
59
59
|
toAnalyticsInput() {
|
|
60
|
-
const [t] =
|
|
60
|
+
const [t] = jr([e]), n = Hr({
|
|
61
61
|
...r,
|
|
62
62
|
inputId: r.inputId || t.inputId
|
|
63
63
|
});
|
|
@@ -129,38 +129,38 @@ const Hi = {
|
|
|
129
129
|
queryKind: "matrix"
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
}, ce = 10,
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
switch (
|
|
132
|
+
}, ce = 10, Ne = 8;
|
|
133
|
+
function He(e, r) {
|
|
134
|
+
const t = e == null ? void 0 : e.result;
|
|
135
|
+
if (t)
|
|
136
|
+
switch (t.kind) {
|
|
137
137
|
case "records":
|
|
138
138
|
return le({
|
|
139
139
|
title: "Records",
|
|
140
140
|
rowNoun: "rows",
|
|
141
|
-
records:
|
|
142
|
-
columns:
|
|
143
|
-
rowCount:
|
|
141
|
+
records: t.records,
|
|
142
|
+
columns: t.columns,
|
|
143
|
+
rowCount: t.rowCount
|
|
144
144
|
});
|
|
145
145
|
case "sql":
|
|
146
146
|
return le({
|
|
147
147
|
title: "SQL Rows",
|
|
148
148
|
rowNoun: "rows",
|
|
149
|
-
records:
|
|
150
|
-
columns:
|
|
151
|
-
rowCount:
|
|
149
|
+
records: t.records,
|
|
150
|
+
columns: t.columns,
|
|
151
|
+
rowCount: t.rowCount
|
|
152
152
|
});
|
|
153
153
|
case "inputOptions":
|
|
154
154
|
return le({
|
|
155
155
|
title: "Options",
|
|
156
156
|
rowNoun: "options",
|
|
157
|
-
records:
|
|
158
|
-
var
|
|
157
|
+
records: t.options.slice(0, ce).map((n) => {
|
|
158
|
+
var i;
|
|
159
159
|
return {
|
|
160
|
-
label:
|
|
161
|
-
value:
|
|
162
|
-
count:
|
|
163
|
-
disambiguation: (
|
|
160
|
+
label: n.label,
|
|
161
|
+
value: n.value,
|
|
162
|
+
count: n.count,
|
|
163
|
+
disambiguation: (i = n.disambiguation) == null ? void 0 : i.join(" / ")
|
|
164
164
|
};
|
|
165
165
|
}),
|
|
166
166
|
columns: [
|
|
@@ -169,42 +169,22 @@ function lt(e) {
|
|
|
169
169
|
{ key: "count", label: "Count" },
|
|
170
170
|
{ key: "disambiguation", label: "Disambiguation" }
|
|
171
171
|
],
|
|
172
|
-
rowCount:
|
|
173
|
-
});
|
|
174
|
-
case "metric": {
|
|
175
|
-
const t = [
|
|
176
|
-
{ metric: "primaryValue", value: r.primaryValue }
|
|
177
|
-
];
|
|
178
|
-
return r.comparison && t.push(
|
|
179
|
-
{
|
|
180
|
-
metric: `${r.comparison.kind} value`,
|
|
181
|
-
value: r.comparison.value
|
|
182
|
-
},
|
|
183
|
-
{ metric: "delta", value: r.comparison.delta },
|
|
184
|
-
{ metric: "deltaPercent", value: r.comparison.deltaPercent }
|
|
185
|
-
), le({
|
|
186
|
-
title: "Metric",
|
|
187
|
-
rowNoun: "values",
|
|
188
|
-
records: t,
|
|
189
|
-
columns: [
|
|
190
|
-
{ key: "metric", label: "Metric" },
|
|
191
|
-
{ key: "value", label: "Value" }
|
|
192
|
-
],
|
|
193
|
-
rowCount: t.length
|
|
172
|
+
rowCount: t.rowCount ?? t.options.length
|
|
194
173
|
});
|
|
195
|
-
|
|
174
|
+
case "metric":
|
|
175
|
+
return ct(t, r);
|
|
196
176
|
case "matrix":
|
|
197
177
|
return le({
|
|
198
178
|
title: "Matrix Cells",
|
|
199
179
|
rowNoun: "cells",
|
|
200
|
-
records:
|
|
201
|
-
const
|
|
180
|
+
records: t.cells.slice(0, ce).map((n) => {
|
|
181
|
+
const i = t.nodesById[n.rowId], o = n.columnId ? t.nodesById[n.columnId] : void 0, u = t.measuresById[n.measureId];
|
|
202
182
|
return {
|
|
203
|
-
row: (
|
|
204
|
-
column: (
|
|
205
|
-
measure: (
|
|
206
|
-
value:
|
|
207
|
-
role:
|
|
183
|
+
row: (i == null ? void 0 : i.label) || n.rowId,
|
|
184
|
+
column: (o == null ? void 0 : o.label) || n.columnId || "Total",
|
|
185
|
+
measure: (u == null ? void 0 : u.label) || n.measureId,
|
|
186
|
+
value: n.formattedValue ?? n.value,
|
|
187
|
+
role: n.role
|
|
208
188
|
};
|
|
209
189
|
}),
|
|
210
190
|
columns: [
|
|
@@ -214,12 +194,52 @@ function lt(e) {
|
|
|
214
194
|
{ key: "value", label: "Value" },
|
|
215
195
|
{ key: "role", label: "Role" }
|
|
216
196
|
],
|
|
217
|
-
rowCount:
|
|
197
|
+
rowCount: t.rowCount ?? t.cells.length
|
|
218
198
|
});
|
|
219
199
|
default:
|
|
220
|
-
return
|
|
200
|
+
return pt(t);
|
|
221
201
|
}
|
|
222
202
|
}
|
|
203
|
+
function ct(e, r) {
|
|
204
|
+
var o, u, f, d, c;
|
|
205
|
+
const t = [
|
|
206
|
+
{
|
|
207
|
+
metric: "primaryValue",
|
|
208
|
+
value: (r == null ? void 0 : r.primaryValue) ?? e.primaryValue
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
r && "value" in r && t.push({ metric: "value", value: r.value });
|
|
212
|
+
const n = (r == null ? void 0 : r.comparisonKind) ?? ((o = e.comparison) == null ? void 0 : o.kind);
|
|
213
|
+
return n && t.push(
|
|
214
|
+
{
|
|
215
|
+
metric: `${n} value`,
|
|
216
|
+
value: (r == null ? void 0 : r.comparisonValue) ?? ((u = e.comparison) == null ? void 0 : u.value)
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
metric: "delta",
|
|
220
|
+
value: (r == null ? void 0 : r.delta) ?? ((f = e.comparison) == null ? void 0 : f.delta)
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
metric: "deltaPercent",
|
|
224
|
+
value: (r == null ? void 0 : r.deltaPercent) ?? ((d = e.comparison) == null ? void 0 : d.deltaPercent)
|
|
225
|
+
}
|
|
226
|
+
), (((c = r == null ? void 0 : r.missingMeasures) == null ? void 0 : c.filter(Boolean)) ?? []).forEach((g) => {
|
|
227
|
+
t.push({ metric: `missing:${g}`, value: "missing" });
|
|
228
|
+
}), Object.entries((r == null ? void 0 : r.measures) ?? {}).sort(([g], [m]) => g.localeCompare(m)).forEach(([g, m]) => {
|
|
229
|
+
t.push({ metric: `measure:${g}`, value: m });
|
|
230
|
+
}), Object.entries((r == null ? void 0 : r.measureBindings) ?? {}).sort(([g], [m]) => g.localeCompare(m)).forEach(([g, m]) => {
|
|
231
|
+
t.push({ metric: `binding:${g}`, value: m });
|
|
232
|
+
}), le({
|
|
233
|
+
title: "Metric",
|
|
234
|
+
rowNoun: "values",
|
|
235
|
+
records: t,
|
|
236
|
+
columns: [
|
|
237
|
+
{ key: "metric", label: "Metric" },
|
|
238
|
+
{ key: "value", label: "Value" }
|
|
239
|
+
],
|
|
240
|
+
rowCount: t.length
|
|
241
|
+
});
|
|
242
|
+
}
|
|
223
243
|
function le({
|
|
224
244
|
title: e,
|
|
225
245
|
rowNoun: r,
|
|
@@ -227,20 +247,20 @@ function le({
|
|
|
227
247
|
columns: n,
|
|
228
248
|
rowCount: i
|
|
229
249
|
}) {
|
|
230
|
-
const o =
|
|
250
|
+
const o = ft(n, t);
|
|
231
251
|
if (!o.length)
|
|
232
252
|
return;
|
|
233
253
|
const u = i ?? t.length, f = t.slice(0, ce);
|
|
234
254
|
return {
|
|
235
255
|
title: e,
|
|
236
|
-
summary: `${
|
|
237
|
-
columns: o.slice(0,
|
|
256
|
+
summary: `${mt(u)} ${r}`,
|
|
257
|
+
columns: o.slice(0, Ne),
|
|
238
258
|
rows: f,
|
|
239
259
|
truncatedRows: u > f.length,
|
|
240
|
-
truncatedColumns: o.length >
|
|
260
|
+
truncatedColumns: o.length > Ne
|
|
241
261
|
};
|
|
242
262
|
}
|
|
243
|
-
function
|
|
263
|
+
function ft(e, r) {
|
|
244
264
|
if (e != null && e.length)
|
|
245
265
|
return e.filter((n) => n.key).map((n) => ({
|
|
246
266
|
key: n.key,
|
|
@@ -251,47 +271,47 @@ function dt(e, r) {
|
|
|
251
271
|
Object.keys(n).forEach((i) => t.add(i));
|
|
252
272
|
}), [...t].map((n) => ({ key: n, label: n }));
|
|
253
273
|
}
|
|
254
|
-
function
|
|
255
|
-
throw new Error(`Unhandled Semaphor result kind: ${
|
|
274
|
+
function pt(e) {
|
|
275
|
+
throw new Error(`Unhandled Semaphor result kind: ${wr(e)}`);
|
|
256
276
|
}
|
|
257
|
-
function
|
|
258
|
-
return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ?
|
|
277
|
+
function gt(e) {
|
|
278
|
+
return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ? or(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : or(wr(e));
|
|
259
279
|
}
|
|
260
|
-
function
|
|
280
|
+
function mt(e) {
|
|
261
281
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
262
282
|
}
|
|
263
|
-
function
|
|
283
|
+
function wr(e) {
|
|
264
284
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
265
285
|
}
|
|
266
|
-
function
|
|
286
|
+
function or(e) {
|
|
267
287
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
268
288
|
}
|
|
269
|
-
function
|
|
289
|
+
function qe(e) {
|
|
270
290
|
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
271
291
|
}
|
|
272
|
-
function
|
|
292
|
+
function yt(e) {
|
|
273
293
|
if (e.label)
|
|
274
294
|
return e.label;
|
|
275
295
|
if (e.queryKind !== "inputOptions")
|
|
276
296
|
return;
|
|
277
297
|
const t = e.labelField.label || e.valueField.label || e.labelField.name || e.valueField.name || e.inputId;
|
|
278
|
-
return `${
|
|
298
|
+
return `${ht(t)} Options`;
|
|
279
299
|
}
|
|
280
|
-
function
|
|
300
|
+
function ht(e) {
|
|
281
301
|
return (e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\bfilter\b/gi, " ").replace(/\boptions?\b/gi, " ").replace(/\bid\b/gi, " ").replace(/\s+/g, " ").trim() || e).split(" ").filter(Boolean).map((n) => n === n.toUpperCase() && n.length > 1 ? n : `${n.slice(0, 1).toUpperCase()}${n.slice(1)}`).join(" ");
|
|
282
302
|
}
|
|
283
|
-
function
|
|
303
|
+
function Pe(e) {
|
|
284
304
|
return e.flatMap((r) => {
|
|
285
|
-
var
|
|
286
|
-
const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i =
|
|
287
|
-
(
|
|
288
|
-
), o =
|
|
305
|
+
var g, m, v, y;
|
|
306
|
+
const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = ke(
|
|
307
|
+
(g = n == null ? void 0 : n.validation) == null ? void 0 : g.warnings
|
|
308
|
+
), o = ke(
|
|
289
309
|
(m = n == null ? void 0 : n.validation) == null ? void 0 : m.errors
|
|
290
|
-
), u =
|
|
310
|
+
), u = wt(
|
|
291
311
|
(v = n == null ? void 0 : n.coverage) == null ? void 0 : v.missingObligations
|
|
292
|
-
), f =
|
|
293
|
-
(
|
|
294
|
-
), d = [], c =
|
|
312
|
+
), f = ke(
|
|
313
|
+
(y = n == null ? void 0 : n.coverage) == null ? void 0 : y.warnings
|
|
314
|
+
), d = [], c = qe(r);
|
|
295
315
|
(t == null ? void 0 : t.status) === "error" && d.push({
|
|
296
316
|
trace: r,
|
|
297
317
|
tone: "error",
|
|
@@ -311,7 +331,7 @@ function Me(e) {
|
|
|
311
331
|
return d;
|
|
312
332
|
});
|
|
313
333
|
}
|
|
314
|
-
function
|
|
334
|
+
function bt(e) {
|
|
315
335
|
return {
|
|
316
336
|
traceId: e.trace.traceId,
|
|
317
337
|
queryId: e.trace.queryId,
|
|
@@ -325,11 +345,11 @@ function mt(e) {
|
|
|
325
345
|
path: e.path
|
|
326
346
|
};
|
|
327
347
|
}
|
|
328
|
-
function
|
|
348
|
+
function vt(e, r) {
|
|
329
349
|
return e.filter((t) => t.trace.traceId === r.traceId).length;
|
|
330
350
|
}
|
|
331
|
-
function
|
|
332
|
-
const r =
|
|
351
|
+
function St(e) {
|
|
352
|
+
const r = Pe(e), t = e.filter(
|
|
333
353
|
(u) => {
|
|
334
354
|
var f;
|
|
335
355
|
return ((f = u.latestAttempt) == null ? void 0 : f.status) === "error";
|
|
@@ -350,15 +370,15 @@ function ht(e) {
|
|
|
350
370
|
severity: t || i ? "error" : o ? "warning" : n ? "loading" : "ok"
|
|
351
371
|
};
|
|
352
372
|
}
|
|
353
|
-
function
|
|
373
|
+
function wt(e) {
|
|
354
374
|
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
355
375
|
}
|
|
356
|
-
function
|
|
357
|
-
return Array.isArray(e) ? e.map(
|
|
376
|
+
function ke(e) {
|
|
377
|
+
return Array.isArray(e) ? e.map(It).filter(
|
|
358
378
|
(r) => !!r
|
|
359
379
|
) : [];
|
|
360
380
|
}
|
|
361
|
-
function
|
|
381
|
+
function It(e) {
|
|
362
382
|
if (typeof e == "string")
|
|
363
383
|
return { message: e };
|
|
364
384
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
@@ -373,10 +393,10 @@ function vt(e) {
|
|
|
373
393
|
...i ? { path: i } : {}
|
|
374
394
|
} : n ? { message: n, code: n } : void 0;
|
|
375
395
|
}
|
|
376
|
-
function
|
|
396
|
+
function xt(e) {
|
|
377
397
|
if (!e.enabled)
|
|
378
398
|
return e;
|
|
379
|
-
const r = e.queries.map(
|
|
399
|
+
const r = e.queries.map(Ir);
|
|
380
400
|
return {
|
|
381
401
|
enabled: e.enabled,
|
|
382
402
|
queries: r,
|
|
@@ -385,28 +405,29 @@ function St(e) {
|
|
|
385
405
|
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
386
406
|
};
|
|
387
407
|
}
|
|
388
|
-
function
|
|
389
|
-
return e ?
|
|
408
|
+
function sr(e) {
|
|
409
|
+
return e ? Ir(e) : void 0;
|
|
390
410
|
}
|
|
391
|
-
function
|
|
411
|
+
function Ir(e) {
|
|
392
412
|
var r;
|
|
393
413
|
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
394
414
|
...e,
|
|
395
415
|
latestAttempt: {
|
|
396
416
|
...e.latestAttempt,
|
|
397
|
-
|
|
417
|
+
resultPreview: e.latestAttempt.resultPreview || He(e.latestAttempt.executionResult),
|
|
418
|
+
executionResult: qt(
|
|
398
419
|
e.latestAttempt.executionResult
|
|
399
420
|
)
|
|
400
421
|
}
|
|
401
422
|
} : e;
|
|
402
423
|
}
|
|
403
|
-
function
|
|
424
|
+
function qt(e) {
|
|
404
425
|
const {
|
|
405
426
|
compiledQuery: r,
|
|
406
427
|
intent: t,
|
|
407
428
|
result: n,
|
|
408
429
|
...i
|
|
409
|
-
} = e, o =
|
|
430
|
+
} = e, o = At(
|
|
410
431
|
i.metadata
|
|
411
432
|
);
|
|
412
433
|
return {
|
|
@@ -414,7 +435,7 @@ function wt(e) {
|
|
|
414
435
|
...o ? { metadata: o } : {}
|
|
415
436
|
};
|
|
416
437
|
}
|
|
417
|
-
function
|
|
438
|
+
function At(e) {
|
|
418
439
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
419
440
|
return e;
|
|
420
441
|
const r = e.dataAppDebug;
|
|
@@ -426,7 +447,7 @@ function It(e) {
|
|
|
426
447
|
dataAppDebug: n
|
|
427
448
|
};
|
|
428
449
|
}
|
|
429
|
-
function
|
|
450
|
+
function Ct(e) {
|
|
430
451
|
return e === "relative" ? {
|
|
431
452
|
position: "relative",
|
|
432
453
|
top: "auto",
|
|
@@ -440,7 +461,7 @@ function xt(e) {
|
|
|
440
461
|
left: e.endsWith("left") ? 20 : "auto"
|
|
441
462
|
};
|
|
442
463
|
}
|
|
443
|
-
function
|
|
464
|
+
function Tt(e) {
|
|
444
465
|
return e === "error" ? {
|
|
445
466
|
borderColor: "var(--sd-error-border)",
|
|
446
467
|
background: "var(--sd-error-bg)",
|
|
@@ -459,7 +480,7 @@ function qt(e) {
|
|
|
459
480
|
color: "var(--sd-success-fg)"
|
|
460
481
|
};
|
|
461
482
|
}
|
|
462
|
-
function
|
|
483
|
+
function kt(e) {
|
|
463
484
|
return e === "right" ? {
|
|
464
485
|
top: 16,
|
|
465
486
|
right: 16,
|
|
@@ -478,23 +499,23 @@ function At(e) {
|
|
|
478
499
|
borderRadius: 6
|
|
479
500
|
};
|
|
480
501
|
}
|
|
481
|
-
function
|
|
502
|
+
function Et(e) {
|
|
482
503
|
return e === "right" ? {
|
|
483
504
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
484
505
|
} : {
|
|
485
506
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
486
507
|
};
|
|
487
508
|
}
|
|
488
|
-
function
|
|
509
|
+
function Rt(e) {
|
|
489
510
|
return {
|
|
490
511
|
borderRight: "1px solid var(--sd-border)",
|
|
491
512
|
borderBottom: 0
|
|
492
513
|
};
|
|
493
514
|
}
|
|
494
|
-
function
|
|
515
|
+
function xr(e) {
|
|
495
516
|
return e === "error" ? { background: "var(--sd-error-dot)" } : e === "success" ? { background: "var(--sd-success-dot)" } : e === "loading" ? { background: "var(--sd-loading-dot)" } : { background: "var(--sd-idle-dot)" };
|
|
496
517
|
}
|
|
497
|
-
function
|
|
518
|
+
function Lt(e) {
|
|
498
519
|
return e === "error" ? {
|
|
499
520
|
borderColor: "var(--sd-error-border)",
|
|
500
521
|
color: "var(--sd-error-fg)"
|
|
@@ -509,7 +530,7 @@ function kt(e) {
|
|
|
509
530
|
color: "var(--sd-fg-muted)"
|
|
510
531
|
};
|
|
511
532
|
}
|
|
512
|
-
const
|
|
533
|
+
const ar = "semaphor-devtools-stylesheet", R = "semaphor-devtools", $t = `
|
|
513
534
|
.${R} {
|
|
514
535
|
--sd-bg: #ffffff;
|
|
515
536
|
--sd-bg-muted: #fafafa;
|
|
@@ -626,13 +647,13 @@ const ir = "semaphor-devtools-stylesheet", R = "semaphor-devtools", Et = `
|
|
|
626
647
|
color: var(--sd-fg);
|
|
627
648
|
}
|
|
628
649
|
`;
|
|
629
|
-
function
|
|
630
|
-
if (typeof document > "u" || document.getElementById(
|
|
650
|
+
function qr() {
|
|
651
|
+
if (typeof document > "u" || document.getElementById(ar))
|
|
631
652
|
return;
|
|
632
653
|
const e = document.createElement("style");
|
|
633
|
-
e.id =
|
|
654
|
+
e.id = ar, e.textContent = $t, document.head.appendChild(e);
|
|
634
655
|
}
|
|
635
|
-
const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', W = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
656
|
+
const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', W = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ee = {
|
|
636
657
|
color: "var(--sd-fg-muted)",
|
|
637
658
|
fontSize: 10,
|
|
638
659
|
fontWeight: 600,
|
|
@@ -790,7 +811,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
790
811
|
background: "transparent",
|
|
791
812
|
color: "inherit",
|
|
792
813
|
cursor: "pointer",
|
|
793
|
-
...
|
|
814
|
+
...Ee
|
|
794
815
|
},
|
|
795
816
|
issueSummaryHeaderLabel: {
|
|
796
817
|
display: "inline-flex",
|
|
@@ -897,7 +918,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
897
918
|
alignItems: "center",
|
|
898
919
|
justifyContent: "space-between",
|
|
899
920
|
padding: "4px 6px 3px",
|
|
900
|
-
...
|
|
921
|
+
...Ee
|
|
901
922
|
},
|
|
902
923
|
queryGroupCount: {
|
|
903
924
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1499,7 +1520,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1499
1520
|
gap: 5
|
|
1500
1521
|
},
|
|
1501
1522
|
codeBlockLabel: {
|
|
1502
|
-
...
|
|
1523
|
+
...Ee
|
|
1503
1524
|
},
|
|
1504
1525
|
codeBlock: {
|
|
1505
1526
|
maxHeight: 260,
|
|
@@ -1540,129 +1561,129 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1540
1561
|
textOverflow: "ellipsis",
|
|
1541
1562
|
whiteSpace: "nowrap"
|
|
1542
1563
|
}
|
|
1543
|
-
},
|
|
1564
|
+
}, Re = 10, Le = 100, Ot = 25, Dt = 500, Ar = {
|
|
1544
1565
|
enabled: !1,
|
|
1545
1566
|
queries: [],
|
|
1546
1567
|
issues: [],
|
|
1547
1568
|
getQuery: () => {
|
|
1548
1569
|
},
|
|
1549
1570
|
getQueries: () => []
|
|
1550
|
-
},
|
|
1571
|
+
}, Ve = xe(null), Qe = xe(null), Ue = xe(
|
|
1551
1572
|
void 0
|
|
1552
1573
|
), V = [];
|
|
1553
|
-
function
|
|
1574
|
+
function Bt({
|
|
1554
1575
|
debug: e,
|
|
1555
1576
|
children: r
|
|
1556
1577
|
}) {
|
|
1557
|
-
const t = I(() =>
|
|
1558
|
-
|
|
1578
|
+
const t = I(() => Wn(e), [e]), [n, i] = Zr(
|
|
1579
|
+
Rn,
|
|
1559
1580
|
t,
|
|
1560
|
-
|
|
1561
|
-
), o = E(n), u =
|
|
1581
|
+
Or
|
|
1582
|
+
), o = E(n), u = Sr(), [f, d] = z({ open: !1 });
|
|
1562
1583
|
o.current = n, B(() => {
|
|
1563
1584
|
i({ type: "config", config: t });
|
|
1564
1585
|
}, [t]), B(() => {
|
|
1565
1586
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
1566
1587
|
return;
|
|
1567
|
-
const h =
|
|
1568
|
-
return
|
|
1588
|
+
const h = Kn(() => o.current);
|
|
1589
|
+
return Kt({
|
|
1569
1590
|
ownerId: u,
|
|
1570
1591
|
bridge: h
|
|
1571
1592
|
}), () => {
|
|
1572
|
-
|
|
1593
|
+
Wt(u);
|
|
1573
1594
|
};
|
|
1574
1595
|
}, [u, n.enabled, n.exposeWindowBridge]);
|
|
1575
|
-
const c = I(() => ({ state: n, dispatch: i }), [n]),
|
|
1596
|
+
const c = I(() => ({ state: n, dispatch: i }), [n]), g = D((h) => {
|
|
1576
1597
|
d({ open: !0, focus: h });
|
|
1577
|
-
}, []), m =
|
|
1598
|
+
}, []), m = D(() => {
|
|
1578
1599
|
d((h) => ({ ...h, open: !1 }));
|
|
1579
|
-
}, []), v =
|
|
1600
|
+
}, []), v = D((h) => {
|
|
1580
1601
|
d({ open: !0, focus: h });
|
|
1581
|
-
}, []),
|
|
1602
|
+
}, []), y = I(
|
|
1582
1603
|
() => ({
|
|
1583
1604
|
open: f.open,
|
|
1584
1605
|
focus: f.focus,
|
|
1585
|
-
openDevtools:
|
|
1606
|
+
openDevtools: g,
|
|
1586
1607
|
closeDevtools: m,
|
|
1587
1608
|
focusTrace: v
|
|
1588
1609
|
}),
|
|
1589
1610
|
[
|
|
1590
1611
|
m,
|
|
1591
1612
|
v,
|
|
1592
|
-
|
|
1613
|
+
g,
|
|
1593
1614
|
f.focus,
|
|
1594
1615
|
f.open
|
|
1595
1616
|
]
|
|
1596
1617
|
);
|
|
1597
|
-
return /* @__PURE__ */ a(
|
|
1618
|
+
return /* @__PURE__ */ a(Ve.Provider, { value: c, children: /* @__PURE__ */ a(Qe.Provider, { value: y, children: r }) });
|
|
1598
1619
|
}
|
|
1599
|
-
function
|
|
1620
|
+
function Kt(e) {
|
|
1600
1621
|
const r = V.findIndex(
|
|
1601
1622
|
(t) => t.ownerId === e.ownerId
|
|
1602
1623
|
);
|
|
1603
|
-
r >= 0 && V.splice(r, 1), V.push(e),
|
|
1624
|
+
r >= 0 && V.splice(r, 1), V.push(e), Cr();
|
|
1604
1625
|
}
|
|
1605
|
-
function
|
|
1626
|
+
function Wt(e) {
|
|
1606
1627
|
const r = V.findIndex(
|
|
1607
1628
|
(t) => t.ownerId === e
|
|
1608
1629
|
);
|
|
1609
|
-
r >= 0 && V.splice(r, 1),
|
|
1630
|
+
r >= 0 && V.splice(r, 1), Cr();
|
|
1610
1631
|
}
|
|
1611
|
-
function
|
|
1632
|
+
function Cr() {
|
|
1612
1633
|
if (typeof window > "u")
|
|
1613
1634
|
return;
|
|
1614
1635
|
const e = V[V.length - 1];
|
|
1615
1636
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
1616
1637
|
}
|
|
1617
|
-
function
|
|
1638
|
+
function Xi({
|
|
1618
1639
|
id: e,
|
|
1619
1640
|
title: r,
|
|
1620
1641
|
children: t
|
|
1621
1642
|
}) {
|
|
1622
1643
|
const n = I(() => ({ id: e, title: r }), [e, r]);
|
|
1623
|
-
return /* @__PURE__ */ a(
|
|
1644
|
+
return /* @__PURE__ */ a(Ue.Provider, { value: n, children: t });
|
|
1624
1645
|
}
|
|
1625
|
-
function
|
|
1646
|
+
function _t({
|
|
1626
1647
|
buttonPosition: e = "bottom-right",
|
|
1627
1648
|
initialIsOpen: r = !1,
|
|
1628
1649
|
panelPosition: t = "right",
|
|
1629
1650
|
className: n,
|
|
1630
1651
|
style: i
|
|
1631
1652
|
} = {}) {
|
|
1632
|
-
const o =
|
|
1653
|
+
const o = Tr(), u = Q(Qe), [f, d] = z(""), [c, g] = z(!1), m = E(null), v = E(null), y = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, C = (u == null ? void 0 : u.open) === !0;
|
|
1633
1654
|
B(() => {
|
|
1634
|
-
|
|
1655
|
+
qr();
|
|
1635
1656
|
}, []), B(() => {
|
|
1636
|
-
r && o.enabled && (
|
|
1637
|
-
}, [r, o.enabled,
|
|
1638
|
-
if (!
|
|
1657
|
+
r && o.enabled && (y == null || y());
|
|
1658
|
+
}, [r, o.enabled, y]), B(() => {
|
|
1659
|
+
if (!C || !h)
|
|
1639
1660
|
return;
|
|
1640
1661
|
const S = (w) => {
|
|
1641
|
-
var x,
|
|
1662
|
+
var x, O;
|
|
1642
1663
|
const L = w.target;
|
|
1643
|
-
L instanceof Node && ((x = m.current) != null && x.contains(L) || (
|
|
1664
|
+
L instanceof Node && ((x = m.current) != null && x.contains(L) || (O = v.current) != null && O.contains(L) || h());
|
|
1644
1665
|
};
|
|
1645
1666
|
return document.addEventListener("pointerdown", S, !0), document.addEventListener("mousedown", S, !0), document.addEventListener("click", S, !0), () => {
|
|
1646
1667
|
document.removeEventListener("pointerdown", S, !0), document.removeEventListener("mousedown", S, !0), document.removeEventListener("click", S, !0);
|
|
1647
1668
|
};
|
|
1648
|
-
}, [h,
|
|
1669
|
+
}, [h, C]);
|
|
1649
1670
|
const l = I(
|
|
1650
|
-
() =>
|
|
1671
|
+
() => St(o.queries),
|
|
1651
1672
|
[o.queries]
|
|
1652
1673
|
), b = I(
|
|
1653
|
-
() =>
|
|
1674
|
+
() => Pe(o.queries),
|
|
1654
1675
|
[o.queries]
|
|
1655
|
-
), K =
|
|
1656
|
-
() =>
|
|
1676
|
+
), K = sn(l), T = I(
|
|
1677
|
+
() => an(o.queries, f),
|
|
1657
1678
|
[o.queries, f]
|
|
1658
1679
|
), N = I(
|
|
1659
|
-
() =>
|
|
1680
|
+
() => ln(T),
|
|
1660
1681
|
[T]
|
|
1661
1682
|
), $ = I(
|
|
1662
|
-
() =>
|
|
1683
|
+
() => kr(T, u == null ? void 0 : u.focus) || T[0],
|
|
1663
1684
|
[T, u == null ? void 0 : u.focus]
|
|
1664
1685
|
);
|
|
1665
|
-
return !o.enabled || !u ? null : /* @__PURE__ */ p(
|
|
1686
|
+
return !o.enabled || !u ? null : /* @__PURE__ */ p(vr, { children: [
|
|
1666
1687
|
/* @__PURE__ */ p(
|
|
1667
1688
|
"button",
|
|
1668
1689
|
{
|
|
@@ -1673,8 +1694,8 @@ function Bt({
|
|
|
1673
1694
|
className: n ? `${R} ${n}` : R,
|
|
1674
1695
|
style: {
|
|
1675
1696
|
...s.launcher,
|
|
1676
|
-
...
|
|
1677
|
-
...
|
|
1697
|
+
...Ct(e),
|
|
1698
|
+
...Tt(l.severity),
|
|
1678
1699
|
...i
|
|
1679
1700
|
},
|
|
1680
1701
|
onClick: () => {
|
|
@@ -1689,7 +1710,7 @@ function Bt({
|
|
|
1689
1710
|
);
|
|
1690
1711
|
},
|
|
1691
1712
|
children: [
|
|
1692
|
-
/* @__PURE__ */ a(
|
|
1713
|
+
/* @__PURE__ */ a(Mt, {}),
|
|
1693
1714
|
/* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
|
|
1694
1715
|
l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
|
|
1695
1716
|
l.issueCount,
|
|
@@ -1709,7 +1730,7 @@ function Bt({
|
|
|
1709
1730
|
className: R,
|
|
1710
1731
|
style: {
|
|
1711
1732
|
...s.panel,
|
|
1712
|
-
...
|
|
1733
|
+
...kt(t),
|
|
1713
1734
|
...c ? s.panelFullscreen : null
|
|
1714
1735
|
},
|
|
1715
1736
|
children: [
|
|
@@ -1739,8 +1760,8 @@ function Bt({
|
|
|
1739
1760
|
"aria-label": c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
1740
1761
|
title: c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
1741
1762
|
style: s.iconButton,
|
|
1742
|
-
onClick: () =>
|
|
1743
|
-
children: c ? /* @__PURE__ */ a(
|
|
1763
|
+
onClick: () => g((S) => !S),
|
|
1764
|
+
children: c ? /* @__PURE__ */ a(tt, { size: 15 }) : /* @__PURE__ */ a(nt, { size: 15 })
|
|
1744
1765
|
}
|
|
1745
1766
|
),
|
|
1746
1767
|
/* @__PURE__ */ a(
|
|
@@ -1750,13 +1771,13 @@ function Bt({
|
|
|
1750
1771
|
"aria-label": "Close Semaphor Inspector",
|
|
1751
1772
|
style: s.iconButton,
|
|
1752
1773
|
onClick: u.closeDevtools,
|
|
1753
|
-
children: /* @__PURE__ */ a(
|
|
1774
|
+
children: /* @__PURE__ */ a(at, { size: 15 })
|
|
1754
1775
|
}
|
|
1755
1776
|
)
|
|
1756
1777
|
] })
|
|
1757
1778
|
] }),
|
|
1758
1779
|
/* @__PURE__ */ p("label", { style: s.searchBox, children: [
|
|
1759
|
-
/* @__PURE__ */ a(
|
|
1780
|
+
/* @__PURE__ */ a(it, { size: 14 }),
|
|
1760
1781
|
/* @__PURE__ */ a(
|
|
1761
1782
|
"input",
|
|
1762
1783
|
{
|
|
@@ -1769,7 +1790,7 @@ function Bt({
|
|
|
1769
1790
|
)
|
|
1770
1791
|
] }),
|
|
1771
1792
|
b.length ? /* @__PURE__ */ a(
|
|
1772
|
-
|
|
1793
|
+
Ht,
|
|
1773
1794
|
{
|
|
1774
1795
|
issues: b,
|
|
1775
1796
|
onSelect: (S) => u.focusTrace({
|
|
@@ -1784,7 +1805,7 @@ function Bt({
|
|
|
1784
1805
|
{
|
|
1785
1806
|
style: {
|
|
1786
1807
|
...s.panelBody,
|
|
1787
|
-
...
|
|
1808
|
+
...Et(t)
|
|
1788
1809
|
},
|
|
1789
1810
|
children: [
|
|
1790
1811
|
/* @__PURE__ */ a(
|
|
@@ -1792,7 +1813,7 @@ function Bt({
|
|
|
1792
1813
|
{
|
|
1793
1814
|
style: {
|
|
1794
1815
|
...s.queryList,
|
|
1795
|
-
...
|
|
1816
|
+
...Rt()
|
|
1796
1817
|
},
|
|
1797
1818
|
"aria-label": "Registered queries",
|
|
1798
1819
|
children: T.length ? N.map((S) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
|
|
@@ -1802,12 +1823,12 @@ function Bt({
|
|
|
1802
1823
|
] }),
|
|
1803
1824
|
S.traces.length ? S.traces.map((w) => {
|
|
1804
1825
|
var ne;
|
|
1805
|
-
const L =
|
|
1826
|
+
const L = un(w, $), x = qe(w), O = Lr(w), pe = $r(w), re = fn(w, x, pe), te = re.join(" · "), k = Er(O), j = vt(b, w);
|
|
1806
1827
|
return /* @__PURE__ */ p(
|
|
1807
1828
|
"button",
|
|
1808
1829
|
{
|
|
1809
1830
|
type: "button",
|
|
1810
|
-
title: `${x} · ${
|
|
1831
|
+
title: `${x} · ${O} · ${te}`,
|
|
1811
1832
|
style: {
|
|
1812
1833
|
...s.queryListItem,
|
|
1813
1834
|
...L ? s.queryListItemSelected : null
|
|
@@ -1819,19 +1840,19 @@ function Bt({
|
|
|
1819
1840
|
}),
|
|
1820
1841
|
children: [
|
|
1821
1842
|
/* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
|
|
1822
|
-
/* @__PURE__ */ a(
|
|
1843
|
+
/* @__PURE__ */ a(Pt, { status: (ne = w.latestAttempt) == null ? void 0 : ne.status }),
|
|
1823
1844
|
/* @__PURE__ */ a("span", { style: s.queryListTitle, title: x, children: x }),
|
|
1824
1845
|
/* @__PURE__ */ a(
|
|
1825
1846
|
"span",
|
|
1826
1847
|
{
|
|
1827
1848
|
style: {
|
|
1828
1849
|
...s.queryListKindChip,
|
|
1829
|
-
...
|
|
1850
|
+
...Rr(k)
|
|
1830
1851
|
},
|
|
1831
|
-
children:
|
|
1852
|
+
children: O
|
|
1832
1853
|
}
|
|
1833
1854
|
),
|
|
1834
|
-
|
|
1855
|
+
j > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: j }) : null
|
|
1835
1856
|
] }),
|
|
1836
1857
|
/* @__PURE__ */ a(
|
|
1837
1858
|
"span",
|
|
@@ -1839,7 +1860,7 @@ function Bt({
|
|
|
1839
1860
|
className: `${R}-source`,
|
|
1840
1861
|
style: s.queryListSource,
|
|
1841
1862
|
title: te,
|
|
1842
|
-
children: re.map((ie, oe) => /* @__PURE__ */ p(
|
|
1863
|
+
children: re.map((ie, oe) => /* @__PURE__ */ p(Xr, { children: [
|
|
1843
1864
|
oe > 0 ? /* @__PURE__ */ a("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
|
|
1844
1865
|
/* @__PURE__ */ a("span", { children: ie })
|
|
1845
1866
|
] }, `${ie}:${oe}`))
|
|
@@ -1847,13 +1868,13 @@ function Bt({
|
|
|
1847
1868
|
)
|
|
1848
1869
|
]
|
|
1849
1870
|
},
|
|
1850
|
-
|
|
1871
|
+
Me(w)
|
|
1851
1872
|
);
|
|
1852
1873
|
}) : /* @__PURE__ */ a("div", { style: s.queryGroupEmpty, children: "No input traces" })
|
|
1853
1874
|
] }, S.title)) : /* @__PURE__ */ a("div", { style: s.emptyState, children: "No matching traces" })
|
|
1854
1875
|
}
|
|
1855
1876
|
),
|
|
1856
|
-
/* @__PURE__ */ a(
|
|
1877
|
+
/* @__PURE__ */ a(Ft, { trace: $ })
|
|
1857
1878
|
]
|
|
1858
1879
|
}
|
|
1859
1880
|
)
|
|
@@ -1862,7 +1883,7 @@ function Bt({
|
|
|
1862
1883
|
) : null
|
|
1863
1884
|
] });
|
|
1864
1885
|
}
|
|
1865
|
-
function
|
|
1886
|
+
function Zi({
|
|
1866
1887
|
queryId: e,
|
|
1867
1888
|
viewId: r,
|
|
1868
1889
|
label: t,
|
|
@@ -1870,12 +1891,12 @@ function Qi({
|
|
|
1870
1891
|
style: i
|
|
1871
1892
|
} = {}) {
|
|
1872
1893
|
var m, v;
|
|
1873
|
-
const o =
|
|
1894
|
+
const o = Tr(), u = Q(Qe), f = Q(Ue);
|
|
1874
1895
|
B(() => {
|
|
1875
|
-
|
|
1896
|
+
qr();
|
|
1876
1897
|
}, []);
|
|
1877
1898
|
const d = r || (f == null ? void 0 : f.id), c = I(
|
|
1878
|
-
() =>
|
|
1899
|
+
() => dn(o.queries, {
|
|
1879
1900
|
queryId: e,
|
|
1880
1901
|
viewId: d
|
|
1881
1902
|
}),
|
|
@@ -1887,17 +1908,17 @@ function Qi({
|
|
|
1887
1908
|
);
|
|
1888
1909
|
if (!o.enabled || !u || !c)
|
|
1889
1910
|
return null;
|
|
1890
|
-
const
|
|
1911
|
+
const g = t || `Inspect ${pn(c, !!e)}`;
|
|
1891
1912
|
return /* @__PURE__ */ p(
|
|
1892
1913
|
"button",
|
|
1893
1914
|
{
|
|
1894
1915
|
type: "button",
|
|
1895
|
-
"aria-label":
|
|
1896
|
-
title:
|
|
1916
|
+
"aria-label": g,
|
|
1917
|
+
title: g,
|
|
1897
1918
|
className: n ? `${R} ${n}` : R,
|
|
1898
1919
|
style: {
|
|
1899
1920
|
...s.inspectButton,
|
|
1900
|
-
...
|
|
1921
|
+
...Lt((m = c.latestAttempt) == null ? void 0 : m.status),
|
|
1901
1922
|
...i
|
|
1902
1923
|
},
|
|
1903
1924
|
onClick: () => u.openDevtools({
|
|
@@ -1906,17 +1927,17 @@ function Qi({
|
|
|
1906
1927
|
viewId: c.viewId
|
|
1907
1928
|
}),
|
|
1908
1929
|
children: [
|
|
1909
|
-
/* @__PURE__ */ a(
|
|
1930
|
+
/* @__PURE__ */ a(ot, { size: 13 }),
|
|
1910
1931
|
/* @__PURE__ */ a("span", { style: s.inspectButtonText, children: ((v = c.latestAttempt) == null ? void 0 : v.status) || "idle" })
|
|
1911
1932
|
]
|
|
1912
1933
|
}
|
|
1913
1934
|
);
|
|
1914
1935
|
}
|
|
1915
|
-
function
|
|
1916
|
-
const e = Q(
|
|
1917
|
-
return !e || !e.state.enabled ?
|
|
1936
|
+
function Tr() {
|
|
1937
|
+
const e = Q(Ve);
|
|
1938
|
+
return !e || !e.state.enabled ? Ar : de(e.state);
|
|
1918
1939
|
}
|
|
1919
|
-
function
|
|
1940
|
+
function Nt({
|
|
1920
1941
|
spec: e,
|
|
1921
1942
|
queryKind: r,
|
|
1922
1943
|
queryKey: t,
|
|
@@ -1924,73 +1945,73 @@ function Kt({
|
|
|
1924
1945
|
activeInputs: i,
|
|
1925
1946
|
debug: o
|
|
1926
1947
|
}) {
|
|
1927
|
-
const u = Q(
|
|
1948
|
+
const u = Q(Ve), f = Q(Ue), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, g = Nn(e), m = yt(e), v = I(
|
|
1928
1949
|
() => JSON.stringify(e),
|
|
1929
1950
|
[e]
|
|
1930
|
-
),
|
|
1951
|
+
), y = I(
|
|
1931
1952
|
() => JSON.stringify(i || []),
|
|
1932
1953
|
[i]
|
|
1933
1954
|
), h = I(
|
|
1934
1955
|
() => JSON.stringify(n || null),
|
|
1935
1956
|
[n]
|
|
1936
|
-
),
|
|
1937
|
-
l.current !== v && (l.current = v,
|
|
1938
|
-
const x =
|
|
1939
|
-
() =>
|
|
1940
|
-
[t,
|
|
1941
|
-
),
|
|
1957
|
+
), C = E(e), l = E(v), b = E(n), K = E(h), T = E(i), N = E(y), $ = _n(o), S = JSON.stringify($ || []), w = E($), L = E(S);
|
|
1958
|
+
l.current !== v && (l.current = v, C.current = e), K.current !== h && (K.current = h, b.current = n), N.current !== y && (N.current = y, T.current = i), L.current !== S && (L.current = S, w.current = $);
|
|
1959
|
+
const x = C.current, O = b.current, pe = T.current, re = w.current, te = Sr(), k = I(
|
|
1960
|
+
() => g || `query_${Kr(t)}`,
|
|
1961
|
+
[t, g]
|
|
1962
|
+
), j = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ne = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), ie = o == null ? void 0 : o.visualType, oe = o == null ? void 0 : o.sectionTitle, H = I(
|
|
1942
1963
|
() => [
|
|
1943
|
-
|
|
1964
|
+
j || "unscoped-view",
|
|
1944
1965
|
k,
|
|
1945
1966
|
te
|
|
1946
1967
|
].join("::"),
|
|
1947
|
-
[k, te,
|
|
1948
|
-
),
|
|
1968
|
+
[k, te, j]
|
|
1969
|
+
), Ze = I(
|
|
1949
1970
|
() => ({
|
|
1950
|
-
traceKey:
|
|
1971
|
+
traceKey: H,
|
|
1951
1972
|
spec: x,
|
|
1952
1973
|
queryId: k,
|
|
1953
1974
|
queryLabel: m,
|
|
1954
1975
|
queryKind: r,
|
|
1955
|
-
builder:
|
|
1956
|
-
viewId:
|
|
1976
|
+
builder: Mn(r),
|
|
1977
|
+
viewId: j,
|
|
1957
1978
|
viewTitle: ne,
|
|
1958
1979
|
visualType: ie,
|
|
1959
1980
|
sectionTitle: oe,
|
|
1960
1981
|
sourceHints: re,
|
|
1961
|
-
intent:
|
|
1982
|
+
intent: O,
|
|
1962
1983
|
activeInputs: pe,
|
|
1963
|
-
clientWarnings:
|
|
1984
|
+
clientWarnings: g ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
1964
1985
|
}),
|
|
1965
1986
|
[
|
|
1966
1987
|
k,
|
|
1967
1988
|
r,
|
|
1968
|
-
|
|
1989
|
+
g,
|
|
1969
1990
|
m,
|
|
1970
1991
|
x,
|
|
1971
1992
|
pe,
|
|
1972
|
-
|
|
1993
|
+
O,
|
|
1973
1994
|
re,
|
|
1974
1995
|
oe,
|
|
1996
|
+
H,
|
|
1975
1997
|
j,
|
|
1976
|
-
M,
|
|
1977
1998
|
ne,
|
|
1978
1999
|
ie
|
|
1979
2000
|
]
|
|
1980
2001
|
);
|
|
1981
2002
|
B(() => {
|
|
1982
2003
|
if (!(!d || !c))
|
|
1983
|
-
return c({ type: "register", descriptor:
|
|
1984
|
-
c({ type: "unregister", traceKey:
|
|
2004
|
+
return c({ type: "register", descriptor: Ze }), () => {
|
|
2005
|
+
c({ type: "unregister", traceKey: H });
|
|
1985
2006
|
};
|
|
1986
|
-
}, [
|
|
1987
|
-
const
|
|
1988
|
-
(
|
|
1989
|
-
!d || !c || c({ type: "event", traceKey:
|
|
2007
|
+
}, [Ze, c, d, H]);
|
|
2008
|
+
const M = D(
|
|
2009
|
+
(q, U) => {
|
|
2010
|
+
!d || !c || c({ type: "event", traceKey: H, event: q, latestAttempt: U });
|
|
1990
2011
|
},
|
|
1991
|
-
[c, d,
|
|
1992
|
-
),
|
|
1993
|
-
|
|
2012
|
+
[c, d, H]
|
|
2013
|
+
), er = D(() => {
|
|
2014
|
+
M(
|
|
1994
2015
|
{
|
|
1995
2016
|
type: "query_started",
|
|
1996
2017
|
queryId: k,
|
|
@@ -1998,10 +2019,10 @@ function Kt({
|
|
|
1998
2019
|
},
|
|
1999
2020
|
{ status: "loading" }
|
|
2000
2021
|
);
|
|
2001
|
-
}, [
|
|
2002
|
-
(
|
|
2003
|
-
const se =
|
|
2004
|
-
|
|
2022
|
+
}, [M, k]), rr = D(
|
|
2023
|
+
(q, U) => {
|
|
2024
|
+
const se = gr(q), ae = Un(q), zr = Gn(q), ir = pr(q);
|
|
2025
|
+
M(
|
|
2005
2026
|
{
|
|
2006
2027
|
type: "query_succeeded",
|
|
2007
2028
|
queryId: k,
|
|
@@ -2015,17 +2036,21 @@ function Kt({
|
|
|
2015
2036
|
status: "success",
|
|
2016
2037
|
durationMs: U,
|
|
2017
2038
|
rowCount: ae,
|
|
2018
|
-
columnCount:
|
|
2019
|
-
metricCoverage:
|
|
2020
|
-
|
|
2039
|
+
columnCount: zr,
|
|
2040
|
+
metricCoverage: Jn(q),
|
|
2041
|
+
resultPreview: He(
|
|
2042
|
+
ir,
|
|
2043
|
+
Yn(q)
|
|
2044
|
+
),
|
|
2045
|
+
executionResult: ir
|
|
2021
2046
|
}
|
|
2022
2047
|
);
|
|
2023
2048
|
},
|
|
2024
|
-
[
|
|
2025
|
-
), ge =
|
|
2026
|
-
(
|
|
2027
|
-
const se =
|
|
2028
|
-
|
|
2049
|
+
[M, k]
|
|
2050
|
+
), ge = D(
|
|
2051
|
+
(q, U) => {
|
|
2052
|
+
const se = gr(q), ae = q instanceof Error ? q.message : String(q);
|
|
2053
|
+
M(
|
|
2029
2054
|
{
|
|
2030
2055
|
type: "query_failed",
|
|
2031
2056
|
queryId: k,
|
|
@@ -2038,53 +2063,53 @@ function Kt({
|
|
|
2038
2063
|
status: "error",
|
|
2039
2064
|
durationMs: U,
|
|
2040
2065
|
errorMessage: ae,
|
|
2041
|
-
executionResult:
|
|
2066
|
+
executionResult: pr(q)
|
|
2042
2067
|
}
|
|
2043
2068
|
);
|
|
2044
2069
|
},
|
|
2045
|
-
[
|
|
2046
|
-
),
|
|
2047
|
-
(
|
|
2048
|
-
|
|
2070
|
+
[M, k]
|
|
2071
|
+
), tr = D(
|
|
2072
|
+
(q) => {
|
|
2073
|
+
M(
|
|
2049
2074
|
{
|
|
2050
2075
|
type: "query_ignored_stale",
|
|
2051
2076
|
queryId: k,
|
|
2052
2077
|
at: be(),
|
|
2053
|
-
reason:
|
|
2078
|
+
reason: q
|
|
2054
2079
|
}
|
|
2055
2080
|
);
|
|
2056
2081
|
},
|
|
2057
|
-
[
|
|
2058
|
-
),
|
|
2059
|
-
(
|
|
2060
|
-
ge(
|
|
2082
|
+
[M, k]
|
|
2083
|
+
), nr = D(
|
|
2084
|
+
(q) => {
|
|
2085
|
+
ge(q, 0);
|
|
2061
2086
|
},
|
|
2062
2087
|
[ge]
|
|
2063
|
-
), Te = d ? u == null ? void 0 : u.state.entries[
|
|
2088
|
+
), Te = d ? u == null ? void 0 : u.state.entries[H] : void 0;
|
|
2064
2089
|
return I(
|
|
2065
2090
|
() => ({
|
|
2066
2091
|
enabled: d,
|
|
2067
2092
|
queryId: k,
|
|
2068
2093
|
trace: Te ? ve(Te) : void 0,
|
|
2069
|
-
start:
|
|
2070
|
-
success:
|
|
2094
|
+
start: er,
|
|
2095
|
+
success: rr,
|
|
2071
2096
|
failure: ge,
|
|
2072
|
-
ignored:
|
|
2073
|
-
validationFailure:
|
|
2097
|
+
ignored: tr,
|
|
2098
|
+
validationFailure: nr
|
|
2074
2099
|
}),
|
|
2075
2100
|
[
|
|
2076
2101
|
d,
|
|
2077
2102
|
ge,
|
|
2078
|
-
|
|
2103
|
+
tr,
|
|
2079
2104
|
k,
|
|
2080
|
-
|
|
2081
|
-
|
|
2105
|
+
er,
|
|
2106
|
+
rr,
|
|
2082
2107
|
Te,
|
|
2083
|
-
|
|
2108
|
+
nr
|
|
2084
2109
|
]
|
|
2085
2110
|
);
|
|
2086
2111
|
}
|
|
2087
|
-
function
|
|
2112
|
+
function Mt() {
|
|
2088
2113
|
return /* @__PURE__ */ a("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
2089
2114
|
"svg",
|
|
2090
2115
|
{
|
|
@@ -2102,19 +2127,19 @@ function Wt() {
|
|
|
2102
2127
|
}
|
|
2103
2128
|
) });
|
|
2104
2129
|
}
|
|
2105
|
-
function
|
|
2130
|
+
function Ft({
|
|
2106
2131
|
trace: e
|
|
2107
2132
|
}) {
|
|
2108
2133
|
var $, S, w, L, x;
|
|
2109
2134
|
if (!e)
|
|
2110
2135
|
return /* @__PURE__ */ a("div", { style: s.detailsPane, children: /* @__PURE__ */ a("div", { style: s.emptyState, children: "No traces registered yet" }) });
|
|
2111
|
-
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n =
|
|
2136
|
+
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = Oe(
|
|
2112
2137
|
($ = t == null ? void 0 : t.validation) == null ? void 0 : $.warnings
|
|
2113
|
-
), i =
|
|
2138
|
+
), i = Oe((S = t == null ? void 0 : t.validation) == null ? void 0 : S.errors), o = Cn(
|
|
2114
2139
|
(w = t == null ? void 0 : t.coverage) == null ? void 0 : w.missingObligations
|
|
2115
|
-
), u =
|
|
2140
|
+
), u = Oe(
|
|
2116
2141
|
(L = t == null ? void 0 : t.coverage) == null ? void 0 : L.warnings
|
|
2117
|
-
), f = t == null ? void 0 : t.compiledQuery, d =
|
|
2142
|
+
), f = t == null ? void 0 : t.compiledQuery, d = En(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || d.compiledSql, g = (r == null ? void 0 : r.resultPreview) || He(t), m = [
|
|
2118
2143
|
...r != null && r.errorMessage ? [r.errorMessage] : [],
|
|
2119
2144
|
...i
|
|
2120
2145
|
], v = [
|
|
@@ -2122,7 +2147,7 @@ function _t({
|
|
|
2122
2147
|
...n,
|
|
2123
2148
|
...o,
|
|
2124
2149
|
...u
|
|
2125
|
-
],
|
|
2150
|
+
], y = e.inputsApplied.length > 0, h = !!(f || c), C = yn(e), l = Sn(r == null ? void 0 : r.rowCount), b = wn(r == null ? void 0 : r.durationMs), K = e.sourceRefs.length, T = Lr(e), N = Er(T);
|
|
2126
2151
|
return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
|
|
2127
2152
|
/* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
|
|
2128
2153
|
/* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
|
|
@@ -2132,24 +2157,24 @@ function _t({
|
|
|
2132
2157
|
"aria-hidden": !0,
|
|
2133
2158
|
style: {
|
|
2134
2159
|
...s.detailsHeaderStatusDot,
|
|
2135
|
-
...
|
|
2160
|
+
...xr(r == null ? void 0 : r.status)
|
|
2136
2161
|
}
|
|
2137
2162
|
}
|
|
2138
2163
|
),
|
|
2139
|
-
/* @__PURE__ */ a("span", { style: s.detailsTitle, children:
|
|
2164
|
+
/* @__PURE__ */ a("span", { style: s.detailsTitle, children: qe(e) }),
|
|
2140
2165
|
/* @__PURE__ */ a(
|
|
2141
2166
|
"span",
|
|
2142
2167
|
{
|
|
2143
2168
|
style: {
|
|
2144
2169
|
...s.detailsKindChip,
|
|
2145
|
-
...
|
|
2170
|
+
...Rr(N)
|
|
2146
2171
|
},
|
|
2147
2172
|
children: T
|
|
2148
2173
|
}
|
|
2149
2174
|
)
|
|
2150
2175
|
] }),
|
|
2151
2176
|
/* @__PURE__ */ p("div", { style: s.metaStrip, children: [
|
|
2152
|
-
/* @__PURE__ */ a("span", { style: s.metaStripItem, children:
|
|
2177
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: C }),
|
|
2153
2178
|
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
2154
2179
|
/* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
|
|
2155
2180
|
l,
|
|
@@ -2157,21 +2182,21 @@ function _t({
|
|
|
2157
2182
|
] }),
|
|
2158
2183
|
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
2159
2184
|
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: b }),
|
|
2160
|
-
K > 0 ? /* @__PURE__ */ p(
|
|
2185
|
+
K > 0 ? /* @__PURE__ */ p(vr, { children: [
|
|
2161
2186
|
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
2162
2187
|
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: K === 1 ? "1 source" : `${K} sources` })
|
|
2163
2188
|
] }) : null
|
|
2164
2189
|
] })
|
|
2165
2190
|
] }),
|
|
2166
|
-
m.length ? /* @__PURE__ */ a(
|
|
2167
|
-
v.length ? /* @__PURE__ */ a(
|
|
2168
|
-
/* @__PURE__ */ a(
|
|
2169
|
-
|
|
2191
|
+
m.length ? /* @__PURE__ */ a(lr, { tone: "error", title: "Error", items: m }) : null,
|
|
2192
|
+
v.length ? /* @__PURE__ */ a(lr, { tone: "warning", title: "Warnings", items: v }) : null,
|
|
2193
|
+
/* @__PURE__ */ a(Vt, { trace: e }),
|
|
2194
|
+
y ? /* @__PURE__ */ a(en, { inputs: e.inputsApplied }) : null,
|
|
2170
2195
|
/* @__PURE__ */ a(
|
|
2171
|
-
|
|
2196
|
+
zt,
|
|
2172
2197
|
{
|
|
2173
2198
|
trace: e,
|
|
2174
|
-
resultPreview:
|
|
2199
|
+
resultPreview: g,
|
|
2175
2200
|
compiledQuery: f,
|
|
2176
2201
|
compiledSql: c,
|
|
2177
2202
|
hasCompiled: h
|
|
@@ -2179,24 +2204,24 @@ function _t({
|
|
|
2179
2204
|
)
|
|
2180
2205
|
] });
|
|
2181
2206
|
}
|
|
2182
|
-
function
|
|
2207
|
+
function zt({
|
|
2183
2208
|
trace: e,
|
|
2184
2209
|
resultPreview: r,
|
|
2185
2210
|
compiledQuery: t,
|
|
2186
2211
|
compiledSql: n,
|
|
2187
2212
|
hasCompiled: i
|
|
2188
2213
|
}) {
|
|
2189
|
-
var h,
|
|
2214
|
+
var h, C;
|
|
2190
2215
|
const o = [];
|
|
2191
2216
|
r && o.push({
|
|
2192
2217
|
id: "returned",
|
|
2193
2218
|
label: "Returned",
|
|
2194
|
-
render: () => /* @__PURE__ */ a(
|
|
2219
|
+
render: () => /* @__PURE__ */ a(rn, { preview: r })
|
|
2195
2220
|
}), i && o.push({
|
|
2196
2221
|
id: "compiled",
|
|
2197
2222
|
label: "Compiled",
|
|
2198
2223
|
render: () => /* @__PURE__ */ a(
|
|
2199
|
-
|
|
2224
|
+
tn,
|
|
2200
2225
|
{
|
|
2201
2226
|
compiledQuery: t,
|
|
2202
2227
|
compiledSql: n
|
|
@@ -2205,24 +2230,24 @@ function Nt({
|
|
|
2205
2230
|
}), (e.sourceRefs.length || e.fieldRefs.length) && o.push({
|
|
2206
2231
|
id: "lineage",
|
|
2207
2232
|
label: "Sources",
|
|
2208
|
-
render: () => /* @__PURE__ */ a(
|
|
2233
|
+
render: () => /* @__PURE__ */ a(Gt, { trace: e })
|
|
2209
2234
|
}), (h = e.sourceHints) != null && h.length && o.push({
|
|
2210
2235
|
id: "hints",
|
|
2211
2236
|
label: "Hints",
|
|
2212
|
-
render: () => /* @__PURE__ */ a(
|
|
2237
|
+
render: () => /* @__PURE__ */ a(Jt, { hints: e.sourceHints ?? [] })
|
|
2213
2238
|
}), o.push({
|
|
2214
2239
|
id: "lifecycle",
|
|
2215
2240
|
label: "Lifecycle",
|
|
2216
|
-
render: () => /* @__PURE__ */ a(
|
|
2241
|
+
render: () => /* @__PURE__ */ a(jt, { trace: e })
|
|
2217
2242
|
}), o.push({
|
|
2218
2243
|
id: "raw",
|
|
2219
2244
|
label: "Raw",
|
|
2220
|
-
render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children:
|
|
2245
|
+
render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: In(e) })
|
|
2221
2246
|
});
|
|
2222
|
-
const u = (
|
|
2247
|
+
const u = (C = o[0]) == null ? void 0 : C.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = z(u), g = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
|
|
2223
2248
|
B(() => {
|
|
2224
|
-
if (
|
|
2225
|
-
|
|
2249
|
+
if (g.current !== f) {
|
|
2250
|
+
g.current = f, m.current = !1, c(u);
|
|
2226
2251
|
return;
|
|
2227
2252
|
}
|
|
2228
2253
|
if (!(d ? v.split("|").includes(d) : !1)) {
|
|
@@ -2231,10 +2256,10 @@ function Nt({
|
|
|
2231
2256
|
}
|
|
2232
2257
|
!m.current && d !== u && c(u);
|
|
2233
2258
|
}, [d, u, v, f]);
|
|
2234
|
-
const
|
|
2259
|
+
const y = o.find((l) => l.id === d) ?? o[0];
|
|
2235
2260
|
return /* @__PURE__ */ p("div", { style: s.traceTabs, children: [
|
|
2236
2261
|
/* @__PURE__ */ a("div", { style: s.traceTabBar, role: "tablist", "aria-label": "Trace details", children: o.map((l) => {
|
|
2237
|
-
const b = l.id ===
|
|
2262
|
+
const b = l.id === y.id;
|
|
2238
2263
|
return /* @__PURE__ */ a(
|
|
2239
2264
|
"button",
|
|
2240
2265
|
{
|
|
@@ -2254,18 +2279,18 @@ function Nt({
|
|
|
2254
2279
|
l.id
|
|
2255
2280
|
);
|
|
2256
2281
|
}) }),
|
|
2257
|
-
/* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children:
|
|
2282
|
+
/* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children: y.render() })
|
|
2258
2283
|
] });
|
|
2259
2284
|
}
|
|
2260
|
-
function
|
|
2285
|
+
function jt({
|
|
2261
2286
|
trace: e
|
|
2262
2287
|
}) {
|
|
2263
2288
|
return e.recentEvents.length ? /* @__PURE__ */ a("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((r, t) => /* @__PURE__ */ p("div", { style: s.eventRow, children: [
|
|
2264
|
-
/* @__PURE__ */ a("span", { style: s.eventType, children:
|
|
2265
|
-
/* @__PURE__ */ a("span", { style: s.eventMeta, children:
|
|
2289
|
+
/* @__PURE__ */ a("span", { style: s.eventType, children: xn(r) }),
|
|
2290
|
+
/* @__PURE__ */ a("span", { style: s.eventMeta, children: qn(r) })
|
|
2266
2291
|
] }, `${r.type}:${r.at}:${t}`)) }) : /* @__PURE__ */ a("div", { style: s.mutedText, children: "No attempts recorded" });
|
|
2267
2292
|
}
|
|
2268
|
-
function
|
|
2293
|
+
function lr({
|
|
2269
2294
|
tone: e,
|
|
2270
2295
|
title: r,
|
|
2271
2296
|
items: t
|
|
@@ -2276,11 +2301,11 @@ function or({
|
|
|
2276
2301
|
t.length > 1 ? /* @__PURE__ */ a("ul", { style: s.alertCardList, children: t.map((i, o) => /* @__PURE__ */ a("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ a("div", { children: t[0] })
|
|
2277
2302
|
] });
|
|
2278
2303
|
}
|
|
2279
|
-
function
|
|
2304
|
+
function Ht({
|
|
2280
2305
|
issues: e,
|
|
2281
2306
|
onSelect: r
|
|
2282
2307
|
}) {
|
|
2283
|
-
const [t, n] =
|
|
2308
|
+
const [t, n] = z(!1), i = e.slice(0, 6), o = e.length - i.length, u = e.filter((c) => c.tone === "error").length, f = e.length - u, d = [
|
|
2284
2309
|
u ? `${u} error${u === 1 ? "" : "s"}` : "",
|
|
2285
2310
|
f ? `${f} warning${f === 1 ? "" : "s"}` : ""
|
|
2286
2311
|
].filter(Boolean);
|
|
@@ -2294,7 +2319,7 @@ function zt({
|
|
|
2294
2319
|
onClick: () => n((c) => !c),
|
|
2295
2320
|
children: [
|
|
2296
2321
|
/* @__PURE__ */ p("span", { style: s.issueSummaryHeaderLabel, children: [
|
|
2297
|
-
t ? /* @__PURE__ */ a(
|
|
2322
|
+
t ? /* @__PURE__ */ a(lt, { size: 13 }) : /* @__PURE__ */ a(st, { size: 13 }),
|
|
2298
2323
|
/* @__PURE__ */ a("span", { children: "Issues" })
|
|
2299
2324
|
] }),
|
|
2300
2325
|
/* @__PURE__ */ a("span", { style: s.issueSummaryCount, children: e.length })
|
|
@@ -2302,7 +2327,7 @@ function zt({
|
|
|
2302
2327
|
}
|
|
2303
2328
|
),
|
|
2304
2329
|
t ? /* @__PURE__ */ p("div", { style: s.issueSummaryList, children: [
|
|
2305
|
-
i.map((c,
|
|
2330
|
+
i.map((c, g) => /* @__PURE__ */ p(
|
|
2306
2331
|
"button",
|
|
2307
2332
|
{
|
|
2308
2333
|
type: "button",
|
|
@@ -2326,7 +2351,7 @@ function zt({
|
|
|
2326
2351
|
] })
|
|
2327
2352
|
]
|
|
2328
2353
|
},
|
|
2329
|
-
`${c.trace.traceId}:${c.title}:${
|
|
2354
|
+
`${c.trace.traceId}:${c.title}:${g}`
|
|
2330
2355
|
)),
|
|
2331
2356
|
o > 0 ? /* @__PURE__ */ p("div", { style: s.issueSummaryMore, children: [
|
|
2332
2357
|
o,
|
|
@@ -2340,7 +2365,7 @@ function zt({
|
|
|
2340
2365
|
] })
|
|
2341
2366
|
] });
|
|
2342
2367
|
}
|
|
2343
|
-
function
|
|
2368
|
+
function Pt({
|
|
2344
2369
|
status: e
|
|
2345
2370
|
}) {
|
|
2346
2371
|
return /* @__PURE__ */ a(
|
|
@@ -2349,34 +2374,40 @@ function Ft({
|
|
|
2349
2374
|
"aria-hidden": !0,
|
|
2350
2375
|
style: {
|
|
2351
2376
|
...s.statusDot,
|
|
2352
|
-
...
|
|
2377
|
+
...xr(e)
|
|
2353
2378
|
}
|
|
2354
2379
|
}
|
|
2355
2380
|
);
|
|
2356
2381
|
}
|
|
2357
|
-
function
|
|
2382
|
+
function Vt({
|
|
2358
2383
|
trace: e
|
|
2359
2384
|
}) {
|
|
2360
2385
|
var i;
|
|
2361
|
-
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n =
|
|
2386
|
+
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = mn(r);
|
|
2362
2387
|
return /* @__PURE__ */ p("div", { style: s.recipe, children: [
|
|
2363
|
-
/* @__PURE__ */ a(
|
|
2364
|
-
/* @__PURE__ */ a(
|
|
2365
|
-
/* @__PURE__ */ a(
|
|
2388
|
+
/* @__PURE__ */ a(Qt, { sources: e.sourceRefs }),
|
|
2389
|
+
/* @__PURE__ */ a(P, { title: "Measures", fields: n.measures }),
|
|
2390
|
+
/* @__PURE__ */ a(P, { title: "Time fields", fields: n.timeFields }),
|
|
2366
2391
|
/* @__PURE__ */ a(
|
|
2367
|
-
|
|
2392
|
+
P,
|
|
2368
2393
|
{
|
|
2369
2394
|
title: "Dimensions",
|
|
2370
2395
|
fields: n.dimensions,
|
|
2371
2396
|
emptyText: "No dimensions selected"
|
|
2372
2397
|
}
|
|
2373
2398
|
),
|
|
2374
|
-
/* @__PURE__ */ a(
|
|
2375
|
-
/* @__PURE__ */ a(
|
|
2376
|
-
/* @__PURE__ */ a(
|
|
2399
|
+
/* @__PURE__ */ a(P, { title: "Identifiers", fields: n.identifiers }),
|
|
2400
|
+
/* @__PURE__ */ a(P, { title: "Other fields", fields: n.other }),
|
|
2401
|
+
/* @__PURE__ */ a(
|
|
2402
|
+
P,
|
|
2403
|
+
{
|
|
2404
|
+
title: "Input bindings (Filters)",
|
|
2405
|
+
fields: t
|
|
2406
|
+
}
|
|
2407
|
+
)
|
|
2377
2408
|
] });
|
|
2378
2409
|
}
|
|
2379
|
-
function
|
|
2410
|
+
function Qt({
|
|
2380
2411
|
sources: e
|
|
2381
2412
|
}) {
|
|
2382
2413
|
return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
@@ -2385,28 +2416,28 @@ function jt({
|
|
|
2385
2416
|
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
|
|
2386
2417
|
] }),
|
|
2387
2418
|
/* @__PURE__ */ a("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ a(
|
|
2388
|
-
|
|
2419
|
+
Ut,
|
|
2389
2420
|
{
|
|
2390
2421
|
source: r
|
|
2391
2422
|
},
|
|
2392
|
-
`${
|
|
2423
|
+
`${F(r)}:${t}`
|
|
2393
2424
|
)) })
|
|
2394
2425
|
] }) : null;
|
|
2395
2426
|
}
|
|
2396
|
-
function
|
|
2397
|
-
const r =
|
|
2427
|
+
function Ut({ source: e }) {
|
|
2428
|
+
const r = F(e);
|
|
2398
2429
|
return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
|
|
2399
2430
|
/* @__PURE__ */ a("span", { style: s.sourcePillLabel, children: r }),
|
|
2400
2431
|
/* @__PURE__ */ a("span", { style: s.sourcePillRole, children: e.kind })
|
|
2401
2432
|
] });
|
|
2402
2433
|
}
|
|
2403
|
-
function
|
|
2434
|
+
function Gt({
|
|
2404
2435
|
trace: e
|
|
2405
2436
|
}) {
|
|
2406
2437
|
return /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
|
|
2407
|
-
/* @__PURE__ */ a(
|
|
2438
|
+
/* @__PURE__ */ a(Yt, { sources: e.sourceRefs }),
|
|
2408
2439
|
/* @__PURE__ */ a(
|
|
2409
|
-
|
|
2440
|
+
P,
|
|
2410
2441
|
{
|
|
2411
2442
|
title: "All field refs",
|
|
2412
2443
|
fields: e.fieldRefs,
|
|
@@ -2415,11 +2446,11 @@ function Vt({
|
|
|
2415
2446
|
)
|
|
2416
2447
|
] });
|
|
2417
2448
|
}
|
|
2418
|
-
function
|
|
2449
|
+
function Jt({
|
|
2419
2450
|
hints: e
|
|
2420
2451
|
}) {
|
|
2421
2452
|
return /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => {
|
|
2422
|
-
const n =
|
|
2453
|
+
const n = vn(r), i = r.component || r.exportName || n || "Source hint", o = [
|
|
2423
2454
|
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
2424
2455
|
n,
|
|
2425
2456
|
r.note
|
|
@@ -2438,7 +2469,7 @@ function Qt({
|
|
|
2438
2469
|
);
|
|
2439
2470
|
}) });
|
|
2440
2471
|
}
|
|
2441
|
-
function
|
|
2472
|
+
function Yt({
|
|
2442
2473
|
sources: e
|
|
2443
2474
|
}) {
|
|
2444
2475
|
return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
@@ -2450,17 +2481,17 @@ function Ut({
|
|
|
2450
2481
|
"div",
|
|
2451
2482
|
{
|
|
2452
2483
|
style: s.recipeFieldRow,
|
|
2453
|
-
title:
|
|
2484
|
+
title: F(r),
|
|
2454
2485
|
children: [
|
|
2455
|
-
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children:
|
|
2486
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children: F(r) }),
|
|
2456
2487
|
/* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: r.kind })
|
|
2457
2488
|
]
|
|
2458
2489
|
},
|
|
2459
|
-
`${
|
|
2490
|
+
`${F(r)}:${t}`
|
|
2460
2491
|
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: "No sources captured" })
|
|
2461
2492
|
] });
|
|
2462
2493
|
}
|
|
2463
|
-
function
|
|
2494
|
+
function P({
|
|
2464
2495
|
title: e,
|
|
2465
2496
|
fields: r,
|
|
2466
2497
|
emptyText: t
|
|
@@ -2471,20 +2502,20 @@ function H({
|
|
|
2471
2502
|
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: r.length })
|
|
2472
2503
|
] }),
|
|
2473
2504
|
r.length ? /* @__PURE__ */ a("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ a(
|
|
2474
|
-
|
|
2505
|
+
Xt,
|
|
2475
2506
|
{
|
|
2476
2507
|
field: n,
|
|
2477
2508
|
groupTitle: e
|
|
2478
2509
|
},
|
|
2479
|
-
`${
|
|
2510
|
+
`${Ge(n)}:${i}`
|
|
2480
2511
|
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: t })
|
|
2481
2512
|
] });
|
|
2482
2513
|
}
|
|
2483
|
-
function
|
|
2514
|
+
function Xt({
|
|
2484
2515
|
field: e,
|
|
2485
2516
|
groupTitle: r
|
|
2486
2517
|
}) {
|
|
2487
|
-
const t =
|
|
2518
|
+
const t = hn(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? F(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = Zt(e, r);
|
|
2488
2519
|
return /* @__PURE__ */ p(
|
|
2489
2520
|
"div",
|
|
2490
2521
|
{
|
|
@@ -2502,7 +2533,7 @@ function Gt({
|
|
|
2502
2533
|
}
|
|
2503
2534
|
);
|
|
2504
2535
|
}
|
|
2505
|
-
function
|
|
2536
|
+
function Zt(e, r) {
|
|
2506
2537
|
const t = e.dataType, n = e.role;
|
|
2507
2538
|
return !!e.aggregate || n === "measure" || r === "Measures" ? {
|
|
2508
2539
|
text: "Σ",
|
|
@@ -2541,16 +2572,16 @@ function Jt(e, r) {
|
|
|
2541
2572
|
}
|
|
2542
2573
|
};
|
|
2543
2574
|
}
|
|
2544
|
-
function
|
|
2575
|
+
function en({
|
|
2545
2576
|
inputs: e
|
|
2546
2577
|
}) {
|
|
2547
2578
|
return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
|
|
2548
2579
|
/* @__PURE__ */ p("div", { style: s.inputsAppliedHeader, children: [
|
|
2549
|
-
/* @__PURE__ */ a("span", { style: s.inputsAppliedTitle, children: "Active Inputs" }),
|
|
2580
|
+
/* @__PURE__ */ a("span", { style: s.inputsAppliedTitle, children: "Active Inputs (Active Filters)" }),
|
|
2550
2581
|
/* @__PURE__ */ a("span", { style: s.inputsAppliedCount, children: e.length })
|
|
2551
2582
|
] }),
|
|
2552
2583
|
/* @__PURE__ */ a("div", { style: s.inputRecipeList, children: e.map((r) => {
|
|
2553
|
-
const t =
|
|
2584
|
+
const t = bn(r);
|
|
2554
2585
|
return /* @__PURE__ */ p(
|
|
2555
2586
|
"div",
|
|
2556
2587
|
{
|
|
@@ -2571,7 +2602,7 @@ function Yt({
|
|
|
2571
2602
|
}) })
|
|
2572
2603
|
] });
|
|
2573
2604
|
}
|
|
2574
|
-
function
|
|
2605
|
+
function rn({
|
|
2575
2606
|
preview: e
|
|
2576
2607
|
}) {
|
|
2577
2608
|
return /* @__PURE__ */ p("div", { style: s.resultPreview, children: [
|
|
@@ -2581,7 +2612,7 @@ function Xt({
|
|
|
2581
2612
|
] }),
|
|
2582
2613
|
/* @__PURE__ */ a("div", { style: s.resultPreviewScroller, children: /* @__PURE__ */ p("table", { style: s.resultPreviewTable, children: [
|
|
2583
2614
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.columns.map((r) => /* @__PURE__ */ a("th", { style: s.resultPreviewTh, children: r.label }, r.key)) }) }),
|
|
2584
|
-
/* @__PURE__ */ a("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ a("tr", { children: e.columns.map((n) => /* @__PURE__ */ a("td", { style: s.resultPreviewTd, children:
|
|
2615
|
+
/* @__PURE__ */ a("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ a("tr", { children: e.columns.map((n) => /* @__PURE__ */ a("td", { style: s.resultPreviewTd, children: gt(r[n.key]) }, n.key)) }, t)) : /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
2585
2616
|
"td",
|
|
2586
2617
|
{
|
|
2587
2618
|
colSpan: e.columns.length,
|
|
@@ -2595,28 +2626,28 @@ function Xt({
|
|
|
2595
2626
|
ce,
|
|
2596
2627
|
" rows and first",
|
|
2597
2628
|
" ",
|
|
2598
|
-
|
|
2629
|
+
Ne,
|
|
2599
2630
|
" columns."
|
|
2600
2631
|
] }) : null
|
|
2601
2632
|
] });
|
|
2602
2633
|
}
|
|
2603
|
-
function
|
|
2634
|
+
function tn({
|
|
2604
2635
|
compiledQuery: e,
|
|
2605
2636
|
compiledSql: r
|
|
2606
2637
|
}) {
|
|
2607
2638
|
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
|
|
2608
|
-
/* @__PURE__ */ a(
|
|
2609
|
-
e.pythonCode ? /* @__PURE__ */ a(
|
|
2639
|
+
/* @__PURE__ */ a(dr, { label: "SQL", value: e.sql }),
|
|
2640
|
+
e.pythonCode ? /* @__PURE__ */ a($e, { label: "Python", value: e.pythonCode }) : null,
|
|
2610
2641
|
e.parameters ? /* @__PURE__ */ a(
|
|
2611
|
-
|
|
2642
|
+
$e,
|
|
2612
2643
|
{
|
|
2613
2644
|
label: "Parameters",
|
|
2614
|
-
value:
|
|
2645
|
+
value: Fe(e.parameters)
|
|
2615
2646
|
}
|
|
2616
2647
|
) : null
|
|
2617
|
-
] }) : r ? /* @__PURE__ */ a(
|
|
2648
|
+
] }) : r ? /* @__PURE__ */ a(dr, { label: "SQL", value: r }) : /* @__PURE__ */ a($e, { label: "Compiled Query", value: Fe(e) });
|
|
2618
2649
|
}
|
|
2619
|
-
function
|
|
2650
|
+
function $e({
|
|
2620
2651
|
label: e,
|
|
2621
2652
|
value: r
|
|
2622
2653
|
}) {
|
|
@@ -2625,16 +2656,16 @@ function Le({
|
|
|
2625
2656
|
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: r })
|
|
2626
2657
|
] });
|
|
2627
2658
|
}
|
|
2628
|
-
function
|
|
2659
|
+
function dr({
|
|
2629
2660
|
label: e,
|
|
2630
2661
|
value: r
|
|
2631
2662
|
}) {
|
|
2632
2663
|
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
2633
2664
|
/* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
|
|
2634
|
-
/* @__PURE__ */ a("pre", { style: s.codeBlock, children:
|
|
2665
|
+
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: on(r) })
|
|
2635
2666
|
] });
|
|
2636
2667
|
}
|
|
2637
|
-
const
|
|
2668
|
+
const nn = /* @__PURE__ */ new Set([
|
|
2638
2669
|
"SELECT",
|
|
2639
2670
|
"FROM",
|
|
2640
2671
|
"JOIN",
|
|
@@ -2672,14 +2703,14 @@ const en = /* @__PURE__ */ new Set([
|
|
|
2672
2703
|
"ALL",
|
|
2673
2704
|
"WITH"
|
|
2674
2705
|
]);
|
|
2675
|
-
function
|
|
2706
|
+
function on(e) {
|
|
2676
2707
|
return e.split(/(\s+|,|\(|\))/).map((t, n) => {
|
|
2677
2708
|
if (!t) return null;
|
|
2678
2709
|
const i = t.toUpperCase();
|
|
2679
|
-
return
|
|
2710
|
+
return nn.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
|
|
2680
2711
|
});
|
|
2681
2712
|
}
|
|
2682
|
-
function
|
|
2713
|
+
function sn(e) {
|
|
2683
2714
|
return [
|
|
2684
2715
|
`${e.total} ${e.total === 1 ? "trace" : "traces"}`,
|
|
2685
2716
|
`${e.loading} loading`,
|
|
@@ -2688,7 +2719,7 @@ function tn(e) {
|
|
|
2688
2719
|
`${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
|
|
2689
2720
|
].join(" · ");
|
|
2690
2721
|
}
|
|
2691
|
-
function
|
|
2722
|
+
function an(e, r) {
|
|
2692
2723
|
const t = r.trim().toLowerCase();
|
|
2693
2724
|
return t ? e.filter(
|
|
2694
2725
|
(n) => [
|
|
@@ -2700,36 +2731,36 @@ function nn(e, r) {
|
|
|
2700
2731
|
n.sectionTitle,
|
|
2701
2732
|
n.builder,
|
|
2702
2733
|
n.queryKind,
|
|
2703
|
-
|
|
2734
|
+
$r(n)
|
|
2704
2735
|
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
2705
2736
|
) : e;
|
|
2706
2737
|
}
|
|
2707
|
-
function
|
|
2708
|
-
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(
|
|
2738
|
+
function ln(e) {
|
|
2739
|
+
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Me));
|
|
2709
2740
|
return [
|
|
2710
|
-
{ title: "Views", traces: e.filter((i) => !t.has(
|
|
2741
|
+
{ title: "Views", traces: e.filter((i) => !t.has(Me(i))) },
|
|
2711
2742
|
{ title: "Inputs", traces: r }
|
|
2712
2743
|
];
|
|
2713
2744
|
}
|
|
2714
|
-
function
|
|
2745
|
+
function kr(e, r) {
|
|
2715
2746
|
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
2716
2747
|
return r.traceId ? e.find((t) => t.traceId === r.traceId) : e.find((t) => !(r.queryId && t.queryId !== r.queryId || r.viewId && t.viewId !== r.viewId));
|
|
2717
2748
|
}
|
|
2718
|
-
function
|
|
2749
|
+
function dn(e, r) {
|
|
2719
2750
|
if (r.queryId)
|
|
2720
|
-
return
|
|
2751
|
+
return kr(e, r);
|
|
2721
2752
|
if (!r.viewId)
|
|
2722
2753
|
return;
|
|
2723
2754
|
const t = e.filter((n) => n.viewId === r.viewId);
|
|
2724
2755
|
return t.length === 1 ? t[0] : void 0;
|
|
2725
2756
|
}
|
|
2726
|
-
function
|
|
2757
|
+
function un(e, r) {
|
|
2727
2758
|
return !!(e && r && e.traceId === r.traceId);
|
|
2728
2759
|
}
|
|
2729
|
-
function
|
|
2760
|
+
function Me(e) {
|
|
2730
2761
|
return e.traceId;
|
|
2731
2762
|
}
|
|
2732
|
-
function
|
|
2763
|
+
function cn(e) {
|
|
2733
2764
|
switch (e) {
|
|
2734
2765
|
case "metric":
|
|
2735
2766
|
return "metric";
|
|
@@ -2744,14 +2775,14 @@ function ln(e) {
|
|
|
2744
2775
|
case "sql":
|
|
2745
2776
|
return "sql";
|
|
2746
2777
|
default:
|
|
2747
|
-
return
|
|
2778
|
+
return Ae(e);
|
|
2748
2779
|
}
|
|
2749
2780
|
}
|
|
2750
|
-
function
|
|
2781
|
+
function Er(e) {
|
|
2751
2782
|
const r = e.trim().toLowerCase();
|
|
2752
2783
|
return r === "metric" || r === "kpi" ? "metric" : r === "records" || r === "table" ? "records" : r === "matrix" || r === "pivot" ? "matrix" : r === "analysis" ? "analysis" : r === "inputs" || r === "input options" ? "inputs" : r === "sql" ? "sql" : "default";
|
|
2753
2784
|
}
|
|
2754
|
-
function
|
|
2785
|
+
function Rr(e) {
|
|
2755
2786
|
switch (e) {
|
|
2756
2787
|
case "metric":
|
|
2757
2788
|
return {
|
|
@@ -2783,25 +2814,25 @@ function Cr(e) {
|
|
|
2783
2814
|
};
|
|
2784
2815
|
}
|
|
2785
2816
|
}
|
|
2786
|
-
function
|
|
2817
|
+
function fn(e, r, t) {
|
|
2787
2818
|
const n = [];
|
|
2788
2819
|
return e.queryLabel && e.queryLabel !== r && n.push(e.queryLabel), e.queryId && e.queryId !== r && e.queryId !== e.queryLabel ? n.push(e.queryId) : e.viewId && e.viewId !== r && e.viewId !== e.queryLabel && n.push(e.viewId), n.push(t), n;
|
|
2789
2820
|
}
|
|
2790
|
-
function
|
|
2791
|
-
return
|
|
2821
|
+
function Lr(e) {
|
|
2822
|
+
return gn(e.visualType) || cn(e.queryKind);
|
|
2792
2823
|
}
|
|
2793
|
-
function
|
|
2794
|
-
return r ? e.queryLabel || e.queryId :
|
|
2824
|
+
function pn(e, r) {
|
|
2825
|
+
return r ? e.queryLabel || e.queryId : qe(e);
|
|
2795
2826
|
}
|
|
2796
|
-
function
|
|
2827
|
+
function gn(e) {
|
|
2797
2828
|
if (e)
|
|
2798
2829
|
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
2799
2830
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const r = e.sourceRefs.map(
|
|
2831
|
+
function $r(e) {
|
|
2832
|
+
const r = e.sourceRefs.map(F);
|
|
2802
2833
|
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
2803
2834
|
}
|
|
2804
|
-
function
|
|
2835
|
+
function mn(e) {
|
|
2805
2836
|
return e.reduce(
|
|
2806
2837
|
(r, t) => (t.role === "measure" ? r.measures.push(t) : t.role === "date" ? r.timeFields.push(t) : t.role === "dimension" ? r.dimensions.push(t) : t.role === "id" ? r.identifiers.push(t) : r.other.push(t), r),
|
|
2807
2838
|
{
|
|
@@ -2813,7 +2844,7 @@ function fn(e) {
|
|
|
2813
2844
|
}
|
|
2814
2845
|
);
|
|
2815
2846
|
}
|
|
2816
|
-
function
|
|
2847
|
+
function yn(e) {
|
|
2817
2848
|
var r, t;
|
|
2818
2849
|
if (e.queryKind === "records" && ((r = e.projectionFieldRefs) != null && r.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((t = e.latestAttempt) == null ? void 0 : t.rowCount) === 1)
|
|
2819
2850
|
return "KPI query";
|
|
@@ -2831,15 +2862,15 @@ function pn(e) {
|
|
|
2831
2862
|
case "sql":
|
|
2832
2863
|
return "SQL query";
|
|
2833
2864
|
default:
|
|
2834
|
-
return
|
|
2865
|
+
return Ae(e.queryKind);
|
|
2835
2866
|
}
|
|
2836
2867
|
}
|
|
2837
|
-
function
|
|
2868
|
+
function hn(e) {
|
|
2838
2869
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
2839
2870
|
}
|
|
2840
|
-
function
|
|
2871
|
+
function bn(e) {
|
|
2841
2872
|
var f, d, c;
|
|
2842
|
-
const r = e.valuePreview || "redacted", t = e.inputLabel || e.inputId, n = ((f = e.fieldRef) == null ? void 0 : f.label) || ((d = e.fieldRef) == null ? void 0 : d.name), i = (c = e.fieldRef) != null && c.source ?
|
|
2873
|
+
const r = e.valuePreview || "redacted", t = e.inputLabel || e.inputId, n = ((f = e.fieldRef) == null ? void 0 : f.label) || ((d = e.fieldRef) == null ? void 0 : d.name), i = (c = e.fieldRef) != null && c.source ? F(e.fieldRef.source) : void 0, o = [n ? `on ${n}` : void 0, i].filter(Boolean).join(" · "), u = [
|
|
2843
2874
|
t,
|
|
2844
2875
|
e.inputId,
|
|
2845
2876
|
e.operator,
|
|
@@ -2855,29 +2886,29 @@ function mn(e) {
|
|
|
2855
2886
|
title: u
|
|
2856
2887
|
};
|
|
2857
2888
|
}
|
|
2858
|
-
function
|
|
2889
|
+
function F(e) {
|
|
2859
2890
|
return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
|
|
2860
2891
|
e.schemaName,
|
|
2861
2892
|
e.tableName
|
|
2862
2893
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
2863
2894
|
}
|
|
2864
|
-
function
|
|
2895
|
+
function vn(e) {
|
|
2865
2896
|
if (e.file)
|
|
2866
2897
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
2867
2898
|
}
|
|
2868
|
-
function
|
|
2899
|
+
function Sn(e) {
|
|
2869
2900
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
2870
2901
|
}
|
|
2871
|
-
function
|
|
2902
|
+
function wn(e) {
|
|
2872
2903
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
2873
2904
|
}
|
|
2874
|
-
function
|
|
2875
|
-
return
|
|
2905
|
+
function In(e) {
|
|
2906
|
+
return Fe(e);
|
|
2876
2907
|
}
|
|
2877
|
-
function
|
|
2908
|
+
function Fe(e) {
|
|
2878
2909
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
2879
2910
|
}
|
|
2880
|
-
function
|
|
2911
|
+
function xn(e) {
|
|
2881
2912
|
switch (e.type) {
|
|
2882
2913
|
case "query_started":
|
|
2883
2914
|
return "Started";
|
|
@@ -2890,10 +2921,10 @@ function Sn(e) {
|
|
|
2890
2921
|
case "input_changed":
|
|
2891
2922
|
return "Input changed";
|
|
2892
2923
|
default:
|
|
2893
|
-
return
|
|
2924
|
+
return An(e);
|
|
2894
2925
|
}
|
|
2895
2926
|
}
|
|
2896
|
-
function
|
|
2927
|
+
function qn(e) {
|
|
2897
2928
|
return [
|
|
2898
2929
|
e.at,
|
|
2899
2930
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -2902,20 +2933,20 @@ function wn(e) {
|
|
|
2902
2933
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
2903
2934
|
].filter(Boolean).join(" - ");
|
|
2904
2935
|
}
|
|
2905
|
-
function
|
|
2936
|
+
function An(e) {
|
|
2906
2937
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
2907
2938
|
}
|
|
2908
|
-
function
|
|
2939
|
+
function Cn(e) {
|
|
2909
2940
|
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
2910
2941
|
}
|
|
2911
|
-
function
|
|
2912
|
-
return Array.isArray(e) ? e.map((r) =>
|
|
2942
|
+
function Oe(e) {
|
|
2943
|
+
return Array.isArray(e) ? e.map((r) => Tn(r)).filter((r) => !!r) : [];
|
|
2913
2944
|
}
|
|
2914
|
-
function
|
|
2945
|
+
function Tn(e) {
|
|
2915
2946
|
var r;
|
|
2916
|
-
return (r =
|
|
2947
|
+
return (r = kn(e)) == null ? void 0 : r.message;
|
|
2917
2948
|
}
|
|
2918
|
-
function
|
|
2949
|
+
function kn(e) {
|
|
2919
2950
|
if (typeof e == "string")
|
|
2920
2951
|
return { message: e };
|
|
2921
2952
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
@@ -2927,14 +2958,14 @@ function An(e) {
|
|
|
2927
2958
|
...i ? { path: i } : {}
|
|
2928
2959
|
} : t ? { message: t } : n ? { message: n, code: n } : void 0;
|
|
2929
2960
|
}
|
|
2930
|
-
function
|
|
2961
|
+
function En(e) {
|
|
2931
2962
|
const r = e == null ? void 0 : e.metadata, t = r && typeof r == "object" && !Array.isArray(r) && "dataAppDebug" in r && r.dataAppDebug && typeof r.dataAppDebug == "object" && !Array.isArray(r.dataAppDebug) ? r.dataAppDebug : void 0;
|
|
2932
2963
|
return {
|
|
2933
2964
|
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
2934
2965
|
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
2935
2966
|
};
|
|
2936
2967
|
}
|
|
2937
|
-
function
|
|
2968
|
+
function Or(e) {
|
|
2938
2969
|
return {
|
|
2939
2970
|
...e,
|
|
2940
2971
|
order: [],
|
|
@@ -2942,29 +2973,29 @@ function Rr(e) {
|
|
|
2942
2973
|
sequence: 0
|
|
2943
2974
|
};
|
|
2944
2975
|
}
|
|
2945
|
-
function
|
|
2976
|
+
function Rn(e, r) {
|
|
2946
2977
|
if (r.type === "config")
|
|
2947
2978
|
return r.config.enabled ? {
|
|
2948
2979
|
...e,
|
|
2949
2980
|
...r.config
|
|
2950
|
-
} :
|
|
2981
|
+
} : Or(r.config);
|
|
2951
2982
|
if (!e.enabled)
|
|
2952
2983
|
return e;
|
|
2953
2984
|
switch (r.type) {
|
|
2954
2985
|
case "register":
|
|
2955
|
-
return Ln(
|
|
2986
|
+
return Dn(Ln(e, r.descriptor));
|
|
2956
2987
|
case "unregister":
|
|
2957
|
-
return
|
|
2988
|
+
return $n(e, r.traceKey);
|
|
2958
2989
|
case "event":
|
|
2959
|
-
return
|
|
2990
|
+
return On(e, r);
|
|
2960
2991
|
default:
|
|
2961
2992
|
return e;
|
|
2962
2993
|
}
|
|
2963
2994
|
}
|
|
2964
|
-
function
|
|
2965
|
-
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i =
|
|
2966
|
-
...t ||
|
|
2967
|
-
...
|
|
2995
|
+
function Ln(e, r) {
|
|
2996
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Je(), o = {
|
|
2997
|
+
...t || Bn(r),
|
|
2998
|
+
...Dr(r),
|
|
2968
2999
|
traceKey: r.traceKey,
|
|
2969
3000
|
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
2970
3001
|
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
@@ -2982,7 +3013,7 @@ function kn(e, r) {
|
|
|
2982
3013
|
}
|
|
2983
3014
|
};
|
|
2984
3015
|
}
|
|
2985
|
-
function
|
|
3016
|
+
function $n(e, r) {
|
|
2986
3017
|
const t = e.entries[r];
|
|
2987
3018
|
return t ? {
|
|
2988
3019
|
...e,
|
|
@@ -2995,11 +3026,11 @@ function En(e, r) {
|
|
|
2995
3026
|
}
|
|
2996
3027
|
} : e;
|
|
2997
3028
|
}
|
|
2998
|
-
function
|
|
3029
|
+
function On(e, r) {
|
|
2999
3030
|
const t = e.entries[r.traceKey];
|
|
3000
3031
|
if (!t)
|
|
3001
3032
|
return e;
|
|
3002
|
-
const n =
|
|
3033
|
+
const n = Je(), i = [
|
|
3003
3034
|
...t.recentEvents,
|
|
3004
3035
|
r.event
|
|
3005
3036
|
].slice(-e.maxEventsPerQuery);
|
|
@@ -3019,7 +3050,7 @@ function Rn(e, r) {
|
|
|
3019
3050
|
}
|
|
3020
3051
|
};
|
|
3021
3052
|
}
|
|
3022
|
-
function
|
|
3053
|
+
function Dn(e) {
|
|
3023
3054
|
if (e.order.length <= e.maxQueries)
|
|
3024
3055
|
return e;
|
|
3025
3056
|
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
|
|
@@ -3033,10 +3064,10 @@ function Ln(e) {
|
|
|
3033
3064
|
)
|
|
3034
3065
|
} : e;
|
|
3035
3066
|
}
|
|
3036
|
-
function
|
|
3037
|
-
const r =
|
|
3067
|
+
function Bn(e) {
|
|
3068
|
+
const r = Je();
|
|
3038
3069
|
return {
|
|
3039
|
-
...
|
|
3070
|
+
...Dr(e),
|
|
3040
3071
|
traceKey: e.traceKey,
|
|
3041
3072
|
latestAttempt: { status: "idle" },
|
|
3042
3073
|
recentEvents: [],
|
|
@@ -3045,14 +3076,14 @@ function $n(e) {
|
|
|
3045
3076
|
lastEventAt: r
|
|
3046
3077
|
};
|
|
3047
3078
|
}
|
|
3048
|
-
function
|
|
3079
|
+
function Dr(e) {
|
|
3049
3080
|
var n;
|
|
3050
|
-
const r =
|
|
3081
|
+
const r = Hn(e.spec), t = Pn(
|
|
3051
3082
|
e.spec,
|
|
3052
3083
|
e.activeInputs
|
|
3053
3084
|
);
|
|
3054
3085
|
return {
|
|
3055
|
-
traceId:
|
|
3086
|
+
traceId: Kr(e.traceKey),
|
|
3056
3087
|
viewId: e.viewId,
|
|
3057
3088
|
viewTitle: e.viewTitle,
|
|
3058
3089
|
visualType: e.visualType,
|
|
@@ -3061,17 +3092,17 @@ function Lr(e) {
|
|
|
3061
3092
|
queryLabel: e.queryLabel,
|
|
3062
3093
|
queryKind: e.queryKind,
|
|
3063
3094
|
builder: e.builder,
|
|
3064
|
-
sourceRefs:
|
|
3095
|
+
sourceRefs: jn(e.intent),
|
|
3065
3096
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
3066
3097
|
projectionFieldRefs: r,
|
|
3067
3098
|
inputFieldRefs: t,
|
|
3068
|
-
fieldRefs:
|
|
3099
|
+
fieldRefs: Vn(e.intent),
|
|
3069
3100
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
3070
3101
|
inputId: i.inputId,
|
|
3071
3102
|
inputLabel: i.label,
|
|
3072
3103
|
fieldRef: i.field,
|
|
3073
3104
|
operator: i.operator,
|
|
3074
|
-
valuePreview:
|
|
3105
|
+
valuePreview: Fn(i)
|
|
3075
3106
|
})),
|
|
3076
3107
|
recentEvents: [],
|
|
3077
3108
|
clientWarnings: e.clientWarnings
|
|
@@ -3089,8 +3120,8 @@ function ve(e) {
|
|
|
3089
3120
|
}
|
|
3090
3121
|
function de(e) {
|
|
3091
3122
|
if (!e.enabled)
|
|
3092
|
-
return
|
|
3093
|
-
const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t =
|
|
3123
|
+
return Ar;
|
|
3124
|
+
const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t = Pe(r).map(bt);
|
|
3094
3125
|
return {
|
|
3095
3126
|
enabled: !0,
|
|
3096
3127
|
queries: r,
|
|
@@ -3104,48 +3135,48 @@ function de(e) {
|
|
|
3104
3135
|
getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(ve)
|
|
3105
3136
|
};
|
|
3106
3137
|
}
|
|
3107
|
-
function
|
|
3138
|
+
function Kn(e) {
|
|
3108
3139
|
return {
|
|
3109
|
-
snapshot: () =>
|
|
3110
|
-
getQuery: (r) =>
|
|
3111
|
-
getQueries: (r) => de(e()).getQueries(r).map((t) =>
|
|
3140
|
+
snapshot: () => xt(de(e())),
|
|
3141
|
+
getQuery: (r) => sr(de(e()).getQuery(r)),
|
|
3142
|
+
getQueries: (r) => de(e()).getQueries(r).map((t) => sr(t)).filter((t) => !!t),
|
|
3112
3143
|
getIssues: () => de(e()).issues
|
|
3113
3144
|
};
|
|
3114
3145
|
}
|
|
3115
|
-
function
|
|
3146
|
+
function Wn(e) {
|
|
3116
3147
|
return e === void 0 || e === !1 ? {
|
|
3117
3148
|
enabled: !1,
|
|
3118
3149
|
exposeWindowBridge: !1,
|
|
3119
|
-
maxEventsPerQuery:
|
|
3120
|
-
maxQueries:
|
|
3150
|
+
maxEventsPerQuery: Re,
|
|
3151
|
+
maxQueries: Le
|
|
3121
3152
|
} : e === !0 ? {
|
|
3122
3153
|
enabled: !0,
|
|
3123
3154
|
exposeWindowBridge: !1,
|
|
3124
|
-
maxEventsPerQuery:
|
|
3125
|
-
maxQueries:
|
|
3155
|
+
maxEventsPerQuery: Re,
|
|
3156
|
+
maxQueries: Le
|
|
3126
3157
|
} : {
|
|
3127
3158
|
enabled: e.enabled !== !1,
|
|
3128
3159
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
3129
|
-
maxEventsPerQuery:
|
|
3160
|
+
maxEventsPerQuery: cr(
|
|
3130
3161
|
e.maxEventsPerQuery,
|
|
3131
|
-
|
|
3132
|
-
|
|
3162
|
+
Re,
|
|
3163
|
+
Ot
|
|
3133
3164
|
),
|
|
3134
|
-
maxQueries:
|
|
3165
|
+
maxQueries: cr(
|
|
3135
3166
|
e.maxQueries,
|
|
3136
|
-
|
|
3137
|
-
|
|
3167
|
+
Le,
|
|
3168
|
+
Dt
|
|
3138
3169
|
)
|
|
3139
3170
|
};
|
|
3140
3171
|
}
|
|
3141
|
-
function
|
|
3172
|
+
function _n(e) {
|
|
3142
3173
|
const t = [
|
|
3143
3174
|
e == null ? void 0 : e.sourceHint,
|
|
3144
3175
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
3145
3176
|
].filter((n) => !!n).map((n) => ({
|
|
3146
3177
|
file: he(n.file),
|
|
3147
|
-
line:
|
|
3148
|
-
column:
|
|
3178
|
+
line: ur(n.line),
|
|
3179
|
+
column: ur(n.column),
|
|
3149
3180
|
exportName: he(n.exportName),
|
|
3150
3181
|
component: he(n.component),
|
|
3151
3182
|
note: he(n.note)
|
|
@@ -3160,16 +3191,16 @@ function he(e) {
|
|
|
3160
3191
|
const r = e.trim();
|
|
3161
3192
|
return r || void 0;
|
|
3162
3193
|
}
|
|
3163
|
-
function
|
|
3194
|
+
function ur(e) {
|
|
3164
3195
|
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
3165
3196
|
}
|
|
3166
|
-
function
|
|
3197
|
+
function cr(e, r, t) {
|
|
3167
3198
|
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
3168
3199
|
}
|
|
3169
|
-
function
|
|
3200
|
+
function Nn(e) {
|
|
3170
3201
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
3171
3202
|
}
|
|
3172
|
-
function
|
|
3203
|
+
function Mn(e) {
|
|
3173
3204
|
switch (e) {
|
|
3174
3205
|
case "metric":
|
|
3175
3206
|
return "semaphor.metric";
|
|
@@ -3184,14 +3215,14 @@ function Wn(e) {
|
|
|
3184
3215
|
case "sql":
|
|
3185
3216
|
return "semaphor.sql";
|
|
3186
3217
|
default:
|
|
3187
|
-
return
|
|
3218
|
+
return Ae(e);
|
|
3188
3219
|
}
|
|
3189
3220
|
}
|
|
3190
|
-
function
|
|
3221
|
+
function Ae(e) {
|
|
3191
3222
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3192
3223
|
}
|
|
3193
|
-
function
|
|
3194
|
-
if (
|
|
3224
|
+
function Fn(e) {
|
|
3225
|
+
if (zn(e))
|
|
3195
3226
|
return;
|
|
3196
3227
|
const r = e.value;
|
|
3197
3228
|
if (r !== void 0) {
|
|
@@ -3201,17 +3232,17 @@ function _n(e) {
|
|
|
3201
3232
|
).map((n) => String(n));
|
|
3202
3233
|
if (t.length === r.length && t.length > 0) {
|
|
3203
3234
|
const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
|
|
3204
|
-
return
|
|
3235
|
+
return fr(`${n}${i}`);
|
|
3205
3236
|
}
|
|
3206
3237
|
return `${r.length} selected`;
|
|
3207
3238
|
}
|
|
3208
|
-
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ?
|
|
3239
|
+
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? fr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
|
|
3209
3240
|
}
|
|
3210
3241
|
}
|
|
3211
|
-
function
|
|
3242
|
+
function fr(e) {
|
|
3212
3243
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
3213
3244
|
}
|
|
3214
|
-
function
|
|
3245
|
+
function zn(e) {
|
|
3215
3246
|
var t;
|
|
3216
3247
|
const r = [
|
|
3217
3248
|
e.inputId,
|
|
@@ -3222,13 +3253,13 @@ function Nn(e) {
|
|
|
3222
3253
|
(n) => r.includes(n)
|
|
3223
3254
|
);
|
|
3224
3255
|
}
|
|
3225
|
-
function
|
|
3256
|
+
function jn(e) {
|
|
3226
3257
|
const r = [];
|
|
3227
|
-
return
|
|
3228
|
-
|
|
3229
|
-
}),
|
|
3258
|
+
return Ie(e, (t) => {
|
|
3259
|
+
Qn(t) && r.push(t);
|
|
3260
|
+
}), rt(r);
|
|
3230
3261
|
}
|
|
3231
|
-
function
|
|
3262
|
+
function Hn(e) {
|
|
3232
3263
|
switch (e.queryKind) {
|
|
3233
3264
|
case "metric":
|
|
3234
3265
|
case "analysis":
|
|
@@ -3256,12 +3287,12 @@ function zn(e) {
|
|
|
3256
3287
|
...(e.values || []).map(De)
|
|
3257
3288
|
]);
|
|
3258
3289
|
default:
|
|
3259
|
-
return
|
|
3290
|
+
return Ae(e);
|
|
3260
3291
|
}
|
|
3261
3292
|
}
|
|
3262
|
-
function
|
|
3293
|
+
function Pn(e, r) {
|
|
3263
3294
|
const t = [
|
|
3264
|
-
...(e.inputs || []).map(
|
|
3295
|
+
...(e.inputs || []).map(Br),
|
|
3265
3296
|
...(r || []).map((n) => n.field)
|
|
3266
3297
|
];
|
|
3267
3298
|
return Y(t);
|
|
@@ -3269,16 +3300,16 @@ function Fn(e, r) {
|
|
|
3269
3300
|
function Y(e) {
|
|
3270
3301
|
const r = /* @__PURE__ */ new Map();
|
|
3271
3302
|
return e.forEach((t) => {
|
|
3272
|
-
t && fe(t) && r.set(
|
|
3303
|
+
t && fe(t) && r.set(Ge(t), t);
|
|
3273
3304
|
}), [...r.values()];
|
|
3274
3305
|
}
|
|
3275
|
-
function
|
|
3306
|
+
function Br(e) {
|
|
3276
3307
|
if (!e || typeof e != "object")
|
|
3277
3308
|
return;
|
|
3278
3309
|
const r = e.toAnalyticsInput;
|
|
3279
3310
|
if (typeof r == "function") {
|
|
3280
3311
|
const n = r.call(e);
|
|
3281
|
-
return
|
|
3312
|
+
return Br(n);
|
|
3282
3313
|
}
|
|
3283
3314
|
const t = e.field;
|
|
3284
3315
|
return fe(t) ? t : void 0;
|
|
@@ -3291,24 +3322,24 @@ function De(e) {
|
|
|
3291
3322
|
const r = e.field;
|
|
3292
3323
|
return fe(r) ? r : void 0;
|
|
3293
3324
|
}
|
|
3294
|
-
function
|
|
3325
|
+
function Vn(e) {
|
|
3295
3326
|
const r = /* @__PURE__ */ new Map();
|
|
3296
|
-
return
|
|
3297
|
-
fe(t) && r.set(
|
|
3327
|
+
return Ie(e, (t) => {
|
|
3328
|
+
fe(t) && r.set(Ge(t), t);
|
|
3298
3329
|
}), [...r.values()];
|
|
3299
3330
|
}
|
|
3300
|
-
function
|
|
3331
|
+
function Ie(e, r) {
|
|
3301
3332
|
if (!(!e || typeof e != "object")) {
|
|
3302
3333
|
if (r(e), Array.isArray(e)) {
|
|
3303
|
-
e.forEach((t) =>
|
|
3334
|
+
e.forEach((t) => Ie(t, r));
|
|
3304
3335
|
return;
|
|
3305
3336
|
}
|
|
3306
3337
|
Object.values(e).forEach(
|
|
3307
|
-
(t) =>
|
|
3338
|
+
(t) => Ie(t, r)
|
|
3308
3339
|
);
|
|
3309
3340
|
}
|
|
3310
3341
|
}
|
|
3311
|
-
function
|
|
3342
|
+
function Qn(e) {
|
|
3312
3343
|
if (!e || typeof e != "object")
|
|
3313
3344
|
return !1;
|
|
3314
3345
|
const r = e;
|
|
@@ -3320,27 +3351,27 @@ function fe(e) {
|
|
|
3320
3351
|
const r = e;
|
|
3321
3352
|
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
3322
3353
|
}
|
|
3323
|
-
function
|
|
3354
|
+
function Ge(e) {
|
|
3324
3355
|
return [
|
|
3325
3356
|
e.name,
|
|
3326
3357
|
e.role,
|
|
3327
3358
|
e.aggregate,
|
|
3328
|
-
e.source ?
|
|
3359
|
+
e.source ? et(e.source) : ""
|
|
3329
3360
|
].join(":");
|
|
3330
3361
|
}
|
|
3331
|
-
function
|
|
3362
|
+
function Un(e) {
|
|
3332
3363
|
const r = e;
|
|
3333
3364
|
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
3334
3365
|
}
|
|
3335
|
-
function
|
|
3366
|
+
function Gn(e) {
|
|
3336
3367
|
const r = e;
|
|
3337
3368
|
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
3338
3369
|
}
|
|
3339
|
-
function
|
|
3370
|
+
function pr(e) {
|
|
3340
3371
|
const r = e;
|
|
3341
3372
|
return r == null ? void 0 : r.executionResult;
|
|
3342
3373
|
}
|
|
3343
|
-
function
|
|
3374
|
+
function Jn(e) {
|
|
3344
3375
|
const r = e, t = [
|
|
3345
3376
|
...r != null && r.measures ? Object.keys(r.measures) : [],
|
|
3346
3377
|
...r != null && r.measureBindings ? Object.keys(r.measureBindings) : []
|
|
@@ -3353,11 +3384,29 @@ function Qn(e) {
|
|
|
3353
3384
|
...n.length > 0 ? { missingMeasures: n } : {}
|
|
3354
3385
|
};
|
|
3355
3386
|
}
|
|
3356
|
-
function
|
|
3387
|
+
function Yn(e) {
|
|
3388
|
+
const r = e;
|
|
3389
|
+
if (!r || typeof r != "object")
|
|
3390
|
+
return;
|
|
3391
|
+
const t = {};
|
|
3392
|
+
return Se(r.primaryValue) && (t.primaryValue = r.primaryValue), Se(r.value) && (t.value = r.value), Se(r.comparisonValue) && (t.comparisonValue = r.comparisonValue), typeof r.comparisonKind == "string" && (t.comparisonKind = r.comparisonKind), (typeof r.delta == "number" || r.delta === null) && (t.delta = r.delta), (typeof r.deltaPercent == "number" || r.deltaPercent === null) && (t.deltaPercent = r.deltaPercent), Xn(r.measures) && (t.measures = r.measures), Zn(r.measureBindings) && (t.measureBindings = r.measureBindings), Array.isArray(r.missingMeasures) && (t.missingMeasures = r.missingMeasures.filter(
|
|
3393
|
+
(n) => typeof n == "string" && !!n
|
|
3394
|
+
)), Object.keys(t).length > 0 ? t : void 0;
|
|
3395
|
+
}
|
|
3396
|
+
function Se(e) {
|
|
3397
|
+
return e === null || typeof e == "number" || typeof e == "string";
|
|
3398
|
+
}
|
|
3399
|
+
function Xn(e) {
|
|
3400
|
+
return e !== null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every(Se);
|
|
3401
|
+
}
|
|
3402
|
+
function Zn(e) {
|
|
3403
|
+
return e !== null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every((r) => typeof r == "string");
|
|
3404
|
+
}
|
|
3405
|
+
function gr(e) {
|
|
3357
3406
|
const r = e;
|
|
3358
3407
|
return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
|
|
3359
3408
|
}
|
|
3360
|
-
function
|
|
3409
|
+
function Kr(e) {
|
|
3361
3410
|
let r = 2166136261;
|
|
3362
3411
|
for (let t = 0; t < e.length; t += 1)
|
|
3363
3412
|
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
@@ -3366,10 +3415,10 @@ function Dr(e) {
|
|
|
3366
3415
|
function be() {
|
|
3367
3416
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
3368
3417
|
}
|
|
3369
|
-
function
|
|
3418
|
+
function Je() {
|
|
3370
3419
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3371
3420
|
}
|
|
3372
|
-
const
|
|
3421
|
+
const ei = [
|
|
3373
3422
|
"primary",
|
|
3374
3423
|
"comparisons",
|
|
3375
3424
|
"contributors",
|
|
@@ -3383,7 +3432,7 @@ const Un = [
|
|
|
3383
3432
|
"largestPositiveChanges",
|
|
3384
3433
|
"largestNegativeDrivers",
|
|
3385
3434
|
"largestPositiveDrivers"
|
|
3386
|
-
],
|
|
3435
|
+
], ri = [
|
|
3387
3436
|
"primary",
|
|
3388
3437
|
"records",
|
|
3389
3438
|
"periodChanges",
|
|
@@ -3398,12 +3447,12 @@ const Un = [
|
|
|
3398
3447
|
"largestNegativeDrivers",
|
|
3399
3448
|
"largestPositiveDrivers"
|
|
3400
3449
|
];
|
|
3401
|
-
function
|
|
3450
|
+
function Wr(e) {
|
|
3402
3451
|
if (!e)
|
|
3403
3452
|
return {};
|
|
3404
|
-
const r =
|
|
3405
|
-
|
|
3406
|
-
|
|
3453
|
+
const r = ai(e.executionResult), t = ti(e, r), n = oi(t), i = _r(
|
|
3454
|
+
Xe(e.analysisWarnings),
|
|
3455
|
+
ui(t)
|
|
3407
3456
|
);
|
|
3408
3457
|
return {
|
|
3409
3458
|
...e,
|
|
@@ -3416,19 +3465,19 @@ function Or(e) {
|
|
|
3416
3465
|
} : {}
|
|
3417
3466
|
};
|
|
3418
3467
|
}
|
|
3419
|
-
function
|
|
3420
|
-
const t =
|
|
3421
|
-
for (const i of
|
|
3468
|
+
function ti(e, r) {
|
|
3469
|
+
const t = ni(e.resultSets);
|
|
3470
|
+
for (const i of ei) {
|
|
3422
3471
|
if (t[i])
|
|
3423
3472
|
continue;
|
|
3424
|
-
const o =
|
|
3473
|
+
const o = li(e[i]);
|
|
3425
3474
|
if (!o.length)
|
|
3426
3475
|
continue;
|
|
3427
|
-
const u = r.length ? r :
|
|
3476
|
+
const u = r.length ? r : di(o);
|
|
3428
3477
|
t[i] = {
|
|
3429
3478
|
id: i,
|
|
3430
3479
|
role: i,
|
|
3431
|
-
...
|
|
3480
|
+
...Ye({
|
|
3432
3481
|
records: o,
|
|
3433
3482
|
columns: u,
|
|
3434
3483
|
resultSetKey: i
|
|
@@ -3437,20 +3486,20 @@ function Jn(e, r) {
|
|
|
3437
3486
|
rowCount: o.length
|
|
3438
3487
|
};
|
|
3439
3488
|
}
|
|
3440
|
-
const n =
|
|
3489
|
+
const n = si(e.executionResult);
|
|
3441
3490
|
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
3442
3491
|
}
|
|
3443
|
-
function
|
|
3492
|
+
function ni(e) {
|
|
3444
3493
|
return Object.fromEntries(
|
|
3445
3494
|
Object.entries(e || {}).map(([r, t]) => [
|
|
3446
3495
|
r,
|
|
3447
|
-
|
|
3496
|
+
ii(t, r)
|
|
3448
3497
|
])
|
|
3449
3498
|
);
|
|
3450
3499
|
}
|
|
3451
|
-
function
|
|
3500
|
+
function ii(e, r = e.id || e.role || "resultSet") {
|
|
3452
3501
|
var n;
|
|
3453
|
-
const t =
|
|
3502
|
+
const t = Ye({
|
|
3454
3503
|
records: e.records || [],
|
|
3455
3504
|
columns: e.columns || [],
|
|
3456
3505
|
resultSetKey: r
|
|
@@ -3459,28 +3508,28 @@ function Xn(e, r = e.id || e.role || "resultSet") {
|
|
|
3459
3508
|
...e,
|
|
3460
3509
|
...t,
|
|
3461
3510
|
...e.warnings || t.warnings ? {
|
|
3462
|
-
warnings:
|
|
3463
|
-
|
|
3511
|
+
warnings: _r(
|
|
3512
|
+
Xe(e.warnings),
|
|
3464
3513
|
t.warnings
|
|
3465
3514
|
)
|
|
3466
3515
|
} : {},
|
|
3467
3516
|
rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
|
|
3468
3517
|
};
|
|
3469
3518
|
}
|
|
3470
|
-
function
|
|
3519
|
+
function oi(e) {
|
|
3471
3520
|
var r;
|
|
3472
|
-
for (const t of
|
|
3521
|
+
for (const t of ri)
|
|
3473
3522
|
if ((r = e[t]) != null && r.records.length)
|
|
3474
3523
|
return e[t];
|
|
3475
3524
|
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
3476
3525
|
}
|
|
3477
|
-
function
|
|
3526
|
+
function si(e) {
|
|
3478
3527
|
const r = e == null ? void 0 : e.result;
|
|
3479
3528
|
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
3480
3529
|
return {
|
|
3481
3530
|
id: "records",
|
|
3482
3531
|
role: "records",
|
|
3483
|
-
...
|
|
3532
|
+
...Ye({
|
|
3484
3533
|
records: r.records,
|
|
3485
3534
|
columns: r.columns,
|
|
3486
3535
|
resultSetKey: "records"
|
|
@@ -3489,16 +3538,16 @@ function ei(e) {
|
|
|
3489
3538
|
rowCount: r.rowCount ?? r.records.length
|
|
3490
3539
|
};
|
|
3491
3540
|
}
|
|
3492
|
-
function
|
|
3541
|
+
function ai(e) {
|
|
3493
3542
|
const r = e == null ? void 0 : e.result;
|
|
3494
3543
|
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
3495
3544
|
}
|
|
3496
|
-
function
|
|
3545
|
+
function li(e) {
|
|
3497
3546
|
return Array.isArray(e) ? e.filter(
|
|
3498
3547
|
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
3499
3548
|
) : [];
|
|
3500
3549
|
}
|
|
3501
|
-
function
|
|
3550
|
+
function Ye({
|
|
3502
3551
|
records: e,
|
|
3503
3552
|
columns: r,
|
|
3504
3553
|
resultSetKey: t
|
|
@@ -3530,7 +3579,7 @@ function Ge({
|
|
|
3530
3579
|
...n.length ? { warnings: n } : {}
|
|
3531
3580
|
};
|
|
3532
3581
|
}
|
|
3533
|
-
function
|
|
3582
|
+
function di(e) {
|
|
3534
3583
|
return Array.from(
|
|
3535
3584
|
new Set(e.flatMap((t) => Object.keys(t)))
|
|
3536
3585
|
).map((t) => ({
|
|
@@ -3539,26 +3588,26 @@ function ni(e) {
|
|
|
3539
3588
|
label: t
|
|
3540
3589
|
}));
|
|
3541
3590
|
}
|
|
3542
|
-
function
|
|
3591
|
+
function ui(e) {
|
|
3543
3592
|
return Object.values(e).flatMap(
|
|
3544
|
-
(r) =>
|
|
3593
|
+
(r) => Xe(r.warnings)
|
|
3545
3594
|
);
|
|
3546
3595
|
}
|
|
3547
|
-
function
|
|
3548
|
-
return Array.isArray(e) ? e.filter(
|
|
3596
|
+
function Xe(e) {
|
|
3597
|
+
return Array.isArray(e) ? e.filter(ci) : [];
|
|
3549
3598
|
}
|
|
3550
|
-
function
|
|
3599
|
+
function ci(e) {
|
|
3551
3600
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
3552
3601
|
}
|
|
3553
|
-
function
|
|
3602
|
+
function _r(...e) {
|
|
3554
3603
|
const r = /* @__PURE__ */ new Set(), t = [];
|
|
3555
3604
|
for (const n of e.flatMap((i) => i || [])) {
|
|
3556
|
-
const i =
|
|
3605
|
+
const i = fi(n);
|
|
3557
3606
|
r.has(i) || (r.add(i), t.push(n));
|
|
3558
3607
|
}
|
|
3559
3608
|
return t;
|
|
3560
3609
|
}
|
|
3561
|
-
function
|
|
3610
|
+
function fi(e) {
|
|
3562
3611
|
return e.code === "missing_analysis_result_key" ? [
|
|
3563
3612
|
e.code,
|
|
3564
3613
|
e.resultSetKey,
|
|
@@ -3574,32 +3623,32 @@ function ze(e) {
|
|
|
3574
3623
|
const r = e;
|
|
3575
3624
|
return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
|
|
3576
3625
|
}
|
|
3577
|
-
const
|
|
3626
|
+
const Be = {
|
|
3578
3627
|
value: null,
|
|
3579
3628
|
primaryValue: null
|
|
3580
|
-
},
|
|
3581
|
-
function
|
|
3582
|
-
const r = X(e.inputs), t =
|
|
3629
|
+
}, Ke = {}, pi = { records: [] }, We = { options: [] }, gi = { records: [] }, _e = {};
|
|
3630
|
+
function mi(e) {
|
|
3631
|
+
const r = X(e.inputs), t = Gr(e);
|
|
3583
3632
|
try {
|
|
3584
|
-
const n =
|
|
3633
|
+
const n = Jr(e), i = ee(n, "analysis");
|
|
3585
3634
|
return i ? {
|
|
3586
3635
|
error: i,
|
|
3587
3636
|
activeInputs: r,
|
|
3588
3637
|
analysisOptions: t,
|
|
3589
|
-
queryKey:
|
|
3638
|
+
queryKey: A(
|
|
3590
3639
|
void 0,
|
|
3591
3640
|
r,
|
|
3592
3641
|
i,
|
|
3593
3642
|
t
|
|
3594
3643
|
),
|
|
3595
|
-
idleData:
|
|
3644
|
+
idleData: Ke
|
|
3596
3645
|
} : {
|
|
3597
3646
|
intent: n,
|
|
3598
3647
|
error: null,
|
|
3599
3648
|
activeInputs: r,
|
|
3600
3649
|
analysisOptions: t,
|
|
3601
|
-
queryKey:
|
|
3602
|
-
idleData:
|
|
3650
|
+
queryKey: A(n, r, void 0, t),
|
|
3651
|
+
idleData: Ke
|
|
3603
3652
|
};
|
|
3604
3653
|
} catch (n) {
|
|
3605
3654
|
const i = Z(n, "analysis");
|
|
@@ -3607,56 +3656,56 @@ function di(e) {
|
|
|
3607
3656
|
error: i,
|
|
3608
3657
|
activeInputs: r,
|
|
3609
3658
|
analysisOptions: t,
|
|
3610
|
-
queryKey:
|
|
3659
|
+
queryKey: A(
|
|
3611
3660
|
void 0,
|
|
3612
3661
|
r,
|
|
3613
3662
|
i,
|
|
3614
3663
|
t
|
|
3615
3664
|
),
|
|
3616
|
-
idleData:
|
|
3665
|
+
idleData: Ke
|
|
3617
3666
|
};
|
|
3618
3667
|
}
|
|
3619
3668
|
}
|
|
3620
|
-
function
|
|
3669
|
+
function yi(e) {
|
|
3621
3670
|
const r = X(e.inputs);
|
|
3622
3671
|
try {
|
|
3623
|
-
const t =
|
|
3672
|
+
const t = Yr(e), n = ee(t);
|
|
3624
3673
|
return n ? {
|
|
3625
3674
|
error: n,
|
|
3626
3675
|
activeInputs: r,
|
|
3627
|
-
queryKey:
|
|
3628
|
-
idleData:
|
|
3676
|
+
queryKey: A(void 0, r, n),
|
|
3677
|
+
idleData: Be
|
|
3629
3678
|
} : {
|
|
3630
3679
|
intent: t,
|
|
3631
3680
|
error: null,
|
|
3632
3681
|
activeInputs: r,
|
|
3633
|
-
queryKey:
|
|
3634
|
-
idleData:
|
|
3682
|
+
queryKey: A(t, r),
|
|
3683
|
+
idleData: Be
|
|
3635
3684
|
};
|
|
3636
3685
|
} catch (t) {
|
|
3637
3686
|
const n = Z(t, "metric");
|
|
3638
3687
|
return {
|
|
3639
3688
|
error: n,
|
|
3640
3689
|
activeInputs: r,
|
|
3641
|
-
queryKey:
|
|
3642
|
-
idleData:
|
|
3690
|
+
queryKey: A(void 0, r, n),
|
|
3691
|
+
idleData: Be
|
|
3643
3692
|
};
|
|
3644
3693
|
}
|
|
3645
3694
|
}
|
|
3646
|
-
function
|
|
3647
|
-
const r = X(e.inputs), t =
|
|
3695
|
+
function hi(e) {
|
|
3696
|
+
const r = X(e.inputs), t = pi;
|
|
3648
3697
|
try {
|
|
3649
|
-
const n =
|
|
3698
|
+
const n = Ur(e), i = ee(n);
|
|
3650
3699
|
return i ? {
|
|
3651
3700
|
error: i,
|
|
3652
3701
|
activeInputs: r,
|
|
3653
|
-
queryKey:
|
|
3702
|
+
queryKey: A(void 0, r, i),
|
|
3654
3703
|
idleData: t
|
|
3655
3704
|
} : {
|
|
3656
3705
|
intent: n,
|
|
3657
3706
|
error: null,
|
|
3658
3707
|
activeInputs: r,
|
|
3659
|
-
queryKey:
|
|
3708
|
+
queryKey: A(n, r),
|
|
3660
3709
|
idleData: t
|
|
3661
3710
|
};
|
|
3662
3711
|
} catch (n) {
|
|
@@ -3664,51 +3713,51 @@ function ci(e) {
|
|
|
3664
3713
|
return {
|
|
3665
3714
|
error: i,
|
|
3666
3715
|
activeInputs: r,
|
|
3667
|
-
queryKey:
|
|
3716
|
+
queryKey: A(void 0, r, i),
|
|
3668
3717
|
idleData: t
|
|
3669
3718
|
};
|
|
3670
3719
|
}
|
|
3671
3720
|
}
|
|
3672
|
-
function
|
|
3721
|
+
function bi(e) {
|
|
3673
3722
|
const r = X(e.inputs);
|
|
3674
3723
|
try {
|
|
3675
|
-
const t =
|
|
3724
|
+
const t = Qr(e), n = ee(t);
|
|
3676
3725
|
return n ? {
|
|
3677
3726
|
error: n,
|
|
3678
3727
|
activeInputs: r,
|
|
3679
|
-
queryKey:
|
|
3680
|
-
idleData:
|
|
3728
|
+
queryKey: A(void 0, r, n),
|
|
3729
|
+
idleData: We
|
|
3681
3730
|
} : {
|
|
3682
3731
|
intent: t,
|
|
3683
3732
|
error: null,
|
|
3684
3733
|
activeInputs: r,
|
|
3685
|
-
queryKey:
|
|
3686
|
-
idleData:
|
|
3734
|
+
queryKey: A(t, r),
|
|
3735
|
+
idleData: We
|
|
3687
3736
|
};
|
|
3688
3737
|
} catch (t) {
|
|
3689
3738
|
const n = Z(t, "inputOptions");
|
|
3690
3739
|
return {
|
|
3691
3740
|
error: n,
|
|
3692
3741
|
activeInputs: r,
|
|
3693
|
-
queryKey:
|
|
3694
|
-
idleData:
|
|
3742
|
+
queryKey: A(void 0, r, n),
|
|
3743
|
+
idleData: We
|
|
3695
3744
|
};
|
|
3696
3745
|
}
|
|
3697
3746
|
}
|
|
3698
|
-
function
|
|
3699
|
-
const r = X(e.inputs), t =
|
|
3747
|
+
function vi(e) {
|
|
3748
|
+
const r = X(e.inputs), t = gi;
|
|
3700
3749
|
try {
|
|
3701
|
-
const n =
|
|
3750
|
+
const n = Vr(e), i = ee(n);
|
|
3702
3751
|
return i ? {
|
|
3703
3752
|
error: i,
|
|
3704
3753
|
activeInputs: r,
|
|
3705
|
-
queryKey:
|
|
3754
|
+
queryKey: A(void 0, r, i),
|
|
3706
3755
|
idleData: t
|
|
3707
3756
|
} : {
|
|
3708
3757
|
intent: n,
|
|
3709
3758
|
error: null,
|
|
3710
3759
|
activeInputs: r,
|
|
3711
|
-
queryKey:
|
|
3760
|
+
queryKey: A(n, r),
|
|
3712
3761
|
idleData: t
|
|
3713
3762
|
};
|
|
3714
3763
|
} catch (n) {
|
|
@@ -3716,42 +3765,42 @@ function pi(e) {
|
|
|
3716
3765
|
return {
|
|
3717
3766
|
error: i,
|
|
3718
3767
|
activeInputs: r,
|
|
3719
|
-
queryKey:
|
|
3768
|
+
queryKey: A(void 0, r, i),
|
|
3720
3769
|
idleData: t
|
|
3721
3770
|
};
|
|
3722
3771
|
}
|
|
3723
3772
|
}
|
|
3724
|
-
function
|
|
3773
|
+
function Si(e) {
|
|
3725
3774
|
const r = X(e.inputs);
|
|
3726
3775
|
try {
|
|
3727
|
-
const t =
|
|
3776
|
+
const t = Pr(e), n = ee(t);
|
|
3728
3777
|
return n ? {
|
|
3729
3778
|
error: n,
|
|
3730
3779
|
activeInputs: r,
|
|
3731
|
-
queryKey:
|
|
3732
|
-
idleData:
|
|
3780
|
+
queryKey: A(void 0, r, n),
|
|
3781
|
+
idleData: _e
|
|
3733
3782
|
} : {
|
|
3734
3783
|
intent: t,
|
|
3735
3784
|
error: null,
|
|
3736
3785
|
activeInputs: r,
|
|
3737
|
-
queryKey:
|
|
3738
|
-
idleData:
|
|
3786
|
+
queryKey: A(t, r),
|
|
3787
|
+
idleData: _e
|
|
3739
3788
|
};
|
|
3740
3789
|
} catch (t) {
|
|
3741
3790
|
const n = Z(t, "matrix");
|
|
3742
3791
|
return {
|
|
3743
3792
|
error: n,
|
|
3744
3793
|
activeInputs: r,
|
|
3745
|
-
queryKey:
|
|
3746
|
-
idleData:
|
|
3794
|
+
queryKey: A(void 0, r, n),
|
|
3795
|
+
idleData: _e
|
|
3747
3796
|
};
|
|
3748
3797
|
}
|
|
3749
3798
|
}
|
|
3750
|
-
function
|
|
3799
|
+
function je(e) {
|
|
3751
3800
|
var o;
|
|
3752
|
-
if (
|
|
3801
|
+
if (wi(e))
|
|
3753
3802
|
return e;
|
|
3754
|
-
const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i =
|
|
3803
|
+
const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ce(
|
|
3755
3804
|
(r == null ? void 0 : r.message) ?? String(e),
|
|
3756
3805
|
{
|
|
3757
3806
|
requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
|
|
@@ -3764,7 +3813,7 @@ function Fe(e) {
|
|
|
3764
3813
|
return i.name = (r == null ? void 0 : r.name) || i.name, i.stack = r == null ? void 0 : r.stack, i;
|
|
3765
3814
|
}
|
|
3766
3815
|
function Z(e, r) {
|
|
3767
|
-
const t =
|
|
3816
|
+
const t = je(e);
|
|
3768
3817
|
if (t.executionResult || t.validation)
|
|
3769
3818
|
return t;
|
|
3770
3819
|
const n = {
|
|
@@ -3784,39 +3833,39 @@ function Z(e, r) {
|
|
|
3784
3833
|
recommendedNextStep: "Update the Data App query spec to satisfy the SDK builder contract."
|
|
3785
3834
|
}
|
|
3786
3835
|
]
|
|
3787
|
-
}, i =
|
|
3836
|
+
}, i = Nr(
|
|
3788
3837
|
void 0,
|
|
3789
3838
|
r,
|
|
3790
3839
|
n
|
|
3791
|
-
), o =
|
|
3840
|
+
), o = Ce(t.message, {
|
|
3792
3841
|
executionResult: i,
|
|
3793
3842
|
validation: n,
|
|
3794
3843
|
validationIssues: n.errors
|
|
3795
3844
|
});
|
|
3796
3845
|
return o.stack = t.stack, o;
|
|
3797
3846
|
}
|
|
3798
|
-
function
|
|
3847
|
+
function Ce(e, r = {}) {
|
|
3799
3848
|
var i, o, u;
|
|
3800
3849
|
const t = new Error(e);
|
|
3801
3850
|
t.name = "SemaphorDataAppQueryError", t.kind = "data_app_query_error", r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), r.validation !== void 0 && (t.validation = r.validation);
|
|
3802
3851
|
const n = r.validationIssues ?? ((i = r.validation) == null ? void 0 : i.errors) ?? ((u = (o = r.executionResult) == null ? void 0 : o.validation) == null ? void 0 : u.errors);
|
|
3803
3852
|
return n !== void 0 && (t.validationIssues = n), t;
|
|
3804
3853
|
}
|
|
3805
|
-
function
|
|
3854
|
+
function wi(e) {
|
|
3806
3855
|
return e instanceof Error && e.kind === "data_app_query_error";
|
|
3807
3856
|
}
|
|
3808
3857
|
function ee(e, r = e.kind) {
|
|
3809
|
-
const t =
|
|
3858
|
+
const t = ut(e);
|
|
3810
3859
|
if (t.ok)
|
|
3811
3860
|
return null;
|
|
3812
3861
|
const n = t.errors.map(
|
|
3813
3862
|
(o) => o.path ? `${o.code} at ${o.path}: ${o.message}` : `${o.code}: ${o.message}`
|
|
3814
|
-
).join("; "), i =
|
|
3863
|
+
).join("; "), i = Nr(
|
|
3815
3864
|
e,
|
|
3816
3865
|
r,
|
|
3817
3866
|
t
|
|
3818
3867
|
);
|
|
3819
|
-
return
|
|
3868
|
+
return Ce(
|
|
3820
3869
|
`Invalid Semaphor analytics intent. ${n}`,
|
|
3821
3870
|
{
|
|
3822
3871
|
executionResult: i,
|
|
@@ -3825,7 +3874,7 @@ function ee(e, r = e.kind) {
|
|
|
3825
3874
|
}
|
|
3826
3875
|
);
|
|
3827
3876
|
}
|
|
3828
|
-
function
|
|
3877
|
+
function Nr(e, r, t) {
|
|
3829
3878
|
return {
|
|
3830
3879
|
...e != null && e.id ? { intentId: e.id } : {},
|
|
3831
3880
|
...e ? { intent: e } : {},
|
|
@@ -3864,7 +3913,7 @@ function Kr(e, r, t) {
|
|
|
3864
3913
|
}
|
|
3865
3914
|
};
|
|
3866
3915
|
}
|
|
3867
|
-
function
|
|
3916
|
+
function A(e, r, t, n) {
|
|
3868
3917
|
return JSON.stringify({
|
|
3869
3918
|
intent: e,
|
|
3870
3919
|
activeInputs: r,
|
|
@@ -3872,13 +3921,13 @@ function q(e, r, t, n) {
|
|
|
3872
3921
|
error: t == null ? void 0 : t.message
|
|
3873
3922
|
});
|
|
3874
3923
|
}
|
|
3875
|
-
function
|
|
3924
|
+
function Ii() {
|
|
3876
3925
|
return {
|
|
3877
3926
|
executeAnalysis: (e, r, t) => G(
|
|
3878
3927
|
e,
|
|
3879
3928
|
r,
|
|
3880
3929
|
t ?? {}
|
|
3881
|
-
).then(
|
|
3930
|
+
).then(Wr),
|
|
3882
3931
|
executeMetric: (e, r) => G(e, r),
|
|
3883
3932
|
executeRecords: (e, r) => G(e, r),
|
|
3884
3933
|
executeInputOptions: (e, r) => G(e, r),
|
|
@@ -3891,7 +3940,7 @@ async function G(e, r, t) {
|
|
|
3891
3940
|
throw new Error(
|
|
3892
3941
|
"SemaphorDataAppProvider needs a token to execute queries."
|
|
3893
3942
|
);
|
|
3894
|
-
const n =
|
|
3943
|
+
const n = Ri(r), i = Ai(e, n);
|
|
3895
3944
|
let o;
|
|
3896
3945
|
try {
|
|
3897
3946
|
o = await fetch(n, {
|
|
@@ -3905,7 +3954,7 @@ async function G(e, r, t) {
|
|
|
3905
3954
|
activeInputs: r.activeInputs,
|
|
3906
3955
|
...t ? { analysisOptions: t } : {},
|
|
3907
3956
|
resultShape: e.kind,
|
|
3908
|
-
...
|
|
3957
|
+
...qi(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
3909
3958
|
})
|
|
3910
3959
|
});
|
|
3911
3960
|
} catch (f) {
|
|
@@ -3913,37 +3962,37 @@ async function G(e, r, t) {
|
|
|
3913
3962
|
`${i}: ${f instanceof Error ? f.message : String(f)}`
|
|
3914
3963
|
);
|
|
3915
3964
|
}
|
|
3916
|
-
const u = await
|
|
3965
|
+
const u = await ki(o);
|
|
3917
3966
|
if (!o.ok || u.error)
|
|
3918
|
-
throw
|
|
3967
|
+
throw xi(
|
|
3919
3968
|
`${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
|
|
3920
3969
|
u
|
|
3921
3970
|
);
|
|
3922
3971
|
return u;
|
|
3923
3972
|
}
|
|
3924
|
-
function
|
|
3973
|
+
function xi(e, r) {
|
|
3925
3974
|
var t;
|
|
3926
|
-
return
|
|
3975
|
+
return Ce(e, {
|
|
3927
3976
|
requestId: r.requestId,
|
|
3928
3977
|
details: r.details,
|
|
3929
3978
|
executionResult: r.executionResult,
|
|
3930
3979
|
validation: (t = r.executionResult) == null ? void 0 : t.validation
|
|
3931
3980
|
});
|
|
3932
3981
|
}
|
|
3933
|
-
function
|
|
3982
|
+
function qi(e) {
|
|
3934
3983
|
const r = e.debug;
|
|
3935
3984
|
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
3936
3985
|
}
|
|
3937
|
-
function
|
|
3986
|
+
function Ai(e, r) {
|
|
3938
3987
|
return [
|
|
3939
3988
|
`Semaphor ${e.kind} query`,
|
|
3940
3989
|
e.id ? `id=${e.id}` : void 0,
|
|
3941
3990
|
e.label ? `label=${e.label}` : void 0,
|
|
3942
|
-
|
|
3943
|
-
`endpoint=${
|
|
3991
|
+
Ci(e),
|
|
3992
|
+
`endpoint=${Ti(r)}`
|
|
3944
3993
|
].filter((t) => !!t).join(" ");
|
|
3945
3994
|
}
|
|
3946
|
-
function
|
|
3995
|
+
function Ci(e) {
|
|
3947
3996
|
const r = "source" in e ? e.source : void 0;
|
|
3948
3997
|
if (!(!r || typeof r != "object")) {
|
|
3949
3998
|
if (r.kind === "semantic")
|
|
@@ -3962,7 +4011,7 @@ function Si(e) {
|
|
|
3962
4011
|
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
3963
4012
|
}
|
|
3964
4013
|
}
|
|
3965
|
-
function
|
|
4014
|
+
function Ti(e) {
|
|
3966
4015
|
if (!e)
|
|
3967
4016
|
return "/api/v1/data-app/execute";
|
|
3968
4017
|
try {
|
|
@@ -3971,7 +4020,7 @@ function wi(e) {
|
|
|
3971
4020
|
return e;
|
|
3972
4021
|
}
|
|
3973
4022
|
}
|
|
3974
|
-
async function
|
|
4023
|
+
async function ki(e) {
|
|
3975
4024
|
const r = await e.text().catch(() => "");
|
|
3976
4025
|
if (!r.trim())
|
|
3977
4026
|
return e.ok ? {
|
|
@@ -3984,52 +4033,52 @@ async function Ii(e) {
|
|
|
3984
4033
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
3985
4034
|
details: r
|
|
3986
4035
|
} : {
|
|
3987
|
-
error:
|
|
4036
|
+
error: Ei(e, r),
|
|
3988
4037
|
details: r
|
|
3989
4038
|
};
|
|
3990
4039
|
}
|
|
3991
4040
|
}
|
|
3992
|
-
function
|
|
4041
|
+
function Ei(e, r) {
|
|
3993
4042
|
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
3994
4043
|
return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
|
|
3995
4044
|
}
|
|
3996
|
-
function
|
|
3997
|
-
const r =
|
|
4045
|
+
function Ri(e) {
|
|
4046
|
+
const r = Li(e).replace(/\/+$/, "");
|
|
3998
4047
|
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
3999
4048
|
}
|
|
4000
|
-
function
|
|
4049
|
+
function Li(e) {
|
|
4001
4050
|
if (e.apiBaseUrl)
|
|
4002
4051
|
return e.apiBaseUrl;
|
|
4003
4052
|
if (!e.token)
|
|
4004
4053
|
return "";
|
|
4005
4054
|
try {
|
|
4006
|
-
return
|
|
4055
|
+
return dt(e.token).apiServiceUrl || "";
|
|
4007
4056
|
} catch {
|
|
4008
4057
|
return "";
|
|
4009
4058
|
}
|
|
4010
4059
|
}
|
|
4011
|
-
const
|
|
4012
|
-
function
|
|
4060
|
+
const Mr = xe({});
|
|
4061
|
+
function $i() {
|
|
4013
4062
|
if (!(typeof window > "u"))
|
|
4014
4063
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
4015
4064
|
}
|
|
4016
|
-
function
|
|
4017
|
-
return Q(
|
|
4065
|
+
function Oi() {
|
|
4066
|
+
return Q(Mr);
|
|
4018
4067
|
}
|
|
4019
|
-
function
|
|
4020
|
-
const [r, t] =
|
|
4021
|
-
() =>
|
|
4068
|
+
function eo(e) {
|
|
4069
|
+
const [r, t] = z(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
|
|
4070
|
+
() => hr(e.options),
|
|
4022
4071
|
[e.options]
|
|
4023
|
-
), u =
|
|
4072
|
+
), u = D(
|
|
4024
4073
|
(d) => {
|
|
4025
|
-
var
|
|
4074
|
+
var g;
|
|
4026
4075
|
const c = d;
|
|
4027
|
-
(
|
|
4076
|
+
(g = e.onValueChange) == null || g.call(e, c), n || t(c);
|
|
4028
4077
|
},
|
|
4029
4078
|
[n, e]
|
|
4030
|
-
), f =
|
|
4079
|
+
), f = D(() => u(void 0), [u]);
|
|
4031
4080
|
return I(() => {
|
|
4032
|
-
const d =
|
|
4081
|
+
const d = br(e);
|
|
4033
4082
|
return {
|
|
4034
4083
|
id: e.id,
|
|
4035
4084
|
kind: e.kind,
|
|
@@ -4057,8 +4106,8 @@ function Ui(e) {
|
|
|
4057
4106
|
};
|
|
4058
4107
|
}, [f, o, u, e, i]);
|
|
4059
4108
|
}
|
|
4060
|
-
function
|
|
4061
|
-
const [r, t] =
|
|
4109
|
+
function ro(e) {
|
|
4110
|
+
const [r, t] = z(() => Mi(e));
|
|
4062
4111
|
return B(() => {
|
|
4063
4112
|
t((n) => {
|
|
4064
4113
|
let i = n;
|
|
@@ -4071,13 +4120,13 @@ function Gi(e) {
|
|
|
4071
4120
|
const i = Object.prototype.hasOwnProperty.call(
|
|
4072
4121
|
n,
|
|
4073
4122
|
"value"
|
|
4074
|
-
), o = i ? n.value : r[n.id], u =
|
|
4123
|
+
), o = i ? n.value : r[n.id], u = hr(n.options), f = (g) => {
|
|
4075
4124
|
var m;
|
|
4076
|
-
(m = n.onValueChange) == null || m.call(n,
|
|
4125
|
+
(m = n.onValueChange) == null || m.call(n, g), i || t((v) => ({
|
|
4077
4126
|
...v,
|
|
4078
|
-
[n.id]:
|
|
4127
|
+
[n.id]: g
|
|
4079
4128
|
}));
|
|
4080
|
-
}, d = () => f(void 0), c =
|
|
4129
|
+
}, d = () => f(void 0), c = br(n);
|
|
4081
4130
|
return {
|
|
4082
4131
|
id: n.id,
|
|
4083
4132
|
kind: n.kind,
|
|
@@ -4107,29 +4156,29 @@ function Gi(e) {
|
|
|
4107
4156
|
[e, r]
|
|
4108
4157
|
);
|
|
4109
4158
|
}
|
|
4110
|
-
function
|
|
4111
|
-
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() =>
|
|
4159
|
+
function to(e, r) {
|
|
4160
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Bi(t), [t]);
|
|
4112
4161
|
B(() => {
|
|
4113
|
-
|
|
4162
|
+
Di(e.value, t) || e.clear();
|
|
4114
4163
|
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
4115
4164
|
}
|
|
4116
|
-
function
|
|
4165
|
+
function Di(e, r) {
|
|
4117
4166
|
if (!ue(e) || r === void 0)
|
|
4118
4167
|
return !0;
|
|
4119
4168
|
const t = new Set(
|
|
4120
|
-
r.map((i) =>
|
|
4169
|
+
r.map((i) => mr(i.value))
|
|
4121
4170
|
);
|
|
4122
4171
|
return (Array.isArray(e) ? e : [e]).every(
|
|
4123
|
-
(i) => t.has(
|
|
4172
|
+
(i) => t.has(mr(i))
|
|
4124
4173
|
);
|
|
4125
4174
|
}
|
|
4126
|
-
function
|
|
4175
|
+
function Bi(e) {
|
|
4127
4176
|
return JSON.stringify((e || []).map((r) => r.value));
|
|
4128
4177
|
}
|
|
4129
|
-
function
|
|
4178
|
+
function mr(e) {
|
|
4130
4179
|
return `${typeof e}:${String(e)}`;
|
|
4131
4180
|
}
|
|
4132
|
-
function
|
|
4181
|
+
function no(e, r = {}) {
|
|
4133
4182
|
const t = I(
|
|
4134
4183
|
() => r.inputs ? {
|
|
4135
4184
|
...e,
|
|
@@ -4141,37 +4190,37 @@ function Yi(e, r = {}) {
|
|
|
4141
4190
|
case "metric":
|
|
4142
4191
|
return {
|
|
4143
4192
|
queryKind: t.queryKind,
|
|
4144
|
-
request:
|
|
4193
|
+
request: yi(t)
|
|
4145
4194
|
};
|
|
4146
4195
|
case "analysis":
|
|
4147
4196
|
return {
|
|
4148
4197
|
queryKind: t.queryKind,
|
|
4149
|
-
request:
|
|
4198
|
+
request: mi(t)
|
|
4150
4199
|
};
|
|
4151
4200
|
case "records":
|
|
4152
4201
|
return {
|
|
4153
4202
|
queryKind: t.queryKind,
|
|
4154
|
-
request:
|
|
4203
|
+
request: hi(t)
|
|
4155
4204
|
};
|
|
4156
4205
|
case "inputOptions":
|
|
4157
4206
|
return {
|
|
4158
4207
|
queryKind: t.queryKind,
|
|
4159
|
-
request:
|
|
4208
|
+
request: bi(t)
|
|
4160
4209
|
};
|
|
4161
4210
|
case "sql":
|
|
4162
4211
|
return {
|
|
4163
4212
|
queryKind: t.queryKind,
|
|
4164
|
-
request:
|
|
4213
|
+
request: vi(t)
|
|
4165
4214
|
};
|
|
4166
4215
|
case "matrix":
|
|
4167
4216
|
return {
|
|
4168
4217
|
queryKind: t.queryKind,
|
|
4169
|
-
request:
|
|
4218
|
+
request: Si(t)
|
|
4170
4219
|
};
|
|
4171
4220
|
default:
|
|
4172
|
-
return
|
|
4221
|
+
return we(t);
|
|
4173
4222
|
}
|
|
4174
|
-
}, [t]), i =
|
|
4223
|
+
}, [t]), i = Nt({
|
|
4175
4224
|
spec: t,
|
|
4176
4225
|
queryKind: n.queryKind,
|
|
4177
4226
|
queryKey: n.request.queryKey,
|
|
@@ -4191,9 +4240,9 @@ function Yi(e, r = {}) {
|
|
|
4191
4240
|
i.start,
|
|
4192
4241
|
i.success
|
|
4193
4242
|
]
|
|
4194
|
-
), f =
|
|
4243
|
+
), f = D(
|
|
4195
4244
|
(l) => {
|
|
4196
|
-
var K, T, N, $, S, w, L, x,
|
|
4245
|
+
var K, T, N, $, S, w, L, x, O;
|
|
4197
4246
|
const b = n.request;
|
|
4198
4247
|
if (b.intent)
|
|
4199
4248
|
switch (n.queryKind) {
|
|
@@ -4226,23 +4275,23 @@ function Yi(e, r = {}) {
|
|
|
4226
4275
|
l
|
|
4227
4276
|
);
|
|
4228
4277
|
case "matrix":
|
|
4229
|
-
return (
|
|
4278
|
+
return (O = (x = l.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : O.call(
|
|
4230
4279
|
x,
|
|
4231
4280
|
b.intent,
|
|
4232
4281
|
l
|
|
4233
4282
|
);
|
|
4234
4283
|
default:
|
|
4235
|
-
return
|
|
4284
|
+
return we(n);
|
|
4236
4285
|
}
|
|
4237
4286
|
},
|
|
4238
4287
|
[n]
|
|
4239
|
-
), d =
|
|
4288
|
+
), d = Ni(
|
|
4240
4289
|
n.request.queryKey,
|
|
4241
4290
|
f,
|
|
4242
4291
|
n.request.idleData,
|
|
4243
4292
|
n.request.activeInputs,
|
|
4244
4293
|
u
|
|
4245
|
-
), c = i.queryId,
|
|
4294
|
+
), c = i.queryId, g = i.validationFailure;
|
|
4246
4295
|
B(() => {
|
|
4247
4296
|
const l = n.request.error;
|
|
4248
4297
|
if (!l) {
|
|
@@ -4250,22 +4299,22 @@ function Yi(e, r = {}) {
|
|
|
4250
4299
|
return;
|
|
4251
4300
|
}
|
|
4252
4301
|
const b = `${c}:${l.message}`;
|
|
4253
|
-
o.current !== b && (o.current = b,
|
|
4302
|
+
o.current !== b && (o.current = b, g(l));
|
|
4254
4303
|
}, [
|
|
4255
4304
|
n.request.error,
|
|
4256
4305
|
n.request.queryKey,
|
|
4257
4306
|
c,
|
|
4258
|
-
|
|
4307
|
+
g
|
|
4259
4308
|
]);
|
|
4260
|
-
const m = n.request.error ? n.request.idleData : d.data, v = n.request.error ? "error" : d.status,
|
|
4309
|
+
const m = n.request.error ? n.request.idleData : d.data, v = n.request.error ? "error" : d.status, y = !n.request.error && d.status === "loading", h = n.request.error || d.error, C = i.trace;
|
|
4261
4310
|
switch (n.queryKind) {
|
|
4262
4311
|
case "metric": {
|
|
4263
4312
|
const l = m, b = J({
|
|
4264
4313
|
queryKind: n.queryKind,
|
|
4265
4314
|
status: v,
|
|
4266
|
-
isLoading:
|
|
4315
|
+
isLoading: y,
|
|
4267
4316
|
error: h,
|
|
4268
|
-
trace:
|
|
4317
|
+
trace: C,
|
|
4269
4318
|
payload: l,
|
|
4270
4319
|
activeInputs: n.request.activeInputs,
|
|
4271
4320
|
isStale: d.isStale
|
|
@@ -4287,12 +4336,12 @@ function Yi(e, r = {}) {
|
|
|
4287
4336
|
};
|
|
4288
4337
|
}
|
|
4289
4338
|
case "analysis": {
|
|
4290
|
-
const l =
|
|
4339
|
+
const l = Wr(m), b = J({
|
|
4291
4340
|
queryKind: n.queryKind,
|
|
4292
4341
|
status: v,
|
|
4293
|
-
isLoading:
|
|
4342
|
+
isLoading: y,
|
|
4294
4343
|
error: h,
|
|
4295
|
-
trace:
|
|
4344
|
+
trace: C,
|
|
4296
4345
|
payload: l,
|
|
4297
4346
|
activeInputs: n.request.activeInputs,
|
|
4298
4347
|
isStale: d.isStale
|
|
@@ -4308,9 +4357,9 @@ function Yi(e, r = {}) {
|
|
|
4308
4357
|
const l = m, b = J({
|
|
4309
4358
|
queryKind: n.queryKind,
|
|
4310
4359
|
status: v,
|
|
4311
|
-
isLoading:
|
|
4360
|
+
isLoading: y,
|
|
4312
4361
|
error: h,
|
|
4313
|
-
trace:
|
|
4362
|
+
trace: C,
|
|
4314
4363
|
payload: l,
|
|
4315
4364
|
activeInputs: n.request.activeInputs,
|
|
4316
4365
|
isStale: d.isStale
|
|
@@ -4330,9 +4379,9 @@ function Yi(e, r = {}) {
|
|
|
4330
4379
|
const l = m, b = J({
|
|
4331
4380
|
queryKind: n.queryKind,
|
|
4332
4381
|
status: v,
|
|
4333
|
-
isLoading:
|
|
4382
|
+
isLoading: y,
|
|
4334
4383
|
error: h,
|
|
4335
|
-
trace:
|
|
4384
|
+
trace: C,
|
|
4336
4385
|
payload: l,
|
|
4337
4386
|
activeInputs: n.request.activeInputs,
|
|
4338
4387
|
isStale: d.isStale
|
|
@@ -4348,9 +4397,9 @@ function Yi(e, r = {}) {
|
|
|
4348
4397
|
const l = m, b = J({
|
|
4349
4398
|
queryKind: n.queryKind,
|
|
4350
4399
|
status: v,
|
|
4351
|
-
isLoading:
|
|
4400
|
+
isLoading: y,
|
|
4352
4401
|
error: h,
|
|
4353
|
-
trace:
|
|
4402
|
+
trace: C,
|
|
4354
4403
|
payload: l,
|
|
4355
4404
|
activeInputs: n.request.activeInputs,
|
|
4356
4405
|
isStale: d.isStale
|
|
@@ -4371,9 +4420,9 @@ function Yi(e, r = {}) {
|
|
|
4371
4420
|
const l = m, b = J({
|
|
4372
4421
|
queryKind: n.queryKind,
|
|
4373
4422
|
status: v,
|
|
4374
|
-
isLoading:
|
|
4423
|
+
isLoading: y,
|
|
4375
4424
|
error: h,
|
|
4376
|
-
trace:
|
|
4425
|
+
trace: C,
|
|
4377
4426
|
payload: l,
|
|
4378
4427
|
activeInputs: n.request.activeInputs,
|
|
4379
4428
|
isStale: d.isStale
|
|
@@ -4388,12 +4437,12 @@ function Yi(e, r = {}) {
|
|
|
4388
4437
|
};
|
|
4389
4438
|
}
|
|
4390
4439
|
default:
|
|
4391
|
-
return
|
|
4440
|
+
return we(n);
|
|
4392
4441
|
}
|
|
4393
4442
|
}
|
|
4394
4443
|
function J(e) {
|
|
4395
4444
|
var o, u, f;
|
|
4396
|
-
const r =
|
|
4445
|
+
const r = Ki(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
|
|
4397
4446
|
return {
|
|
4398
4447
|
status: e.status,
|
|
4399
4448
|
executionStatus: r == null ? void 0 : r.status,
|
|
@@ -4402,8 +4451,8 @@ function J(e) {
|
|
|
4402
4451
|
coverage: n,
|
|
4403
4452
|
diagnosticFeedback: i,
|
|
4404
4453
|
isLoading: e.isLoading,
|
|
4405
|
-
isEmpty:
|
|
4406
|
-
isPartial:
|
|
4454
|
+
isEmpty: _i(e.queryKind, e.payload, e.status),
|
|
4455
|
+
isPartial: Wi(e.payload, r),
|
|
4407
4456
|
isFiltered: !!((f = e.activeInputs) != null && f.some(
|
|
4408
4457
|
(d) => d.kind === "filter" && d.isActive
|
|
4409
4458
|
)),
|
|
@@ -4413,16 +4462,16 @@ function J(e) {
|
|
|
4413
4462
|
trace: e.trace
|
|
4414
4463
|
};
|
|
4415
4464
|
}
|
|
4416
|
-
function
|
|
4465
|
+
function Ki(e) {
|
|
4417
4466
|
const r = e;
|
|
4418
4467
|
return r == null ? void 0 : r.executionResult;
|
|
4419
4468
|
}
|
|
4420
|
-
function
|
|
4469
|
+
function Wi(e, r) {
|
|
4421
4470
|
var n, i;
|
|
4422
4471
|
const t = !!(e != null && e.rowLimitExceeded);
|
|
4423
4472
|
return !!((r == null ? void 0 : r.status) === "partial" || ((n = r == null ? void 0 : r.diagnosticFeedback) == null ? void 0 : n.status) === "partial" || (r == null ? void 0 : r.status) !== "failed" && ((i = r == null ? void 0 : r.coverage) != null && i.missingObligations.length) || t);
|
|
4424
4473
|
}
|
|
4425
|
-
function
|
|
4474
|
+
function _i(e, r, t) {
|
|
4426
4475
|
var n, i, o, u, f;
|
|
4427
4476
|
if (t !== "success")
|
|
4428
4477
|
return !1;
|
|
@@ -4454,53 +4503,53 @@ function $i(e, r, t) {
|
|
|
4454
4503
|
return !((o = (i = d == null ? void 0 : d.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = d == null ? void 0 : d.grid) == null ? void 0 : u.cells) != null && f.length);
|
|
4455
4504
|
}
|
|
4456
4505
|
default:
|
|
4457
|
-
return
|
|
4506
|
+
return we(e);
|
|
4458
4507
|
}
|
|
4459
4508
|
}
|
|
4460
4509
|
function _(e) {
|
|
4461
4510
|
return Array.isArray(e) && e.length > 0;
|
|
4462
4511
|
}
|
|
4463
|
-
function
|
|
4464
|
-
const o =
|
|
4512
|
+
function Ni(e, r, t, n, i) {
|
|
4513
|
+
const o = Oi(), u = E(r), f = E(n), [d, c] = z({
|
|
4465
4514
|
status: "idle",
|
|
4466
4515
|
data: t,
|
|
4467
4516
|
error: null,
|
|
4468
4517
|
isStale: !1
|
|
4469
4518
|
});
|
|
4470
4519
|
return u.current = r, f.current = n, B(() => {
|
|
4471
|
-
let
|
|
4520
|
+
let g;
|
|
4472
4521
|
try {
|
|
4473
|
-
|
|
4522
|
+
g = u.current({
|
|
4474
4523
|
...o,
|
|
4475
4524
|
activeInputs: f.current
|
|
4476
4525
|
});
|
|
4477
|
-
} catch (
|
|
4478
|
-
i == null || i.failure(
|
|
4526
|
+
} catch (y) {
|
|
4527
|
+
i == null || i.failure(y, 0), c({
|
|
4479
4528
|
status: "error",
|
|
4480
4529
|
data: t,
|
|
4481
|
-
error:
|
|
4530
|
+
error: je(y),
|
|
4482
4531
|
isStale: !1
|
|
4483
4532
|
});
|
|
4484
4533
|
return;
|
|
4485
4534
|
}
|
|
4486
|
-
if (!
|
|
4535
|
+
if (!g) {
|
|
4487
4536
|
c({ status: "idle", data: t, error: null, isStale: !1 });
|
|
4488
4537
|
return;
|
|
4489
4538
|
}
|
|
4490
4539
|
let m = !1;
|
|
4491
|
-
const v =
|
|
4492
|
-
return i == null || i.start(), c((
|
|
4540
|
+
const v = Fr();
|
|
4541
|
+
return i == null || i.start(), c((y) => ({
|
|
4493
4542
|
status: "loading",
|
|
4494
|
-
data:
|
|
4543
|
+
data: y.data,
|
|
4495
4544
|
error: null,
|
|
4496
|
-
isStale:
|
|
4497
|
-
})),
|
|
4498
|
-
m ? i == null || i.ignored("superseded") : (i == null || i.success(
|
|
4499
|
-
}).catch((
|
|
4500
|
-
m ? i == null || i.ignored("superseded") : (i == null || i.failure(
|
|
4545
|
+
isStale: y.isStale || y.status === "success"
|
|
4546
|
+
})), g.then((y) => {
|
|
4547
|
+
m ? i == null || i.ignored("superseded") : (i == null || i.success(y, yr(v)), c({ status: "success", data: y, error: null, isStale: !1 }));
|
|
4548
|
+
}).catch((y) => {
|
|
4549
|
+
m ? i == null || i.ignored("superseded") : (i == null || i.failure(y, yr(v)), c({
|
|
4501
4550
|
status: "error",
|
|
4502
4551
|
data: t,
|
|
4503
|
-
error:
|
|
4552
|
+
error: je(y),
|
|
4504
4553
|
isStale: !1
|
|
4505
4554
|
}));
|
|
4506
4555
|
}), () => {
|
|
@@ -4508,32 +4557,32 @@ function Di(e, r, t, n, i) {
|
|
|
4508
4557
|
};
|
|
4509
4558
|
}, [t, e, o, i]), d;
|
|
4510
4559
|
}
|
|
4511
|
-
function
|
|
4560
|
+
function Fr() {
|
|
4512
4561
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
4513
4562
|
}
|
|
4514
|
-
function
|
|
4515
|
-
return Math.max(0, Math.round(
|
|
4563
|
+
function yr(e) {
|
|
4564
|
+
return Math.max(0, Math.round(Fr() - e));
|
|
4516
4565
|
}
|
|
4517
|
-
function
|
|
4566
|
+
function Mi(e) {
|
|
4518
4567
|
return Object.fromEntries(
|
|
4519
4568
|
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
4520
4569
|
);
|
|
4521
4570
|
}
|
|
4522
|
-
function
|
|
4571
|
+
function we(e) {
|
|
4523
4572
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
4524
4573
|
}
|
|
4525
|
-
function
|
|
4574
|
+
function Fi(e) {
|
|
4526
4575
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
4527
4576
|
}
|
|
4528
|
-
function
|
|
4577
|
+
function io({
|
|
4529
4578
|
token: e,
|
|
4530
4579
|
apiBaseUrl: r,
|
|
4531
4580
|
executor: t,
|
|
4532
4581
|
debug: n,
|
|
4533
4582
|
children: i
|
|
4534
4583
|
}) {
|
|
4535
|
-
var
|
|
4536
|
-
const o =
|
|
4584
|
+
var y;
|
|
4585
|
+
const o = $i(), u = ((y = o == null ? void 0 : o.authToken) == null ? void 0 : y.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = Fi(d), g = I(() => Ii(), []), m = t || g, v = I(
|
|
4537
4586
|
() => ({
|
|
4538
4587
|
token: u,
|
|
4539
4588
|
apiBaseUrl: f,
|
|
@@ -4542,25 +4591,26 @@ function Xi({
|
|
|
4542
4591
|
}),
|
|
4543
4592
|
[f, d, m, u]
|
|
4544
4593
|
);
|
|
4545
|
-
return /* @__PURE__ */ a(
|
|
4594
|
+
return /* @__PURE__ */ a(Bt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
|
|
4546
4595
|
i,
|
|
4547
|
-
c ? /* @__PURE__ */ a(
|
|
4596
|
+
c ? /* @__PURE__ */ a(_t, { ...c }) : null
|
|
4548
4597
|
] }) });
|
|
4549
4598
|
}
|
|
4550
4599
|
export {
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4600
|
+
io as SemaphorDataAppProvider,
|
|
4601
|
+
_t as SemaphorDevtools,
|
|
4602
|
+
Zi as SemaphorDevtoolsInspectButton,
|
|
4603
|
+
Xi as SemaphorViewBoundary,
|
|
4604
|
+
Ii as createSemaphorQueryExecutor,
|
|
4605
|
+
Gi as defineSemaphorDataApp,
|
|
4606
|
+
Ji as defineSemaphorInput,
|
|
4607
|
+
Di as isSemaphorInputValueValidForOptions,
|
|
4608
|
+
Yi as semaphor,
|
|
4609
|
+
ao as semaphorMetricAggregate,
|
|
4610
|
+
lo as semaphorMetricMeasureBindingKey,
|
|
4611
|
+
to as useClearInvalidSemaphorInputValue,
|
|
4612
|
+
Tr as useSemaphorDevtools,
|
|
4613
|
+
eo as useSemaphorInput,
|
|
4614
|
+
ro as useSemaphorInputs,
|
|
4615
|
+
no as useSemaphorQuery
|
|
4566
4616
|
};
|