@cccsaurora/clue-ui 1.0.2 → 1.1.0-dev.10

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 (180) hide show
  1. package/ActionForm-D4ryHO0M.js +436 -0
  2. package/AnnotationDetails-YAPoqw3R.js +175 -0
  3. package/AnnotationPreview-DiQDjt9s.js +188 -0
  4. package/ClueEnrichContext-DIn6g8tw.js +522 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_Map-kgDsDYxq.js +64 -0
  7. package/_MapCache-DabaaWfq.js +161 -0
  8. package/_Uint8Array-BlVVH1tp.js +129 -0
  9. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  10. package/_baseClone-D3a8Pa4T.js +284 -0
  11. package/_baseExtremum-B1o1zHjR.js +33 -0
  12. package/_baseFlatten-D4huXoEI.js +92 -0
  13. package/_baseGet-BSK_nnoz.js +109 -0
  14. package/_baseIsEqual-B5xLoweL.js +238 -0
  15. package/_baseIteratee-p6Nj07-n.js +126 -0
  16. package/_baseSlice-GAv_YFTT.js +20 -0
  17. package/_baseSum-D0WC1dN0.js +13 -0
  18. package/_baseUniq-CpupKWcL.js +89 -0
  19. package/_commonjsHelpers-CUmg6egw.js +6 -0
  20. package/_createAggregator-BpVy5xMi.js +63 -0
  21. package/_getPrototype-D1LAdQKO.js +5 -0
  22. package/_getTag-D3ToyefI.js +126 -0
  23. package/cloneDeep-CjP5k9zW.js +8 -0
  24. package/components/AnnotationBody.js +49 -34
  25. package/components/AnnotationDetailPopover.js +36 -30
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +50 -47
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +44 -23
  30. package/components/CountBadge.js +31 -26
  31. package/components/EnrichedCard.js +104 -92
  32. package/components/EnrichedChip.js +134 -109
  33. package/components/EnrichedTypography.js +136 -110
  34. package/components/ErrorBoundary.js +28 -24
  35. package/components/RetryFailedEnrichments.js +10 -9
  36. package/components/SourcePicker.js +57 -49
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +64 -50
  39. package/components/actions/ResultModal.js +37 -34
  40. package/components/actions/form/schemaAdapter.js +39 -20
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +92 -76
  43. package/components/display/graph/elements/NodeTag.js +15 -13
  44. package/components/display/graph/index.js +258 -200
  45. package/components/display/graph/visualizations/Leaf.js +88 -69
  46. package/components/display/graph/visualizations/cloud/index.js +98 -81
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  48. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  53. package/components/display/graph/visualizations/icons/index.js +14 -13
  54. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  55. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +407 -305
  58. package/components/display/icons/Iconified.js +27 -12
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/DynamicTabs.js +22 -17
  61. package/components/display/markdown/index.js +8527 -5670
  62. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  63. package/components/enrichment/EnrichPopover.js +55 -47
  64. package/components/fetchers/Fetcher.js +123 -95
  65. package/components/fetchers/PreviewModal.js +20 -17
  66. package/components/fetchers/StatusChip.js +22 -18
  67. package/components/group/Entry.js +13 -11
  68. package/components/group/Group.js +13 -10
  69. package/components/group/GroupControl.js +76 -65
  70. package/components/stats/QueryStatus.js +37 -28
  71. package/countBy-C69WslUA.js +14 -0
  72. package/data/event.js +6 -4
  73. package/database/index.js +2 -2
  74. package/debounce-bV0h5FC5.js +92 -0
  75. package/get-D3C3lEU3.js +8 -0
  76. package/groupBy-DC2oOuBN.js +14 -0
  77. package/hooks/ClueActionContext.js +6 -6
  78. package/hooks/ClueComponentContext.js +29 -23
  79. package/hooks/ClueConfigProvider.js +14 -12
  80. package/hooks/ClueDatabaseContext.js +19 -13
  81. package/hooks/ClueEnrichContext.js +8 -8
  82. package/hooks/ClueFetcherContext.js +74 -46
  83. package/hooks/ClueGroupContext.js +17 -14
  84. package/hooks/CluePopupContext.js +5 -5
  85. package/hooks/ClueProvider.js +12 -10
  86. package/hooks/selectors.js +22 -11
  87. package/hooks/useAnnotations.js +45 -29
  88. package/hooks/useClue.js +6 -4
  89. package/hooks/useClueActions.js +3 -3
  90. package/hooks/useClueConfig.js +5 -5
  91. package/hooks/useClueTypeConfig.js +3 -3
  92. package/hooks/useComparator.js +722 -435
  93. package/hooks/useErrors.js +22 -18
  94. package/hooks/useMyHighlights.js +66 -36
  95. package/hooks/useMyLocalStorage.js +63 -43
  96. package/iconify-CXMreGTg.js +1782 -0
  97. package/icons/Action.js +66 -49
  98. package/icons/Assessment.js +84 -68
  99. package/icons/Context.js +75 -61
  100. package/icons/Opinion.js +77 -65
  101. package/icons/iconMap.js +2 -2
  102. package/identity-CPGTqrE4.js +6 -0
  103. package/index-BDVjGvMI.js +696 -0
  104. package/index-BHPT3qoB.js +1172 -0
  105. package/index-BMxyILVD.js +465 -0
  106. package/index-BbPn6-Mw.js +15750 -0
  107. package/index-Dz1kF2MU.js +17654 -0
  108. package/isEmpty-BQkZubqU.js +29 -0
  109. package/isNil-CIubwp4T.js +6 -0
  110. package/isObject-FTY-5JQX.js +7 -0
  111. package/isObjectLike-OAgjjZye.js +48 -0
  112. package/isSymbol-Xd2FsJyp.js +8 -0
  113. package/last-CUCl67Im.js +7 -0
  114. package/main.js +58 -58
  115. package/package.json +1 -1
  116. package/sortBy-B-UKp4GT.js +100 -0
  117. package/sumBy-MYkDPHZL.js +8 -0
  118. package/tabs-xGuUGsJd.js +254 -0
  119. package/text/Frequency.js +42 -23
  120. package/toFinite-Bc55msYj.js +16 -0
  121. package/toNumber-DPxy1FBy.js +39 -0
  122. package/useClueTypeConfig-CH-nGq6a.js +3184 -0
  123. package/utils/chain.js +91 -64
  124. package/utils/classificationParser.js +519 -256
  125. package/utils/constants.js +35 -10
  126. package/utils/graph.js +72 -45
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +131 -81
  129. package/utils/loggerUtil.js +5 -3
  130. package/utils/sessionStorage.js +41 -29
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +21 -10
  133. package/utils-Dr4wbKBZ.js +4182 -0
  134. package/ActionForm-BtTv0s4P.js +0 -340
  135. package/AnnotationDetails-D5tBIeEw.js +0 -160
  136. package/AnnotationPreview-CZr_CcZC.js +0 -140
  137. package/ClueEnrichContext-DH9lqjwH.js +0 -401
  138. package/FlexOne-BXWFOd1T.js +0 -6
  139. package/_Map-DXNg_Z-q.js +0 -54
  140. package/_MapCache-Cu25RRDU.js +0 -129
  141. package/_Uint8Array-DlJCtTvG.js +0 -102
  142. package/_baseAssignValue-CUmzp727.js +0 -20
  143. package/_baseClone-BlMmRXeX.js +0 -208
  144. package/_baseExtremum-P_0akmCi.js +0 -27
  145. package/_baseFlatten-CN7vDNEQ.js +0 -72
  146. package/_baseGet-Dgf6_xCm.js +0 -80
  147. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  148. package/_baseIteratee-CP1bocOX.js +0 -95
  149. package/_baseSlice-M5RKzt1A.js +0 -10
  150. package/_baseSum-wEbgNeUs.js +0 -10
  151. package/_baseUniq-tMFmk80M.js +0 -61
  152. package/_commonjsHelpers-C6fGbg64.js +0 -6
  153. package/_createAggregator-B4Cav8ZM.js +0 -53
  154. package/_getPrototype-CHAFQYL_.js +0 -5
  155. package/_getTag-BV_UoLYG.js +0 -90
  156. package/cloneDeep-BPVpFBzJ.js +0 -8
  157. package/countBy-DOutsa_w.js +0 -8
  158. package/debounce-DryYcbJ4.js +0 -56
  159. package/get-Bow1vKwx.js +0 -8
  160. package/groupBy-BheQYl6f.js +0 -8
  161. package/iconify-BBckr5AQ.js +0 -1263
  162. package/identity-ByMq8VxU.js +0 -6
  163. package/index-BUcHmehh.js +0 -975
  164. package/index-Bo-v5IAc.js +0 -12754
  165. package/index-CnaCBNrd.js +0 -358
  166. package/index-E7g8cRyW.js +0 -568
  167. package/index-p5_wX7q1.js +0 -11729
  168. package/isEmpty-g47Qir2A.js +0 -21
  169. package/isNil-CjWwlQS3.js +0 -6
  170. package/isObject-B53jY8Qg.js +0 -7
  171. package/isObjectLike-BatpeCIi.js +0 -29
  172. package/isSymbol-C3_SC0Qp.js +0 -8
  173. package/last-7CdUxN0r.js +0 -7
  174. package/sortBy-ITdmD17L.js +0 -79
  175. package/sumBy-DxJUU2E8.js +0 -8
  176. package/tabs-CgADNA57.js +0 -195
  177. package/toFinite-BMy6GObD.js +0 -14
  178. package/toNumber-YVhnnJv4.js +0 -31
  179. package/useClueTypeConfig-CneP98N_.js +0 -2260
  180. package/utils-CD0rFIFU.js +0 -2704
