@cccsaurora/clue-ui 0.15.0 → 1.0.0-dev.49

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 (257) hide show
  1. package/ActionForm-c5hLIfQ-.js +436 -0
  2. package/AnnotationPreview-BvNpZOP0.js +188 -0
  3. package/ClueEnrichContext-m-4vn9rz.js +518 -0
  4. package/FlexOne-BSYAhhtG.js +9 -0
  5. package/_Map-kgDsDYxq.js +64 -0
  6. package/_MapCache-DabaaWfq.js +161 -0
  7. package/_Uint8Array-BlVVH1tp.js +129 -0
  8. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  9. package/_baseClone-D3a8Pa4T.js +284 -0
  10. package/_baseExtremum-B1o1zHjR.js +33 -0
  11. package/_baseFlatten-D4huXoEI.js +92 -0
  12. package/_baseGet-BSK_nnoz.js +109 -0
  13. package/_baseIsEqual-B5xLoweL.js +238 -0
  14. package/_baseIteratee-p6Nj07-n.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-CpupKWcL.js +89 -0
  18. package/_commonjsHelpers-CUmg6egw.js +6 -0
  19. package/_createAggregator-BpVy5xMi.js +63 -0
  20. package/_getPrototype-D1LAdQKO.js +5 -0
  21. package/_getTag-D3ToyefI.js +126 -0
  22. package/api/lookup/enrich.d.ts +10 -0
  23. package/api/lookup/index.d.ts +5 -0
  24. package/api/lookup/types.d.ts +5 -0
  25. package/api/lookup/types_detection.d.ts +5 -0
  26. package/cloneDeep-CjP5k9zW.js +8 -0
  27. package/components/AnnotationBody.d.ts +6 -0
  28. package/components/AnnotationBody.js +56 -0
  29. package/components/AnnotationDetailPopover.d.ts +14 -0
  30. package/components/AnnotationDetailPopover.js +61 -0
  31. package/components/AnnotationDetails.d.ts +8 -0
  32. package/components/AnnotationDetails.js +172 -0
  33. package/components/AnnotationEntry.d.ts +6 -0
  34. package/components/AnnotationEntry.js +59 -0
  35. package/components/AnnotationPreview.d.ts +14 -0
  36. package/components/AnnotationPreview.js +11 -0
  37. package/components/ClassificationChip.d.ts +11 -0
  38. package/components/ClassificationChip.js +52 -0
  39. package/components/CountBadge.d.ts +8 -0
  40. package/components/CountBadge.js +34 -0
  41. package/components/EnrichedCard.d.ts +14 -0
  42. package/components/EnrichedCard.js +162 -0
  43. package/components/EnrichedChip.d.ts +9 -0
  44. package/components/EnrichedChip.js +176 -0
  45. package/components/EnrichedTypography.d.ts +16 -0
  46. package/components/EnrichedTypography.js +178 -0
  47. package/components/ErrorBoundary.d.ts +15 -0
  48. package/components/ErrorBoundary.js +36 -0
  49. package/components/RetryFailedEnrichments.d.ts +2 -0
  50. package/components/RetryFailedEnrichments.js +13 -0
  51. package/components/SourcePicker.d.ts +2 -0
  52. package/components/SourcePicker.js +98 -0
  53. package/components/actions/ActionForm.d.ts +6 -0
  54. package/components/actions/ActionForm.js +16 -0
  55. package/components/actions/ExecutePopover.d.ts +10 -0
  56. package/components/actions/ExecutePopover.js +93 -0
  57. package/components/actions/ResultModal.d.ts +9 -0
  58. package/components/actions/ResultModal.js +46 -0
  59. package/components/actions/form/schemaAdapter.d.ts +3 -0
  60. package/components/actions/form/schemaAdapter.js +47 -0
  61. package/components/display/graph/ExpandMoreButton.d.ts +7 -0
  62. package/components/display/graph/ExpandMoreButton.js +18 -0
  63. package/components/display/graph/elements/NodeCard.d.ts +10 -0
  64. package/components/display/graph/elements/NodeCard.js +146 -0
  65. package/components/display/graph/elements/NodeTag.d.ts +9 -0
  66. package/components/display/graph/elements/NodeTag.js +17 -0
  67. package/components/display/graph/index.d.ts +9 -0
  68. package/components/display/graph/index.js +438 -0
  69. package/components/display/graph/visualizations/Leaf.d.ts +25 -0
  70. package/components/display/graph/visualizations/Leaf.js +125 -0
  71. package/components/display/graph/visualizations/cloud/index.d.ts +24 -0
  72. package/components/display/graph/visualizations/cloud/index.js +141 -0
  73. package/components/display/graph/visualizations/icons/BaseIcon.d.ts +12 -0
  74. package/components/display/graph/visualizations/icons/BaseIcon.js +37 -0
  75. package/components/display/graph/visualizations/icons/BugIcon.d.ts +5 -0
  76. package/components/display/graph/visualizations/icons/BugIcon.js +18 -0
  77. package/components/display/graph/visualizations/icons/HostIcon.d.ts +5 -0
  78. package/components/display/graph/visualizations/icons/HostIcon.js +24 -0
  79. package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +5 -0
  80. package/components/display/graph/visualizations/icons/NetworkIcon.js +24 -0
  81. package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +5 -0
  82. package/components/display/graph/visualizations/icons/ProcessIcon.js +18 -0
  83. package/components/display/graph/visualizations/icons/TargetIcon.d.ts +5 -0
  84. package/components/display/graph/visualizations/icons/TargetIcon.js +19 -0
  85. package/components/display/graph/visualizations/icons/index.d.ts +2 -0
  86. package/components/display/graph/visualizations/icons/index.js +16 -0
  87. package/components/display/graph/visualizations/panels/NodePanel.d.ts +8 -0
  88. package/components/display/graph/visualizations/panels/NodePanel.js +12 -0
  89. package/components/display/graph/visualizations/tree/BundleLine.d.ts +29 -0
  90. package/components/display/graph/visualizations/tree/BundleLine.js +121 -0
  91. package/components/display/graph/visualizations/tree/Triangle.d.ts +9 -0
  92. package/components/display/graph/visualizations/tree/Triangle.js +26 -0
  93. package/components/display/graph/visualizations/tree/index.d.ts +36 -0
  94. package/components/display/graph/visualizations/tree/index.js +485 -0
  95. package/components/display/graph/visualizations/tree/types.d.ts +11 -0
  96. package/components/display/graph/visualizations/tree/types.js +1 -0
  97. package/components/display/icons/Iconified.d.ts +9 -0
  98. package/components/display/icons/Iconified.js +29 -0
  99. package/components/display/json/index.d.ts +14 -0
  100. package/components/display/json/index.js +12 -0
  101. package/components/display/markdown/DynamicTabs.d.ts +8 -0
  102. package/components/display/markdown/DynamicTabs.js +26 -0
  103. package/components/display/markdown/index.d.ts +9 -0
  104. package/components/display/markdown/index.js +13389 -0
  105. package/components/display/markdown/markdownPlugins/tabs.d.ts +3 -0
  106. package/components/display/markdown/markdownPlugins/tabs.js +4 -0
  107. package/components/enrichment/EnrichPopover.d.ts +10 -0
  108. package/components/enrichment/EnrichPopover.js +88 -0
  109. package/components/fetchers/Fetcher.d.ts +17 -0
  110. package/components/fetchers/Fetcher.js +188 -0
  111. package/components/fetchers/PreviewModal.d.ts +8 -0
  112. package/components/fetchers/PreviewModal.js +22 -0
  113. package/components/fetchers/StatusChip.d.ts +8 -0
  114. package/components/fetchers/StatusChip.js +30 -0
  115. package/components/group/Entry.d.ts +8 -0
  116. package/components/group/Entry.js +15 -0
  117. package/components/group/Group.d.ts +12 -0
  118. package/components/group/Group.js +15 -0
  119. package/components/group/GroupControl.d.ts +4 -0
  120. package/components/group/GroupControl.js +103 -0
  121. package/components/stats/QueryStatus.d.ts +4 -0
  122. package/components/stats/QueryStatus.js +61 -0
  123. package/countBy-C69WslUA.js +14 -0
  124. package/data/event.d.ts +12 -0
  125. package/data/event.js +8 -0
  126. package/database/index.d.ts +4 -0
  127. package/database/index.js +4 -0
  128. package/database/selector.schema.json.d.ts +119 -0
  129. package/database/status.schema.json.d.ts +38 -0
  130. package/database/types.d.ts +64 -0
  131. package/debounce-bV0h5FC5.js +92 -0
  132. package/en/translation.json +135 -0
  133. package/fr/translation.json +134 -0
  134. package/get-D3C3lEU3.js +8 -0
  135. package/groupBy-DC2oOuBN.js +14 -0
  136. package/hooks/ClueActionContext.d.ts +86 -0
  137. package/hooks/ClueActionContext.js +18 -0
  138. package/hooks/ClueComponentContext.d.ts +10 -0
  139. package/hooks/ClueComponentContext.js +40 -0
  140. package/hooks/ClueConfigProvider.d.ts +12 -0
  141. package/hooks/ClueConfigProvider.js +23 -0
  142. package/hooks/ClueDatabaseContext.d.ts +10 -0
  143. package/hooks/ClueDatabaseContext.js +23 -0
  144. package/hooks/ClueEnrichContext.d.ts +6 -0
  145. package/hooks/ClueEnrichContext.js +15 -0
  146. package/hooks/ClueEnrichContextType.d.ts +113 -0
  147. package/hooks/ClueEnrichProps.d.ts +81 -0
  148. package/hooks/ClueFetcherContext.d.ts +35 -0
  149. package/hooks/ClueFetcherContext.js +88 -0
  150. package/hooks/ClueGroupContext.d.ts +14 -0
  151. package/hooks/ClueGroupContext.js +23 -0
  152. package/hooks/CluePopupContext.d.ts +24 -0
  153. package/hooks/CluePopupContext.js +12 -0
  154. package/hooks/ClueProvider.d.ts +9 -0
  155. package/hooks/ClueProvider.js +14 -0
  156. package/hooks/selectors.d.ts +10 -0
  157. package/hooks/selectors.js +24 -0
  158. package/hooks/useAnnotations.d.ts +24 -0
  159. package/hooks/useAnnotations.js +69 -0
  160. package/hooks/useClue.d.ts +4 -0
  161. package/hooks/useClue.js +8 -0
  162. package/hooks/useClueActions.d.ts +4 -0
  163. package/hooks/useClueActions.js +5 -0
  164. package/hooks/useClueConfig.d.ts +1 -0
  165. package/hooks/useClueConfig.js +8 -0
  166. package/hooks/useClueTypeConfig.d.ts +17 -0
  167. package/hooks/useClueTypeConfig.js +7 -0
  168. package/hooks/useComparator.d.ts +16 -0
  169. package/hooks/useComparator.js +1060 -0
  170. package/hooks/useErrors.d.ts +17 -0
  171. package/hooks/useErrors.js +35 -0
  172. package/hooks/useMyHighlights.d.ts +11 -0
  173. package/hooks/useMyHighlights.js +74 -0
  174. package/hooks/useMyLocalStorage.d.ts +16 -0
  175. package/hooks/useMyLocalStorage.js +80 -0
  176. package/iconify-CXMreGTg.js +1782 -0
  177. package/icons/Action.d.ts +9 -0
  178. package/icons/Action.js +90 -0
  179. package/icons/Assessment.d.ts +11 -0
  180. package/icons/Assessment.js +123 -0
  181. package/icons/Context.d.ts +12 -0
  182. package/icons/Context.js +83 -0
  183. package/icons/Opinion.d.ts +11 -0
  184. package/icons/Opinion.js +125 -0
  185. package/icons/iconMap.d.ts +7 -0
  186. package/icons/iconMap.js +10 -0
  187. package/identity-CPGTqrE4.js +6 -0
  188. package/index-BDVjGvMI.js +696 -0
  189. package/index-BDrtH5ec.js +465 -0
  190. package/index-BbPn6-Mw.js +15750 -0
  191. package/index-C9lySIVX.js +1172 -0
  192. package/index-Dn2NHyXg.js +17654 -0
  193. package/index.css +21 -0
  194. package/isEmpty-BQkZubqU.js +29 -0
  195. package/isNil-CIubwp4T.js +6 -0
  196. package/isObject-FTY-5JQX.js +7 -0
  197. package/isObjectLike-OAgjjZye.js +48 -0
  198. package/isSymbol-Xd2FsJyp.js +8 -0
  199. package/isUndefined-CE8h73dH.js +10 -0
  200. package/last-CUCl67Im.js +7 -0
  201. package/main.d.ts +42 -0
  202. package/main.js +70 -0
  203. package/package.json +39 -143
  204. package/public/manifest.json +16 -0
  205. package/public/robots.txt +3 -0
  206. package/public/svg/dark/clue-h.svg +52 -0
  207. package/public/svg/dark/clue-icon1-simple.svg +33 -0
  208. package/public/svg/dark/clue-icon1.svg +44 -0
  209. package/public/svg/dark/clue-icon2-simple.svg +26 -0
  210. package/public/svg/dark/clue-icon2.svg +37 -0
  211. package/public/svg/dark/clue-name.svg +14 -0
  212. package/public/svg/dark/clue-v.svg +52 -0
  213. package/public/svg/light/clue-h.svg +60 -0
  214. package/public/svg/light/clue-icon1-simple.svg +37 -0
  215. package/public/svg/light/clue-icon1.svg +48 -0
  216. package/public/svg/light/clue-icon2-simple.svg +30 -0
  217. package/public/svg/light/clue-icon2.svg +41 -0
  218. package/public/svg/light/clue-name.svg +14 -0
  219. package/public/svg/light/clue-v.svg +60 -0
  220. package/sortBy-B-UKp4GT.js +100 -0
  221. package/sumBy-MYkDPHZL.js +8 -0
  222. package/tabs-xGuUGsJd.js +254 -0
  223. package/text/Frequency.d.ts +9 -0
  224. package/text/Frequency.js +49 -0
  225. package/toFinite-Bc55msYj.js +16 -0
  226. package/toNumber-DPxy1FBy.js +39 -0
  227. package/types/EnrichmentProps.d.ts +73 -0
  228. package/types/RunningActionData.d.ts +15 -0
  229. package/types/WithActionData.d.ts +9 -0
  230. package/types/action.d.ts +25 -0
  231. package/types/config.d.ts +16 -0
  232. package/types/fetcher.d.ts +60 -0
  233. package/types/graph.d.ts +101 -0
  234. package/types/lookup.d.ts +62 -0
  235. package/types/network.d.ts +9 -0
  236. package/useClueTypeConfig-D4zcy8Gr.js +3184 -0
  237. package/utils/chain.d.ts +14 -0
  238. package/utils/chain.js +106 -0
  239. package/utils/classificationParser.d.ts +195 -0
  240. package/utils/classificationParser.js +553 -0
  241. package/utils/constants.d.ts +27 -0
  242. package/utils/constants.js +37 -0
  243. package/utils/graph.d.ts +13 -0
  244. package/utils/graph.js +79 -0
  245. package/utils/hashUtil.d.ts +6 -0
  246. package/utils/hashUtil.js +11 -0
  247. package/utils/line.d.ts +28 -0
  248. package/utils/line.js +136 -0
  249. package/utils/loggerUtil.d.ts +6 -0
  250. package/utils/loggerUtil.js +8 -0
  251. package/utils/sessionStorage.d.ts +9 -0
  252. package/utils/sessionStorage.js +51 -0
  253. package/utils/utils.d.ts +13 -0
  254. package/utils/utils.js +11 -0
  255. package/utils/window.d.ts +3 -0
  256. package/utils/window.js +24 -0
  257. package/utils-CxIhC2xH.js +4182 -0
