react-semaphor 0.1.390 → 0.1.392
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +120 -252
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +1585 -0
- package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +1 -0
- package/dist/chunks/{braces--20GzUQh.js → braces-8TRlDwDw.js} +1 -1
- package/dist/chunks/{braces-C0Vh_Mft.js → braces-D2tStQjF.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-B-VsxhsA.js → calendar-preferences-dialog-49fcEPXS.js} +4 -4
- package/dist/chunks/{calendar-preferences-dialog-DE67Z3oQ.js → calendar-preferences-dialog-DwLeBLy2.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-CgkSKkZR.js +80 -0
- package/dist/chunks/{dashboard-briefing-launcher-BIj3X7b3.js → dashboard-briefing-launcher-cgPKz1yX.js} +252 -252
- package/dist/chunks/dashboard-controls-D12ZSUP_.js +52 -0
- package/dist/chunks/{dashboard-controls-BXxucM4f.js → dashboard-controls-VMFm3OP4.js} +87 -87
- package/dist/chunks/{dashboard-json-C6oZuipD.js → dashboard-json-C-GG5yC7.js} +4 -4
- package/dist/chunks/{dashboard-json-BNwshkK2.js → dashboard-json-CvK0oI24.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CmfrI_L3.js → edit-dashboard-visual-B5KB7dx4.js} +977 -977
- package/dist/chunks/edit-dashboard-visual-ql99faTz.js +178 -0
- package/dist/chunks/{index-icb12JV1.js → index-CQmKDEbe.js} +735 -741
- package/dist/chunks/{index-4W_ElSBJ.js → index-DXCBPLDu.js} +218 -223
- package/dist/chunks/{layout-grid-B7-klXiK.js → layout-grid-C0OI-MRn.js} +1 -1
- package/dist/chunks/{layout-grid-DV89AC9_.js → layout-grid-CiubineE.js} +1 -1
- package/dist/chunks/{palette-Dj-dgPYh.js → palette-C4KTXOug.js} +1 -1
- package/dist/chunks/{palette-5IwhMbSF.js → palette-Cp1hqZtm.js} +1 -1
- package/dist/chunks/{save-C5fwVdTF.js → save-C__QggEE.js} +1 -1
- package/dist/chunks/{save-16C6YSW2.js → save-DgMfP0j8.js} +1 -1
- package/dist/chunks/{search-0LmWwZzW.js → search-BHsQIWBV.js} +17 -7
- package/dist/chunks/{search-Dq1Mbb03.js → search-DNCejM7Z.js} +9 -4
- package/dist/chunks/source-identity-uMaUe036.js +1 -0
- package/dist/chunks/{source-identity-CN4xiyKJ.js → source-identity-y0VSSreA.js} +33 -15
- package/dist/chunks/{switch-bdJp0Bkw.js → switch-B79Hn4Qh.js} +27 -32
- package/dist/chunks/{switch-DUdaHFZQ.js → switch-BXQAlSuW.js} +637 -647
- package/dist/chunks/use-create-flow-overlay-state-7MFN3PWX.js +21 -0
- package/dist/chunks/{use-create-flow-overlay-state-YvqCp6Zo.js → use-create-flow-overlay-state-Bw5LRkf9.js} +93 -92
- package/dist/chunks/{validators-CHPH6ORs.js → validators-4EGCWWga.js} +1 -1
- package/dist/chunks/{validators-lWo8m0Q7.js → validators-CPtkrola.js} +1 -1
- package/dist/chunks/{x-B_cx7LwM.js → x-B6ghREd2.js} +10 -5
- package/dist/chunks/{x-IdR_js6f.js → x-CXDkqdur.js} +28 -18
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +3 -3
- package/dist/data-app-builder/index.cjs +13 -13
- package/dist/data-app-builder/index.js +11 -11
- package/dist/data-app-sdk/index.cjs +5 -5
- package/dist/data-app-sdk/index.js +1698 -1121
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +6 -7
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +2107 -43
- package/dist/types/dashboard-assistant.d.ts +3 -1
- package/dist/types/data-app-sdk-adapters.d.ts +1 -1
- package/dist/types/data-app-sdk-validation.d.ts +4 -2
- package/dist/types/data-app-sdk.d.ts +73 -5
- package/package.json +2 -1
- package/src/data-app-sdk/README.md +55 -0
- package/dist/chunks/analyze-result-contract-CtXfp3nv.js +0 -1
- package/dist/chunks/analyze-result-contract-DuhlklhI.js +0 -102
- package/dist/chunks/dashboard-briefing-launcher-Czx6BcXW.js +0 -80
- package/dist/chunks/dashboard-controls-BP-DcPFs.js +0 -52
- package/dist/chunks/edit-dashboard-visual-BAprin3J.js +0 -178
- package/dist/chunks/source-identity-C-xaeE_I.js +0 -1
- package/dist/chunks/use-create-flow-overlay-state-BIHKf_XK.js +0 -21
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import "../chunks/
|
|
8
|
-
|
|
1
|
+
import { toSemaphorInputSnapshots as Nr, toSemaphorInputBinding as Fr, toSemaphorActiveInputSnapshots as Z, toSemaphorMatrixIntent as zr, toSemaphorSqlIntent as Mr, toSemaphorInputOptionsIntent as Hr, toSemaphorRecordsIntent as jr, toSemaphorAnalysisQueryOptions as Pr, toSemaphorAnalysisIntent as Qr, toSemaphorMetricIntent as Vr, hasSemaphorInputValue as ce, normalizeSemaphorInputOptions as cr, toSemaphorInputSpec as fr } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as pr, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as we, useContext as V, useState as M, useRef as D, useEffect as $, useMemo as w, Fragment as Ur, useId as gr, useCallback as O, useReducer as Gr } from "react";
|
|
4
|
+
import { a as Jr, m as Yr } from "../chunks/source-identity-y0VSSreA.js";
|
|
5
|
+
import "../chunks/analyze-result-contract-C9Gv2_qW.js";
|
|
6
|
+
import { M as Xr, a as Zr, S as et, E as rt, C as tt } from "../chunks/search-BHsQIWBV.js";
|
|
7
|
+
import { X as nt, C as it, j as ot } from "../chunks/x-CXDkqdur.js";
|
|
8
|
+
import { b as st } from "../chunks/validators-4EGCWWga.js";
|
|
9
|
+
function ge(e, r, t = {}) {
|
|
9
10
|
return {
|
|
10
11
|
...t,
|
|
11
12
|
name: e,
|
|
12
13
|
role: r
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function Ti(e) {
|
|
16
17
|
return e;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function Ci(e) {
|
|
19
20
|
return e;
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
+
const ki = {
|
|
22
23
|
source: {
|
|
23
24
|
semantic(e) {
|
|
24
25
|
return {
|
|
@@ -35,16 +36,16 @@ const ni = {
|
|
|
35
36
|
},
|
|
36
37
|
field: {
|
|
37
38
|
measure(e, r) {
|
|
38
|
-
return
|
|
39
|
+
return ge(e, "measure", r);
|
|
39
40
|
},
|
|
40
41
|
dimension(e, r) {
|
|
41
|
-
return
|
|
42
|
+
return ge(e, "dimension", r);
|
|
42
43
|
},
|
|
43
44
|
date(e, r) {
|
|
44
|
-
return
|
|
45
|
+
return ge(e, "date", r);
|
|
45
46
|
},
|
|
46
47
|
id(e, r) {
|
|
47
|
-
return
|
|
48
|
+
return ge(e, "id", r);
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
filter(e) {
|
|
@@ -56,7 +57,7 @@ const ni = {
|
|
|
56
57
|
bindInput(e, r) {
|
|
57
58
|
return {
|
|
58
59
|
toAnalyticsInput() {
|
|
59
|
-
const [t] =
|
|
60
|
+
const [t] = Nr([e]), n = Fr({
|
|
60
61
|
...r,
|
|
61
62
|
inputId: r.inputId || t.inputId
|
|
62
63
|
});
|
|
@@ -128,289 +129,320 @@ const ni = {
|
|
|
128
129
|
queryKind: "matrix"
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
|
-
},
|
|
132
|
+
}, Te = 10, Ce = 100, at = 25, dt = 500, mr = {
|
|
132
133
|
enabled: !1,
|
|
133
134
|
queries: [],
|
|
135
|
+
issues: [],
|
|
134
136
|
getQuery: () => {
|
|
135
137
|
},
|
|
136
138
|
getQueries: () => []
|
|
137
|
-
},
|
|
139
|
+
}, ze = we(null), Me = we(null), He = we(
|
|
138
140
|
void 0
|
|
139
|
-
),
|
|
140
|
-
function
|
|
141
|
+
), Q = [];
|
|
142
|
+
function lt({
|
|
141
143
|
debug: e,
|
|
142
144
|
children: r
|
|
143
145
|
}) {
|
|
144
|
-
const t =
|
|
145
|
-
|
|
146
|
+
const t = w(() => vn(e), [e]), [n, i] = Gr(
|
|
147
|
+
dn,
|
|
146
148
|
t,
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
|
|
149
|
+
Cr
|
|
150
|
+
), o = D(n), u = gr(), [f, d] = M({ open: !1 });
|
|
151
|
+
o.current = n, $(() => {
|
|
150
152
|
i({ type: "config", config: t });
|
|
151
|
-
}, [t]),
|
|
153
|
+
}, [t]), $(() => {
|
|
152
154
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
155
|
return;
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
ownerId:
|
|
157
|
-
bridge:
|
|
156
|
+
const b = gn(() => o.current);
|
|
157
|
+
return ut({
|
|
158
|
+
ownerId: u,
|
|
159
|
+
bridge: b
|
|
158
160
|
}), () => {
|
|
159
|
-
|
|
161
|
+
ct(u);
|
|
160
162
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
166
|
-
}, []),
|
|
167
|
-
|
|
168
|
-
}, []), g =
|
|
163
|
+
}, [u, n.enabled, n.exposeWindowBridge]);
|
|
164
|
+
const c = w(() => ({ state: n, dispatch: i }), [n]), m = O((b) => {
|
|
165
|
+
d({ open: !0, focus: b });
|
|
166
|
+
}, []), v = O(() => {
|
|
167
|
+
d((b) => ({ ...b, open: !1 }));
|
|
168
|
+
}, []), S = O((b) => {
|
|
169
|
+
d({ open: !0, focus: b });
|
|
170
|
+
}, []), g = w(
|
|
169
171
|
() => ({
|
|
170
|
-
open:
|
|
171
|
-
focus:
|
|
172
|
+
open: f.open,
|
|
173
|
+
focus: f.focus,
|
|
172
174
|
openDevtools: m,
|
|
173
|
-
closeDevtools:
|
|
174
|
-
focusTrace:
|
|
175
|
+
closeDevtools: v,
|
|
176
|
+
focusTrace: S
|
|
175
177
|
}),
|
|
176
178
|
[
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
v,
|
|
180
|
+
S,
|
|
179
181
|
m,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
f.focus,
|
|
183
|
+
f.open
|
|
182
184
|
]
|
|
183
185
|
);
|
|
184
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ a(ze.Provider, { value: c, children: /* @__PURE__ */ a(Me.Provider, { value: g, children: r }) });
|
|
185
187
|
}
|
|
186
|
-
function
|
|
187
|
-
const r =
|
|
188
|
+
function ut(e) {
|
|
189
|
+
const r = Q.findIndex(
|
|
188
190
|
(t) => t.ownerId === e.ownerId
|
|
189
191
|
);
|
|
190
|
-
r >= 0 &&
|
|
192
|
+
r >= 0 && Q.splice(r, 1), Q.push(e), yr();
|
|
191
193
|
}
|
|
192
|
-
function
|
|
193
|
-
const r =
|
|
194
|
+
function ct(e) {
|
|
195
|
+
const r = Q.findIndex(
|
|
194
196
|
(t) => t.ownerId === e
|
|
195
197
|
);
|
|
196
|
-
r >= 0 &&
|
|
198
|
+
r >= 0 && Q.splice(r, 1), yr();
|
|
197
199
|
}
|
|
198
|
-
function
|
|
200
|
+
function yr() {
|
|
199
201
|
if (typeof window > "u")
|
|
200
202
|
return;
|
|
201
|
-
const e =
|
|
203
|
+
const e = Q[Q.length - 1];
|
|
202
204
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function Ri({
|
|
205
207
|
id: e,
|
|
206
208
|
title: r,
|
|
207
209
|
children: t
|
|
208
210
|
}) {
|
|
209
|
-
const n =
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
+
const n = w(() => ({ id: e, title: r }), [e, r]);
|
|
212
|
+
return /* @__PURE__ */ a(He.Provider, { value: n, children: t });
|
|
211
213
|
}
|
|
212
|
-
function
|
|
214
|
+
function ft({
|
|
213
215
|
buttonPosition: e = "bottom-right",
|
|
214
216
|
initialIsOpen: r = !1,
|
|
215
217
|
panelPosition: t = "right",
|
|
216
218
|
className: n,
|
|
217
219
|
style: i
|
|
218
220
|
} = {}) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}, []),
|
|
223
|
-
r &&
|
|
224
|
-
}, [r,
|
|
225
|
-
if (!k || !
|
|
221
|
+
const o = hr(), u = V(Me), [f, d] = M(""), [c, m] = M(!1), v = D(null), S = D(null), g = u == null ? void 0 : u.openDevtools, b = u == null ? void 0 : u.closeDevtools, k = (u == null ? void 0 : u.open) === !0;
|
|
222
|
+
$(() => {
|
|
223
|
+
Tr();
|
|
224
|
+
}, []), $(() => {
|
|
225
|
+
r && o.enabled && (g == null || g());
|
|
226
|
+
}, [r, o.enabled, g]), $(() => {
|
|
227
|
+
if (!k || !b)
|
|
226
228
|
return;
|
|
227
|
-
const
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
|
|
229
|
+
const h = (I) => {
|
|
230
|
+
var q, A;
|
|
231
|
+
const R = I.target;
|
|
232
|
+
R instanceof Node && ((q = v.current) != null && q.contains(R) || (A = S.current) != null && A.contains(R) || b());
|
|
231
233
|
};
|
|
232
|
-
return document.addEventListener("pointerdown",
|
|
233
|
-
document.removeEventListener("pointerdown",
|
|
234
|
+
return document.addEventListener("pointerdown", h, !0), document.addEventListener("mousedown", h, !0), document.addEventListener("click", h, !0), () => {
|
|
235
|
+
document.removeEventListener("pointerdown", h, !0), document.removeEventListener("mousedown", h, !0), document.removeEventListener("click", h, !0);
|
|
234
236
|
};
|
|
235
|
-
}, [
|
|
236
|
-
const
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
() =>
|
|
247
|
-
[
|
|
237
|
+
}, [b, k]);
|
|
238
|
+
const l = w(
|
|
239
|
+
() => Lt(o.queries),
|
|
240
|
+
[o.queries]
|
|
241
|
+
), y = w(
|
|
242
|
+
() => je(o.queries),
|
|
243
|
+
[o.queries]
|
|
244
|
+
), K = Ot(l), E = w(
|
|
245
|
+
() => Bt(o.queries, f),
|
|
246
|
+
[o.queries, f]
|
|
247
|
+
), W = w(
|
|
248
|
+
() => $t(E),
|
|
249
|
+
[E]
|
|
250
|
+
), L = w(
|
|
251
|
+
() => vr(E, u == null ? void 0 : u.focus) || E[0],
|
|
252
|
+
[E, u == null ? void 0 : u.focus]
|
|
248
253
|
);
|
|
249
|
-
return !
|
|
254
|
+
return !o.enabled || !u ? null : /* @__PURE__ */ p(pr, { children: [
|
|
250
255
|
/* @__PURE__ */ p(
|
|
251
256
|
"button",
|
|
252
257
|
{
|
|
253
|
-
ref:
|
|
258
|
+
ref: v,
|
|
254
259
|
type: "button",
|
|
255
260
|
"aria-label": "Open Semaphor Inspector",
|
|
256
|
-
title:
|
|
257
|
-
className: n ? `${
|
|
261
|
+
title: K,
|
|
262
|
+
className: n ? `${N} ${n}` : N,
|
|
258
263
|
style: {
|
|
259
264
|
...s.launcher,
|
|
260
|
-
...
|
|
261
|
-
|
|
265
|
+
...en(e),
|
|
266
|
+
...rn(l.severity),
|
|
262
267
|
...i
|
|
263
268
|
},
|
|
264
|
-
onClick: () =>
|
|
269
|
+
onClick: () => {
|
|
270
|
+
var I;
|
|
271
|
+
const h = (I = y[0]) == null ? void 0 : I.trace;
|
|
272
|
+
u.openDevtools(
|
|
273
|
+
h ? {
|
|
274
|
+
traceId: h.traceId,
|
|
275
|
+
queryId: h.queryId,
|
|
276
|
+
viewId: h.viewId
|
|
277
|
+
} : void 0
|
|
278
|
+
);
|
|
279
|
+
},
|
|
265
280
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
|
|
269
|
-
|
|
281
|
+
/* @__PURE__ */ a(gt, {}),
|
|
282
|
+
/* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
|
|
283
|
+
l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
|
|
284
|
+
l.issueCount,
|
|
270
285
|
" issue",
|
|
271
|
-
|
|
286
|
+
l.issueCount === 1 ? "" : "s"
|
|
272
287
|
] }) : null
|
|
273
288
|
]
|
|
274
289
|
}
|
|
275
290
|
),
|
|
276
|
-
|
|
291
|
+
u.open ? /* @__PURE__ */ p(
|
|
277
292
|
"div",
|
|
278
293
|
{
|
|
279
|
-
ref:
|
|
294
|
+
ref: S,
|
|
280
295
|
role: "dialog",
|
|
281
296
|
"aria-label": "Semaphor Inspector",
|
|
282
297
|
"aria-modal": "false",
|
|
283
|
-
className:
|
|
298
|
+
className: N,
|
|
284
299
|
style: {
|
|
285
300
|
...s.panel,
|
|
286
|
-
...
|
|
287
|
-
...
|
|
301
|
+
...tn(t),
|
|
302
|
+
...c ? s.panelFullscreen : null
|
|
288
303
|
},
|
|
289
304
|
children: [
|
|
290
305
|
/* @__PURE__ */ p("div", { style: s.panelHeader, children: [
|
|
291
306
|
/* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
|
|
292
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ a("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
|
|
293
308
|
/* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
|
|
294
|
-
|
|
309
|
+
l.total,
|
|
295
310
|
" queries · ",
|
|
296
|
-
|
|
311
|
+
l.loading,
|
|
297
312
|
" loading ·",
|
|
298
313
|
" ",
|
|
299
|
-
|
|
300
|
-
" failed"
|
|
314
|
+
l.failed,
|
|
315
|
+
" failed · ",
|
|
316
|
+
l.errorCount,
|
|
317
|
+
" errors ·",
|
|
318
|
+
" ",
|
|
319
|
+
l.warningCount,
|
|
320
|
+
" warnings"
|
|
301
321
|
] })
|
|
302
322
|
] }),
|
|
303
323
|
/* @__PURE__ */ p("div", { style: s.panelActions, children: [
|
|
304
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ a(
|
|
305
325
|
"button",
|
|
306
326
|
{
|
|
307
327
|
type: "button",
|
|
308
|
-
"aria-label":
|
|
309
|
-
title:
|
|
328
|
+
"aria-label": c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
329
|
+
title: c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
310
330
|
style: s.iconButton,
|
|
311
|
-
onClick: () => m((
|
|
312
|
-
children:
|
|
331
|
+
onClick: () => m((h) => !h),
|
|
332
|
+
children: c ? /* @__PURE__ */ a(Xr, { size: 15 }) : /* @__PURE__ */ a(Zr, { size: 15 })
|
|
313
333
|
}
|
|
314
334
|
),
|
|
315
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ a(
|
|
316
336
|
"button",
|
|
317
337
|
{
|
|
318
338
|
type: "button",
|
|
319
339
|
"aria-label": "Close Semaphor Inspector",
|
|
320
340
|
style: s.iconButton,
|
|
321
|
-
onClick:
|
|
322
|
-
children: /* @__PURE__ */
|
|
341
|
+
onClick: u.closeDevtools,
|
|
342
|
+
children: /* @__PURE__ */ a(nt, { size: 15 })
|
|
323
343
|
}
|
|
324
344
|
)
|
|
325
345
|
] })
|
|
326
346
|
] }),
|
|
327
347
|
/* @__PURE__ */ p("label", { style: s.searchBox, children: [
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ a(et, { size: 14 }),
|
|
349
|
+
/* @__PURE__ */ a(
|
|
330
350
|
"input",
|
|
331
351
|
{
|
|
332
352
|
"aria-label": "Search Semaphor traces",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (
|
|
353
|
+
value: f,
|
|
354
|
+
onChange: (h) => d(h.currentTarget.value),
|
|
335
355
|
placeholder: "Search traces",
|
|
336
356
|
style: s.searchInput
|
|
337
357
|
}
|
|
338
358
|
)
|
|
339
359
|
] }),
|
|
360
|
+
y.length ? /* @__PURE__ */ a(
|
|
361
|
+
yt,
|
|
362
|
+
{
|
|
363
|
+
issues: y,
|
|
364
|
+
onSelect: (h) => u.focusTrace({
|
|
365
|
+
traceId: h.traceId,
|
|
366
|
+
queryId: h.queryId,
|
|
367
|
+
viewId: h.viewId
|
|
368
|
+
})
|
|
369
|
+
}
|
|
370
|
+
) : null,
|
|
340
371
|
/* @__PURE__ */ p(
|
|
341
372
|
"div",
|
|
342
373
|
{
|
|
343
374
|
style: {
|
|
344
375
|
...s.panelBody,
|
|
345
|
-
...
|
|
376
|
+
...nn(t)
|
|
346
377
|
},
|
|
347
378
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ a(
|
|
349
380
|
"div",
|
|
350
381
|
{
|
|
351
382
|
style: {
|
|
352
383
|
...s.queryList,
|
|
353
|
-
...
|
|
384
|
+
...on()
|
|
354
385
|
},
|
|
355
386
|
"aria-label": "Registered queries",
|
|
356
|
-
children:
|
|
387
|
+
children: E.length ? W.map((h) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
|
|
357
388
|
/* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ a("span", { children: h.title }),
|
|
390
|
+
/* @__PURE__ */ a("span", { style: s.queryGroupCount, children: h.traces.length })
|
|
360
391
|
] }),
|
|
361
|
-
|
|
362
|
-
var
|
|
363
|
-
const
|
|
392
|
+
h.traces.length ? h.traces.map((I) => {
|
|
393
|
+
var ie;
|
|
394
|
+
const R = br(I, L), q = qe(I), A = wr(I), U = qr(I), te = _t(I, q, U), ne = te.join(" · "), T = Sr(A), H = Dt(y, I);
|
|
364
395
|
return /* @__PURE__ */ p(
|
|
365
396
|
"button",
|
|
366
397
|
{
|
|
367
398
|
type: "button",
|
|
368
|
-
title: `${
|
|
399
|
+
title: `${q} · ${A} · ${ne}`,
|
|
369
400
|
style: {
|
|
370
401
|
...s.queryListItem,
|
|
371
|
-
...
|
|
402
|
+
...R ? s.queryListItemSelected : null
|
|
372
403
|
},
|
|
373
|
-
onClick: () =>
|
|
374
|
-
traceId:
|
|
375
|
-
queryId:
|
|
376
|
-
viewId:
|
|
404
|
+
onClick: () => u.focusTrace({
|
|
405
|
+
traceId: I.traceId,
|
|
406
|
+
queryId: I.queryId,
|
|
407
|
+
viewId: I.viewId
|
|
377
408
|
}),
|
|
378
409
|
children: [
|
|
379
410
|
/* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ a(ht, { status: (ie = I.latestAttempt) == null ? void 0 : ie.status }),
|
|
412
|
+
/* @__PURE__ */ a("span", { style: s.queryListTitle, title: q, children: q }),
|
|
413
|
+
/* @__PURE__ */ a(
|
|
383
414
|
"span",
|
|
384
415
|
{
|
|
385
416
|
style: {
|
|
386
417
|
...s.queryListKindChip,
|
|
387
|
-
...
|
|
418
|
+
...Ir(T)
|
|
388
419
|
},
|
|
389
|
-
children:
|
|
420
|
+
children: A
|
|
390
421
|
}
|
|
391
|
-
)
|
|
422
|
+
),
|
|
423
|
+
H > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: H }) : null
|
|
392
424
|
] }),
|
|
393
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ a(
|
|
394
426
|
"span",
|
|
395
427
|
{
|
|
396
|
-
className: `${
|
|
428
|
+
className: `${N}-source`,
|
|
397
429
|
style: s.queryListSource,
|
|
398
|
-
title:
|
|
399
|
-
children:
|
|
400
|
-
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
] }, `${
|
|
430
|
+
title: ne,
|
|
431
|
+
children: te.map((oe, se) => /* @__PURE__ */ p(Ur, { children: [
|
|
432
|
+
se > 0 ? /* @__PURE__ */ a("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
|
|
433
|
+
/* @__PURE__ */ a("span", { children: oe })
|
|
434
|
+
] }, `${oe}:${se}`))
|
|
403
435
|
}
|
|
404
436
|
)
|
|
405
437
|
]
|
|
406
438
|
},
|
|
407
|
-
|
|
439
|
+
We(I)
|
|
408
440
|
);
|
|
409
|
-
}) : /* @__PURE__ */
|
|
410
|
-
] },
|
|
441
|
+
}) : /* @__PURE__ */ a("div", { style: s.queryGroupEmpty, children: "No input traces" })
|
|
442
|
+
] }, h.title)) : /* @__PURE__ */ a("div", { style: s.emptyState, children: "No matching traces" })
|
|
411
443
|
}
|
|
412
444
|
),
|
|
413
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ a(mt, { trace: L })
|
|
414
446
|
]
|
|
415
447
|
}
|
|
416
448
|
)
|
|
@@ -419,229 +451,229 @@ function Yr({
|
|
|
419
451
|
) : null
|
|
420
452
|
] });
|
|
421
453
|
}
|
|
422
|
-
function
|
|
454
|
+
function Di({
|
|
423
455
|
queryId: e,
|
|
424
456
|
viewId: r,
|
|
425
457
|
label: t,
|
|
426
458
|
className: n,
|
|
427
459
|
style: i
|
|
428
460
|
} = {}) {
|
|
429
|
-
var
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
|
|
461
|
+
var v, S;
|
|
462
|
+
const o = hr(), u = V(Me), f = V(He);
|
|
463
|
+
$(() => {
|
|
464
|
+
Tr();
|
|
433
465
|
}, []);
|
|
434
|
-
const
|
|
435
|
-
() =>
|
|
466
|
+
const d = r || (f == null ? void 0 : f.id), c = w(
|
|
467
|
+
() => Kt(o.queries, {
|
|
436
468
|
queryId: e,
|
|
437
|
-
viewId:
|
|
469
|
+
viewId: d
|
|
438
470
|
}),
|
|
439
471
|
[
|
|
440
|
-
|
|
472
|
+
o.queries,
|
|
441
473
|
e,
|
|
442
|
-
|
|
474
|
+
d
|
|
443
475
|
]
|
|
444
476
|
);
|
|
445
|
-
if (!
|
|
477
|
+
if (!o.enabled || !u || !c)
|
|
446
478
|
return null;
|
|
447
|
-
const m = t || `Inspect ${
|
|
479
|
+
const m = t || `Inspect ${Nt(c, !!e)}`;
|
|
448
480
|
return /* @__PURE__ */ p(
|
|
449
481
|
"button",
|
|
450
482
|
{
|
|
451
483
|
type: "button",
|
|
452
484
|
"aria-label": m,
|
|
453
485
|
title: m,
|
|
454
|
-
className: n ? `${
|
|
486
|
+
className: n ? `${N} ${n}` : N,
|
|
455
487
|
style: {
|
|
456
488
|
...s.inspectButton,
|
|
457
|
-
...
|
|
489
|
+
...sn((v = c.latestAttempt) == null ? void 0 : v.status),
|
|
458
490
|
...i
|
|
459
491
|
},
|
|
460
|
-
onClick: () =>
|
|
461
|
-
traceId:
|
|
462
|
-
queryId:
|
|
463
|
-
viewId:
|
|
492
|
+
onClick: () => u.openDevtools({
|
|
493
|
+
traceId: c.traceId,
|
|
494
|
+
queryId: c.queryId,
|
|
495
|
+
viewId: c.viewId
|
|
464
496
|
}),
|
|
465
497
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ a(rt, { size: 13 }),
|
|
499
|
+
/* @__PURE__ */ a("span", { style: s.inspectButtonText, children: ((S = c.latestAttempt) == null ? void 0 : S.status) || "idle" })
|
|
468
500
|
]
|
|
469
501
|
}
|
|
470
502
|
);
|
|
471
503
|
}
|
|
472
|
-
function
|
|
473
|
-
const e =
|
|
474
|
-
return !e || !e.state.enabled ?
|
|
504
|
+
function hr() {
|
|
505
|
+
const e = V(ze);
|
|
506
|
+
return !e || !e.state.enabled ? mr : le(e.state);
|
|
475
507
|
}
|
|
476
|
-
function
|
|
508
|
+
function pt({
|
|
477
509
|
spec: e,
|
|
478
510
|
queryKind: r,
|
|
479
511
|
queryKey: t,
|
|
480
512
|
intent: n,
|
|
481
513
|
activeInputs: i,
|
|
482
|
-
debug:
|
|
514
|
+
debug: o
|
|
483
515
|
}) {
|
|
484
|
-
const
|
|
516
|
+
const u = V(ze), f = V(He), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, m = Sn(e), v = e.label, S = w(
|
|
485
517
|
() => JSON.stringify(e),
|
|
486
518
|
[e]
|
|
487
|
-
), g =
|
|
519
|
+
), g = w(
|
|
488
520
|
() => JSON.stringify(i || []),
|
|
489
521
|
[i]
|
|
490
|
-
),
|
|
522
|
+
), b = w(
|
|
491
523
|
() => JSON.stringify(n || null),
|
|
492
524
|
[n]
|
|
493
|
-
), k = D(e),
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
() => m || `query_${
|
|
525
|
+
), k = D(e), l = D(S), y = D(n), K = D(b), E = D(i), W = D(g), L = bn(o), h = JSON.stringify(L || []), I = D(L), R = D(h);
|
|
526
|
+
l.current !== S && (l.current = S, k.current = e), K.current !== b && (K.current = b, y.current = n), W.current !== g && (W.current = g, E.current = i), R.current !== h && (R.current = h, I.current = L);
|
|
527
|
+
const q = k.current, A = y.current, U = E.current, te = I.current, ne = gr(), T = w(
|
|
528
|
+
() => m || `query_${Lr(t)}`,
|
|
497
529
|
[t, m]
|
|
498
|
-
), H = (
|
|
530
|
+
), H = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ie = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), oe = o == null ? void 0 : o.visualType, se = o == null ? void 0 : o.sectionTitle, j = w(
|
|
499
531
|
() => [
|
|
500
532
|
H || "unscoped-view",
|
|
501
|
-
|
|
502
|
-
|
|
533
|
+
T,
|
|
534
|
+
ne
|
|
503
535
|
].join("::"),
|
|
504
|
-
[
|
|
505
|
-
),
|
|
536
|
+
[T, ne, H]
|
|
537
|
+
), Ge = w(
|
|
506
538
|
() => ({
|
|
507
|
-
traceKey:
|
|
508
|
-
spec:
|
|
509
|
-
queryId:
|
|
510
|
-
queryLabel:
|
|
539
|
+
traceKey: j,
|
|
540
|
+
spec: q,
|
|
541
|
+
queryId: T,
|
|
542
|
+
queryLabel: v,
|
|
511
543
|
queryKind: r,
|
|
512
|
-
builder:
|
|
544
|
+
builder: In(r),
|
|
513
545
|
viewId: H,
|
|
514
|
-
viewTitle:
|
|
515
|
-
visualType:
|
|
516
|
-
sectionTitle:
|
|
517
|
-
sourceHints:
|
|
518
|
-
intent:
|
|
519
|
-
activeInputs:
|
|
546
|
+
viewTitle: ie,
|
|
547
|
+
visualType: oe,
|
|
548
|
+
sectionTitle: se,
|
|
549
|
+
sourceHints: te,
|
|
550
|
+
intent: A,
|
|
551
|
+
activeInputs: U,
|
|
520
552
|
clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
521
553
|
}),
|
|
522
554
|
[
|
|
523
|
-
|
|
555
|
+
T,
|
|
524
556
|
r,
|
|
525
557
|
m,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
558
|
+
v,
|
|
559
|
+
q,
|
|
560
|
+
U,
|
|
561
|
+
A,
|
|
562
|
+
te,
|
|
563
|
+
se,
|
|
564
|
+
j,
|
|
533
565
|
H,
|
|
534
|
-
|
|
535
|
-
|
|
566
|
+
ie,
|
|
567
|
+
oe
|
|
536
568
|
]
|
|
537
569
|
);
|
|
538
|
-
|
|
539
|
-
if (!(!
|
|
540
|
-
return
|
|
541
|
-
|
|
570
|
+
$(() => {
|
|
571
|
+
if (!(!d || !c))
|
|
572
|
+
return c({ type: "register", descriptor: Ge }), () => {
|
|
573
|
+
c({ type: "unregister", traceKey: j });
|
|
542
574
|
};
|
|
543
|
-
}, [
|
|
544
|
-
const
|
|
545
|
-
(
|
|
546
|
-
!
|
|
575
|
+
}, [Ge, c, d, j]);
|
|
576
|
+
const F = O(
|
|
577
|
+
(C, G) => {
|
|
578
|
+
!d || !c || c({ type: "event", traceKey: j, event: C, latestAttempt: G });
|
|
547
579
|
},
|
|
548
|
-
[
|
|
549
|
-
),
|
|
550
|
-
|
|
580
|
+
[c, d, j]
|
|
581
|
+
), Je = O(() => {
|
|
582
|
+
F(
|
|
551
583
|
{
|
|
552
584
|
type: "query_started",
|
|
553
|
-
queryId:
|
|
554
|
-
at:
|
|
585
|
+
queryId: T,
|
|
586
|
+
at: ve()
|
|
555
587
|
},
|
|
556
588
|
{ status: "loading" }
|
|
557
589
|
);
|
|
558
|
-
}, [
|
|
559
|
-
(
|
|
560
|
-
const
|
|
561
|
-
|
|
590
|
+
}, [F, T]), Ye = O(
|
|
591
|
+
(C, G) => {
|
|
592
|
+
const ae = dr(C), de = kn(C), _r = Rn(C);
|
|
593
|
+
F(
|
|
562
594
|
{
|
|
563
595
|
type: "query_succeeded",
|
|
564
|
-
queryId:
|
|
565
|
-
requestId:
|
|
566
|
-
at:
|
|
567
|
-
rowCount:
|
|
568
|
-
durationMs:
|
|
596
|
+
queryId: T,
|
|
597
|
+
requestId: ae,
|
|
598
|
+
at: ve(),
|
|
599
|
+
rowCount: de,
|
|
600
|
+
durationMs: G
|
|
569
601
|
},
|
|
570
602
|
{
|
|
571
|
-
requestId:
|
|
603
|
+
requestId: ae,
|
|
572
604
|
status: "success",
|
|
573
|
-
durationMs:
|
|
574
|
-
rowCount:
|
|
575
|
-
columnCount:
|
|
576
|
-
executionResult:
|
|
605
|
+
durationMs: G,
|
|
606
|
+
rowCount: de,
|
|
607
|
+
columnCount: _r,
|
|
608
|
+
executionResult: ar(C)
|
|
577
609
|
}
|
|
578
610
|
);
|
|
579
611
|
},
|
|
580
|
-
[
|
|
581
|
-
),
|
|
582
|
-
(
|
|
583
|
-
const
|
|
584
|
-
|
|
612
|
+
[F, T]
|
|
613
|
+
), pe = O(
|
|
614
|
+
(C, G) => {
|
|
615
|
+
const ae = dr(C), de = C instanceof Error ? C.message : String(C);
|
|
616
|
+
F(
|
|
585
617
|
{
|
|
586
618
|
type: "query_failed",
|
|
587
|
-
queryId:
|
|
588
|
-
requestId:
|
|
589
|
-
at:
|
|
590
|
-
errorMessage:
|
|
619
|
+
queryId: T,
|
|
620
|
+
requestId: ae,
|
|
621
|
+
at: ve(),
|
|
622
|
+
errorMessage: de
|
|
591
623
|
},
|
|
592
624
|
{
|
|
593
|
-
requestId:
|
|
625
|
+
requestId: ae,
|
|
594
626
|
status: "error",
|
|
595
|
-
durationMs:
|
|
596
|
-
errorMessage:
|
|
597
|
-
executionResult:
|
|
627
|
+
durationMs: G,
|
|
628
|
+
errorMessage: de,
|
|
629
|
+
executionResult: ar(C)
|
|
598
630
|
}
|
|
599
631
|
);
|
|
600
632
|
},
|
|
601
|
-
[
|
|
602
|
-
),
|
|
603
|
-
(
|
|
604
|
-
|
|
633
|
+
[F, T]
|
|
634
|
+
), Xe = O(
|
|
635
|
+
(C) => {
|
|
636
|
+
F(
|
|
605
637
|
{
|
|
606
638
|
type: "query_ignored_stale",
|
|
607
|
-
queryId:
|
|
608
|
-
at:
|
|
609
|
-
reason:
|
|
639
|
+
queryId: T,
|
|
640
|
+
at: ve(),
|
|
641
|
+
reason: C
|
|
610
642
|
}
|
|
611
643
|
);
|
|
612
644
|
},
|
|
613
|
-
[
|
|
614
|
-
),
|
|
615
|
-
(
|
|
616
|
-
|
|
645
|
+
[F, T]
|
|
646
|
+
), Ze = O(
|
|
647
|
+
(C) => {
|
|
648
|
+
pe(C, 0);
|
|
617
649
|
},
|
|
618
|
-
[
|
|
619
|
-
),
|
|
620
|
-
return
|
|
650
|
+
[pe]
|
|
651
|
+
), Ee = d ? u == null ? void 0 : u.state.entries[j] : void 0;
|
|
652
|
+
return w(
|
|
621
653
|
() => ({
|
|
622
|
-
enabled:
|
|
623
|
-
queryId:
|
|
624
|
-
trace:
|
|
625
|
-
start:
|
|
626
|
-
success:
|
|
627
|
-
failure:
|
|
628
|
-
ignored:
|
|
629
|
-
validationFailure:
|
|
654
|
+
enabled: d,
|
|
655
|
+
queryId: T,
|
|
656
|
+
trace: Ee ? be(Ee) : void 0,
|
|
657
|
+
start: Je,
|
|
658
|
+
success: Ye,
|
|
659
|
+
failure: pe,
|
|
660
|
+
ignored: Xe,
|
|
661
|
+
validationFailure: Ze
|
|
630
662
|
}),
|
|
631
663
|
[
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
664
|
+
d,
|
|
665
|
+
pe,
|
|
666
|
+
Xe,
|
|
667
|
+
T,
|
|
668
|
+
Je,
|
|
669
|
+
Ye,
|
|
670
|
+
Ee,
|
|
671
|
+
Ze
|
|
640
672
|
]
|
|
641
673
|
);
|
|
642
674
|
}
|
|
643
|
-
function
|
|
644
|
-
return /* @__PURE__ */
|
|
675
|
+
function gt() {
|
|
676
|
+
return /* @__PURE__ */ a("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
645
677
|
"svg",
|
|
646
678
|
{
|
|
647
679
|
viewBox: "0 0 100 100",
|
|
@@ -650,194 +682,263 @@ function Zr() {
|
|
|
650
682
|
height: "16",
|
|
651
683
|
focusable: "false",
|
|
652
684
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "15", width: "60", height: "12", rx: "6", fill: "currentColor" }),
|
|
686
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "35", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
687
|
+
/* @__PURE__ */ a("rect", { x: "40", y: "55", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
688
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "75", width: "60", height: "12", rx: "6", fill: "currentColor" })
|
|
657
689
|
]
|
|
658
690
|
}
|
|
659
691
|
) });
|
|
660
692
|
}
|
|
661
|
-
function
|
|
693
|
+
function mt({
|
|
662
694
|
trace: e
|
|
663
695
|
}) {
|
|
664
|
-
var L,
|
|
696
|
+
var W, L, h, I, R, q;
|
|
665
697
|
if (!e)
|
|
666
|
-
return /* @__PURE__ */
|
|
667
|
-
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n =
|
|
668
|
-
(
|
|
669
|
-
), i =
|
|
670
|
-
(
|
|
671
|
-
),
|
|
698
|
+
return /* @__PURE__ */ a("div", { style: s.detailsPane, children: /* @__PURE__ */ a("div", { style: s.emptyState, children: "No traces registered yet" }) });
|
|
699
|
+
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = Re(
|
|
700
|
+
(W = t == null ? void 0 : t.validation) == null ? void 0 : W.warnings
|
|
701
|
+
), i = Re((L = t == null ? void 0 : t.validation) == null ? void 0 : L.errors), o = xr(
|
|
702
|
+
(h = t == null ? void 0 : t.coverage) == null ? void 0 : h.missingObligations
|
|
703
|
+
), u = Re(
|
|
704
|
+
(I = t == null ? void 0 : t.coverage) == null ? void 0 : I.warnings
|
|
705
|
+
), f = t == null ? void 0 : t.compiledQuery, d = Zt(t), c = ((R = e.server) == null ? void 0 : R.compiledSql) || d.compiledSql, m = [
|
|
706
|
+
...r != null && r.errorMessage ? [r.errorMessage] : [],
|
|
707
|
+
...i
|
|
708
|
+
], v = [
|
|
672
709
|
...e.clientWarnings,
|
|
673
710
|
...n,
|
|
674
|
-
...
|
|
675
|
-
...
|
|
676
|
-
],
|
|
711
|
+
...o,
|
|
712
|
+
...u
|
|
713
|
+
], S = e.inputsApplied.length > 0, g = !!(f || c), b = Mt(e), k = Qt(r == null ? void 0 : r.rowCount), l = Vt(r == null ? void 0 : r.durationMs), y = e.sourceRefs.length, K = wr(e), E = Sr(K);
|
|
677
714
|
return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
|
|
678
715
|
/* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
|
|
679
716
|
/* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
|
|
680
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ a(
|
|
681
718
|
"span",
|
|
682
719
|
{
|
|
683
720
|
"aria-hidden": !0,
|
|
684
721
|
style: {
|
|
685
722
|
...s.detailsHeaderStatusDot,
|
|
686
|
-
...
|
|
723
|
+
...Er(r == null ? void 0 : r.status)
|
|
687
724
|
}
|
|
688
725
|
}
|
|
689
726
|
),
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ a("span", { style: s.detailsTitle, children: qe(e) }),
|
|
728
|
+
/* @__PURE__ */ a(
|
|
692
729
|
"span",
|
|
693
730
|
{
|
|
694
731
|
style: {
|
|
695
732
|
...s.detailsKindChip,
|
|
696
|
-
...
|
|
733
|
+
...Ir(E)
|
|
697
734
|
},
|
|
698
|
-
children:
|
|
735
|
+
children: K
|
|
699
736
|
}
|
|
700
737
|
)
|
|
701
738
|
] }),
|
|
702
739
|
/* @__PURE__ */ p("div", { style: s.metaStrip, children: [
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: b }),
|
|
741
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
705
742
|
/* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
|
|
706
|
-
|
|
743
|
+
k,
|
|
707
744
|
" rows"
|
|
708
745
|
] }),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
747
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: l }),
|
|
748
|
+
y > 0 ? /* @__PURE__ */ p(pr, { children: [
|
|
749
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
750
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: y === 1 ? "1 source" : `${y} sources` })
|
|
714
751
|
] }) : null
|
|
715
752
|
] })
|
|
716
753
|
] }),
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
(
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
754
|
+
m.length ? /* @__PURE__ */ a(er, { tone: "error", title: "Error", items: m }) : null,
|
|
755
|
+
v.length ? /* @__PURE__ */ a(er, { tone: "warning", title: "Warnings", items: v }) : null,
|
|
756
|
+
/* @__PURE__ */ a(vt, { trace: e }),
|
|
757
|
+
/* @__PURE__ */ a(It, { trace: e }),
|
|
758
|
+
(q = e.sourceHints) != null && q.length ? /* @__PURE__ */ a(wt, { hints: e.sourceHints }) : null,
|
|
759
|
+
S ? /* @__PURE__ */ a(Et, { inputs: e.inputsApplied }) : null,
|
|
760
|
+
g ? /* @__PURE__ */ a(ue, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ a(
|
|
761
|
+
Tt,
|
|
725
762
|
{
|
|
726
|
-
compiledQuery:
|
|
727
|
-
compiledSql:
|
|
763
|
+
compiledQuery: f,
|
|
764
|
+
compiledSql: c
|
|
728
765
|
}
|
|
729
766
|
) }) : null,
|
|
730
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ a(ue, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ a("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((A, U) => /* @__PURE__ */ p(
|
|
731
768
|
"div",
|
|
732
769
|
{
|
|
733
770
|
style: s.eventRow,
|
|
734
771
|
children: [
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ a("span", { style: s.eventType, children: Gt(A) }),
|
|
773
|
+
/* @__PURE__ */ a("span", { style: s.eventMeta, children: Jt(A) })
|
|
737
774
|
]
|
|
738
775
|
},
|
|
739
|
-
`${
|
|
740
|
-
)) }) : /* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
776
|
+
`${A.type}:${A.at}:${U}`
|
|
777
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.mutedText, children: "No attempts recorded" }) }),
|
|
778
|
+
/* @__PURE__ */ a(ue, { title: "Raw Trace", children: /* @__PURE__ */ a("pre", { style: s.codeBlock, children: Ut(e) }) })
|
|
742
779
|
] });
|
|
743
780
|
}
|
|
744
|
-
function
|
|
781
|
+
function er({
|
|
745
782
|
tone: e,
|
|
746
783
|
title: r,
|
|
747
784
|
items: t
|
|
748
785
|
}) {
|
|
749
786
|
const n = e === "error" ? s.alertCardError : s.alertCardWarning;
|
|
750
787
|
return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
t.length > 1 ? /* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ a("div", { style: s.alertCardTitle, children: r }),
|
|
789
|
+
t.length > 1 ? /* @__PURE__ */ a("ul", { style: s.alertCardList, children: t.map((i, o) => /* @__PURE__ */ a("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ a("div", { children: t[0] })
|
|
790
|
+
] });
|
|
791
|
+
}
|
|
792
|
+
function yt({
|
|
793
|
+
issues: e,
|
|
794
|
+
onSelect: r
|
|
795
|
+
}) {
|
|
796
|
+
const [t, n] = M(!1), i = e.slice(0, 6), o = e.length - i.length, u = e.filter((c) => c.tone === "error").length, f = e.length - u, d = [
|
|
797
|
+
u ? `${u} error${u === 1 ? "" : "s"}` : "",
|
|
798
|
+
f ? `${f} warning${f === 1 ? "" : "s"}` : ""
|
|
799
|
+
].filter(Boolean);
|
|
800
|
+
return /* @__PURE__ */ p("section", { style: s.issueSummary, "aria-label": "Semaphor trace issues", children: [
|
|
801
|
+
/* @__PURE__ */ p(
|
|
802
|
+
"button",
|
|
803
|
+
{
|
|
804
|
+
type: "button",
|
|
805
|
+
"aria-expanded": t,
|
|
806
|
+
style: s.issueSummaryToggle,
|
|
807
|
+
onClick: () => n((c) => !c),
|
|
808
|
+
children: [
|
|
809
|
+
/* @__PURE__ */ p("span", { style: s.issueSummaryHeaderLabel, children: [
|
|
810
|
+
t ? /* @__PURE__ */ a(it, { size: 13 }) : /* @__PURE__ */ a(tt, { size: 13 }),
|
|
811
|
+
/* @__PURE__ */ a("span", { children: "Issues" })
|
|
812
|
+
] }),
|
|
813
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryCount, children: e.length })
|
|
814
|
+
]
|
|
815
|
+
}
|
|
816
|
+
),
|
|
817
|
+
t ? /* @__PURE__ */ p("div", { style: s.issueSummaryList, children: [
|
|
818
|
+
i.map((c, m) => /* @__PURE__ */ p(
|
|
819
|
+
"button",
|
|
820
|
+
{
|
|
821
|
+
type: "button",
|
|
822
|
+
title: `${c.title}: ${c.message}`,
|
|
823
|
+
style: s.issueSummaryItem,
|
|
824
|
+
onClick: () => r(c.trace),
|
|
825
|
+
children: [
|
|
826
|
+
/* @__PURE__ */ a(
|
|
827
|
+
"span",
|
|
828
|
+
{
|
|
829
|
+
style: {
|
|
830
|
+
...s.issueSummaryBadge,
|
|
831
|
+
...c.tone === "error" ? s.issueSummaryBadgeError : s.issueSummaryBadgeWarning
|
|
832
|
+
},
|
|
833
|
+
children: c.tone === "error" ? "Error" : "Warning"
|
|
834
|
+
}
|
|
835
|
+
),
|
|
836
|
+
/* @__PURE__ */ p("span", { style: s.issueSummaryText, children: [
|
|
837
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryTitle, children: c.title }),
|
|
838
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryMessage, children: c.message })
|
|
839
|
+
] })
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
`${c.trace.traceId}:${c.title}:${m}`
|
|
843
|
+
)),
|
|
844
|
+
o > 0 ? /* @__PURE__ */ p("div", { style: s.issueSummaryMore, children: [
|
|
845
|
+
o,
|
|
846
|
+
" more issue",
|
|
847
|
+
o === 1 ? "" : "s",
|
|
848
|
+
" in traces"
|
|
849
|
+
] }) : null
|
|
850
|
+
] }) : /* @__PURE__ */ p("div", { style: s.issueSummaryCollapsed, children: [
|
|
851
|
+
d.join(" · "),
|
|
852
|
+
" across traces"
|
|
853
|
+
] })
|
|
753
854
|
] });
|
|
754
855
|
}
|
|
755
|
-
function
|
|
856
|
+
function ht({
|
|
756
857
|
status: e
|
|
757
858
|
}) {
|
|
758
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ a(
|
|
759
860
|
"span",
|
|
760
861
|
{
|
|
761
862
|
"aria-hidden": !0,
|
|
762
863
|
style: {
|
|
763
864
|
...s.statusDot,
|
|
764
|
-
...
|
|
865
|
+
...Er(e)
|
|
765
866
|
}
|
|
766
867
|
}
|
|
767
868
|
);
|
|
768
869
|
}
|
|
769
|
-
function
|
|
870
|
+
function ue({
|
|
770
871
|
title: e,
|
|
771
872
|
children: r,
|
|
772
873
|
defaultOpen: t = !1
|
|
773
874
|
}) {
|
|
774
|
-
const [n, i] =
|
|
875
|
+
const [n, i] = M(t);
|
|
775
876
|
return /* @__PURE__ */ p(
|
|
776
877
|
"details",
|
|
777
878
|
{
|
|
778
879
|
style: s.disclosure,
|
|
779
880
|
open: n,
|
|
780
|
-
onToggle: (
|
|
881
|
+
onToggle: (o) => i(o.currentTarget.open),
|
|
781
882
|
children: [
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ a("summary", { style: s.disclosureSummary, children: e }),
|
|
884
|
+
/* @__PURE__ */ a("div", { style: s.disclosureBody, children: r })
|
|
784
885
|
]
|
|
785
886
|
}
|
|
786
887
|
);
|
|
787
888
|
}
|
|
788
|
-
function
|
|
889
|
+
function vt({
|
|
789
890
|
trace: e
|
|
790
891
|
}) {
|
|
791
892
|
var i;
|
|
792
|
-
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n =
|
|
893
|
+
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = zt(r);
|
|
793
894
|
return /* @__PURE__ */ p("div", { style: s.recipe, children: [
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
|
|
895
|
+
/* @__PURE__ */ a(bt, { sources: e.sourceRefs }),
|
|
896
|
+
/* @__PURE__ */ a(P, { title: "Measures", fields: n.measures }),
|
|
897
|
+
/* @__PURE__ */ a(P, { title: "Time fields", fields: n.timeFields }),
|
|
898
|
+
/* @__PURE__ */ a(
|
|
899
|
+
P,
|
|
799
900
|
{
|
|
800
901
|
title: "Dimensions",
|
|
801
902
|
fields: n.dimensions,
|
|
802
903
|
emptyText: "No dimensions selected"
|
|
803
904
|
}
|
|
804
905
|
),
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ a(P, { title: "Identifiers", fields: n.identifiers }),
|
|
907
|
+
/* @__PURE__ */ a(P, { title: "Other fields", fields: n.other }),
|
|
908
|
+
/* @__PURE__ */ a(P, { title: "Input bindings", fields: t })
|
|
808
909
|
] });
|
|
809
910
|
}
|
|
810
|
-
function
|
|
911
|
+
function bt({
|
|
811
912
|
sources: e
|
|
812
913
|
}) {
|
|
813
914
|
return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
814
915
|
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "From" }),
|
|
917
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
|
|
817
918
|
] }),
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
|
|
919
|
+
/* @__PURE__ */ a("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ a(
|
|
920
|
+
St,
|
|
820
921
|
{
|
|
821
922
|
source: r
|
|
822
923
|
},
|
|
823
|
-
`${
|
|
924
|
+
`${z(r)}:${t}`
|
|
824
925
|
)) })
|
|
825
926
|
] }) : null;
|
|
826
927
|
}
|
|
827
|
-
function
|
|
828
|
-
const r =
|
|
928
|
+
function St({ source: e }) {
|
|
929
|
+
const r = z(e);
|
|
829
930
|
return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ a("span", { style: s.sourcePillLabel, children: r }),
|
|
932
|
+
/* @__PURE__ */ a("span", { style: s.sourcePillRole, children: e.kind })
|
|
832
933
|
] });
|
|
833
934
|
}
|
|
834
|
-
function
|
|
935
|
+
function It({
|
|
835
936
|
trace: e
|
|
836
937
|
}) {
|
|
837
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
|
|
938
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ a(ue, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
|
|
939
|
+
/* @__PURE__ */ a(qt, { sources: e.sourceRefs }),
|
|
940
|
+
/* @__PURE__ */ a(
|
|
941
|
+
P,
|
|
841
942
|
{
|
|
842
943
|
title: "All field refs",
|
|
843
944
|
fields: e.fieldRefs,
|
|
@@ -846,11 +947,11 @@ function ot({
|
|
|
846
947
|
)
|
|
847
948
|
] }) });
|
|
848
949
|
}
|
|
849
|
-
function
|
|
950
|
+
function wt({
|
|
850
951
|
hints: e
|
|
851
952
|
}) {
|
|
852
|
-
return /* @__PURE__ */
|
|
853
|
-
const n =
|
|
953
|
+
return /* @__PURE__ */ a(ue, { title: "Source hints", children: /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => {
|
|
954
|
+
const n = Pt(r), i = r.component || r.exportName || n || "Source hint", o = [
|
|
854
955
|
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
855
956
|
n,
|
|
856
957
|
r.note
|
|
@@ -859,73 +960,73 @@ function st({
|
|
|
859
960
|
"div",
|
|
860
961
|
{
|
|
861
962
|
style: s.recipeFieldRow,
|
|
862
|
-
title:
|
|
963
|
+
title: o || i,
|
|
863
964
|
children: [
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
|
|
965
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children: i }),
|
|
966
|
+
o ? /* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: o }) : null
|
|
866
967
|
]
|
|
867
968
|
},
|
|
868
969
|
`${i}:${n}:${t}`
|
|
869
970
|
);
|
|
870
971
|
}) }) });
|
|
871
972
|
}
|
|
872
|
-
function
|
|
973
|
+
function qt({
|
|
873
974
|
sources: e
|
|
874
975
|
}) {
|
|
875
976
|
return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
876
977
|
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "Sources" }),
|
|
979
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
|
|
879
980
|
] }),
|
|
880
|
-
e.length ? /* @__PURE__ */
|
|
981
|
+
e.length ? /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
|
|
881
982
|
"div",
|
|
882
983
|
{
|
|
883
984
|
style: s.recipeFieldRow,
|
|
884
|
-
title:
|
|
985
|
+
title: z(r),
|
|
885
986
|
children: [
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children: z(r) }),
|
|
988
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: r.kind })
|
|
888
989
|
]
|
|
889
990
|
},
|
|
890
|
-
`${
|
|
891
|
-
)) }) : /* @__PURE__ */
|
|
991
|
+
`${z(r)}:${t}`
|
|
992
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: "No sources captured" })
|
|
892
993
|
] });
|
|
893
994
|
}
|
|
894
|
-
function
|
|
995
|
+
function P({
|
|
895
996
|
title: e,
|
|
896
997
|
fields: r,
|
|
897
998
|
emptyText: t
|
|
898
999
|
}) {
|
|
899
1000
|
return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
900
1001
|
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: e }),
|
|
1003
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: r.length })
|
|
903
1004
|
] }),
|
|
904
|
-
r.length ? /* @__PURE__ */
|
|
905
|
-
|
|
1005
|
+
r.length ? /* @__PURE__ */ a("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ a(
|
|
1006
|
+
xt,
|
|
906
1007
|
{
|
|
907
1008
|
field: n,
|
|
908
1009
|
groupTitle: e
|
|
909
1010
|
},
|
|
910
|
-
`${
|
|
911
|
-
)) }) : /* @__PURE__ */
|
|
1011
|
+
`${Pe(n)}:${i}`
|
|
1012
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: t })
|
|
912
1013
|
] });
|
|
913
1014
|
}
|
|
914
|
-
function
|
|
1015
|
+
function xt({
|
|
915
1016
|
field: e,
|
|
916
1017
|
groupTitle: r
|
|
917
1018
|
}) {
|
|
918
|
-
const t =
|
|
919
|
-
return /* @__PURE__ */ p("div", { style: s.fieldChip, title:
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
e.aggregate ? /* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
i ? /* @__PURE__ */
|
|
924
|
-
i &&
|
|
925
|
-
|
|
1019
|
+
const t = Ht(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? z(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = At(e, r);
|
|
1020
|
+
return /* @__PURE__ */ p("div", { style: s.fieldChip, title: u, children: [
|
|
1021
|
+
/* @__PURE__ */ a("span", { style: { ...s.fieldGlyph, ...f.style }, children: f.text }),
|
|
1022
|
+
e.aggregate ? /* @__PURE__ */ a("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
|
|
1023
|
+
/* @__PURE__ */ a("span", { style: s.fieldChipName, children: n }),
|
|
1024
|
+
i ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: i }) : null,
|
|
1025
|
+
i && o ? /* @__PURE__ */ a("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
|
|
1026
|
+
o ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: o }) : null
|
|
926
1027
|
] });
|
|
927
1028
|
}
|
|
928
|
-
function
|
|
1029
|
+
function At(e, r) {
|
|
929
1030
|
const t = e.dataType, n = e.role;
|
|
930
1031
|
return !!e.aggregate || n === "measure" || r === "Measures" ? {
|
|
931
1032
|
text: "Σ",
|
|
@@ -964,16 +1065,16 @@ function lt(e, r) {
|
|
|
964
1065
|
}
|
|
965
1066
|
};
|
|
966
1067
|
}
|
|
967
|
-
function
|
|
1068
|
+
function Et({
|
|
968
1069
|
inputs: e
|
|
969
1070
|
}) {
|
|
970
1071
|
return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
|
|
971
1072
|
/* @__PURE__ */ p("div", { style: s.inputsAppliedHeader, children: [
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ a("span", { style: s.inputsAppliedTitle, children: "Active Inputs" }),
|
|
1074
|
+
/* @__PURE__ */ a("span", { style: s.inputsAppliedCount, children: e.length })
|
|
974
1075
|
] }),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
const t =
|
|
1076
|
+
/* @__PURE__ */ a("div", { style: s.inputRecipeList, children: e.map((r) => {
|
|
1077
|
+
const t = jt(r);
|
|
977
1078
|
return /* @__PURE__ */ p(
|
|
978
1079
|
"div",
|
|
979
1080
|
{
|
|
@@ -981,11 +1082,11 @@ function ut({
|
|
|
981
1082
|
title: t.title,
|
|
982
1083
|
children: [
|
|
983
1084
|
/* @__PURE__ */ p("div", { style: s.inputRecipeHeader, children: [
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
t.operator ? /* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ a("span", { style: s.inputRecipeId, title: r.inputId, children: r.inputId }),
|
|
1086
|
+
t.operator ? /* @__PURE__ */ a("span", { style: s.inputOperatorBadge, children: t.operator }) : null,
|
|
1087
|
+
/* @__PURE__ */ a("span", { style: s.inputValuePreview, title: t.value, children: t.value })
|
|
987
1088
|
] }),
|
|
988
|
-
t.binding ? /* @__PURE__ */
|
|
1089
|
+
t.binding ? /* @__PURE__ */ a("div", { style: s.inputRecipeBinding, title: t.binding, children: t.binding }) : null
|
|
989
1090
|
]
|
|
990
1091
|
},
|
|
991
1092
|
r.inputId
|
|
@@ -993,41 +1094,41 @@ function ut({
|
|
|
993
1094
|
}) })
|
|
994
1095
|
] });
|
|
995
1096
|
}
|
|
996
|
-
function
|
|
1097
|
+
function Tt({
|
|
997
1098
|
compiledQuery: e,
|
|
998
1099
|
compiledSql: r
|
|
999
1100
|
}) {
|
|
1000
1101
|
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
e.pythonCode ? /* @__PURE__ */
|
|
1003
|
-
e.parameters ? /* @__PURE__ */
|
|
1004
|
-
|
|
1102
|
+
/* @__PURE__ */ a(rr, { label: "SQL", value: e.sql }),
|
|
1103
|
+
e.pythonCode ? /* @__PURE__ */ a(ke, { label: "Python", value: e.pythonCode }) : null,
|
|
1104
|
+
e.parameters ? /* @__PURE__ */ a(
|
|
1105
|
+
ke,
|
|
1005
1106
|
{
|
|
1006
1107
|
label: "Parameters",
|
|
1007
|
-
value:
|
|
1108
|
+
value: _e(e.parameters)
|
|
1008
1109
|
}
|
|
1009
1110
|
) : null
|
|
1010
|
-
] }) : r ? /* @__PURE__ */
|
|
1111
|
+
] }) : r ? /* @__PURE__ */ a(rr, { label: "SQL", value: r }) : /* @__PURE__ */ a(ke, { label: "Compiled Query", value: _e(e) });
|
|
1011
1112
|
}
|
|
1012
|
-
function
|
|
1113
|
+
function ke({
|
|
1013
1114
|
label: e,
|
|
1014
1115
|
value: r
|
|
1015
1116
|
}) {
|
|
1016
1117
|
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
|
|
1119
|
+
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: r })
|
|
1019
1120
|
] });
|
|
1020
1121
|
}
|
|
1021
|
-
function
|
|
1122
|
+
function rr({
|
|
1022
1123
|
label: e,
|
|
1023
1124
|
value: r
|
|
1024
1125
|
}) {
|
|
1025
1126
|
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
|
|
1128
|
+
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: kt(r) })
|
|
1028
1129
|
] });
|
|
1029
1130
|
}
|
|
1030
|
-
const
|
|
1131
|
+
const Ct = /* @__PURE__ */ new Set([
|
|
1031
1132
|
"SELECT",
|
|
1032
1133
|
"FROM",
|
|
1033
1134
|
"JOIN",
|
|
@@ -1065,48 +1166,93 @@ const ft = /* @__PURE__ */ new Set([
|
|
|
1065
1166
|
"ALL",
|
|
1066
1167
|
"WITH"
|
|
1067
1168
|
]);
|
|
1068
|
-
function
|
|
1169
|
+
function kt(e) {
|
|
1069
1170
|
return e.split(/(\s+|,|\(|\))/).map((t, n) => {
|
|
1070
1171
|
if (!t) return null;
|
|
1071
1172
|
const i = t.toUpperCase();
|
|
1072
|
-
return
|
|
1173
|
+
return Ct.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
|
|
1073
1174
|
});
|
|
1074
1175
|
}
|
|
1075
|
-
function
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1176
|
+
function je(e) {
|
|
1177
|
+
return e.flatMap((r) => {
|
|
1178
|
+
var m, v, S, g;
|
|
1179
|
+
const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = De(
|
|
1180
|
+
(m = n == null ? void 0 : n.validation) == null ? void 0 : m.warnings
|
|
1181
|
+
), o = De(
|
|
1182
|
+
(v = n == null ? void 0 : n.validation) == null ? void 0 : v.errors
|
|
1183
|
+
), u = xr(
|
|
1184
|
+
(S = n == null ? void 0 : n.coverage) == null ? void 0 : S.missingObligations
|
|
1185
|
+
), f = De(
|
|
1186
|
+
(g = n == null ? void 0 : n.coverage) == null ? void 0 : g.warnings
|
|
1187
|
+
), d = [], c = qe(r);
|
|
1188
|
+
(t == null ? void 0 : t.status) === "error" && d.push({
|
|
1189
|
+
trace: r,
|
|
1190
|
+
tone: "error",
|
|
1191
|
+
title: c,
|
|
1192
|
+
message: t.errorMessage || "Query attempt failed."
|
|
1193
|
+
});
|
|
1194
|
+
for (const b of r.clientWarnings)
|
|
1195
|
+
d.push({ trace: r, tone: "warning", title: c, message: b });
|
|
1196
|
+
for (const b of i)
|
|
1197
|
+
d.push({ trace: r, tone: "warning", title: c, ...b });
|
|
1198
|
+
for (const b of o)
|
|
1199
|
+
d.push({ trace: r, tone: "error", title: c, ...b });
|
|
1200
|
+
for (const b of u)
|
|
1201
|
+
d.push({ trace: r, tone: "warning", title: c, message: b });
|
|
1202
|
+
for (const b of f)
|
|
1203
|
+
d.push({ trace: r, tone: "warning", title: c, ...b });
|
|
1204
|
+
return d;
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
function Rt(e) {
|
|
1208
|
+
return {
|
|
1209
|
+
traceId: e.trace.traceId,
|
|
1210
|
+
queryId: e.trace.queryId,
|
|
1211
|
+
viewId: e.trace.viewId,
|
|
1212
|
+
viewTitle: e.trace.viewTitle,
|
|
1213
|
+
queryLabel: e.trace.queryLabel,
|
|
1214
|
+
severity: e.tone,
|
|
1215
|
+
title: e.title,
|
|
1216
|
+
message: e.message,
|
|
1217
|
+
code: e.code,
|
|
1218
|
+
path: e.path
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
function Dt(e, r) {
|
|
1222
|
+
return e.filter((t) => br(t.trace, r)).length;
|
|
1223
|
+
}
|
|
1224
|
+
function Lt(e) {
|
|
1225
|
+
const r = je(e), t = e.filter(
|
|
1226
|
+
(u) => {
|
|
1227
|
+
var f;
|
|
1228
|
+
return ((f = u.latestAttempt) == null ? void 0 : f.status) === "error";
|
|
1085
1229
|
}
|
|
1086
1230
|
).length, n = e.filter(
|
|
1087
|
-
(
|
|
1088
|
-
var
|
|
1089
|
-
return
|
|
1231
|
+
(u) => {
|
|
1232
|
+
var f;
|
|
1233
|
+
return ((f = u.latestAttempt) == null ? void 0 : f.status) === "loading";
|
|
1090
1234
|
}
|
|
1091
|
-
).length;
|
|
1235
|
+
).length, i = r.filter((u) => u.tone === "error").length, o = r.filter((u) => u.tone === "warning").length;
|
|
1092
1236
|
return {
|
|
1093
1237
|
total: e.length,
|
|
1094
|
-
failed:
|
|
1095
|
-
loading:
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1238
|
+
failed: t,
|
|
1239
|
+
loading: n,
|
|
1240
|
+
errorCount: i,
|
|
1241
|
+
warningCount: o,
|
|
1242
|
+
issueCount: r.length,
|
|
1243
|
+
severity: t || i ? "error" : o ? "warning" : n ? "loading" : "ok"
|
|
1099
1244
|
};
|
|
1100
1245
|
}
|
|
1101
|
-
function
|
|
1246
|
+
function Ot(e) {
|
|
1102
1247
|
return [
|
|
1103
1248
|
`${e.total} ${e.total === 1 ? "trace" : "traces"}`,
|
|
1104
1249
|
`${e.loading} loading`,
|
|
1105
1250
|
`${e.failed} failed`,
|
|
1251
|
+
`${e.errorCount} error${e.errorCount === 1 ? "" : "s"}`,
|
|
1106
1252
|
`${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
|
|
1107
1253
|
].join(" · ");
|
|
1108
1254
|
}
|
|
1109
|
-
function
|
|
1255
|
+
function Bt(e, r) {
|
|
1110
1256
|
const t = r.trim().toLowerCase();
|
|
1111
1257
|
return t ? e.filter(
|
|
1112
1258
|
(n) => [
|
|
@@ -1118,36 +1264,36 @@ function yt(e, r) {
|
|
|
1118
1264
|
n.sectionTitle,
|
|
1119
1265
|
n.builder,
|
|
1120
1266
|
n.queryKind,
|
|
1121
|
-
|
|
1267
|
+
qr(n)
|
|
1122
1268
|
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
1123
1269
|
) : e;
|
|
1124
1270
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(
|
|
1271
|
+
function $t(e) {
|
|
1272
|
+
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(We));
|
|
1127
1273
|
return [
|
|
1128
|
-
{ title: "Views", traces: e.filter((i) => !t.has(
|
|
1274
|
+
{ title: "Views", traces: e.filter((i) => !t.has(We(i))) },
|
|
1129
1275
|
{ title: "Inputs", traces: r }
|
|
1130
1276
|
];
|
|
1131
1277
|
}
|
|
1132
|
-
function
|
|
1278
|
+
function vr(e, r) {
|
|
1133
1279
|
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
1134
1280
|
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));
|
|
1135
1281
|
}
|
|
1136
|
-
function
|
|
1282
|
+
function Kt(e, r) {
|
|
1137
1283
|
if (r.queryId)
|
|
1138
|
-
return
|
|
1284
|
+
return vr(e, r);
|
|
1139
1285
|
if (!r.viewId)
|
|
1140
1286
|
return;
|
|
1141
1287
|
const t = e.filter((n) => n.viewId === r.viewId);
|
|
1142
1288
|
return t.length === 1 ? t[0] : void 0;
|
|
1143
1289
|
}
|
|
1144
|
-
function
|
|
1290
|
+
function br(e, r) {
|
|
1145
1291
|
return !!(e && r && e.traceId === r.traceId);
|
|
1146
1292
|
}
|
|
1147
|
-
function
|
|
1293
|
+
function We(e) {
|
|
1148
1294
|
return e.traceId;
|
|
1149
1295
|
}
|
|
1150
|
-
function
|
|
1296
|
+
function Wt(e) {
|
|
1151
1297
|
switch (e) {
|
|
1152
1298
|
case "metric":
|
|
1153
1299
|
return "metric";
|
|
@@ -1162,14 +1308,14 @@ function St(e) {
|
|
|
1162
1308
|
case "sql":
|
|
1163
1309
|
return "sql";
|
|
1164
1310
|
default:
|
|
1165
|
-
return
|
|
1311
|
+
return xe(e);
|
|
1166
1312
|
}
|
|
1167
1313
|
}
|
|
1168
|
-
function
|
|
1314
|
+
function Sr(e) {
|
|
1169
1315
|
const r = e.trim().toLowerCase();
|
|
1170
1316
|
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";
|
|
1171
1317
|
}
|
|
1172
|
-
function
|
|
1318
|
+
function Ir(e) {
|
|
1173
1319
|
switch (e) {
|
|
1174
1320
|
case "metric":
|
|
1175
1321
|
return {
|
|
@@ -1201,28 +1347,28 @@ function fr(e) {
|
|
|
1201
1347
|
};
|
|
1202
1348
|
}
|
|
1203
1349
|
}
|
|
1204
|
-
function
|
|
1350
|
+
function qe(e) {
|
|
1205
1351
|
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
1206
1352
|
}
|
|
1207
|
-
function
|
|
1353
|
+
function _t(e, r, t) {
|
|
1208
1354
|
const n = [];
|
|
1209
1355
|
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;
|
|
1210
1356
|
}
|
|
1211
|
-
function
|
|
1212
|
-
return
|
|
1357
|
+
function wr(e) {
|
|
1358
|
+
return Ft(e.visualType) || Wt(e.queryKind);
|
|
1213
1359
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return r ? e.queryLabel || e.queryId :
|
|
1360
|
+
function Nt(e, r) {
|
|
1361
|
+
return r ? e.queryLabel || e.queryId : qe(e);
|
|
1216
1362
|
}
|
|
1217
|
-
function
|
|
1363
|
+
function Ft(e) {
|
|
1218
1364
|
if (e)
|
|
1219
1365
|
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1220
1366
|
}
|
|
1221
|
-
function
|
|
1222
|
-
const r = e.sourceRefs.map(
|
|
1367
|
+
function qr(e) {
|
|
1368
|
+
const r = e.sourceRefs.map(z);
|
|
1223
1369
|
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
1224
1370
|
}
|
|
1225
|
-
function
|
|
1371
|
+
function zt(e) {
|
|
1226
1372
|
return e.reduce(
|
|
1227
1373
|
(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),
|
|
1228
1374
|
{
|
|
@@ -1234,7 +1380,7 @@ function qt(e) {
|
|
|
1234
1380
|
}
|
|
1235
1381
|
);
|
|
1236
1382
|
}
|
|
1237
|
-
function
|
|
1383
|
+
function Mt(e) {
|
|
1238
1384
|
var r, t;
|
|
1239
1385
|
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)
|
|
1240
1386
|
return "KPI query";
|
|
@@ -1252,15 +1398,15 @@ function Rt(e) {
|
|
|
1252
1398
|
case "sql":
|
|
1253
1399
|
return "SQL query";
|
|
1254
1400
|
default:
|
|
1255
|
-
return
|
|
1401
|
+
return xe(e.queryKind);
|
|
1256
1402
|
}
|
|
1257
1403
|
}
|
|
1258
|
-
function
|
|
1404
|
+
function Ht(e) {
|
|
1259
1405
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1260
1406
|
}
|
|
1261
|
-
function
|
|
1262
|
-
var
|
|
1263
|
-
const r = e.valuePreview || "redacted", t = ((
|
|
1407
|
+
function jt(e) {
|
|
1408
|
+
var u, f, d;
|
|
1409
|
+
const r = e.valuePreview || "redacted", t = ((u = e.fieldRef) == null ? void 0 : u.label) || ((f = e.fieldRef) == null ? void 0 : f.name), n = (d = e.fieldRef) != null && d.source ? z(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), o = [
|
|
1264
1410
|
e.inputId,
|
|
1265
1411
|
e.operator,
|
|
1266
1412
|
r,
|
|
@@ -1270,32 +1416,32 @@ function Et(e) {
|
|
|
1270
1416
|
operator: e.operator,
|
|
1271
1417
|
value: r,
|
|
1272
1418
|
binding: i,
|
|
1273
|
-
title:
|
|
1419
|
+
title: o
|
|
1274
1420
|
};
|
|
1275
1421
|
}
|
|
1276
|
-
function
|
|
1422
|
+
function z(e) {
|
|
1277
1423
|
return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
|
|
1278
1424
|
e.schemaName,
|
|
1279
1425
|
e.tableName
|
|
1280
1426
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
1281
1427
|
}
|
|
1282
|
-
function
|
|
1428
|
+
function Pt(e) {
|
|
1283
1429
|
if (e.file)
|
|
1284
1430
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1285
1431
|
}
|
|
1286
|
-
function
|
|
1432
|
+
function Qt(e) {
|
|
1287
1433
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1288
1434
|
}
|
|
1289
|
-
function
|
|
1435
|
+
function Vt(e) {
|
|
1290
1436
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1291
1437
|
}
|
|
1292
|
-
function
|
|
1293
|
-
return
|
|
1438
|
+
function Ut(e) {
|
|
1439
|
+
return _e(e);
|
|
1294
1440
|
}
|
|
1295
|
-
function
|
|
1441
|
+
function _e(e) {
|
|
1296
1442
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1297
1443
|
}
|
|
1298
|
-
function
|
|
1444
|
+
function Gt(e) {
|
|
1299
1445
|
switch (e.type) {
|
|
1300
1446
|
case "query_started":
|
|
1301
1447
|
return "Started";
|
|
@@ -1308,10 +1454,10 @@ function Lt(e) {
|
|
|
1308
1454
|
case "input_changed":
|
|
1309
1455
|
return "Input changed";
|
|
1310
1456
|
default:
|
|
1311
|
-
return
|
|
1457
|
+
return Yt(e);
|
|
1312
1458
|
}
|
|
1313
1459
|
}
|
|
1314
|
-
function
|
|
1460
|
+
function Jt(e) {
|
|
1315
1461
|
return [
|
|
1316
1462
|
e.at,
|
|
1317
1463
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1320,20 +1466,44 @@ function Ot(e) {
|
|
|
1320
1466
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1321
1467
|
].filter(Boolean).join(" - ");
|
|
1322
1468
|
}
|
|
1323
|
-
function
|
|
1469
|
+
function Yt(e) {
|
|
1324
1470
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1325
1471
|
}
|
|
1326
|
-
function
|
|
1472
|
+
function xr(e) {
|
|
1327
1473
|
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
1328
1474
|
}
|
|
1329
|
-
function
|
|
1475
|
+
function Re(e) {
|
|
1476
|
+
return Array.isArray(e) ? e.map((r) => Xt(r)).filter((r) => !!r) : [];
|
|
1477
|
+
}
|
|
1478
|
+
function De(e) {
|
|
1479
|
+
return Array.isArray(e) ? e.map((r) => Ar(r)).filter(
|
|
1480
|
+
(r) => !!r
|
|
1481
|
+
) : [];
|
|
1482
|
+
}
|
|
1483
|
+
function Xt(e) {
|
|
1484
|
+
var r;
|
|
1485
|
+
return (r = Ar(e)) == null ? void 0 : r.message;
|
|
1486
|
+
}
|
|
1487
|
+
function Ar(e) {
|
|
1488
|
+
if (typeof e == "string")
|
|
1489
|
+
return { message: e };
|
|
1490
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1491
|
+
return;
|
|
1492
|
+
const r = e, t = typeof r.message == "string" ? r.message : "", n = typeof r.code == "string" ? r.code : "", i = typeof r.path == "string" ? r.path : "";
|
|
1493
|
+
return t && n ? {
|
|
1494
|
+
message: i ? `${t} (${n}, ${i})` : `${t} (${n})`,
|
|
1495
|
+
code: n,
|
|
1496
|
+
...i ? { path: i } : {}
|
|
1497
|
+
} : t ? { message: t } : n ? { message: n, code: n } : void 0;
|
|
1498
|
+
}
|
|
1499
|
+
function Zt(e) {
|
|
1330
1500
|
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;
|
|
1331
1501
|
return {
|
|
1332
1502
|
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
1333
1503
|
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
1334
1504
|
};
|
|
1335
1505
|
}
|
|
1336
|
-
function
|
|
1506
|
+
function en(e) {
|
|
1337
1507
|
return e === "relative" ? {
|
|
1338
1508
|
position: "relative",
|
|
1339
1509
|
top: "auto",
|
|
@@ -1347,7 +1517,7 @@ function Nt(e) {
|
|
|
1347
1517
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1348
1518
|
};
|
|
1349
1519
|
}
|
|
1350
|
-
function
|
|
1520
|
+
function rn(e) {
|
|
1351
1521
|
return e === "error" ? {
|
|
1352
1522
|
borderColor: "var(--sd-error-border)",
|
|
1353
1523
|
background: "var(--sd-error-bg)",
|
|
@@ -1366,7 +1536,7 @@ function $t(e) {
|
|
|
1366
1536
|
color: "var(--sd-success-fg)"
|
|
1367
1537
|
};
|
|
1368
1538
|
}
|
|
1369
|
-
function
|
|
1539
|
+
function tn(e) {
|
|
1370
1540
|
return e === "right" ? {
|
|
1371
1541
|
top: 16,
|
|
1372
1542
|
right: 16,
|
|
@@ -1385,23 +1555,23 @@ function Wt(e) {
|
|
|
1385
1555
|
borderRadius: 6
|
|
1386
1556
|
};
|
|
1387
1557
|
}
|
|
1388
|
-
function
|
|
1558
|
+
function nn(e) {
|
|
1389
1559
|
return e === "right" ? {
|
|
1390
1560
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1391
1561
|
} : {
|
|
1392
1562
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1393
1563
|
};
|
|
1394
1564
|
}
|
|
1395
|
-
function
|
|
1565
|
+
function on(e) {
|
|
1396
1566
|
return {
|
|
1397
1567
|
borderRight: "1px solid var(--sd-border)",
|
|
1398
1568
|
borderBottom: 0
|
|
1399
1569
|
};
|
|
1400
1570
|
}
|
|
1401
|
-
function
|
|
1571
|
+
function Er(e) {
|
|
1402
1572
|
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)" };
|
|
1403
1573
|
}
|
|
1404
|
-
function
|
|
1574
|
+
function sn(e) {
|
|
1405
1575
|
return e === "error" ? {
|
|
1406
1576
|
borderColor: "var(--sd-error-border)",
|
|
1407
1577
|
color: "var(--sd-error-fg)"
|
|
@@ -1416,8 +1586,8 @@ function zt(e) {
|
|
|
1416
1586
|
color: "var(--sd-fg-muted)"
|
|
1417
1587
|
};
|
|
1418
1588
|
}
|
|
1419
|
-
const
|
|
1420
|
-
.${
|
|
1589
|
+
const tr = "semaphor-devtools-stylesheet", N = "semaphor-devtools", an = `
|
|
1590
|
+
.${N} {
|
|
1421
1591
|
--sd-bg: #ffffff;
|
|
1422
1592
|
--sd-bg-muted: #fafafa;
|
|
1423
1593
|
--sd-bg-raised: #ffffff;
|
|
@@ -1466,7 +1636,7 @@ const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
|
|
|
1466
1636
|
}
|
|
1467
1637
|
|
|
1468
1638
|
@media (prefers-color-scheme: dark) {
|
|
1469
|
-
.${
|
|
1639
|
+
.${N} {
|
|
1470
1640
|
--sd-bg: #09090b;
|
|
1471
1641
|
--sd-bg-muted: #18181b;
|
|
1472
1642
|
--sd-bg-raised: #18181b;
|
|
@@ -1510,7 +1680,7 @@ const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
|
|
|
1510
1680
|
}
|
|
1511
1681
|
}
|
|
1512
1682
|
|
|
1513
|
-
.${
|
|
1683
|
+
.${N}-source {
|
|
1514
1684
|
display: -webkit-box;
|
|
1515
1685
|
-webkit-line-clamp: 2;
|
|
1516
1686
|
-webkit-box-orient: vertical;
|
|
@@ -1518,13 +1688,13 @@ const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
|
|
|
1518
1688
|
word-break: break-all;
|
|
1519
1689
|
}
|
|
1520
1690
|
`;
|
|
1521
|
-
function
|
|
1522
|
-
if (typeof document > "u" || document.getElementById(
|
|
1691
|
+
function Tr() {
|
|
1692
|
+
if (typeof document > "u" || document.getElementById(tr))
|
|
1523
1693
|
return;
|
|
1524
1694
|
const e = document.createElement("style");
|
|
1525
|
-
e.id =
|
|
1695
|
+
e.id = tr, e.textContent = an, document.head.appendChild(e);
|
|
1526
1696
|
}
|
|
1527
|
-
const
|
|
1697
|
+
const me = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', _ = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", ye = {
|
|
1528
1698
|
color: "var(--sd-fg-muted)",
|
|
1529
1699
|
fontSize: 10,
|
|
1530
1700
|
fontWeight: 600,
|
|
@@ -1545,7 +1715,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1545
1715
|
borderStyle: "solid",
|
|
1546
1716
|
borderRadius: 6,
|
|
1547
1717
|
boxShadow: "var(--sd-shadow)",
|
|
1548
|
-
font: `600 12px/1.2 ${
|
|
1718
|
+
font: `600 12px/1.2 ${me}`,
|
|
1549
1719
|
cursor: "pointer"
|
|
1550
1720
|
},
|
|
1551
1721
|
launcherText: {
|
|
@@ -1590,7 +1760,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1590
1760
|
background: "var(--sd-bg)",
|
|
1591
1761
|
color: "var(--sd-fg)",
|
|
1592
1762
|
boxShadow: "var(--sd-shadow)",
|
|
1593
|
-
font: `13px/1.4 ${
|
|
1763
|
+
font: `13px/1.4 ${me}`
|
|
1594
1764
|
},
|
|
1595
1765
|
panelFullscreen: {
|
|
1596
1766
|
top: 0,
|
|
@@ -1659,7 +1829,111 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1659
1829
|
outline: 0,
|
|
1660
1830
|
background: "transparent",
|
|
1661
1831
|
color: "var(--sd-fg)",
|
|
1662
|
-
font: `12px/1.4 ${
|
|
1832
|
+
font: `12px/1.4 ${me}`
|
|
1833
|
+
},
|
|
1834
|
+
issueSummary: {
|
|
1835
|
+
margin: "0 10px 10px",
|
|
1836
|
+
borderWidth: 1,
|
|
1837
|
+
borderStyle: "solid",
|
|
1838
|
+
borderColor: "var(--sd-warning-border)",
|
|
1839
|
+
borderRadius: 6,
|
|
1840
|
+
background: "var(--sd-warning-bg)",
|
|
1841
|
+
color: "var(--sd-warning-fg)",
|
|
1842
|
+
overflow: "hidden"
|
|
1843
|
+
},
|
|
1844
|
+
issueSummaryToggle: {
|
|
1845
|
+
display: "flex",
|
|
1846
|
+
alignItems: "center",
|
|
1847
|
+
justifyContent: "space-between",
|
|
1848
|
+
gap: 8,
|
|
1849
|
+
width: "100%",
|
|
1850
|
+
padding: "7px 9px 5px",
|
|
1851
|
+
border: 0,
|
|
1852
|
+
background: "transparent",
|
|
1853
|
+
color: "inherit",
|
|
1854
|
+
cursor: "pointer",
|
|
1855
|
+
...ye
|
|
1856
|
+
},
|
|
1857
|
+
issueSummaryHeaderLabel: {
|
|
1858
|
+
display: "inline-flex",
|
|
1859
|
+
alignItems: "center",
|
|
1860
|
+
gap: 4,
|
|
1861
|
+
minWidth: 0
|
|
1862
|
+
},
|
|
1863
|
+
issueSummaryCount: {
|
|
1864
|
+
fontVariantNumeric: "tabular-nums"
|
|
1865
|
+
},
|
|
1866
|
+
issueSummaryCollapsed: {
|
|
1867
|
+
padding: "0 9px 8px 26px",
|
|
1868
|
+
color: "var(--sd-fg-muted)",
|
|
1869
|
+
fontSize: 11
|
|
1870
|
+
},
|
|
1871
|
+
issueSummaryList: {
|
|
1872
|
+
display: "grid",
|
|
1873
|
+
gap: 1,
|
|
1874
|
+
padding: "0 6px 6px"
|
|
1875
|
+
},
|
|
1876
|
+
issueSummaryItem: {
|
|
1877
|
+
display: "grid",
|
|
1878
|
+
gridTemplateColumns: "auto minmax(0, 1fr)",
|
|
1879
|
+
alignItems: "start",
|
|
1880
|
+
gap: 8,
|
|
1881
|
+
width: "100%",
|
|
1882
|
+
padding: "7px 8px",
|
|
1883
|
+
border: 0,
|
|
1884
|
+
borderRadius: 5,
|
|
1885
|
+
background: "transparent",
|
|
1886
|
+
color: "inherit",
|
|
1887
|
+
textAlign: "left",
|
|
1888
|
+
cursor: "pointer"
|
|
1889
|
+
},
|
|
1890
|
+
issueSummaryBadge: {
|
|
1891
|
+
display: "inline-flex",
|
|
1892
|
+
alignItems: "center",
|
|
1893
|
+
height: 17,
|
|
1894
|
+
padding: "0 5px",
|
|
1895
|
+
borderWidth: 1,
|
|
1896
|
+
borderStyle: "solid",
|
|
1897
|
+
borderRadius: 3,
|
|
1898
|
+
fontSize: 9,
|
|
1899
|
+
fontWeight: 700,
|
|
1900
|
+
textTransform: "uppercase",
|
|
1901
|
+
letterSpacing: "0.06em"
|
|
1902
|
+
},
|
|
1903
|
+
issueSummaryBadgeError: {
|
|
1904
|
+
borderColor: "var(--sd-error-border)",
|
|
1905
|
+
background: "var(--sd-error-bg)",
|
|
1906
|
+
color: "var(--sd-error-fg)"
|
|
1907
|
+
},
|
|
1908
|
+
issueSummaryBadgeWarning: {
|
|
1909
|
+
borderColor: "var(--sd-warning-border)",
|
|
1910
|
+
background: "var(--sd-bg)",
|
|
1911
|
+
color: "var(--sd-warning-fg)"
|
|
1912
|
+
},
|
|
1913
|
+
issueSummaryText: {
|
|
1914
|
+
display: "grid",
|
|
1915
|
+
gap: 2,
|
|
1916
|
+
minWidth: 0
|
|
1917
|
+
},
|
|
1918
|
+
issueSummaryTitle: {
|
|
1919
|
+
overflow: "hidden",
|
|
1920
|
+
textOverflow: "ellipsis",
|
|
1921
|
+
whiteSpace: "nowrap",
|
|
1922
|
+
color: "var(--sd-fg)",
|
|
1923
|
+
fontSize: 12,
|
|
1924
|
+
fontWeight: 650
|
|
1925
|
+
},
|
|
1926
|
+
issueSummaryMessage: {
|
|
1927
|
+
overflow: "hidden",
|
|
1928
|
+
textOverflow: "ellipsis",
|
|
1929
|
+
whiteSpace: "nowrap",
|
|
1930
|
+
color: "var(--sd-warning-fg)",
|
|
1931
|
+
fontSize: 11
|
|
1932
|
+
},
|
|
1933
|
+
issueSummaryMore: {
|
|
1934
|
+
padding: "3px 8px 5px",
|
|
1935
|
+
color: "var(--sd-fg-muted)",
|
|
1936
|
+
fontSize: 11
|
|
1663
1937
|
},
|
|
1664
1938
|
panelBody: {
|
|
1665
1939
|
display: "grid",
|
|
@@ -1685,7 +1959,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1685
1959
|
alignItems: "center",
|
|
1686
1960
|
justifyContent: "space-between",
|
|
1687
1961
|
padding: "4px 6px 3px",
|
|
1688
|
-
...
|
|
1962
|
+
...ye
|
|
1689
1963
|
},
|
|
1690
1964
|
queryGroupCount: {
|
|
1691
1965
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1748,12 +2022,30 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1748
2022
|
borderRadius: 3,
|
|
1749
2023
|
background: "var(--sd-bg-accent)",
|
|
1750
2024
|
color: "var(--sd-fg-muted)",
|
|
1751
|
-
fontFamily:
|
|
2025
|
+
fontFamily: _,
|
|
1752
2026
|
fontSize: 9,
|
|
1753
2027
|
fontWeight: 600,
|
|
1754
2028
|
textTransform: "uppercase",
|
|
1755
2029
|
letterSpacing: "0.06em"
|
|
1756
2030
|
},
|
|
2031
|
+
queryListIssueBadge: {
|
|
2032
|
+
flex: "0 0 auto",
|
|
2033
|
+
display: "inline-flex",
|
|
2034
|
+
alignItems: "center",
|
|
2035
|
+
justifyContent: "center",
|
|
2036
|
+
minWidth: 16,
|
|
2037
|
+
height: 16,
|
|
2038
|
+
padding: "0 4px",
|
|
2039
|
+
borderWidth: 1,
|
|
2040
|
+
borderStyle: "solid",
|
|
2041
|
+
borderColor: "var(--sd-warning-border)",
|
|
2042
|
+
borderRadius: 999,
|
|
2043
|
+
background: "var(--sd-warning-bg)",
|
|
2044
|
+
color: "var(--sd-warning-fg)",
|
|
2045
|
+
fontSize: 10,
|
|
2046
|
+
fontWeight: 700,
|
|
2047
|
+
fontVariantNumeric: "tabular-nums"
|
|
2048
|
+
},
|
|
1757
2049
|
queryListSource: {
|
|
1758
2050
|
minWidth: 0,
|
|
1759
2051
|
paddingLeft: 14,
|
|
@@ -1808,7 +2100,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1808
2100
|
borderRadius: 3,
|
|
1809
2101
|
background: "var(--sd-bg-accent)",
|
|
1810
2102
|
color: "var(--sd-fg-muted)",
|
|
1811
|
-
fontFamily:
|
|
2103
|
+
fontFamily: _,
|
|
1812
2104
|
fontSize: 10,
|
|
1813
2105
|
fontWeight: 600,
|
|
1814
2106
|
textTransform: "uppercase",
|
|
@@ -1849,7 +2141,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1849
2141
|
color: "var(--sd-fg)"
|
|
1850
2142
|
},
|
|
1851
2143
|
sourcePillLabel: {
|
|
1852
|
-
fontFamily:
|
|
2144
|
+
fontFamily: _,
|
|
1853
2145
|
fontSize: 11,
|
|
1854
2146
|
color: "var(--sd-fg)"
|
|
1855
2147
|
},
|
|
@@ -1861,7 +2153,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1861
2153
|
borderRadius: 3,
|
|
1862
2154
|
background: "var(--sd-bg-accent)",
|
|
1863
2155
|
color: "var(--sd-fg-subtle)",
|
|
1864
|
-
fontFamily:
|
|
2156
|
+
fontFamily: _,
|
|
1865
2157
|
fontSize: 9,
|
|
1866
2158
|
textTransform: "uppercase",
|
|
1867
2159
|
letterSpacing: "0.06em"
|
|
@@ -1893,7 +2185,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1893
2185
|
borderWidth: 1,
|
|
1894
2186
|
borderStyle: "solid",
|
|
1895
2187
|
borderRadius: 4,
|
|
1896
|
-
fontFamily:
|
|
2188
|
+
fontFamily: _,
|
|
1897
2189
|
fontSize: 11,
|
|
1898
2190
|
fontWeight: 700,
|
|
1899
2191
|
lineHeight: 1
|
|
@@ -1906,7 +2198,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1906
2198
|
borderRadius: 3,
|
|
1907
2199
|
background: "var(--sd-bg-accent)",
|
|
1908
2200
|
color: "var(--sd-fg)",
|
|
1909
|
-
fontFamily:
|
|
2201
|
+
fontFamily: _,
|
|
1910
2202
|
fontSize: 10,
|
|
1911
2203
|
fontWeight: 600,
|
|
1912
2204
|
letterSpacing: "0.04em"
|
|
@@ -1923,7 +2215,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1923
2215
|
},
|
|
1924
2216
|
fieldChipMeta: {
|
|
1925
2217
|
flex: "0 0 auto",
|
|
1926
|
-
fontFamily:
|
|
2218
|
+
fontFamily: _,
|
|
1927
2219
|
fontSize: 10,
|
|
1928
2220
|
color: "var(--sd-fg-subtle)"
|
|
1929
2221
|
},
|
|
@@ -1943,7 +2235,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1943
2235
|
},
|
|
1944
2236
|
disclosureSummary: {
|
|
1945
2237
|
cursor: "pointer",
|
|
1946
|
-
...
|
|
2238
|
+
...ye
|
|
1947
2239
|
},
|
|
1948
2240
|
disclosureBody: {
|
|
1949
2241
|
marginTop: 8
|
|
@@ -2099,7 +2391,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2099
2391
|
textOverflow: "ellipsis",
|
|
2100
2392
|
whiteSpace: "nowrap",
|
|
2101
2393
|
color: "var(--sd-fg)",
|
|
2102
|
-
fontFamily:
|
|
2394
|
+
fontFamily: _,
|
|
2103
2395
|
fontSize: 11,
|
|
2104
2396
|
fontWeight: 600
|
|
2105
2397
|
},
|
|
@@ -2112,7 +2404,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2112
2404
|
borderRadius: 3,
|
|
2113
2405
|
background: "var(--sd-bg-accent)",
|
|
2114
2406
|
color: "var(--sd-fg-muted)",
|
|
2115
|
-
fontFamily:
|
|
2407
|
+
fontFamily: _,
|
|
2116
2408
|
fontSize: 10,
|
|
2117
2409
|
textTransform: "uppercase",
|
|
2118
2410
|
letterSpacing: "0.06em"
|
|
@@ -2171,7 +2463,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2171
2463
|
gap: 5
|
|
2172
2464
|
},
|
|
2173
2465
|
codeBlockLabel: {
|
|
2174
|
-
...
|
|
2466
|
+
...ye
|
|
2175
2467
|
},
|
|
2176
2468
|
codeBlock: {
|
|
2177
2469
|
maxHeight: 260,
|
|
@@ -2182,7 +2474,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2182
2474
|
borderRadius: 5,
|
|
2183
2475
|
background: "var(--sd-bg-muted)",
|
|
2184
2476
|
color: "var(--sd-fg)",
|
|
2185
|
-
fontFamily:
|
|
2477
|
+
fontFamily: _,
|
|
2186
2478
|
fontSize: 11,
|
|
2187
2479
|
lineHeight: 1.5,
|
|
2188
2480
|
whiteSpace: "pre-wrap"
|
|
@@ -2204,7 +2496,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2204
2496
|
borderStyle: "solid",
|
|
2205
2497
|
borderRadius: 5,
|
|
2206
2498
|
background: "var(--sd-bg)",
|
|
2207
|
-
font: `600 11px/1 ${
|
|
2499
|
+
font: `600 11px/1 ${me}`,
|
|
2208
2500
|
cursor: "pointer"
|
|
2209
2501
|
},
|
|
2210
2502
|
inspectButtonText: {
|
|
@@ -2213,7 +2505,7 @@ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2213
2505
|
whiteSpace: "nowrap"
|
|
2214
2506
|
}
|
|
2215
2507
|
};
|
|
2216
|
-
function
|
|
2508
|
+
function Cr(e) {
|
|
2217
2509
|
return {
|
|
2218
2510
|
...e,
|
|
2219
2511
|
order: [],
|
|
@@ -2221,29 +2513,29 @@ function hr(e) {
|
|
|
2221
2513
|
sequence: 0
|
|
2222
2514
|
};
|
|
2223
2515
|
}
|
|
2224
|
-
function
|
|
2516
|
+
function dn(e, r) {
|
|
2225
2517
|
if (r.type === "config")
|
|
2226
2518
|
return r.config.enabled ? {
|
|
2227
2519
|
...e,
|
|
2228
2520
|
...r.config
|
|
2229
|
-
} :
|
|
2521
|
+
} : Cr(r.config);
|
|
2230
2522
|
if (!e.enabled)
|
|
2231
2523
|
return e;
|
|
2232
2524
|
switch (r.type) {
|
|
2233
2525
|
case "register":
|
|
2234
|
-
return
|
|
2526
|
+
return fn(ln(e, r.descriptor));
|
|
2235
2527
|
case "unregister":
|
|
2236
|
-
return
|
|
2528
|
+
return un(e, r.traceKey);
|
|
2237
2529
|
case "event":
|
|
2238
|
-
return
|
|
2530
|
+
return cn(e, r);
|
|
2239
2531
|
default:
|
|
2240
2532
|
return e;
|
|
2241
2533
|
}
|
|
2242
2534
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i =
|
|
2245
|
-
...t ||
|
|
2246
|
-
...
|
|
2535
|
+
function ln(e, r) {
|
|
2536
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Qe(), o = {
|
|
2537
|
+
...t || pn(r),
|
|
2538
|
+
...kr(r),
|
|
2247
2539
|
traceKey: r.traceKey,
|
|
2248
2540
|
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
2249
2541
|
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
@@ -2257,11 +2549,11 @@ function jt(e, r) {
|
|
|
2257
2549
|
order: t ? e.order : [...e.order, r.traceKey],
|
|
2258
2550
|
entries: {
|
|
2259
2551
|
...e.entries,
|
|
2260
|
-
[r.traceKey]:
|
|
2552
|
+
[r.traceKey]: o
|
|
2261
2553
|
}
|
|
2262
2554
|
};
|
|
2263
2555
|
}
|
|
2264
|
-
function
|
|
2556
|
+
function un(e, r) {
|
|
2265
2557
|
const t = e.entries[r];
|
|
2266
2558
|
return t ? {
|
|
2267
2559
|
...e,
|
|
@@ -2274,11 +2566,11 @@ function Pt(e, r) {
|
|
|
2274
2566
|
}
|
|
2275
2567
|
} : e;
|
|
2276
2568
|
}
|
|
2277
|
-
function
|
|
2569
|
+
function cn(e, r) {
|
|
2278
2570
|
const t = e.entries[r.traceKey];
|
|
2279
2571
|
if (!t)
|
|
2280
2572
|
return e;
|
|
2281
|
-
const n =
|
|
2573
|
+
const n = Qe(), i = [
|
|
2282
2574
|
...t.recentEvents,
|
|
2283
2575
|
r.event
|
|
2284
2576
|
].slice(-e.maxEventsPerQuery);
|
|
@@ -2298,10 +2590,10 @@ function Qt(e, r) {
|
|
|
2298
2590
|
}
|
|
2299
2591
|
};
|
|
2300
2592
|
}
|
|
2301
|
-
function
|
|
2593
|
+
function fn(e) {
|
|
2302
2594
|
if (e.order.length <= e.maxQueries)
|
|
2303
2595
|
return e;
|
|
2304
|
-
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i,
|
|
2596
|
+
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
|
|
2305
2597
|
r.slice(0, t).map((i) => i.traceKey)
|
|
2306
2598
|
);
|
|
2307
2599
|
return n.size ? {
|
|
@@ -2312,10 +2604,10 @@ function Vt(e) {
|
|
|
2312
2604
|
)
|
|
2313
2605
|
} : e;
|
|
2314
2606
|
}
|
|
2315
|
-
function
|
|
2316
|
-
const r =
|
|
2607
|
+
function pn(e) {
|
|
2608
|
+
const r = Qe();
|
|
2317
2609
|
return {
|
|
2318
|
-
...
|
|
2610
|
+
...kr(e),
|
|
2319
2611
|
traceKey: e.traceKey,
|
|
2320
2612
|
latestAttempt: { status: "idle" },
|
|
2321
2613
|
recentEvents: [],
|
|
@@ -2324,14 +2616,14 @@ function Ut(e) {
|
|
|
2324
2616
|
lastEventAt: r
|
|
2325
2617
|
};
|
|
2326
2618
|
}
|
|
2327
|
-
function
|
|
2619
|
+
function kr(e) {
|
|
2328
2620
|
var n;
|
|
2329
|
-
const r =
|
|
2621
|
+
const r = An(e.spec), t = En(
|
|
2330
2622
|
e.spec,
|
|
2331
2623
|
e.activeInputs
|
|
2332
2624
|
);
|
|
2333
2625
|
return {
|
|
2334
|
-
traceId:
|
|
2626
|
+
traceId: Lr(e.traceKey),
|
|
2335
2627
|
viewId: e.viewId,
|
|
2336
2628
|
viewTitle: e.viewTitle,
|
|
2337
2629
|
visualType: e.visualType,
|
|
@@ -2340,92 +2632,98 @@ function vr(e) {
|
|
|
2340
2632
|
queryLabel: e.queryLabel,
|
|
2341
2633
|
queryKind: e.queryKind,
|
|
2342
2634
|
builder: e.builder,
|
|
2343
|
-
sourceRefs:
|
|
2635
|
+
sourceRefs: xn(e.intent),
|
|
2344
2636
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2345
2637
|
projectionFieldRefs: r,
|
|
2346
2638
|
inputFieldRefs: t,
|
|
2347
|
-
fieldRefs:
|
|
2639
|
+
fieldRefs: Tn(e.intent),
|
|
2348
2640
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2349
2641
|
inputId: i.inputId,
|
|
2350
2642
|
fieldRef: i.field,
|
|
2351
2643
|
operator: i.operator,
|
|
2352
|
-
valuePreview:
|
|
2644
|
+
valuePreview: wn(i)
|
|
2353
2645
|
})),
|
|
2354
2646
|
recentEvents: [],
|
|
2355
2647
|
clientWarnings: e.clientWarnings
|
|
2356
2648
|
};
|
|
2357
2649
|
}
|
|
2358
|
-
function
|
|
2650
|
+
function be(e) {
|
|
2359
2651
|
const {
|
|
2360
2652
|
traceKey: r,
|
|
2361
2653
|
mounted: t,
|
|
2362
2654
|
registeredAt: n,
|
|
2363
2655
|
lastEventAt: i,
|
|
2364
|
-
...
|
|
2656
|
+
...o
|
|
2365
2657
|
} = e;
|
|
2366
|
-
return
|
|
2658
|
+
return o;
|
|
2367
2659
|
}
|
|
2368
|
-
function
|
|
2369
|
-
|
|
2660
|
+
function le(e) {
|
|
2661
|
+
if (!e.enabled)
|
|
2662
|
+
return mr;
|
|
2663
|
+
const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(be), t = je(r).map(Rt);
|
|
2664
|
+
return {
|
|
2370
2665
|
enabled: !0,
|
|
2371
|
-
queries:
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2666
|
+
queries: r,
|
|
2667
|
+
issues: t,
|
|
2668
|
+
getQuery: (n) => {
|
|
2669
|
+
const i = Object.values(e.entries).find(
|
|
2670
|
+
(o) => o.queryId === n
|
|
2375
2671
|
);
|
|
2376
|
-
return
|
|
2672
|
+
return i ? be(i) : void 0;
|
|
2377
2673
|
},
|
|
2378
|
-
getQueries: (
|
|
2379
|
-
}
|
|
2674
|
+
getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(be)
|
|
2675
|
+
};
|
|
2380
2676
|
}
|
|
2381
|
-
function
|
|
2677
|
+
function gn(e) {
|
|
2382
2678
|
return {
|
|
2383
|
-
snapshot: () =>
|
|
2384
|
-
getQuery: (r) =>
|
|
2385
|
-
getQueries: (r) =>
|
|
2679
|
+
snapshot: () => mn(le(e())),
|
|
2680
|
+
getQuery: (r) => nr(le(e()).getQuery(r)),
|
|
2681
|
+
getQueries: (r) => le(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
|
|
2682
|
+
getIssues: () => le(e()).issues
|
|
2386
2683
|
};
|
|
2387
2684
|
}
|
|
2388
|
-
function
|
|
2685
|
+
function mn(e) {
|
|
2389
2686
|
if (!e.enabled)
|
|
2390
2687
|
return e;
|
|
2391
|
-
const r = e.queries.map(
|
|
2688
|
+
const r = e.queries.map(Rr);
|
|
2392
2689
|
return {
|
|
2393
2690
|
enabled: e.enabled,
|
|
2394
2691
|
queries: r,
|
|
2692
|
+
issues: e.issues,
|
|
2395
2693
|
getQuery: (t) => r.find((n) => n.queryId === t),
|
|
2396
2694
|
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
2397
2695
|
};
|
|
2398
2696
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return e ?
|
|
2697
|
+
function nr(e) {
|
|
2698
|
+
return e ? Rr(e) : void 0;
|
|
2401
2699
|
}
|
|
2402
|
-
function
|
|
2700
|
+
function Rr(e) {
|
|
2403
2701
|
var r;
|
|
2404
2702
|
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
2405
2703
|
...e,
|
|
2406
2704
|
latestAttempt: {
|
|
2407
2705
|
...e.latestAttempt,
|
|
2408
|
-
executionResult:
|
|
2706
|
+
executionResult: yn(
|
|
2409
2707
|
e.latestAttempt.executionResult
|
|
2410
2708
|
)
|
|
2411
2709
|
}
|
|
2412
2710
|
} : e;
|
|
2413
2711
|
}
|
|
2414
|
-
function
|
|
2712
|
+
function yn(e) {
|
|
2415
2713
|
const {
|
|
2416
2714
|
compiledQuery: r,
|
|
2417
2715
|
intent: t,
|
|
2418
2716
|
result: n,
|
|
2419
2717
|
...i
|
|
2420
|
-
} = e,
|
|
2718
|
+
} = e, o = hn(
|
|
2421
2719
|
i.metadata
|
|
2422
2720
|
);
|
|
2423
2721
|
return {
|
|
2424
2722
|
...i,
|
|
2425
|
-
...
|
|
2723
|
+
...o ? { metadata: o } : {}
|
|
2426
2724
|
};
|
|
2427
2725
|
}
|
|
2428
|
-
function
|
|
2726
|
+
function hn(e) {
|
|
2429
2727
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2430
2728
|
return e;
|
|
2431
2729
|
const r = e.dataAppDebug;
|
|
@@ -2437,64 +2735,64 @@ function Xt(e) {
|
|
|
2437
2735
|
dataAppDebug: n
|
|
2438
2736
|
};
|
|
2439
2737
|
}
|
|
2440
|
-
function
|
|
2738
|
+
function vn(e) {
|
|
2441
2739
|
return e === void 0 || e === !1 ? {
|
|
2442
2740
|
enabled: !1,
|
|
2443
2741
|
exposeWindowBridge: !1,
|
|
2444
|
-
maxEventsPerQuery:
|
|
2445
|
-
maxQueries:
|
|
2742
|
+
maxEventsPerQuery: Te,
|
|
2743
|
+
maxQueries: Ce
|
|
2446
2744
|
} : e === !0 ? {
|
|
2447
2745
|
enabled: !0,
|
|
2448
2746
|
exposeWindowBridge: !1,
|
|
2449
|
-
maxEventsPerQuery:
|
|
2450
|
-
maxQueries:
|
|
2747
|
+
maxEventsPerQuery: Te,
|
|
2748
|
+
maxQueries: Ce
|
|
2451
2749
|
} : {
|
|
2452
2750
|
enabled: e.enabled !== !1,
|
|
2453
2751
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2454
|
-
maxEventsPerQuery:
|
|
2752
|
+
maxEventsPerQuery: or(
|
|
2455
2753
|
e.maxEventsPerQuery,
|
|
2456
|
-
|
|
2457
|
-
|
|
2754
|
+
Te,
|
|
2755
|
+
at
|
|
2458
2756
|
),
|
|
2459
|
-
maxQueries:
|
|
2757
|
+
maxQueries: or(
|
|
2460
2758
|
e.maxQueries,
|
|
2461
|
-
|
|
2462
|
-
|
|
2759
|
+
Ce,
|
|
2760
|
+
dt
|
|
2463
2761
|
)
|
|
2464
2762
|
};
|
|
2465
2763
|
}
|
|
2466
|
-
function
|
|
2764
|
+
function bn(e) {
|
|
2467
2765
|
const t = [
|
|
2468
2766
|
e == null ? void 0 : e.sourceHint,
|
|
2469
2767
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
2470
2768
|
].filter((n) => !!n).map((n) => ({
|
|
2471
|
-
file:
|
|
2472
|
-
line:
|
|
2473
|
-
column:
|
|
2474
|
-
exportName:
|
|
2475
|
-
component:
|
|
2476
|
-
note:
|
|
2769
|
+
file: he(n.file),
|
|
2770
|
+
line: ir(n.line),
|
|
2771
|
+
column: ir(n.column),
|
|
2772
|
+
exportName: he(n.exportName),
|
|
2773
|
+
component: he(n.component),
|
|
2774
|
+
note: he(n.note)
|
|
2477
2775
|
})).filter(
|
|
2478
2776
|
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2479
2777
|
);
|
|
2480
2778
|
return t.length ? t : void 0;
|
|
2481
2779
|
}
|
|
2482
|
-
function
|
|
2780
|
+
function he(e) {
|
|
2483
2781
|
if (typeof e != "string")
|
|
2484
2782
|
return;
|
|
2485
2783
|
const r = e.trim();
|
|
2486
2784
|
return r || void 0;
|
|
2487
2785
|
}
|
|
2488
|
-
function
|
|
2786
|
+
function ir(e) {
|
|
2489
2787
|
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
2490
2788
|
}
|
|
2491
|
-
function
|
|
2789
|
+
function or(e, r, t) {
|
|
2492
2790
|
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
2493
2791
|
}
|
|
2494
|
-
function
|
|
2792
|
+
function Sn(e) {
|
|
2495
2793
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2496
2794
|
}
|
|
2497
|
-
function
|
|
2795
|
+
function In(e) {
|
|
2498
2796
|
switch (e) {
|
|
2499
2797
|
case "metric":
|
|
2500
2798
|
return "semaphor.metric";
|
|
@@ -2509,14 +2807,14 @@ function tn(e) {
|
|
|
2509
2807
|
case "sql":
|
|
2510
2808
|
return "semaphor.sql";
|
|
2511
2809
|
default:
|
|
2512
|
-
return
|
|
2810
|
+
return xe(e);
|
|
2513
2811
|
}
|
|
2514
2812
|
}
|
|
2515
|
-
function
|
|
2813
|
+
function xe(e) {
|
|
2516
2814
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2517
2815
|
}
|
|
2518
|
-
function
|
|
2519
|
-
if (
|
|
2816
|
+
function wn(e) {
|
|
2817
|
+
if (qn(e))
|
|
2520
2818
|
return;
|
|
2521
2819
|
const r = e.value;
|
|
2522
2820
|
if (r !== void 0) {
|
|
@@ -2526,17 +2824,17 @@ function nn(e) {
|
|
|
2526
2824
|
).map((n) => String(n));
|
|
2527
2825
|
if (t.length === r.length && t.length > 0) {
|
|
2528
2826
|
const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
|
|
2529
|
-
return
|
|
2827
|
+
return sr(`${n}${i}`);
|
|
2530
2828
|
}
|
|
2531
2829
|
return `${r.length} selected`;
|
|
2532
2830
|
}
|
|
2533
|
-
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ?
|
|
2831
|
+
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? sr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
|
|
2534
2832
|
}
|
|
2535
2833
|
}
|
|
2536
|
-
function
|
|
2834
|
+
function sr(e) {
|
|
2537
2835
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2538
2836
|
}
|
|
2539
|
-
function
|
|
2837
|
+
function qn(e) {
|
|
2540
2838
|
var t;
|
|
2541
2839
|
const r = [
|
|
2542
2840
|
e.inputId,
|
|
@@ -2547,177 +2845,180 @@ function on(e) {
|
|
|
2547
2845
|
(n) => r.includes(n)
|
|
2548
2846
|
);
|
|
2549
2847
|
}
|
|
2550
|
-
function
|
|
2551
|
-
const r =
|
|
2552
|
-
return
|
|
2553
|
-
|
|
2554
|
-
}),
|
|
2848
|
+
function xn(e) {
|
|
2849
|
+
const r = [];
|
|
2850
|
+
return Ie(e, (t) => {
|
|
2851
|
+
Cn(t) && r.push(t);
|
|
2852
|
+
}), Yr(r);
|
|
2555
2853
|
}
|
|
2556
|
-
function
|
|
2854
|
+
function An(e) {
|
|
2557
2855
|
switch (e.queryKind) {
|
|
2558
2856
|
case "metric":
|
|
2559
2857
|
case "analysis":
|
|
2560
|
-
return
|
|
2858
|
+
return X([
|
|
2561
2859
|
...e.measures || [],
|
|
2562
2860
|
e.primaryMeasure,
|
|
2563
2861
|
e.dateField,
|
|
2564
2862
|
...e.dimensions || []
|
|
2565
2863
|
]);
|
|
2566
2864
|
case "records":
|
|
2567
|
-
return
|
|
2865
|
+
return X(e.fields || []);
|
|
2568
2866
|
case "inputOptions":
|
|
2569
|
-
return
|
|
2867
|
+
return X([
|
|
2570
2868
|
e.labelField,
|
|
2571
2869
|
e.valueField,
|
|
2572
2870
|
e.searchField,
|
|
2573
2871
|
...e.disambiguationFields || []
|
|
2574
2872
|
]);
|
|
2575
2873
|
case "sql":
|
|
2576
|
-
return
|
|
2874
|
+
return X(e.fields || []);
|
|
2577
2875
|
case "matrix":
|
|
2578
|
-
return
|
|
2579
|
-
...(e.rows || []).map(
|
|
2580
|
-
...(e.columns || []).map(
|
|
2581
|
-
...(e.values || []).map(
|
|
2876
|
+
return X([
|
|
2877
|
+
...(e.rows || []).map(Le),
|
|
2878
|
+
...(e.columns || []).map(Le),
|
|
2879
|
+
...(e.values || []).map(Le)
|
|
2582
2880
|
]);
|
|
2583
2881
|
default:
|
|
2584
|
-
return
|
|
2882
|
+
return xe(e);
|
|
2585
2883
|
}
|
|
2586
2884
|
}
|
|
2587
|
-
function
|
|
2885
|
+
function En(e, r) {
|
|
2588
2886
|
const t = [
|
|
2589
|
-
...(e.inputs || []).map(
|
|
2887
|
+
...(e.inputs || []).map(Dr),
|
|
2590
2888
|
...(r || []).map((n) => n.field)
|
|
2591
2889
|
];
|
|
2592
|
-
return
|
|
2890
|
+
return X(t);
|
|
2593
2891
|
}
|
|
2594
|
-
function
|
|
2892
|
+
function X(e) {
|
|
2595
2893
|
const r = /* @__PURE__ */ new Map();
|
|
2596
2894
|
return e.forEach((t) => {
|
|
2597
|
-
t &&
|
|
2895
|
+
t && fe(t) && r.set(Pe(t), t);
|
|
2598
2896
|
}), [...r.values()];
|
|
2599
2897
|
}
|
|
2600
|
-
function
|
|
2898
|
+
function Dr(e) {
|
|
2601
2899
|
if (!e || typeof e != "object")
|
|
2602
2900
|
return;
|
|
2603
2901
|
const r = e.toAnalyticsInput;
|
|
2604
2902
|
if (typeof r == "function") {
|
|
2605
2903
|
const n = r.call(e);
|
|
2606
|
-
return
|
|
2904
|
+
return Dr(n);
|
|
2607
2905
|
}
|
|
2608
2906
|
const t = e.field;
|
|
2609
|
-
return
|
|
2907
|
+
return fe(t) ? t : void 0;
|
|
2610
2908
|
}
|
|
2611
|
-
function
|
|
2612
|
-
if (
|
|
2909
|
+
function Le(e) {
|
|
2910
|
+
if (fe(e))
|
|
2613
2911
|
return e;
|
|
2614
2912
|
if (!e || typeof e != "object")
|
|
2615
2913
|
return;
|
|
2616
2914
|
const r = e.field;
|
|
2617
|
-
return
|
|
2915
|
+
return fe(r) ? r : void 0;
|
|
2618
2916
|
}
|
|
2619
|
-
function
|
|
2917
|
+
function Tn(e) {
|
|
2620
2918
|
const r = /* @__PURE__ */ new Map();
|
|
2621
|
-
return
|
|
2622
|
-
|
|
2919
|
+
return Ie(e, (t) => {
|
|
2920
|
+
fe(t) && r.set(Pe(t), t);
|
|
2623
2921
|
}), [...r.values()];
|
|
2624
2922
|
}
|
|
2625
|
-
function
|
|
2923
|
+
function Ie(e, r) {
|
|
2626
2924
|
if (!(!e || typeof e != "object")) {
|
|
2627
2925
|
if (r(e), Array.isArray(e)) {
|
|
2628
|
-
e.forEach((t) =>
|
|
2926
|
+
e.forEach((t) => Ie(t, r));
|
|
2629
2927
|
return;
|
|
2630
2928
|
}
|
|
2631
2929
|
Object.values(e).forEach(
|
|
2632
|
-
(t) =>
|
|
2930
|
+
(t) => Ie(t, r)
|
|
2633
2931
|
);
|
|
2634
2932
|
}
|
|
2635
2933
|
}
|
|
2636
|
-
function
|
|
2934
|
+
function Cn(e) {
|
|
2637
2935
|
if (!e || typeof e != "object")
|
|
2638
2936
|
return !1;
|
|
2639
2937
|
const r = e;
|
|
2640
2938
|
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;
|
|
2641
2939
|
}
|
|
2642
|
-
function
|
|
2940
|
+
function fe(e) {
|
|
2643
2941
|
if (!e || typeof e != "object")
|
|
2644
2942
|
return !1;
|
|
2645
2943
|
const r = e;
|
|
2646
2944
|
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
2647
2945
|
}
|
|
2648
|
-
function
|
|
2649
|
-
return e.kind === "semantic" ? [
|
|
2650
|
-
e.kind,
|
|
2651
|
-
e.domainId,
|
|
2652
|
-
e.datasetId || e.datasetName
|
|
2653
|
-
].join(":") : e.kind === "physical" ? [
|
|
2654
|
-
e.kind,
|
|
2655
|
-
e.connectionId,
|
|
2656
|
-
e.databaseName,
|
|
2657
|
-
e.schemaName,
|
|
2658
|
-
e.tableName
|
|
2659
|
-
].join(":") : [e.kind, e.connectionId].join(":");
|
|
2660
|
-
}
|
|
2661
|
-
function Ne(e) {
|
|
2946
|
+
function Pe(e) {
|
|
2662
2947
|
return [
|
|
2663
2948
|
e.name,
|
|
2664
2949
|
e.role,
|
|
2665
2950
|
e.aggregate,
|
|
2666
|
-
e.source ?
|
|
2951
|
+
e.source ? Jr(e.source) : ""
|
|
2667
2952
|
].join(":");
|
|
2668
2953
|
}
|
|
2669
|
-
function
|
|
2954
|
+
function kn(e) {
|
|
2670
2955
|
const r = e;
|
|
2671
2956
|
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
2672
2957
|
}
|
|
2673
|
-
function
|
|
2958
|
+
function Rn(e) {
|
|
2674
2959
|
const r = e;
|
|
2675
2960
|
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
2676
2961
|
}
|
|
2677
|
-
function
|
|
2962
|
+
function ar(e) {
|
|
2678
2963
|
const r = e;
|
|
2679
2964
|
return r == null ? void 0 : r.executionResult;
|
|
2680
2965
|
}
|
|
2681
|
-
function
|
|
2966
|
+
function dr(e) {
|
|
2682
2967
|
const r = e;
|
|
2683
2968
|
return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
|
|
2684
2969
|
}
|
|
2685
|
-
function
|
|
2970
|
+
function Lr(e) {
|
|
2686
2971
|
let r = 2166136261;
|
|
2687
2972
|
for (let t = 0; t < e.length; t += 1)
|
|
2688
2973
|
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
2689
2974
|
return (r >>> 0).toString(36);
|
|
2690
2975
|
}
|
|
2691
|
-
function
|
|
2976
|
+
function ve() {
|
|
2692
2977
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2693
2978
|
}
|
|
2694
|
-
function
|
|
2979
|
+
function Qe() {
|
|
2695
2980
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2696
2981
|
}
|
|
2697
|
-
const
|
|
2982
|
+
const Dn = [
|
|
2983
|
+
"primary",
|
|
2984
|
+
"comparisons",
|
|
2985
|
+
"contributors",
|
|
2986
|
+
"segments",
|
|
2987
|
+
"periodChanges",
|
|
2698
2988
|
"records",
|
|
2699
2989
|
"changes",
|
|
2700
2990
|
"drivers",
|
|
2991
|
+
"absoluteDeltaDrivers",
|
|
2701
2992
|
"largestNegativeChanges",
|
|
2702
2993
|
"largestPositiveChanges",
|
|
2703
2994
|
"largestNegativeDrivers",
|
|
2704
2995
|
"largestPositiveDrivers"
|
|
2705
|
-
],
|
|
2996
|
+
], Ln = [
|
|
2997
|
+
"primary",
|
|
2706
2998
|
"records",
|
|
2999
|
+
"periodChanges",
|
|
2707
3000
|
"changes",
|
|
3001
|
+
"comparisons",
|
|
3002
|
+
"contributors",
|
|
3003
|
+
"segments",
|
|
2708
3004
|
"drivers",
|
|
3005
|
+
"absoluteDeltaDrivers",
|
|
2709
3006
|
"largestNegativeChanges",
|
|
2710
3007
|
"largestPositiveChanges",
|
|
2711
3008
|
"largestNegativeDrivers",
|
|
2712
3009
|
"largestPositiveDrivers"
|
|
2713
3010
|
];
|
|
2714
|
-
function
|
|
3011
|
+
function Or(e) {
|
|
2715
3012
|
if (!e)
|
|
2716
3013
|
return {};
|
|
2717
|
-
const r =
|
|
3014
|
+
const r = _n(e.executionResult), t = On(e, r), n = Kn(t), i = Br(
|
|
3015
|
+
Ue(e.analysisWarnings),
|
|
3016
|
+
zn(t)
|
|
3017
|
+
);
|
|
2718
3018
|
return {
|
|
2719
3019
|
...e,
|
|
2720
3020
|
...Object.keys(t).length ? { resultSets: t } : {},
|
|
3021
|
+
...i.length ? { analysisWarnings: i } : {},
|
|
2721
3022
|
...n ? {
|
|
2722
3023
|
columns: n.columns,
|
|
2723
3024
|
records: n.records,
|
|
@@ -2725,84 +3026,121 @@ function Ir(e) {
|
|
|
2725
3026
|
} : {}
|
|
2726
3027
|
};
|
|
2727
3028
|
}
|
|
2728
|
-
function
|
|
2729
|
-
const t =
|
|
2730
|
-
for (const i of
|
|
2731
|
-
if (t[i])
|
|
2732
|
-
t[i] = qr(t[i]);
|
|
3029
|
+
function On(e, r) {
|
|
3030
|
+
const t = Bn(e.resultSets);
|
|
3031
|
+
for (const i of Dn) {
|
|
3032
|
+
if (t[i])
|
|
2733
3033
|
continue;
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
if (!d.length)
|
|
3034
|
+
const o = Nn(e[i]);
|
|
3035
|
+
if (!o.length)
|
|
2737
3036
|
continue;
|
|
2738
|
-
const
|
|
3037
|
+
const u = r.length ? r : Fn(o);
|
|
2739
3038
|
t[i] = {
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
3039
|
+
id: i,
|
|
3040
|
+
role: i,
|
|
3041
|
+
...Ve({
|
|
3042
|
+
records: o,
|
|
3043
|
+
columns: u,
|
|
3044
|
+
resultSetKey: i
|
|
3045
|
+
}),
|
|
3046
|
+
columns: u,
|
|
3047
|
+
rowCount: o.length
|
|
2743
3048
|
};
|
|
2744
3049
|
}
|
|
2745
|
-
const n =
|
|
3050
|
+
const n = Wn(e.executionResult);
|
|
2746
3051
|
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
2747
3052
|
}
|
|
2748
|
-
function
|
|
3053
|
+
function Bn(e) {
|
|
2749
3054
|
return Object.fromEntries(
|
|
2750
3055
|
Object.entries(e || {}).map(([r, t]) => [
|
|
2751
3056
|
r,
|
|
2752
|
-
|
|
3057
|
+
$n(t, r)
|
|
2753
3058
|
])
|
|
2754
3059
|
);
|
|
2755
3060
|
}
|
|
2756
|
-
function
|
|
2757
|
-
var
|
|
3061
|
+
function $n(e, r = e.id || e.role || "resultSet") {
|
|
3062
|
+
var n;
|
|
3063
|
+
const t = Ve({
|
|
3064
|
+
records: e.records || [],
|
|
3065
|
+
columns: e.columns || [],
|
|
3066
|
+
resultSetKey: r
|
|
3067
|
+
});
|
|
2758
3068
|
return {
|
|
2759
3069
|
...e,
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
3070
|
+
...t,
|
|
3071
|
+
...e.warnings || t.warnings ? {
|
|
3072
|
+
warnings: Br(
|
|
3073
|
+
Ue(e.warnings),
|
|
3074
|
+
t.warnings
|
|
3075
|
+
)
|
|
3076
|
+
} : {},
|
|
3077
|
+
rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
|
|
2765
3078
|
};
|
|
2766
3079
|
}
|
|
2767
|
-
function
|
|
3080
|
+
function Kn(e) {
|
|
2768
3081
|
var r;
|
|
2769
|
-
for (const t of
|
|
3082
|
+
for (const t of Ln)
|
|
2770
3083
|
if ((r = e[t]) != null && r.records.length)
|
|
2771
3084
|
return e[t];
|
|
2772
3085
|
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
2773
3086
|
}
|
|
2774
|
-
function
|
|
3087
|
+
function Wn(e) {
|
|
2775
3088
|
const r = e == null ? void 0 : e.result;
|
|
2776
3089
|
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
2777
3090
|
return {
|
|
2778
|
-
|
|
3091
|
+
id: "records",
|
|
3092
|
+
role: "records",
|
|
3093
|
+
...Ve({
|
|
3094
|
+
records: r.records,
|
|
3095
|
+
columns: r.columns,
|
|
3096
|
+
resultSetKey: "records"
|
|
3097
|
+
}),
|
|
2779
3098
|
columns: r.columns,
|
|
2780
3099
|
rowCount: r.rowCount ?? r.records.length
|
|
2781
3100
|
};
|
|
2782
3101
|
}
|
|
2783
|
-
function
|
|
3102
|
+
function _n(e) {
|
|
2784
3103
|
const r = e == null ? void 0 : e.result;
|
|
2785
3104
|
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
2786
3105
|
}
|
|
2787
|
-
function
|
|
3106
|
+
function Nn(e) {
|
|
2788
3107
|
return Array.isArray(e) ? e.filter(
|
|
2789
3108
|
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
2790
3109
|
) : [];
|
|
2791
3110
|
}
|
|
2792
|
-
function
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
3111
|
+
function Ve({
|
|
3112
|
+
records: e,
|
|
3113
|
+
columns: r,
|
|
3114
|
+
resultSetKey: t
|
|
3115
|
+
}) {
|
|
3116
|
+
if (!r.length)
|
|
3117
|
+
return { records: e };
|
|
3118
|
+
const n = [];
|
|
3119
|
+
return {
|
|
3120
|
+
records: e.map((o, u) => {
|
|
3121
|
+
const f = {};
|
|
3122
|
+
return r.forEach((d) => {
|
|
3123
|
+
if (Object.prototype.hasOwnProperty.call(o, d.key)) {
|
|
3124
|
+
f[d.key] = o[d.key];
|
|
3125
|
+
return;
|
|
3126
|
+
}
|
|
3127
|
+
n.push({
|
|
3128
|
+
code: "missing_analysis_result_key",
|
|
3129
|
+
severity: "warning",
|
|
3130
|
+
resultSetKey: t,
|
|
3131
|
+
rowIndex: u,
|
|
3132
|
+
columnKey: d.key,
|
|
3133
|
+
...d.name ? { columnName: d.name } : {},
|
|
3134
|
+
...d.label ? { columnLabel: d.label } : {},
|
|
3135
|
+
availableKeys: Object.keys(o),
|
|
3136
|
+
message: `Analysis result set "${t}" row ${u} is missing column key "${d.key}". Rows must expose values by column.key; labels and column names are display metadata only.`
|
|
3137
|
+
});
|
|
3138
|
+
}), f;
|
|
3139
|
+
}),
|
|
3140
|
+
...n.length ? { warnings: n } : {}
|
|
3141
|
+
};
|
|
2804
3142
|
}
|
|
2805
|
-
function
|
|
3143
|
+
function Fn(e) {
|
|
2806
3144
|
return Array.from(
|
|
2807
3145
|
new Set(e.flatMap((t) => Object.keys(t)))
|
|
2808
3146
|
).map((t) => ({
|
|
@@ -2811,338 +3149,329 @@ function wn(e) {
|
|
|
2811
3149
|
label: t
|
|
2812
3150
|
}));
|
|
2813
3151
|
}
|
|
2814
|
-
function
|
|
2815
|
-
|
|
2816
|
-
r.
|
|
2817
|
-
|
|
2818
|
-
...r.fallbackNames || []
|
|
2819
|
-
].filter((n) => !!n);
|
|
2820
|
-
for (const n of t)
|
|
2821
|
-
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
2822
|
-
return e[n];
|
|
2823
|
-
}
|
|
2824
|
-
function In() {
|
|
2825
|
-
return {
|
|
2826
|
-
executeAnalysis: (e, r, t) => G(
|
|
2827
|
-
e,
|
|
2828
|
-
r,
|
|
2829
|
-
t ?? {}
|
|
2830
|
-
).then(Ir),
|
|
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)
|
|
2836
|
-
};
|
|
2837
|
-
}
|
|
2838
|
-
async function G(e, r, t) {
|
|
2839
|
-
if (!r.token)
|
|
2840
|
-
throw new Error(
|
|
2841
|
-
"SemaphorDataAppProvider needs a token to execute queries."
|
|
2842
|
-
);
|
|
2843
|
-
const n = Dn(r), i = An(e, n);
|
|
2844
|
-
let d;
|
|
2845
|
-
try {
|
|
2846
|
-
d = await fetch(n, {
|
|
2847
|
-
method: "POST",
|
|
2848
|
-
headers: {
|
|
2849
|
-
"Content-Type": "application/json",
|
|
2850
|
-
Authorization: `Bearer ${r.token}`
|
|
2851
|
-
},
|
|
2852
|
-
body: JSON.stringify({
|
|
2853
|
-
intent: e,
|
|
2854
|
-
activeInputs: r.activeInputs,
|
|
2855
|
-
...t ? { analysisOptions: t } : {},
|
|
2856
|
-
resultShape: e.kind,
|
|
2857
|
-
...Rn(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
2858
|
-
})
|
|
2859
|
-
});
|
|
2860
|
-
} catch (c) {
|
|
2861
|
-
throw new Error(
|
|
2862
|
-
`${i}: ${c instanceof Error ? c.message : String(c)}`
|
|
2863
|
-
);
|
|
2864
|
-
}
|
|
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}.`}`,
|
|
2869
|
-
l
|
|
2870
|
-
);
|
|
2871
|
-
return l;
|
|
2872
|
-
}
|
|
2873
|
-
function qn(e, r) {
|
|
2874
|
-
const t = new Error(e);
|
|
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;
|
|
2876
|
-
}
|
|
2877
|
-
function Rn(e) {
|
|
2878
|
-
const r = e.debug;
|
|
2879
|
-
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
2880
|
-
}
|
|
2881
|
-
function An(e, r) {
|
|
2882
|
-
return [
|
|
2883
|
-
`Semaphor ${e.kind} query`,
|
|
2884
|
-
e.id ? `id=${e.id}` : void 0,
|
|
2885
|
-
e.label ? `label=${e.label}` : void 0,
|
|
2886
|
-
En(e),
|
|
2887
|
-
`endpoint=${Tn(r)}`
|
|
2888
|
-
].filter((t) => !!t).join(" ");
|
|
2889
|
-
}
|
|
2890
|
-
function En(e) {
|
|
2891
|
-
const r = "source" in e ? e.source : void 0;
|
|
2892
|
-
if (!(!r || typeof r != "object")) {
|
|
2893
|
-
if (r.kind === "semantic")
|
|
2894
|
-
return `source=${[
|
|
2895
|
-
r.domainId,
|
|
2896
|
-
r.datasetId || r.datasetName
|
|
2897
|
-
].filter(Boolean).join("/")}`;
|
|
2898
|
-
if (r.kind === "physical")
|
|
2899
|
-
return `source=${[
|
|
2900
|
-
r.connectionId,
|
|
2901
|
-
r.databaseName,
|
|
2902
|
-
r.schemaName,
|
|
2903
|
-
r.tableName
|
|
2904
|
-
].filter(Boolean).join("/")}`;
|
|
2905
|
-
if (r.kind === "sql")
|
|
2906
|
-
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
function Tn(e) {
|
|
2910
|
-
if (!e)
|
|
2911
|
-
return "/api/v1/data-app/execute";
|
|
2912
|
-
try {
|
|
2913
|
-
return new URL(e, "http://localhost").pathname;
|
|
2914
|
-
} catch {
|
|
2915
|
-
return e;
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
async function kn(e) {
|
|
2919
|
-
const r = await e.text().catch(() => "");
|
|
2920
|
-
if (!r.trim())
|
|
2921
|
-
return e.ok ? {
|
|
2922
|
-
error: "Semaphor Data App execution returned an empty response."
|
|
2923
|
-
} : {};
|
|
2924
|
-
try {
|
|
2925
|
-
return JSON.parse(r);
|
|
2926
|
-
} catch {
|
|
2927
|
-
return e.ok ? {
|
|
2928
|
-
error: "Semaphor Data App execution returned invalid JSON.",
|
|
2929
|
-
details: r
|
|
2930
|
-
} : {
|
|
2931
|
-
error: Cn(e, r),
|
|
2932
|
-
details: r
|
|
2933
|
-
};
|
|
2934
|
-
}
|
|
3152
|
+
function zn(e) {
|
|
3153
|
+
return Object.values(e).flatMap(
|
|
3154
|
+
(r) => Ue(r.warnings)
|
|
3155
|
+
);
|
|
2935
3156
|
}
|
|
2936
|
-
function
|
|
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}.`;
|
|
3157
|
+
function Ue(e) {
|
|
3158
|
+
return Array.isArray(e) ? e.filter(Mn) : [];
|
|
2939
3159
|
}
|
|
2940
|
-
function
|
|
2941
|
-
|
|
2942
|
-
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
3160
|
+
function Mn(e) {
|
|
3161
|
+
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
2943
3162
|
}
|
|
2944
|
-
function
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
try {
|
|
2950
|
-
return jr(e.token).apiServiceUrl || "";
|
|
2951
|
-
} catch {
|
|
2952
|
-
return "";
|
|
3163
|
+
function Br(...e) {
|
|
3164
|
+
const r = /* @__PURE__ */ new Set(), t = [];
|
|
3165
|
+
for (const n of e.flatMap((i) => i || [])) {
|
|
3166
|
+
const i = Hn(n);
|
|
3167
|
+
r.has(i) || (r.add(i), t.push(n));
|
|
2953
3168
|
}
|
|
3169
|
+
return t;
|
|
2954
3170
|
}
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
3171
|
+
function Hn(e) {
|
|
3172
|
+
return e.code === "missing_analysis_result_key" ? [
|
|
3173
|
+
e.code,
|
|
3174
|
+
e.resultSetKey,
|
|
3175
|
+
e.rowIndex,
|
|
3176
|
+
e.columnKey
|
|
3177
|
+
].join(":") : Ne(e);
|
|
2959
3178
|
}
|
|
2960
|
-
function
|
|
2961
|
-
|
|
3179
|
+
function Ne(e) {
|
|
3180
|
+
if (!e || typeof e != "object")
|
|
3181
|
+
return JSON.stringify(e);
|
|
3182
|
+
if (Array.isArray(e))
|
|
3183
|
+
return `[${e.map((t) => Ne(t)).join(",")}]`;
|
|
3184
|
+
const r = e;
|
|
3185
|
+
return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${Ne(r[t])}`).join(",")}}`;
|
|
2962
3186
|
}
|
|
2963
|
-
const
|
|
2964
|
-
function
|
|
2965
|
-
const r =
|
|
3187
|
+
const Oe = { value: null }, Be = {}, jn = { records: [] }, $e = { options: [] }, Pn = { records: [] }, Ke = {};
|
|
3188
|
+
function Qn(e) {
|
|
3189
|
+
const r = Z(e.inputs), t = Pr(e);
|
|
2966
3190
|
try {
|
|
2967
|
-
const n =
|
|
3191
|
+
const n = Qr(e), i = re(n, "analysis");
|
|
2968
3192
|
return i ? {
|
|
2969
3193
|
error: i,
|
|
2970
3194
|
activeInputs: r,
|
|
2971
3195
|
analysisOptions: t,
|
|
2972
|
-
queryKey:
|
|
3196
|
+
queryKey: x(
|
|
2973
3197
|
void 0,
|
|
2974
3198
|
r,
|
|
2975
3199
|
i,
|
|
2976
3200
|
t
|
|
2977
3201
|
),
|
|
2978
|
-
idleData:
|
|
3202
|
+
idleData: Be
|
|
2979
3203
|
} : {
|
|
2980
3204
|
intent: n,
|
|
2981
3205
|
error: null,
|
|
2982
3206
|
activeInputs: r,
|
|
2983
3207
|
analysisOptions: t,
|
|
2984
|
-
queryKey:
|
|
2985
|
-
idleData:
|
|
3208
|
+
queryKey: x(n, r, void 0, t),
|
|
3209
|
+
idleData: Be
|
|
2986
3210
|
};
|
|
2987
3211
|
} catch (n) {
|
|
2988
|
-
const i =
|
|
3212
|
+
const i = ee(n, "analysis");
|
|
2989
3213
|
return {
|
|
2990
3214
|
error: i,
|
|
2991
3215
|
activeInputs: r,
|
|
2992
3216
|
analysisOptions: t,
|
|
2993
|
-
queryKey:
|
|
3217
|
+
queryKey: x(
|
|
2994
3218
|
void 0,
|
|
2995
3219
|
r,
|
|
2996
3220
|
i,
|
|
2997
3221
|
t
|
|
2998
3222
|
),
|
|
2999
|
-
idleData:
|
|
3223
|
+
idleData: Be
|
|
3000
3224
|
};
|
|
3001
3225
|
}
|
|
3002
3226
|
}
|
|
3003
|
-
function
|
|
3004
|
-
const r =
|
|
3227
|
+
function Vn(e) {
|
|
3228
|
+
const r = Z(e.inputs);
|
|
3005
3229
|
try {
|
|
3006
|
-
const t =
|
|
3230
|
+
const t = Vr(e), n = re(t);
|
|
3007
3231
|
return n ? {
|
|
3008
3232
|
error: n,
|
|
3009
3233
|
activeInputs: r,
|
|
3010
|
-
queryKey:
|
|
3011
|
-
idleData:
|
|
3234
|
+
queryKey: x(void 0, r, n),
|
|
3235
|
+
idleData: Oe
|
|
3012
3236
|
} : {
|
|
3013
3237
|
intent: t,
|
|
3014
3238
|
error: null,
|
|
3015
3239
|
activeInputs: r,
|
|
3016
|
-
queryKey:
|
|
3017
|
-
idleData:
|
|
3240
|
+
queryKey: x(t, r),
|
|
3241
|
+
idleData: Oe
|
|
3018
3242
|
};
|
|
3019
3243
|
} catch (t) {
|
|
3020
|
-
const n =
|
|
3244
|
+
const n = ee(t, "metric");
|
|
3021
3245
|
return {
|
|
3022
3246
|
error: n,
|
|
3023
3247
|
activeInputs: r,
|
|
3024
|
-
queryKey:
|
|
3025
|
-
idleData:
|
|
3248
|
+
queryKey: x(void 0, r, n),
|
|
3249
|
+
idleData: Oe
|
|
3026
3250
|
};
|
|
3027
3251
|
}
|
|
3028
3252
|
}
|
|
3029
|
-
function
|
|
3030
|
-
const r =
|
|
3253
|
+
function Un(e) {
|
|
3254
|
+
const r = Z(e.inputs), t = jn;
|
|
3031
3255
|
try {
|
|
3032
|
-
const n =
|
|
3256
|
+
const n = jr(e), i = re(n);
|
|
3033
3257
|
return i ? {
|
|
3034
3258
|
error: i,
|
|
3035
3259
|
activeInputs: r,
|
|
3036
|
-
queryKey:
|
|
3260
|
+
queryKey: x(void 0, r, i),
|
|
3037
3261
|
idleData: t
|
|
3038
3262
|
} : {
|
|
3039
3263
|
intent: n,
|
|
3040
3264
|
error: null,
|
|
3041
3265
|
activeInputs: r,
|
|
3042
|
-
queryKey:
|
|
3266
|
+
queryKey: x(n, r),
|
|
3043
3267
|
idleData: t
|
|
3044
3268
|
};
|
|
3045
3269
|
} catch (n) {
|
|
3046
|
-
const i =
|
|
3270
|
+
const i = ee(n, "records");
|
|
3047
3271
|
return {
|
|
3048
3272
|
error: i,
|
|
3049
3273
|
activeInputs: r,
|
|
3050
|
-
queryKey:
|
|
3274
|
+
queryKey: x(void 0, r, i),
|
|
3051
3275
|
idleData: t
|
|
3052
3276
|
};
|
|
3053
3277
|
}
|
|
3054
3278
|
}
|
|
3055
|
-
function
|
|
3056
|
-
const r =
|
|
3279
|
+
function Gn(e) {
|
|
3280
|
+
const r = Z(e.inputs);
|
|
3057
3281
|
try {
|
|
3058
|
-
const t =
|
|
3282
|
+
const t = Hr(e), n = re(t);
|
|
3059
3283
|
return n ? {
|
|
3060
3284
|
error: n,
|
|
3061
3285
|
activeInputs: r,
|
|
3062
|
-
queryKey:
|
|
3063
|
-
idleData:
|
|
3286
|
+
queryKey: x(void 0, r, n),
|
|
3287
|
+
idleData: $e
|
|
3064
3288
|
} : {
|
|
3065
3289
|
intent: t,
|
|
3066
3290
|
error: null,
|
|
3067
3291
|
activeInputs: r,
|
|
3068
|
-
queryKey:
|
|
3069
|
-
idleData:
|
|
3292
|
+
queryKey: x(t, r),
|
|
3293
|
+
idleData: $e
|
|
3070
3294
|
};
|
|
3071
3295
|
} catch (t) {
|
|
3072
|
-
const n =
|
|
3296
|
+
const n = ee(t, "inputOptions");
|
|
3073
3297
|
return {
|
|
3074
3298
|
error: n,
|
|
3075
3299
|
activeInputs: r,
|
|
3076
|
-
queryKey:
|
|
3077
|
-
idleData:
|
|
3300
|
+
queryKey: x(void 0, r, n),
|
|
3301
|
+
idleData: $e
|
|
3078
3302
|
};
|
|
3079
3303
|
}
|
|
3080
3304
|
}
|
|
3081
|
-
function
|
|
3082
|
-
const r =
|
|
3305
|
+
function Jn(e) {
|
|
3306
|
+
const r = Z(e.inputs), t = Pn;
|
|
3083
3307
|
try {
|
|
3084
|
-
const n =
|
|
3308
|
+
const n = Mr(e), i = re(n);
|
|
3085
3309
|
return i ? {
|
|
3086
3310
|
error: i,
|
|
3087
3311
|
activeInputs: r,
|
|
3088
|
-
queryKey:
|
|
3312
|
+
queryKey: x(void 0, r, i),
|
|
3089
3313
|
idleData: t
|
|
3090
3314
|
} : {
|
|
3091
3315
|
intent: n,
|
|
3092
3316
|
error: null,
|
|
3093
3317
|
activeInputs: r,
|
|
3094
|
-
queryKey:
|
|
3318
|
+
queryKey: x(n, r),
|
|
3095
3319
|
idleData: t
|
|
3096
3320
|
};
|
|
3097
3321
|
} catch (n) {
|
|
3098
|
-
const i =
|
|
3322
|
+
const i = ee(n, "sql");
|
|
3099
3323
|
return {
|
|
3100
3324
|
error: i,
|
|
3101
3325
|
activeInputs: r,
|
|
3102
|
-
queryKey:
|
|
3326
|
+
queryKey: x(void 0, r, i),
|
|
3103
3327
|
idleData: t
|
|
3104
3328
|
};
|
|
3105
3329
|
}
|
|
3106
3330
|
}
|
|
3107
|
-
function
|
|
3108
|
-
const r =
|
|
3331
|
+
function Yn(e) {
|
|
3332
|
+
const r = Z(e.inputs);
|
|
3109
3333
|
try {
|
|
3110
|
-
const t =
|
|
3334
|
+
const t = zr(e), n = re(t);
|
|
3111
3335
|
return n ? {
|
|
3112
3336
|
error: n,
|
|
3113
3337
|
activeInputs: r,
|
|
3114
|
-
queryKey:
|
|
3115
|
-
idleData:
|
|
3338
|
+
queryKey: x(void 0, r, n),
|
|
3339
|
+
idleData: Ke
|
|
3116
3340
|
} : {
|
|
3117
3341
|
intent: t,
|
|
3118
3342
|
error: null,
|
|
3119
3343
|
activeInputs: r,
|
|
3120
|
-
queryKey:
|
|
3121
|
-
idleData:
|
|
3344
|
+
queryKey: x(t, r),
|
|
3345
|
+
idleData: Ke
|
|
3122
3346
|
};
|
|
3123
3347
|
} catch (t) {
|
|
3124
|
-
const n =
|
|
3348
|
+
const n = ee(t, "matrix");
|
|
3125
3349
|
return {
|
|
3126
3350
|
error: n,
|
|
3127
3351
|
activeInputs: r,
|
|
3128
|
-
queryKey:
|
|
3129
|
-
idleData:
|
|
3352
|
+
queryKey: x(void 0, r, n),
|
|
3353
|
+
idleData: Ke
|
|
3130
3354
|
};
|
|
3131
3355
|
}
|
|
3132
3356
|
}
|
|
3133
|
-
function
|
|
3134
|
-
|
|
3357
|
+
function Fe(e) {
|
|
3358
|
+
var o;
|
|
3359
|
+
if (Xn(e))
|
|
3360
|
+
return e;
|
|
3361
|
+
const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ae(
|
|
3362
|
+
(r == null ? void 0 : r.message) ?? String(e),
|
|
3363
|
+
{
|
|
3364
|
+
requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
|
|
3365
|
+
details: t == null ? void 0 : t.details,
|
|
3366
|
+
executionResult: n,
|
|
3367
|
+
validation: (t == null ? void 0 : t.validation) ?? (n == null ? void 0 : n.validation),
|
|
3368
|
+
validationIssues: (t == null ? void 0 : t.validationIssues) ?? ((o = n == null ? void 0 : n.validation) == null ? void 0 : o.errors)
|
|
3369
|
+
}
|
|
3370
|
+
);
|
|
3371
|
+
return i.name = (r == null ? void 0 : r.name) || i.name, i.stack = r == null ? void 0 : r.stack, i;
|
|
3372
|
+
}
|
|
3373
|
+
function ee(e, r) {
|
|
3374
|
+
const t = Fe(e);
|
|
3375
|
+
if (t.executionResult || t.validation)
|
|
3376
|
+
return t;
|
|
3377
|
+
const n = {
|
|
3378
|
+
ok: !1,
|
|
3379
|
+
errors: [
|
|
3380
|
+
{
|
|
3381
|
+
code: "invalid_query_spec",
|
|
3382
|
+
message: t.message,
|
|
3383
|
+
path: "spec"
|
|
3384
|
+
}
|
|
3385
|
+
],
|
|
3386
|
+
warnings: [],
|
|
3387
|
+
repairHints: [
|
|
3388
|
+
{
|
|
3389
|
+
code: "invalid_query_spec",
|
|
3390
|
+
message: t.message,
|
|
3391
|
+
recommendedNextStep: "Update the Data App query spec to satisfy the SDK builder contract."
|
|
3392
|
+
}
|
|
3393
|
+
]
|
|
3394
|
+
}, i = $r(
|
|
3395
|
+
void 0,
|
|
3396
|
+
r,
|
|
3397
|
+
n
|
|
3398
|
+
), o = Ae(t.message, {
|
|
3399
|
+
executionResult: i,
|
|
3400
|
+
validation: n,
|
|
3401
|
+
validationIssues: n.errors
|
|
3402
|
+
});
|
|
3403
|
+
return o.stack = t.stack, o;
|
|
3404
|
+
}
|
|
3405
|
+
function Ae(e, r = {}) {
|
|
3406
|
+
var i, o, u;
|
|
3407
|
+
const t = new Error(e);
|
|
3408
|
+
t.name = "SemaphorDataAppQueryError", t.kind = "data_app_query_error", r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), r.validation !== void 0 && (t.validation = r.validation);
|
|
3409
|
+
const n = r.validationIssues ?? ((i = r.validation) == null ? void 0 : i.errors) ?? ((u = (o = r.executionResult) == null ? void 0 : o.validation) == null ? void 0 : u.errors);
|
|
3410
|
+
return n !== void 0 && (t.validationIssues = n), t;
|
|
3411
|
+
}
|
|
3412
|
+
function Xn(e) {
|
|
3413
|
+
return e instanceof Error && e.kind === "data_app_query_error";
|
|
3135
3414
|
}
|
|
3136
|
-
function
|
|
3137
|
-
const
|
|
3138
|
-
if (
|
|
3415
|
+
function re(e, r = e.kind) {
|
|
3416
|
+
const t = st(e);
|
|
3417
|
+
if (t.ok)
|
|
3139
3418
|
return null;
|
|
3140
|
-
const
|
|
3141
|
-
(
|
|
3142
|
-
).join("; ")
|
|
3143
|
-
|
|
3419
|
+
const n = t.errors.map(
|
|
3420
|
+
(o) => o.path ? `${o.code} at ${o.path}: ${o.message}` : `${o.code}: ${o.message}`
|
|
3421
|
+
).join("; "), i = $r(
|
|
3422
|
+
e,
|
|
3423
|
+
r,
|
|
3424
|
+
t
|
|
3425
|
+
);
|
|
3426
|
+
return Ae(
|
|
3427
|
+
`Invalid Semaphor analytics intent. ${n}`,
|
|
3428
|
+
{
|
|
3429
|
+
executionResult: i,
|
|
3430
|
+
validation: t,
|
|
3431
|
+
validationIssues: t.errors
|
|
3432
|
+
}
|
|
3433
|
+
);
|
|
3434
|
+
}
|
|
3435
|
+
function $r(e, r, t) {
|
|
3436
|
+
return {
|
|
3437
|
+
...e != null && e.id ? { intentId: e.id } : {},
|
|
3438
|
+
...e ? { intent: e } : {},
|
|
3439
|
+
status: "failed",
|
|
3440
|
+
resultShape: r,
|
|
3441
|
+
validation: t,
|
|
3442
|
+
coverage: {
|
|
3443
|
+
answeredObligations: [],
|
|
3444
|
+
missingObligations: ["query_spec_validation"],
|
|
3445
|
+
warnings: t.warnings
|
|
3446
|
+
},
|
|
3447
|
+
missingFields: t.errors.filter((n) => n.code === "missing_field").flatMap((n) => {
|
|
3448
|
+
var o;
|
|
3449
|
+
const i = n.path || ((o = n.repairHint) == null ? void 0 : o.invalidField);
|
|
3450
|
+
return i ? [i] : [];
|
|
3451
|
+
}),
|
|
3452
|
+
warnings: t.warnings.map((n) => n.message),
|
|
3453
|
+
diagnosticFeedback: {
|
|
3454
|
+
version: 1,
|
|
3455
|
+
status: "blocked",
|
|
3456
|
+
summary: "Data App query spec validation failed.",
|
|
3457
|
+
answered: [],
|
|
3458
|
+
blocked: t.errors.map((n) => {
|
|
3459
|
+
var o, u;
|
|
3460
|
+
const i = {
|
|
3461
|
+
reasonCode: "query_validation_failed",
|
|
3462
|
+
message: n.message
|
|
3463
|
+
};
|
|
3464
|
+
return n.code === "missing_field" && (i.missingFields = [
|
|
3465
|
+
n.path || ((o = n.repairHint) == null ? void 0 : o.invalidField) || n.message
|
|
3466
|
+
]), (u = n.repairHint) != null && u.recommendedNextStep && (i.recommendedNextStep = n.repairHint.recommendedNextStep), i;
|
|
3467
|
+
})
|
|
3468
|
+
},
|
|
3469
|
+
metadata: {
|
|
3470
|
+
validationKind: "data_app_sdk_query_spec"
|
|
3471
|
+
}
|
|
3472
|
+
};
|
|
3144
3473
|
}
|
|
3145
|
-
function
|
|
3474
|
+
function x(e, r, t, n) {
|
|
3146
3475
|
return JSON.stringify({
|
|
3147
3476
|
intent: e,
|
|
3148
3477
|
activeInputs: r,
|
|
@@ -3150,90 +3479,234 @@ function q(e, r, t, n) {
|
|
|
3150
3479
|
error: t == null ? void 0 : t.message
|
|
3151
3480
|
});
|
|
3152
3481
|
}
|
|
3153
|
-
function
|
|
3154
|
-
|
|
3155
|
-
() =>
|
|
3482
|
+
function Zn() {
|
|
3483
|
+
return {
|
|
3484
|
+
executeAnalysis: (e, r, t) => J(
|
|
3485
|
+
e,
|
|
3486
|
+
r,
|
|
3487
|
+
t ?? {}
|
|
3488
|
+
).then(Or),
|
|
3489
|
+
executeMetric: (e, r) => J(e, r),
|
|
3490
|
+
executeRecords: (e, r) => J(e, r),
|
|
3491
|
+
executeInputOptions: (e, r) => J(e, r),
|
|
3492
|
+
executeSql: (e, r) => J(e, r),
|
|
3493
|
+
executeMatrix: (e, r) => J(e, r)
|
|
3494
|
+
};
|
|
3495
|
+
}
|
|
3496
|
+
async function J(e, r, t) {
|
|
3497
|
+
if (!r.token)
|
|
3498
|
+
throw new Error(
|
|
3499
|
+
"SemaphorDataAppProvider needs a token to execute queries."
|
|
3500
|
+
);
|
|
3501
|
+
const n = ai(r), i = ti(e, n);
|
|
3502
|
+
let o;
|
|
3503
|
+
try {
|
|
3504
|
+
o = await fetch(n, {
|
|
3505
|
+
method: "POST",
|
|
3506
|
+
headers: {
|
|
3507
|
+
"Content-Type": "application/json",
|
|
3508
|
+
Authorization: `Bearer ${r.token}`
|
|
3509
|
+
},
|
|
3510
|
+
body: JSON.stringify({
|
|
3511
|
+
intent: e,
|
|
3512
|
+
activeInputs: r.activeInputs,
|
|
3513
|
+
...t ? { analysisOptions: t } : {},
|
|
3514
|
+
resultShape: e.kind,
|
|
3515
|
+
...ri(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
3516
|
+
})
|
|
3517
|
+
});
|
|
3518
|
+
} catch (f) {
|
|
3519
|
+
throw new Error(
|
|
3520
|
+
`${i}: ${f instanceof Error ? f.message : String(f)}`
|
|
3521
|
+
);
|
|
3522
|
+
}
|
|
3523
|
+
const u = await oi(o);
|
|
3524
|
+
if (!o.ok || u.error)
|
|
3525
|
+
throw ei(
|
|
3526
|
+
`${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
|
|
3527
|
+
u
|
|
3528
|
+
);
|
|
3529
|
+
return u;
|
|
3530
|
+
}
|
|
3531
|
+
function ei(e, r) {
|
|
3532
|
+
var t;
|
|
3533
|
+
return Ae(e, {
|
|
3534
|
+
requestId: r.requestId,
|
|
3535
|
+
details: r.details,
|
|
3536
|
+
executionResult: r.executionResult,
|
|
3537
|
+
validation: (t = r.executionResult) == null ? void 0 : t.validation
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
function ri(e) {
|
|
3541
|
+
const r = e.debug;
|
|
3542
|
+
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
3543
|
+
}
|
|
3544
|
+
function ti(e, r) {
|
|
3545
|
+
return [
|
|
3546
|
+
`Semaphor ${e.kind} query`,
|
|
3547
|
+
e.id ? `id=${e.id}` : void 0,
|
|
3548
|
+
e.label ? `label=${e.label}` : void 0,
|
|
3549
|
+
ni(e),
|
|
3550
|
+
`endpoint=${ii(r)}`
|
|
3551
|
+
].filter((t) => !!t).join(" ");
|
|
3552
|
+
}
|
|
3553
|
+
function ni(e) {
|
|
3554
|
+
const r = "source" in e ? e.source : void 0;
|
|
3555
|
+
if (!(!r || typeof r != "object")) {
|
|
3556
|
+
if (r.kind === "semantic")
|
|
3557
|
+
return `source=${[
|
|
3558
|
+
r.domainId,
|
|
3559
|
+
r.datasetId || r.datasetName
|
|
3560
|
+
].filter(Boolean).join("/")}`;
|
|
3561
|
+
if (r.kind === "physical")
|
|
3562
|
+
return `source=${[
|
|
3563
|
+
r.connectionId,
|
|
3564
|
+
r.databaseName,
|
|
3565
|
+
r.schemaName,
|
|
3566
|
+
r.tableName
|
|
3567
|
+
].filter(Boolean).join("/")}`;
|
|
3568
|
+
if (r.kind === "sql")
|
|
3569
|
+
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
function ii(e) {
|
|
3573
|
+
if (!e)
|
|
3574
|
+
return "/api/v1/data-app/execute";
|
|
3575
|
+
try {
|
|
3576
|
+
return new URL(e, "http://localhost").pathname;
|
|
3577
|
+
} catch {
|
|
3578
|
+
return e;
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
async function oi(e) {
|
|
3582
|
+
const r = await e.text().catch(() => "");
|
|
3583
|
+
if (!r.trim())
|
|
3584
|
+
return e.ok ? {
|
|
3585
|
+
error: "Semaphor Data App execution returned an empty response."
|
|
3586
|
+
} : {};
|
|
3587
|
+
try {
|
|
3588
|
+
return JSON.parse(r);
|
|
3589
|
+
} catch {
|
|
3590
|
+
return e.ok ? {
|
|
3591
|
+
error: "Semaphor Data App execution returned invalid JSON.",
|
|
3592
|
+
details: r
|
|
3593
|
+
} : {
|
|
3594
|
+
error: si(e, r),
|
|
3595
|
+
details: r
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
function si(e, r) {
|
|
3600
|
+
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
3601
|
+
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}.`;
|
|
3602
|
+
}
|
|
3603
|
+
function ai(e) {
|
|
3604
|
+
const r = di(e).replace(/\/+$/, "");
|
|
3605
|
+
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
3606
|
+
}
|
|
3607
|
+
function di(e) {
|
|
3608
|
+
if (e.apiBaseUrl)
|
|
3609
|
+
return e.apiBaseUrl;
|
|
3610
|
+
if (!e.token)
|
|
3611
|
+
return "";
|
|
3612
|
+
try {
|
|
3613
|
+
return ot(e.token).apiServiceUrl || "";
|
|
3614
|
+
} catch {
|
|
3615
|
+
return "";
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
const Kr = we({});
|
|
3619
|
+
function li() {
|
|
3620
|
+
if (!(typeof window > "u"))
|
|
3621
|
+
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
3622
|
+
}
|
|
3623
|
+
function ui() {
|
|
3624
|
+
return V(Kr);
|
|
3625
|
+
}
|
|
3626
|
+
function Li(e) {
|
|
3627
|
+
const [r, t] = M(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = w(
|
|
3628
|
+
() => cr(e.options),
|
|
3156
3629
|
[e.options]
|
|
3157
|
-
),
|
|
3158
|
-
(
|
|
3630
|
+
), u = O(
|
|
3631
|
+
(d) => {
|
|
3159
3632
|
var m;
|
|
3160
|
-
const
|
|
3161
|
-
(m = e.onValueChange) == null || m.call(e,
|
|
3633
|
+
const c = d;
|
|
3634
|
+
(m = e.onValueChange) == null || m.call(e, c), n || t(c);
|
|
3162
3635
|
},
|
|
3163
3636
|
[n, e]
|
|
3164
|
-
),
|
|
3165
|
-
return
|
|
3166
|
-
const
|
|
3637
|
+
), f = O(() => u(void 0), [u]);
|
|
3638
|
+
return w(() => {
|
|
3639
|
+
const d = fr(e);
|
|
3167
3640
|
return {
|
|
3168
3641
|
id: e.id,
|
|
3169
3642
|
kind: e.kind,
|
|
3170
3643
|
label: e.label,
|
|
3171
|
-
field:
|
|
3172
|
-
operator:
|
|
3173
|
-
relationshipHint:
|
|
3644
|
+
field: d.field,
|
|
3645
|
+
operator: d.operator,
|
|
3646
|
+
relationshipHint: d.relationshipHint,
|
|
3174
3647
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
3175
3648
|
value: i,
|
|
3176
|
-
options:
|
|
3177
|
-
isActive:
|
|
3178
|
-
setValue:
|
|
3179
|
-
clear:
|
|
3649
|
+
options: o,
|
|
3650
|
+
isActive: ce(i),
|
|
3651
|
+
setValue: u,
|
|
3652
|
+
clear: f,
|
|
3180
3653
|
toAnalyticsInput: () => ({
|
|
3181
|
-
inputId:
|
|
3182
|
-
field:
|
|
3654
|
+
inputId: d.inputId,
|
|
3655
|
+
field: d.field,
|
|
3183
3656
|
kind: e.kind,
|
|
3184
3657
|
label: e.label,
|
|
3185
3658
|
value: i,
|
|
3186
|
-
isActive:
|
|
3187
|
-
operator:
|
|
3188
|
-
relationshipHint:
|
|
3659
|
+
isActive: ce(i),
|
|
3660
|
+
operator: d.operator,
|
|
3661
|
+
relationshipHint: d.relationshipHint,
|
|
3189
3662
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
3190
3663
|
})
|
|
3191
3664
|
};
|
|
3192
|
-
}, [
|
|
3665
|
+
}, [f, o, u, e, i]);
|
|
3193
3666
|
}
|
|
3194
|
-
function
|
|
3195
|
-
const [r, t] =
|
|
3196
|
-
return
|
|
3667
|
+
function Oi(e) {
|
|
3668
|
+
const [r, t] = M(() => hi(e));
|
|
3669
|
+
return $(() => {
|
|
3197
3670
|
t((n) => {
|
|
3198
3671
|
let i = n;
|
|
3199
|
-
for (const
|
|
3200
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
3672
|
+
for (const o of e)
|
|
3673
|
+
!Object.prototype.hasOwnProperty.call(i, o.id) && o.defaultValue !== void 0 && (i = { ...i, [o.id]: o.defaultValue });
|
|
3201
3674
|
return i;
|
|
3202
3675
|
});
|
|
3203
|
-
}, [e]),
|
|
3676
|
+
}, [e]), w(
|
|
3204
3677
|
() => e.map((n) => {
|
|
3205
3678
|
const i = Object.prototype.hasOwnProperty.call(
|
|
3206
3679
|
n,
|
|
3207
3680
|
"value"
|
|
3208
|
-
),
|
|
3209
|
-
var
|
|
3210
|
-
(
|
|
3211
|
-
...
|
|
3681
|
+
), o = i ? n.value : r[n.id], u = cr(n.options), f = (m) => {
|
|
3682
|
+
var v;
|
|
3683
|
+
(v = n.onValueChange) == null || v.call(n, m), i || t((S) => ({
|
|
3684
|
+
...S,
|
|
3212
3685
|
[n.id]: m
|
|
3213
3686
|
}));
|
|
3214
|
-
},
|
|
3687
|
+
}, d = () => f(void 0), c = fr(n);
|
|
3215
3688
|
return {
|
|
3216
3689
|
id: n.id,
|
|
3217
3690
|
kind: n.kind,
|
|
3218
3691
|
label: n.label,
|
|
3219
|
-
field:
|
|
3220
|
-
operator:
|
|
3221
|
-
relationshipHint:
|
|
3692
|
+
field: c.field,
|
|
3693
|
+
operator: c.operator,
|
|
3694
|
+
relationshipHint: c.relationshipHint,
|
|
3222
3695
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
3223
|
-
value:
|
|
3224
|
-
options:
|
|
3225
|
-
isActive:
|
|
3226
|
-
setValue:
|
|
3227
|
-
clear:
|
|
3696
|
+
value: o,
|
|
3697
|
+
options: u,
|
|
3698
|
+
isActive: ce(o),
|
|
3699
|
+
setValue: f,
|
|
3700
|
+
clear: d,
|
|
3228
3701
|
toAnalyticsInput: () => ({
|
|
3229
|
-
inputId:
|
|
3230
|
-
field:
|
|
3702
|
+
inputId: c.inputId,
|
|
3703
|
+
field: c.field,
|
|
3231
3704
|
kind: n.kind,
|
|
3232
3705
|
label: n.label,
|
|
3233
|
-
value:
|
|
3234
|
-
isActive:
|
|
3235
|
-
operator:
|
|
3236
|
-
relationshipHint:
|
|
3706
|
+
value: o,
|
|
3707
|
+
isActive: ce(o),
|
|
3708
|
+
operator: c.operator,
|
|
3709
|
+
relationshipHint: c.relationshipHint,
|
|
3237
3710
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
3238
3711
|
})
|
|
3239
3712
|
};
|
|
@@ -3241,78 +3714,78 @@ function ai(e) {
|
|
|
3241
3714
|
[e, r]
|
|
3242
3715
|
);
|
|
3243
3716
|
}
|
|
3244
|
-
function
|
|
3245
|
-
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n =
|
|
3246
|
-
|
|
3247
|
-
|
|
3717
|
+
function Bi(e, r) {
|
|
3718
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = w(() => fi(t), [t]);
|
|
3719
|
+
$(() => {
|
|
3720
|
+
ci(e.value, t) || e.clear();
|
|
3248
3721
|
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
3249
3722
|
}
|
|
3250
|
-
function
|
|
3251
|
-
if (!
|
|
3723
|
+
function ci(e, r) {
|
|
3724
|
+
if (!ce(e) || r === void 0)
|
|
3252
3725
|
return !0;
|
|
3253
3726
|
const t = new Set(
|
|
3254
|
-
r.map((i) =>
|
|
3727
|
+
r.map((i) => lr(i.value))
|
|
3255
3728
|
);
|
|
3256
3729
|
return (Array.isArray(e) ? e : [e]).every(
|
|
3257
|
-
(i) => t.has(
|
|
3730
|
+
(i) => t.has(lr(i))
|
|
3258
3731
|
);
|
|
3259
3732
|
}
|
|
3260
|
-
function
|
|
3733
|
+
function fi(e) {
|
|
3261
3734
|
return JSON.stringify((e || []).map((r) => r.value));
|
|
3262
3735
|
}
|
|
3263
|
-
function
|
|
3736
|
+
function lr(e) {
|
|
3264
3737
|
return `${typeof e}:${String(e)}`;
|
|
3265
3738
|
}
|
|
3266
|
-
function
|
|
3267
|
-
const t =
|
|
3739
|
+
function $i(e, r = {}) {
|
|
3740
|
+
const t = w(
|
|
3268
3741
|
() => r.inputs ? {
|
|
3269
3742
|
...e,
|
|
3270
3743
|
inputs: r.inputs
|
|
3271
3744
|
} : e,
|
|
3272
3745
|
[r.inputs, e]
|
|
3273
|
-
), n =
|
|
3746
|
+
), n = w(() => {
|
|
3274
3747
|
switch (t.queryKind) {
|
|
3275
3748
|
case "metric":
|
|
3276
3749
|
return {
|
|
3277
3750
|
queryKind: t.queryKind,
|
|
3278
|
-
request:
|
|
3751
|
+
request: Vn(t)
|
|
3279
3752
|
};
|
|
3280
3753
|
case "analysis":
|
|
3281
3754
|
return {
|
|
3282
3755
|
queryKind: t.queryKind,
|
|
3283
|
-
request:
|
|
3756
|
+
request: Qn(t)
|
|
3284
3757
|
};
|
|
3285
3758
|
case "records":
|
|
3286
3759
|
return {
|
|
3287
3760
|
queryKind: t.queryKind,
|
|
3288
|
-
request:
|
|
3761
|
+
request: Un(t)
|
|
3289
3762
|
};
|
|
3290
3763
|
case "inputOptions":
|
|
3291
3764
|
return {
|
|
3292
3765
|
queryKind: t.queryKind,
|
|
3293
|
-
request:
|
|
3766
|
+
request: Gn(t)
|
|
3294
3767
|
};
|
|
3295
3768
|
case "sql":
|
|
3296
3769
|
return {
|
|
3297
3770
|
queryKind: t.queryKind,
|
|
3298
|
-
request:
|
|
3771
|
+
request: Jn(t)
|
|
3299
3772
|
};
|
|
3300
3773
|
case "matrix":
|
|
3301
3774
|
return {
|
|
3302
3775
|
queryKind: t.queryKind,
|
|
3303
|
-
request:
|
|
3776
|
+
request: Yn(t)
|
|
3304
3777
|
};
|
|
3305
3778
|
default:
|
|
3306
|
-
return
|
|
3779
|
+
return Se(t);
|
|
3307
3780
|
}
|
|
3308
|
-
}, [t]), i =
|
|
3781
|
+
}, [t]), i = pt({
|
|
3309
3782
|
spec: t,
|
|
3310
3783
|
queryKind: n.queryKind,
|
|
3311
3784
|
queryKey: n.request.queryKey,
|
|
3312
3785
|
intent: n.request.intent,
|
|
3313
3786
|
activeInputs: n.request.activeInputs,
|
|
3314
3787
|
debug: r.debug
|
|
3315
|
-
}),
|
|
3788
|
+
}), o = D(null), u = w(
|
|
3316
3789
|
() => ({
|
|
3317
3790
|
start: i.start,
|
|
3318
3791
|
success: i.success,
|
|
@@ -3325,232 +3798,336 @@ function li(e, r = {}) {
|
|
|
3325
3798
|
i.start,
|
|
3326
3799
|
i.success
|
|
3327
3800
|
]
|
|
3328
|
-
),
|
|
3329
|
-
(
|
|
3330
|
-
var
|
|
3331
|
-
const
|
|
3332
|
-
if (
|
|
3801
|
+
), f = O(
|
|
3802
|
+
(l) => {
|
|
3803
|
+
var K, E, W, L, h, I, R, q, A;
|
|
3804
|
+
const y = n.request;
|
|
3805
|
+
if (y.intent)
|
|
3333
3806
|
switch (n.queryKind) {
|
|
3334
3807
|
case "metric":
|
|
3335
|
-
return (
|
|
3336
|
-
|
|
3337
|
-
|
|
3808
|
+
return (K = l.executor) == null ? void 0 : K.executeMetric(
|
|
3809
|
+
y.intent,
|
|
3810
|
+
l
|
|
3338
3811
|
);
|
|
3339
3812
|
case "analysis":
|
|
3340
|
-
return (
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3813
|
+
return (W = (E = l.executor) == null ? void 0 : E.executeAnalysis) == null ? void 0 : W.call(
|
|
3814
|
+
E,
|
|
3815
|
+
y.intent,
|
|
3816
|
+
l,
|
|
3817
|
+
y.analysisOptions
|
|
3345
3818
|
);
|
|
3346
3819
|
case "records":
|
|
3347
|
-
return (
|
|
3348
|
-
|
|
3349
|
-
|
|
3820
|
+
return (L = l.executor) == null ? void 0 : L.executeRecords(
|
|
3821
|
+
y.intent,
|
|
3822
|
+
l
|
|
3350
3823
|
);
|
|
3351
3824
|
case "inputOptions":
|
|
3352
|
-
return (
|
|
3353
|
-
|
|
3354
|
-
|
|
3825
|
+
return (h = l.executor) == null ? void 0 : h.executeInputOptions(
|
|
3826
|
+
y.intent,
|
|
3827
|
+
l
|
|
3355
3828
|
);
|
|
3356
3829
|
case "sql":
|
|
3357
|
-
return (
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3830
|
+
return (R = (I = l.executor) == null ? void 0 : I.executeSql) == null ? void 0 : R.call(
|
|
3831
|
+
I,
|
|
3832
|
+
y.intent,
|
|
3833
|
+
l
|
|
3361
3834
|
);
|
|
3362
3835
|
case "matrix":
|
|
3363
|
-
return (
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3836
|
+
return (A = (q = l.executor) == null ? void 0 : q.executeMatrix) == null ? void 0 : A.call(
|
|
3837
|
+
q,
|
|
3838
|
+
y.intent,
|
|
3839
|
+
l
|
|
3367
3840
|
);
|
|
3368
3841
|
default:
|
|
3369
|
-
return
|
|
3842
|
+
return Se(n);
|
|
3370
3843
|
}
|
|
3371
3844
|
},
|
|
3372
3845
|
[n]
|
|
3373
|
-
),
|
|
3846
|
+
), d = yi(
|
|
3374
3847
|
n.request.queryKey,
|
|
3375
|
-
|
|
3848
|
+
f,
|
|
3376
3849
|
n.request.idleData,
|
|
3377
3850
|
n.request.activeInputs,
|
|
3378
|
-
|
|
3379
|
-
),
|
|
3380
|
-
|
|
3381
|
-
const
|
|
3382
|
-
if (!
|
|
3383
|
-
|
|
3851
|
+
u
|
|
3852
|
+
), c = i.queryId, m = i.validationFailure;
|
|
3853
|
+
$(() => {
|
|
3854
|
+
const l = n.request.error;
|
|
3855
|
+
if (!l) {
|
|
3856
|
+
o.current = null;
|
|
3384
3857
|
return;
|
|
3385
3858
|
}
|
|
3386
|
-
const
|
|
3387
|
-
|
|
3859
|
+
const y = `${c}:${l.message}`;
|
|
3860
|
+
o.current !== y && (o.current = y, m(l));
|
|
3388
3861
|
}, [
|
|
3389
3862
|
n.request.error,
|
|
3390
3863
|
n.request.queryKey,
|
|
3391
|
-
|
|
3864
|
+
c,
|
|
3392
3865
|
m
|
|
3393
3866
|
]);
|
|
3394
|
-
const
|
|
3867
|
+
const v = n.request.error ? n.request.idleData : d.data, S = n.request.error ? "error" : d.status, g = !n.request.error && d.status === "loading", b = n.request.error || d.error, k = i.trace;
|
|
3395
3868
|
switch (n.queryKind) {
|
|
3396
3869
|
case "metric": {
|
|
3397
|
-
const
|
|
3870
|
+
const l = v, y = Y({
|
|
3871
|
+
queryKind: n.queryKind,
|
|
3872
|
+
status: S,
|
|
3873
|
+
isLoading: g,
|
|
3874
|
+
error: b,
|
|
3875
|
+
trace: k,
|
|
3876
|
+
payload: l,
|
|
3877
|
+
activeInputs: n.request.activeInputs,
|
|
3878
|
+
isStale: d.isStale
|
|
3879
|
+
});
|
|
3398
3880
|
return {
|
|
3399
3881
|
id: t.id,
|
|
3400
3882
|
intent: n.request.intent,
|
|
3401
|
-
value: (
|
|
3402
|
-
measures:
|
|
3403
|
-
comparisonValue:
|
|
3404
|
-
delta:
|
|
3405
|
-
deltaPercent:
|
|
3406
|
-
records:
|
|
3407
|
-
|
|
3408
|
-
status: h,
|
|
3409
|
-
isLoading: g,
|
|
3410
|
-
error: S,
|
|
3411
|
-
trace: k
|
|
3883
|
+
value: (l == null ? void 0 : l.value) ?? null,
|
|
3884
|
+
measures: l == null ? void 0 : l.measures,
|
|
3885
|
+
comparisonValue: l == null ? void 0 : l.comparisonValue,
|
|
3886
|
+
delta: l == null ? void 0 : l.delta,
|
|
3887
|
+
deltaPercent: l == null ? void 0 : l.deltaPercent,
|
|
3888
|
+
records: l == null ? void 0 : l.records,
|
|
3889
|
+
...y
|
|
3412
3890
|
};
|
|
3413
3891
|
}
|
|
3414
3892
|
case "analysis": {
|
|
3415
|
-
const
|
|
3893
|
+
const l = Or(v), y = Y({
|
|
3894
|
+
queryKind: n.queryKind,
|
|
3895
|
+
status: S,
|
|
3896
|
+
isLoading: g,
|
|
3897
|
+
error: b,
|
|
3898
|
+
trace: k,
|
|
3899
|
+
payload: l,
|
|
3900
|
+
activeInputs: n.request.activeInputs,
|
|
3901
|
+
isStale: d.isStale
|
|
3902
|
+
});
|
|
3416
3903
|
return {
|
|
3417
3904
|
id: t.id,
|
|
3418
3905
|
intent: n.request.intent,
|
|
3419
|
-
...
|
|
3420
|
-
|
|
3421
|
-
isLoading: g,
|
|
3422
|
-
error: S,
|
|
3423
|
-
trace: k
|
|
3906
|
+
...l || {},
|
|
3907
|
+
...y
|
|
3424
3908
|
};
|
|
3425
3909
|
}
|
|
3426
3910
|
case "records": {
|
|
3427
|
-
const
|
|
3911
|
+
const l = v, y = Y({
|
|
3912
|
+
queryKind: n.queryKind,
|
|
3913
|
+
status: S,
|
|
3914
|
+
isLoading: g,
|
|
3915
|
+
error: b,
|
|
3916
|
+
trace: k,
|
|
3917
|
+
payload: l,
|
|
3918
|
+
activeInputs: n.request.activeInputs,
|
|
3919
|
+
isStale: d.isStale
|
|
3920
|
+
});
|
|
3428
3921
|
return {
|
|
3429
3922
|
id: t.id,
|
|
3430
3923
|
intent: n.request.intent,
|
|
3431
|
-
records: (
|
|
3432
|
-
columns:
|
|
3433
|
-
rowCount:
|
|
3434
|
-
pagination:
|
|
3435
|
-
|
|
3436
|
-
status: h,
|
|
3437
|
-
isLoading: g,
|
|
3438
|
-
error: S,
|
|
3439
|
-
trace: k
|
|
3924
|
+
records: (l == null ? void 0 : l.records) || [],
|
|
3925
|
+
columns: l == null ? void 0 : l.columns,
|
|
3926
|
+
rowCount: l == null ? void 0 : l.rowCount,
|
|
3927
|
+
pagination: l == null ? void 0 : l.pagination,
|
|
3928
|
+
...y
|
|
3440
3929
|
};
|
|
3441
3930
|
}
|
|
3442
3931
|
case "inputOptions": {
|
|
3443
|
-
const
|
|
3932
|
+
const l = v, y = Y({
|
|
3933
|
+
queryKind: n.queryKind,
|
|
3934
|
+
status: S,
|
|
3935
|
+
isLoading: g,
|
|
3936
|
+
error: b,
|
|
3937
|
+
trace: k,
|
|
3938
|
+
payload: l,
|
|
3939
|
+
activeInputs: n.request.activeInputs,
|
|
3940
|
+
isStale: d.isStale
|
|
3941
|
+
});
|
|
3444
3942
|
return {
|
|
3445
3943
|
id: t.id,
|
|
3446
3944
|
intent: n.request.intent,
|
|
3447
|
-
options: (
|
|
3448
|
-
|
|
3449
|
-
status: h,
|
|
3450
|
-
isLoading: g,
|
|
3451
|
-
error: S,
|
|
3452
|
-
trace: k
|
|
3945
|
+
options: (l == null ? void 0 : l.options) || [],
|
|
3946
|
+
...y
|
|
3453
3947
|
};
|
|
3454
3948
|
}
|
|
3455
3949
|
case "sql": {
|
|
3456
|
-
const
|
|
3950
|
+
const l = v, y = Y({
|
|
3951
|
+
queryKind: n.queryKind,
|
|
3952
|
+
status: S,
|
|
3953
|
+
isLoading: g,
|
|
3954
|
+
error: b,
|
|
3955
|
+
trace: k,
|
|
3956
|
+
payload: l,
|
|
3957
|
+
activeInputs: n.request.activeInputs,
|
|
3958
|
+
isStale: d.isStale
|
|
3959
|
+
});
|
|
3457
3960
|
return {
|
|
3458
3961
|
id: t.id,
|
|
3459
3962
|
intent: n.request.intent,
|
|
3460
|
-
records: (
|
|
3461
|
-
columns:
|
|
3462
|
-
rowCount:
|
|
3463
|
-
pagination:
|
|
3464
|
-
output:
|
|
3465
|
-
rowLimitExceeded:
|
|
3466
|
-
|
|
3467
|
-
status: h,
|
|
3468
|
-
isLoading: g,
|
|
3469
|
-
error: S,
|
|
3470
|
-
trace: k
|
|
3963
|
+
records: (l == null ? void 0 : l.records) || [],
|
|
3964
|
+
columns: l == null ? void 0 : l.columns,
|
|
3965
|
+
rowCount: l == null ? void 0 : l.rowCount,
|
|
3966
|
+
pagination: l == null ? void 0 : l.pagination,
|
|
3967
|
+
output: l == null ? void 0 : l.output,
|
|
3968
|
+
rowLimitExceeded: l == null ? void 0 : l.rowLimitExceeded,
|
|
3969
|
+
...y
|
|
3471
3970
|
};
|
|
3472
3971
|
}
|
|
3473
3972
|
case "matrix": {
|
|
3474
|
-
const
|
|
3973
|
+
const l = v, y = Y({
|
|
3974
|
+
queryKind: n.queryKind,
|
|
3975
|
+
status: S,
|
|
3976
|
+
isLoading: g,
|
|
3977
|
+
error: b,
|
|
3978
|
+
trace: k,
|
|
3979
|
+
payload: l,
|
|
3980
|
+
activeInputs: n.request.activeInputs,
|
|
3981
|
+
isStale: d.isStale
|
|
3982
|
+
});
|
|
3475
3983
|
return {
|
|
3476
3984
|
id: t.id,
|
|
3477
3985
|
intent: n.request.intent,
|
|
3478
|
-
matrixResult:
|
|
3479
|
-
grid:
|
|
3480
|
-
expansion:
|
|
3481
|
-
|
|
3482
|
-
status: h,
|
|
3483
|
-
isLoading: g,
|
|
3484
|
-
error: S,
|
|
3485
|
-
trace: k
|
|
3986
|
+
matrixResult: l == null ? void 0 : l.matrixResult,
|
|
3987
|
+
grid: l == null ? void 0 : l.grid,
|
|
3988
|
+
expansion: l == null ? void 0 : l.expansion,
|
|
3989
|
+
...y
|
|
3486
3990
|
};
|
|
3487
3991
|
}
|
|
3488
3992
|
default:
|
|
3489
|
-
return
|
|
3993
|
+
return Se(n);
|
|
3994
|
+
}
|
|
3995
|
+
}
|
|
3996
|
+
function Y(e) {
|
|
3997
|
+
var o, u, f;
|
|
3998
|
+
const r = pi(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
|
|
3999
|
+
return {
|
|
4000
|
+
status: e.status,
|
|
4001
|
+
executionStatus: r == null ? void 0 : r.status,
|
|
4002
|
+
executionResult: r,
|
|
4003
|
+
validation: t,
|
|
4004
|
+
coverage: n,
|
|
4005
|
+
diagnosticFeedback: i,
|
|
4006
|
+
isLoading: e.isLoading,
|
|
4007
|
+
isEmpty: mi(e.queryKind, e.payload, e.status),
|
|
4008
|
+
isPartial: gi(e.payload, r),
|
|
4009
|
+
isFiltered: !!((f = e.activeInputs) != null && f.some(
|
|
4010
|
+
(d) => d.kind === "filter" && d.isActive
|
|
4011
|
+
)),
|
|
4012
|
+
isStale: e.isStale,
|
|
4013
|
+
isValidated: !!t,
|
|
4014
|
+
error: e.error,
|
|
4015
|
+
trace: e.trace
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
4018
|
+
function pi(e) {
|
|
4019
|
+
const r = e;
|
|
4020
|
+
return r == null ? void 0 : r.executionResult;
|
|
4021
|
+
}
|
|
4022
|
+
function gi(e, r) {
|
|
4023
|
+
var n, i;
|
|
4024
|
+
const t = !!(e != null && e.rowLimitExceeded);
|
|
4025
|
+
return !!((r == null ? void 0 : r.status) === "partial" || ((n = r == null ? void 0 : r.diagnosticFeedback) == null ? void 0 : n.status) === "partial" || (r == null ? void 0 : r.status) !== "failed" && ((i = r == null ? void 0 : r.coverage) != null && i.missingObligations.length) || t);
|
|
4026
|
+
}
|
|
4027
|
+
function mi(e, r, t) {
|
|
4028
|
+
var n, i, o, u, f;
|
|
4029
|
+
if (t !== "success")
|
|
4030
|
+
return !1;
|
|
4031
|
+
switch (e) {
|
|
4032
|
+
case "metric": {
|
|
4033
|
+
const d = r;
|
|
4034
|
+
return (d == null ? void 0 : d.value) == null && !B(d == null ? void 0 : d.records);
|
|
4035
|
+
}
|
|
4036
|
+
case "analysis": {
|
|
4037
|
+
const d = r;
|
|
4038
|
+
return d ? !d.answerSummary && !B(d.records) && !B(d.changes) && !B(d.drivers) && !B(d.largestNegativeChanges) && !B(d.largestPositiveChanges) && !B(d.largestNegativeDrivers) && !B(d.largestPositiveDrivers) && !Object.values(d.resultSets || {}).some(
|
|
4039
|
+
(c) => B(c.records)
|
|
4040
|
+
) : !0;
|
|
4041
|
+
}
|
|
4042
|
+
case "records": {
|
|
4043
|
+
const d = r;
|
|
4044
|
+
return !B(d == null ? void 0 : d.records);
|
|
4045
|
+
}
|
|
4046
|
+
case "sql": {
|
|
4047
|
+
const d = r;
|
|
4048
|
+
return !B(d == null ? void 0 : d.records) && (d == null ? void 0 : d.output) === void 0;
|
|
4049
|
+
}
|
|
4050
|
+
case "inputOptions": {
|
|
4051
|
+
const d = r;
|
|
4052
|
+
return !((n = d == null ? void 0 : d.options) != null && n.length);
|
|
4053
|
+
}
|
|
4054
|
+
case "matrix": {
|
|
4055
|
+
const d = r;
|
|
4056
|
+
return !((o = (i = d == null ? void 0 : d.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = d == null ? void 0 : d.grid) == null ? void 0 : u.cells) != null && f.length);
|
|
4057
|
+
}
|
|
4058
|
+
default:
|
|
4059
|
+
return Se(e);
|
|
3490
4060
|
}
|
|
3491
4061
|
}
|
|
3492
|
-
function
|
|
3493
|
-
|
|
4062
|
+
function B(e) {
|
|
4063
|
+
return Array.isArray(e) && e.length > 0;
|
|
4064
|
+
}
|
|
4065
|
+
function yi(e, r, t, n, i) {
|
|
4066
|
+
const o = ui(), u = D(r), f = D(n), [d, c] = M({
|
|
3494
4067
|
status: "idle",
|
|
3495
4068
|
data: t,
|
|
3496
|
-
error: null
|
|
4069
|
+
error: null,
|
|
4070
|
+
isStale: !1
|
|
3497
4071
|
});
|
|
3498
|
-
return
|
|
4072
|
+
return u.current = r, f.current = n, $(() => {
|
|
3499
4073
|
let m;
|
|
3500
4074
|
try {
|
|
3501
|
-
m =
|
|
3502
|
-
...
|
|
3503
|
-
activeInputs:
|
|
4075
|
+
m = u.current({
|
|
4076
|
+
...o,
|
|
4077
|
+
activeInputs: f.current
|
|
3504
4078
|
});
|
|
3505
4079
|
} catch (g) {
|
|
3506
|
-
i == null || i.failure(g, 0),
|
|
4080
|
+
i == null || i.failure(g, 0), c({
|
|
3507
4081
|
status: "error",
|
|
3508
4082
|
data: t,
|
|
3509
|
-
error:
|
|
4083
|
+
error: Fe(g),
|
|
4084
|
+
isStale: !1
|
|
3510
4085
|
});
|
|
3511
4086
|
return;
|
|
3512
4087
|
}
|
|
3513
4088
|
if (!m) {
|
|
3514
|
-
|
|
4089
|
+
c({ status: "idle", data: t, error: null, isStale: !1 });
|
|
3515
4090
|
return;
|
|
3516
4091
|
}
|
|
3517
|
-
let
|
|
3518
|
-
const
|
|
3519
|
-
return i == null || i.start(),
|
|
4092
|
+
let v = !1;
|
|
4093
|
+
const S = Wr();
|
|
4094
|
+
return i == null || i.start(), c((g) => ({
|
|
3520
4095
|
status: "loading",
|
|
3521
4096
|
data: g.data,
|
|
3522
|
-
error: null
|
|
4097
|
+
error: null,
|
|
4098
|
+
isStale: g.isStale || g.status === "success"
|
|
3523
4099
|
})), m.then((g) => {
|
|
3524
|
-
|
|
4100
|
+
v ? i == null || i.ignored("superseded") : (i == null || i.success(g, ur(S)), c({ status: "success", data: g, error: null, isStale: !1 }));
|
|
3525
4101
|
}).catch((g) => {
|
|
3526
|
-
|
|
4102
|
+
v ? i == null || i.ignored("superseded") : (i == null || i.failure(g, ur(S)), c({
|
|
3527
4103
|
status: "error",
|
|
3528
4104
|
data: t,
|
|
3529
|
-
error:
|
|
4105
|
+
error: Fe(g),
|
|
4106
|
+
isStale: !1
|
|
3530
4107
|
}));
|
|
3531
4108
|
}), () => {
|
|
3532
|
-
|
|
4109
|
+
v = !0;
|
|
3533
4110
|
};
|
|
3534
|
-
}, [t, e,
|
|
4111
|
+
}, [t, e, o, i]), d;
|
|
3535
4112
|
}
|
|
3536
|
-
function
|
|
4113
|
+
function Wr() {
|
|
3537
4114
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3538
4115
|
}
|
|
3539
|
-
function
|
|
3540
|
-
return Math.max(0, Math.round(
|
|
4116
|
+
function ur(e) {
|
|
4117
|
+
return Math.max(0, Math.round(Wr() - e));
|
|
3541
4118
|
}
|
|
3542
|
-
function
|
|
4119
|
+
function hi(e) {
|
|
3543
4120
|
return Object.fromEntries(
|
|
3544
4121
|
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
3545
4122
|
);
|
|
3546
4123
|
}
|
|
3547
|
-
function
|
|
4124
|
+
function Se(e) {
|
|
3548
4125
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3549
4126
|
}
|
|
3550
|
-
function
|
|
4127
|
+
function vi(e) {
|
|
3551
4128
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3552
4129
|
}
|
|
3553
|
-
function
|
|
4130
|
+
function Ki({
|
|
3554
4131
|
token: e,
|
|
3555
4132
|
apiBaseUrl: r,
|
|
3556
4133
|
executor: t,
|
|
@@ -3558,33 +4135,33 @@ function ui({
|
|
|
3558
4135
|
children: i
|
|
3559
4136
|
}) {
|
|
3560
4137
|
var g;
|
|
3561
|
-
const
|
|
4138
|
+
const o = li(), u = ((g = o == null ? void 0 : o.authToken) == null ? void 0 : g.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = vi(d), m = w(() => Zn(), []), v = t || m, S = w(
|
|
3562
4139
|
() => ({
|
|
3563
|
-
token:
|
|
3564
|
-
apiBaseUrl:
|
|
3565
|
-
executor:
|
|
3566
|
-
debug:
|
|
4140
|
+
token: u,
|
|
4141
|
+
apiBaseUrl: f,
|
|
4142
|
+
executor: v,
|
|
4143
|
+
debug: d
|
|
3567
4144
|
}),
|
|
3568
|
-
[
|
|
4145
|
+
[f, d, v, u]
|
|
3569
4146
|
);
|
|
3570
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ a(lt, { debug: d, children: /* @__PURE__ */ p(Kr.Provider, { value: S, children: [
|
|
3571
4148
|
i,
|
|
3572
|
-
|
|
4149
|
+
c ? /* @__PURE__ */ a(ft, { ...c }) : null
|
|
3573
4150
|
] }) });
|
|
3574
4151
|
}
|
|
3575
4152
|
export {
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
4153
|
+
Ki as SemaphorDataAppProvider,
|
|
4154
|
+
ft as SemaphorDevtools,
|
|
4155
|
+
Di as SemaphorDevtoolsInspectButton,
|
|
4156
|
+
Ri as SemaphorViewBoundary,
|
|
4157
|
+
Zn as createSemaphorQueryExecutor,
|
|
4158
|
+
Ti as defineSemaphorDataApp,
|
|
4159
|
+
Ci as defineSemaphorInput,
|
|
4160
|
+
ci as isSemaphorInputValueValidForOptions,
|
|
4161
|
+
ki as semaphor,
|
|
4162
|
+
Bi as useClearInvalidSemaphorInputValue,
|
|
4163
|
+
hr as useSemaphorDevtools,
|
|
4164
|
+
Li as useSemaphorInput,
|
|
4165
|
+
Oi as useSemaphorInputs,
|
|
4166
|
+
$i as useSemaphorQuery
|
|
3590
4167
|
};
|