@cccsaurora/clue-ui 1.0.1-dev.57 → 1.0.1
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/ActionForm-WIj7BfD5.js +340 -0
- package/AnnotationPreview-DWRDhxUB.js +140 -0
- package/ClueEnrichContext-CbJVBm4w.js +397 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +34 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +94 -109
- package/components/AnnotationEntry.js +52 -50
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +92 -104
- package/components/EnrichedChip.js +109 -134
- package/components/EnrichedTypography.js +110 -136
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +50 -64
- package/components/actions/ResultModal.js +34 -37
- package/components/actions/form/schemaAdapter.js +20 -39
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +76 -92
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +200 -258
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/DynamicTabs.js +17 -22
- package/components/display/markdown/index.js +5674 -8531
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +18 -22
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +28 -37
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +11 -22
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +43 -63
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +61 -75
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-4YFAh_sa.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-HuYhutsd.js +975 -0
- package/index-WvFmjbxF.js +12734 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isEmpty-g47Qir2A.js +21 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/isUndefined-DiNCDKoz.js +10 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +68 -68
- package/package.json +1 -1
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/tabs-CgADNA57.js +195 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-BQ33EiyB.js +2273 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +254 -504
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +29 -41
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-C_RX5uMP.js +2704 -0
- package/ActionForm-c5hLIfQ-.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-m-4vn9rz.js +0 -518
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-BbPn6-Mw.js +0 -15750
- package/index-C9lySIVX.js +0 -1172
- package/index-Dn2NHyXg.js +0 -17654
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/isUndefined-CE8h73dH.js +0 -10
- package/last-CUCl67Im.js +0 -7
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
- package/utils-CxIhC2xH.js +0 -4182
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { materialRenderers as be, materialCells as Re } from "@jsonforms/material-renderers";
|
|
3
|
+
import { JsonForms as Ee } from "@jsonforms/react";
|
|
4
|
+
import { Stack as x, Typography as q, IconButton as Me, Modal as Se, Paper as je, Box as F, Button as G, Divider as oe, CircularProgress as Fe, Collapse as $e } from "@mui/material";
|
|
5
|
+
import le from "./components/display/icons/Iconified.js";
|
|
6
|
+
import { J as Je } from "./index-4YFAh_sa.js";
|
|
7
|
+
import { ClueComponentContext as ie } from "./hooks/ClueComponentContext.js";
|
|
8
|
+
import { c as Oe, u as ce, a as Pe } from "./index-E7g8cRyW.js";
|
|
9
|
+
import { A as ze } from "./index-WvFmjbxF.js";
|
|
10
|
+
import { a as te } from "./useClueTypeConfig-BQ33EiyB.js";
|
|
11
|
+
import { useState as v, useCallback as R, useEffect as We, useMemo as L, memo as qe } from "react";
|
|
12
|
+
import U from "./components/ErrorBoundary.js";
|
|
13
|
+
import { adaptSchema as Be } from "./components/actions/form/schemaAdapter.js";
|
|
14
|
+
import { d as de } from "./_baseGet-Dgf6_xCm.js";
|
|
15
|
+
import { b as Ve } from "./_baseSlice-M5RKzt1A.js";
|
|
16
|
+
import { i as ke } from "./utils-C_RX5uMP.js";
|
|
17
|
+
import He from "./components/actions/ResultModal.js";
|
|
18
|
+
import { SNACKBAR_EVENT_ID as I } from "./data/event.js";
|
|
19
|
+
import { safeDispatchEvent as K } from "./utils/window.js";
|
|
20
|
+
import _e from "./hooks/useClue.js";
|
|
21
|
+
function Ge(e, l, i) {
|
|
22
|
+
var o = e.length;
|
|
23
|
+
return i = i === void 0 ? o : i, !l && i >= o ? e : Ve(e, l, i);
|
|
24
|
+
}
|
|
25
|
+
var Ie = "\\ud800-\\udfff", Ke = "\\u0300-\\u036f", Le = "\\ufe20-\\ufe2f", Ne = "\\u20d0-\\u20ff", Ze = Ke + Le + Ne, Ue = "\\ufe0e\\ufe0f", Qe = "\\u200d", Xe = RegExp("[" + Qe + Ie + Ze + Ue + "]");
|
|
26
|
+
function fe(e) {
|
|
27
|
+
return Xe.test(e);
|
|
28
|
+
}
|
|
29
|
+
function Ye(e) {
|
|
30
|
+
return e.split("");
|
|
31
|
+
}
|
|
32
|
+
var me = "\\ud800-\\udfff", ne = "\\u0300-\\u036f", Te = "\\ufe20-\\ufe2f", ge = "\\u20d0-\\u20ff", Ae = ne + Te + ge, De = "\\ufe0e\\ufe0f", es = "[" + me + "]", N = "[" + Ae + "]", Z = "\\ud83c[\\udffb-\\udfff]", ss = "(?:" + N + "|" + Z + ")", pe = "[^" + me + "]", ae = "(?:\\ud83c[\\udde6-\\uddff]){2}", ue = "[\\ud800-\\udbff][\\udc00-\\udfff]", rs = "\\u200d", he = ss + "?", ve = "[" + De + "]?", os = "(?:" + rs + "(?:" + [pe, ae, ue].join("|") + ")" + ve + he + ")*", ts = ve + he + os, ls = "(?:" + [pe + N + "?", N, ae, ue, es].join("|") + ")", is = RegExp(Z + "(?=" + Z + ")|" + ls + ts, "g");
|
|
33
|
+
function cs(e) {
|
|
34
|
+
return e.match(is) || [];
|
|
35
|
+
}
|
|
36
|
+
function ds(e) {
|
|
37
|
+
return fe(e) ? cs(e) : Ye(e);
|
|
38
|
+
}
|
|
39
|
+
function fs(e) {
|
|
40
|
+
return function(l) {
|
|
41
|
+
l = de(l);
|
|
42
|
+
var i = fe(l) ? ds(l) : void 0, o = i ? i[0] : l.charAt(0), m = i ? Ge(i, 1).join("") : l.slice(1);
|
|
43
|
+
return o[e]() + m;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var ms = fs("toUpperCase");
|
|
47
|
+
function ps(e) {
|
|
48
|
+
return ms(de(e).toLowerCase());
|
|
49
|
+
}
|
|
50
|
+
const as = new ze({ removeAdditional: !0, coerceTypes: !0, strict: !1 }), Ce = Oe(null), Hs = ({
|
|
51
|
+
baseURL: e,
|
|
52
|
+
children: l,
|
|
53
|
+
classification: i,
|
|
54
|
+
getToken: o,
|
|
55
|
+
onNetworkCall: m
|
|
56
|
+
}) => {
|
|
57
|
+
const { t: E } = ce(ie, (c) => c.i18next), { ready: w } = _e(), [a, C] = v(null), [$, M] = v({}), [B, t] = v(!1), [J, V] = v(null), [r, d] = v(!1), [b, O] = v({}), k = R(async () => {
|
|
58
|
+
if (!w)
|
|
59
|
+
return;
|
|
60
|
+
const c = {}, u = o == null ? void 0 : o();
|
|
61
|
+
u && (c.Authorization = `Bearer ${u}`);
|
|
62
|
+
let y = { baseURL: e, headers: c };
|
|
63
|
+
m && (y = m(y));
|
|
64
|
+
const S = await te.actions.get(y);
|
|
65
|
+
return S && O(S), S;
|
|
66
|
+
}, [e, o, m, w]);
|
|
67
|
+
We(() => {
|
|
68
|
+
k();
|
|
69
|
+
}, [e, w]);
|
|
70
|
+
const P = R(
|
|
71
|
+
(c, u, y) => JSON.stringify({ type: c, value: u, classification: y ?? i }),
|
|
72
|
+
[i]
|
|
73
|
+
), Q = R(
|
|
74
|
+
async (c, u, y, S) => {
|
|
75
|
+
const { forceMenu: n, onComplete: z, skipMenu: xe, timeout: T } = {
|
|
76
|
+
forceMenu: !1,
|
|
77
|
+
skipMenu: !1,
|
|
78
|
+
onComplete: null,
|
|
79
|
+
timeout: null,
|
|
80
|
+
...S
|
|
81
|
+
}, g = {}, A = o == null ? void 0 : o();
|
|
82
|
+
if (A && (g.Authorization = `Bearer ${A}`), !Object.keys(b).includes(c))
|
|
83
|
+
throw new Error("Invalid action id");
|
|
84
|
+
const D = u.map(
|
|
85
|
+
(h) => h.type === "telemetry" ? { ...h, value: JSON.stringify(h.value) } : h
|
|
86
|
+
), W = b[c], H = as.compile(W.params), _ = { selectors: D, ...y };
|
|
87
|
+
if (d(!0), !H(_) || n) {
|
|
88
|
+
if (xe && !n)
|
|
89
|
+
throw console.error(`Form is not valid (${H.errors.length} errors)`), new Error("Form is not completed");
|
|
90
|
+
(a == null ? void 0 : a.id) === c && (console.error(`Form is not valid (${H.errors.length} errors)`), K(
|
|
91
|
+
new CustomEvent(I, {
|
|
92
|
+
detail: {
|
|
93
|
+
message: E("action.error.validation"),
|
|
94
|
+
level: "error"
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
)), C({
|
|
98
|
+
id: c,
|
|
99
|
+
action: W,
|
|
100
|
+
selectors: u,
|
|
101
|
+
params: _ ?? {},
|
|
102
|
+
onComplete: z,
|
|
103
|
+
timeout: T
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
let h = { baseURL: e, headers: g };
|
|
109
|
+
m && (h = m(h));
|
|
110
|
+
const p = await te.actions.post(
|
|
111
|
+
c,
|
|
112
|
+
D,
|
|
113
|
+
_ ?? {},
|
|
114
|
+
{ timeout: T },
|
|
115
|
+
h
|
|
116
|
+
), ee = { ...p, actionId: c, action: W };
|
|
117
|
+
z == null || z(ee), M((se) => {
|
|
118
|
+
const we = u.map((j) => P(j.type, j.value, j.classification));
|
|
119
|
+
return {
|
|
120
|
+
...se,
|
|
121
|
+
...we.reduce(
|
|
122
|
+
(j, re) => ({
|
|
123
|
+
...j,
|
|
124
|
+
[re]: [...se[re] ?? [], ee]
|
|
125
|
+
}),
|
|
126
|
+
{}
|
|
127
|
+
)
|
|
128
|
+
};
|
|
129
|
+
}), K(
|
|
130
|
+
new CustomEvent(I, {
|
|
131
|
+
detail: {
|
|
132
|
+
message: /* @__PURE__ */ f(x, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
|
|
133
|
+
/* @__PURE__ */ s(q, { children: p.summary }),
|
|
134
|
+
p.link && /* @__PURE__ */ s(Me, { component: "a", href: p.link, size: "small", target: "_blank", children: /* @__PURE__ */ s(le, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
135
|
+
] }),
|
|
136
|
+
timeout: p.link ? null : 5e3,
|
|
137
|
+
level: p.outcome === "success" ? "success" : "error",
|
|
138
|
+
options: {
|
|
139
|
+
style: {
|
|
140
|
+
minWidth: 0
|
|
141
|
+
},
|
|
142
|
+
SnackbarProps: {
|
|
143
|
+
style: {
|
|
144
|
+
minWidth: 0
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
), p.outcome === "success" && C(null), p.format && (V({ ...p, actionId: c, action: W }), p.format !== "pivot" ? t(!0) : window.open(p.output, "_blank", "noreferrer"));
|
|
151
|
+
} catch (h) {
|
|
152
|
+
K(
|
|
153
|
+
new CustomEvent(I, {
|
|
154
|
+
detail: {
|
|
155
|
+
message: h.toString(),
|
|
156
|
+
level: "error"
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
);
|
|
160
|
+
} finally {
|
|
161
|
+
d(!1);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
[b, e, P, o, m, a == null ? void 0 : a.id, E]
|
|
165
|
+
), X = R(() => {
|
|
166
|
+
C(null), d(!1);
|
|
167
|
+
}, []), Y = R(
|
|
168
|
+
(c, u, y) => $[P(c, u, y)] ?? [],
|
|
169
|
+
[$, P]
|
|
170
|
+
), ye = L(
|
|
171
|
+
() => ({
|
|
172
|
+
availableActions: b,
|
|
173
|
+
executeAction: Q,
|
|
174
|
+
cancelAction: X,
|
|
175
|
+
getActionResults: Y,
|
|
176
|
+
loading: r,
|
|
177
|
+
refreshActions: k
|
|
178
|
+
}),
|
|
179
|
+
[b, X, Q, Y, r, k]
|
|
180
|
+
);
|
|
181
|
+
return /* @__PURE__ */ f(Ce.Provider, { value: ye, children: [
|
|
182
|
+
l,
|
|
183
|
+
/* @__PURE__ */ f(U, { children: [
|
|
184
|
+
a && /* @__PURE__ */ s(Cs, { runningActionData: a }),
|
|
185
|
+
/* @__PURE__ */ s(
|
|
186
|
+
He,
|
|
187
|
+
{
|
|
188
|
+
show: B && !!J,
|
|
189
|
+
result: J,
|
|
190
|
+
onClose: () => t(!1)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] })
|
|
194
|
+
] });
|
|
195
|
+
}, us = () => Pe(Ce), hs = be.map((e) => ({
|
|
196
|
+
...e,
|
|
197
|
+
renderer: ({ ...l }) => /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(e.renderer, { ...l }) })
|
|
198
|
+
})), vs = ({ runningActionData: e }) => {
|
|
199
|
+
const { executeAction: l, cancelAction: i } = us(), { t: o } = ce(ie, (r) => r.i18next), [m, E] = v(!1), [w, a] = v(null), [C, $] = v(e == null ? void 0 : e.params), [M, B] = v(!1), t = L(
|
|
200
|
+
() => e != null && e.action ? { ...Be(e.action.params), ...e.action.extra_schema ?? {} } : null,
|
|
201
|
+
[e == null ? void 0 : e.action]
|
|
202
|
+
), J = L(
|
|
203
|
+
() => ({
|
|
204
|
+
type: "VerticalLayout",
|
|
205
|
+
elements: Object.entries((t == null ? void 0 : t.properties) ?? {}).sort(([r, d], [b, O]) => d.order || O.order ? d.order - O.order : +(t == null ? void 0 : t.required.includes(r)) - +(t == null ? void 0 : t.required.includes(b))).map(([r, d]) => ({
|
|
206
|
+
type: "Control",
|
|
207
|
+
scope: `#/properties/${r}`,
|
|
208
|
+
options: {
|
|
209
|
+
autocomplete: !!d.enum,
|
|
210
|
+
showUnfocusedDescription: !0,
|
|
211
|
+
...d.options
|
|
212
|
+
},
|
|
213
|
+
rule: d.rule
|
|
214
|
+
}))
|
|
215
|
+
}),
|
|
216
|
+
[t == null ? void 0 : t.properties, t == null ? void 0 : t.required]
|
|
217
|
+
), V = R(async () => {
|
|
218
|
+
try {
|
|
219
|
+
E(!0);
|
|
220
|
+
const r = {};
|
|
221
|
+
e != null && e.onComplete && (r.onComplete = e == null ? void 0 : e.onComplete), e != null && e.timeout && (r.timeout = e == null ? void 0 : e.timeout), await l(e == null ? void 0 : e.id, e == null ? void 0 : e.selectors, C, r);
|
|
222
|
+
} catch (r) {
|
|
223
|
+
console.error(r);
|
|
224
|
+
} finally {
|
|
225
|
+
E(!1);
|
|
226
|
+
}
|
|
227
|
+
}, [
|
|
228
|
+
l,
|
|
229
|
+
e == null ? void 0 : e.id,
|
|
230
|
+
e == null ? void 0 : e.selectors,
|
|
231
|
+
e == null ? void 0 : e.onComplete,
|
|
232
|
+
e == null ? void 0 : e.timeout,
|
|
233
|
+
C
|
|
234
|
+
]);
|
|
235
|
+
if (e != null && e.action)
|
|
236
|
+
try {
|
|
237
|
+
return /* @__PURE__ */ s(Se, { open: !0, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: i, children: /* @__PURE__ */ s(
|
|
238
|
+
je,
|
|
239
|
+
{
|
|
240
|
+
sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", px: 2, pt: 2, minWidth: "750px", overflow: "auto" },
|
|
241
|
+
children: /* @__PURE__ */ f(
|
|
242
|
+
x,
|
|
243
|
+
{
|
|
244
|
+
spacing: 1,
|
|
245
|
+
height: "100%",
|
|
246
|
+
sx: {
|
|
247
|
+
".MuiFormHelperText-root": {
|
|
248
|
+
marginLeft: "0 !important",
|
|
249
|
+
"&:last-of-type": { mb: 3 }
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ f(x, { direction: "row", spacing: 1, children: [
|
|
254
|
+
/* @__PURE__ */ f(x, { direction: "column", spacing: 1, children: [
|
|
255
|
+
/* @__PURE__ */ f(q, { variant: "h5", children: [
|
|
256
|
+
o("actions.executing"),
|
|
257
|
+
" ",
|
|
258
|
+
e == null ? void 0 : e.action.id.replace(/_/g, " ").split(" ").map(ps).join(" ")
|
|
259
|
+
] }),
|
|
260
|
+
(e == null ? void 0 : e.action.summary) && /* @__PURE__ */ s(q, { variant: "body1", color: "text.secondary", sx: { pb: 1.5 }, children: e == null ? void 0 : e.action.summary })
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ s(F, { flex: 1 }),
|
|
263
|
+
/* @__PURE__ */ s(F, { alignContent: "end", children: /* @__PURE__ */ s(
|
|
264
|
+
G,
|
|
265
|
+
{
|
|
266
|
+
variant: "outlined",
|
|
267
|
+
onClick: () => B((r) => !r),
|
|
268
|
+
startIcon: /* @__PURE__ */ s(
|
|
269
|
+
F,
|
|
270
|
+
{
|
|
271
|
+
component: "span",
|
|
272
|
+
sx: (r) => ({
|
|
273
|
+
transition: r.transitions.create("transform"),
|
|
274
|
+
transform: M ? "rotate(180deg)" : "rotate(0deg)"
|
|
275
|
+
}),
|
|
276
|
+
children: /* @__PURE__ */ s(le, { icon: "ic:baseline-keyboard-double-arrow-right" })
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
children: o(M ? "actions.json.hide" : "actions.json.show")
|
|
280
|
+
}
|
|
281
|
+
) })
|
|
282
|
+
] }),
|
|
283
|
+
/* @__PURE__ */ s(oe, { orientation: "horizontal", variant: "middle" }),
|
|
284
|
+
/* @__PURE__ */ s(F, { pt: 1.5 }),
|
|
285
|
+
/* @__PURE__ */ f(x, { flexGrow: 1, direction: "row", spacing: 1, children: [
|
|
286
|
+
/* @__PURE__ */ f(x, { direction: "column", flexGrow: 1, children: [
|
|
287
|
+
/* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(
|
|
288
|
+
Ee,
|
|
289
|
+
{
|
|
290
|
+
schema: t,
|
|
291
|
+
uischema: J,
|
|
292
|
+
renderers: hs,
|
|
293
|
+
cells: Re,
|
|
294
|
+
data: C,
|
|
295
|
+
onChange: ({ data: r, errors: d }) => {
|
|
296
|
+
ke(r, C) || $(r), a(d);
|
|
297
|
+
},
|
|
298
|
+
config: {}
|
|
299
|
+
}
|
|
300
|
+
) }),
|
|
301
|
+
/* @__PURE__ */ f(x, { direction: "row", spacing: 1, pb: 1, children: [
|
|
302
|
+
/* @__PURE__ */ s("div", { style: { flex: 1 } }),
|
|
303
|
+
/* @__PURE__ */ s(G, { color: "error", variant: "outlined", onClick: i, children: o("cancel") }),
|
|
304
|
+
/* @__PURE__ */ s(
|
|
305
|
+
G,
|
|
306
|
+
{
|
|
307
|
+
color: "success",
|
|
308
|
+
variant: "outlined",
|
|
309
|
+
disabled: m || (w == null ? void 0 : w.length) > 0,
|
|
310
|
+
onClick: V,
|
|
311
|
+
endIcon: m && /* @__PURE__ */ s(Fe, { color: "inherit", size: 18 }),
|
|
312
|
+
children: o("actions.execute")
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ s($e, { orientation: "horizontal", in: M, unmountOnExit: !0, mountOnEnter: !0, children: /* @__PURE__ */ f(x, { direction: "row", height: "100%", spacing: 1, children: [
|
|
318
|
+
/* @__PURE__ */ s(oe, { orientation: "vertical" }),
|
|
319
|
+
/* @__PURE__ */ f(x, { children: [
|
|
320
|
+
/* @__PURE__ */ s(q, { variant: "h5", children: o("action.data") }),
|
|
321
|
+
/* @__PURE__ */ s(F, { width: 600, height: "100%", children: /* @__PURE__ */ s(Je, { data: C, slotProps: { stack: { height: "100%" }, json: { name: !1 } } }) })
|
|
322
|
+
] })
|
|
323
|
+
] }) })
|
|
324
|
+
] })
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
) });
|
|
330
|
+
} catch (r) {
|
|
331
|
+
return console.warn(r), null;
|
|
332
|
+
}
|
|
333
|
+
}, Cs = qe(vs);
|
|
334
|
+
export {
|
|
335
|
+
Cs as A,
|
|
336
|
+
Hs as C,
|
|
337
|
+
Ce as a,
|
|
338
|
+
ps as c,
|
|
339
|
+
us as u
|
|
340
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsxs as C, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { I as H } from "./iconify-BBckr5AQ.js";
|
|
3
|
+
import { useTheme as k, Popper as V, Fade as j, Paper as O, Stack as w, Typography as y, Divider as W } from "@mui/material";
|
|
4
|
+
import F from "./components/AnnotationDetailPopover.js";
|
|
5
|
+
import L from "./hooks/useAnnotations.js";
|
|
6
|
+
import { t as M } from "./utils-C_RX5uMP.js";
|
|
7
|
+
import { useState as v, useRef as Y, useCallback as x, useEffect as Z, useMemo as _ } from "react";
|
|
8
|
+
import { c as B, u as G } from "./index-E7g8cRyW.js";
|
|
9
|
+
import { SHOW_EVENT_ID as g, HIDE_EVENT_ID as D } from "./data/event.js";
|
|
10
|
+
import { safeDispatchEvent as A, safeAddEventListener as S } from "./utils/window.js";
|
|
11
|
+
import { i as J } from "./isUndefined-DiNCDKoz.js";
|
|
12
|
+
const b = B(null), rt = ({ children: c }) => {
|
|
13
|
+
const [l, e] = v(null), [p, i] = v(null), [r, d] = v(null), [u, m] = v(null), [f, t] = v({}), a = Y(null), P = x((s, o, z, N) => {
|
|
14
|
+
A(
|
|
15
|
+
new CustomEvent(g, {
|
|
16
|
+
detail: {
|
|
17
|
+
type: s,
|
|
18
|
+
anchorEl: o,
|
|
19
|
+
value: z,
|
|
20
|
+
options: N
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}, []), h = x(
|
|
25
|
+
(s, o) => {
|
|
26
|
+
A(
|
|
27
|
+
new CustomEvent(D, {
|
|
28
|
+
detail: {
|
|
29
|
+
type: s,
|
|
30
|
+
value: o
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
[]
|
|
37
|
+
), E = x((s) => {
|
|
38
|
+
const { detail: o } = s;
|
|
39
|
+
e(o.type), d(o.value), o.options && (o.options.content && m(o.options.content), o.options.onClose && (a.current = o.options.onClose), o.options.popoverProps && t(o.options.popoverProps)), i(o.anchorEl);
|
|
40
|
+
}, []), I = x(
|
|
41
|
+
(s) => {
|
|
42
|
+
const { detail: o } = s;
|
|
43
|
+
r && (o.type !== l || r.type !== o.value.type || r.value !== o.value.value) || (e(null), i(null), d(null), m(null), t({}), a.current = null);
|
|
44
|
+
},
|
|
45
|
+
[r, l]
|
|
46
|
+
);
|
|
47
|
+
Z(() => {
|
|
48
|
+
const s = S(g, E), o = S(D, I);
|
|
49
|
+
return () => {
|
|
50
|
+
s(), o();
|
|
51
|
+
};
|
|
52
|
+
}, [E, I]);
|
|
53
|
+
const T = _(
|
|
54
|
+
() => ({
|
|
55
|
+
showInfo: P,
|
|
56
|
+
closeInfo: h,
|
|
57
|
+
__detailsContent: u
|
|
58
|
+
}),
|
|
59
|
+
[h, u, P]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ C(b.Provider, { value: T, children: [
|
|
62
|
+
c,
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
|
+
F,
|
|
65
|
+
{
|
|
66
|
+
...f,
|
|
67
|
+
anchorEl: p,
|
|
68
|
+
open: !!p && l === "details",
|
|
69
|
+
enrichRequest: r,
|
|
70
|
+
onClose: () => {
|
|
71
|
+
a.current ? a.current() : h("details", r);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ n(
|
|
76
|
+
K,
|
|
77
|
+
{
|
|
78
|
+
...f,
|
|
79
|
+
anchorEl: p,
|
|
80
|
+
open: !!p && !J(l) && l !== "details",
|
|
81
|
+
annotationType: l,
|
|
82
|
+
enrichRequest: r
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
}, K = ({ annotationType: c, anchorEl: l, enrichRequest: e, open: p, ...i }) => {
|
|
87
|
+
const r = k(), d = G(b, (t) => t.__detailsContent), [u] = L(e == null ? void 0 : e.type, e == null ? void 0 : e.value, e == null ? void 0 : e.classification), m = _(
|
|
88
|
+
() => c === "actionResults" ? [] : u.filter((t) => t.type === c),
|
|
89
|
+
[c, u]
|
|
90
|
+
), f = x((t) => {
|
|
91
|
+
try {
|
|
92
|
+
const a = parseInt(window.getComputedStyle(t, null).getPropertyValue("z-index"));
|
|
93
|
+
return isNaN(a) ? f(t.parentElement) : (a + 2).toString();
|
|
94
|
+
} catch {
|
|
95
|
+
return "2";
|
|
96
|
+
}
|
|
97
|
+
}, []);
|
|
98
|
+
return !m.length && !d ? null : /* @__PURE__ */ n(
|
|
99
|
+
V,
|
|
100
|
+
{
|
|
101
|
+
...i,
|
|
102
|
+
open: p,
|
|
103
|
+
anchorEl: l,
|
|
104
|
+
placement: "bottom-start",
|
|
105
|
+
sx: [{ zIndex: f(l) }, ...Array.isArray(i.sx) ? i.sx : [i.sx]],
|
|
106
|
+
children: /* @__PURE__ */ n(j, { in: !!l, children: /* @__PURE__ */ n(O, { sx: { overflowY: "auto", maxWidth: "500px", boxShadow: r.shadows[2] }, children: /* @__PURE__ */ n(w, { direction: "column", sx: { p: 1 }, spacing: 1, divider: /* @__PURE__ */ n(W, { orientation: "horizontal" }), children: d ?? m.map((t) => /* @__PURE__ */ C(
|
|
107
|
+
w,
|
|
108
|
+
{
|
|
109
|
+
direction: "column",
|
|
110
|
+
spacing: 1,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ C(w, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
113
|
+
t.analytic_icon && /* @__PURE__ */ n(
|
|
114
|
+
H,
|
|
115
|
+
{
|
|
116
|
+
icon: t.analytic_icon,
|
|
117
|
+
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ n(y, { variant: "body1", sx: { textTransform: "capitalize" }, children: t.analytic ?? t.author }),
|
|
121
|
+
/* @__PURE__ */ C(y, { variant: "caption", color: "text.secondary", children: [
|
|
122
|
+
"(",
|
|
123
|
+
M(t.timestamp),
|
|
124
|
+
")"
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ n(y, { variant: "body2", children: t.summary }),
|
|
128
|
+
/* @__PURE__ */ n(y, { variant: "caption", color: "text.secondary", children: t.value })
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
t.analytic + t.author + t.value + t.link + t.summary + t.timestamp
|
|
132
|
+
)) }) }) })
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
K as A,
|
|
138
|
+
b as C,
|
|
139
|
+
rt as a
|
|
140
|
+
};
|