@@ -0,0 +1,100 @@
1
+ import { b as baseExtremum, a as baseGt, i as isIterateeCall } from "./_baseExtremum-B1o1zHjR.js";
2
+ import { b as baseIteratee } from "./_baseIteratee-p6Nj07-n.js";
3
+ import { s as setToString, o as overRest, b as baseFlatten } from "./_baseFlatten-D4huXoEI.js";
4
+ import { a as arrayMap, b as baseGet } from "./_baseGet-BSK_nnoz.js";
5
+ import { b as baseEach } from "./_createAggregator-BpVy5xMi.js";
6
+ import { i as isArrayLike, f as baseUnary } from "./_getTag-D3ToyefI.js";
7
+ import { i as isSymbol } from "./isSymbol-Xd2FsJyp.js";
8
+ import { i as identity } from "./identity-CPGTqrE4.js";
9
+ import { i as isArray } from "./_Map-kgDsDYxq.js";
10
+ function baseRest(func, start) {
11
+ return setToString(overRest(func, start, identity), func + "");
12
+ }
13
+ function baseMap(collection, iteratee) {
14
+ var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
15
+ baseEach(collection, function(value, key, collection2) {
16
+ result[++index] = iteratee(value, key, collection2);
17
+ });
18
+ return result;
19
+ }
20
+ function maxBy(array, iteratee) {
21
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : void 0;
22
+ }
23
+ function baseSortBy(array, comparer) {
24
+ var length = array.length;
25
+ array.sort(comparer);
26
+ while (length--) {
27
+ array[length] = array[length].value;
28
+ }
29
+ return array;
30
+ }
31
+ function compareAscending(value, other) {
32
+ if (value !== other) {
33
+ var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
34
+ var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
35
+ if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
36
+ return 1;
37
+ }
38
+ if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
39
+ return -1;
40
+ }
41
+ }
42
+ return 0;
43
+ }
44
+ function compareMultiple(object, other, orders) {
45
+ var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
46
+ while (++index < length) {
47
+ var result = compareAscending(objCriteria[index], othCriteria[index]);
48
+ if (result) {
49
+ if (index >= ordersLength) {
50
+ return result;
51
+ }
52
+ var order = orders[index];
53
+ return result * (order == "desc" ? -1 : 1);
54
+ }
55
+ }
56
+ return object.index - other.index;
57
+ }
58
+ function baseOrderBy(collection, iteratees, orders) {
59
+ if (iteratees.length) {
60
+ iteratees = arrayMap(iteratees, function(iteratee) {
61
+ if (isArray(iteratee)) {
62
+ return function(value) {
63
+ return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
64
+ };
65
+ }
66
+ return iteratee;
67
+ });
68
+ } else {
69
+ iteratees = [identity];
70
+ }
71
+ var index = -1;
72
+ iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
73
+ var result = baseMap(collection, function(value, key, collection2) {
74
+ var criteria = arrayMap(iteratees, function(iteratee) {
75
+ return iteratee(value);
76
+ });
77
+ return { "criteria": criteria, "index": ++index, "value": value };
78
+ });
79
+ return baseSortBy(result, function(object, other) {
80
+ return compareMultiple(object, other, orders);
81
+ });
82
+ }
83
+ var sortBy = baseRest(function(collection, iteratees) {
84
+ if (collection == null) {
85
+ return [];
86
+ }
87
+ var length = iteratees.length;
88
+ if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
89
+ iteratees = [];
90
+ } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
91
+ iteratees = [iteratees[0]];
92
+ }
93
+ return baseOrderBy(collection, baseFlatten(iteratees), []);
94
+ });
95
+ export {
96
+ baseOrderBy as a,
97
+ baseMap as b,
98
+ maxBy as m,
99
+ sortBy as s
100
+ };
@@ -0,0 +1,8 @@
1
+ import { b as baseIteratee } from "./_baseIteratee-p6Nj07-n.js";
2
+ import { b as baseSum } from "./_baseSum-D0WC1dN0.js";
3
+ function sumBy(array, iteratee) {
4
+ return array && array.length ? baseSum(array, baseIteratee(iteratee)) : 0;
5
+ }
6
+ export {
7
+ sumBy as s
8
+ };
@@ -0,0 +1,254 @@
1
+ const convert = (
2
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
3
+ /**
4
+ * @type {(
5
+ * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
6
+ * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
7
+ * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
8
+ * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
9
+ * ((test?: Test) => Check)
10
+ * )}
11
+ */
12
+ /**
13
+ * @param {Test} [test]
14
+ * @returns {Check}
15
+ */
16
+ function(test) {
17
+ if (test === null || test === void 0) {
18
+ return ok;
19
+ }
20
+ if (typeof test === "function") {
21
+ return castFactory(test);
22
+ }
23
+ if (typeof test === "object") {
24
+ return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
25
+ }
26
+ if (typeof test === "string") {
27
+ return typeFactory(test);
28
+ }
29
+ throw new Error("Expected function, string, or object as test");
30
+ }
31
+ );
32
+ function anyFactory(tests) {
33
+ const checks = [];
34
+ let index = -1;
35
+ while (++index < tests.length) {
36
+ checks[index] = convert(tests[index]);
37
+ }
38
+ return castFactory(any);
39
+ function any(...parameters) {
40
+ let index2 = -1;
41
+ while (++index2 < checks.length) {
42
+ if (checks[index2].apply(this, parameters)) return true;
43
+ }
44
+ return false;
45
+ }
46
+ }
47
+ function propsFactory(check) {
48
+ const checkAsRecord = (
49
+ /** @type {Record<string, unknown>} */
50
+ check
51
+ );
52
+ return castFactory(all);
53
+ function all(node) {
54
+ const nodeAsRecord = (
55
+ /** @type {Record<string, unknown>} */
56
+ /** @type {unknown} */
57
+ node
58
+ );
59
+ let key;
60
+ for (key in check) {
61
+ if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
62
+ }
63
+ return true;
64
+ }
65
+ }
66
+ function typeFactory(check) {
67
+ return castFactory(type);
68
+ function type(node) {
69
+ return node && node.type === check;
70
+ }
71
+ }
72
+ function castFactory(testFunction) {
73
+ return check;
74
+ function check(value, index, parent) {
75
+ return Boolean(
76
+ looksLikeANode(value) && testFunction.call(
77
+ this,
78
+ value,
79
+ typeof index === "number" ? index : void 0,
80
+ parent || void 0
81
+ )
82
+ );
83
+ }
84
+ }
85
+ function ok() {
86
+ return true;
87
+ }
88
+ function looksLikeANode(value) {
89
+ return value !== null && typeof value === "object" && "type" in value;
90
+ }
91
+ function color(d) {
92
+ return d;
93
+ }
94
+ const empty = [];
95
+ const CONTINUE = true;
96
+ const EXIT = false;
97
+ const SKIP = "skip";
98
+ function visitParents(tree, test, visitor, reverse) {
99
+ let check;
100
+ if (typeof test === "function" && typeof visitor !== "function") {
101
+ reverse = visitor;
102
+ visitor = test;
103
+ } else {
104
+ check = test;
105
+ }
106
+ const is = convert(check);
107
+ const step = reverse ? -1 : 1;
108
+ factory(tree, void 0, [])();
109
+ function factory(node, index, parents) {
110
+ const value = (
111
+ /** @type {Record<string, unknown>} */
112
+ node && typeof node === "object" ? node : {}
113
+ );
114
+ if (typeof value.type === "string") {
115
+ const name = (
116
+ // `hast`
117
+ typeof value.tagName === "string" ? value.tagName : (
118
+ // `xast`
119
+ typeof value.name === "string" ? value.name : void 0
120
+ )
121
+ );
122
+ Object.defineProperty(visit2, "name", {
123
+ value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
124
+ });
125
+ }
126
+ return visit2;
127
+ function visit2() {
128
+ let result = empty;
129
+ let subresult;
130
+ let offset;
131
+ let grandparents;
132
+ if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
133
+ result = toResult(visitor(node, parents));
134
+ if (result[0] === EXIT) {
135
+ return result;
136
+ }
137
+ }
138
+ if ("children" in node && node.children) {
139
+ const nodeAsParent = (
140
+ /** @type {UnistParent} */
141
+ node
142
+ );
143
+ if (nodeAsParent.children && result[0] !== SKIP) {
144
+ offset = (reverse ? nodeAsParent.children.length : -1) + step;
145
+ grandparents = parents.concat(nodeAsParent);
146
+ while (offset > -1 && offset < nodeAsParent.children.length) {
147
+ const child = nodeAsParent.children[offset];
148
+ subresult = factory(child, offset, grandparents)();
149
+ if (subresult[0] === EXIT) {
150
+ return subresult;
151
+ }
152
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
153
+ }
154
+ }
155
+ }
156
+ return result;
157
+ }
158
+ }
159
+ }
160
+ function toResult(value) {
161
+ if (Array.isArray(value)) {
162
+ return value;
163
+ }
164
+ if (typeof value === "number") {
165
+ return [CONTINUE, value];
166
+ }
167
+ return value === null || value === void 0 ? empty : [value];
168
+ }
169
+ function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
170
+ let reverse;
171
+ let test;
172
+ let visitor;
173
+ if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
174
+ test = void 0;
175
+ visitor = testOrVisitor;
176
+ reverse = visitorOrReverse;
177
+ } else {
178
+ test = testOrVisitor;
179
+ visitor = visitorOrReverse;
180
+ reverse = maybeReverse;
181
+ }
182
+ visitParents(tree, test, overload, reverse);
183
+ function overload(node, parents) {
184
+ const parent = parents[parents.length - 1];
185
+ const index = parent ? parent.children.indexOf(node) : void 0;
186
+ return visitor(node, index, parent);
187
+ }
188
+ }
189
+ function findTabs(index, parent) {
190
+ const { children } = parent;
191
+ const tabs = [];
192
+ while (index++ < children.length) {
193
+ const child = children[index];
194
+ if (child && child.type === "code") {
195
+ const metaString = `${child.lang ?? ""} ${child.meta ?? ""}`.trim();
196
+ if (!metaString) break;
197
+ const [tabtitle] = metaString.match(new RegExp(`(?<=tab=("|'))(.*?)(?=("|'))`)) ?? [""];
198
+ if (!tabtitle) {
199
+ console.warn("Failed to parse tab title.");
200
+ break;
201
+ }
202
+ tabs.push({ title: tabtitle, lang: child.lang, value: child.value });
203
+ } else {
204
+ break;
205
+ }
206
+ }
207
+ return tabs;
208
+ }
209
+ const codeTabs = () => {
210
+ return (tree, file) => {
211
+ visit(tree, "code", (node, index, parent) => {
212
+ const metaString = `${node.lang ?? ""} ${node.meta ?? ""}`.trim();
213
+ if (!metaString) {
214
+ return;
215
+ }
216
+ const [tab] = metaString.match(new RegExp(`(?<=tab=("|'))(.*?)(?=("|'))`)) ?? [""];
217
+ if (!tab && metaString.includes("tab=")) {
218
+ file.message("Invalid tab title", node, "remark-code-title");
219
+ return;
220
+ }
221
+ if (!tab) {
222
+ return;
223
+ }
224
+ const tabs = [{ title: tab, lang: node.lang, value: node.value }, ...findTabs(index, parent)];
225
+ if (tabs.length > 1) {
226
+ const tabsNode = {
227
+ type: "code",
228
+ lang: "tabs",
229
+ value: JSON.stringify(tabs)
230
+ };
231
+ parent.children.splice(index, tabs.length, tabsNode);
232
+ return index + tabs.length - 1;
233
+ } else {
234
+ const titleNode = {
235
+ type: "paragraph",
236
+ data: {
237
+ hName: "div",
238
+ hProperties: {
239
+ "data-remark-code-title": true,
240
+ "data-language": node.lang
241
+ }
242
+ },
243
+ children: [{ type: "text", value: tab }]
244
+ };
245
+ parent.children.splice(index, 0, titleNode);
246
+ return index + 2;
247
+ }
248
+ });
249
+ };
250
+ };
251
+ export {
252
+ codeTabs as c,
253
+ visit as v
254
+ };
@@ -0,0 +1,9 @@
1
+ import { TypographyProps } from '@mui/material';
2
+ import { Annotation } from "../types/lookup";
3
+ import { FC } from 'react';
4
+
5
+ declare const FrequencyText: FC<{
6
+ annotations: Annotation[];
7
+ value: string;
8
+ } & TypographyProps>;
9
+ export default FrequencyText;
@@ -0,0 +1,49 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Typography } from "@mui/material";
3
+ import { useMemo } from "react";
4
+ import { s as sumBy } from "../sumBy-MYkDPHZL.js";
5
+ import { i as isNull, a as isUndefined } from "../isUndefined-CE8h73dH.js";
6
+ const FrequencyText = ({
7
+ annotations,
8
+ value,
9
+ ...otherProps
10
+ }) => {
11
+ const frequencyAnnotations = useMemo(
12
+ () => annotations.filter((annotation) => annotation.type === "frequency"),
13
+ [annotations]
14
+ );
15
+ const frequency = useMemo(
16
+ () => frequencyAnnotations.length > 0 ? sumBy(frequencyAnnotations, (annotation) => annotation.value) : null,
17
+ [frequencyAnnotations]
18
+ );
19
+ const color = useMemo(() => {
20
+ if (isNull(frequency) || isUndefined(frequency)) {
21
+ return null;
22
+ }
23
+ if (frequency < 1) {
24
+ return "error";
25
+ }
26
+ if (frequency < 1e3) {
27
+ return "secondary";
28
+ }
29
+ if (frequency < 1e6) {
30
+ return "disabled";
31
+ }
32
+ return null;
33
+ }, [frequency]);
34
+ if (isNull(frequency) || isUndefined(frequency)) {
35
+ return /* @__PURE__ */ jsx(Typography, { ...otherProps, color, children: value });
36
+ }
37
+ return /* @__PURE__ */ jsx(
38
+ Typography,
39
+ {
40
+ ...otherProps,
41
+ color: color ?? otherProps.color,
42
+ sx: { fontWeight: !isNull(frequency) && !isUndefined(frequency) && frequency < 10 ? "bold" : "inherit" },
43
+ children: value
44
+ }
45
+ );
46
+ };
47
+ export {
48
+ FrequencyText as default
49
+ };
@@ -0,0 +1,16 @@
1
+ import { t as toNumber } from "./toNumber-DPxy1FBy.js";
2
+ var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292;
3
+ function toFinite(value) {
4
+ if (!value) {
5
+ return value === 0 ? value : 0;
6
+ }
7
+ value = toNumber(value);
8
+ if (value === INFINITY || value === -INFINITY) {
9
+ var sign = value < 0 ? -1 : 1;
10
+ return sign * MAX_INTEGER;
11
+ }
12
+ return value === value ? value : 0;
13
+ }
14
+ export {
15
+ toFinite as t
16
+ };
@@ -0,0 +1,39 @@
1
+ import { i as isObject } from "./isObject-FTY-5JQX.js";
2
+ import { i as isSymbol } from "./isSymbol-Xd2FsJyp.js";
3
+ var reWhitespace = /\s/;
4
+ function trimmedEndIndex(string) {
5
+ var index = string.length;
6
+ while (index-- && reWhitespace.test(string.charAt(index))) {
7
+ }
8
+ return index;
9
+ }
10
+ var reTrimStart = /^\s+/;
11
+ function baseTrim(string) {
12
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
13
+ }
14
+ var NAN = 0 / 0;
15
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
16
+ var reIsBinary = /^0b[01]+$/i;
17
+ var reIsOctal = /^0o[0-7]+$/i;
18
+ var freeParseInt = parseInt;
19
+ function toNumber(value) {
20
+ if (typeof value == "number") {
21
+ return value;
22
+ }
23
+ if (isSymbol(value)) {
24
+ return NAN;
25
+ }
26
+ if (isObject(value)) {
27
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
28
+ value = isObject(other) ? other + "" : other;
29
+ }
30
+ if (typeof value != "string") {
31
+ return value === 0 ? value : +value;
32
+ }
33
+ value = baseTrim(value);
34
+ var isBinary = reIsBinary.test(value);
35
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
36
+ }
37
+ export {
38
+ toNumber as t
39
+ };
@@ -0,0 +1,73 @@
1
+ import { PopoverProps } from '@mui/material';
2
+
3
+
4
+ interface EnrichmentProps {
5
+ /**
6
+ * The type of the selector to enrich.
7
+ */
8
+ type?: string;
9
+
10
+ /**
11
+ * The selector to enrich.
12
+ */
13
+ value: string;
14
+
15
+ /**
16
+ * The classification of the selector.
17
+ */
18
+ classification?: string;
19
+
20
+ /**
21
+ * Should the component show the extra context icon?
22
+ */
23
+ contextIcon?: boolean;
24
+
25
+ /**
26
+ * Should the component show counters?
27
+ */
28
+ counters?: boolean;
29
+
30
+ /**
31
+ * Disable the onclick functionality, and don't automatically show the related popup
32
+ */
33
+ hideDetails?: boolean;
34
+
35
+ /**
36
+ * Show the preview for extra icons on mouseover?
37
+ */
38
+ showPreview?: boolean;
39
+
40
+ /**
41
+ * Should the component hide the loading icon?
42
+ */
43
+ hideLoading?: boolean;
44
+
45
+ /**
46
+ * Force the element to show the details popup.
47
+ */
48
+ forceDetails?: boolean;
49
+
50
+ /**
51
+ * Callback for when the popup wants to close
52
+ */
53
+ setForceDetails?: (value: boolean) => void;
54
+
55
+ /**
56
+ * Should the component show a details icon to open the popup instead of simply clicking the selector?
57
+ */
58
+ useDetailsIcon?: boolean;
59
+
60
+ /**
61
+ * Skip enriching the value, thereby only showing cached results?
62
+ */
63
+ skipEnrichment?: boolean;
64
+
65
+ /**
66
+ * Props for various subcomponents of the enrichment component.
67
+ */
68
+ slotProps?: {
69
+ popover?: Omit<PopoverProps, 'open'>;
70
+ };
71
+ }
72
+
73
+ export default EnrichmentProps;
@@ -0,0 +1,15 @@
1
+ import { ActionDefinition, ActionResult } from "../api/actions";
2
+ import { Selector } from 'lib/types/lookup';
3
+ import { default as WithActionData } from './WithActionData';
4
+
5
+
6
+ interface RunningActionData {
7
+ id: string;
8
+ action: ActionDefinition;
9
+ selectors: Selector[];
10
+ params: { [index: string]: any };
11
+ onComplete?: (result: WithActionData<ActionResult>) => void;
12
+ timeout?: number;
13
+ }
14
+
15
+ export default RunningActionData;
@@ -0,0 +1,9 @@
1
+ import { ActionDefinition } from './action';
2
+
3
+
4
+ export type WithActionData<T> = T & {
5
+ actionId: string;
6
+ action: ActionDefinition;
7
+ };
8
+
9
+ export default WithActionData;
@@ -0,0 +1,25 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+
3
+
4
+ export interface ActionDefinition {
5
+ accept_multiple?: boolean;
6
+ action_icon?: string;
7
+ classification: string;
8
+ extra_schema?: JSON;
9
+ format?: string;
10
+ id: string;
11
+ name: string;
12
+ params: JSONSchema7;
13
+ summary?: string;
14
+ supported_types?: string[];
15
+ }
16
+
17
+ export interface ActionResult<T = any> {
18
+ outcome: 'success' | 'failure';
19
+ summary?: string;
20
+ output?: T;
21
+ format?: string;
22
+ link?: string;
23
+ }
24
+
25
+ export type ActionDefinitionsResponse = { [type: string]: ActionDefinition };
@@ -0,0 +1,16 @@
1
+ export interface ApiType {
2
+ configuration: {
3
+ auth: {
4
+ oauth_providers: string[];
5
+ };
6
+ system: {
7
+ version: string;
8
+ branch: string;
9
+ commit: string;
10
+ };
11
+ ui: {
12
+ apps: any[];
13
+ };
14
+ };
15
+ c12nDef: any;
16
+ }
@@ -0,0 +1,60 @@
1
+ import { NestedDataset } from './graph';
2
+
3
+
4
+ export interface FetcherDefinition {
5
+ id: string;
6
+ classification: string;
7
+ description: string;
8
+ format: string;
9
+ supported_types: string[];
10
+ }
11
+
12
+ interface BaseFetcherResult {
13
+ outcome: 'success' | 'failure';
14
+ error: string;
15
+ link: string;
16
+ format: string;
17
+ }
18
+
19
+ export interface FetcherImageResult extends BaseFetcherResult {
20
+ data: {
21
+ image: string;
22
+ alt: string;
23
+ };
24
+ format: 'image';
25
+ }
26
+
27
+ export interface FetcherJsonResult extends BaseFetcherResult {
28
+ data: any;
29
+ format: 'json';
30
+ }
31
+
32
+ export interface FetcherMarkdownResult extends BaseFetcherResult {
33
+ data: string;
34
+ format: 'markdown';
35
+ }
36
+
37
+ export interface FetcherGraphResult extends BaseFetcherResult {
38
+ data: NestedDataset;
39
+ format: 'graph';
40
+ }
41
+
42
+ export interface FetcherStatusResult extends BaseFetcherResult {
43
+ data: {
44
+ empty: boolean;
45
+ labels: { language: string; label: string }[];
46
+ link?: string;
47
+ icon?: string;
48
+ color?: string;
49
+ };
50
+ format: 'status';
51
+ }
52
+
53
+ export type FetcherResult =
54
+ | FetcherImageResult
55
+ | FetcherJsonResult
56
+ | FetcherGraphResult
57
+ | FetcherMarkdownResult
58
+ | FetcherStatusResult;
59
+
60
+ export type FetcherDefinitionsResponse = { [type: string]: FetcherDefinition };