@@ -1,12 +1,37 @@
1
- const n = void 0, c = !1, C = void 0, _ = "clue.ui", s = `${_}.cache`;
2
- var E = /* @__PURE__ */ ((O) => (O.PROVIDER = "provider", O.REFRESH_TOKEN = "refresh_token", O.APP_TOKEN = "app_token", O.NEXT_LOCATION = "next.location", O.NEXT_SEARCH = "next.search", O.AXIOS_CACHE = "axios.cache", O.COMPACT_JSON = "compact_json_view", O.FLATTEN_JSON = "flatten_json_view", O.PAGE_COUNT = "page_count", O.CLUE_CACHE = "results", O.LOGIN_NONCE = "login_nonce", O.COLOR_SCHEME = "color.scheme", O.SHOW_DIRECTIONALITY = "show.directionality", O.SHOW_CARDS = "show.cards", O.CARD_CUTOFF = "card.cutoff", O.SHOW_MOUSE_POS = "show.mouse.position", O.SHOW_COORDINATES = "show.coordinates", O.PANEL_LOCATION = "panel.location", O.FORCE_COLOR_SETTING = "force.color.setting", O))(E || {});
3
- const A = "-X-";
1
+ const CLUE_API = void 0;
2
+ const LOCAL = CLUE_API === "MOCK";
3
+ const VERSION = void 0;
4
+ const MY_LOCAL_STORAGE_PREFIX = "clue.ui";
5
+ const MY_SESSION_STORAGE_PREFIX = `${MY_LOCAL_STORAGE_PREFIX}.cache`;
6
+ var StorageKey = /* @__PURE__ */ ((StorageKey2) => {
7
+ StorageKey2["PROVIDER"] = "provider";
8
+ StorageKey2["REFRESH_TOKEN"] = "refresh_token";
9
+ StorageKey2["APP_TOKEN"] = "app_token";
10
+ StorageKey2["NEXT_LOCATION"] = "next.location";
11
+ StorageKey2["NEXT_SEARCH"] = "next.search";
12
+ StorageKey2["AXIOS_CACHE"] = "axios.cache";
13
+ StorageKey2["COMPACT_JSON"] = "compact_json_view";
14
+ StorageKey2["FLATTEN_JSON"] = "flatten_json_view";
15
+ StorageKey2["PAGE_COUNT"] = "page_count";
16
+ StorageKey2["CLUE_CACHE"] = "results";
17
+ StorageKey2["LOGIN_NONCE"] = "login_nonce";
18
+ StorageKey2["COLOR_SCHEME"] = "color.scheme";
19
+ StorageKey2["SHOW_DIRECTIONALITY"] = "show.directionality";
20
+ StorageKey2["SHOW_CARDS"] = "show.cards";
21
+ StorageKey2["CARD_CUTOFF"] = "card.cutoff";
22
+ StorageKey2["SHOW_MOUSE_POS"] = "show.mouse.position";
23
+ StorageKey2["SHOW_COORDINATES"] = "show.coordinates";
24
+ StorageKey2["PANEL_LOCATION"] = "panel.location";
25
+ StorageKey2["FORCE_COLOR_SETTING"] = "force.color.setting";
26
+ return StorageKey2;
27
+ })(StorageKey || {});
28
+ const BUNDLE_SEPARATOR = "-X-";
4
29
  export {
5
- A as BUNDLE_SEPARATOR,
6
- n as CLUE_API,
7
- c as LOCAL,
8
- _ as MY_LOCAL_STORAGE_PREFIX,
9
- s as MY_SESSION_STORAGE_PREFIX,
10
- E as StorageKey,
11
- C as VERSION
30
+ BUNDLE_SEPARATOR,
31
+ CLUE_API,
32
+ LOCAL,
33
+ MY_LOCAL_STORAGE_PREFIX,
34
+ MY_SESSION_STORAGE_PREFIX,
35
+ StorageKey,
36
+ VERSION
12
37
  };
