@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3

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.
Files changed (183) hide show
  1. package/ActionForm-DlOXqMUx.js +4460 -0
  2. package/AnnotationDetails-Bk-p0F6h.js +160 -0
  3. package/AnnotationPreview-jzZvkCxJ.js +140 -0
  4. package/ClueEnrichContext-KqRuuWNS.js +418 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-BiTi0iqu.js +180 -0
  7. package/_Uint8Array-BQNOM9Rr.js +101 -0
  8. package/_baseAssignValue-CNMLQZco.js +20 -0
  9. package/_baseClone-BnT-6pyM.js +207 -0
  10. package/_baseExtremum-Ca2EHgy2.js +16 -0
  11. package/_baseFlatten-Bfr_Molw.js +72 -0
  12. package/_baseGet-DSZygzyq.js +79 -0
  13. package/_baseIsEqual-VgvaAFZG.js +147 -0
  14. package/_baseIteratee-Dbfsw5z8.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-BJcj69PL.js +79 -0
  18. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  19. package/_createAggregator-k3TuAnxT.js +53 -0
  20. package/_getPrototype-Cr1Mk7BC.js +5 -0
  21. package/_getTag-CK2Sffaq.js +90 -0
  22. package/_isIterateeCall-DkJP7Rbx.js +13 -0
  23. package/_setToArray-C7yMOeww.js +29 -0
  24. package/cloneDeep-CF8TtLHr.js +8 -0
  25. package/components/AnnotationBody.js +35 -49
  26. package/components/AnnotationDetailPopover.js +30 -36
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +23 -44
  31. package/components/CountBadge.js +26 -31
  32. package/components/EnrichedCard.js +97 -110
  33. package/components/EnrichedChip.js +105 -130
  34. package/components/EnrichedTypography.js +107 -133
  35. package/components/ErrorBoundary.js +24 -28
  36. package/components/RetryFailedEnrichments.js +9 -10
  37. package/components/SourcePicker.js +49 -57
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +59 -75
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +23 -39
  42. package/components/actions/formats/FileResult.js +59 -86
  43. package/components/actions/formats/index.js +10 -21
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +91 -111
  46. package/components/display/graph/elements/NodeTag.js +13 -15
  47. package/components/display/graph/index.js +202 -261
  48. package/components/display/graph/visualizations/Leaf.js +69 -88
  49. package/components/display/graph/visualizations/cloud/index.js +81 -98
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +13 -14
  57. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  58. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +306 -408
  61. package/components/display/icons/Iconified.js +12 -27
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +5770 -8678
  64. package/components/enrichment/EnrichPopover.js +46 -54
  65. package/components/fetchers/Fetcher.js +119 -158
  66. package/components/fetchers/PreviewModal.js +17 -20
  67. package/components/fetchers/StatusChip.js +17 -21
  68. package/components/group/Entry.js +11 -13
  69. package/components/group/Group.js +10 -13
  70. package/components/group/GroupControl.js +65 -76
  71. package/components/stats/QueryStatus.js +33 -43
  72. package/countBy-CdYegFSu.js +8 -0
  73. package/data/event.js +4 -6
  74. package/database/index.js +2 -2
  75. package/debounce-DryYcbJ4.js +56 -0
  76. package/get-CH7kz5Ix.js +8 -0
  77. package/groupBy-br8xmD2R.js +8 -0
  78. package/hooks/ClueActionContext.js +6 -6
  79. package/hooks/ClueComponentContext.js +23 -29
  80. package/hooks/ClueConfigProvider.js +12 -14
  81. package/hooks/ClueDatabaseContext.js +13 -19
  82. package/hooks/ClueEnrichContext.js +8 -8
  83. package/hooks/ClueFetcherContext.js +56 -83
  84. package/hooks/ClueGroupContext.js +14 -17
  85. package/hooks/CluePopupContext.js +5 -5
  86. package/hooks/ClueProvider.js +10 -12
  87. package/hooks/selectors.js +7 -7
  88. package/hooks/useActionResult.js +2 -2
  89. package/hooks/useAnnotations.js +31 -47
  90. package/hooks/useClue.js +4 -6
  91. package/hooks/useClueActions.js +3 -3
  92. package/hooks/useClueConfig.js +4 -6
  93. package/hooks/useClueTypeConfig.js +3 -3
  94. package/hooks/useComparator.js +435 -722
  95. package/hooks/useErrors.js +18 -22
  96. package/hooks/useFetcherResult.js +24 -33
  97. package/hooks/useMyHighlights.js +36 -66
  98. package/hooks/useMyLocalStorage.js +37 -66
  99. package/iconify-BBckr5AQ.js +1263 -0
  100. package/icons/Action.js +49 -66
  101. package/icons/Assessment.js +69 -85
  102. package/icons/Context.js +63 -77
  103. package/icons/Opinion.js +60 -76
  104. package/icons/iconMap.js +2 -2
  105. package/identity-ByMq8VxU.js +6 -0
  106. package/index-BHAe_V9n.js +12768 -0
  107. package/index-BK-zfYhR.js +358 -0
  108. package/index-CA5CUNZO.js +975 -0
  109. package/index-Dj5C04IX.js +568 -0
  110. package/index-p5_wX7q1.js +11729 -0
  111. package/isNil-CjWwlQS3.js +6 -0
  112. package/isObject-B53jY8Qg.js +7 -0
  113. package/isObjectLike-BatpeCIi.js +29 -0
  114. package/isSymbol-C3_SC0Qp.js +8 -0
  115. package/last-7CdUxN0r.js +7 -0
  116. package/main.js +60 -60
  117. package/maxBy-Bc0dYHcO.js +8 -0
  118. package/package.json +1 -1
  119. package/sortBy-DY2JBf9n.js +75 -0
  120. package/sumBy-DuMASLPd.js +8 -0
  121. package/text/Frequency.js +23 -42
  122. package/toFinite-BMy6GObD.js +14 -0
  123. package/toNumber-YVhnnJv4.js +31 -0
  124. package/useClueTypeConfig-Ct9Ygter.js +2292 -0
  125. package/utils/chain.js +65 -92
  126. package/utils/classificationParser.js +256 -519
  127. package/utils/constants.js +10 -35
  128. package/utils/graph.js +45 -72
  129. package/utils/hashUtil.js +7 -7
  130. package/utils/line.js +81 -131
  131. package/utils/loggerUtil.js +3 -5
  132. package/utils/sessionStorage.js +27 -41
  133. package/utils/time.js +423 -423
  134. package/utils/utils.js +9 -9
  135. package/utils/window.js +10 -21
  136. package/utils-DmwSUrum.js +129 -0
  137. package/ActionForm-uDp92tN2.js +0 -5941
  138. package/AnnotationDetails-DGYfOiWm.js +0 -175
  139. package/AnnotationPreview-bHObsb3P.js +0 -188
  140. package/ClueEnrichContext-CJEJxrgs.js +0 -541
  141. package/FlexOne-BSYAhhtG.js +0 -9
  142. package/_MapCache-WmuDdwuH.js +0 -222
  143. package/_Uint8Array-B7JqpgFX.js +0 -128
  144. package/_baseAssignValue-CGTuELqU.js +0 -25
  145. package/_baseClone-CkNrTyhm.js +0 -283
  146. package/_baseExtremum-kob8QXyt.js +0 -18
  147. package/_baseFlatten-jIR_sN_-.js +0 -92
  148. package/_baseGet-Bx3A4Qfp.js +0 -108
  149. package/_baseIsEqual-C5OTWzTk.js +0 -208
  150. package/_baseIteratee-avi7MX2o.js +0 -126
  151. package/_baseSlice-GAv_YFTT.js +0 -20
  152. package/_baseSum-D0WC1dN0.js +0 -13
  153. package/_baseUniq-BI9GIHMF.js +0 -115
  154. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  155. package/_createAggregator-QD8MzKwe.js +0 -63
  156. package/_getPrototype-CU0j_POw.js +0 -5
  157. package/_getTag-Ckxxfr88.js +0 -126
  158. package/_isIterateeCall-Ds3sw2SF.js +0 -17
  159. package/_setToArray-CaPKQhcz.js +0 -33
  160. package/cloneDeep-DJrLSw8W.js +0 -8
  161. package/countBy-c6S3dvSW.js +0 -14
  162. package/debounce-bV0h5FC5.js +0 -92
  163. package/get-DSsNkRQs.js +0 -8
  164. package/groupBy-xqz-n0Vd.js +0 -14
  165. package/iconify-CXMreGTg.js +0 -1782
  166. package/identity-CPGTqrE4.js +0 -6
  167. package/index-AMfoEg_6.js +0 -696
  168. package/index-B6C2a_Lg.js +0 -1172
  169. package/index-C12gPw2W.js +0 -17698
  170. package/index-DCKkHTvx.js +0 -15750
  171. package/index-JcKyZeoY.js +0 -465
  172. package/isNil-CIubwp4T.js +0 -6
  173. package/isObject-FTY-5JQX.js +0 -7
  174. package/isObjectLike-OAgjjZye.js +0 -48
  175. package/isSymbol-Xd2FsJyp.js +0 -8
  176. package/last-CUCl67Im.js +0 -7
  177. package/maxBy-IKHzFrCS.js +0 -8
  178. package/sortBy-DfSj8IoJ.js +0 -96
  179. package/sumBy-D-hb_NY-.js +0 -8
  180. package/toFinite-Bc55msYj.js +0 -16
  181. package/toNumber-DPxy1FBy.js +0 -39
  182. package/useClueTypeConfig-Z1LFp01b.js +0 -3289
  183. package/utils-HmNPuoDB.js +0 -199
