react-semaphor 0.1.388 → 0.1.390
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.
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as Tr, toSemaphorInputBinding as
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { M as
|
|
5
|
-
import { X as
|
|
1
|
+
import { toSemaphorInputSnapshots as Tr, toSemaphorInputBinding as kr, toSemaphorActiveInputSnapshots as Y, toSemaphorMatrixIntent as Cr, toSemaphorSqlIntent as Dr, toSemaphorInputOptionsIntent as Lr, toSemaphorRecordsIntent as Or, toSemaphorAnalysisQueryOptions as Br, toSemaphorAnalysisIntent as Kr, toSemaphorMetricIntent as Nr, hasSemaphorInputValue as oe, normalizeSemaphorInputOptions as nr, toSemaphorInputSpec as ir } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as or, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as ye, useContext as Q, useState as V, useRef as D, useEffect as K, useMemo as b, Fragment as $r, useId as sr, useCallback as O, useReducer as Wr } from "react";
|
|
4
|
+
import { M as Fr, a as _r, S as zr, E as Hr } from "../chunks/search-0LmWwZzW.js";
|
|
5
|
+
import { X as Mr, j as jr } from "../chunks/x-IdR_js6f.js";
|
|
6
6
|
import { b as Pr } from "../chunks/validators-CHPH6ORs.js";
|
|
7
7
|
import "../chunks/analyze-result-contract-DuhlklhI.js";
|
|
8
|
-
function
|
|
8
|
+
function le(e, r, t = {}) {
|
|
9
9
|
return {
|
|
10
10
|
...t,
|
|
11
11
|
name: e,
|
|
12
12
|
role: r
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ri(e) {
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function ti(e) {
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const ni = {
|
|
22
22
|
source: {
|
|
23
23
|
semantic(e) {
|
|
24
24
|
return {
|
|
@@ -35,16 +35,16 @@ const ri = {
|
|
|
35
35
|
},
|
|
36
36
|
field: {
|
|
37
37
|
measure(e, r) {
|
|
38
|
-
return
|
|
38
|
+
return le(e, "measure", r);
|
|
39
39
|
},
|
|
40
40
|
dimension(e, r) {
|
|
41
|
-
return
|
|
41
|
+
return le(e, "dimension", r);
|
|
42
42
|
},
|
|
43
43
|
date(e, r) {
|
|
44
|
-
return
|
|
44
|
+
return le(e, "date", r);
|
|
45
45
|
},
|
|
46
46
|
id(e, r) {
|
|
47
|
-
return
|
|
47
|
+
return le(e, "id", r);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
filter(e) {
|
|
@@ -56,7 +56,7 @@ const ri = {
|
|
|
56
56
|
bindInput(e, r) {
|
|
57
57
|
return {
|
|
58
58
|
toAnalyticsInput() {
|
|
59
|
-
const [t] = Tr([e]), n =
|
|
59
|
+
const [t] = Tr([e]), n = kr({
|
|
60
60
|
...r,
|
|
61
61
|
inputId: r.inputId || t.inputId
|
|
62
62
|
});
|
|
@@ -128,44 +128,44 @@ const ri = {
|
|
|
128
128
|
queryKind: "matrix"
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, be = 10, Se = 100, Qr = 25, Vr = 500, ar = {
|
|
132
132
|
enabled: !1,
|
|
133
133
|
queries: [],
|
|
134
134
|
getQuery: () => {
|
|
135
135
|
},
|
|
136
136
|
getQueries: () => []
|
|
137
|
-
},
|
|
137
|
+
}, Le = ye(null), Oe = ye(null), Be = ye(
|
|
138
138
|
void 0
|
|
139
139
|
), P = [];
|
|
140
|
-
function
|
|
140
|
+
function Ur({
|
|
141
141
|
debug: e,
|
|
142
142
|
children: r
|
|
143
143
|
}) {
|
|
144
|
-
const t =
|
|
144
|
+
const t = b(() => Zt(e), [e]), [n, i] = Wr(
|
|
145
145
|
Mt,
|
|
146
146
|
t,
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
|
|
147
|
+
hr
|
|
148
|
+
), d = D(n), l = sr(), [c, u] = V({ open: !1 });
|
|
149
|
+
d.current = n, K(() => {
|
|
150
150
|
i({ type: "config", config: t });
|
|
151
|
-
}, [t]),
|
|
151
|
+
}, [t]), K(() => {
|
|
152
152
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
153
|
return;
|
|
154
|
-
const S =
|
|
155
|
-
return
|
|
154
|
+
const S = Gt(() => d.current);
|
|
155
|
+
return Gr({
|
|
156
156
|
ownerId: l,
|
|
157
157
|
bridge: S
|
|
158
158
|
}), () => {
|
|
159
|
-
|
|
159
|
+
Jr(l);
|
|
160
160
|
};
|
|
161
161
|
}, [l, n.enabled, n.exposeWindowBridge]);
|
|
162
|
-
const f =
|
|
162
|
+
const f = b(() => ({ state: n, dispatch: i }), [n]), m = O((S) => {
|
|
163
163
|
u({ open: !0, focus: S });
|
|
164
|
-
}, []), y =
|
|
164
|
+
}, []), y = O(() => {
|
|
165
165
|
u((S) => ({ ...S, open: !1 }));
|
|
166
|
-
}, []), h =
|
|
166
|
+
}, []), h = O((S) => {
|
|
167
167
|
u({ open: !0, focus: S });
|
|
168
|
-
}, []), g =
|
|
168
|
+
}, []), g = b(
|
|
169
169
|
() => ({
|
|
170
170
|
open: c.open,
|
|
171
171
|
focus: c.focus,
|
|
@@ -181,91 +181,95 @@ function Qr({
|
|
|
181
181
|
c.open
|
|
182
182
|
]
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */ o(
|
|
184
|
+
return /* @__PURE__ */ o(Le.Provider, { value: f, children: /* @__PURE__ */ o(Oe.Provider, { value: g, children: r }) });
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Gr(e) {
|
|
187
187
|
const r = P.findIndex(
|
|
188
188
|
(t) => t.ownerId === e.ownerId
|
|
189
189
|
);
|
|
190
|
-
r >= 0 && P.splice(r, 1), P.push(e),
|
|
190
|
+
r >= 0 && P.splice(r, 1), P.push(e), dr();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Jr(e) {
|
|
193
193
|
const r = P.findIndex(
|
|
194
194
|
(t) => t.ownerId === e
|
|
195
195
|
);
|
|
196
|
-
r >= 0 && P.splice(r, 1),
|
|
196
|
+
r >= 0 && P.splice(r, 1), dr();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function dr() {
|
|
199
199
|
if (typeof window > "u")
|
|
200
200
|
return;
|
|
201
201
|
const e = P[P.length - 1];
|
|
202
202
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ii({
|
|
205
205
|
id: e,
|
|
206
206
|
title: r,
|
|
207
207
|
children: t
|
|
208
208
|
}) {
|
|
209
|
-
const n =
|
|
209
|
+
const n = b(() => ({ id: e, title: r }), [e, r]);
|
|
210
210
|
return /* @__PURE__ */ o(Be.Provider, { value: n, children: t });
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Yr({
|
|
213
213
|
buttonPosition: e = "bottom-right",
|
|
214
214
|
initialIsOpen: r = !1,
|
|
215
215
|
panelPosition: t = "right",
|
|
216
216
|
className: n,
|
|
217
217
|
style: i
|
|
218
218
|
} = {}) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}, []),
|
|
223
|
-
r &&
|
|
224
|
-
}, [r,
|
|
225
|
-
if (!
|
|
219
|
+
const d = lr(), l = Q(Oe), [c, u] = V(""), [f, m] = V(!1), y = D(null), h = D(null), g = l == null ? void 0 : l.openDevtools, S = l == null ? void 0 : l.closeDevtools, k = (l == null ? void 0 : l.open) === !0;
|
|
220
|
+
K(() => {
|
|
221
|
+
yr();
|
|
222
|
+
}, []), K(() => {
|
|
223
|
+
r && d.enabled && (g == null || g());
|
|
224
|
+
}, [r, d.enabled, g]), K(() => {
|
|
225
|
+
if (!k || !S)
|
|
226
226
|
return;
|
|
227
|
-
const
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
|
|
227
|
+
const v = (w) => {
|
|
228
|
+
var I, E;
|
|
229
|
+
const A = w.target;
|
|
230
|
+
A instanceof Node && ((I = y.current) != null && I.contains(A) || (E = h.current) != null && E.contains(A) || S());
|
|
231
231
|
};
|
|
232
|
-
return document.addEventListener("pointerdown",
|
|
233
|
-
document.removeEventListener("pointerdown",
|
|
232
|
+
return document.addEventListener("pointerdown", v, !0), document.addEventListener("mousedown", v, !0), document.addEventListener("click", v, !0), () => {
|
|
233
|
+
document.removeEventListener("pointerdown", v, !0), document.removeEventListener("mousedown", v, !0), document.removeEventListener("click", v, !0);
|
|
234
234
|
};
|
|
235
|
-
}, [S,
|
|
236
|
-
const
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
), x =
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
() =>
|
|
247
|
-
[
|
|
235
|
+
}, [S, k]);
|
|
236
|
+
const a = b(
|
|
237
|
+
() => gt(d.queries),
|
|
238
|
+
[d.queries]
|
|
239
|
+
), x = mt(a), C = b(
|
|
240
|
+
() => yt(d.queries, c),
|
|
241
|
+
[d.queries, c]
|
|
242
|
+
), L = b(
|
|
243
|
+
() => ht(C),
|
|
244
|
+
[C]
|
|
245
|
+
), B = b(
|
|
246
|
+
() => ur(C, l == null ? void 0 : l.focus) || C[0],
|
|
247
|
+
[C, l == null ? void 0 : l.focus]
|
|
248
248
|
);
|
|
249
|
-
return !
|
|
249
|
+
return !d.enabled || !l ? null : /* @__PURE__ */ p(or, { children: [
|
|
250
250
|
/* @__PURE__ */ p(
|
|
251
251
|
"button",
|
|
252
252
|
{
|
|
253
253
|
ref: y,
|
|
254
254
|
type: "button",
|
|
255
255
|
"aria-label": "Open Semaphor Inspector",
|
|
256
|
-
title:
|
|
256
|
+
title: x,
|
|
257
257
|
className: n ? `${$} ${n}` : $,
|
|
258
258
|
style: {
|
|
259
259
|
...s.launcher,
|
|
260
|
-
...
|
|
261
|
-
|
|
260
|
+
...Nt(e),
|
|
261
|
+
...$t(a.severity),
|
|
262
262
|
...i
|
|
263
263
|
},
|
|
264
264
|
onClick: () => l.openDevtools(),
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */ o(
|
|
267
|
-
/* @__PURE__ */ o("span", { style: s.launcherText, children:
|
|
268
|
-
|
|
266
|
+
/* @__PURE__ */ o(Zr, {}),
|
|
267
|
+
/* @__PURE__ */ o("span", { style: s.launcherText, children: a.total }),
|
|
268
|
+
a.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
|
|
269
|
+
a.issueCount,
|
|
270
|
+
" issue",
|
|
271
|
+
a.issueCount === 1 ? "" : "s"
|
|
272
|
+
] }) : null
|
|
269
273
|
]
|
|
270
274
|
}
|
|
271
275
|
),
|
|
@@ -279,7 +283,7 @@ function Gr({
|
|
|
279
283
|
className: $,
|
|
280
284
|
style: {
|
|
281
285
|
...s.panel,
|
|
282
|
-
|
|
286
|
+
...Wt(t),
|
|
283
287
|
...f ? s.panelFullscreen : null
|
|
284
288
|
},
|
|
285
289
|
children: [
|
|
@@ -287,12 +291,12 @@ function Gr({
|
|
|
287
291
|
/* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
|
|
288
292
|
/* @__PURE__ */ o("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
|
|
289
293
|
/* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
|
|
290
|
-
|
|
294
|
+
a.total,
|
|
291
295
|
" queries · ",
|
|
292
|
-
|
|
296
|
+
a.loading,
|
|
293
297
|
" loading ·",
|
|
294
298
|
" ",
|
|
295
|
-
|
|
299
|
+
a.failed,
|
|
296
300
|
" failed"
|
|
297
301
|
] })
|
|
298
302
|
] }),
|
|
@@ -304,8 +308,8 @@ function Gr({
|
|
|
304
308
|
"aria-label": f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
305
309
|
title: f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
306
310
|
style: s.iconButton,
|
|
307
|
-
onClick: () => m((
|
|
308
|
-
children: f ? /* @__PURE__ */ o(
|
|
311
|
+
onClick: () => m((v) => !v),
|
|
312
|
+
children: f ? /* @__PURE__ */ o(Fr, { size: 15 }) : /* @__PURE__ */ o(_r, { size: 15 })
|
|
309
313
|
}
|
|
310
314
|
),
|
|
311
315
|
/* @__PURE__ */ o(
|
|
@@ -315,19 +319,19 @@ function Gr({
|
|
|
315
319
|
"aria-label": "Close Semaphor Inspector",
|
|
316
320
|
style: s.iconButton,
|
|
317
321
|
onClick: l.closeDevtools,
|
|
318
|
-
children: /* @__PURE__ */ o(
|
|
322
|
+
children: /* @__PURE__ */ o(Mr, { size: 15 })
|
|
319
323
|
}
|
|
320
324
|
)
|
|
321
325
|
] })
|
|
322
326
|
] }),
|
|
323
327
|
/* @__PURE__ */ p("label", { style: s.searchBox, children: [
|
|
324
|
-
/* @__PURE__ */ o(
|
|
328
|
+
/* @__PURE__ */ o(zr, { size: 14 }),
|
|
325
329
|
/* @__PURE__ */ o(
|
|
326
330
|
"input",
|
|
327
331
|
{
|
|
328
332
|
"aria-label": "Search Semaphor traces",
|
|
329
333
|
value: c,
|
|
330
|
-
onChange: (
|
|
334
|
+
onChange: (v) => u(v.currentTarget.value),
|
|
331
335
|
placeholder: "Search traces",
|
|
332
336
|
style: s.searchInput
|
|
333
337
|
}
|
|
@@ -338,7 +342,7 @@ function Gr({
|
|
|
338
342
|
{
|
|
339
343
|
style: {
|
|
340
344
|
...s.panelBody,
|
|
341
|
-
...
|
|
345
|
+
...Ft(t)
|
|
342
346
|
},
|
|
343
347
|
children: [
|
|
344
348
|
/* @__PURE__ */ o(
|
|
@@ -346,70 +350,67 @@ function Gr({
|
|
|
346
350
|
{
|
|
347
351
|
style: {
|
|
348
352
|
...s.queryList,
|
|
349
|
-
...
|
|
353
|
+
..._t()
|
|
350
354
|
},
|
|
351
355
|
"aria-label": "Registered queries",
|
|
352
|
-
children:
|
|
356
|
+
children: C.length ? L.map((v) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
|
|
353
357
|
/* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
|
|
354
|
-
/* @__PURE__ */ o("span", { children:
|
|
355
|
-
/* @__PURE__ */ o("span", { style: s.queryGroupCount, children:
|
|
358
|
+
/* @__PURE__ */ o("span", { children: v.title }),
|
|
359
|
+
/* @__PURE__ */ o("span", { style: s.queryGroupCount, children: v.traces.length })
|
|
356
360
|
] }),
|
|
357
|
-
|
|
358
|
-
var
|
|
359
|
-
const
|
|
361
|
+
v.traces.length ? v.traces.map((w) => {
|
|
362
|
+
var R;
|
|
363
|
+
const A = bt(w, B), I = Ke(w), E = pr(w), z = gr(w), Z = wt(w, I, z), ee = Z.join(" · "), ae = cr(E);
|
|
360
364
|
return /* @__PURE__ */ p(
|
|
361
365
|
"button",
|
|
362
366
|
{
|
|
363
367
|
type: "button",
|
|
364
|
-
title: `${
|
|
368
|
+
title: `${I} · ${E} · ${ee}`,
|
|
365
369
|
style: {
|
|
366
370
|
...s.queryListItem,
|
|
367
|
-
...
|
|
371
|
+
...A ? s.queryListItemSelected : null
|
|
368
372
|
},
|
|
369
373
|
onClick: () => l.focusTrace({
|
|
370
|
-
traceId:
|
|
371
|
-
queryId:
|
|
372
|
-
viewId:
|
|
374
|
+
traceId: w.traceId,
|
|
375
|
+
queryId: w.queryId,
|
|
376
|
+
viewId: w.viewId
|
|
373
377
|
}),
|
|
374
378
|
children: [
|
|
375
379
|
/* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
|
|
376
|
-
/* @__PURE__ */ o(
|
|
377
|
-
/* @__PURE__ */ o("span", { style: s.queryListTitle, title:
|
|
380
|
+
/* @__PURE__ */ o(rt, { status: (R = w.latestAttempt) == null ? void 0 : R.status }),
|
|
381
|
+
/* @__PURE__ */ o("span", { style: s.queryListTitle, title: I, children: I }),
|
|
378
382
|
/* @__PURE__ */ o(
|
|
379
383
|
"span",
|
|
380
384
|
{
|
|
381
385
|
style: {
|
|
382
386
|
...s.queryListKindChip,
|
|
383
|
-
...
|
|
387
|
+
...fr(ae)
|
|
384
388
|
},
|
|
385
|
-
children:
|
|
389
|
+
children: E
|
|
386
390
|
}
|
|
387
391
|
)
|
|
388
392
|
] }),
|
|
389
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ o(
|
|
390
394
|
"span",
|
|
391
395
|
{
|
|
392
396
|
className: `${$}-source`,
|
|
393
397
|
style: s.queryListSource,
|
|
394
|
-
title:
|
|
395
|
-
children: [
|
|
396
|
-
/* @__PURE__ */ o("span", {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
/* @__PURE__ */ o("span", { style: s.queryListPrefixId, children: Q.queryId })
|
|
400
|
-
] }) : null
|
|
401
|
-
]
|
|
398
|
+
title: ee,
|
|
399
|
+
children: Z.map((H, re) => /* @__PURE__ */ p($r, { children: [
|
|
400
|
+
re > 0 ? /* @__PURE__ */ o("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
|
|
401
|
+
/* @__PURE__ */ o("span", { children: H })
|
|
402
|
+
] }, `${H}:${re}`))
|
|
402
403
|
}
|
|
403
404
|
)
|
|
404
405
|
]
|
|
405
406
|
},
|
|
406
|
-
Ce(
|
|
407
|
+
Ce(w)
|
|
407
408
|
);
|
|
408
409
|
}) : /* @__PURE__ */ o("div", { style: s.queryGroupEmpty, children: "No input traces" })
|
|
409
|
-
] },
|
|
410
|
+
] }, v.title)) : /* @__PURE__ */ o("div", { style: s.emptyState, children: "No matching traces" })
|
|
410
411
|
}
|
|
411
412
|
),
|
|
412
|
-
/* @__PURE__ */ o(
|
|
413
|
+
/* @__PURE__ */ o(et, { trace: B })
|
|
413
414
|
]
|
|
414
415
|
}
|
|
415
416
|
)
|
|
@@ -418,7 +419,7 @@ function Gr({
|
|
|
418
419
|
) : null
|
|
419
420
|
] });
|
|
420
421
|
}
|
|
421
|
-
function
|
|
422
|
+
function oi({
|
|
422
423
|
queryId: e,
|
|
423
424
|
viewId: r,
|
|
424
425
|
label: t,
|
|
@@ -426,22 +427,22 @@ function ni({
|
|
|
426
427
|
style: i
|
|
427
428
|
} = {}) {
|
|
428
429
|
var y, h;
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
const d = lr(), l = Q(Oe), c = Q(Be);
|
|
431
|
+
K(() => {
|
|
432
|
+
yr();
|
|
432
433
|
}, []);
|
|
433
|
-
const u = r || (c == null ? void 0 : c.id), f =
|
|
434
|
-
() =>
|
|
434
|
+
const u = r || (c == null ? void 0 : c.id), f = b(
|
|
435
|
+
() => vt(d.queries, {
|
|
435
436
|
queryId: e,
|
|
436
437
|
viewId: u
|
|
437
438
|
}),
|
|
438
439
|
[
|
|
439
|
-
|
|
440
|
+
d.queries,
|
|
440
441
|
e,
|
|
441
442
|
u
|
|
442
443
|
]
|
|
443
444
|
);
|
|
444
|
-
if (!
|
|
445
|
+
if (!d.enabled || !l || !f)
|
|
445
446
|
return null;
|
|
446
447
|
const m = t || `Inspect ${xt(f, !!e)}`;
|
|
447
448
|
return /* @__PURE__ */ p(
|
|
@@ -453,7 +454,7 @@ function ni({
|
|
|
453
454
|
className: n ? `${$} ${n}` : $,
|
|
454
455
|
style: {
|
|
455
456
|
...s.inspectButton,
|
|
456
|
-
...
|
|
457
|
+
...zt((y = f.latestAttempt) == null ? void 0 : y.status),
|
|
457
458
|
...i
|
|
458
459
|
},
|
|
459
460
|
onClick: () => l.openDevtools({
|
|
@@ -462,189 +463,184 @@ function ni({
|
|
|
462
463
|
viewId: f.viewId
|
|
463
464
|
}),
|
|
464
465
|
children: [
|
|
465
|
-
/* @__PURE__ */ o(
|
|
466
|
+
/* @__PURE__ */ o(Hr, { size: 13 }),
|
|
466
467
|
/* @__PURE__ */ o("span", { style: s.inspectButtonText, children: ((h = f.latestAttempt) == null ? void 0 : h.status) || "idle" })
|
|
467
468
|
]
|
|
468
469
|
}
|
|
469
470
|
);
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
-
const e =
|
|
473
|
-
return !e || !e.state.enabled ?
|
|
472
|
+
function lr() {
|
|
473
|
+
const e = Q(Le);
|
|
474
|
+
return !e || !e.state.enabled ? ar : ge(e.state);
|
|
474
475
|
}
|
|
475
|
-
function
|
|
476
|
+
function Xr({
|
|
476
477
|
spec: e,
|
|
477
478
|
queryKind: r,
|
|
478
479
|
queryKey: t,
|
|
479
480
|
intent: n,
|
|
480
481
|
activeInputs: i,
|
|
481
|
-
debug:
|
|
482
|
+
debug: d
|
|
482
483
|
}) {
|
|
483
|
-
const l =
|
|
484
|
+
const l = Q(Le), c = Q(Be), u = !!(l != null && l.state.enabled), f = l == null ? void 0 : l.dispatch, m = rn(e), y = e.label, h = b(
|
|
484
485
|
() => JSON.stringify(e),
|
|
485
486
|
[e]
|
|
486
|
-
), g =
|
|
487
|
+
), g = b(
|
|
487
488
|
() => JSON.stringify(i || []),
|
|
488
489
|
[i]
|
|
489
|
-
), S =
|
|
490
|
+
), S = b(
|
|
490
491
|
() => JSON.stringify(n || null),
|
|
491
492
|
[n]
|
|
492
|
-
),
|
|
493
|
-
|
|
494
|
-
const
|
|
493
|
+
), k = D(e), a = D(h), x = D(n), C = D(S), L = D(i), B = D(g), v = en(d), w = JSON.stringify(v || []), A = D(v), I = D(w);
|
|
494
|
+
a.current !== h && (a.current = h, k.current = e), C.current !== S && (C.current = S, x.current = n), B.current !== g && (B.current = g, L.current = i), I.current !== w && (I.current = w, A.current = v);
|
|
495
|
+
const E = k.current, z = x.current, Z = L.current, ee = A.current, ae = sr(), R = b(
|
|
495
496
|
() => m || `query_${xr(t)}`,
|
|
496
497
|
[t, m]
|
|
497
|
-
),
|
|
498
|
-
() => Ge(a),
|
|
499
|
-
// Keep inline debug={{ sourceHint: ... }} objects from re-registering every render.
|
|
500
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
501
|
-
[oe]
|
|
502
|
-
), z = v(
|
|
498
|
+
), H = (d == null ? void 0 : d.viewId) || (c == null ? void 0 : c.id), re = (d == null ? void 0 : d.viewTitle) || (d == null ? void 0 : d.title) || (c == null ? void 0 : c.title), Fe = d == null ? void 0 : d.visualType, _e = d == null ? void 0 : d.sectionTitle, M = b(
|
|
503
499
|
() => [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
500
|
+
H || "unscoped-view",
|
|
501
|
+
R,
|
|
502
|
+
ae
|
|
507
503
|
].join("::"),
|
|
508
|
-
[
|
|
509
|
-
),
|
|
504
|
+
[R, ae, H]
|
|
505
|
+
), ze = b(
|
|
510
506
|
() => ({
|
|
511
|
-
traceKey:
|
|
512
|
-
spec:
|
|
513
|
-
queryId:
|
|
507
|
+
traceKey: M,
|
|
508
|
+
spec: E,
|
|
509
|
+
queryId: R,
|
|
514
510
|
queryLabel: y,
|
|
515
511
|
queryKind: r,
|
|
516
|
-
builder:
|
|
517
|
-
viewId:
|
|
518
|
-
viewTitle:
|
|
519
|
-
visualType:
|
|
520
|
-
sectionTitle:
|
|
521
|
-
sourceHints:
|
|
522
|
-
intent:
|
|
523
|
-
activeInputs:
|
|
512
|
+
builder: tn(r),
|
|
513
|
+
viewId: H,
|
|
514
|
+
viewTitle: re,
|
|
515
|
+
visualType: Fe,
|
|
516
|
+
sectionTitle: _e,
|
|
517
|
+
sourceHints: ee,
|
|
518
|
+
intent: z,
|
|
519
|
+
activeInputs: Z,
|
|
524
520
|
clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
525
521
|
}),
|
|
526
522
|
[
|
|
527
|
-
|
|
523
|
+
R,
|
|
528
524
|
r,
|
|
529
525
|
m,
|
|
530
526
|
y,
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
k,
|
|
534
|
-
Fe,
|
|
535
|
-
ie,
|
|
527
|
+
E,
|
|
528
|
+
Z,
|
|
536
529
|
z,
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
530
|
+
ee,
|
|
531
|
+
_e,
|
|
532
|
+
M,
|
|
533
|
+
H,
|
|
534
|
+
re,
|
|
535
|
+
Fe
|
|
540
536
|
]
|
|
541
537
|
);
|
|
542
|
-
|
|
538
|
+
K(() => {
|
|
543
539
|
if (!(!u || !f))
|
|
544
|
-
return f({ type: "register", descriptor:
|
|
545
|
-
f({ type: "unregister", traceKey:
|
|
540
|
+
return f({ type: "register", descriptor: ze }), () => {
|
|
541
|
+
f({ type: "unregister", traceKey: M });
|
|
546
542
|
};
|
|
547
|
-
}, [
|
|
548
|
-
const W =
|
|
549
|
-
(T,
|
|
550
|
-
!u || !f || f({ type: "event", traceKey:
|
|
543
|
+
}, [ze, f, u, M]);
|
|
544
|
+
const W = O(
|
|
545
|
+
(T, U) => {
|
|
546
|
+
!u || !f || f({ type: "event", traceKey: M, event: T, latestAttempt: U });
|
|
551
547
|
},
|
|
552
|
-
[f, u,
|
|
553
|
-
),
|
|
548
|
+
[f, u, M]
|
|
549
|
+
), He = O(() => {
|
|
554
550
|
W(
|
|
555
551
|
{
|
|
556
552
|
type: "query_started",
|
|
557
|
-
queryId:
|
|
558
|
-
at:
|
|
553
|
+
queryId: R,
|
|
554
|
+
at: fe()
|
|
559
555
|
},
|
|
560
556
|
{ status: "loading" }
|
|
561
557
|
);
|
|
562
|
-
}, [W,
|
|
563
|
-
(T,
|
|
564
|
-
const
|
|
558
|
+
}, [W, R]), Me = O(
|
|
559
|
+
(T, U) => {
|
|
560
|
+
const te = er(T), ne = cn(T), Er = fn(T);
|
|
565
561
|
W(
|
|
566
562
|
{
|
|
567
563
|
type: "query_succeeded",
|
|
568
|
-
queryId:
|
|
569
|
-
requestId:
|
|
570
|
-
at:
|
|
571
|
-
rowCount:
|
|
572
|
-
durationMs:
|
|
564
|
+
queryId: R,
|
|
565
|
+
requestId: te,
|
|
566
|
+
at: fe(),
|
|
567
|
+
rowCount: ne,
|
|
568
|
+
durationMs: U
|
|
573
569
|
},
|
|
574
570
|
{
|
|
575
|
-
requestId:
|
|
571
|
+
requestId: te,
|
|
576
572
|
status: "success",
|
|
577
|
-
durationMs:
|
|
578
|
-
rowCount:
|
|
579
|
-
columnCount:
|
|
573
|
+
durationMs: U,
|
|
574
|
+
rowCount: ne,
|
|
575
|
+
columnCount: Er,
|
|
580
576
|
executionResult: Ze(T)
|
|
581
577
|
}
|
|
582
578
|
);
|
|
583
579
|
},
|
|
584
|
-
[W,
|
|
585
|
-
),
|
|
586
|
-
(T,
|
|
587
|
-
const
|
|
580
|
+
[W, R]
|
|
581
|
+
), de = O(
|
|
582
|
+
(T, U) => {
|
|
583
|
+
const te = er(T), ne = T instanceof Error ? T.message : String(T);
|
|
588
584
|
W(
|
|
589
585
|
{
|
|
590
586
|
type: "query_failed",
|
|
591
|
-
queryId:
|
|
592
|
-
requestId:
|
|
593
|
-
at:
|
|
594
|
-
errorMessage:
|
|
587
|
+
queryId: R,
|
|
588
|
+
requestId: te,
|
|
589
|
+
at: fe(),
|
|
590
|
+
errorMessage: ne
|
|
595
591
|
},
|
|
596
592
|
{
|
|
597
|
-
requestId:
|
|
593
|
+
requestId: te,
|
|
598
594
|
status: "error",
|
|
599
|
-
durationMs:
|
|
600
|
-
errorMessage:
|
|
595
|
+
durationMs: U,
|
|
596
|
+
errorMessage: ne,
|
|
601
597
|
executionResult: Ze(T)
|
|
602
598
|
}
|
|
603
599
|
);
|
|
604
600
|
},
|
|
605
|
-
[W,
|
|
606
|
-
),
|
|
601
|
+
[W, R]
|
|
602
|
+
), je = O(
|
|
607
603
|
(T) => {
|
|
608
604
|
W(
|
|
609
605
|
{
|
|
610
606
|
type: "query_ignored_stale",
|
|
611
|
-
queryId:
|
|
612
|
-
at:
|
|
607
|
+
queryId: R,
|
|
608
|
+
at: fe(),
|
|
613
609
|
reason: T
|
|
614
610
|
}
|
|
615
611
|
);
|
|
616
612
|
},
|
|
617
|
-
[W,
|
|
618
|
-
),
|
|
613
|
+
[W, R]
|
|
614
|
+
), Pe = O(
|
|
619
615
|
(T) => {
|
|
620
|
-
|
|
616
|
+
de(T, 0);
|
|
621
617
|
},
|
|
622
|
-
[
|
|
623
|
-
),
|
|
624
|
-
return
|
|
618
|
+
[de]
|
|
619
|
+
), ve = u ? l == null ? void 0 : l.state.entries[M] : void 0;
|
|
620
|
+
return b(
|
|
625
621
|
() => ({
|
|
626
622
|
enabled: u,
|
|
627
|
-
queryId:
|
|
628
|
-
trace:
|
|
629
|
-
start:
|
|
623
|
+
queryId: R,
|
|
624
|
+
trace: ve ? pe(ve) : void 0,
|
|
625
|
+
start: He,
|
|
630
626
|
success: Me,
|
|
631
|
-
failure:
|
|
632
|
-
ignored:
|
|
633
|
-
validationFailure:
|
|
627
|
+
failure: de,
|
|
628
|
+
ignored: je,
|
|
629
|
+
validationFailure: Pe
|
|
634
630
|
}),
|
|
635
631
|
[
|
|
636
632
|
u,
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
633
|
+
de,
|
|
634
|
+
je,
|
|
635
|
+
R,
|
|
636
|
+
He,
|
|
641
637
|
Me,
|
|
642
|
-
|
|
643
|
-
|
|
638
|
+
ve,
|
|
639
|
+
Pe
|
|
644
640
|
]
|
|
645
641
|
);
|
|
646
642
|
}
|
|
647
|
-
function
|
|
643
|
+
function Zr() {
|
|
648
644
|
return /* @__PURE__ */ o("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
649
645
|
"svg",
|
|
650
646
|
{
|
|
@@ -662,22 +658,22 @@ function Yr() {
|
|
|
662
658
|
}
|
|
663
659
|
) });
|
|
664
660
|
}
|
|
665
|
-
function
|
|
661
|
+
function et({
|
|
666
662
|
trace: e
|
|
667
663
|
}) {
|
|
668
|
-
var
|
|
664
|
+
var L, B, v, w, A;
|
|
669
665
|
if (!e)
|
|
670
666
|
return /* @__PURE__ */ o("div", { style: s.detailsPane, children: /* @__PURE__ */ o("div", { style: s.emptyState, children: "No traces registered yet" }) });
|
|
671
667
|
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = xe(
|
|
672
|
-
(
|
|
673
|
-
), i = xe((
|
|
674
|
-
(
|
|
675
|
-
), l = t == null ? void 0 : t.compiledQuery, c =
|
|
668
|
+
(L = t == null ? void 0 : t.validation) == null ? void 0 : L.warnings
|
|
669
|
+
), i = xe((B = t == null ? void 0 : t.validation) == null ? void 0 : B.errors), d = xe(
|
|
670
|
+
(v = t == null ? void 0 : t.coverage) == null ? void 0 : v.missingObligations
|
|
671
|
+
), l = t == null ? void 0 : t.compiledQuery, c = Kt(t), u = ((w = e.server) == null ? void 0 : w.compiledSql) || c.compiledSql, f = r != null && r.errorMessage ? [r.errorMessage] : [], m = [
|
|
676
672
|
...e.clientWarnings,
|
|
677
673
|
...n,
|
|
678
674
|
...i,
|
|
679
|
-
...
|
|
680
|
-
], y = e.inputsApplied.length > 0, h = !!(l || u), g =
|
|
675
|
+
...d
|
|
676
|
+
], y = e.inputsApplied.length > 0, h = !!(l || u), g = Rt(e), S = kt(r == null ? void 0 : r.rowCount), k = Ct(r == null ? void 0 : r.durationMs), a = e.sourceRefs.length, x = pr(e), C = cr(x);
|
|
681
677
|
return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
|
|
682
678
|
/* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
|
|
683
679
|
/* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
|
|
@@ -687,17 +683,17 @@ function Xr({
|
|
|
687
683
|
"aria-hidden": !0,
|
|
688
684
|
style: {
|
|
689
685
|
...s.detailsHeaderStatusDot,
|
|
690
|
-
...
|
|
686
|
+
...mr(r == null ? void 0 : r.status)
|
|
691
687
|
}
|
|
692
688
|
}
|
|
693
689
|
),
|
|
694
|
-
/* @__PURE__ */ o("span", { style: s.detailsTitle, children:
|
|
690
|
+
/* @__PURE__ */ o("span", { style: s.detailsTitle, children: Ke(e) }),
|
|
695
691
|
/* @__PURE__ */ o(
|
|
696
692
|
"span",
|
|
697
693
|
{
|
|
698
694
|
style: {
|
|
699
695
|
...s.detailsKindChip,
|
|
700
|
-
...
|
|
696
|
+
...fr(C)
|
|
701
697
|
},
|
|
702
698
|
children: x
|
|
703
699
|
}
|
|
@@ -711,41 +707,41 @@ function Xr({
|
|
|
711
707
|
" rows"
|
|
712
708
|
] }),
|
|
713
709
|
/* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
|
|
714
|
-
/* @__PURE__ */ o("span", { style: s.metaStripItem, children:
|
|
715
|
-
|
|
710
|
+
/* @__PURE__ */ o("span", { style: s.metaStripItem, children: k }),
|
|
711
|
+
a > 0 ? /* @__PURE__ */ p(or, { children: [
|
|
716
712
|
/* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
|
|
717
|
-
/* @__PURE__ */ o("span", { style: s.metaStripItem, children:
|
|
713
|
+
/* @__PURE__ */ o("span", { style: s.metaStripItem, children: a === 1 ? "1 source" : `${a} sources` })
|
|
718
714
|
] }) : null
|
|
719
715
|
] })
|
|
720
716
|
] }),
|
|
721
|
-
f.length ? /* @__PURE__ */ o(
|
|
722
|
-
m.length ? /* @__PURE__ */ o(
|
|
723
|
-
/* @__PURE__ */ o(
|
|
724
|
-
/* @__PURE__ */ o(
|
|
725
|
-
(A = e.sourceHints) != null && A.length ? /* @__PURE__ */ o(
|
|
726
|
-
y ? /* @__PURE__ */ o(
|
|
727
|
-
h ? /* @__PURE__ */ o(
|
|
728
|
-
|
|
717
|
+
f.length ? /* @__PURE__ */ o(Qe, { tone: "error", title: "Error", items: f }) : null,
|
|
718
|
+
m.length ? /* @__PURE__ */ o(Qe, { tone: "warning", title: "Warnings", items: m }) : null,
|
|
719
|
+
/* @__PURE__ */ o(tt, { trace: e }),
|
|
720
|
+
/* @__PURE__ */ o(ot, { trace: e }),
|
|
721
|
+
(A = e.sourceHints) != null && A.length ? /* @__PURE__ */ o(st, { hints: e.sourceHints }) : null,
|
|
722
|
+
y ? /* @__PURE__ */ o(ut, { inputs: e.inputsApplied }) : null,
|
|
723
|
+
h ? /* @__PURE__ */ o(ie, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ o(
|
|
724
|
+
ct,
|
|
729
725
|
{
|
|
730
726
|
compiledQuery: l,
|
|
731
727
|
compiledSql: u
|
|
732
728
|
}
|
|
733
729
|
) }) : null,
|
|
734
|
-
/* @__PURE__ */ o(
|
|
730
|
+
/* @__PURE__ */ o(ie, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ o("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((I, E) => /* @__PURE__ */ p(
|
|
735
731
|
"div",
|
|
736
732
|
{
|
|
737
733
|
style: s.eventRow,
|
|
738
734
|
children: [
|
|
739
|
-
/* @__PURE__ */ o("span", { style: s.eventType, children: Lt(
|
|
740
|
-
/* @__PURE__ */ o("span", { style: s.eventMeta, children:
|
|
735
|
+
/* @__PURE__ */ o("span", { style: s.eventType, children: Lt(I) }),
|
|
736
|
+
/* @__PURE__ */ o("span", { style: s.eventMeta, children: Ot(I) })
|
|
741
737
|
]
|
|
742
738
|
},
|
|
743
|
-
`${
|
|
739
|
+
`${I.type}:${I.at}:${E}`
|
|
744
740
|
)) }) : /* @__PURE__ */ o("div", { style: s.mutedText, children: "No attempts recorded" }) }),
|
|
745
|
-
/* @__PURE__ */ o(
|
|
741
|
+
/* @__PURE__ */ o(ie, { title: "Raw Trace", children: /* @__PURE__ */ o("pre", { style: s.codeBlock, children: Dt(e) }) })
|
|
746
742
|
] });
|
|
747
743
|
}
|
|
748
|
-
function
|
|
744
|
+
function Qe({
|
|
749
745
|
tone: e,
|
|
750
746
|
title: r,
|
|
751
747
|
items: t
|
|
@@ -753,10 +749,10 @@ function je({
|
|
|
753
749
|
const n = e === "error" ? s.alertCardError : s.alertCardWarning;
|
|
754
750
|
return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
|
|
755
751
|
/* @__PURE__ */ o("div", { style: s.alertCardTitle, children: r }),
|
|
756
|
-
t.length > 1 ? /* @__PURE__ */ o("ul", { style: s.alertCardList, children: t.map((i,
|
|
752
|
+
t.length > 1 ? /* @__PURE__ */ o("ul", { style: s.alertCardList, children: t.map((i, d) => /* @__PURE__ */ o("li", { children: i }, `${e}-${d}`)) }) : /* @__PURE__ */ o("div", { children: t[0] })
|
|
757
753
|
] });
|
|
758
754
|
}
|
|
759
|
-
function
|
|
755
|
+
function rt({
|
|
760
756
|
status: e
|
|
761
757
|
}) {
|
|
762
758
|
return /* @__PURE__ */ o(
|
|
@@ -765,23 +761,23 @@ function Zr({
|
|
|
765
761
|
"aria-hidden": !0,
|
|
766
762
|
style: {
|
|
767
763
|
...s.statusDot,
|
|
768
|
-
...
|
|
764
|
+
...mr(e)
|
|
769
765
|
}
|
|
770
766
|
}
|
|
771
767
|
);
|
|
772
768
|
}
|
|
773
|
-
function
|
|
769
|
+
function ie({
|
|
774
770
|
title: e,
|
|
775
771
|
children: r,
|
|
776
772
|
defaultOpen: t = !1
|
|
777
773
|
}) {
|
|
778
|
-
const [n, i] =
|
|
774
|
+
const [n, i] = V(t);
|
|
779
775
|
return /* @__PURE__ */ p(
|
|
780
776
|
"details",
|
|
781
777
|
{
|
|
782
778
|
style: s.disclosure,
|
|
783
779
|
open: n,
|
|
784
|
-
onToggle: (
|
|
780
|
+
onToggle: (d) => i(d.currentTarget.open),
|
|
785
781
|
children: [
|
|
786
782
|
/* @__PURE__ */ o("summary", { style: s.disclosureSummary, children: e }),
|
|
787
783
|
/* @__PURE__ */ o("div", { style: s.disclosureBody, children: r })
|
|
@@ -789,29 +785,29 @@ function ee({
|
|
|
789
785
|
}
|
|
790
786
|
);
|
|
791
787
|
}
|
|
792
|
-
function
|
|
788
|
+
function tt({
|
|
793
789
|
trace: e
|
|
794
790
|
}) {
|
|
795
791
|
var i;
|
|
796
|
-
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n =
|
|
792
|
+
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = qt(r);
|
|
797
793
|
return /* @__PURE__ */ p("div", { style: s.recipe, children: [
|
|
798
|
-
/* @__PURE__ */ o(
|
|
799
|
-
/* @__PURE__ */ o(
|
|
800
|
-
/* @__PURE__ */ o(
|
|
794
|
+
/* @__PURE__ */ o(nt, { sources: e.sourceRefs }),
|
|
795
|
+
/* @__PURE__ */ o(j, { title: "Measures", fields: n.measures }),
|
|
796
|
+
/* @__PURE__ */ o(j, { title: "Time fields", fields: n.timeFields }),
|
|
801
797
|
/* @__PURE__ */ o(
|
|
802
|
-
|
|
798
|
+
j,
|
|
803
799
|
{
|
|
804
800
|
title: "Dimensions",
|
|
805
801
|
fields: n.dimensions,
|
|
806
802
|
emptyText: "No dimensions selected"
|
|
807
803
|
}
|
|
808
804
|
),
|
|
809
|
-
/* @__PURE__ */ o(
|
|
810
|
-
/* @__PURE__ */ o(
|
|
811
|
-
/* @__PURE__ */ o(
|
|
805
|
+
/* @__PURE__ */ o(j, { title: "Identifiers", fields: n.identifiers }),
|
|
806
|
+
/* @__PURE__ */ o(j, { title: "Other fields", fields: n.other }),
|
|
807
|
+
/* @__PURE__ */ o(j, { title: "Input bindings", fields: t })
|
|
812
808
|
] });
|
|
813
809
|
}
|
|
814
|
-
function
|
|
810
|
+
function nt({
|
|
815
811
|
sources: e
|
|
816
812
|
}) {
|
|
817
813
|
return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
@@ -820,7 +816,7 @@ function rt({
|
|
|
820
816
|
/* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: e.length })
|
|
821
817
|
] }),
|
|
822
818
|
/* @__PURE__ */ o("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ o(
|
|
823
|
-
|
|
819
|
+
it,
|
|
824
820
|
{
|
|
825
821
|
source: r
|
|
826
822
|
},
|
|
@@ -828,20 +824,20 @@ function rt({
|
|
|
828
824
|
)) })
|
|
829
825
|
] }) : null;
|
|
830
826
|
}
|
|
831
|
-
function
|
|
827
|
+
function it({ source: e }) {
|
|
832
828
|
const r = F(e);
|
|
833
829
|
return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
|
|
834
830
|
/* @__PURE__ */ o("span", { style: s.sourcePillLabel, children: r }),
|
|
835
831
|
/* @__PURE__ */ o("span", { style: s.sourcePillRole, children: e.kind })
|
|
836
832
|
] });
|
|
837
833
|
}
|
|
838
|
-
function
|
|
834
|
+
function ot({
|
|
839
835
|
trace: e
|
|
840
836
|
}) {
|
|
841
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ o(
|
|
842
|
-
/* @__PURE__ */ o(
|
|
837
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ o(ie, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
|
|
838
|
+
/* @__PURE__ */ o(at, { sources: e.sourceRefs }),
|
|
843
839
|
/* @__PURE__ */ o(
|
|
844
|
-
|
|
840
|
+
j,
|
|
845
841
|
{
|
|
846
842
|
title: "All field refs",
|
|
847
843
|
fields: e.fieldRefs,
|
|
@@ -850,11 +846,11 @@ function nt({
|
|
|
850
846
|
)
|
|
851
847
|
] }) });
|
|
852
848
|
}
|
|
853
|
-
function
|
|
849
|
+
function st({
|
|
854
850
|
hints: e
|
|
855
851
|
}) {
|
|
856
|
-
return /* @__PURE__ */ o(
|
|
857
|
-
const n = Tt(r), i = r.component || r.exportName || n || "Source hint",
|
|
852
|
+
return /* @__PURE__ */ o(ie, { title: "Source hints", children: /* @__PURE__ */ o("div", { style: s.recipeFieldList, children: e.map((r, t) => {
|
|
853
|
+
const n = Tt(r), i = r.component || r.exportName || n || "Source hint", d = [
|
|
858
854
|
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
859
855
|
n,
|
|
860
856
|
r.note
|
|
@@ -863,17 +859,17 @@ function it({
|
|
|
863
859
|
"div",
|
|
864
860
|
{
|
|
865
861
|
style: s.recipeFieldRow,
|
|
866
|
-
title:
|
|
862
|
+
title: d || i,
|
|
867
863
|
children: [
|
|
868
864
|
/* @__PURE__ */ o("span", { style: s.recipeFieldName, children: i }),
|
|
869
|
-
|
|
865
|
+
d ? /* @__PURE__ */ o("span", { style: s.recipeFieldMeta, children: d }) : null
|
|
870
866
|
]
|
|
871
867
|
},
|
|
872
868
|
`${i}:${n}:${t}`
|
|
873
869
|
);
|
|
874
870
|
}) }) });
|
|
875
871
|
}
|
|
876
|
-
function
|
|
872
|
+
function at({
|
|
877
873
|
sources: e
|
|
878
874
|
}) {
|
|
879
875
|
return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
@@ -895,7 +891,7 @@ function ot({
|
|
|
895
891
|
)) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: "No sources captured" })
|
|
896
892
|
] });
|
|
897
893
|
}
|
|
898
|
-
function
|
|
894
|
+
function j({
|
|
899
895
|
title: e,
|
|
900
896
|
fields: r,
|
|
901
897
|
emptyText: t
|
|
@@ -906,7 +902,7 @@ function M({
|
|
|
906
902
|
/* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: r.length })
|
|
907
903
|
] }),
|
|
908
904
|
r.length ? /* @__PURE__ */ o("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ o(
|
|
909
|
-
|
|
905
|
+
dt,
|
|
910
906
|
{
|
|
911
907
|
field: n,
|
|
912
908
|
groupTitle: e
|
|
@@ -915,21 +911,21 @@ function M({
|
|
|
915
911
|
)) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: t })
|
|
916
912
|
] });
|
|
917
913
|
}
|
|
918
|
-
function
|
|
914
|
+
function dt({
|
|
919
915
|
field: e,
|
|
920
916
|
groupTitle: r
|
|
921
917
|
}) {
|
|
922
|
-
const t =
|
|
918
|
+
const t = At(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, d = e.source ? F(e.source) : void 0, l = [t, i, d].filter(Boolean).join(" · "), c = lt(e, r);
|
|
923
919
|
return /* @__PURE__ */ p("div", { style: s.fieldChip, title: l, children: [
|
|
924
920
|
/* @__PURE__ */ o("span", { style: { ...s.fieldGlyph, ...c.style }, children: c.text }),
|
|
925
921
|
e.aggregate ? /* @__PURE__ */ o("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
|
|
926
922
|
/* @__PURE__ */ o("span", { style: s.fieldChipName, children: n }),
|
|
927
923
|
i ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: i }) : null,
|
|
928
|
-
i &&
|
|
929
|
-
|
|
924
|
+
i && d ? /* @__PURE__ */ o("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
|
|
925
|
+
d ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: d }) : null
|
|
930
926
|
] });
|
|
931
927
|
}
|
|
932
|
-
function
|
|
928
|
+
function lt(e, r) {
|
|
933
929
|
const t = e.dataType, n = e.role;
|
|
934
930
|
return !!e.aggregate || n === "measure" || r === "Measures" ? {
|
|
935
931
|
text: "Σ",
|
|
@@ -968,7 +964,7 @@ function at(e, r) {
|
|
|
968
964
|
}
|
|
969
965
|
};
|
|
970
966
|
}
|
|
971
|
-
function
|
|
967
|
+
function ut({
|
|
972
968
|
inputs: e
|
|
973
969
|
}) {
|
|
974
970
|
return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
|
|
@@ -977,7 +973,7 @@ function dt({
|
|
|
977
973
|
/* @__PURE__ */ o("span", { style: s.inputsAppliedCount, children: e.length })
|
|
978
974
|
] }),
|
|
979
975
|
/* @__PURE__ */ o("div", { style: s.inputRecipeList, children: e.map((r) => {
|
|
980
|
-
const t =
|
|
976
|
+
const t = Et(r);
|
|
981
977
|
return /* @__PURE__ */ p(
|
|
982
978
|
"div",
|
|
983
979
|
{
|
|
@@ -997,23 +993,23 @@ function dt({
|
|
|
997
993
|
}) })
|
|
998
994
|
] });
|
|
999
995
|
}
|
|
1000
|
-
function
|
|
996
|
+
function ct({
|
|
1001
997
|
compiledQuery: e,
|
|
1002
998
|
compiledSql: r
|
|
1003
999
|
}) {
|
|
1004
1000
|
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
|
|
1005
|
-
/* @__PURE__ */ o(
|
|
1006
|
-
e.pythonCode ? /* @__PURE__ */ o(
|
|
1001
|
+
/* @__PURE__ */ o(Ve, { label: "SQL", value: e.sql }),
|
|
1002
|
+
e.pythonCode ? /* @__PURE__ */ o(we, { label: "Python", value: e.pythonCode }) : null,
|
|
1007
1003
|
e.parameters ? /* @__PURE__ */ o(
|
|
1008
|
-
|
|
1004
|
+
we,
|
|
1009
1005
|
{
|
|
1010
1006
|
label: "Parameters",
|
|
1011
|
-
value:
|
|
1007
|
+
value: De(e.parameters)
|
|
1012
1008
|
}
|
|
1013
1009
|
) : null
|
|
1014
|
-
] }) : r ? /* @__PURE__ */ o(
|
|
1010
|
+
] }) : r ? /* @__PURE__ */ o(Ve, { label: "SQL", value: r }) : /* @__PURE__ */ o(we, { label: "Compiled Query", value: De(e) });
|
|
1015
1011
|
}
|
|
1016
|
-
function
|
|
1012
|
+
function we({
|
|
1017
1013
|
label: e,
|
|
1018
1014
|
value: r
|
|
1019
1015
|
}) {
|
|
@@ -1022,16 +1018,16 @@ function Se({
|
|
|
1022
1018
|
/* @__PURE__ */ o("pre", { style: s.codeBlock, children: r })
|
|
1023
1019
|
] });
|
|
1024
1020
|
}
|
|
1025
|
-
function
|
|
1021
|
+
function Ve({
|
|
1026
1022
|
label: e,
|
|
1027
1023
|
value: r
|
|
1028
1024
|
}) {
|
|
1029
1025
|
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1030
1026
|
/* @__PURE__ */ o("div", { style: s.codeBlockLabel, children: e }),
|
|
1031
|
-
/* @__PURE__ */ o("pre", { style: s.codeBlock, children:
|
|
1027
|
+
/* @__PURE__ */ o("pre", { style: s.codeBlock, children: pt(r) })
|
|
1032
1028
|
] });
|
|
1033
1029
|
}
|
|
1034
|
-
const
|
|
1030
|
+
const ft = /* @__PURE__ */ new Set([
|
|
1035
1031
|
"SELECT",
|
|
1036
1032
|
"FROM",
|
|
1037
1033
|
"JOIN",
|
|
@@ -1069,28 +1065,28 @@ const ut = /* @__PURE__ */ new Set([
|
|
|
1069
1065
|
"ALL",
|
|
1070
1066
|
"WITH"
|
|
1071
1067
|
]);
|
|
1072
|
-
function
|
|
1068
|
+
function pt(e) {
|
|
1073
1069
|
return e.split(/(\s+|,|\(|\))/).map((t, n) => {
|
|
1074
1070
|
if (!t) return null;
|
|
1075
1071
|
const i = t.toUpperCase();
|
|
1076
|
-
return
|
|
1072
|
+
return ft.has(i) ? /* @__PURE__ */ o("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ o("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ o("span", { children: t }, n);
|
|
1077
1073
|
});
|
|
1078
1074
|
}
|
|
1079
|
-
function
|
|
1075
|
+
function gt(e) {
|
|
1080
1076
|
const r = e.filter(
|
|
1081
1077
|
(i) => {
|
|
1082
|
-
var
|
|
1083
|
-
return ((
|
|
1078
|
+
var d;
|
|
1079
|
+
return ((d = i.latestAttempt) == null ? void 0 : d.status) === "error";
|
|
1084
1080
|
}
|
|
1085
1081
|
).length, t = e.filter(
|
|
1086
1082
|
(i) => {
|
|
1087
|
-
var
|
|
1088
|
-
return ((
|
|
1083
|
+
var d;
|
|
1084
|
+
return ((d = i.latestAttempt) == null ? void 0 : d.status) === "loading";
|
|
1089
1085
|
}
|
|
1090
1086
|
).length, n = e.filter(
|
|
1091
1087
|
(i) => {
|
|
1092
|
-
var
|
|
1093
|
-
return i.clientWarnings.length > 0 || !!((u = (c = (l = (
|
|
1088
|
+
var d, l, c, u;
|
|
1089
|
+
return i.clientWarnings.length > 0 || !!((u = (c = (l = (d = i.latestAttempt) == null ? void 0 : d.executionResult) == null ? void 0 : l.validation) == null ? void 0 : c.warnings) != null && u.length);
|
|
1094
1090
|
}
|
|
1095
1091
|
).length;
|
|
1096
1092
|
return {
|
|
@@ -1099,10 +1095,18 @@ function ft(e) {
|
|
|
1099
1095
|
loading: t,
|
|
1100
1096
|
warningCount: n,
|
|
1101
1097
|
issueCount: r + n,
|
|
1102
|
-
severity: r ? "error" : n ? "warning" : "ok"
|
|
1098
|
+
severity: r ? "error" : n ? "warning" : t ? "loading" : "ok"
|
|
1103
1099
|
};
|
|
1104
1100
|
}
|
|
1105
|
-
function
|
|
1101
|
+
function mt(e) {
|
|
1102
|
+
return [
|
|
1103
|
+
`${e.total} ${e.total === 1 ? "trace" : "traces"}`,
|
|
1104
|
+
`${e.loading} loading`,
|
|
1105
|
+
`${e.failed} failed`,
|
|
1106
|
+
`${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
|
|
1107
|
+
].join(" · ");
|
|
1108
|
+
}
|
|
1109
|
+
function yt(e, r) {
|
|
1106
1110
|
const t = r.trim().toLowerCase();
|
|
1107
1111
|
return t ? e.filter(
|
|
1108
1112
|
(n) => [
|
|
@@ -1114,36 +1118,36 @@ function pt(e, r) {
|
|
|
1114
1118
|
n.sectionTitle,
|
|
1115
1119
|
n.builder,
|
|
1116
1120
|
n.queryKind,
|
|
1117
|
-
|
|
1121
|
+
gr(n)
|
|
1118
1122
|
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
1119
1123
|
) : e;
|
|
1120
1124
|
}
|
|
1121
|
-
function
|
|
1125
|
+
function ht(e) {
|
|
1122
1126
|
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Ce));
|
|
1123
1127
|
return [
|
|
1124
1128
|
{ title: "Views", traces: e.filter((i) => !t.has(Ce(i))) },
|
|
1125
1129
|
{ title: "Inputs", traces: r }
|
|
1126
1130
|
];
|
|
1127
1131
|
}
|
|
1128
|
-
function
|
|
1132
|
+
function ur(e, r) {
|
|
1129
1133
|
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
1130
1134
|
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));
|
|
1131
1135
|
}
|
|
1132
|
-
function
|
|
1136
|
+
function vt(e, r) {
|
|
1133
1137
|
if (r.queryId)
|
|
1134
|
-
return
|
|
1138
|
+
return ur(e, r);
|
|
1135
1139
|
if (!r.viewId)
|
|
1136
1140
|
return;
|
|
1137
1141
|
const t = e.filter((n) => n.viewId === r.viewId);
|
|
1138
1142
|
return t.length === 1 ? t[0] : void 0;
|
|
1139
1143
|
}
|
|
1140
|
-
function
|
|
1144
|
+
function bt(e, r) {
|
|
1141
1145
|
return !!(e && r && e.traceId === r.traceId);
|
|
1142
1146
|
}
|
|
1143
1147
|
function Ce(e) {
|
|
1144
1148
|
return e.traceId;
|
|
1145
1149
|
}
|
|
1146
|
-
function
|
|
1150
|
+
function St(e) {
|
|
1147
1151
|
switch (e) {
|
|
1148
1152
|
case "metric":
|
|
1149
1153
|
return "metric";
|
|
@@ -1158,14 +1162,14 @@ function ht(e) {
|
|
|
1158
1162
|
case "sql":
|
|
1159
1163
|
return "sql";
|
|
1160
1164
|
default:
|
|
1161
|
-
return
|
|
1165
|
+
return he(e);
|
|
1162
1166
|
}
|
|
1163
1167
|
}
|
|
1164
|
-
function
|
|
1168
|
+
function cr(e) {
|
|
1165
1169
|
const r = e.trim().toLowerCase();
|
|
1166
1170
|
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";
|
|
1167
1171
|
}
|
|
1168
|
-
function
|
|
1172
|
+
function fr(e) {
|
|
1169
1173
|
switch (e) {
|
|
1170
1174
|
case "metric":
|
|
1171
1175
|
return {
|
|
@@ -1197,37 +1201,28 @@ function cr(e) {
|
|
|
1197
1201
|
};
|
|
1198
1202
|
}
|
|
1199
1203
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return e.queryLabel || e.queryId || me(e);
|
|
1202
|
-
}
|
|
1203
|
-
function vt(e) {
|
|
1204
|
-
return fr(e);
|
|
1205
|
-
}
|
|
1206
|
-
function bt(e) {
|
|
1207
|
-
const r = Ke(e), t = fr(e);
|
|
1208
|
-
return e.queryId && e.queryId !== t ? { source: r, queryId: e.queryId } : { source: r };
|
|
1209
|
-
}
|
|
1210
|
-
function me(e) {
|
|
1204
|
+
function Ke(e) {
|
|
1211
1205
|
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
1212
1206
|
}
|
|
1213
|
-
function
|
|
1214
|
-
|
|
1207
|
+
function wt(e, r, t) {
|
|
1208
|
+
const n = [];
|
|
1209
|
+
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;
|
|
1215
1210
|
}
|
|
1216
1211
|
function pr(e) {
|
|
1217
|
-
return It(e.visualType) ||
|
|
1212
|
+
return It(e.visualType) || St(e.queryKind);
|
|
1218
1213
|
}
|
|
1219
1214
|
function xt(e, r) {
|
|
1220
|
-
return r ? e.queryLabel || e.queryId :
|
|
1215
|
+
return r ? e.queryLabel || e.queryId : Ke(e);
|
|
1221
1216
|
}
|
|
1222
1217
|
function It(e) {
|
|
1223
1218
|
if (e)
|
|
1224
1219
|
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1225
1220
|
}
|
|
1226
|
-
function
|
|
1221
|
+
function gr(e) {
|
|
1227
1222
|
const r = e.sourceRefs.map(F);
|
|
1228
1223
|
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
1229
1224
|
}
|
|
1230
|
-
function
|
|
1225
|
+
function qt(e) {
|
|
1231
1226
|
return e.reduce(
|
|
1232
1227
|
(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),
|
|
1233
1228
|
{
|
|
@@ -1239,7 +1234,7 @@ function wt(e) {
|
|
|
1239
1234
|
}
|
|
1240
1235
|
);
|
|
1241
1236
|
}
|
|
1242
|
-
function
|
|
1237
|
+
function Rt(e) {
|
|
1243
1238
|
var r, t;
|
|
1244
1239
|
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)
|
|
1245
1240
|
return "KPI query";
|
|
@@ -1257,15 +1252,15 @@ function qt(e) {
|
|
|
1257
1252
|
case "sql":
|
|
1258
1253
|
return "SQL query";
|
|
1259
1254
|
default:
|
|
1260
|
-
return
|
|
1255
|
+
return he(e.queryKind);
|
|
1261
1256
|
}
|
|
1262
1257
|
}
|
|
1263
|
-
function
|
|
1258
|
+
function At(e) {
|
|
1264
1259
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1265
1260
|
}
|
|
1266
|
-
function
|
|
1261
|
+
function Et(e) {
|
|
1267
1262
|
var l, c, u;
|
|
1268
|
-
const r = e.valuePreview || "redacted", t = ((l = e.fieldRef) == null ? void 0 : l.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (u = e.fieldRef) != null && u.source ? F(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "),
|
|
1263
|
+
const r = e.valuePreview || "redacted", t = ((l = e.fieldRef) == null ? void 0 : l.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (u = e.fieldRef) != null && u.source ? F(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), d = [
|
|
1269
1264
|
e.inputId,
|
|
1270
1265
|
e.operator,
|
|
1271
1266
|
r,
|
|
@@ -1275,7 +1270,7 @@ function At(e) {
|
|
|
1275
1270
|
operator: e.operator,
|
|
1276
1271
|
value: r,
|
|
1277
1272
|
binding: i,
|
|
1278
|
-
title:
|
|
1273
|
+
title: d
|
|
1279
1274
|
};
|
|
1280
1275
|
}
|
|
1281
1276
|
function F(e) {
|
|
@@ -1288,16 +1283,16 @@ function Tt(e) {
|
|
|
1288
1283
|
if (e.file)
|
|
1289
1284
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1290
1285
|
}
|
|
1291
|
-
function
|
|
1286
|
+
function kt(e) {
|
|
1292
1287
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1293
1288
|
}
|
|
1294
|
-
function
|
|
1289
|
+
function Ct(e) {
|
|
1295
1290
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1296
1291
|
}
|
|
1297
|
-
function
|
|
1298
|
-
return
|
|
1292
|
+
function Dt(e) {
|
|
1293
|
+
return De(e);
|
|
1299
1294
|
}
|
|
1300
|
-
function
|
|
1295
|
+
function De(e) {
|
|
1301
1296
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1302
1297
|
}
|
|
1303
1298
|
function Lt(e) {
|
|
@@ -1313,10 +1308,10 @@ function Lt(e) {
|
|
|
1313
1308
|
case "input_changed":
|
|
1314
1309
|
return "Input changed";
|
|
1315
1310
|
default:
|
|
1316
|
-
return
|
|
1311
|
+
return Bt(e);
|
|
1317
1312
|
}
|
|
1318
1313
|
}
|
|
1319
|
-
function
|
|
1314
|
+
function Ot(e) {
|
|
1320
1315
|
return [
|
|
1321
1316
|
e.at,
|
|
1322
1317
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1325,20 +1320,20 @@ function Dt(e) {
|
|
|
1325
1320
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1326
1321
|
].filter(Boolean).join(" - ");
|
|
1327
1322
|
}
|
|
1328
|
-
function
|
|
1323
|
+
function Bt(e) {
|
|
1329
1324
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1330
1325
|
}
|
|
1331
1326
|
function xe(e) {
|
|
1332
1327
|
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
1333
1328
|
}
|
|
1334
|
-
function
|
|
1329
|
+
function Kt(e) {
|
|
1335
1330
|
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;
|
|
1336
1331
|
return {
|
|
1337
1332
|
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
1338
1333
|
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
1339
1334
|
};
|
|
1340
1335
|
}
|
|
1341
|
-
function
|
|
1336
|
+
function Nt(e) {
|
|
1342
1337
|
return e === "relative" ? {
|
|
1343
1338
|
position: "relative",
|
|
1344
1339
|
top: "auto",
|
|
@@ -1352,7 +1347,7 @@ function Kt(e) {
|
|
|
1352
1347
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1353
1348
|
};
|
|
1354
1349
|
}
|
|
1355
|
-
function
|
|
1350
|
+
function $t(e) {
|
|
1356
1351
|
return e === "error" ? {
|
|
1357
1352
|
borderColor: "var(--sd-error-border)",
|
|
1358
1353
|
background: "var(--sd-error-bg)",
|
|
@@ -1361,13 +1356,17 @@ function Nt(e) {
|
|
|
1361
1356
|
borderColor: "var(--sd-warning-border)",
|
|
1362
1357
|
background: "var(--sd-warning-bg)",
|
|
1363
1358
|
color: "var(--sd-warning-fg)"
|
|
1359
|
+
} : e === "loading" ? {
|
|
1360
|
+
borderColor: "var(--sd-loading-border)",
|
|
1361
|
+
background: "var(--sd-loading-bg)",
|
|
1362
|
+
color: "var(--sd-loading-fg)"
|
|
1364
1363
|
} : {
|
|
1365
1364
|
borderColor: "var(--sd-success-border)",
|
|
1366
1365
|
background: "var(--sd-success-bg)",
|
|
1367
1366
|
color: "var(--sd-success-fg)"
|
|
1368
1367
|
};
|
|
1369
1368
|
}
|
|
1370
|
-
function
|
|
1369
|
+
function Wt(e) {
|
|
1371
1370
|
return e === "right" ? {
|
|
1372
1371
|
top: 16,
|
|
1373
1372
|
right: 16,
|
|
@@ -1386,23 +1385,23 @@ function $t(e) {
|
|
|
1386
1385
|
borderRadius: 6
|
|
1387
1386
|
};
|
|
1388
1387
|
}
|
|
1389
|
-
function
|
|
1388
|
+
function Ft(e) {
|
|
1390
1389
|
return e === "right" ? {
|
|
1391
1390
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1392
1391
|
} : {
|
|
1393
1392
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1394
1393
|
};
|
|
1395
1394
|
}
|
|
1396
|
-
function
|
|
1395
|
+
function _t(e) {
|
|
1397
1396
|
return {
|
|
1398
1397
|
borderRight: "1px solid var(--sd-border)",
|
|
1399
1398
|
borderBottom: 0
|
|
1400
1399
|
};
|
|
1401
1400
|
}
|
|
1402
|
-
function
|
|
1401
|
+
function mr(e) {
|
|
1403
1402
|
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)" };
|
|
1404
1403
|
}
|
|
1405
|
-
function
|
|
1404
|
+
function zt(e) {
|
|
1406
1405
|
return e === "error" ? {
|
|
1407
1406
|
borderColor: "var(--sd-error-border)",
|
|
1408
1407
|
color: "var(--sd-error-fg)"
|
|
@@ -1417,7 +1416,7 @@ function _t(e) {
|
|
|
1417
1416
|
color: "var(--sd-fg-muted)"
|
|
1418
1417
|
};
|
|
1419
1418
|
}
|
|
1420
|
-
const
|
|
1419
|
+
const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
|
|
1421
1420
|
.${$} {
|
|
1422
1421
|
--sd-bg: #ffffff;
|
|
1423
1422
|
--sd-bg-muted: #fafafa;
|
|
@@ -1519,13 +1518,13 @@ const Ve = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", zt = `
|
|
|
1519
1518
|
word-break: break-all;
|
|
1520
1519
|
}
|
|
1521
1520
|
`;
|
|
1522
|
-
function
|
|
1523
|
-
if (typeof document > "u" || document.getElementById(
|
|
1521
|
+
function yr() {
|
|
1522
|
+
if (typeof document > "u" || document.getElementById(Ue))
|
|
1524
1523
|
return;
|
|
1525
1524
|
const e = document.createElement("style");
|
|
1526
|
-
e.id =
|
|
1525
|
+
e.id = Ue, e.textContent = Ht, document.head.appendChild(e);
|
|
1527
1526
|
}
|
|
1528
|
-
const
|
|
1527
|
+
const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', N = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ie = {
|
|
1529
1528
|
color: "var(--sd-fg-muted)",
|
|
1530
1529
|
fontSize: 10,
|
|
1531
1530
|
fontWeight: 600,
|
|
@@ -1546,7 +1545,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1546
1545
|
borderStyle: "solid",
|
|
1547
1546
|
borderRadius: 6,
|
|
1548
1547
|
boxShadow: "var(--sd-shadow)",
|
|
1549
|
-
font: `600 12px/1.2 ${
|
|
1548
|
+
font: `600 12px/1.2 ${ue}`,
|
|
1550
1549
|
cursor: "pointer"
|
|
1551
1550
|
},
|
|
1552
1551
|
launcherText: {
|
|
@@ -1554,14 +1553,17 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1554
1553
|
},
|
|
1555
1554
|
launcherIssueCount: {
|
|
1556
1555
|
display: "grid",
|
|
1557
|
-
minWidth:
|
|
1558
|
-
height:
|
|
1556
|
+
minWidth: 18,
|
|
1557
|
+
height: 18,
|
|
1558
|
+
padding: "0 6px",
|
|
1559
1559
|
placeItems: "center",
|
|
1560
|
-
borderRadius:
|
|
1561
|
-
|
|
1562
|
-
|
|
1560
|
+
borderRadius: 999,
|
|
1561
|
+
border: "1px solid currentColor",
|
|
1562
|
+
background: "var(--sd-bg)",
|
|
1563
|
+
color: "currentColor",
|
|
1563
1564
|
fontSize: 10,
|
|
1564
|
-
lineHeight: "
|
|
1565
|
+
lineHeight: "18px",
|
|
1566
|
+
whiteSpace: "nowrap"
|
|
1565
1567
|
},
|
|
1566
1568
|
logoMark: {
|
|
1567
1569
|
display: "grid",
|
|
@@ -1588,7 +1590,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1588
1590
|
background: "var(--sd-bg)",
|
|
1589
1591
|
color: "var(--sd-fg)",
|
|
1590
1592
|
boxShadow: "var(--sd-shadow)",
|
|
1591
|
-
font: `13px/1.4 ${
|
|
1593
|
+
font: `13px/1.4 ${ue}`
|
|
1592
1594
|
},
|
|
1593
1595
|
panelFullscreen: {
|
|
1594
1596
|
top: 0,
|
|
@@ -1657,7 +1659,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1657
1659
|
outline: 0,
|
|
1658
1660
|
background: "transparent",
|
|
1659
1661
|
color: "var(--sd-fg)",
|
|
1660
|
-
font: `12px/1.4 ${
|
|
1662
|
+
font: `12px/1.4 ${ue}`
|
|
1661
1663
|
},
|
|
1662
1664
|
panelBody: {
|
|
1663
1665
|
display: "grid",
|
|
@@ -1746,7 +1748,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1746
1748
|
borderRadius: 3,
|
|
1747
1749
|
background: "var(--sd-bg-accent)",
|
|
1748
1750
|
color: "var(--sd-fg-muted)",
|
|
1749
|
-
fontFamily:
|
|
1751
|
+
fontFamily: N,
|
|
1750
1752
|
fontSize: 9,
|
|
1751
1753
|
fontWeight: 600,
|
|
1752
1754
|
textTransform: "uppercase",
|
|
@@ -1757,13 +1759,12 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1757
1759
|
paddingLeft: 14,
|
|
1758
1760
|
color: "var(--sd-fg-muted)",
|
|
1759
1761
|
fontSize: 11,
|
|
1760
|
-
lineHeight: 1.35
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1762
|
+
lineHeight: 1.35,
|
|
1763
|
+
overflow: "hidden",
|
|
1764
|
+
textOverflow: "ellipsis",
|
|
1765
|
+
whiteSpace: "nowrap"
|
|
1764
1766
|
},
|
|
1765
|
-
|
|
1766
|
-
fontFamily: O,
|
|
1767
|
+
queryListSubtitleSep: {
|
|
1767
1768
|
color: "var(--sd-fg-subtle)"
|
|
1768
1769
|
},
|
|
1769
1770
|
detailsPane: {
|
|
@@ -1807,7 +1808,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1807
1808
|
borderRadius: 3,
|
|
1808
1809
|
background: "var(--sd-bg-accent)",
|
|
1809
1810
|
color: "var(--sd-fg-muted)",
|
|
1810
|
-
fontFamily:
|
|
1811
|
+
fontFamily: N,
|
|
1811
1812
|
fontSize: 10,
|
|
1812
1813
|
fontWeight: 600,
|
|
1813
1814
|
textTransform: "uppercase",
|
|
@@ -1848,7 +1849,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1848
1849
|
color: "var(--sd-fg)"
|
|
1849
1850
|
},
|
|
1850
1851
|
sourcePillLabel: {
|
|
1851
|
-
fontFamily:
|
|
1852
|
+
fontFamily: N,
|
|
1852
1853
|
fontSize: 11,
|
|
1853
1854
|
color: "var(--sd-fg)"
|
|
1854
1855
|
},
|
|
@@ -1860,7 +1861,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1860
1861
|
borderRadius: 3,
|
|
1861
1862
|
background: "var(--sd-bg-accent)",
|
|
1862
1863
|
color: "var(--sd-fg-subtle)",
|
|
1863
|
-
fontFamily:
|
|
1864
|
+
fontFamily: N,
|
|
1864
1865
|
fontSize: 9,
|
|
1865
1866
|
textTransform: "uppercase",
|
|
1866
1867
|
letterSpacing: "0.06em"
|
|
@@ -1892,7 +1893,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1892
1893
|
borderWidth: 1,
|
|
1893
1894
|
borderStyle: "solid",
|
|
1894
1895
|
borderRadius: 4,
|
|
1895
|
-
fontFamily:
|
|
1896
|
+
fontFamily: N,
|
|
1896
1897
|
fontSize: 11,
|
|
1897
1898
|
fontWeight: 700,
|
|
1898
1899
|
lineHeight: 1
|
|
@@ -1905,7 +1906,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1905
1906
|
borderRadius: 3,
|
|
1906
1907
|
background: "var(--sd-bg-accent)",
|
|
1907
1908
|
color: "var(--sd-fg)",
|
|
1908
|
-
fontFamily:
|
|
1909
|
+
fontFamily: N,
|
|
1909
1910
|
fontSize: 10,
|
|
1910
1911
|
fontWeight: 600,
|
|
1911
1912
|
letterSpacing: "0.04em"
|
|
@@ -1922,7 +1923,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1922
1923
|
},
|
|
1923
1924
|
fieldChipMeta: {
|
|
1924
1925
|
flex: "0 0 auto",
|
|
1925
|
-
fontFamily:
|
|
1926
|
+
fontFamily: N,
|
|
1926
1927
|
fontSize: 10,
|
|
1927
1928
|
color: "var(--sd-fg-subtle)"
|
|
1928
1929
|
},
|
|
@@ -2098,7 +2099,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2098
2099
|
textOverflow: "ellipsis",
|
|
2099
2100
|
whiteSpace: "nowrap",
|
|
2100
2101
|
color: "var(--sd-fg)",
|
|
2101
|
-
fontFamily:
|
|
2102
|
+
fontFamily: N,
|
|
2102
2103
|
fontSize: 11,
|
|
2103
2104
|
fontWeight: 600
|
|
2104
2105
|
},
|
|
@@ -2111,7 +2112,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2111
2112
|
borderRadius: 3,
|
|
2112
2113
|
background: "var(--sd-bg-accent)",
|
|
2113
2114
|
color: "var(--sd-fg-muted)",
|
|
2114
|
-
fontFamily:
|
|
2115
|
+
fontFamily: N,
|
|
2115
2116
|
fontSize: 10,
|
|
2116
2117
|
textTransform: "uppercase",
|
|
2117
2118
|
letterSpacing: "0.06em"
|
|
@@ -2181,7 +2182,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2181
2182
|
borderRadius: 5,
|
|
2182
2183
|
background: "var(--sd-bg-muted)",
|
|
2183
2184
|
color: "var(--sd-fg)",
|
|
2184
|
-
fontFamily:
|
|
2185
|
+
fontFamily: N,
|
|
2185
2186
|
fontSize: 11,
|
|
2186
2187
|
lineHeight: 1.5,
|
|
2187
2188
|
whiteSpace: "pre-wrap"
|
|
@@ -2203,7 +2204,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2203
2204
|
borderStyle: "solid",
|
|
2204
2205
|
borderRadius: 5,
|
|
2205
2206
|
background: "var(--sd-bg)",
|
|
2206
|
-
font: `600 11px/1 ${
|
|
2207
|
+
font: `600 11px/1 ${ue}`,
|
|
2207
2208
|
cursor: "pointer"
|
|
2208
2209
|
},
|
|
2209
2210
|
inspectButtonText: {
|
|
@@ -2212,7 +2213,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2212
2213
|
whiteSpace: "nowrap"
|
|
2213
2214
|
}
|
|
2214
2215
|
};
|
|
2215
|
-
function
|
|
2216
|
+
function hr(e) {
|
|
2216
2217
|
return {
|
|
2217
2218
|
...e,
|
|
2218
2219
|
order: [],
|
|
@@ -2225,24 +2226,24 @@ function Mt(e, r) {
|
|
|
2225
2226
|
return r.config.enabled ? {
|
|
2226
2227
|
...e,
|
|
2227
2228
|
...r.config
|
|
2228
|
-
} :
|
|
2229
|
+
} : hr(r.config);
|
|
2229
2230
|
if (!e.enabled)
|
|
2230
2231
|
return e;
|
|
2231
2232
|
switch (r.type) {
|
|
2232
2233
|
case "register":
|
|
2233
|
-
return
|
|
2234
|
+
return Vt(jt(e, r.descriptor));
|
|
2234
2235
|
case "unregister":
|
|
2235
|
-
return
|
|
2236
|
+
return Pt(e, r.traceKey);
|
|
2236
2237
|
case "event":
|
|
2237
|
-
return
|
|
2238
|
+
return Qt(e, r);
|
|
2238
2239
|
default:
|
|
2239
2240
|
return e;
|
|
2240
2241
|
}
|
|
2241
2242
|
}
|
|
2242
|
-
function
|
|
2243
|
-
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = $e(),
|
|
2244
|
-
...t ||
|
|
2245
|
-
...
|
|
2243
|
+
function jt(e, r) {
|
|
2244
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = $e(), d = {
|
|
2245
|
+
...t || Ut(r),
|
|
2246
|
+
...vr(r),
|
|
2246
2247
|
traceKey: r.traceKey,
|
|
2247
2248
|
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
2248
2249
|
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
@@ -2256,11 +2257,11 @@ function Pt(e, r) {
|
|
|
2256
2257
|
order: t ? e.order : [...e.order, r.traceKey],
|
|
2257
2258
|
entries: {
|
|
2258
2259
|
...e.entries,
|
|
2259
|
-
[r.traceKey]:
|
|
2260
|
+
[r.traceKey]: d
|
|
2260
2261
|
}
|
|
2261
2262
|
};
|
|
2262
2263
|
}
|
|
2263
|
-
function
|
|
2264
|
+
function Pt(e, r) {
|
|
2264
2265
|
const t = e.entries[r];
|
|
2265
2266
|
return t ? {
|
|
2266
2267
|
...e,
|
|
@@ -2273,7 +2274,7 @@ function Ht(e, r) {
|
|
|
2273
2274
|
}
|
|
2274
2275
|
} : e;
|
|
2275
2276
|
}
|
|
2276
|
-
function
|
|
2277
|
+
function Qt(e, r) {
|
|
2277
2278
|
const t = e.entries[r.traceKey];
|
|
2278
2279
|
if (!t)
|
|
2279
2280
|
return e;
|
|
@@ -2297,10 +2298,10 @@ function jt(e, r) {
|
|
|
2297
2298
|
}
|
|
2298
2299
|
};
|
|
2299
2300
|
}
|
|
2300
|
-
function
|
|
2301
|
+
function Vt(e) {
|
|
2301
2302
|
if (e.order.length <= e.maxQueries)
|
|
2302
2303
|
return e;
|
|
2303
|
-
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i,
|
|
2304
|
+
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, d) => i.mounted !== d.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - d.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
|
|
2304
2305
|
r.slice(0, t).map((i) => i.traceKey)
|
|
2305
2306
|
);
|
|
2306
2307
|
return n.size ? {
|
|
@@ -2311,10 +2312,10 @@ function Qt(e) {
|
|
|
2311
2312
|
)
|
|
2312
2313
|
} : e;
|
|
2313
2314
|
}
|
|
2314
|
-
function
|
|
2315
|
+
function Ut(e) {
|
|
2315
2316
|
const r = $e();
|
|
2316
2317
|
return {
|
|
2317
|
-
...
|
|
2318
|
+
...vr(e),
|
|
2318
2319
|
traceKey: e.traceKey,
|
|
2319
2320
|
latestAttempt: { status: "idle" },
|
|
2320
2321
|
recentEvents: [],
|
|
@@ -2323,9 +2324,9 @@ function Vt(e) {
|
|
|
2323
2324
|
lastEventAt: r
|
|
2324
2325
|
};
|
|
2325
2326
|
}
|
|
2326
|
-
function
|
|
2327
|
+
function vr(e) {
|
|
2327
2328
|
var n;
|
|
2328
|
-
const r =
|
|
2329
|
+
const r = an(e.spec), t = dn(
|
|
2329
2330
|
e.spec,
|
|
2330
2331
|
e.activeInputs
|
|
2331
2332
|
);
|
|
@@ -2339,55 +2340,55 @@ function hr(e) {
|
|
|
2339
2340
|
queryLabel: e.queryLabel,
|
|
2340
2341
|
queryKind: e.queryKind,
|
|
2341
2342
|
builder: e.builder,
|
|
2342
|
-
sourceRefs:
|
|
2343
|
+
sourceRefs: sn(e.intent),
|
|
2343
2344
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2344
2345
|
projectionFieldRefs: r,
|
|
2345
2346
|
inputFieldRefs: t,
|
|
2346
|
-
fieldRefs:
|
|
2347
|
+
fieldRefs: ln(e.intent),
|
|
2347
2348
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2348
2349
|
inputId: i.inputId,
|
|
2349
2350
|
fieldRef: i.field,
|
|
2350
2351
|
operator: i.operator,
|
|
2351
|
-
valuePreview:
|
|
2352
|
+
valuePreview: nn(i)
|
|
2352
2353
|
})),
|
|
2353
2354
|
recentEvents: [],
|
|
2354
2355
|
clientWarnings: e.clientWarnings
|
|
2355
2356
|
};
|
|
2356
2357
|
}
|
|
2357
|
-
function
|
|
2358
|
+
function pe(e) {
|
|
2358
2359
|
const {
|
|
2359
2360
|
traceKey: r,
|
|
2360
2361
|
mounted: t,
|
|
2361
2362
|
registeredAt: n,
|
|
2362
2363
|
lastEventAt: i,
|
|
2363
|
-
...
|
|
2364
|
+
...d
|
|
2364
2365
|
} = e;
|
|
2365
|
-
return
|
|
2366
|
+
return d;
|
|
2366
2367
|
}
|
|
2367
|
-
function
|
|
2368
|
+
function ge(e) {
|
|
2368
2369
|
return e.enabled ? {
|
|
2369
2370
|
enabled: !0,
|
|
2370
|
-
queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(
|
|
2371
|
+
queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(pe),
|
|
2371
2372
|
getQuery: (t) => {
|
|
2372
2373
|
const n = Object.values(e.entries).find(
|
|
2373
2374
|
(i) => i.queryId === t
|
|
2374
2375
|
);
|
|
2375
|
-
return n ?
|
|
2376
|
+
return n ? pe(n) : void 0;
|
|
2376
2377
|
},
|
|
2377
|
-
getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(
|
|
2378
|
-
} :
|
|
2378
|
+
getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(pe)
|
|
2379
|
+
} : ar;
|
|
2379
2380
|
}
|
|
2380
|
-
function
|
|
2381
|
+
function Gt(e) {
|
|
2381
2382
|
return {
|
|
2382
|
-
snapshot: () =>
|
|
2383
|
-
getQuery: (r) =>
|
|
2384
|
-
getQueries: (r) =>
|
|
2383
|
+
snapshot: () => Jt(ge(e())),
|
|
2384
|
+
getQuery: (r) => Ge(ge(e()).getQuery(r)),
|
|
2385
|
+
getQueries: (r) => ge(e()).getQueries(r).map((t) => Ge(t)).filter((t) => !!t)
|
|
2385
2386
|
};
|
|
2386
2387
|
}
|
|
2387
|
-
function
|
|
2388
|
+
function Jt(e) {
|
|
2388
2389
|
if (!e.enabled)
|
|
2389
2390
|
return e;
|
|
2390
|
-
const r = e.queries.map(
|
|
2391
|
+
const r = e.queries.map(br);
|
|
2391
2392
|
return {
|
|
2392
2393
|
enabled: e.enabled,
|
|
2393
2394
|
queries: r,
|
|
@@ -2395,36 +2396,36 @@ function Gt(e) {
|
|
|
2395
2396
|
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
2396
2397
|
};
|
|
2397
2398
|
}
|
|
2398
|
-
function
|
|
2399
|
-
return e ?
|
|
2399
|
+
function Ge(e) {
|
|
2400
|
+
return e ? br(e) : void 0;
|
|
2400
2401
|
}
|
|
2401
|
-
function
|
|
2402
|
+
function br(e) {
|
|
2402
2403
|
var r;
|
|
2403
2404
|
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
2404
2405
|
...e,
|
|
2405
2406
|
latestAttempt: {
|
|
2406
2407
|
...e.latestAttempt,
|
|
2407
|
-
executionResult:
|
|
2408
|
+
executionResult: Yt(
|
|
2408
2409
|
e.latestAttempt.executionResult
|
|
2409
2410
|
)
|
|
2410
2411
|
}
|
|
2411
2412
|
} : e;
|
|
2412
2413
|
}
|
|
2413
|
-
function
|
|
2414
|
+
function Yt(e) {
|
|
2414
2415
|
const {
|
|
2415
2416
|
compiledQuery: r,
|
|
2416
2417
|
intent: t,
|
|
2417
2418
|
result: n,
|
|
2418
2419
|
...i
|
|
2419
|
-
} = e,
|
|
2420
|
+
} = e, d = Xt(
|
|
2420
2421
|
i.metadata
|
|
2421
2422
|
);
|
|
2422
2423
|
return {
|
|
2423
2424
|
...i,
|
|
2424
|
-
...
|
|
2425
|
+
...d ? { metadata: d } : {}
|
|
2425
2426
|
};
|
|
2426
2427
|
}
|
|
2427
|
-
function
|
|
2428
|
+
function Xt(e) {
|
|
2428
2429
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2429
2430
|
return e;
|
|
2430
2431
|
const r = e.dataAppDebug;
|
|
@@ -2436,49 +2437,49 @@ function Yt(e) {
|
|
|
2436
2437
|
dataAppDebug: n
|
|
2437
2438
|
};
|
|
2438
2439
|
}
|
|
2439
|
-
function
|
|
2440
|
+
function Zt(e) {
|
|
2440
2441
|
return e === void 0 || e === !1 ? {
|
|
2441
2442
|
enabled: !1,
|
|
2442
2443
|
exposeWindowBridge: !1,
|
|
2443
|
-
maxEventsPerQuery:
|
|
2444
|
-
maxQueries:
|
|
2444
|
+
maxEventsPerQuery: be,
|
|
2445
|
+
maxQueries: Se
|
|
2445
2446
|
} : e === !0 ? {
|
|
2446
2447
|
enabled: !0,
|
|
2447
2448
|
exposeWindowBridge: !1,
|
|
2448
|
-
maxEventsPerQuery:
|
|
2449
|
-
maxQueries:
|
|
2449
|
+
maxEventsPerQuery: be,
|
|
2450
|
+
maxQueries: Se
|
|
2450
2451
|
} : {
|
|
2451
2452
|
enabled: e.enabled !== !1,
|
|
2452
2453
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2453
2454
|
maxEventsPerQuery: Ye(
|
|
2454
2455
|
e.maxEventsPerQuery,
|
|
2455
|
-
|
|
2456
|
-
|
|
2456
|
+
be,
|
|
2457
|
+
Qr
|
|
2457
2458
|
),
|
|
2458
2459
|
maxQueries: Ye(
|
|
2459
2460
|
e.maxQueries,
|
|
2460
|
-
|
|
2461
|
-
|
|
2461
|
+
Se,
|
|
2462
|
+
Vr
|
|
2462
2463
|
)
|
|
2463
2464
|
};
|
|
2464
2465
|
}
|
|
2465
|
-
function
|
|
2466
|
+
function en(e) {
|
|
2466
2467
|
const t = [
|
|
2467
2468
|
e == null ? void 0 : e.sourceHint,
|
|
2468
2469
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
2469
2470
|
].filter((n) => !!n).map((n) => ({
|
|
2470
|
-
file:
|
|
2471
|
+
file: ce(n.file),
|
|
2471
2472
|
line: Je(n.line),
|
|
2472
2473
|
column: Je(n.column),
|
|
2473
|
-
exportName:
|
|
2474
|
-
component:
|
|
2475
|
-
note:
|
|
2474
|
+
exportName: ce(n.exportName),
|
|
2475
|
+
component: ce(n.component),
|
|
2476
|
+
note: ce(n.note)
|
|
2476
2477
|
})).filter(
|
|
2477
2478
|
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2478
2479
|
);
|
|
2479
2480
|
return t.length ? t : void 0;
|
|
2480
2481
|
}
|
|
2481
|
-
function
|
|
2482
|
+
function ce(e) {
|
|
2482
2483
|
if (typeof e != "string")
|
|
2483
2484
|
return;
|
|
2484
2485
|
const r = e.trim();
|
|
@@ -2490,10 +2491,10 @@ function Je(e) {
|
|
|
2490
2491
|
function Ye(e, r, t) {
|
|
2491
2492
|
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
2492
2493
|
}
|
|
2493
|
-
function
|
|
2494
|
+
function rn(e) {
|
|
2494
2495
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2495
2496
|
}
|
|
2496
|
-
function
|
|
2497
|
+
function tn(e) {
|
|
2497
2498
|
switch (e) {
|
|
2498
2499
|
case "metric":
|
|
2499
2500
|
return "semaphor.metric";
|
|
@@ -2508,14 +2509,14 @@ function en(e) {
|
|
|
2508
2509
|
case "sql":
|
|
2509
2510
|
return "semaphor.sql";
|
|
2510
2511
|
default:
|
|
2511
|
-
return
|
|
2512
|
+
return he(e);
|
|
2512
2513
|
}
|
|
2513
2514
|
}
|
|
2514
|
-
function
|
|
2515
|
+
function he(e) {
|
|
2515
2516
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2516
2517
|
}
|
|
2517
|
-
function
|
|
2518
|
-
if (
|
|
2518
|
+
function nn(e) {
|
|
2519
|
+
if (on(e))
|
|
2519
2520
|
return;
|
|
2520
2521
|
const r = e.value;
|
|
2521
2522
|
if (r !== void 0) {
|
|
@@ -2535,7 +2536,7 @@ function rn(e) {
|
|
|
2535
2536
|
function Xe(e) {
|
|
2536
2537
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2537
2538
|
}
|
|
2538
|
-
function
|
|
2539
|
+
function on(e) {
|
|
2539
2540
|
var t;
|
|
2540
2541
|
const r = [
|
|
2541
2542
|
e.inputId,
|
|
@@ -2546,105 +2547,105 @@ function tn(e) {
|
|
|
2546
2547
|
(n) => r.includes(n)
|
|
2547
2548
|
);
|
|
2548
2549
|
}
|
|
2549
|
-
function
|
|
2550
|
+
function sn(e) {
|
|
2550
2551
|
const r = /* @__PURE__ */ new Map();
|
|
2551
|
-
return
|
|
2552
|
-
|
|
2552
|
+
return me(e, (t) => {
|
|
2553
|
+
un(t) && r.set(wr(t), t);
|
|
2553
2554
|
}), [...r.values()];
|
|
2554
2555
|
}
|
|
2555
|
-
function
|
|
2556
|
+
function an(e) {
|
|
2556
2557
|
switch (e.queryKind) {
|
|
2557
2558
|
case "metric":
|
|
2558
2559
|
case "analysis":
|
|
2559
|
-
return
|
|
2560
|
+
return J([
|
|
2560
2561
|
...e.measures || [],
|
|
2561
2562
|
e.primaryMeasure,
|
|
2562
2563
|
e.dateField,
|
|
2563
2564
|
...e.dimensions || []
|
|
2564
2565
|
]);
|
|
2565
2566
|
case "records":
|
|
2566
|
-
return
|
|
2567
|
+
return J(e.fields || []);
|
|
2567
2568
|
case "inputOptions":
|
|
2568
|
-
return
|
|
2569
|
+
return J([
|
|
2569
2570
|
e.labelField,
|
|
2570
2571
|
e.valueField,
|
|
2571
2572
|
e.searchField,
|
|
2572
2573
|
...e.disambiguationFields || []
|
|
2573
2574
|
]);
|
|
2574
2575
|
case "sql":
|
|
2575
|
-
return
|
|
2576
|
+
return J(e.fields || []);
|
|
2576
2577
|
case "matrix":
|
|
2577
|
-
return
|
|
2578
|
-
...(e.rows || []).map(
|
|
2579
|
-
...(e.columns || []).map(
|
|
2580
|
-
...(e.values || []).map(
|
|
2578
|
+
return J([
|
|
2579
|
+
...(e.rows || []).map(qe),
|
|
2580
|
+
...(e.columns || []).map(qe),
|
|
2581
|
+
...(e.values || []).map(qe)
|
|
2581
2582
|
]);
|
|
2582
2583
|
default:
|
|
2583
|
-
return
|
|
2584
|
+
return he(e);
|
|
2584
2585
|
}
|
|
2585
2586
|
}
|
|
2586
|
-
function
|
|
2587
|
+
function dn(e, r) {
|
|
2587
2588
|
const t = [
|
|
2588
|
-
...(e.inputs || []).map(
|
|
2589
|
+
...(e.inputs || []).map(Sr),
|
|
2589
2590
|
...(r || []).map((n) => n.field)
|
|
2590
2591
|
];
|
|
2591
|
-
return
|
|
2592
|
+
return J(t);
|
|
2592
2593
|
}
|
|
2593
|
-
function
|
|
2594
|
+
function J(e) {
|
|
2594
2595
|
const r = /* @__PURE__ */ new Map();
|
|
2595
2596
|
return e.forEach((t) => {
|
|
2596
|
-
t &&
|
|
2597
|
+
t && se(t) && r.set(Ne(t), t);
|
|
2597
2598
|
}), [...r.values()];
|
|
2598
2599
|
}
|
|
2599
|
-
function
|
|
2600
|
+
function Sr(e) {
|
|
2600
2601
|
if (!e || typeof e != "object")
|
|
2601
2602
|
return;
|
|
2602
2603
|
const r = e.toAnalyticsInput;
|
|
2603
2604
|
if (typeof r == "function") {
|
|
2604
2605
|
const n = r.call(e);
|
|
2605
|
-
return
|
|
2606
|
+
return Sr(n);
|
|
2606
2607
|
}
|
|
2607
2608
|
const t = e.field;
|
|
2608
|
-
return
|
|
2609
|
+
return se(t) ? t : void 0;
|
|
2609
2610
|
}
|
|
2610
|
-
function
|
|
2611
|
-
if (
|
|
2611
|
+
function qe(e) {
|
|
2612
|
+
if (se(e))
|
|
2612
2613
|
return e;
|
|
2613
2614
|
if (!e || typeof e != "object")
|
|
2614
2615
|
return;
|
|
2615
2616
|
const r = e.field;
|
|
2616
|
-
return
|
|
2617
|
+
return se(r) ? r : void 0;
|
|
2617
2618
|
}
|
|
2618
|
-
function
|
|
2619
|
+
function ln(e) {
|
|
2619
2620
|
const r = /* @__PURE__ */ new Map();
|
|
2620
|
-
return
|
|
2621
|
-
|
|
2621
|
+
return me(e, (t) => {
|
|
2622
|
+
se(t) && r.set(Ne(t), t);
|
|
2622
2623
|
}), [...r.values()];
|
|
2623
2624
|
}
|
|
2624
|
-
function
|
|
2625
|
+
function me(e, r) {
|
|
2625
2626
|
if (!(!e || typeof e != "object")) {
|
|
2626
2627
|
if (r(e), Array.isArray(e)) {
|
|
2627
|
-
e.forEach((t) =>
|
|
2628
|
+
e.forEach((t) => me(t, r));
|
|
2628
2629
|
return;
|
|
2629
2630
|
}
|
|
2630
2631
|
Object.values(e).forEach(
|
|
2631
|
-
(t) =>
|
|
2632
|
+
(t) => me(t, r)
|
|
2632
2633
|
);
|
|
2633
2634
|
}
|
|
2634
2635
|
}
|
|
2635
|
-
function
|
|
2636
|
+
function un(e) {
|
|
2636
2637
|
if (!e || typeof e != "object")
|
|
2637
2638
|
return !1;
|
|
2638
2639
|
const r = e;
|
|
2639
2640
|
return r.kind === "semantic" ? typeof r.domainId == "string" && typeof r.datasetName == "string" : r.kind === "physical" ? typeof r.connectionId == "string" && typeof r.tableName == "string" : r.kind === "sql" ? typeof r.connectionId == "string" : !1;
|
|
2640
2641
|
}
|
|
2641
|
-
function
|
|
2642
|
+
function se(e) {
|
|
2642
2643
|
if (!e || typeof e != "object")
|
|
2643
2644
|
return !1;
|
|
2644
2645
|
const r = e;
|
|
2645
2646
|
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
2646
2647
|
}
|
|
2647
|
-
function
|
|
2648
|
+
function wr(e) {
|
|
2648
2649
|
return e.kind === "semantic" ? [
|
|
2649
2650
|
e.kind,
|
|
2650
2651
|
e.domainId,
|
|
@@ -2662,14 +2663,14 @@ function Ne(e) {
|
|
|
2662
2663
|
e.name,
|
|
2663
2664
|
e.role,
|
|
2664
2665
|
e.aggregate,
|
|
2665
|
-
e.source ?
|
|
2666
|
+
e.source ? wr(e.source) : ""
|
|
2666
2667
|
].join(":");
|
|
2667
2668
|
}
|
|
2668
|
-
function
|
|
2669
|
+
function cn(e) {
|
|
2669
2670
|
const r = e;
|
|
2670
2671
|
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
2671
2672
|
}
|
|
2672
|
-
function
|
|
2673
|
+
function fn(e) {
|
|
2673
2674
|
const r = e;
|
|
2674
2675
|
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
2675
2676
|
}
|
|
@@ -2687,13 +2688,13 @@ function xr(e) {
|
|
|
2687
2688
|
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
2688
2689
|
return (r >>> 0).toString(36);
|
|
2689
2690
|
}
|
|
2690
|
-
function
|
|
2691
|
+
function fe() {
|
|
2691
2692
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2692
2693
|
}
|
|
2693
2694
|
function $e() {
|
|
2694
2695
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2695
2696
|
}
|
|
2696
|
-
const
|
|
2697
|
+
const pn = [
|
|
2697
2698
|
"records",
|
|
2698
2699
|
"changes",
|
|
2699
2700
|
"drivers",
|
|
@@ -2701,7 +2702,7 @@ const cn = [
|
|
|
2701
2702
|
"largestPositiveChanges",
|
|
2702
2703
|
"largestNegativeDrivers",
|
|
2703
2704
|
"largestPositiveDrivers"
|
|
2704
|
-
],
|
|
2705
|
+
], gn = [
|
|
2705
2706
|
"records",
|
|
2706
2707
|
"changes",
|
|
2707
2708
|
"drivers",
|
|
@@ -2713,7 +2714,7 @@ const cn = [
|
|
|
2713
2714
|
function Ir(e) {
|
|
2714
2715
|
if (!e)
|
|
2715
2716
|
return {};
|
|
2716
|
-
const r =
|
|
2717
|
+
const r = bn(e.executionResult), t = mn(e, r), n = hn(t);
|
|
2717
2718
|
return {
|
|
2718
2719
|
...e,
|
|
2719
2720
|
...Object.keys(t).length ? { resultSets: t } : {},
|
|
@@ -2724,35 +2725,35 @@ function Ir(e) {
|
|
|
2724
2725
|
} : {}
|
|
2725
2726
|
};
|
|
2726
2727
|
}
|
|
2727
|
-
function
|
|
2728
|
-
const t =
|
|
2729
|
-
for (const i of
|
|
2728
|
+
function mn(e, r) {
|
|
2729
|
+
const t = yn(e.resultSets);
|
|
2730
|
+
for (const i of pn) {
|
|
2730
2731
|
if (t[i]) {
|
|
2731
|
-
t[i] =
|
|
2732
|
+
t[i] = qr(t[i]);
|
|
2732
2733
|
continue;
|
|
2733
2734
|
}
|
|
2734
|
-
const
|
|
2735
|
-
if (!
|
|
2735
|
+
const d = Sn(e[i]);
|
|
2736
|
+
if (!d.length)
|
|
2736
2737
|
continue;
|
|
2737
|
-
const l = r.length ? r :
|
|
2738
|
+
const l = r.length ? r : wn(d);
|
|
2738
2739
|
t[i] = {
|
|
2739
|
-
records: We(
|
|
2740
|
+
records: We(d, l),
|
|
2740
2741
|
columns: l,
|
|
2741
|
-
rowCount:
|
|
2742
|
+
rowCount: d.length
|
|
2742
2743
|
};
|
|
2743
2744
|
}
|
|
2744
|
-
const n =
|
|
2745
|
+
const n = vn(e.executionResult);
|
|
2745
2746
|
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
2746
2747
|
}
|
|
2747
|
-
function
|
|
2748
|
+
function yn(e) {
|
|
2748
2749
|
return Object.fromEntries(
|
|
2749
2750
|
Object.entries(e || {}).map(([r, t]) => [
|
|
2750
2751
|
r,
|
|
2751
|
-
|
|
2752
|
+
qr(t)
|
|
2752
2753
|
])
|
|
2753
2754
|
);
|
|
2754
2755
|
}
|
|
2755
|
-
function
|
|
2756
|
+
function qr(e) {
|
|
2756
2757
|
var r;
|
|
2757
2758
|
return {
|
|
2758
2759
|
...e,
|
|
@@ -2763,14 +2764,14 @@ function wr(e) {
|
|
|
2763
2764
|
rowCount: e.rowCount ?? ((r = e.records) == null ? void 0 : r.length) ?? 0
|
|
2764
2765
|
};
|
|
2765
2766
|
}
|
|
2766
|
-
function
|
|
2767
|
+
function hn(e) {
|
|
2767
2768
|
var r;
|
|
2768
|
-
for (const t of
|
|
2769
|
+
for (const t of gn)
|
|
2769
2770
|
if ((r = e[t]) != null && r.records.length)
|
|
2770
2771
|
return e[t];
|
|
2771
2772
|
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
2772
2773
|
}
|
|
2773
|
-
function
|
|
2774
|
+
function vn(e) {
|
|
2774
2775
|
const r = e == null ? void 0 : e.result;
|
|
2775
2776
|
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
2776
2777
|
return {
|
|
@@ -2779,11 +2780,11 @@ function yn(e) {
|
|
|
2779
2780
|
rowCount: r.rowCount ?? r.records.length
|
|
2780
2781
|
};
|
|
2781
2782
|
}
|
|
2782
|
-
function
|
|
2783
|
+
function bn(e) {
|
|
2783
2784
|
const r = e == null ? void 0 : e.result;
|
|
2784
2785
|
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
2785
2786
|
}
|
|
2786
|
-
function
|
|
2787
|
+
function Sn(e) {
|
|
2787
2788
|
return Array.isArray(e) ? e.filter(
|
|
2788
2789
|
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
2789
2790
|
) : [];
|
|
@@ -2791,17 +2792,17 @@ function vn(e) {
|
|
|
2791
2792
|
function We(e, r) {
|
|
2792
2793
|
return r.length ? e.map((t) => {
|
|
2793
2794
|
const n = {};
|
|
2794
|
-
return r.forEach((i,
|
|
2795
|
-
const l =
|
|
2795
|
+
return r.forEach((i, d) => {
|
|
2796
|
+
const l = xn(t, {
|
|
2796
2797
|
name: i.key,
|
|
2797
2798
|
label: i.label,
|
|
2798
|
-
fallbackNames: [i.name, Object.keys(t)[
|
|
2799
|
+
fallbackNames: [i.name, Object.keys(t)[d]]
|
|
2799
2800
|
});
|
|
2800
2801
|
l !== void 0 && (n[i.key] = l);
|
|
2801
2802
|
}), Object.keys(n).length ? n : t;
|
|
2802
2803
|
}) : e;
|
|
2803
2804
|
}
|
|
2804
|
-
function
|
|
2805
|
+
function wn(e) {
|
|
2805
2806
|
return Array.from(
|
|
2806
2807
|
new Set(e.flatMap((t) => Object.keys(t)))
|
|
2807
2808
|
).map((t) => ({
|
|
@@ -2810,7 +2811,7 @@ function bn(e) {
|
|
|
2810
2811
|
label: t
|
|
2811
2812
|
}));
|
|
2812
2813
|
}
|
|
2813
|
-
function
|
|
2814
|
+
function xn(e, r) {
|
|
2814
2815
|
const t = [
|
|
2815
2816
|
r.name,
|
|
2816
2817
|
r.label,
|
|
@@ -2820,29 +2821,29 @@ function Sn(e, r) {
|
|
|
2820
2821
|
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
2821
2822
|
return e[n];
|
|
2822
2823
|
}
|
|
2823
|
-
function
|
|
2824
|
+
function In() {
|
|
2824
2825
|
return {
|
|
2825
|
-
executeAnalysis: (e, r, t) =>
|
|
2826
|
+
executeAnalysis: (e, r, t) => G(
|
|
2826
2827
|
e,
|
|
2827
2828
|
r,
|
|
2828
2829
|
t ?? {}
|
|
2829
2830
|
).then(Ir),
|
|
2830
|
-
executeMetric: (e, r) =>
|
|
2831
|
-
executeRecords: (e, r) =>
|
|
2832
|
-
executeInputOptions: (e, r) =>
|
|
2833
|
-
executeSql: (e, r) =>
|
|
2834
|
-
executeMatrix: (e, r) =>
|
|
2831
|
+
executeMetric: (e, r) => G(e, r),
|
|
2832
|
+
executeRecords: (e, r) => G(e, r),
|
|
2833
|
+
executeInputOptions: (e, r) => G(e, r),
|
|
2834
|
+
executeSql: (e, r) => G(e, r),
|
|
2835
|
+
executeMatrix: (e, r) => G(e, r)
|
|
2835
2836
|
};
|
|
2836
2837
|
}
|
|
2837
|
-
async function
|
|
2838
|
+
async function G(e, r, t) {
|
|
2838
2839
|
if (!r.token)
|
|
2839
2840
|
throw new Error(
|
|
2840
2841
|
"SemaphorDataAppProvider needs a token to execute queries."
|
|
2841
2842
|
);
|
|
2842
|
-
const n =
|
|
2843
|
-
let
|
|
2843
|
+
const n = Dn(r), i = An(e, n);
|
|
2844
|
+
let d;
|
|
2844
2845
|
try {
|
|
2845
|
-
|
|
2846
|
+
d = await fetch(n, {
|
|
2846
2847
|
method: "POST",
|
|
2847
2848
|
headers: {
|
|
2848
2849
|
"Content-Type": "application/json",
|
|
@@ -2853,7 +2854,7 @@ async function U(e, r, t) {
|
|
|
2853
2854
|
activeInputs: r.activeInputs,
|
|
2854
2855
|
...t ? { analysisOptions: t } : {},
|
|
2855
2856
|
resultShape: e.kind,
|
|
2856
|
-
...
|
|
2857
|
+
...Rn(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
2857
2858
|
})
|
|
2858
2859
|
});
|
|
2859
2860
|
} catch (c) {
|
|
@@ -2861,32 +2862,32 @@ async function U(e, r, t) {
|
|
|
2861
2862
|
`${i}: ${c instanceof Error ? c.message : String(c)}`
|
|
2862
2863
|
);
|
|
2863
2864
|
}
|
|
2864
|
-
const l = await
|
|
2865
|
-
if (!
|
|
2866
|
-
throw
|
|
2867
|
-
`${i}: ${l.error || `Semaphor Data App execution failed with status ${
|
|
2865
|
+
const l = await kn(d);
|
|
2866
|
+
if (!d.ok || l.error)
|
|
2867
|
+
throw qn(
|
|
2868
|
+
`${i}: ${l.error || `Semaphor Data App execution failed with status ${d.status}.`}`,
|
|
2868
2869
|
l
|
|
2869
2870
|
);
|
|
2870
2871
|
return l;
|
|
2871
2872
|
}
|
|
2872
|
-
function
|
|
2873
|
+
function qn(e, r) {
|
|
2873
2874
|
const t = new Error(e);
|
|
2874
2875
|
return r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), t;
|
|
2875
2876
|
}
|
|
2876
|
-
function
|
|
2877
|
+
function Rn(e) {
|
|
2877
2878
|
const r = e.debug;
|
|
2878
2879
|
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
2879
2880
|
}
|
|
2880
|
-
function
|
|
2881
|
+
function An(e, r) {
|
|
2881
2882
|
return [
|
|
2882
2883
|
`Semaphor ${e.kind} query`,
|
|
2883
2884
|
e.id ? `id=${e.id}` : void 0,
|
|
2884
2885
|
e.label ? `label=${e.label}` : void 0,
|
|
2885
|
-
|
|
2886
|
-
`endpoint=${
|
|
2886
|
+
En(e),
|
|
2887
|
+
`endpoint=${Tn(r)}`
|
|
2887
2888
|
].filter((t) => !!t).join(" ");
|
|
2888
2889
|
}
|
|
2889
|
-
function
|
|
2890
|
+
function En(e) {
|
|
2890
2891
|
const r = "source" in e ? e.source : void 0;
|
|
2891
2892
|
if (!(!r || typeof r != "object")) {
|
|
2892
2893
|
if (r.kind === "semantic")
|
|
@@ -2905,7 +2906,7 @@ function Rn(e) {
|
|
|
2905
2906
|
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
2906
2907
|
}
|
|
2907
2908
|
}
|
|
2908
|
-
function
|
|
2909
|
+
function Tn(e) {
|
|
2909
2910
|
if (!e)
|
|
2910
2911
|
return "/api/v1/data-app/execute";
|
|
2911
2912
|
try {
|
|
@@ -2914,7 +2915,7 @@ function An(e) {
|
|
|
2914
2915
|
return e;
|
|
2915
2916
|
}
|
|
2916
2917
|
}
|
|
2917
|
-
async function
|
|
2918
|
+
async function kn(e) {
|
|
2918
2919
|
const r = await e.text().catch(() => "");
|
|
2919
2920
|
if (!r.trim())
|
|
2920
2921
|
return e.ok ? {
|
|
@@ -2927,43 +2928,43 @@ async function Tn(e) {
|
|
|
2927
2928
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
2928
2929
|
details: r
|
|
2929
2930
|
} : {
|
|
2930
|
-
error:
|
|
2931
|
+
error: Cn(e, r),
|
|
2931
2932
|
details: r
|
|
2932
2933
|
};
|
|
2933
2934
|
}
|
|
2934
2935
|
}
|
|
2935
|
-
function
|
|
2936
|
+
function Cn(e, r) {
|
|
2936
2937
|
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
2937
2938
|
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}.`;
|
|
2938
2939
|
}
|
|
2939
|
-
function
|
|
2940
|
-
const r =
|
|
2940
|
+
function Dn(e) {
|
|
2941
|
+
const r = Ln(e).replace(/\/+$/, "");
|
|
2941
2942
|
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
2942
2943
|
}
|
|
2943
|
-
function
|
|
2944
|
+
function Ln(e) {
|
|
2944
2945
|
if (e.apiBaseUrl)
|
|
2945
2946
|
return e.apiBaseUrl;
|
|
2946
2947
|
if (!e.token)
|
|
2947
2948
|
return "";
|
|
2948
2949
|
try {
|
|
2949
|
-
return
|
|
2950
|
+
return jr(e.token).apiServiceUrl || "";
|
|
2950
2951
|
} catch {
|
|
2951
2952
|
return "";
|
|
2952
2953
|
}
|
|
2953
2954
|
}
|
|
2954
|
-
const
|
|
2955
|
-
function
|
|
2955
|
+
const Rr = ye({});
|
|
2956
|
+
function On() {
|
|
2956
2957
|
if (!(typeof window > "u"))
|
|
2957
2958
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
2958
2959
|
}
|
|
2959
|
-
function
|
|
2960
|
-
return
|
|
2960
|
+
function Bn() {
|
|
2961
|
+
return Q(Rr);
|
|
2961
2962
|
}
|
|
2962
|
-
const
|
|
2963
|
-
function
|
|
2964
|
-
const r =
|
|
2963
|
+
const Re = { value: null }, Ae = {}, Kn = { records: [] }, Ee = { options: [] }, Nn = { records: [] }, Te = {};
|
|
2964
|
+
function $n(e) {
|
|
2965
|
+
const r = Y(e.inputs), t = Br(e);
|
|
2965
2966
|
try {
|
|
2966
|
-
const n =
|
|
2967
|
+
const n = Kr(e), i = X(n);
|
|
2967
2968
|
return i ? {
|
|
2968
2969
|
error: i,
|
|
2969
2970
|
activeInputs: r,
|
|
@@ -2974,14 +2975,14 @@ function Kn(e) {
|
|
|
2974
2975
|
i,
|
|
2975
2976
|
t
|
|
2976
2977
|
),
|
|
2977
|
-
idleData:
|
|
2978
|
+
idleData: Ae
|
|
2978
2979
|
} : {
|
|
2979
2980
|
intent: n,
|
|
2980
2981
|
error: null,
|
|
2981
2982
|
activeInputs: r,
|
|
2982
2983
|
analysisOptions: t,
|
|
2983
2984
|
queryKey: q(n, r, void 0, t),
|
|
2984
|
-
idleData:
|
|
2985
|
+
idleData: Ae
|
|
2985
2986
|
};
|
|
2986
2987
|
} catch (n) {
|
|
2987
2988
|
const i = _(n);
|
|
@@ -2995,25 +2996,25 @@ function Kn(e) {
|
|
|
2995
2996
|
i,
|
|
2996
2997
|
t
|
|
2997
2998
|
),
|
|
2998
|
-
idleData:
|
|
2999
|
+
idleData: Ae
|
|
2999
3000
|
};
|
|
3000
3001
|
}
|
|
3001
3002
|
}
|
|
3002
|
-
function
|
|
3003
|
-
const r =
|
|
3003
|
+
function Wn(e) {
|
|
3004
|
+
const r = Y(e.inputs);
|
|
3004
3005
|
try {
|
|
3005
|
-
const t =
|
|
3006
|
+
const t = Nr(e), n = X(t);
|
|
3006
3007
|
return n ? {
|
|
3007
3008
|
error: n,
|
|
3008
3009
|
activeInputs: r,
|
|
3009
3010
|
queryKey: q(void 0, r, n),
|
|
3010
|
-
idleData:
|
|
3011
|
+
idleData: Re
|
|
3011
3012
|
} : {
|
|
3012
3013
|
intent: t,
|
|
3013
3014
|
error: null,
|
|
3014
3015
|
activeInputs: r,
|
|
3015
3016
|
queryKey: q(t, r),
|
|
3016
|
-
idleData:
|
|
3017
|
+
idleData: Re
|
|
3017
3018
|
};
|
|
3018
3019
|
} catch (t) {
|
|
3019
3020
|
const n = _(t);
|
|
@@ -3021,14 +3022,14 @@ function Nn(e) {
|
|
|
3021
3022
|
error: n,
|
|
3022
3023
|
activeInputs: r,
|
|
3023
3024
|
queryKey: q(void 0, r, n),
|
|
3024
|
-
idleData:
|
|
3025
|
+
idleData: Re
|
|
3025
3026
|
};
|
|
3026
3027
|
}
|
|
3027
3028
|
}
|
|
3028
|
-
function
|
|
3029
|
-
const r =
|
|
3029
|
+
function Fn(e) {
|
|
3030
|
+
const r = Y(e.inputs), t = Kn;
|
|
3030
3031
|
try {
|
|
3031
|
-
const n =
|
|
3032
|
+
const n = Or(e), i = X(n);
|
|
3032
3033
|
return i ? {
|
|
3033
3034
|
error: i,
|
|
3034
3035
|
activeInputs: r,
|
|
@@ -3051,21 +3052,21 @@ function $n(e) {
|
|
|
3051
3052
|
};
|
|
3052
3053
|
}
|
|
3053
3054
|
}
|
|
3054
|
-
function
|
|
3055
|
-
const r =
|
|
3055
|
+
function _n(e) {
|
|
3056
|
+
const r = Y(e.inputs);
|
|
3056
3057
|
try {
|
|
3057
|
-
const t = Lr(e), n =
|
|
3058
|
+
const t = Lr(e), n = X(t);
|
|
3058
3059
|
return n ? {
|
|
3059
3060
|
error: n,
|
|
3060
3061
|
activeInputs: r,
|
|
3061
3062
|
queryKey: q(void 0, r, n),
|
|
3062
|
-
idleData:
|
|
3063
|
+
idleData: Ee
|
|
3063
3064
|
} : {
|
|
3064
3065
|
intent: t,
|
|
3065
3066
|
error: null,
|
|
3066
3067
|
activeInputs: r,
|
|
3067
3068
|
queryKey: q(t, r),
|
|
3068
|
-
idleData:
|
|
3069
|
+
idleData: Ee
|
|
3069
3070
|
};
|
|
3070
3071
|
} catch (t) {
|
|
3071
3072
|
const n = _(t);
|
|
@@ -3073,14 +3074,14 @@ function Wn(e) {
|
|
|
3073
3074
|
error: n,
|
|
3074
3075
|
activeInputs: r,
|
|
3075
3076
|
queryKey: q(void 0, r, n),
|
|
3076
|
-
idleData:
|
|
3077
|
+
idleData: Ee
|
|
3077
3078
|
};
|
|
3078
3079
|
}
|
|
3079
3080
|
}
|
|
3080
|
-
function
|
|
3081
|
-
const r =
|
|
3081
|
+
function zn(e) {
|
|
3082
|
+
const r = Y(e.inputs), t = Nn;
|
|
3082
3083
|
try {
|
|
3083
|
-
const n =
|
|
3084
|
+
const n = Dr(e), i = X(n);
|
|
3084
3085
|
return i ? {
|
|
3085
3086
|
error: i,
|
|
3086
3087
|
activeInputs: r,
|
|
@@ -3103,10 +3104,10 @@ function Fn(e) {
|
|
|
3103
3104
|
};
|
|
3104
3105
|
}
|
|
3105
3106
|
}
|
|
3106
|
-
function
|
|
3107
|
-
const r =
|
|
3107
|
+
function Hn(e) {
|
|
3108
|
+
const r = Y(e.inputs);
|
|
3108
3109
|
try {
|
|
3109
|
-
const t =
|
|
3110
|
+
const t = Cr(e), n = X(t);
|
|
3110
3111
|
return n ? {
|
|
3111
3112
|
error: n,
|
|
3112
3113
|
activeInputs: r,
|
|
@@ -3132,7 +3133,7 @@ function _n(e) {
|
|
|
3132
3133
|
function _(e) {
|
|
3133
3134
|
return e instanceof Error ? e : new Error(String(e));
|
|
3134
3135
|
}
|
|
3135
|
-
function
|
|
3136
|
+
function X(e) {
|
|
3136
3137
|
const r = Pr(e);
|
|
3137
3138
|
if (r.ok)
|
|
3138
3139
|
return null;
|
|
@@ -3149,19 +3150,19 @@ function q(e, r, t, n) {
|
|
|
3149
3150
|
error: t == null ? void 0 : t.message
|
|
3150
3151
|
});
|
|
3151
3152
|
}
|
|
3152
|
-
function
|
|
3153
|
-
const [r, t] =
|
|
3153
|
+
function si(e) {
|
|
3154
|
+
const [r, t] = V(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, d = b(
|
|
3154
3155
|
() => nr(e.options),
|
|
3155
3156
|
[e.options]
|
|
3156
|
-
), l =
|
|
3157
|
+
), l = O(
|
|
3157
3158
|
(u) => {
|
|
3158
3159
|
var m;
|
|
3159
3160
|
const f = u;
|
|
3160
3161
|
(m = e.onValueChange) == null || m.call(e, f), n || t(f);
|
|
3161
3162
|
},
|
|
3162
3163
|
[n, e]
|
|
3163
|
-
), c =
|
|
3164
|
-
return
|
|
3164
|
+
), c = O(() => l(void 0), [l]);
|
|
3165
|
+
return b(() => {
|
|
3165
3166
|
const u = ir(e);
|
|
3166
3167
|
return {
|
|
3167
3168
|
id: e.id,
|
|
@@ -3172,8 +3173,8 @@ function ii(e) {
|
|
|
3172
3173
|
relationshipHint: u.relationshipHint,
|
|
3173
3174
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
3174
3175
|
value: i,
|
|
3175
|
-
options:
|
|
3176
|
-
isActive:
|
|
3176
|
+
options: d,
|
|
3177
|
+
isActive: oe(i),
|
|
3177
3178
|
setValue: l,
|
|
3178
3179
|
clear: c,
|
|
3179
3180
|
toAnalyticsInput: () => ({
|
|
@@ -3182,29 +3183,29 @@ function ii(e) {
|
|
|
3182
3183
|
kind: e.kind,
|
|
3183
3184
|
label: e.label,
|
|
3184
3185
|
value: i,
|
|
3185
|
-
isActive:
|
|
3186
|
+
isActive: oe(i),
|
|
3186
3187
|
operator: u.operator,
|
|
3187
3188
|
relationshipHint: u.relationshipHint,
|
|
3188
3189
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
3189
3190
|
})
|
|
3190
3191
|
};
|
|
3191
|
-
}, [c,
|
|
3192
|
+
}, [c, d, l, e, i]);
|
|
3192
3193
|
}
|
|
3193
|
-
function
|
|
3194
|
-
const [r, t] =
|
|
3195
|
-
return
|
|
3194
|
+
function ai(e) {
|
|
3195
|
+
const [r, t] = V(() => Qn(e));
|
|
3196
|
+
return K(() => {
|
|
3196
3197
|
t((n) => {
|
|
3197
3198
|
let i = n;
|
|
3198
|
-
for (const
|
|
3199
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
3199
|
+
for (const d of e)
|
|
3200
|
+
!Object.prototype.hasOwnProperty.call(i, d.id) && d.defaultValue !== void 0 && (i = { ...i, [d.id]: d.defaultValue });
|
|
3200
3201
|
return i;
|
|
3201
3202
|
});
|
|
3202
|
-
}, [e]),
|
|
3203
|
+
}, [e]), b(
|
|
3203
3204
|
() => e.map((n) => {
|
|
3204
3205
|
const i = Object.prototype.hasOwnProperty.call(
|
|
3205
3206
|
n,
|
|
3206
3207
|
"value"
|
|
3207
|
-
),
|
|
3208
|
+
), d = i ? n.value : r[n.id], l = nr(n.options), c = (m) => {
|
|
3208
3209
|
var y;
|
|
3209
3210
|
(y = n.onValueChange) == null || y.call(n, m), i || t((h) => ({
|
|
3210
3211
|
...h,
|
|
@@ -3219,9 +3220,9 @@ function oi(e) {
|
|
|
3219
3220
|
operator: f.operator,
|
|
3220
3221
|
relationshipHint: f.relationshipHint,
|
|
3221
3222
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
3222
|
-
value:
|
|
3223
|
+
value: d,
|
|
3223
3224
|
options: l,
|
|
3224
|
-
isActive:
|
|
3225
|
+
isActive: oe(d),
|
|
3225
3226
|
setValue: c,
|
|
3226
3227
|
clear: u,
|
|
3227
3228
|
toAnalyticsInput: () => ({
|
|
@@ -3229,8 +3230,8 @@ function oi(e) {
|
|
|
3229
3230
|
field: f.field,
|
|
3230
3231
|
kind: n.kind,
|
|
3231
3232
|
label: n.label,
|
|
3232
|
-
value:
|
|
3233
|
-
isActive:
|
|
3233
|
+
value: d,
|
|
3234
|
+
isActive: oe(d),
|
|
3234
3235
|
operator: f.operator,
|
|
3235
3236
|
relationshipHint: f.relationshipHint,
|
|
3236
3237
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
@@ -3240,14 +3241,14 @@ function oi(e) {
|
|
|
3240
3241
|
[e, r]
|
|
3241
3242
|
);
|
|
3242
3243
|
}
|
|
3243
|
-
function
|
|
3244
|
-
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n =
|
|
3245
|
-
|
|
3246
|
-
|
|
3244
|
+
function di(e, r) {
|
|
3245
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = b(() => jn(t), [t]);
|
|
3246
|
+
K(() => {
|
|
3247
|
+
Mn(e.value, t) || e.clear();
|
|
3247
3248
|
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
3248
3249
|
}
|
|
3249
|
-
function
|
|
3250
|
-
if (!
|
|
3250
|
+
function Mn(e, r) {
|
|
3251
|
+
if (!oe(e) || r === void 0)
|
|
3251
3252
|
return !0;
|
|
3252
3253
|
const t = new Set(
|
|
3253
3254
|
r.map((i) => rr(i.value))
|
|
@@ -3256,62 +3257,62 @@ function zn(e, r) {
|
|
|
3256
3257
|
(i) => t.has(rr(i))
|
|
3257
3258
|
);
|
|
3258
3259
|
}
|
|
3259
|
-
function
|
|
3260
|
+
function jn(e) {
|
|
3260
3261
|
return JSON.stringify((e || []).map((r) => r.value));
|
|
3261
3262
|
}
|
|
3262
3263
|
function rr(e) {
|
|
3263
3264
|
return `${typeof e}:${String(e)}`;
|
|
3264
3265
|
}
|
|
3265
|
-
function
|
|
3266
|
-
const t =
|
|
3266
|
+
function li(e, r = {}) {
|
|
3267
|
+
const t = b(
|
|
3267
3268
|
() => r.inputs ? {
|
|
3268
3269
|
...e,
|
|
3269
3270
|
inputs: r.inputs
|
|
3270
3271
|
} : e,
|
|
3271
3272
|
[r.inputs, e]
|
|
3272
|
-
), n =
|
|
3273
|
+
), n = b(() => {
|
|
3273
3274
|
switch (t.queryKind) {
|
|
3274
3275
|
case "metric":
|
|
3275
3276
|
return {
|
|
3276
3277
|
queryKind: t.queryKind,
|
|
3277
|
-
request:
|
|
3278
|
+
request: Wn(t)
|
|
3278
3279
|
};
|
|
3279
3280
|
case "analysis":
|
|
3280
3281
|
return {
|
|
3281
3282
|
queryKind: t.queryKind,
|
|
3282
|
-
request:
|
|
3283
|
+
request: $n(t)
|
|
3283
3284
|
};
|
|
3284
3285
|
case "records":
|
|
3285
3286
|
return {
|
|
3286
3287
|
queryKind: t.queryKind,
|
|
3287
|
-
request:
|
|
3288
|
+
request: Fn(t)
|
|
3288
3289
|
};
|
|
3289
3290
|
case "inputOptions":
|
|
3290
3291
|
return {
|
|
3291
3292
|
queryKind: t.queryKind,
|
|
3292
|
-
request:
|
|
3293
|
+
request: _n(t)
|
|
3293
3294
|
};
|
|
3294
3295
|
case "sql":
|
|
3295
3296
|
return {
|
|
3296
3297
|
queryKind: t.queryKind,
|
|
3297
|
-
request:
|
|
3298
|
+
request: zn(t)
|
|
3298
3299
|
};
|
|
3299
3300
|
case "matrix":
|
|
3300
3301
|
return {
|
|
3301
3302
|
queryKind: t.queryKind,
|
|
3302
|
-
request:
|
|
3303
|
+
request: Hn(t)
|
|
3303
3304
|
};
|
|
3304
3305
|
default:
|
|
3305
|
-
return
|
|
3306
|
+
return ke(t);
|
|
3306
3307
|
}
|
|
3307
|
-
}, [t]), i =
|
|
3308
|
+
}, [t]), i = Xr({
|
|
3308
3309
|
spec: t,
|
|
3309
3310
|
queryKind: n.queryKind,
|
|
3310
3311
|
queryKey: n.request.queryKey,
|
|
3311
3312
|
intent: n.request.intent,
|
|
3312
3313
|
activeInputs: n.request.activeInputs,
|
|
3313
3314
|
debug: r.debug
|
|
3314
|
-
}),
|
|
3315
|
+
}), d = D(null), l = b(
|
|
3315
3316
|
() => ({
|
|
3316
3317
|
start: i.start,
|
|
3317
3318
|
success: i.success,
|
|
@@ -3324,48 +3325,48 @@ function ai(e, r = {}) {
|
|
|
3324
3325
|
i.start,
|
|
3325
3326
|
i.success
|
|
3326
3327
|
]
|
|
3327
|
-
), c =
|
|
3328
|
-
(
|
|
3329
|
-
var
|
|
3328
|
+
), c = O(
|
|
3329
|
+
(a) => {
|
|
3330
|
+
var C, L, B, v, w, A, I, E, z;
|
|
3330
3331
|
const x = n.request;
|
|
3331
3332
|
if (x.intent)
|
|
3332
3333
|
switch (n.queryKind) {
|
|
3333
3334
|
case "metric":
|
|
3334
|
-
return (
|
|
3335
|
+
return (C = a.executor) == null ? void 0 : C.executeMetric(
|
|
3335
3336
|
x.intent,
|
|
3336
|
-
|
|
3337
|
+
a
|
|
3337
3338
|
);
|
|
3338
3339
|
case "analysis":
|
|
3339
|
-
return (
|
|
3340
|
-
|
|
3340
|
+
return (B = (L = a.executor) == null ? void 0 : L.executeAnalysis) == null ? void 0 : B.call(
|
|
3341
|
+
L,
|
|
3341
3342
|
x.intent,
|
|
3342
|
-
|
|
3343
|
+
a,
|
|
3343
3344
|
x.analysisOptions
|
|
3344
3345
|
);
|
|
3345
3346
|
case "records":
|
|
3346
|
-
return (
|
|
3347
|
+
return (v = a.executor) == null ? void 0 : v.executeRecords(
|
|
3347
3348
|
x.intent,
|
|
3348
|
-
|
|
3349
|
+
a
|
|
3349
3350
|
);
|
|
3350
3351
|
case "inputOptions":
|
|
3351
|
-
return (
|
|
3352
|
+
return (w = a.executor) == null ? void 0 : w.executeInputOptions(
|
|
3352
3353
|
x.intent,
|
|
3353
|
-
|
|
3354
|
+
a
|
|
3354
3355
|
);
|
|
3355
3356
|
case "sql":
|
|
3356
|
-
return (
|
|
3357
|
+
return (I = (A = a.executor) == null ? void 0 : A.executeSql) == null ? void 0 : I.call(
|
|
3357
3358
|
A,
|
|
3358
3359
|
x.intent,
|
|
3359
|
-
|
|
3360
|
+
a
|
|
3360
3361
|
);
|
|
3361
3362
|
case "matrix":
|
|
3362
|
-
return (
|
|
3363
|
-
|
|
3363
|
+
return (z = (E = a.executor) == null ? void 0 : E.executeMatrix) == null ? void 0 : z.call(
|
|
3364
|
+
E,
|
|
3364
3365
|
x.intent,
|
|
3365
|
-
|
|
3366
|
+
a
|
|
3366
3367
|
);
|
|
3367
3368
|
default:
|
|
3368
|
-
return
|
|
3369
|
+
return ke(n);
|
|
3369
3370
|
}
|
|
3370
3371
|
},
|
|
3371
3372
|
[n]
|
|
@@ -3376,129 +3377,129 @@ function ai(e, r = {}) {
|
|
|
3376
3377
|
n.request.activeInputs,
|
|
3377
3378
|
l
|
|
3378
3379
|
), f = i.queryId, m = i.validationFailure;
|
|
3379
|
-
|
|
3380
|
-
const
|
|
3381
|
-
if (!
|
|
3382
|
-
|
|
3380
|
+
K(() => {
|
|
3381
|
+
const a = n.request.error;
|
|
3382
|
+
if (!a) {
|
|
3383
|
+
d.current = null;
|
|
3383
3384
|
return;
|
|
3384
3385
|
}
|
|
3385
|
-
const x = `${f}:${
|
|
3386
|
-
|
|
3386
|
+
const x = `${f}:${a.message}`;
|
|
3387
|
+
d.current !== x && (d.current = x, m(a));
|
|
3387
3388
|
}, [
|
|
3388
3389
|
n.request.error,
|
|
3389
3390
|
n.request.queryKey,
|
|
3390
3391
|
f,
|
|
3391
3392
|
m
|
|
3392
3393
|
]);
|
|
3393
|
-
const y = n.request.error ? n.request.idleData : u.data, h = n.request.error ? "error" : u.status, g = !n.request.error && u.status === "loading", S = n.request.error || u.error,
|
|
3394
|
+
const y = n.request.error ? n.request.idleData : u.data, h = n.request.error ? "error" : u.status, g = !n.request.error && u.status === "loading", S = n.request.error || u.error, k = i.trace;
|
|
3394
3395
|
switch (n.queryKind) {
|
|
3395
3396
|
case "metric": {
|
|
3396
|
-
const
|
|
3397
|
+
const a = y;
|
|
3397
3398
|
return {
|
|
3398
3399
|
id: t.id,
|
|
3399
3400
|
intent: n.request.intent,
|
|
3400
|
-
value: (
|
|
3401
|
-
measures:
|
|
3402
|
-
comparisonValue:
|
|
3403
|
-
delta:
|
|
3404
|
-
deltaPercent:
|
|
3405
|
-
records:
|
|
3406
|
-
executionResult:
|
|
3401
|
+
value: (a == null ? void 0 : a.value) ?? null,
|
|
3402
|
+
measures: a == null ? void 0 : a.measures,
|
|
3403
|
+
comparisonValue: a == null ? void 0 : a.comparisonValue,
|
|
3404
|
+
delta: a == null ? void 0 : a.delta,
|
|
3405
|
+
deltaPercent: a == null ? void 0 : a.deltaPercent,
|
|
3406
|
+
records: a == null ? void 0 : a.records,
|
|
3407
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3407
3408
|
status: h,
|
|
3408
3409
|
isLoading: g,
|
|
3409
3410
|
error: S,
|
|
3410
|
-
trace:
|
|
3411
|
+
trace: k
|
|
3411
3412
|
};
|
|
3412
3413
|
}
|
|
3413
3414
|
case "analysis": {
|
|
3414
|
-
const
|
|
3415
|
+
const a = Ir(y);
|
|
3415
3416
|
return {
|
|
3416
3417
|
id: t.id,
|
|
3417
3418
|
intent: n.request.intent,
|
|
3418
|
-
...
|
|
3419
|
+
...a || {},
|
|
3419
3420
|
status: h,
|
|
3420
3421
|
isLoading: g,
|
|
3421
3422
|
error: S,
|
|
3422
|
-
trace:
|
|
3423
|
+
trace: k
|
|
3423
3424
|
};
|
|
3424
3425
|
}
|
|
3425
3426
|
case "records": {
|
|
3426
|
-
const
|
|
3427
|
+
const a = y;
|
|
3427
3428
|
return {
|
|
3428
3429
|
id: t.id,
|
|
3429
3430
|
intent: n.request.intent,
|
|
3430
|
-
records: (
|
|
3431
|
-
columns:
|
|
3432
|
-
rowCount:
|
|
3433
|
-
pagination:
|
|
3434
|
-
executionResult:
|
|
3431
|
+
records: (a == null ? void 0 : a.records) || [],
|
|
3432
|
+
columns: a == null ? void 0 : a.columns,
|
|
3433
|
+
rowCount: a == null ? void 0 : a.rowCount,
|
|
3434
|
+
pagination: a == null ? void 0 : a.pagination,
|
|
3435
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3435
3436
|
status: h,
|
|
3436
3437
|
isLoading: g,
|
|
3437
3438
|
error: S,
|
|
3438
|
-
trace:
|
|
3439
|
+
trace: k
|
|
3439
3440
|
};
|
|
3440
3441
|
}
|
|
3441
3442
|
case "inputOptions": {
|
|
3442
|
-
const
|
|
3443
|
+
const a = y;
|
|
3443
3444
|
return {
|
|
3444
3445
|
id: t.id,
|
|
3445
3446
|
intent: n.request.intent,
|
|
3446
|
-
options: (
|
|
3447
|
-
executionResult:
|
|
3447
|
+
options: (a == null ? void 0 : a.options) || [],
|
|
3448
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3448
3449
|
status: h,
|
|
3449
3450
|
isLoading: g,
|
|
3450
3451
|
error: S,
|
|
3451
|
-
trace:
|
|
3452
|
+
trace: k
|
|
3452
3453
|
};
|
|
3453
3454
|
}
|
|
3454
3455
|
case "sql": {
|
|
3455
|
-
const
|
|
3456
|
+
const a = y;
|
|
3456
3457
|
return {
|
|
3457
3458
|
id: t.id,
|
|
3458
3459
|
intent: n.request.intent,
|
|
3459
|
-
records: (
|
|
3460
|
-
columns:
|
|
3461
|
-
rowCount:
|
|
3462
|
-
pagination:
|
|
3463
|
-
output:
|
|
3464
|
-
rowLimitExceeded:
|
|
3465
|
-
executionResult:
|
|
3460
|
+
records: (a == null ? void 0 : a.records) || [],
|
|
3461
|
+
columns: a == null ? void 0 : a.columns,
|
|
3462
|
+
rowCount: a == null ? void 0 : a.rowCount,
|
|
3463
|
+
pagination: a == null ? void 0 : a.pagination,
|
|
3464
|
+
output: a == null ? void 0 : a.output,
|
|
3465
|
+
rowLimitExceeded: a == null ? void 0 : a.rowLimitExceeded,
|
|
3466
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3466
3467
|
status: h,
|
|
3467
3468
|
isLoading: g,
|
|
3468
3469
|
error: S,
|
|
3469
|
-
trace:
|
|
3470
|
+
trace: k
|
|
3470
3471
|
};
|
|
3471
3472
|
}
|
|
3472
3473
|
case "matrix": {
|
|
3473
|
-
const
|
|
3474
|
+
const a = y;
|
|
3474
3475
|
return {
|
|
3475
3476
|
id: t.id,
|
|
3476
3477
|
intent: n.request.intent,
|
|
3477
|
-
matrixResult:
|
|
3478
|
-
grid:
|
|
3479
|
-
expansion:
|
|
3480
|
-
executionResult:
|
|
3478
|
+
matrixResult: a == null ? void 0 : a.matrixResult,
|
|
3479
|
+
grid: a == null ? void 0 : a.grid,
|
|
3480
|
+
expansion: a == null ? void 0 : a.expansion,
|
|
3481
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3481
3482
|
status: h,
|
|
3482
3483
|
isLoading: g,
|
|
3483
3484
|
error: S,
|
|
3484
|
-
trace:
|
|
3485
|
+
trace: k
|
|
3485
3486
|
};
|
|
3486
3487
|
}
|
|
3487
3488
|
default:
|
|
3488
|
-
return
|
|
3489
|
+
return ke(n);
|
|
3489
3490
|
}
|
|
3490
3491
|
}
|
|
3491
3492
|
function Pn(e, r, t, n, i) {
|
|
3492
|
-
const
|
|
3493
|
+
const d = Bn(), l = D(r), c = D(n), [u, f] = V({
|
|
3493
3494
|
status: "idle",
|
|
3494
3495
|
data: t,
|
|
3495
3496
|
error: null
|
|
3496
3497
|
});
|
|
3497
|
-
return l.current = r, c.current = n,
|
|
3498
|
+
return l.current = r, c.current = n, K(() => {
|
|
3498
3499
|
let m;
|
|
3499
3500
|
try {
|
|
3500
3501
|
m = l.current({
|
|
3501
|
-
...
|
|
3502
|
+
...d,
|
|
3502
3503
|
activeInputs: c.current
|
|
3503
3504
|
});
|
|
3504
3505
|
} catch (g) {
|
|
@@ -3514,7 +3515,7 @@ function Pn(e, r, t, n, i) {
|
|
|
3514
3515
|
return;
|
|
3515
3516
|
}
|
|
3516
3517
|
let y = !1;
|
|
3517
|
-
const h =
|
|
3518
|
+
const h = Ar();
|
|
3518
3519
|
return i == null || i.start(), f((g) => ({
|
|
3519
3520
|
status: "loading",
|
|
3520
3521
|
data: g.data,
|
|
@@ -3530,26 +3531,26 @@ function Pn(e, r, t, n, i) {
|
|
|
3530
3531
|
}), () => {
|
|
3531
3532
|
y = !0;
|
|
3532
3533
|
};
|
|
3533
|
-
}, [t, e,
|
|
3534
|
+
}, [t, e, d, i]), u;
|
|
3534
3535
|
}
|
|
3535
|
-
function
|
|
3536
|
+
function Ar() {
|
|
3536
3537
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3537
3538
|
}
|
|
3538
3539
|
function tr(e) {
|
|
3539
|
-
return Math.max(0, Math.round(
|
|
3540
|
+
return Math.max(0, Math.round(Ar() - e));
|
|
3540
3541
|
}
|
|
3541
|
-
function
|
|
3542
|
+
function Qn(e) {
|
|
3542
3543
|
return Object.fromEntries(
|
|
3543
3544
|
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
3544
3545
|
);
|
|
3545
3546
|
}
|
|
3546
|
-
function
|
|
3547
|
+
function ke(e) {
|
|
3547
3548
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3548
3549
|
}
|
|
3549
|
-
function
|
|
3550
|
+
function Vn(e) {
|
|
3550
3551
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3551
3552
|
}
|
|
3552
|
-
function
|
|
3553
|
+
function ui({
|
|
3553
3554
|
token: e,
|
|
3554
3555
|
apiBaseUrl: r,
|
|
3555
3556
|
executor: t,
|
|
@@ -3557,7 +3558,7 @@ function di({
|
|
|
3557
3558
|
children: i
|
|
3558
3559
|
}) {
|
|
3559
3560
|
var g;
|
|
3560
|
-
const
|
|
3561
|
+
const d = On(), l = ((g = d == null ? void 0 : d.authToken) == null ? void 0 : g.accessToken) || e, c = (d == null ? void 0 : d.dataApiBaseUrl) || (d == null ? void 0 : d.apiBaseUrl) || r, u = (d == null ? void 0 : d.debug) ?? n, f = Vn(u), m = b(() => In(), []), y = t || m, h = b(
|
|
3561
3562
|
() => ({
|
|
3562
3563
|
token: l,
|
|
3563
3564
|
apiBaseUrl: c,
|
|
@@ -3566,24 +3567,24 @@ function di({
|
|
|
3566
3567
|
}),
|
|
3567
3568
|
[c, u, y, l]
|
|
3568
3569
|
);
|
|
3569
|
-
return /* @__PURE__ */ o(
|
|
3570
|
+
return /* @__PURE__ */ o(Ur, { debug: u, children: /* @__PURE__ */ p(Rr.Provider, { value: h, children: [
|
|
3570
3571
|
i,
|
|
3571
|
-
f ? /* @__PURE__ */ o(
|
|
3572
|
+
f ? /* @__PURE__ */ o(Yr, { ...f }) : null
|
|
3572
3573
|
] }) });
|
|
3573
3574
|
}
|
|
3574
3575
|
export {
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3576
|
+
ui as SemaphorDataAppProvider,
|
|
3577
|
+
Yr as SemaphorDevtools,
|
|
3578
|
+
oi as SemaphorDevtoolsInspectButton,
|
|
3579
|
+
ii as SemaphorViewBoundary,
|
|
3580
|
+
In as createSemaphorQueryExecutor,
|
|
3581
|
+
ri as defineSemaphorDataApp,
|
|
3582
|
+
ti as defineSemaphorInput,
|
|
3583
|
+
Mn as isSemaphorInputValueValidForOptions,
|
|
3584
|
+
ni as semaphor,
|
|
3585
|
+
di as useClearInvalidSemaphorInputValue,
|
|
3586
|
+
lr as useSemaphorDevtools,
|
|
3587
|
+
si as useSemaphorInput,
|
|
3588
|
+
ai as useSemaphorInputs,
|
|
3589
|
+
li as useSemaphorQuery
|
|
3589
3590
|
};
|