react-semaphor 0.1.327 → 0.1.329
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 +211 -72
- package/dist/brand-studio/index.cjs +5 -5
- package/dist/brand-studio/index.js +23 -24
- package/dist/chunks/_commonjsHelpers-BVfed4GL.js +28 -0
- package/dist/chunks/_commonjsHelpers-DwTZ_eVU.js +1 -0
- package/dist/chunks/{braces-BGWZEnQJ.js → braces-CG8viaD2.js} +1 -1
- package/dist/chunks/{braces-B6qRDu1H.js → braces-DSaa_4Oc.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-fkLUMJyR.js → calendar-preferences-dialog-DD_qAthL.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-CjwbE_82.js → calendar-preferences-dialog-JRmNJptJ.js} +3 -3
- package/dist/chunks/{chevrons-up-down-xG-bVFD9.js → chevrons-up-down-CBa0uh0X.js} +1 -1
- package/dist/chunks/{chevrons-up-down-BpsogQvv.js → chevrons-up-down-ChDNqVP7.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-BKdJFwH5.js +106 -0
- package/dist/chunks/{dashboard-briefing-launcher-Cy1nWZRW.js → dashboard-briefing-launcher-BfyNkd8i.js} +1141 -1137
- package/dist/chunks/{dashboard-controls-BWnVEFJq.js → dashboard-controls-0pZDLvFL.js} +218 -218
- package/dist/chunks/{dashboard-controls-C7rOGZO-.js → dashboard-controls-C0xm1QMR.js} +10 -10
- package/dist/chunks/dashboard-json-BW5OVZ6m.js +1 -0
- package/dist/chunks/{dashboard-json-BpRNSsF3.js → dashboard-json-DsruhRPD.js} +14 -13
- package/dist/chunks/{edit-dashboard-visual-B2vkIKEa.js → edit-dashboard-visual-DQyJ7SSv.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CYf26co_.js → edit-dashboard-visual-g5SZZahJ.js} +9 -8
- package/dist/chunks/index-1JWDPCun.js +1935 -0
- package/dist/chunks/index-BdjXTQt4.js +1444 -0
- package/dist/chunks/{index-DTlbYpxd.js → index-BmKr-K7J.js} +116971 -113296
- package/dist/chunks/index-C1l78BIx.js +3247 -0
- package/dist/chunks/lib-Ce3zosXY.js +38 -0
- package/dist/chunks/lib-DFvr9fM4.js +5500 -0
- package/dist/chunks/{palette-CSF7IVJn.js → palette-D0YmAqBS.js} +1 -1
- package/dist/chunks/{palette-CWgEPBoG.js → palette-DQgq3edH.js} +1 -1
- package/dist/chunks/{resource-management-panel-D6nbfJY3.js → resource-management-panel-CIfBh46E.js} +1 -1
- package/dist/chunks/{resource-management-panel-D893Onv8.js → resource-management-panel-Cj19pw9M.js} +145 -145
- package/dist/chunks/{switch-DJJJD_g1.js → switch-BvTzw2AW.js} +39 -34
- package/dist/chunks/{switch-DKf6vHfP.js → switch-De31SR3q.js} +878 -885
- package/dist/chunks/typescript-Cmizj1hi.js +446 -0
- package/dist/chunks/typescript-H1EwZsOb.js +159820 -0
- package/dist/chunks/use-create-flow-overlay-state-BTQiKRD1.js +26 -0
- package/dist/chunks/{use-create-flow-overlay-state-p21zs2p6.js → use-create-flow-overlay-state-IcHP0l39.js} +150 -151
- package/dist/chunks/{use-visual-utils-BKBua6o4.js → use-visual-utils-DQ5zGYD2.js} +13 -13
- package/dist/chunks/{use-visual-utils-BqWm0QeW.js → use-visual-utils-XF-AqV8o.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -0
- package/dist/data-app-builder/index.js +4 -0
- package/dist/data-app-builder-browser-runtime/index.cjs +1 -0
- package/dist/data-app-builder-browser-runtime/index.js +10 -0
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +208 -196
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +76 -1
- package/dist/types/dashboard-authoring.d.ts +2 -1
- package/dist/types/data-app-builder-browser-runtime.d.ts +185 -0
- package/dist/types/data-app-builder.d.ts +631 -0
- package/dist/types/data-app-sdk.d.ts +16 -2
- package/dist/types/main.d.ts +4 -1
- package/package.json +11 -1
- package/dist/chunks/dashboard-briefing-launcher-Co57xBfS.js +0 -106
- package/dist/chunks/dashboard-json-DBPMknGo.js +0 -1
- package/dist/chunks/index-BD90s-wf.js +0 -1309
- package/dist/chunks/save-CtQbSub2.js +0 -6
- package/dist/chunks/save-DRdFKF57.js +0 -21
- package/dist/chunks/use-create-flow-overlay-state-C4LgoK8q.js +0 -26
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { v as
|
|
5
|
-
function
|
|
1
|
+
import { j as $ } from "../chunks/index-CuHybtft.js";
|
|
2
|
+
import { createContext as w, useContext as O, useMemo as p, useState as x, useCallback as h, useRef as b, useEffect as _ } from "react";
|
|
3
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
4
|
+
import { v as T } from "../chunks/validators-DDAweCzB.js";
|
|
5
|
+
function K(t) {
|
|
6
6
|
var r;
|
|
7
7
|
return {
|
|
8
8
|
version: 1,
|
|
9
9
|
kind: "metric",
|
|
10
10
|
id: t.id,
|
|
11
11
|
label: t.label,
|
|
12
|
-
source:
|
|
12
|
+
source: k(t),
|
|
13
13
|
metric: t.metric,
|
|
14
14
|
metrics: t.metrics,
|
|
15
|
-
dateField: t.dateField ?
|
|
15
|
+
dateField: t.dateField ? f(t.dateField, "date") : void 0,
|
|
16
16
|
timeGrain: t.timeGrain,
|
|
17
|
-
dimensions: (r = t.dimensions) == null ? void 0 : r.map((
|
|
17
|
+
dimensions: (r = t.dimensions) == null ? void 0 : r.map((o) => f(o, "dimension")),
|
|
18
18
|
comparison: Q(t.comparison),
|
|
19
|
-
inputs:
|
|
19
|
+
inputs: g(t.inputs),
|
|
20
20
|
limit: t.limit
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function C(t) {
|
|
24
24
|
if ("sort" in t)
|
|
25
25
|
throw new Error(
|
|
26
26
|
"useSemaphorRecords supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
|
|
27
27
|
);
|
|
28
|
-
if (!
|
|
28
|
+
if (!j(t))
|
|
29
29
|
throw new Error(
|
|
30
30
|
"useSemaphorRecords needs at least one field, dimension, or measure."
|
|
31
31
|
);
|
|
@@ -39,29 +39,29 @@ function _(t) {
|
|
|
39
39
|
kind: "records",
|
|
40
40
|
id: t.id,
|
|
41
41
|
label: t.label,
|
|
42
|
-
source:
|
|
42
|
+
source: k(t),
|
|
43
43
|
fields: r,
|
|
44
44
|
measures: t.measures,
|
|
45
|
-
dateField: t.dateField ?
|
|
45
|
+
dateField: t.dateField ? f(t.dateField, "date") : void 0,
|
|
46
46
|
timeGrain: t.timeGrain,
|
|
47
47
|
orderBy: t.orderBy,
|
|
48
|
-
inputs:
|
|
48
|
+
inputs: g(t.inputs),
|
|
49
49
|
limit: t.limit
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function P(t) {
|
|
53
53
|
return {
|
|
54
54
|
version: 1,
|
|
55
55
|
kind: "inputOptions",
|
|
56
56
|
id: t.id,
|
|
57
57
|
label: t.label,
|
|
58
|
-
source:
|
|
59
|
-
field:
|
|
58
|
+
source: k(t),
|
|
59
|
+
field: f(t.field, "dimension"),
|
|
60
60
|
search: t.search,
|
|
61
61
|
limit: t.limit
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function U(t) {
|
|
65
65
|
if ("toAnalyticsInput" in t) {
|
|
66
66
|
const r = t.toAnalyticsInput();
|
|
67
67
|
return {
|
|
@@ -74,22 +74,22 @@ function M(t) {
|
|
|
74
74
|
field: t.field
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const r =
|
|
77
|
+
function st(t) {
|
|
78
|
+
const r = g(t);
|
|
79
79
|
return r.length > 0 ? r : void 0;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return (t || []).map(
|
|
81
|
+
function M(t) {
|
|
82
|
+
return (t || []).map(F);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
84
|
+
function R(t) {
|
|
85
|
+
return M(t).filter((r) => r.isActive);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function N(t) {
|
|
88
88
|
return t.kind === "filter" ? {
|
|
89
89
|
inputId: t.id,
|
|
90
90
|
kind: t.kind,
|
|
91
91
|
label: t.label,
|
|
92
|
-
field:
|
|
92
|
+
field: f(t.field, "dimension"),
|
|
93
93
|
operator: t.operator || "in",
|
|
94
94
|
source: t.source
|
|
95
95
|
} : {
|
|
@@ -98,7 +98,7 @@ function P(t) {
|
|
|
98
98
|
label: t.label
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function V(t = []) {
|
|
102
102
|
return t.map(
|
|
103
103
|
(r) => typeof r == "object" ? r : {
|
|
104
104
|
label: String(r),
|
|
@@ -109,7 +109,7 @@ function j(t = []) {
|
|
|
109
109
|
function A(t) {
|
|
110
110
|
return t == null ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : !0;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function F(t) {
|
|
113
113
|
return "toAnalyticsInput" in t ? t.toAnalyticsInput() : "kind" in t && "isActive" in t ? t : {
|
|
114
114
|
...t,
|
|
115
115
|
kind: "filter",
|
|
@@ -119,7 +119,7 @@ function V(t) {
|
|
|
119
119
|
value: t.value
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function k(t) {
|
|
123
123
|
if ("source" in t && t.source)
|
|
124
124
|
return t.source;
|
|
125
125
|
const r = t.datasetName || t.dataset;
|
|
@@ -134,28 +134,28 @@ function g(t) {
|
|
|
134
134
|
label: t.sourceLabel
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
var r,
|
|
139
|
-
return !!((r = t.fields) != null && r.length || (
|
|
137
|
+
function j(t) {
|
|
138
|
+
var r, o, n;
|
|
139
|
+
return !!((r = t.fields) != null && r.length || (o = t.dimensions) != null && o.length || (n = t.measures) != null && n.length);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function L(t) {
|
|
142
142
|
return !!(t != null && t.length);
|
|
143
143
|
}
|
|
144
|
-
function z(t, r,
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
|
|
144
|
+
function z(t, r, o) {
|
|
145
|
+
const n = [], e = /* @__PURE__ */ new Set(), a = (i) => {
|
|
146
|
+
const s = `${i.role || ""}:${i.name}`;
|
|
147
|
+
e.has(s) || (e.add(s), n.push(i));
|
|
148
148
|
};
|
|
149
|
-
return
|
|
149
|
+
return L(t) && t.map((i) => f(i)).forEach(a), r == null || r.map((i) => f(i, "dimension")).forEach(a), o == null || o.map((i) => f(i, "measure")).forEach(a), n;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function f(t, r) {
|
|
152
152
|
return typeof t == "string" ? r ? { name: t, role: r } : { name: t } : {
|
|
153
153
|
...t,
|
|
154
154
|
role: t.role || r
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
return (t || []).map(
|
|
157
|
+
function g(t) {
|
|
158
|
+
return (t || []).map(U);
|
|
159
159
|
}
|
|
160
160
|
function Q(t) {
|
|
161
161
|
if (!(!t || t === "none"))
|
|
@@ -171,7 +171,7 @@ function G() {
|
|
|
171
171
|
async function v(t, r) {
|
|
172
172
|
if (!r.token)
|
|
173
173
|
throw new Error("SemaphorDataAppProvider needs a token to execute queries.");
|
|
174
|
-
const
|
|
174
|
+
const o = await fetch(W(r), {
|
|
175
175
|
method: "POST",
|
|
176
176
|
headers: {
|
|
177
177
|
"Content-Type": "application/json",
|
|
@@ -182,24 +182,24 @@ async function v(t, r) {
|
|
|
182
182
|
activeInputs: r.activeInputs,
|
|
183
183
|
resultShape: t.kind
|
|
184
184
|
})
|
|
185
|
-
}),
|
|
186
|
-
if (!
|
|
185
|
+
}), n = await J(o);
|
|
186
|
+
if (!o.ok || n.error)
|
|
187
187
|
throw new Error(
|
|
188
|
-
|
|
188
|
+
n.error || `Semaphor Data App execution failed with status ${o.status}.`
|
|
189
189
|
);
|
|
190
|
-
return
|
|
190
|
+
return n;
|
|
191
191
|
}
|
|
192
192
|
async function J(t) {
|
|
193
193
|
const r = await t.text().catch(() => "");
|
|
194
194
|
if (!r.trim())
|
|
195
195
|
return t.ok ? {
|
|
196
|
-
error: "Semaphor Data App
|
|
196
|
+
error: "Semaphor Data App execution returned an empty response."
|
|
197
197
|
} : {};
|
|
198
198
|
try {
|
|
199
199
|
return JSON.parse(r);
|
|
200
200
|
} catch {
|
|
201
201
|
return t.ok ? {
|
|
202
|
-
error: "Semaphor Data App
|
|
202
|
+
error: "Semaphor Data App execution returned invalid JSON.",
|
|
203
203
|
details: r
|
|
204
204
|
} : {
|
|
205
205
|
error: H(t, r),
|
|
@@ -208,12 +208,12 @@ async function J(t) {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
function H(t, r) {
|
|
211
|
-
const
|
|
212
|
-
return
|
|
211
|
+
const o = t.statusText ? ` ${t.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
212
|
+
return n ? `Semaphor Data App execution failed with status ${t.status}${o}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${t.status}${o}.`;
|
|
213
213
|
}
|
|
214
214
|
function W(t) {
|
|
215
215
|
const r = X(t).replace(/\/+$/, "");
|
|
216
|
-
return r ? r.endsWith("/api") ? `${r}/v1/data-app/
|
|
216
|
+
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
217
217
|
}
|
|
218
218
|
function X(t) {
|
|
219
219
|
if (t.apiBaseUrl)
|
|
@@ -221,134 +221,144 @@ function X(t) {
|
|
|
221
221
|
if (!t.token)
|
|
222
222
|
return "";
|
|
223
223
|
try {
|
|
224
|
-
return
|
|
224
|
+
return $(t.token).apiServiceUrl || "";
|
|
225
225
|
} catch {
|
|
226
226
|
return "";
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
const
|
|
230
|
-
function
|
|
229
|
+
const q = w({});
|
|
230
|
+
function Y() {
|
|
231
|
+
if (!(typeof window > "u"))
|
|
232
|
+
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
233
|
+
}
|
|
234
|
+
function Z() {
|
|
235
|
+
return O(q);
|
|
236
|
+
}
|
|
237
|
+
function dt({
|
|
231
238
|
token: t,
|
|
232
239
|
apiBaseUrl: r,
|
|
233
|
-
executor:
|
|
234
|
-
children:
|
|
240
|
+
executor: o,
|
|
241
|
+
children: n
|
|
235
242
|
}) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
243
|
+
var d;
|
|
244
|
+
const e = Y(), a = ((d = e == null ? void 0 : e.authToken) == null ? void 0 : d.accessToken) || t, i = (e == null ? void 0 : e.dataApiBaseUrl) || (e == null ? void 0 : e.apiBaseUrl) || r, s = p(() => G(), []), u = o || s, c = p(
|
|
245
|
+
() => ({
|
|
246
|
+
token: a,
|
|
247
|
+
apiBaseUrl: i,
|
|
248
|
+
executor: u
|
|
249
|
+
}),
|
|
250
|
+
[i, u, a]
|
|
239
251
|
);
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
-
}
|
|
242
|
-
function Y() {
|
|
243
|
-
return K(R);
|
|
252
|
+
return /* @__PURE__ */ B(q.Provider, { value: c, children: n });
|
|
244
253
|
}
|
|
245
|
-
const I = { value: null },
|
|
246
|
-
function
|
|
247
|
-
const r =
|
|
254
|
+
const I = { value: null }, tt = { records: [] }, S = { options: [] };
|
|
255
|
+
function rt(t) {
|
|
256
|
+
const r = R(t.inputs);
|
|
248
257
|
try {
|
|
249
|
-
const
|
|
250
|
-
return
|
|
251
|
-
error:
|
|
258
|
+
const o = K(t), n = D(o);
|
|
259
|
+
return n ? {
|
|
260
|
+
error: n,
|
|
252
261
|
activeInputs: r,
|
|
253
|
-
queryKey:
|
|
262
|
+
queryKey: l(void 0, r, n),
|
|
254
263
|
idleData: I
|
|
255
264
|
} : {
|
|
256
|
-
intent:
|
|
265
|
+
intent: o,
|
|
257
266
|
error: null,
|
|
258
267
|
activeInputs: r,
|
|
259
|
-
queryKey:
|
|
268
|
+
queryKey: l(o, r),
|
|
260
269
|
idleData: I
|
|
261
270
|
};
|
|
262
|
-
} catch (
|
|
263
|
-
const
|
|
271
|
+
} catch (o) {
|
|
272
|
+
const n = y(o);
|
|
264
273
|
return {
|
|
265
|
-
error:
|
|
274
|
+
error: n,
|
|
266
275
|
activeInputs: r,
|
|
267
|
-
queryKey:
|
|
276
|
+
queryKey: l(void 0, r, n),
|
|
268
277
|
idleData: I
|
|
269
278
|
};
|
|
270
279
|
}
|
|
271
280
|
}
|
|
272
|
-
function
|
|
273
|
-
const r =
|
|
281
|
+
function et(t) {
|
|
282
|
+
const r = R(t.inputs), o = tt;
|
|
274
283
|
try {
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
error:
|
|
284
|
+
const n = C(t), e = D(n);
|
|
285
|
+
return e ? {
|
|
286
|
+
error: e,
|
|
278
287
|
activeInputs: r,
|
|
279
|
-
queryKey:
|
|
280
|
-
idleData:
|
|
288
|
+
queryKey: l(void 0, r, e),
|
|
289
|
+
idleData: o
|
|
281
290
|
} : {
|
|
282
|
-
intent:
|
|
291
|
+
intent: n,
|
|
283
292
|
error: null,
|
|
284
293
|
activeInputs: r,
|
|
285
|
-
queryKey:
|
|
286
|
-
idleData:
|
|
294
|
+
queryKey: l(n, r),
|
|
295
|
+
idleData: o
|
|
287
296
|
};
|
|
288
|
-
} catch (
|
|
289
|
-
const
|
|
297
|
+
} catch (n) {
|
|
298
|
+
const e = y(n);
|
|
290
299
|
return {
|
|
291
|
-
error:
|
|
300
|
+
error: e,
|
|
292
301
|
activeInputs: r,
|
|
293
|
-
queryKey:
|
|
294
|
-
idleData:
|
|
302
|
+
queryKey: l(void 0, r, e),
|
|
303
|
+
idleData: o
|
|
295
304
|
};
|
|
296
305
|
}
|
|
297
306
|
}
|
|
298
|
-
function
|
|
307
|
+
function nt(t) {
|
|
299
308
|
try {
|
|
300
|
-
const r =
|
|
301
|
-
return
|
|
302
|
-
error:
|
|
303
|
-
queryKey:
|
|
309
|
+
const r = P(t), o = D(r);
|
|
310
|
+
return o ? {
|
|
311
|
+
error: o,
|
|
312
|
+
queryKey: l(void 0, void 0, o),
|
|
304
313
|
idleData: S
|
|
305
314
|
} : {
|
|
306
315
|
intent: r,
|
|
307
316
|
error: null,
|
|
308
|
-
queryKey:
|
|
317
|
+
queryKey: l(r),
|
|
309
318
|
idleData: S
|
|
310
319
|
};
|
|
311
320
|
} catch (r) {
|
|
312
|
-
const
|
|
321
|
+
const o = y(r);
|
|
313
322
|
return {
|
|
314
|
-
error:
|
|
315
|
-
queryKey:
|
|
323
|
+
error: o,
|
|
324
|
+
queryKey: l(void 0, void 0, o),
|
|
316
325
|
idleData: S
|
|
317
326
|
};
|
|
318
327
|
}
|
|
319
328
|
}
|
|
320
|
-
function
|
|
329
|
+
function y(t) {
|
|
321
330
|
return t instanceof Error ? t : new Error(String(t));
|
|
322
331
|
}
|
|
323
|
-
function
|
|
324
|
-
const r =
|
|
332
|
+
function D(t) {
|
|
333
|
+
const r = T(t);
|
|
325
334
|
if (r.ok)
|
|
326
335
|
return null;
|
|
327
|
-
const
|
|
328
|
-
(
|
|
336
|
+
const o = r.errors.map(
|
|
337
|
+
(n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
|
|
329
338
|
).join("; ");
|
|
330
|
-
return new Error(`Invalid Semaphor analytics intent. ${
|
|
339
|
+
return new Error(`Invalid Semaphor analytics intent. ${o}`);
|
|
331
340
|
}
|
|
332
|
-
function
|
|
341
|
+
function l(t, r, o) {
|
|
333
342
|
return JSON.stringify({
|
|
334
343
|
intent: t,
|
|
335
344
|
activeInputs: r,
|
|
336
|
-
error:
|
|
345
|
+
error: o == null ? void 0 : o.message
|
|
337
346
|
});
|
|
338
347
|
}
|
|
339
|
-
function
|
|
340
|
-
const [r,
|
|
341
|
-
() =>
|
|
348
|
+
function lt(t) {
|
|
349
|
+
const [r, o] = x(t.defaultValue), n = Object.prototype.hasOwnProperty.call(t, "value"), e = n ? t.value : r, a = p(
|
|
350
|
+
() => V(t.options),
|
|
342
351
|
[t.options]
|
|
343
|
-
), i =
|
|
352
|
+
), i = h(
|
|
344
353
|
(u) => {
|
|
345
|
-
var
|
|
346
|
-
|
|
354
|
+
var d;
|
|
355
|
+
const c = u;
|
|
356
|
+
(d = t.onValueChange) == null || d.call(t, c), n || o(c);
|
|
347
357
|
},
|
|
348
|
-
[
|
|
349
|
-
),
|
|
350
|
-
return
|
|
351
|
-
const u =
|
|
358
|
+
[n, t]
|
|
359
|
+
), s = h(() => i(void 0), [i]);
|
|
360
|
+
return p(() => {
|
|
361
|
+
const u = N(t);
|
|
352
362
|
return {
|
|
353
363
|
id: t.id,
|
|
354
364
|
kind: t.kind,
|
|
@@ -357,156 +367,158 @@ function dt(t) {
|
|
|
357
367
|
operator: u.operator,
|
|
358
368
|
source: u.source,
|
|
359
369
|
controlRole: t.kind === "control" ? t.role : void 0,
|
|
360
|
-
value:
|
|
370
|
+
value: e,
|
|
361
371
|
options: a,
|
|
362
|
-
isActive: A(
|
|
372
|
+
isActive: A(e),
|
|
363
373
|
setValue: i,
|
|
364
|
-
clear:
|
|
374
|
+
clear: s,
|
|
365
375
|
toAnalyticsInput: () => ({
|
|
366
376
|
inputId: u.inputId,
|
|
367
377
|
field: u.field,
|
|
368
378
|
kind: t.kind,
|
|
369
379
|
label: t.label,
|
|
370
|
-
value:
|
|
371
|
-
isActive: A(
|
|
380
|
+
value: e,
|
|
381
|
+
isActive: A(e),
|
|
372
382
|
operator: u.operator,
|
|
373
383
|
source: u.source,
|
|
374
384
|
controlRole: t.kind === "control" ? t.role : void 0
|
|
375
385
|
})
|
|
376
386
|
};
|
|
377
|
-
}, [
|
|
387
|
+
}, [s, a, i, t, e]);
|
|
378
388
|
}
|
|
379
|
-
function
|
|
380
|
-
const r =
|
|
389
|
+
function ct(t) {
|
|
390
|
+
const r = p(() => rt(t), [t]), o = h(
|
|
381
391
|
(a) => {
|
|
382
392
|
var i;
|
|
383
393
|
return r.intent ? (i = a.executor) == null ? void 0 : i.executeMetric(r.intent, a) : void 0;
|
|
384
394
|
},
|
|
385
395
|
[r.intent]
|
|
386
|
-
),
|
|
396
|
+
), n = E(
|
|
387
397
|
r.queryKey,
|
|
388
|
-
|
|
398
|
+
o,
|
|
389
399
|
r.idleData,
|
|
390
400
|
r.activeInputs
|
|
391
|
-
),
|
|
401
|
+
), e = r.error ? r.idleData : n.data;
|
|
392
402
|
return {
|
|
393
403
|
id: t.id,
|
|
394
404
|
intent: r.intent,
|
|
395
|
-
value: (
|
|
396
|
-
metrics:
|
|
397
|
-
comparisonValue:
|
|
398
|
-
delta:
|
|
399
|
-
deltaPercent:
|
|
400
|
-
records:
|
|
401
|
-
status: r.error ? "error" :
|
|
402
|
-
isLoading: !r.error &&
|
|
403
|
-
error: r.error ||
|
|
405
|
+
value: (e == null ? void 0 : e.value) ?? null,
|
|
406
|
+
metrics: e == null ? void 0 : e.metrics,
|
|
407
|
+
comparisonValue: e == null ? void 0 : e.comparisonValue,
|
|
408
|
+
delta: e == null ? void 0 : e.delta,
|
|
409
|
+
deltaPercent: e == null ? void 0 : e.deltaPercent,
|
|
410
|
+
records: e == null ? void 0 : e.records,
|
|
411
|
+
status: r.error ? "error" : n.status,
|
|
412
|
+
isLoading: !r.error && n.status === "loading",
|
|
413
|
+
error: r.error || n.error
|
|
404
414
|
};
|
|
405
415
|
}
|
|
406
|
-
function
|
|
407
|
-
const r =
|
|
416
|
+
function ft(t) {
|
|
417
|
+
const r = p(() => et(t), [t]), o = h(
|
|
408
418
|
(a) => {
|
|
409
419
|
var i;
|
|
410
420
|
return r.intent ? (i = a.executor) == null ? void 0 : i.executeRecords(r.intent, a) : void 0;
|
|
411
421
|
},
|
|
412
422
|
[r.intent]
|
|
413
|
-
),
|
|
423
|
+
), n = E(
|
|
414
424
|
r.queryKey,
|
|
415
|
-
|
|
425
|
+
o,
|
|
416
426
|
r.idleData,
|
|
417
427
|
r.activeInputs
|
|
418
|
-
),
|
|
428
|
+
), e = r.error ? r.idleData : n.data;
|
|
419
429
|
return {
|
|
420
430
|
id: t.id,
|
|
421
431
|
intent: r.intent,
|
|
422
|
-
records: (
|
|
423
|
-
columns:
|
|
424
|
-
rowCount:
|
|
425
|
-
status: r.error ? "error" :
|
|
426
|
-
isLoading: !r.error &&
|
|
427
|
-
error: r.error ||
|
|
432
|
+
records: (e == null ? void 0 : e.records) || [],
|
|
433
|
+
columns: e == null ? void 0 : e.columns,
|
|
434
|
+
rowCount: e == null ? void 0 : e.rowCount,
|
|
435
|
+
status: r.error ? "error" : n.status,
|
|
436
|
+
isLoading: !r.error && n.status === "loading",
|
|
437
|
+
error: r.error || n.error
|
|
428
438
|
};
|
|
429
439
|
}
|
|
430
|
-
function
|
|
431
|
-
const r =
|
|
440
|
+
function mt(t) {
|
|
441
|
+
const r = p(() => nt(t), [t]), o = h(
|
|
432
442
|
(a) => {
|
|
433
443
|
var i;
|
|
434
444
|
return r.intent ? (i = a.executor) == null ? void 0 : i.executeInputOptions(r.intent, a) : void 0;
|
|
435
445
|
},
|
|
436
446
|
[r.intent]
|
|
437
|
-
),
|
|
447
|
+
), n = E(
|
|
438
448
|
r.queryKey,
|
|
439
|
-
|
|
449
|
+
o,
|
|
440
450
|
r.idleData
|
|
441
|
-
),
|
|
451
|
+
), e = r.error ? r.idleData : n.data;
|
|
442
452
|
return {
|
|
443
453
|
id: t.id,
|
|
444
454
|
intent: r.intent,
|
|
445
|
-
options: (
|
|
446
|
-
status: r.error ? "error" :
|
|
447
|
-
isLoading: !r.error &&
|
|
448
|
-
error: r.error ||
|
|
455
|
+
options: (e == null ? void 0 : e.options) || [],
|
|
456
|
+
status: r.error ? "error" : n.status,
|
|
457
|
+
isLoading: !r.error && n.status === "loading",
|
|
458
|
+
error: r.error || n.error
|
|
449
459
|
};
|
|
450
460
|
}
|
|
451
|
-
function
|
|
452
|
-
const
|
|
461
|
+
function E(t, r, o, n) {
|
|
462
|
+
const e = Z(), a = b(r), i = b(n), [s, u] = x({
|
|
453
463
|
status: "idle",
|
|
454
|
-
data:
|
|
464
|
+
data: o,
|
|
455
465
|
error: null
|
|
456
466
|
});
|
|
457
|
-
return a.current = r, i.current =
|
|
458
|
-
let
|
|
467
|
+
return a.current = r, i.current = n, _(() => {
|
|
468
|
+
let c;
|
|
459
469
|
try {
|
|
460
|
-
|
|
461
|
-
...
|
|
470
|
+
c = a.current({
|
|
471
|
+
...e,
|
|
462
472
|
activeInputs: i.current
|
|
463
473
|
});
|
|
464
|
-
} catch (
|
|
474
|
+
} catch (m) {
|
|
465
475
|
u({
|
|
466
476
|
status: "error",
|
|
467
|
-
data:
|
|
468
|
-
error:
|
|
477
|
+
data: o,
|
|
478
|
+
error: y(m)
|
|
469
479
|
});
|
|
470
480
|
return;
|
|
471
481
|
}
|
|
472
|
-
if (!
|
|
473
|
-
u({ status: "idle", data:
|
|
482
|
+
if (!c) {
|
|
483
|
+
u({ status: "idle", data: o, error: null });
|
|
474
484
|
return;
|
|
475
485
|
}
|
|
476
|
-
let
|
|
477
|
-
return u((
|
|
486
|
+
let d = !1;
|
|
487
|
+
return u((m) => ({
|
|
478
488
|
status: "loading",
|
|
479
|
-
data:
|
|
489
|
+
data: m.data,
|
|
480
490
|
error: null
|
|
481
|
-
})),
|
|
482
|
-
|
|
483
|
-
}).catch((
|
|
484
|
-
|
|
491
|
+
})), c.then((m) => {
|
|
492
|
+
d || u({ status: "success", data: m, error: null });
|
|
493
|
+
}).catch((m) => {
|
|
494
|
+
d || u({
|
|
485
495
|
status: "error",
|
|
486
|
-
data:
|
|
487
|
-
error:
|
|
496
|
+
data: o,
|
|
497
|
+
error: y(m)
|
|
488
498
|
});
|
|
489
499
|
}), () => {
|
|
490
|
-
|
|
500
|
+
d = !0;
|
|
491
501
|
};
|
|
492
|
-
}, [
|
|
502
|
+
}, [o, t, e]), s;
|
|
493
503
|
}
|
|
494
504
|
export {
|
|
495
|
-
|
|
505
|
+
q as SemaphorDataAppContext,
|
|
506
|
+
dt as SemaphorDataAppProvider,
|
|
496
507
|
G as createSemaphorDataAppExecutor,
|
|
497
508
|
A as hasSemaphorInputValue,
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
ct as
|
|
509
|
+
V as normalizeSemaphorInputOptions,
|
|
510
|
+
Y as readWindowRuntime,
|
|
511
|
+
R as toSemaphorActiveInputSnapshots,
|
|
512
|
+
U as toSemaphorInputBinding,
|
|
513
|
+
st as toSemaphorInputBindings,
|
|
514
|
+
P as toSemaphorInputOptionsIntent,
|
|
515
|
+
M as toSemaphorInputSnapshots,
|
|
516
|
+
N as toSemaphorInputSpec,
|
|
517
|
+
K as toSemaphorMetricIntent,
|
|
518
|
+
C as toSemaphorRecordsIntent,
|
|
519
|
+
Z as useSemaphorDataAppRuntime,
|
|
520
|
+
lt as useSemaphorInput,
|
|
521
|
+
mt as useSemaphorInputOptions,
|
|
522
|
+
ct as useSemaphorMetric,
|
|
523
|
+
ft as useSemaphorRecords
|
|
512
524
|
};
|