@@ -1,255 +1,196 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useMemo, useRef, useState, useEffect, useCallback, createElement } from "react";
3
- import { useTheme, lighten, darken, Stack, Card, Typography, Autocomplete, TextField, FormControl, InputLabel, Select, MenuItem, alpha, IconButton, Collapse } from "@mui/material";
4
- import { p as parseEvent } from "../../../index-JcKyZeoY.js";
5
- import { z as zoom, i as identity, s as select, t as transform, p as pointer } from "../../../index-DCKkHTvx.js";
6
- import { ClueComponentContext } from "../../../hooks/ClueComponentContext.js";
7
- import useComparator from "../../../hooks/useComparator.js";
8
- import { useMyLocalStorageItem } from "../../../hooks/useMyLocalStorage.js";
9
- import { StorageKey } from "../../../utils/constants.js";
10
- import { g as get } from "../../../get-DSsNkRQs.js";
11
- import { u as useContextSelector } from "../../../index-AMfoEg_6.js";
12
- import { cssImportant } from "../../../utils/graph.js";
13
- import Iconified from "../icons/Iconified.js";
14
- import ExpandMoreButton from "./ExpandMoreButton.js";
15
- import Cloud from "./visualizations/cloud/index.js";
16
- import NodePanel from "./visualizations/panels/NodePanel.js";
17
- import Tree from "./visualizations/tree/index.js";
18
- const Graph = ({ graph, sx = {} }) => {
19
- var _a, _b, _c, _d, _e;
20
- const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
21
- const theme = useTheme();
22
- const isDark = useMemo(() => theme.palette.mode === "dark", [theme]);
23
- const { runComparator } = useComparator();
24
- const svgRef = useRef();
25
- const pointRef = useRef();
26
- const [showMousePos] = useMyLocalStorageItem(StorageKey.SHOW_MOUSE_POS, false);
27
- const [showCoordinates] = useMyLocalStorageItem(StorageKey.SHOW_COORDINATES, false);
28
- const [panelLocation] = useMyLocalStorageItem(StorageKey.PANEL_LOCATION, "vertical");
29
- const [relativeMousePos, setRelativeMousePos] = useState(["0", "0"]);
30
- const [absoluteMousePos, setAbsoluteMousePos] = useState(["0", "0"]);
31
- const [showPanel, setShowPanel] = useState(false);
32
- const nodeIds = useMemo(() => ((graph == null ? void 0 : graph.data) ?? []).flat(2).map((node) => node.id), [graph == null ? void 0 : graph.data]);
33
- const zoom$1 = useMemo(() => zoom().scaleExtent([0.1, 6]), []);
34
- const [currentZoom, setCurrentZoom] = useState(identity);
35
- const [nodeId, setNodeId] = useState("");
36
- const [selectedNodeIds, setSelectedNodeIds] = useState([]);
37
- const [viz, setViz] = useState(
38
- ((_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.type) ?? "tree"
39
- );
40
- const [hasError, setHasError] = useState(false);
41
- useEffect(() => {
42
- setShowPanel(selectedNodeIds.length > 0);
43
- }, [selectedNodeIds]);
44
- const labelKeys = useMemo(
1
+ import { jsx as i, jsxs as l, Fragment as ke } from "react/jsx-runtime";
2
+ import { useMemo as m, useRef as te, useState as u, useEffect as z, useCallback as f, createElement as Ce } from "react";
3
+ import { useTheme as we, lighten as oe, darken as ne, Stack as x, Card as T, Typography as he, Autocomplete as ze, TextField as Se, FormControl as Ee, InputLabel as Ie, Select as Oe, MenuItem as Ne, alpha as ie, IconButton as Me, Collapse as Pe } from "@mui/material";
4
+ import { p as Fe } from "../../../index-BK-zfYhR.js";
5
+ import { z as Re, i as P, s as p, t as Te, p as re } from "../../../index-p5_wX7q1.js";
6
+ import { ClueComponentContext as ge } from "../../../hooks/ClueComponentContext.js";
7
+ import Le from "../../../hooks/useComparator.js";
8
+ import { useMyLocalStorageItem as g } from "../../../hooks/useMyLocalStorage.js";
9
+ import { StorageKey as L } from "../../../utils/constants.js";
10
+ import { g as Ae } from "../../../get-CH7kz5Ix.js";
11
+ import { u as Be } from "../../../index-Dj5C04IX.js";
12
+ import { cssImportant as k } from "../../../utils/graph.js";
13
+ import ae from "../icons/Iconified.js";
14
+ import $e from "./ExpandMoreButton.js";
15
+ import je from "./visualizations/cloud/index.js";
16
+ import He from "./visualizations/panels/NodePanel.js";
17
+ import _e from "./visualizations/tree/index.js";
18
+ const rt = ({ graph: t, sx: se = {} }) => {
19
+ var Z, U, Y, q, J;
20
+ const { t: C } = Be(ge, (e) => e.i18next), o = we(), S = m(() => o.palette.mode === "dark", [o]), { runComparator: A } = Le(), a = te(), le = te(), [F] = g(L.SHOW_MOUSE_POS, !1), [w] = g(L.SHOW_COORDINATES, !1), [E] = g(L.PANEL_LOCATION, "vertical"), [ce, de] = u(["0", "0"]), [me, ue] = u(["0", "0"]), [I, B] = u(!1), $ = m(() => ((t == null ? void 0 : t.data) ?? []).flat(2).map((e) => e.id), [t == null ? void 0 : t.data]), v = m(() => Re().scaleExtent([0.1, 6]), []), [s, O] = u(P), [N, pe] = u(""), [h, j] = u([]), [M, H] = u(
21
+ ((U = (Z = t == null ? void 0 : t.metadata.display) == null ? void 0 : Z.visualization) == null ? void 0 : U.type) ?? "tree"
22
+ ), [fe, R] = u(!1);
23
+ z(() => {
24
+ B(h.length > 0);
25
+ }, [h]);
26
+ const b = m(
45
27
  () => {
46
- var _a2, _b2;
47
- return (_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.displayField) == null ? void 0 : _b2.filter((entry) => (entry.zoom ?? Number.MAX_SAFE_INTEGER) > currentZoom.k);
28
+ var e, n;
29
+ return (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.displayField) == null ? void 0 : n.filter((r) => (r.zoom ?? Number.MAX_SAFE_INTEGER) > s.k);
48
30
  },
49
- [(_c = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c.displayField, currentZoom.k]
50
- );
51
- const onNodeChange = useCallback((node) => {
52
- setNodeId(node);
53
- }, []);
54
- const checkForNode = useCallback((_nodeId) => {
55
- const selector = _nodeId === "view" ? _nodeId : `node-${_nodeId ?? "will\\%never\\$ever\\*exist"}`;
56
- return select(`#${selector}`);
57
- }, []);
58
- const selectNode = useCallback(() => {
59
- if (!nodeId) {
60
- setHasError(true);
31
+ [(Y = t == null ? void 0 : t.metadata.display) == null ? void 0 : Y.displayField, s.k]
32
+ ), xe = f((e) => {
33
+ pe(e);
34
+ }, []), _ = f((e) => {
35
+ const n = e === "view" ? e : `node-${e ?? "will\\%never\\$ever\\*exist"}`;
36
+ return p(`#${n}`);
37
+ }, []), G = f(() => {
38
+ if (!N) {
39
+ R(!0);
61
40
  return;
62
41
  }
63
- const nodeToGet = checkForNode(nodeId.replace(/[^A-Za-z0-9]*/g, ""));
64
- if (nodeToGet.empty()) {
65
- setHasError(true);
42
+ const e = _(N.replace(/[^A-Za-z0-9]*/g, ""));
43
+ if (e.empty()) {
44
+ R(!0);
66
45
  return;
67
46
  }
68
- setHasError(false);
69
- setSelectedNodeIds([nodeId]);
70
- const clientRect = svgRef.current.getBoundingClientRect();
71
- const svg = select(svgRef.current);
72
- const box = nodeToGet.node().getBBox();
73
- svg.transition().duration(500).call(
74
- zoom$1.transform,
75
- identity.translate(clientRect.width / 2, clientRect.height / 2).scale(4).translate(-box.x, -box.y)
47
+ R(!1), j([N]);
48
+ const n = a.current.getBoundingClientRect(), r = p(a.current), d = e.node().getBBox();
49
+ r.transition().duration(500).call(
50
+ v.transform,
51
+ P.translate(n.width / 2, n.height / 2).scale(4).translate(-d.x, -d.y)
76
52
  );
77
- }, [checkForNode, nodeId, zoom$1.transform]);
78
- const onKeyPress = useCallback(
79
- (event) => {
80
- const parsedEvent = parseEvent(event);
81
- if (parsedEvent.isCtrl && parsedEvent.isEnter) {
82
- selectNode();
83
- }
53
+ }, [_, N, v.transform]), ve = f(
54
+ (e) => {
55
+ const n = Fe(e);
56
+ n.isCtrl && n.isEnter && G();
84
57
  },
85
- [selectNode]
86
- );
87
- const findNode = useCallback((id) => ((graph == null ? void 0 : graph.data) ?? []).flat().find((n) => n.id === id), [graph == null ? void 0 : graph.data]);
88
- const resetZoom = useCallback(
89
- (instant = false) => {
90
- if (!graph) {
58
+ [G]
59
+ ), be = f((e) => ((t == null ? void 0 : t.data) ?? []).flat().find((n) => n.id === e), [t == null ? void 0 : t.data]), W = f(
60
+ (e = !1) => {
61
+ if (!t)
91
62
  return;
92
- }
93
- const box = select(svgRef.current).select("#view").node().getBBox();
94
- const clientRect = svgRef.current.getBoundingClientRect();
95
- const zoomLevel = Math.min(clientRect.width / (box.width + 25), (clientRect.height - 96) / box.height);
96
- let selection = select(svgRef.current);
97
- if (!instant) {
98
- selection = selection.transition().duration(500);
99
- }
100
- selection.call(
101
- zoom$1.transform,
102
- identity.translate(clientRect.width / 2, (clientRect.height + 96) / 2).scale(zoomLevel).translate(-box.width / 2, -box.height / 2 - 10)
63
+ const n = p(a.current).select("#view").node().getBBox(), r = a.current.getBoundingClientRect(), d = Math.min(r.width / (n.width + 25), (r.height - 96) / n.height);
64
+ let y = p(a.current);
65
+ e || (y = y.transition().duration(500)), y.call(
66
+ v.transform,
67
+ P.translate(r.width / 2, (r.height + 96) / 2).scale(d).translate(-n.width / 2, -n.height / 2 - 10)
103
68
  );
104
69
  },
105
- [zoom$1.transform, graph]
106
- );
107
- const onNodeSelectionChanged = useCallback((_nodeIds) => setSelectedNodeIds(_nodeIds), []);
108
- useEffect(() => {
109
- if (!graph) {
110
- return;
111
- }
112
- pointRef.current = svgRef.current.createSVGPoint();
113
- select(svgRef.current).call(
114
- zoom$1.on("zoom", (event) => {
115
- setCurrentZoom == null ? void 0 : setCurrentZoom(event.transform);
116
- select(svgRef.current).select("#view").attr("transform", event.transform);
70
+ [v.transform, t]
71
+ ), D = f((e) => j(e), []);
72
+ z(() => {
73
+ t && (le.current = a.current.createSVGPoint(), p(a.current).call(
74
+ v.on("zoom", (e) => {
75
+ O == null || O(e.transform), p(a.current).select("#view").attr("transform", e.transform);
117
76
  })
118
- );
119
- }, [setCurrentZoom, zoom$1, viz, graph]);
120
- useEffect(() => {
121
- if (showMousePos) {
122
- select(svgRef.current).on("mousemove", (event) => {
123
- const _zoom = transform(select(svgRef.current).select("#view").node());
124
- setAbsoluteMousePos(_zoom.invert(pointer(event)).map((n) => n.toFixed(0)));
125
- setRelativeMousePos(pointer(event).map((n) => n.toFixed(0)));
126
- });
127
- }
128
- }, [showMousePos, graph]);
129
- useEffect(() => {
130
- resetZoom();
131
- }, [viz, graph == null ? void 0 : graph.data]);
132
- useEffect(() => {
133
- var _a2, _b2, _c2, _d2;
134
- if ((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.type) {
135
- setViz((_d2 = (_c2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c2.visualization) == null ? void 0 : _d2.type);
136
- }
137
- }, [(_e = (_d = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _d.visualization) == null ? void 0 : _e.type]);
138
- const treeOptions = useMemo(
77
+ ));
78
+ }, [O, v, M, t]), z(() => {
79
+ F && p(a.current).on("mousemove", (e) => {
80
+ const n = Te(p(a.current).select("#view").node());
81
+ ue(n.invert(re(e)).map((r) => r.toFixed(0))), de(re(e).map((r) => r.toFixed(0)));
82
+ });
83
+ }, [F, t]), z(() => {
84
+ W();
85
+ }, [M, t == null ? void 0 : t.data]), z(() => {
86
+ var e, n, r, d;
87
+ (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.visualization) != null && n.type && H((d = (r = t == null ? void 0 : t.metadata.display) == null ? void 0 : r.visualization) == null ? void 0 : d.type);
88
+ }, [(J = (q = t == null ? void 0 : t.metadata.display) == null ? void 0 : q.visualization) == null ? void 0 : J.type]);
89
+ const V = m(
139
90
  () => ({
140
- textColor: theme.palette.text.primary,
141
- backgroundColor: theme.palette.background.paper,
91
+ textColor: o.palette.text.primary,
92
+ backgroundColor: o.palette.background.paper,
142
93
  nodeColor: {
143
- border: (isDark ? lighten : darken)(theme.palette.background.paper, 0.3),
94
+ border: (S ? oe : ne)(o.palette.background.paper, 0.3),
144
95
  center: "white"
145
96
  }
146
97
  }),
147
- [isDark, theme.palette.background.paper, theme.palette.text.primary]
148
- );
149
- const cloudOptions = useMemo(
98
+ [S, o.palette.background.paper, o.palette.text.primary]
99
+ ), K = m(
150
100
  () => ({
151
- textColor: theme.palette.text.primary,
152
- backgroundColor: theme.palette.background.paper,
101
+ textColor: o.palette.text.primary,
102
+ backgroundColor: o.palette.background.paper,
153
103
  nodeColor: {
154
- border: (isDark ? lighten : darken)(theme.palette.background.paper, 0.3),
104
+ border: (S ? oe : ne)(o.palette.background.paper, 0.3),
155
105
  center: "white"
156
106
  }
157
107
  }),
158
- [isDark, theme.palette.background.paper, theme.palette.text.primary]
159
- );
160
- const visualizations = useMemo(
108
+ [S, o.palette.background.paper, o.palette.text.primary]
109
+ ), X = m(
161
110
  () => ({
162
- tree: () => /* @__PURE__ */ jsx(
163
- Tree,
111
+ tree: () => /* @__PURE__ */ i(
112
+ _e,
164
113
  {
165
- svgRef,
166
- graph,
167
- labelKeys,
168
- onNodeSelectionChanged,
169
- zoom: currentZoom,
170
- options: treeOptions
114
+ svgRef: a,
115
+ graph: t,
116
+ labelKeys: b,
117
+ onNodeSelectionChanged: D,
118
+ zoom: s,
119
+ options: V
171
120
  }
172
121
  ),
173
- cloud: () => /* @__PURE__ */ jsx(Cloud, { svgRef, graph, options: cloudOptions })
122
+ cloud: () => /* @__PURE__ */ i(je, { svgRef: a, graph: t, options: K })
174
123
  }),
175
- [cloudOptions, currentZoom, graph, labelKeys, onNodeSelectionChanged, treeOptions]
176
- );
177
- const suggestions = useMemo(() => {
178
- return nodeIds.flatMap((id) => {
179
- var _a2, _b2;
180
- const node = (((_a2 = graph == null ? void 0 : graph.data) == null ? void 0 : _a2.flat()) ?? []).find((_node) => _node.id === id);
181
- if (!node) {
182
- return { id, value: id };
183
- }
184
- const key = ((_b2 = labelKeys == null ? void 0 : labelKeys.filter((comparator) => runComparator(comparator, node)).pop()) == null ? void 0 : _b2.label) ?? "id";
185
- const value = key.split(",").map((_key) => {
186
- var _a3;
187
- return (_a3 = get(node, _key)) == null ? void 0 : _a3.toString();
188
- }).filter((val) => !!val).map((_value) => ({ id, value: _value.trim() }));
189
- return value;
190
- });
191
- }, [graph == null ? void 0 : graph.data, labelKeys, nodeIds, runComparator]);
192
- return /* @__PURE__ */ jsxs(
193
- Stack,
124
+ [K, s, t, b, D, V]
125
+ ), ye = m(() => $.flatMap((e) => {
126
+ var y, Q;
127
+ const n = (((y = t == null ? void 0 : t.data) == null ? void 0 : y.flat()) ?? []).find((c) => c.id === e);
128
+ return n ? (((Q = b == null ? void 0 : b.filter((c) => A(c, n)).pop()) == null ? void 0 : Q.label) ?? "id").split(",").map((c) => {
129
+ var ee;
130
+ return (ee = Ae(n, c)) == null ? void 0 : ee.toString();
131
+ }).filter((c) => !!c).map((c) => ({ id: e, value: c.trim() })) : { id: e, value: e };
132
+ }), [t == null ? void 0 : t.data, b, $, A]);
133
+ return /* @__PURE__ */ l(
134
+ x,
194
135
  {
195
- direction: panelLocation === "vertical" ? "row" : "column",
136
+ direction: E === "vertical" ? "row" : "column",
196
137
  spacing: 1,
197
138
  overflow: "hidden",
198
139
  height: "100%",
199
140
  width: "100%",
200
- sx,
141
+ sx: se,
201
142
  children: [
202
- /* @__PURE__ */ jsx(Stack, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ jsxs(
203
- Card,
143
+ /* @__PURE__ */ i(x, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ l(
144
+ T,
204
145
  {
205
146
  variant: "outlined",
206
147
  sx: {
207
148
  flex: 1,
208
149
  position: "relative",
209
- maxHeight: `calc(100vh - 64px - ${theme.spacing(1)})`,
150
+ maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
210
151
  "& #viz": {
211
- maxHeight: `calc(100vh - 64px - ${theme.spacing(1)})`,
152
+ maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
212
153
  width: "100%",
213
154
  height: "100%",
214
- backgroundColor: theme.palette.background.paper
155
+ backgroundColor: o.palette.background.paper
215
156
  },
216
157
  "& .path": {
217
- transition: theme.transitions.create(["opacity"], {
218
- duration: theme.transitions.duration.short
158
+ transition: o.transitions.create(["opacity"], {
159
+ duration: o.transitions.duration.short
219
160
  })
220
161
  },
221
162
  "& .node": {
222
163
  cursor: "pointer",
223
164
  "& > path, & > text, & > polygon, & circle": {
224
- transition: theme.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
225
- duration: theme.transitions.duration.short
165
+ transition: o.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
166
+ duration: o.transitions.duration.short
226
167
  })
227
168
  },
228
169
  "&.hover > .center": {
229
- stroke: cssImportant(theme.palette.primary.main)
170
+ stroke: k(o.palette.primary.main)
230
171
  },
231
172
  "&.hover > .border": {
232
- stroke: cssImportant(theme.palette.primary.dark)
173
+ stroke: k(o.palette.primary.dark)
233
174
  },
234
175
  "&.selected > .center": {
235
- stroke: cssImportant(theme.palette.success.main)
176
+ stroke: k(o.palette.success.main)
236
177
  },
237
178
  "&.selected > .border": {
238
- stroke: cssImportant(theme.palette.success.dark)
179
+ stroke: k(o.palette.success.dark)
239
180
  },
240
181
  "&.selected.hover > .center": {
241
- stroke: cssImportant(theme.palette.primary.main)
182
+ stroke: k(o.palette.primary.main)
242
183
  },
243
184
  "&.selected.hover > .border": {
244
- stroke: cssImportant(theme.palette.primary.dark)
185
+ stroke: k(o.palette.primary.dark)
245
186
  }
246
187
  }
247
188
  },
248
189
  children: [
249
- graph ? visualizations[viz]() : /* @__PURE__ */ jsxs(Fragment, { children: [
250
- /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, children: /* @__PURE__ */ jsx("g", { id: "view" }) }),
251
- /* @__PURE__ */ jsx(
252
- Typography,
190
+ t ? X[M]() : /* @__PURE__ */ l(ke, { children: [
191
+ /* @__PURE__ */ i("svg", { id: "viz", ref: a, children: /* @__PURE__ */ i("g", { id: "view" }) }),
192
+ /* @__PURE__ */ i(
193
+ he,
253
194
  {
254
195
  variant: "h1",
255
196
  color: "text.secondary",
@@ -260,23 +201,23 @@ const Graph = ({ graph, sx = {} }) => {
260
201
  opacity: 0.3,
261
202
  transform: "translateX(-50%) translateY(-50%)"
262
203
  },
263
- children: t("graph.no.dataset")
204
+ children: C("graph.no.dataset")
264
205
  }
265
206
  )
266
207
  ] }),
267
- /* @__PURE__ */ jsx(
268
- Stack,
208
+ /* @__PURE__ */ i(
209
+ x,
269
210
  {
270
211
  direction: "column",
271
212
  spacing: 1,
272
213
  sx: {
273
214
  position: "absolute",
274
- top: theme.spacing(1),
275
- left: theme.spacing(1),
276
- right: theme.spacing(1)
215
+ top: o.spacing(1),
216
+ left: o.spacing(1),
217
+ right: o.spacing(1)
277
218
  },
278
- children: /* @__PURE__ */ jsxs(
279
- Stack,
219
+ children: /* @__PURE__ */ l(
220
+ x,
280
221
  {
281
222
  direction: "row",
282
223
  spacing: 1,
@@ -284,55 +225,55 @@ const Graph = ({ graph, sx = {} }) => {
284
225
  "& > div:first-of-type": {
285
226
  flex: 1,
286
227
  maxWidth: "775px",
287
- backgroundColor: alpha(theme.palette.background.paper, 0.8)
228
+ backgroundColor: ie(o.palette.background.paper, 0.8)
288
229
  }
289
230
  },
290
231
  children: [
291
- /* @__PURE__ */ jsx(
292
- Autocomplete,
232
+ /* @__PURE__ */ i(
233
+ ze,
293
234
  {
294
- disablePortal: true,
295
- onChange: (__, value) => onNodeChange(value.id),
296
- onKeyDown: onKeyPress,
297
- options: suggestions,
235
+ disablePortal: !0,
236
+ onChange: (e, n) => xe(n.id),
237
+ onKeyDown: ve,
238
+ options: ye,
298
239
  sx: { width: "400px" },
299
- getOptionLabel: (option) => option.value,
300
- filterOptions: (options, state) => options.filter((opt) => opt.value.toLowerCase().includes(state.inputValue)),
301
- renderOption: (props, option) => /* @__PURE__ */ createElement("li", { ...props, key: option.id + option.value }, option.value),
302
- renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: hasError, label: t("graph.node.input.label") })
240
+ getOptionLabel: (e) => e.value,
241
+ filterOptions: (e, n) => e.filter((r) => r.value.toLowerCase().includes(n.inputValue)),
242
+ renderOption: (e, n) => /* @__PURE__ */ Ce("li", { ...e, key: n.id + n.value }, n.value),
243
+ renderInput: (e) => /* @__PURE__ */ i(Se, { ...e, error: fe, label: C("graph.node.input.label") })
303
244
  }
304
245
  ),
305
- /* @__PURE__ */ jsxs(FormControl, { sx: { minWidth: "150px", backgroundColor: alpha(theme.palette.background.paper, 0.8) }, children: [
306
- /* @__PURE__ */ jsx(InputLabel, { id: "viz-label", children: t("graph.visualization") }),
307
- /* @__PURE__ */ jsx(
308
- Select,
246
+ /* @__PURE__ */ l(Ee, { sx: { minWidth: "150px", backgroundColor: ie(o.palette.background.paper, 0.8) }, children: [
247
+ /* @__PURE__ */ i(Ie, { id: "viz-label", children: C("graph.visualization") }),
248
+ /* @__PURE__ */ i(
249
+ Oe,
309
250
  {
310
- label: t("graph.visualization"),
251
+ label: C("graph.visualization"),
311
252
  labelId: "viz-label",
312
- value: viz,
313
- onChange: (event) => setViz(event.target.value),
253
+ value: M,
254
+ onChange: (e) => H(e.target.value),
314
255
  sx: { textTransform: "capitalize" },
315
- children: Object.keys(visualizations).map((_viz) => /* @__PURE__ */ jsx(MenuItem, { value: _viz, sx: { textTransform: "capitalize" }, children: _viz }, _viz))
256
+ children: Object.keys(X).map((e) => /* @__PURE__ */ i(Ne, { value: e, sx: { textTransform: "capitalize" }, children: e }, e))
316
257
  }
317
258
  )
318
259
  ] }),
319
- /* @__PURE__ */ jsx(
320
- ExpandMoreButton,
260
+ /* @__PURE__ */ i(
261
+ $e,
321
262
  {
322
- disabled: selectedNodeIds.length < 1,
323
- expand: showPanel,
324
- onClick: () => setShowPanel(!showPanel),
325
- "aria-expanded": showPanel,
326
- "aria-label": t("graph.show.more"),
263
+ disabled: h.length < 1,
264
+ expand: I,
265
+ onClick: () => B(!I),
266
+ "aria-expanded": I,
267
+ "aria-label": C("graph.show.more"),
327
268
  size: "small",
328
269
  sx: {
329
270
  marginLeft: "auto !important",
330
271
  alignSelf: "center"
331
272
  },
332
- children: /* @__PURE__ */ jsx(
333
- Iconified,
273
+ children: /* @__PURE__ */ i(
274
+ ae,
334
275
  {
335
- icon: panelLocation === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
276
+ icon: E === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
336
277
  fontSize: "medium"
337
278
  }
338
279
  )
@@ -343,64 +284,64 @@ const Graph = ({ graph, sx = {} }) => {
343
284
  )
344
285
  }
345
286
  ),
346
- /* @__PURE__ */ jsx(
347
- Card,
287
+ /* @__PURE__ */ i(
288
+ T,
348
289
  {
349
- variant: showCoordinates ? "elevation" : "outlined",
350
- elevation: showCoordinates ? 4 : 0,
290
+ variant: w ? "elevation" : "outlined",
291
+ elevation: w ? 4 : 0,
351
292
  sx: {
352
293
  position: "absolute",
353
- bottom: theme.spacing(0.5),
354
- right: theme.spacing(0.5),
294
+ bottom: o.spacing(0.5),
295
+ right: o.spacing(0.5),
355
296
  px: 1,
356
297
  py: 0.5,
357
298
  border: "none !important"
358
299
  },
359
- children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", children: [
360
- showCoordinates && /* @__PURE__ */ jsxs("span", { children: [
361
- currentZoom.x.toFixed(0),
300
+ children: /* @__PURE__ */ l(x, { direction: "row", spacing: 0.5, alignItems: "center", children: [
301
+ w && /* @__PURE__ */ l("span", { children: [
302
+ s.x.toFixed(0),
362
303
  ", ",
363
- currentZoom.y.toFixed(0),
304
+ s.y.toFixed(0),
364
305
  " (",
365
- currentZoom.k.toFixed(2),
306
+ s.k.toFixed(2),
366
307
  "x",
367
308
  ")"
368
309
  ] }),
369
- /* @__PURE__ */ jsx(
370
- IconButton,
310
+ /* @__PURE__ */ i(
311
+ Me,
371
312
  {
372
- size: showCoordinates ? "small" : "medium",
373
- onClick: () => resetZoom(),
374
- disabled: currentZoom.k === identity.k && currentZoom.x === 0 && currentZoom.y === 0,
375
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-refresh", fontSize: showCoordinates ? "small" : "medium" })
313
+ size: w ? "small" : "medium",
314
+ onClick: () => W(),
315
+ disabled: s.k === P.k && s.x === 0 && s.y === 0,
316
+ children: /* @__PURE__ */ i(ae, { icon: "ic:baseline-refresh", fontSize: w ? "small" : "medium" })
376
317
  }
377
318
  )
378
319
  ] })
379
320
  }
380
321
  ),
381
- showMousePos && /* @__PURE__ */ jsx(
382
- Card,
322
+ F && /* @__PURE__ */ i(
323
+ T,
383
324
  {
384
325
  variant: "elevation",
385
326
  elevation: 4,
386
327
  sx: {
387
328
  position: "absolute",
388
- bottom: theme.spacing(0.5),
389
- left: theme.spacing(0.5),
329
+ bottom: o.spacing(0.5),
330
+ left: o.spacing(0.5),
390
331
  px: 1,
391
332
  py: 0.5
392
333
  },
393
- children: /* @__PURE__ */ jsx("code", { children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
394
- /* @__PURE__ */ jsxs("span", { children: [
334
+ children: /* @__PURE__ */ i("code", { children: /* @__PURE__ */ l(x, { direction: "row", spacing: 1, children: [
335
+ /* @__PURE__ */ l("span", { children: [
395
336
  "(",
396
337
  "abs: ",
397
- absoluteMousePos.join(", "),
338
+ me.join(", "),
398
339
  ")"
399
340
  ] }),
400
- /* @__PURE__ */ jsxs("span", { children: [
341
+ /* @__PURE__ */ l("span", { children: [
401
342
  "(",
402
343
  "rel: ",
403
- relativeMousePos.join(", "),
344
+ ce.join(", "),
404
345
  ")"
405
346
  ] })
406
347
  ] }) })
@@ -409,21 +350,21 @@ const Graph = ({ graph, sx = {} }) => {
409
350
  ]
410
351
  }
411
352
  ) }),
412
- /* @__PURE__ */ jsx(
413
- Collapse,
353
+ /* @__PURE__ */ i(
354
+ Pe,
414
355
  {
415
- in: showPanel && selectedNodeIds.length > 0,
416
- orientation: panelLocation === "vertical" ? "horizontal" : "vertical",
417
- appear: true,
418
- unmountOnExit: true,
419
- children: /* @__PURE__ */ jsx(
420
- Stack,
356
+ in: I && h.length > 0,
357
+ orientation: E === "vertical" ? "horizontal" : "vertical",
358
+ appear: !0,
359
+ unmountOnExit: !0,
360
+ children: /* @__PURE__ */ i(
361
+ x,
421
362
  {
422
363
  direction: "column",
423
364
  spacing: 1,
424
- sx: panelLocation === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
365
+ sx: E === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
425
366
  pb: 1,
426
- children: /* @__PURE__ */ jsx(NodePanel, { selectedNodeIds, findNode })
367
+ children: /* @__PURE__ */ i(He, { selectedNodeIds: h, findNode: be })
427
368
  }
428
369
  )
429
370
  }
@@ -433,5 +374,5 @@ const Graph = ({ graph, sx = {} }) => {
433
374
  );
434
375
  };
435
376
  export {
436
- Graph as default
377
+ rt as default
437
378
  };