package/utils/graph.js CHANGED
@@ -1,52 +1,79 @@
1
- const m = (n, i = 0) => {
2
- let t = 3735928559 ^ i, e = 1103547991 ^ i;
3
- for (let h = 0, a; h < n.length; h++)
4
- a = n.charCodeAt(h), t = Math.imul(t ^ a, 2654435761), e = Math.imul(e ^ a, 1597334677);
5
- return t = Math.imul(t ^ t >>> 16, 2246822507), t ^= Math.imul(e ^ e >>> 13, 3266489909), e = Math.imul(e ^ e >>> 16, 2246822507), e ^= Math.imul(t ^ t >>> 13, 3266489909), parseFloat(`0.${4294967296 * (2097151 & e) + (t >>> 0)}`);
6
- }, p = (n) => `${n} !important`, f = (n, i) => i.find((t) => t.id === n), o = (n, i) => {
7
- function t(e, h) {
8
- if (h.has(e))
9
- return h;
10
- let a = h.add(e);
11
- const s = f(e, i.flat());
12
- return s != null && s.edges && (s == null || s.edges.forEach((l) => {
13
- a = t(l, h);
14
- })), a;
1
+ const cyrb53 = (str, seed = 0) => {
2
+ let h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;
3
+ for (let i = 0, ch; i < str.length; i++) {
4
+ ch = str.charCodeAt(i);
5
+ h1 = Math.imul(h1 ^ ch, 2654435761);
6
+ h2 = Math.imul(h2 ^ ch, 1597334677);
15
7
  }
16
- return t(n, /* @__PURE__ */ new Set());
17
- }, g = (n, i) => {
18
- function t(e, h) {
19
- if (h.has(e))
20
- return h;
21
- let a = h.add(e);
22
- const s = f(e, i.flat()), l = i.flat().filter((r) => {
23
- var c;
24
- return (c = r.edges) == null ? void 0 : c.includes(s == null ? void 0 : s.id);
8
+ h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507);
9
+ h1 ^= Math.imul(h2 ^ h2 >>> 13, 3266489909);
10
+ h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507);
11
+ h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
12
+ return parseFloat(`0.${4294967296 * (2097151 & h2) + (h1 >>> 0)}`);
13
+ };
14
+ const cssImportant = (property) => `${property} !important`;
15
+ const findNode = (nodeId, flatNodes) => {
16
+ return flatNodes.find((node) => node.id === nodeId);
17
+ };
18
+ const getPathToRoot = (nodeId, data) => {
19
+ function getRoot(currNodeId, results) {
20
+ if (results.has(currNodeId)) {
21
+ return results;
22
+ }
23
+ let newResults = results.add(currNodeId);
24
+ const currNode = findNode(currNodeId, data.flat());
25
+ if (currNode == null ? void 0 : currNode.edges) {
26
+ currNode == null ? void 0 : currNode.edges.forEach((parent) => {
27
+ newResults = getRoot(parent, results);
28
+ });
29
+ }
30
+ return newResults;
31
+ }
32
+ return getRoot(nodeId, /* @__PURE__ */ new Set());
33
+ };
34
+ const getAllChildren = (nodeId, data) => {
35
+ function getChildren(currNodeId, results) {
36
+ if (results.has(currNodeId)) {
37
+ return results;
38
+ }
39
+ let newResults = results.add(currNodeId);
40
+ const currNode = findNode(currNodeId, data.flat());
41
+ const directChildren = data.flat().filter((n) => {
42
+ var _a;
43
+ return (_a = n.edges) == null ? void 0 : _a.includes(currNode == null ? void 0 : currNode.id);
25
44
  });
26
- return l && l.forEach((r) => {
27
- a = t(r.id, a);
28
- }), a;
45
+ if (directChildren) {
46
+ directChildren.forEach((child) => {
47
+ newResults = getChildren(child.id, newResults);
48
+ });
49
+ }
50
+ return newResults;
29
51
  }
30
- return t(n, /* @__PURE__ */ new Set());
31
- }, u = (n, i) => {
32
- if (!i)
33
- return new Set(n);
34
- const t = o(n, i), e = g(n, i);
35
- return /* @__PURE__ */ new Set([n, ...t, ...e]);
36
- }, w = (n, i) => {
37
- const t = u(n, i.data);
38
- return i.data.map(
39
- (h) => h.filter((a) => t.has(a.id)).map((a) => {
40
- var s;
41
- return { ...a, edges: (s = a == null ? void 0 : a.edges) == null ? void 0 : s.filter((l) => t.has(l)) };
52
+ return getChildren(nodeId, /* @__PURE__ */ new Set());
53
+ };
54
+ const getSubGraphNodeSet = (nodeId, data) => {
55
+ if (!data) {
56
+ return new Set(nodeId);
57
+ }
58
+ const ancestors = getPathToRoot(nodeId, data);
59
+ const descendents = getAllChildren(nodeId, data);
60
+ return /* @__PURE__ */ new Set([nodeId, ...ancestors, ...descendents]);
61
+ };
62
+ const createSubGraph = (nodeId, dataset) => {
63
+ const subGraphNodes = getSubGraphNodeSet(nodeId, dataset.data);
64
+ const newData = dataset.data.map(
65
+ (level) => level.filter((node) => subGraphNodes.has(node.id)).map((node) => {
66
+ var _a;
67
+ return { ...node, edges: (_a = node == null ? void 0 : node.edges) == null ? void 0 : _a.filter((edge) => subGraphNodes.has(edge)) };
42
68
  })
43
- ).filter((h) => h.length > 0);
69
+ ).filter((level) => level.length > 0);
70
+ return newData;
44
71
  };
45
72
  export {
46
- w as createSubGraph,
47
- p as cssImportant,
48
- m as cyrb53,
49
- g as getAllChildren,
50
- o as getPathToRoot,
51
- u as getSubGraphNodeSet
73
+ createSubGraph,
74
+ cssImportant,
75
+ cyrb53,
76
+ getAllChildren,
77
+ getPathToRoot,
78
+ getSubGraphNodeSet
52
79
  };
package/utils/hashUtil.js CHANGED
@@ -1,11 +1,11 @@
1
- function n(e) {
2
- let t = 0;
3
- for (let r = 0; r < e.length; r++) {
4
- const h = e.charCodeAt(r);
5
- t = (t << 5) - t + h;
1
+ function simpleHash(value) {
2
+ let hash = 0;
3
+ for (let i = 0; i < value.length; i++) {
4
+ const char = value.charCodeAt(i);
5
+ hash = (hash << 5) - hash + char;
6
6
  }
7
- return (t >>> 0).toString(36).padStart(7, "0");
7
+ return (hash >>> 0).toString(36).padStart(7, "0");
8
8
  }
9
9
  export {
10
- n as simpleHash
10
+ simpleHash
11
11
  };
package/utils/line.js CHANGED
@@ -1,86 +1,136 @@
1
- const w = ({
2
- paddingAtLevel: m,
3
- numLines: q,
4
- distanceX: V,
5
- distanceY: j,
6
- childX: x,
7
- childY: f,
8
- childHeight: b,
9
- parentX: z,
10
- parentY: A,
11
- linePaddingX: k,
12
- nodeLocations: L,
13
- dest: v,
14
- arcRadius: $
1
+ const buildHorizontalLine = ({
2
+ paddingAtLevel,
3
+ numLines,
4
+ distanceX,
5
+ distanceY,
6
+ childX,
7
+ childY,
8
+ childHeight,
9
+ parentX,
10
+ parentY,
11
+ linePaddingX,
12
+ nodeLocations,
13
+ dest,
14
+ arcRadius
15
15
  }) => {
16
- const o = [], M = x - (m - q) * k;
17
- return V === 0 ? j === 0 ? (o.push(
18
- `M ${z} ${A}`,
19
- `L ${z - k + 3} ${A}`,
20
- `A 3 3 90 0 0 ${M} ${A + 3}`
21
- ), o.push(
22
- `L ${M} ${L[v.id][1] - 3}`,
23
- `A 3 3 90 0 0 ${M + 3} ${L[v.id][1]}`,
24
- `L ${x} ${L[v.id][1]}`
25
- )) : (o.push(`M ${z} ${A}`, `L ${M + $} ${A}`), Math.sign(j) < 0 ? o.push(
26
- `A ${$} ${$} 90 0 1 ${M} ${A - $}`,
27
- `L ${M} ${f + $}`,
28
- `A ${$} ${$} 90 0 1 ${M + $} ${f}`
29
- ) : o.push(
30
- `A ${$} ${$} 90 0 0 ${M} ${A + $}`,
31
- `L ${M} ${f - $}`,
32
- `A ${$} ${$} 90 0 0 ${M + $} ${f}`
33
- ), o.push(`L ${x} ${f}`)) : (o.push(`M ${z} ${A}`), Math.sign(j) < 0 ? (Math.sign(V) < 0 ? o.push(
34
- `L ${M + $} ${A}`,
35
- `A ${$} ${$} 90 0 1 ${M} ${A - $}`
36
- ) : o.push(
37
- `L ${M - $} ${A}`,
38
- `A ${$} ${$} 90 0 0 ${M} ${A - $}`
39
- ), o.push(
40
- `L ${M} ${f + b / 2 + $}`,
41
- `A ${$} ${$} 90 0 1 ${M + $} ${f + b / 2}`
42
- )) : (Math.sign(V) < 0 ? o.push(
43
- `L ${M + $} ${A}`,
44
- `A ${$} ${$} 90 0 0 ${M} ${A + $}`
45
- ) : o.push(
46
- `L ${M - $} ${A}`,
47
- `A ${$} ${$} 90 0 1 ${M} ${A + $}`
48
- ), o.push(
49
- `L ${M} ${f + b / 2 - $}`,
50
- `A ${$} ${$} 90 0 0 ${M + $} ${f + b / 2}`
51
- )), o.push(`L ${x} ${f + b / 2}`)), o;
52
- }, y = ({
53
- paddingAtLevel: m,
54
- numLines: q,
55
- distanceX: V,
56
- distanceY: j,
57
- childX: x,
58
- childY: f,
59
- childHeight: b,
60
- parentX: z,
61
- parentY: A,
62
- linePaddingX: k,
63
- arcRadius: L
16
+ const d = [];
17
+ const verticalLineX = childX - (paddingAtLevel - numLines) * linePaddingX;
18
+ if (distanceX === 0) {
19
+ if (distanceY === 0) {
20
+ d.push(
21
+ `M ${parentX} ${parentY}`,
22
+ `L ${parentX - linePaddingX + 3} ${parentY}`,
23
+ `A 3 3 90 0 0 ${verticalLineX} ${parentY + 3}`
24
+ );
25
+ d.push(
26
+ `L ${verticalLineX} ${nodeLocations[dest.id][1] - 3}`,
27
+ `A 3 3 90 0 0 ${verticalLineX + 3} ${nodeLocations[dest.id][1]}`,
28
+ `L ${childX} ${nodeLocations[dest.id][1]}`
29
+ );
30
+ } else {
31
+ d.push(`M ${parentX} ${parentY}`, `L ${verticalLineX + arcRadius} ${parentY}`);
32
+ if (Math.sign(distanceY) < 0) {
33
+ d.push(
34
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX} ${parentY - arcRadius}`,
35
+ `L ${verticalLineX} ${childY + arcRadius}`,
36
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX + arcRadius} ${childY}`
37
+ );
38
+ } else {
39
+ d.push(
40
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX} ${parentY + arcRadius}`,
41
+ `L ${verticalLineX} ${childY - arcRadius}`,
42
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX + arcRadius} ${childY}`
43
+ );
44
+ }
45
+ d.push(`L ${childX} ${childY}`);
46
+ }
47
+ } else {
48
+ d.push(`M ${parentX} ${parentY}`);
49
+ if (Math.sign(distanceY) < 0) {
50
+ if (Math.sign(distanceX) < 0) {
51
+ d.push(
52
+ `L ${verticalLineX + arcRadius} ${parentY}`,
53
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX} ${parentY - arcRadius}`
54
+ );
55
+ } else {
56
+ d.push(
57
+ `L ${verticalLineX - arcRadius} ${parentY}`,
58
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX} ${parentY - arcRadius}`
59
+ );
60
+ }
61
+ d.push(
62
+ `L ${verticalLineX} ${childY + childHeight / 2 + arcRadius}`,
63
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX + arcRadius} ${childY + childHeight / 2}`
64
+ );
65
+ } else {
66
+ if (Math.sign(distanceX) < 0) {
67
+ d.push(
68
+ `L ${verticalLineX + arcRadius} ${parentY}`,
69
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX} ${parentY + arcRadius}`
70
+ );
71
+ } else {
72
+ d.push(
73
+ `L ${verticalLineX - arcRadius} ${parentY}`,
74
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX} ${parentY + arcRadius}`
75
+ );
76
+ }
77
+ d.push(
78
+ `L ${verticalLineX} ${childY + childHeight / 2 - arcRadius}`,
79
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX + arcRadius} ${childY + childHeight / 2}`
80
+ );
81
+ }
82
+ d.push(`L ${childX} ${childY + childHeight / 2}`);
83
+ }
84
+ return d;
85
+ };
86
+ const buildVerticalLine = ({
87
+ paddingAtLevel,
88
+ numLines,
89
+ distanceX,
90
+ distanceY,
91
+ childX,
92
+ childY,
93
+ childHeight,
94
+ parentX,
95
+ parentY,
96
+ linePaddingX,
97
+ arcRadius
64
98
  }) => {
65
- const v = [], $ = (Math.sign(j) < 0 ? x : z) - (m - q) * k;
66
- return V === 0 ? v.push(`M ${z} ${A}`, `L ${x} ${f}`) : (v.push(`M ${z} ${A}`), Math.sign(j) < 0 ? Math.sign(V) < 0 ? v.push(
67
- `L ${$ + L} ${A}`,
68
- `A ${L} ${L} 90 0 1 ${$} ${A - L}`,
69
- `L ${$} ${f + b / 2 + L}`,
70
- `A ${L} ${L} 90 0 1 ${$ + L} ${f + b / 2}`
71
- ) : v.push(
72
- `L ${$ - L} ${A}`,
73
- `A ${L} ${L} 90 0 0 ${$} ${A - L}`,
74
- `L ${$} ${f + b / 2 + L}`,
75
- `A ${L} ${L} 90 0 0 ${$ - L} ${f + b / 2}`
76
- ) : v.push(
77
- `L ${$ + L} ${A}`,
78
- `A ${L} ${L} 90 0 0 ${$} ${A + L}`,
79
- `L ${$} ${f + b / 2 - L}`,
80
- `A ${L} ${L} 90 0 0 ${$ + L} ${f + b / 2}`
81
- ), v.push(`L ${x} ${f + b / 2}`)), v;
99
+ const d = [];
100
+ const verticalLineX = (Math.sign(distanceY) < 0 ? childX : parentX) - (paddingAtLevel - numLines) * linePaddingX;
101
+ if (distanceX === 0) {
102
+ d.push(`M ${parentX} ${parentY}`, `L ${childX} ${childY}`);
103
+ } else {
104
+ d.push(`M ${parentX} ${parentY}`);
105
+ if (Math.sign(distanceY) < 0) {
106
+ if (Math.sign(distanceX) < 0) {
107
+ d.push(
108
+ `L ${verticalLineX + arcRadius} ${parentY}`,
109
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX} ${parentY - arcRadius}`,
110
+ `L ${verticalLineX} ${childY + childHeight / 2 + arcRadius}`,
111
+ `A ${arcRadius} ${arcRadius} 90 0 1 ${verticalLineX + arcRadius} ${childY + childHeight / 2}`
112
+ );
113
+ } else {
114
+ d.push(
115
+ `L ${verticalLineX - arcRadius} ${parentY}`,
116
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX} ${parentY - arcRadius}`,
117
+ `L ${verticalLineX} ${childY + childHeight / 2 + arcRadius}`,
118
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX - arcRadius} ${childY + childHeight / 2}`
119
+ );
120
+ }
121
+ } else {
122
+ d.push(
123
+ `L ${verticalLineX + arcRadius} ${parentY}`,
124
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX} ${parentY + arcRadius}`,
125
+ `L ${verticalLineX} ${childY + childHeight / 2 - arcRadius}`,
126
+ `A ${arcRadius} ${arcRadius} 90 0 0 ${verticalLineX + arcRadius} ${childY + childHeight / 2}`
127
+ );
128
+ }
129
+ d.push(`L ${childX} ${childY + childHeight / 2}`);
130
+ }
131
+ return d;
82
132
  };
83
133
  export {
84
- w as buildHorizontalLine,
85
- y as buildVerticalLine
134
+ buildHorizontalLine,
135
+ buildVerticalLine
86
136
  };
@@ -1,6 +1,8 @@
1
- function g(e, o) {
2
- o && console.debug(e);
1
+ function clueDebugLogger(message, loggingEnabled) {
2
+ if (loggingEnabled) {
3
+ console.debug(message);
4
+ }
3
5
  }
4
6
  export {
5
- g as clueDebugLogger
7
+ clueDebugLogger
6
8
  };
@@ -1,39 +1,51 @@
1
- import { StorageKey as n, MY_SESSION_STORAGE_PREFIX as d } from "./constants.js";
2
- import { d as g } from "../debounce-DryYcbJ4.js";
3
- const o = (e) => `${d}.${e}`, {
4
- _getStored: _,
5
- _removeStored: E,
6
- _setStored: m
1
+ import { StorageKey, MY_SESSION_STORAGE_PREFIX } from "./constants.js";
2
+ import { d as debounce } from "../debounce-bV0h5FC5.js";
3
+ const buildName = (name) => `${MY_SESSION_STORAGE_PREFIX}.${name}`;
4
+ const {
5
+ _getStored: getStored,
6
+ _removeStored: removeStored,
7
+ _setStored: setStored
7
8
  } = /* @__PURE__ */ (() => {
8
- let e = {};
9
- return { _getStored: function(t) {
10
- return e[o(t)] ?? JSON.parse(sessionStorage.getItem(o(t)));
11
- }, _removeStored: (t) => {
12
- delete e[o(t)], sessionStorage.removeItem(o(t));
13
- }, _setStored: (t, S) => {
14
- e[o(t)] = S, g(
9
+ let changes = {};
10
+ const _getStored = function(name) {
11
+ return changes[buildName(name)] ?? JSON.parse(sessionStorage.getItem(buildName(name)));
12
+ };
13
+ const _removeStored = (name) => {
14
+ delete changes[buildName(name)];
15
+ sessionStorage.removeItem(buildName(name));
16
+ };
17
+ const _setStored = (name, item) => {
18
+ changes[buildName(name)] = item;
19
+ debounce(
15
20
  () => {
16
- Object.entries(e).forEach(([a, c]) => {
21
+ Object.entries(changes).forEach(([_name, data]) => {
17
22
  try {
18
- sessionStorage.setItem(a, JSON.stringify(c));
19
- } catch (i) {
20
- console.warn("Quota Error when saving to sessionStorage", i);
23
+ sessionStorage.setItem(_name, JSON.stringify(data));
24
+ } catch (e) {
25
+ console.warn("Quota Error when saving to sessionStorage", e);
21
26
  }
22
- }), e = {};
27
+ });
28
+ changes = {};
23
29
  },
24
30
  250,
25
- { leading: !1, trailing: !0, maxWait: 800 }
31
+ { leading: false, trailing: true, maxWait: 800 }
26
32
  );
27
- } };
28
- })(), u = () => _(n.AXIOS_CACHE) ?? {}, I = (e, s) => {
29
- const r = u();
30
- r[e] = s, m(n.AXIOS_CACHE, r);
33
+ };
34
+ return { _getStored, _removeStored, _setStored };
35
+ })();
36
+ const getAxiosCache = () => {
37
+ return getStored(StorageKey.AXIOS_CACHE) ?? {};
38
+ };
39
+ const setAxiosCache = (etag, value) => {
40
+ const cache = getAxiosCache();
41
+ cache[etag] = value;
42
+ setStored(StorageKey.AXIOS_CACHE, cache);
31
43
  };
32
44
  export {
33
- o as buildName,
34
- u as getAxiosCache,
35
- _ as getStored,
36
- E as removeStored,
37
- I as setAxiosCache,
38
- m as setStored
45
+ buildName,
46
+ getAxiosCache,
47
+ getStored,
48
+ removeStored,
49
+ setAxiosCache,
50
+ setStored
39
51
  };
package/utils/utils.js CHANGED
@@ -1,11 +1,11 @@
1
- import { d as m, b as o, r as i, s as p, t as c } from "../utils-CD0rFIFU.js";
2
- import "../_Map-DXNg_Z-q.js";
3
- import "../isEmpty-g47Qir2A.js";
4
- import "../isNil-CjWwlQS3.js";
1
+ import { d, b, r, s, t } from "../utils-Dr4wbKBZ.js";
2
+ import "../_Map-kgDsDYxq.js";
3
+ import "../isEmpty-BQkZubqU.js";
4
+ import "../isNil-CIubwp4T.js";
5
5
  export {
6
- m as delay,
7
- o as filterEnrichments,
8
- i as removeEmpty,
9
- p as searchObject,
10
- c as twitterShort
6
+ d as delay,
7
+ b as filterEnrichments,
8
+ r as removeEmpty,
9
+ s as searchObject,
10
+ t as twitterShort
11
11
  };
package/utils/window.js CHANGED
@@ -1,13 +1,24 @@
1
- const i = (e) => {
2
- typeof window > "u" || window.dispatchEvent(e);
3
- }, d = (e, n, t) => {
4
- typeof window > "u" || window.removeEventListener(e, n, t);
5
- }, o = (e, n, t) => {
6
- if (!(typeof window > "u"))
7
- return window.addEventListener(e, n, t), () => d(e, n, t);
1
+ const safeDispatchEvent = (event) => {
2
+ if (typeof window === "undefined") {
3
+ return;
4
+ }
5
+ window.dispatchEvent(event);
6
+ };
7
+ const safeRemoveEventListener = (type, listener, options) => {
8
+ if (typeof window === "undefined") {
9
+ return;
10
+ }
11
+ window.removeEventListener(type, listener, options);
12
+ };
13
+ const safeAddEventListener = (type, listener, options) => {
14
+ if (typeof window === "undefined") {
15
+ return;
16
+ }
17
+ window.addEventListener(type, listener, options);
18
+ return () => safeRemoveEventListener(type, listener, options);
8
19
  };
9
20
  export {
10
- o as safeAddEventListener,
11
- i as safeDispatchEvent,
12
- d as safeRemoveEventListener
21
+ safeAddEventListener,
22
+ safeDispatchEvent,
23
+ safeRemoveEventListener
13
24
  };