@splunk/visualizations 25.0.1 → 25.2.0

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 (200) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_custom_base_layer_tile_server.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  14. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  58. package/Area.config.js +146 -157
  59. package/Area.config.js.map +1 -1
  60. package/Area.js +459 -545
  61. package/Area.js.map +1 -1
  62. package/Bar.config.js +148 -153
  63. package/Bar.config.js.map +1 -1
  64. package/Bar.js +468 -548
  65. package/Bar.js.map +1 -1
  66. package/Bubble.config.js +143 -123
  67. package/Bubble.config.js.map +1 -1
  68. package/Bubble.js +475 -530
  69. package/Bubble.js.map +1 -1
  70. package/ChoroplethSvg.config.js +87 -81
  71. package/ChoroplethSvg.config.js.map +1 -1
  72. package/ChoroplethSvg.js +352 -422
  73. package/ChoroplethSvg.js.map +1 -1
  74. package/Column.config.js +144 -151
  75. package/Column.config.js.map +1 -1
  76. package/Column.js +463 -546
  77. package/Column.js.map +1 -1
  78. package/Ellipse.config.js +86 -80
  79. package/Ellipse.config.js.map +1 -1
  80. package/Ellipse.js +319 -389
  81. package/Ellipse.js.map +1 -1
  82. package/Events.config.js +668 -0
  83. package/Events.config.js.map +1 -0
  84. package/Events.js +3116 -0
  85. package/Events.js.map +1 -0
  86. package/FillerGauge.config.js +94 -87
  87. package/FillerGauge.config.js.map +1 -1
  88. package/FillerGauge.js +352 -415
  89. package/FillerGauge.js.map +1 -1
  90. package/Image.config.js +74 -74
  91. package/Image.config.js.map +1 -1
  92. package/Image.js +713 -801
  93. package/Image.js.map +1 -1
  94. package/Line.config.js +145 -142
  95. package/Line.config.js.map +1 -1
  96. package/Line.js +471 -538
  97. package/Line.js.map +1 -1
  98. package/LinkGraph.config.js +120 -113
  99. package/LinkGraph.config.js.map +1 -1
  100. package/LinkGraph.js +24563 -717
  101. package/LinkGraph.js.map +1 -1
  102. package/Map.config.js +107 -100
  103. package/Map.config.js.map +1 -1
  104. package/Map.js +2358 -2465
  105. package/Map.js.map +1 -1
  106. package/Markdown.config.js +112 -112
  107. package/Markdown.config.js.map +1 -1
  108. package/Markdown.js +844 -918
  109. package/Markdown.js.map +1 -1
  110. package/MarkerGauge.config.js +185 -186
  111. package/MarkerGauge.config.js.map +1 -1
  112. package/MarkerGauge.js +1274 -1363
  113. package/MarkerGauge.js.map +1 -1
  114. package/ParallelCoordinates.config.js +137 -137
  115. package/ParallelCoordinates.config.js.map +1 -1
  116. package/ParallelCoordinates.js +732 -923
  117. package/ParallelCoordinates.js.map +1 -1
  118. package/Pie.config.js +132 -132
  119. package/Pie.config.js.map +1 -1
  120. package/Pie.js +1193 -1281
  121. package/Pie.js.map +1 -1
  122. package/Punchcard.config.js +138 -138
  123. package/Punchcard.config.js.map +1 -1
  124. package/Punchcard.js +2723 -2923
  125. package/Punchcard.js.map +1 -1
  126. package/Rectangle.config.js +267 -260
  127. package/Rectangle.config.js.map +1 -1
  128. package/Rectangle.js +1107 -1188
  129. package/Rectangle.js.map +1 -1
  130. package/Sankey.config.js +149 -142
  131. package/Sankey.config.js.map +1 -1
  132. package/Sankey.js +2613 -2808
  133. package/Sankey.js.map +1 -1
  134. package/Scatter.config.js +144 -123
  135. package/Scatter.config.js.map +1 -1
  136. package/Scatter.js +1820 -1889
  137. package/Scatter.js.map +1 -1
  138. package/SingleValue.config.js +121 -114
  139. package/SingleValue.config.js.map +1 -1
  140. package/SingleValue.js +2554 -2635
  141. package/SingleValue.js.map +1 -1
  142. package/SingleValueBasic.js +34 -34
  143. package/SingleValueBasic.js.map +1 -1
  144. package/SingleValueIcon.config.js +129 -120
  145. package/SingleValueIcon.config.js.map +1 -1
  146. package/SingleValueIcon.js +994 -1212
  147. package/SingleValueIcon.js.map +1 -1
  148. package/SingleValueRadial.config.js +216 -178
  149. package/SingleValueRadial.config.js.map +1 -1
  150. package/SingleValueRadial.js +2235 -2316
  151. package/SingleValueRadial.js.map +1 -1
  152. package/Table.config.js +150 -151
  153. package/Table.config.js.map +1 -1
  154. package/Table.js +2446 -2525
  155. package/Table.js.map +1 -1
  156. package/common/Charting.js +11 -11
  157. package/common/Charting.js.map +1 -1
  158. package/common/ChartingApi.js +2 -2
  159. package/common/ChartingApi.js.map +1 -1
  160. package/common/EventsDoc.js +25 -18
  161. package/common/EventsDoc.js.map +1 -1
  162. package/common/GaugeMajorTicks.js +10 -10
  163. package/common/GaugeMajorTicks.js.map +1 -1
  164. package/common/GaugeValueMarker.js +10 -10
  165. package/common/GaugeValueMarker.js.map +1 -1
  166. package/common/OptionsDoc.js +57 -357
  167. package/common/OptionsDoc.js.map +1 -1
  168. package/common/OverviewDoc.js +22 -22
  169. package/common/OverviewDoc.js.map +1 -1
  170. package/common/SplunkVisualization.js +4 -4
  171. package/common/SplunkVisualization.js.map +1 -1
  172. package/common/SplunkVisualizationApi.js +2 -2
  173. package/common/SplunkVisualizationApi.js.map +1 -1
  174. package/common/ThemesDoc.js +21 -21
  175. package/common/ThemesDoc.js.map +1 -1
  176. package/common/chartingUtils.js +4 -4
  177. package/common/chartingUtils.js.map +1 -1
  178. package/common/docUtils.js +4 -4
  179. package/common/docUtils.js.map +1 -1
  180. package/common/gaugeUtils.js +13 -13
  181. package/common/gaugeUtils.js.map +1 -1
  182. package/common/shapeUtils.js +8 -8
  183. package/common/shapeUtils.js.map +1 -1
  184. package/common/utils/configUtils.js +17 -18
  185. package/common/utils/configUtils.js.map +1 -1
  186. package/common/utils/{JSONSchemaUtils.js → dataUtils.js} +24 -25
  187. package/common/utils/dataUtils.js.map +1 -0
  188. package/common/utils/hocUtils.js +5 -85
  189. package/common/utils/hocUtils.js.map +1 -1
  190. package/common/utils/mapUtils.js +198 -0
  191. package/common/utils/mapUtils.js.map +1 -0
  192. package/common/utils/singleValueUtils.js +15 -12
  193. package/common/utils/singleValueUtils.js.map +1 -1
  194. package/common/utils/testHelper.js +8 -8
  195. package/common/utils/testHelper.js.map +1 -1
  196. package/common/withDashboardViz.js +120 -207
  197. package/common/withDashboardViz.js.map +1 -1
  198. package/package.json +16 -14
  199. package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
  200. package/common/utils/JSONSchemaUtils.js.map +0 -1
package/Events.js ADDED
@@ -0,0 +1,3116 @@
1
+ /*!
2
+ * Copyright © 2018 Splunk Inc.
3
+ * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
+ * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
+ */
6
+ module.exports =
7
+ /******/ (function(modules) { // webpackBootstrap
8
+ /******/ // The module cache
9
+ /******/ var installedModules = {};
10
+ /******/
11
+ /******/ // The require function
12
+ /******/ function __webpack_require__(moduleId) {
13
+ /******/
14
+ /******/ // Check if module is in cache
15
+ /******/ if(installedModules[moduleId]) {
16
+ /******/ return installedModules[moduleId].exports;
17
+ /******/ }
18
+ /******/ // Create a new module (and put it into the cache)
19
+ /******/ var module = installedModules[moduleId] = {
20
+ /******/ i: moduleId,
21
+ /******/ l: false,
22
+ /******/ exports: {}
23
+ /******/ };
24
+ /******/
25
+ /******/ // Execute the module function
26
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
+ /******/
28
+ /******/ // Flag the module as loaded
29
+ /******/ module.l = true;
30
+ /******/
31
+ /******/ // Return the exports of the module
32
+ /******/ return module.exports;
33
+ /******/ }
34
+ /******/
35
+ /******/
36
+ /******/ // expose the modules object (__webpack_modules__)
37
+ /******/ __webpack_require__.m = modules;
38
+ /******/
39
+ /******/ // expose the module cache
40
+ /******/ __webpack_require__.c = installedModules;
41
+ /******/
42
+ /******/ // define getter function for harmony exports
43
+ /******/ __webpack_require__.d = function(exports, name, getter) {
44
+ /******/ if(!__webpack_require__.o(exports, name)) {
45
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
46
+ /******/ }
47
+ /******/ };
48
+ /******/
49
+ /******/ // define __esModule on exports
50
+ /******/ __webpack_require__.r = function(exports) {
51
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
52
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
53
+ /******/ }
54
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
55
+ /******/ };
56
+ /******/
57
+ /******/ // create a fake namespace object
58
+ /******/ // mode & 1: value is a module id, require it
59
+ /******/ // mode & 2: merge all properties of value into the ns
60
+ /******/ // mode & 4: return value when already ns object
61
+ /******/ // mode & 8|1: behave like require
62
+ /******/ __webpack_require__.t = function(value, mode) {
63
+ /******/ if(mode & 1) value = __webpack_require__(value);
64
+ /******/ if(mode & 8) return value;
65
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
66
+ /******/ var ns = Object.create(null);
67
+ /******/ __webpack_require__.r(ns);
68
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
69
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
70
+ /******/ return ns;
71
+ /******/ };
72
+ /******/
73
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
74
+ /******/ __webpack_require__.n = function(module) {
75
+ /******/ var getter = module && module.__esModule ?
76
+ /******/ function getDefault() { return module['default']; } :
77
+ /******/ function getModuleExports() { return module; };
78
+ /******/ __webpack_require__.d(getter, 'a', getter);
79
+ /******/ return getter;
80
+ /******/ };
81
+ /******/
82
+ /******/ // Object.prototype.hasOwnProperty.call
83
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
84
+ /******/
85
+ /******/ // __webpack_public_path__
86
+ /******/ __webpack_require__.p = "";
87
+ /******/
88
+ /******/
89
+ /******/ // Load entry module and return exports
90
+ /******/ return __webpack_require__(__webpack_require__.s = 183);
91
+ /******/ })
92
+ /************************************************************************/
93
+ /******/ ([
94
+ /* 0 */
95
+ /***/ (function(module, exports) {
96
+
97
+ module.exports = require("prop-types");
98
+
99
+ /***/ }),
100
+ /* 1 */
101
+ /***/ (function(module, exports) {
102
+
103
+ module.exports = require("react");
104
+
105
+ /***/ }),
106
+ /* 2 */
107
+ /***/ (function(module, exports) {
108
+
109
+ module.exports = require("@splunk/ui-utils/i18n");
110
+
111
+ /***/ }),
112
+ /* 3 */
113
+ /***/ (function(module, exports) {
114
+
115
+ module.exports = require("lodash");
116
+
117
+ /***/ }),
118
+ /* 4 */
119
+ /***/ (function(module, exports) {
120
+
121
+ module.exports = require("styled-components");
122
+
123
+ /***/ }),
124
+ /* 5 */,
125
+ /* 6 */
126
+ /***/ (function(module, exports, __webpack_require__) {
127
+
128
+ "use strict";
129
+
130
+
131
+ Object.defineProperty(exports, "__esModule", {
132
+ value: true
133
+ });
134
+ exports.VizBehavior = void 0;
135
+ var VizBehavior;
136
+
137
+ (function (VizBehavior) {
138
+ /**
139
+ * Dynamic Options Behavior.
140
+ * This allows visualization options to be powered by data
141
+ *
142
+ * **Example**
143
+ *
144
+ * sparklineValues: ">primary|seriesByIndex(0)"
145
+ * would configure sparklineValues with an array of data points
146
+ * coming from the first series in the primary datasource
147
+ *
148
+ */
149
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
150
+ VizBehavior["EVENTS"] = "events";
151
+ /**
152
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
153
+ * missing.
154
+ * @type {string}
155
+ */
156
+
157
+ VizBehavior["PLACEHOLDER"] = "placeholder";
158
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
159
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
160
+
161
+ /***/ }),
162
+ /* 7 */
163
+ /***/ (function(module, exports) {
164
+
165
+ module.exports = require("@babel/runtime/helpers/defineProperty");
166
+
167
+ /***/ }),
168
+ /* 8 */
169
+ /***/ (function(module, exports) {
170
+
171
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
172
+
173
+ /***/ }),
174
+ /* 9 */
175
+ /***/ (function(module, exports) {
176
+
177
+ module.exports = require("@splunk/themes/variables");
178
+
179
+ /***/ }),
180
+ /* 10 */
181
+ /***/ (function(module, exports) {
182
+
183
+ module.exports = require("@splunk/visualizations-shared/Message");
184
+
185
+ /***/ }),
186
+ /* 11 */
187
+ /***/ (function(module, exports) {
188
+
189
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
190
+
191
+ /***/ }),
192
+ /* 12 */
193
+ /***/ (function(module, exports) {
194
+
195
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
196
+
197
+ /***/ }),
198
+ /* 13 */
199
+ /***/ (function(module, exports, __webpack_require__) {
200
+
201
+ "use strict";
202
+
203
+
204
+ Object.defineProperty(exports, "__esModule", {
205
+ value: true
206
+ });
207
+
208
+ var React = __webpack_require__(1);
209
+
210
+ var styled_components_1 = __webpack_require__(4);
211
+
212
+ var SizeAwareWrapper_1 = __webpack_require__(20);
213
+
214
+ var style_1 = __webpack_require__(15);
215
+
216
+ var colorUtils_1 = __webpack_require__(12);
217
+
218
+ var Item = styled_components_1.default.div.attrs(function (_ref) {
219
+ var width = _ref.width;
220
+ return {
221
+ style: {
222
+ width: style_1.toPx(width)
223
+ }
224
+ };
225
+ }).withConfig({
226
+ displayName: "FixedSizeContainer__Item",
227
+ componentId: "sc-1yhgpod-0"
228
+ })(["position:relative;background-color:", "};"], function (props) {
229
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
230
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
231
+
232
+ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
233
+ var width = _ref2.width,
234
+ height = _ref2.height;
235
+ return {
236
+ style: Object.assign(Object.assign({}, width && {
237
+ width: style_1.toPx(width)
238
+ }), height && {
239
+ height: style_1.toPx(height)
240
+ })
241
+ };
242
+ }).withConfig({
243
+ displayName: "FixedSizeContainer__FixSizeItem",
244
+ componentId: "sc-1yhgpod-1"
245
+ })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
246
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
247
+ });
248
+ var ItemContent = styled_components_1.default.div.withConfig({
249
+ displayName: "FixedSizeContainer__ItemContent",
250
+ componentId: "sc-1yhgpod-2"
251
+ })(["position:relative;min-height:100px;width:100%;"]);
252
+ var FixSizeItemContent = styled_components_1.default.div.withConfig({
253
+ displayName: "FixedSizeContainer__FixSizeItemContent",
254
+ componentId: "sc-1yhgpod-3"
255
+ })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
256
+
257
+ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
258
+ var FixedSizeContainer = function FixedSizeContainer(props) {
259
+ var width = props.width,
260
+ height = props.height,
261
+ backgroundColor = props.backgroundColor;
262
+
263
+ if (!height) {
264
+ return React.createElement(Item, {
265
+ "data-test": "item",
266
+ width: width,
267
+ backgroundColor: backgroundColor
268
+ }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
269
+ }
270
+
271
+ return React.createElement(FixSizeItem, {
272
+ "data-test": "fix-size-item",
273
+ "data-splunk-visualization-version": "25.2.0 - 4373c5a66",
274
+ width: width,
275
+ height: height,
276
+ backgroundColor: backgroundColor
277
+ }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
278
+ var newWidth = _ref3.width,
279
+ newHeight = _ref3.height;
280
+ return React.createElement(Viz, Object.assign({}, props, {
281
+ width: newWidth,
282
+ height: newHeight
283
+ }));
284
+ })));
285
+ };
286
+
287
+ FixedSizeContainer.displayName = 'withFixedSizeContainer';
288
+ return FixedSizeContainer;
289
+ };
290
+
291
+ exports.default = withFixedSizeContainer;
292
+
293
+ /***/ }),
294
+ /* 14 */
295
+ /***/ (function(module, exports, __webpack_require__) {
296
+
297
+ "use strict";
298
+
299
+
300
+ Object.defineProperty(exports, "__esModule", {
301
+ value: true
302
+ });
303
+ exports.extendStaticWrapperProps = void 0;
304
+ /**
305
+ * @method extendStaticWrapperProps
306
+ * @param {Object} props
307
+ * @param {DashboardVizType} props.Wrapper
308
+ * @param {DashboardVizType} props.Visualization
309
+ */
310
+
311
+ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
312
+ var Wrapper = _ref.Wrapper,
313
+ Visualization = _ref.Visualization;
314
+ var extendProperties = ['propTypes', 'defaultProps', 'config'];
315
+ extendProperties.forEach(function (prop) {
316
+ if (Visualization[prop]) {
317
+ // eslint-disable-next-line no-param-reassign
318
+ Wrapper[prop] = Visualization[prop];
319
+ }
320
+ });
321
+ };
322
+
323
+ exports.extendStaticWrapperProps = extendStaticWrapperProps;
324
+
325
+ /***/ }),
326
+ /* 15 */
327
+ /***/ (function(module, exports) {
328
+
329
+ module.exports = require("@splunk/visualizations-shared/style");
330
+
331
+ /***/ }),
332
+ /* 16 */
333
+ /***/ (function(module, exports) {
334
+
335
+ module.exports = require("@splunk/visualizations-shared/schemaUtils");
336
+
337
+ /***/ }),
338
+ /* 17 */
339
+ /***/ (function(module, exports, __webpack_require__) {
340
+
341
+ "use strict";
342
+
343
+
344
+ var _toConsumableArray = __webpack_require__(8);
345
+
346
+ var _defineProperty = __webpack_require__(7);
347
+
348
+ var __rest = this && this.__rest || function (s, e) {
349
+ var t = {};
350
+
351
+ for (var p in s) {
352
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
353
+ }
354
+
355
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
356
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
357
+ }
358
+ return t;
359
+ };
360
+
361
+ Object.defineProperty(exports, "__esModule", {
362
+ value: true
363
+ });
364
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
365
+
366
+ var lodash_1 = __webpack_require__(3);
367
+
368
+ var schemaUtils_1 = __webpack_require__(16);
369
+
370
+ var VizBehavior_1 = __webpack_require__(6);
371
+
372
+ var dynamicOptionsDSLType = {
373
+ type: 'string',
374
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
375
+ };
376
+ /**
377
+ * Helper function to extend an options schema with dynamic options DSL
378
+ * @param optionsSchema a visualization's options schema
379
+ * @returns an updated options schema that additionally allows strings starting with > for each option
380
+ */
381
+
382
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
383
+ var enhancedOptionsSchema = {};
384
+ Object.keys(optionsSchema).forEach(function (key) {
385
+ var _a = optionsSchema[key],
386
+ title = _a.title,
387
+ description = _a.description,
388
+ readOnly = _a.readOnly,
389
+ writeOnly = _a.writeOnly,
390
+ examples = _a.examples,
391
+ defaultValue = _a.default,
392
+ type = _a.type,
393
+ properties = _a.properties,
394
+ patternProperties = _a.patternProperties,
395
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
396
+
397
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
398
+ title: title
399
+ }), description !== undefined && {
400
+ description: description
401
+ }), readOnly !== undefined && {
402
+ readOnly: readOnly
403
+ }), writeOnly !== undefined && {
404
+ writeOnly: writeOnly
405
+ }), examples !== undefined && {
406
+ examples: examples
407
+ }), defaultValue !== undefined && {
408
+ default: defaultValue
409
+ });
410
+
411
+ if (type === 'object') {
412
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
413
+ type: type
414
+ }), properties && {
415
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
416
+ });
417
+
418
+ if (patternProperties) {
419
+ var enhancedPatternProperties = {};
420
+ Object.keys(patternProperties).forEach(function (opt) {
421
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
422
+ });
423
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
424
+ }
425
+ } else {
426
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
427
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
428
+ type: type
429
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
430
+ });
431
+ }
432
+ });
433
+ return enhancedOptionsSchema;
434
+ }
435
+
436
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
437
+ /**
438
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
439
+ * this function also collapse all editor panels
440
+ * @param vizConfig a Visualization Config
441
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
442
+ * and containing `open: false` for all editor panels in editorConfig
443
+ */
444
+
445
+ function enhanceConfig(vizConfig) {
446
+ var enhancedConfig = vizConfig;
447
+
448
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
449
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
450
+ }
451
+
452
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
453
+ return Object.assign(Object.assign({}, config), {
454
+ open: false
455
+ });
456
+ });
457
+ return enhancedConfig;
458
+ }
459
+
460
+ exports.enhanceConfig = enhanceConfig;
461
+ /**
462
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
463
+ * Created for editor unit tests
464
+ * @param vizConfig a Visualization Config
465
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
466
+ */
467
+
468
+ function uncollapseEditorConfig(vizConfig) {
469
+ var editorPanelUncollapsedConfig = vizConfig;
470
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
471
+ return Object.assign(Object.assign({}, config), {
472
+ open: true
473
+ });
474
+ });
475
+ return editorPanelUncollapsedConfig;
476
+ }
477
+
478
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
479
+
480
+ function isDynamicOption(option) {
481
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
482
+ }
483
+
484
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
485
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
486
+
487
+ /**
488
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
489
+ * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
490
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
491
+ * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
492
+ *
493
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
494
+ */
495
+
496
+ function hasCompatibleContexts(vizContext, presetContext) {
497
+ var presetContextKeys = Object.keys(presetContext);
498
+ return presetContextKeys.every(function (contextKey) {
499
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
500
+ });
501
+ }
502
+ /**
503
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
504
+ */
505
+
506
+
507
+ function hasCompatibleOptions(vizOptions, presetOptions) {
508
+ var presetOptionKeys = Object.keys(presetOptions);
509
+ return presetOptionKeys.every(function (optionKey) {
510
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
511
+ });
512
+ }
513
+ /**
514
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
515
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
516
+ *
517
+ * @param {Object} vizContext - the current vizContext definition
518
+ * @param {Object} vizOptions - the current vizOptions definition
519
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
520
+ */
521
+
522
+
523
+ function getInitialPreset(vizContext, vizOptions, presets) {
524
+ return presets.find(function (preset) {
525
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
526
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
527
+ var presetContextKeys = Object.keys(presetContext);
528
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
529
+ // if not, then the preset is invalid in config.ts
530
+
531
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
532
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
533
+ });
534
+ }
535
+
536
+ exports.getInitialPreset = getInitialPreset;
537
+ /**
538
+ * generates number precision values for a Select editor
539
+ *
540
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
541
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
542
+ */
543
+
544
+ function generatePrecisionValues(numPrecisionValues) {
545
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
546
+ return {
547
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
548
+ value: i
549
+ };
550
+ });
551
+ }
552
+
553
+ exports.generatePrecisionValues = generatePrecisionValues;
554
+ /**
555
+ * insert layout in layout array, return a new layout array instead of updating the original
556
+ *
557
+ * @param {EditorLayoutConfig[][]} layout - editor layout
558
+ * @param {Number} index - the index to insert layout item(s)
559
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
560
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
561
+ */
562
+
563
+ var insertLayout = function insertLayout(layout, index) {
564
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
565
+ layoutItems[_key - 2] = arguments[_key];
566
+ }
567
+
568
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
569
+ };
570
+
571
+ exports.insertLayout = insertLayout;
572
+
573
+ /***/ }),
574
+ /* 18 */,
575
+ /* 19 */
576
+ /***/ (function(module, exports) {
577
+
578
+ module.exports = require("@babel/runtime/helpers/createClass");
579
+
580
+ /***/ }),
581
+ /* 20 */
582
+ /***/ (function(module, exports) {
583
+
584
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
585
+
586
+ /***/ }),
587
+ /* 21 */
588
+ /***/ (function(module, exports) {
589
+
590
+ module.exports = require("@splunk/themes/pick");
591
+
592
+ /***/ }),
593
+ /* 22 */,
594
+ /* 23 */
595
+ /***/ (function(module, exports) {
596
+
597
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
598
+
599
+ /***/ }),
600
+ /* 24 */,
601
+ /* 25 */
602
+ /***/ (function(module, exports) {
603
+
604
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
605
+
606
+ /***/ }),
607
+ /* 26 */
608
+ /***/ (function(module, exports) {
609
+
610
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
611
+
612
+ /***/ }),
613
+ /* 27 */
614
+ /***/ (function(module, exports, __webpack_require__) {
615
+
616
+ "use strict";
617
+
618
+
619
+ Object.defineProperty(exports, "__esModule", {
620
+ value: true
621
+ });
622
+ exports.shouldShowIconPlaceholder = void 0;
623
+
624
+ var React = __webpack_require__(1);
625
+
626
+ var T = __webpack_require__(0);
627
+
628
+ var lodash_1 = __webpack_require__(3);
629
+
630
+ var i18n_1 = __webpack_require__(2);
631
+
632
+ var Message_1 = __webpack_require__(10);
633
+
634
+ var FixedSizeContainer_1 = __webpack_require__(13);
635
+ /**
636
+ * @method shouldShowIconPlaceholder
637
+ * @param {object} dataSources
638
+ * @param {boolean} loading
639
+ * @returns {boolean}
640
+ */
641
+
642
+
643
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
644
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
645
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
646
+ var noData = data === undefined;
647
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
648
+ var noFields = fields === undefined;
649
+ return loading || noData || noFields;
650
+ };
651
+
652
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
653
+ var propTypes = {
654
+ icon: T.func,
655
+ width: T.oneOfType([T.string, T.number]),
656
+ height: T.oneOfType([T.string, T.number]),
657
+ // eslint-disable-next-line react/no-unused-prop-types
658
+ backgroundColor: T.string,
659
+ iconColor: T.string
660
+ };
661
+ /**
662
+ * @method IconPlaceholder
663
+ * @param {IconPlaceholderProps} props
664
+ * @returns {React.ReactElement}
665
+ */
666
+
667
+ var IconPlaceholder = function IconPlaceholder(props) {
668
+ var width = props.width,
669
+ height = props.height,
670
+ icon = props.icon,
671
+ iconColor = props.iconColor;
672
+
673
+ if (icon) {
674
+ return React.createElement(icon, {
675
+ style: {
676
+ left: '50%',
677
+ top: '50%',
678
+ color: iconColor,
679
+ opacity: 0.15,
680
+ position: 'absolute',
681
+ transform: 'translate(-50%, -50%)'
682
+ },
683
+ width: '50%',
684
+ height: '50%'
685
+ });
686
+ }
687
+
688
+ return React.createElement(Message_1.default, {
689
+ width: width,
690
+ height: height,
691
+ level: "warning",
692
+ message: i18n_1._('No DataSource Connected')
693
+ });
694
+ };
695
+
696
+ IconPlaceholder.propTypes = propTypes;
697
+ IconPlaceholder.defaultProps = {
698
+ width: '100%',
699
+ height: 250
700
+ };
701
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
702
+
703
+ /***/ }),
704
+ /* 28 */
705
+ /***/ (function(module, exports, __webpack_require__) {
706
+
707
+ "use strict";
708
+
709
+
710
+ var _defineProperty = __webpack_require__(7);
711
+
712
+ Object.defineProperty(exports, "__esModule", {
713
+ value: true
714
+ });
715
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
716
+
717
+ var T = __webpack_require__(0);
718
+
719
+ var lodash_1 = __webpack_require__(3);
720
+
721
+ var DataSource_1 = __webpack_require__(39);
722
+
723
+ exports.SortParamsPropTypes = T.shape({
724
+ currentSortKey: T.string,
725
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
726
+ onSort: T.func
727
+ });
728
+
729
+ var getSortingParams = function getSortingParams(_ref) {
730
+ var requestParams = _ref.requestParams,
731
+ onRequestParamsChange = _ref.onRequestParamsChange;
732
+ var currentSortKey;
733
+ var currentSortDir;
734
+ var nextSortDirMap = {
735
+ asc: 'desc',
736
+ desc: 'asc',
737
+ none: 'asc'
738
+ };
739
+ var onSort;
740
+
741
+ if (lodash_1.isFunction(onRequestParamsChange)) {
742
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
743
+ currentSortKey = Object.keys(requestParams.sort).shift();
744
+ currentSortDir = requestParams.sort[currentSortKey];
745
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
746
+
747
+
748
+ onSort = function onSort(e, _ref2) {
749
+ var sortKey = _ref2.sortKey,
750
+ sortDir = _ref2.sortDir;
751
+
752
+ if (typeof sortKey === 'string') {
753
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
754
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
755
+ offset: 0,
756
+ sort: _defineProperty({}, sortKey, nextSortDir)
757
+ }));
758
+ } else {
759
+ onRequestParamsChange(requestParams);
760
+ }
761
+ };
762
+ }
763
+
764
+ return {
765
+ currentSortKey: currentSortKey,
766
+ currentSortDir: currentSortDir,
767
+ onSort: onSort
768
+ };
769
+ };
770
+
771
+ exports.getSortingParams = getSortingParams;
772
+
773
+ /***/ }),
774
+ /* 29 */
775
+ /***/ (function(module, exports, __webpack_require__) {
776
+
777
+ "use strict";
778
+
779
+
780
+ Object.defineProperty(exports, "__esModule", {
781
+ value: true
782
+ });
783
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
784
+
785
+ var T = __webpack_require__(0);
786
+
787
+ var lodash_1 = __webpack_require__(3);
788
+
789
+ exports.PaginatorParamsPropTypes = T.shape({
790
+ isPaging: T.bool,
791
+ current: T.number,
792
+ totalPages: T.number,
793
+ onChange: T.func
794
+ });
795
+
796
+ var getPaginationParams = function getPaginationParams(_ref) {
797
+ var requestParams = _ref.requestParams,
798
+ meta = _ref.meta,
799
+ onRequestParamsChange = _ref.onRequestParamsChange;
800
+ var totalCount = meta && meta.totalCount || 0;
801
+ var offset = requestParams && requestParams.offset || 0;
802
+ var count = requestParams && requestParams.count;
803
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
804
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
805
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
806
+
807
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
808
+ var page = _ref2.page,
809
+ countArg = _ref2.count;
810
+ var newParams = lodash_1.cloneDeep(requestParams);
811
+
812
+ if (typeof countArg === 'number') {
813
+ newParams.count = countArg;
814
+ newParams.offset = 0;
815
+ }
816
+
817
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
818
+
819
+ if (typeof page === 'number' && page > 0) {
820
+ newParams.count = pageCount;
821
+ newParams.offset = (page - 1) * pageCount;
822
+ }
823
+
824
+ onRequestParamsChange(newParams);
825
+ };
826
+
827
+ return {
828
+ isPaging: isPaging,
829
+ current: current,
830
+ totalPages: totalPages,
831
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
832
+ };
833
+ };
834
+
835
+ exports.getPaginationParams = getPaginationParams;
836
+
837
+ /***/ }),
838
+ /* 30 */,
839
+ /* 31 */
840
+ /***/ (function(module, exports, __webpack_require__) {
841
+
842
+ "use strict";
843
+
844
+
845
+ Object.defineProperty(exports, "__esModule", {
846
+ value: true
847
+ });
848
+ exports.VizCategory = void 0;
849
+ var VizCategory;
850
+
851
+ (function (VizCategory) {
852
+ VizCategory["SINGLE_VALUE"] = "Single Value";
853
+ VizCategory["TRENDS"] = "Trends";
854
+ VizCategory["COMPARISONS"] = "Comparisons";
855
+ VizCategory["TABLE"] = "Table";
856
+ VizCategory["GAUGE"] = "Gauge";
857
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
858
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
859
+ VizCategory["SHAPES"] = "Shapes";
860
+ VizCategory["MISC"] = "misc";
861
+ VizCategory["FLOW"] = "Flow";
862
+ VizCategory["CORRELATION"] = "Correlation";
863
+ VizCategory["SPATIAL"] = "Spatial";
864
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
865
+
866
+ /***/ }),
867
+ /* 32 */
868
+ /***/ (function(module, exports, __webpack_require__) {
869
+
870
+ "use strict";
871
+
872
+
873
+ Object.defineProperty(exports, "__esModule", {
874
+ value: true
875
+ });
876
+
877
+ var React = __webpack_require__(1);
878
+
879
+ var lodash_1 = __webpack_require__(3);
880
+
881
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
882
+
883
+ var Options_1 = __webpack_require__(34);
884
+
885
+ var SanitizeProps_1 = __webpack_require__(35);
886
+
887
+ var TimezoneContext_1 = __webpack_require__(23);
888
+
889
+ var moment_1 = __webpack_require__(36);
890
+
891
+ var styled_components_1 = __webpack_require__(4);
892
+
893
+ var hocUtils_1 = __webpack_require__(25);
894
+
895
+ var JSONSchemaUtils_1 = __webpack_require__(26);
896
+
897
+ var SplunkVisualization_1 = __webpack_require__(37);
898
+
899
+ var VizBehavior_1 = __webpack_require__(6);
900
+
901
+ var getSorting_1 = __webpack_require__(28);
902
+
903
+ var getPagination_1 = __webpack_require__(29);
904
+
905
+ var useDeepMemo_1 = __webpack_require__(40);
906
+
907
+ var MissingPropsMessage_1 = __webpack_require__(41);
908
+
909
+ var withEditModeCover_1 = __webpack_require__(42);
910
+
911
+ var withPlaceholder_1 = __webpack_require__(43);
912
+ /**
913
+ * hoc that wraps a pure react visualization in a Dashboard visualization
914
+ * @param {DashboardVizOpts} opts
915
+ * @returns {HOC}
916
+ */
917
+
918
+
919
+ var withDashboardViz = function withDashboardViz(opts) {
920
+ var ReactViz = opts.ReactViz,
921
+ vizConfig = opts.vizConfig,
922
+ _opts$computeVizProps = opts.computeVizProps,
923
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
924
+ disableEditModeCover = opts.disableEditModeCover,
925
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
926
+
927
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
928
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
929
+
930
+ var DashboardViz = function DashboardViz(props) {
931
+ var mode = props.mode,
932
+ hasEventHandlers = props.hasEventHandlers,
933
+ dataSources = props.dataSources,
934
+ options = props.options,
935
+ _props$context = props.context,
936
+ context = _props$context === void 0 ? {} : _props$context,
937
+ width = props.width,
938
+ height = props.height,
939
+ onComputedProps = props.onComputedProps,
940
+ onEventTrigger = props.onEventTrigger,
941
+ theme = props.theme,
942
+ onRequestParamsChange = props.onRequestParamsChange;
943
+
944
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
945
+ serializedTimezone = _React$useContext.serializedTimezone;
946
+
947
+ if (serializedTimezone) {
948
+ /*
949
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
950
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
951
+ will use it.
952
+ @TODO(pwied):
953
+ - remove when we moved away from @splunk/moment
954
+ - provide timezone context to dynamic option evaluation phase
955
+ */
956
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
957
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
958
+ }
959
+ }
960
+
961
+ var themeFunc = function themeFunc(themeVar) {
962
+ var _a, _b;
963
+
964
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
965
+ };
966
+
967
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
968
+
969
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
970
+ theme: theme
971
+ }),
972
+ currentThemeFamily = _getSettingsFromTheme.family,
973
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
974
+ currentThemeDensity = _getSettingsFromTheme.density;
975
+
976
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
977
+
978
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
979
+ try {
980
+ return Options_1.Options.evaluate({
981
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
982
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
983
+ }, dataSources, themeFunc);
984
+ } catch (e) {
985
+ // eslint-disable-next-line no-console
986
+ console.error("unexpected error evaluating options: + ".concat(e.message));
987
+ return {};
988
+ }
989
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
990
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
991
+
992
+ React.useEffect(function () {
993
+ onComputedProps(evaluatedOptions);
994
+ }); // present warning message if any required props are missing
995
+
996
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
997
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
998
+ supports = vizConfig.supports;
999
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1000
+
1001
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1002
+ return React.createElement(MissingPropsMessage_1.default, {
1003
+ "data-test": "missing-props-message",
1004
+ width: width,
1005
+ height: height,
1006
+ missingProps: missing,
1007
+ backgroundColor: bgColorFromTheme
1008
+ });
1009
+ } // events
1010
+
1011
+
1012
+ var eventCallbackProps = {};
1013
+
1014
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1015
+ var supportedEvents = vizConfig.events;
1016
+ Object.keys(supportedEvents).forEach(function (eventName) {
1017
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1018
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1019
+ // then remove these lines
1020
+
1021
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
1022
+ var payload = {};
1023
+
1024
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
1025
+ payloadKeys.forEach(function (p) {
1026
+ payload[p] = evaluatedOptions[p];
1027
+ });
1028
+ }
1029
+
1030
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
1031
+ if (ev && ev.payload) {
1032
+ payload = ev.payload;
1033
+ }
1034
+
1035
+ return onEventTrigger({
1036
+ originalEvent: ev,
1037
+ payload: payload,
1038
+ type: eventName
1039
+ });
1040
+ };
1041
+ });
1042
+ } // compute pure viz props which are not from options
1043
+
1044
+
1045
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1046
+ themeFunc: themeFunc
1047
+ }));
1048
+ /**
1049
+ * PAGE_AND_SORT behavior
1050
+ *
1051
+ * Some visualizations, like table, requires metadata about the datasource,
1052
+ * like total number of results, current count, offset, and sort, for rendering
1053
+ * paginator and sorting direction. In this approach, the visualization
1054
+ * allow users to set 'paginateDataSourceKey' to select which datasource
1055
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1056
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
1057
+ * 'requestParams', 'meta' and onRequestParams callback as props.
1058
+ *
1059
+ * In future, we could automatically detect which all datasources are being used
1060
+ * and bind those magically to pagination/sorting behavior.
1061
+ */
1062
+
1063
+ var dataSourceMetadata = {};
1064
+ var OptionKey = 'paginateDataSourceKey';
1065
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1066
+
1067
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1068
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1069
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1070
+
1071
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1072
+ return onRequestParamsChange(paginateDataSourceKey, payload);
1073
+ };
1074
+
1075
+ var sortParams = getSorting_1.getSortingParams({
1076
+ requestParams: requestParams,
1077
+ meta: meta,
1078
+ onRequestParamsChange: handleRequestParamsChange
1079
+ });
1080
+ var paginatorParams = getPagination_1.getPaginationParams({
1081
+ requestParams: requestParams,
1082
+ meta: meta,
1083
+ onRequestParamsChange: handleRequestParamsChange
1084
+ });
1085
+ dataSourceMetadata = {
1086
+ sortParams: sortParams,
1087
+ paginatorParams: paginatorParams
1088
+ };
1089
+ }
1090
+
1091
+ return React.createElement(SanitizedReactViz, Object.assign({
1092
+ mode: mode,
1093
+ width: width,
1094
+ height: height
1095
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1096
+ };
1097
+
1098
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1099
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1100
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1101
+ theme: {}
1102
+ }); // attach viz config
1103
+
1104
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1105
+
1106
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1107
+ };
1108
+
1109
+ exports.default = withDashboardViz;
1110
+
1111
+ /***/ }),
1112
+ /* 33 */
1113
+ /***/ (function(module, exports) {
1114
+
1115
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1116
+
1117
+ /***/ }),
1118
+ /* 34 */
1119
+ /***/ (function(module, exports) {
1120
+
1121
+ module.exports = require("@splunk/visualization-encoding/Options");
1122
+
1123
+ /***/ }),
1124
+ /* 35 */
1125
+ /***/ (function(module, exports) {
1126
+
1127
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1128
+
1129
+ /***/ }),
1130
+ /* 36 */
1131
+ /***/ (function(module, exports) {
1132
+
1133
+ module.exports = require("@splunk/moment");
1134
+
1135
+ /***/ }),
1136
+ /* 37 */
1137
+ /***/ (function(module, exports, __webpack_require__) {
1138
+
1139
+ "use strict";
1140
+
1141
+
1142
+ var _classCallCheck = __webpack_require__(11);
1143
+
1144
+ Object.defineProperty(exports, "__esModule", {
1145
+ value: true
1146
+ });
1147
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1148
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1149
+
1150
+ var T = __webpack_require__(0);
1151
+
1152
+ var lodash_1 = __webpack_require__(3);
1153
+
1154
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1155
+
1156
+
1157
+ exports.INITIAL_WIDTH = 250;
1158
+ exports.INITIAL_HEIGHT = 250;
1159
+ /**
1160
+ * A Splunk visualization
1161
+ */
1162
+
1163
+ var SplunkVisualization = function SplunkVisualization() {
1164
+ _classCallCheck(this, SplunkVisualization);
1165
+ };
1166
+
1167
+ SplunkVisualization.propTypes = {
1168
+ /**
1169
+ * display mode
1170
+ */
1171
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1172
+
1173
+ /**
1174
+ * width in pixel or string, defaults to 100%
1175
+ */
1176
+ width: T.oneOfType([T.string, T.number]).isRequired,
1177
+
1178
+ /**
1179
+ * height in pixel or string
1180
+ */
1181
+ height: T.oneOfType([T.string, T.number]).isRequired,
1182
+
1183
+ /**
1184
+ * visualization context used for dynamic option evaluation
1185
+ */
1186
+ context: T.object,
1187
+
1188
+ /**
1189
+ * visualization formatting options
1190
+ */
1191
+ options: T.object,
1192
+
1193
+ /**
1194
+ * A callback to update formatting options
1195
+ */
1196
+ onOptionsChange: T.func,
1197
+
1198
+ /**
1199
+ * datasource state which include data and request params, object key indicate the datasource type.
1200
+ */
1201
+ dataSources: T.objectOf(T.shape({
1202
+ /**
1203
+ * current request params
1204
+ */
1205
+ requestParams: T.object,
1206
+
1207
+ /**
1208
+ * current dataset
1209
+ */
1210
+ data: T.shape({
1211
+ fields: T.array,
1212
+ columns: T.array
1213
+ }),
1214
+
1215
+ /**
1216
+ * error
1217
+ */
1218
+ error: T.shape({
1219
+ level: T.string,
1220
+ message: T.string
1221
+ }),
1222
+
1223
+ /**
1224
+ * meta data that came with the dataset
1225
+ */
1226
+ meta: T.object
1227
+ })),
1228
+
1229
+ /**
1230
+ * A callback to trigger event
1231
+ */
1232
+ onEventTrigger: T.func,
1233
+
1234
+ /**
1235
+ * Inform viz if there are handlers listening to events
1236
+ */
1237
+ hasEventHandlers: T.bool,
1238
+
1239
+ /**
1240
+ * A callback to communicate computed props to a consumer
1241
+ */
1242
+ onComputedProps: T.func,
1243
+
1244
+ /**
1245
+ * A callback to obtain visualization api
1246
+ */
1247
+ vizActionHandlerRef: T.func,
1248
+ loading: T.bool,
1249
+ theme: T.object,
1250
+
1251
+ /**
1252
+ * A callback to request new data with updated request params
1253
+ */
1254
+ onRequestParamsChange: T.func
1255
+ };
1256
+ /**
1257
+ *
1258
+ */
1259
+
1260
+ SplunkVisualization.defaultProps = {
1261
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1262
+ width: '100%',
1263
+ height: exports.INITIAL_HEIGHT,
1264
+ dataSources: {},
1265
+ onEventTrigger: function onEventTrigger() {
1266
+ return {};
1267
+ },
1268
+ mode: 'view',
1269
+ hasEventHandlers: false,
1270
+ options: {},
1271
+ context: {},
1272
+ onOptionsChange: function onOptionsChange() {
1273
+ return {};
1274
+ },
1275
+ vizActionHandlerRef: function vizActionHandlerRef() {
1276
+ return new VizActionHandler_1.DefaultVizActionHandler();
1277
+ },
1278
+ onComputedProps: function onComputedProps() {
1279
+ return {};
1280
+ },
1281
+ loading: false,
1282
+ onRequestParamsChange: lodash_1.noop
1283
+ };
1284
+ exports.default = SplunkVisualization;
1285
+
1286
+ /***/ }),
1287
+ /* 38 */
1288
+ /***/ (function(module, exports, __webpack_require__) {
1289
+
1290
+ "use strict";
1291
+
1292
+
1293
+ var _classCallCheck = __webpack_require__(11);
1294
+
1295
+ var _createClass = __webpack_require__(19);
1296
+
1297
+ Object.defineProperty(exports, "__esModule", {
1298
+ value: true
1299
+ });
1300
+ exports.DefaultVizActionHandler = void 0;
1301
+
1302
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
1303
+ function DefaultVizActionHandler() {
1304
+ _classCallCheck(this, DefaultVizActionHandler);
1305
+ }
1306
+
1307
+ _createClass(DefaultVizActionHandler, [{
1308
+ key: "focus",
1309
+ value: function focus() {// noop
1310
+ }
1311
+ }, {
1312
+ key: "snapshot",
1313
+ value: function snapshot() {
1314
+ return null; // noop
1315
+ }
1316
+ }]);
1317
+
1318
+ return DefaultVizActionHandler;
1319
+ }();
1320
+
1321
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1322
+
1323
+ /***/ }),
1324
+ /* 39 */
1325
+ /***/ (function(module, exports, __webpack_require__) {
1326
+
1327
+ "use strict";
1328
+
1329
+
1330
+ Object.defineProperty(exports, "__esModule", {
1331
+ value: true
1332
+ });
1333
+ exports.validSortDirs = void 0;
1334
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1335
+
1336
+ /***/ }),
1337
+ /* 40 */
1338
+ /***/ (function(module, exports, __webpack_require__) {
1339
+
1340
+ "use strict";
1341
+
1342
+
1343
+ Object.defineProperty(exports, "__esModule", {
1344
+ value: true
1345
+ });
1346
+ exports.useDeepMemo = void 0;
1347
+
1348
+ var react_1 = __webpack_require__(1);
1349
+
1350
+ var lodash_1 = __webpack_require__(3);
1351
+ /**
1352
+ * This hook evaluates and stores the result of a passed function and only
1353
+ * re-evaluates the function when passed dependencies change.
1354
+ *
1355
+ * It is different from the internal React useMemo in the following aspects:
1356
+ * - it only stores the last evaluated result
1357
+ * - it uses a deep equality check to determine if dependencies have changed
1358
+ *
1359
+ * Inspired by apollo-client's useDeepMemo
1360
+ *
1361
+ * @param fn the function to be executed and
1362
+ * @param dependencies an array of dependencies
1363
+ */
1364
+
1365
+
1366
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1367
+ var ref = react_1.useRef();
1368
+
1369
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1370
+ ref.current = {
1371
+ dependencies: dependencies,
1372
+ value: fn()
1373
+ };
1374
+ }
1375
+
1376
+ return ref.current.value;
1377
+ };
1378
+
1379
+ exports.useDeepMemo = useDeepMemo;
1380
+
1381
+ /***/ }),
1382
+ /* 41 */
1383
+ /***/ (function(module, exports, __webpack_require__) {
1384
+
1385
+ "use strict";
1386
+
1387
+
1388
+ Object.defineProperty(exports, "__esModule", {
1389
+ value: true
1390
+ });
1391
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1392
+
1393
+ var React = __webpack_require__(1);
1394
+
1395
+ var T = __webpack_require__(0);
1396
+
1397
+ var i18n_1 = __webpack_require__(2);
1398
+
1399
+ var Message_1 = __webpack_require__(10);
1400
+
1401
+ var FixedSizeContainer_1 = __webpack_require__(13);
1402
+ /**
1403
+ * @method isMissing
1404
+ * @param {any} v
1405
+ * @returns {boolean} true if the input value === null or undefined
1406
+ */
1407
+
1408
+
1409
+ var isMissing = function isMissing(v) {
1410
+ return v === null || v === undefined;
1411
+ };
1412
+
1413
+ exports.isMissing = isMissing;
1414
+ /**
1415
+ * @method misskingKeys
1416
+ * @param {string[]} keys
1417
+ * @param {object} target
1418
+ * @returns {string[]} the keys of missing required props
1419
+ */
1420
+
1421
+ var missingKeys = function missingKeys(keys, target) {
1422
+ return keys.filter(function (k) {
1423
+ return exports.isMissing(target[k]);
1424
+ });
1425
+ };
1426
+
1427
+ exports.missingKeys = missingKeys;
1428
+ var propTypes = {
1429
+ width: T.oneOfType([T.string, T.number]),
1430
+ height: T.oneOfType([T.string, T.number]),
1431
+ // eslint-disable-next-line react/no-unused-prop-types
1432
+ backgroundColor: T.string,
1433
+ missingProps: T.arrayOf(T.string)
1434
+ };
1435
+ /**
1436
+ * @method MissingPropsMessage
1437
+ * @param {MissingPropsProps} props
1438
+ * @returns {React.ReactElement}
1439
+ */
1440
+
1441
+ var MissingPropsMessage = function MissingPropsMessage(props) {
1442
+ var width = props.width,
1443
+ height = props.height,
1444
+ missingProps = props.missingProps;
1445
+ return React.createElement(Message_1.default, {
1446
+ "data-test": "message",
1447
+ width: width,
1448
+ height: height,
1449
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1450
+ });
1451
+ };
1452
+
1453
+ exports.MissingPropsMessage = MissingPropsMessage;
1454
+ exports.MissingPropsMessage.propTypes = propTypes;
1455
+ exports.MissingPropsMessage.defaultProps = {
1456
+ width: '100%',
1457
+ height: 250
1458
+ };
1459
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1460
+
1461
+ /***/ }),
1462
+ /* 42 */
1463
+ /***/ (function(module, exports, __webpack_require__) {
1464
+
1465
+ "use strict";
1466
+
1467
+
1468
+ Object.defineProperty(exports, "__esModule", {
1469
+ value: true
1470
+ });
1471
+
1472
+ var React = __webpack_require__(1);
1473
+
1474
+ var styled_components_1 = __webpack_require__(4);
1475
+
1476
+ var hocUtils_1 = __webpack_require__(14);
1477
+
1478
+ var Cover = styled_components_1.default.div.withConfig({
1479
+ displayName: "withEditModeCover__Cover",
1480
+ componentId: "sc-1gsbnxb-0"
1481
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1482
+ var Blocker = styled_components_1.default.div.attrs({
1483
+ 'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
1484
+ }).withConfig({
1485
+ displayName: "withEditModeCover__Blocker",
1486
+ componentId: "sc-1gsbnxb-1"
1487
+ })(["position:relative;width:100%;height:100%;"]);
1488
+ /**
1489
+ * HOC that renders a cover layer in edit mode
1490
+ * @method withEditModeCover
1491
+ * @param {ExtendedDashViz} Visualization
1492
+ * @returns {ExtendedDashViz} Wrapper
1493
+ */
1494
+
1495
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1496
+ var Wrapper = function Wrapper(props) {
1497
+ var mode = props.mode;
1498
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
1499
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1500
+ "data-test": "edit-mode-cover"
1501
+ }));
1502
+ };
1503
+
1504
+ hocUtils_1.extendStaticWrapperProps({
1505
+ Wrapper: Wrapper,
1506
+ Visualization: Visualization
1507
+ });
1508
+ return Wrapper;
1509
+ };
1510
+
1511
+ exports.default = withEditModeCover;
1512
+
1513
+ /***/ }),
1514
+ /* 43 */
1515
+ /***/ (function(module, exports, __webpack_require__) {
1516
+
1517
+ "use strict";
1518
+
1519
+
1520
+ Object.defineProperty(exports, "__esModule", {
1521
+ value: true
1522
+ });
1523
+
1524
+ var React = __webpack_require__(1);
1525
+
1526
+ var colorUtils_1 = __webpack_require__(12);
1527
+
1528
+ var variables_1 = __webpack_require__(9);
1529
+
1530
+ var IconPlaceholder_1 = __webpack_require__(27);
1531
+
1532
+ var VizBehavior_1 = __webpack_require__(6);
1533
+
1534
+ var hocUtils_1 = __webpack_require__(14);
1535
+
1536
+ var withPlaceholder = function withPlaceholder(Visualization) {
1537
+ var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1538
+ var config = Visualization.config;
1539
+ var themes = config.themes;
1540
+
1541
+ var Wrapper = function Wrapper(props) {
1542
+ var _a, _b;
1543
+
1544
+ var dataSources = props.dataSources,
1545
+ loading = props.loading,
1546
+ options = props.options,
1547
+ height = props.height,
1548
+ width = props.width;
1549
+ var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1550
+ var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1551
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1552
+ var iconColor = variables_1.default.contentColorActive(props);
1553
+
1554
+ if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1555
+ return React.createElement(IconPlaceholder_1.default, {
1556
+ "data-test": "icon-placeholder",
1557
+ icon: icon,
1558
+ width: width,
1559
+ height: height,
1560
+ backgroundColor: bgColorFromTheme,
1561
+ iconColor: iconColor
1562
+ });
1563
+ }
1564
+
1565
+ return React.createElement(Visualization, Object.assign({}, props));
1566
+ };
1567
+
1568
+ hocUtils_1.extendStaticWrapperProps({
1569
+ Wrapper: Wrapper,
1570
+ Visualization: Visualization
1571
+ });
1572
+ return Wrapper;
1573
+ };
1574
+
1575
+ exports.default = withPlaceholder;
1576
+
1577
+ /***/ }),
1578
+ /* 44 */
1579
+ /***/ (function(module, exports) {
1580
+
1581
+ module.exports = require("@splunk/visualization-icons/placeholders");
1582
+
1583
+ /***/ }),
1584
+ /* 45 */,
1585
+ /* 46 */,
1586
+ /* 47 */
1587
+ /***/ (function(module, exports) {
1588
+
1589
+ module.exports = require("@splunk/visualization-icons");
1590
+
1591
+ /***/ }),
1592
+ /* 48 */,
1593
+ /* 49 */,
1594
+ /* 50 */
1595
+ /***/ (function(module, exports, __webpack_require__) {
1596
+
1597
+ "use strict";
1598
+
1599
+
1600
+ Object.defineProperty(exports, "__esModule", {
1601
+ value: true
1602
+ });
1603
+
1604
+ var i18n_1 = __webpack_require__(2);
1605
+
1606
+ var background = function background(_ref) {
1607
+ var label = _ref.label,
1608
+ themes = _ref.themes,
1609
+ labelPosition = _ref.labelPosition;
1610
+ return [{
1611
+ label: i18n_1._(label || 'Background'),
1612
+ option: 'backgroundColor',
1613
+ editor: 'editor.color',
1614
+ editorProps: {
1615
+ labelPosition: labelPosition || 'top',
1616
+ themes: themes
1617
+ }
1618
+ }];
1619
+ };
1620
+
1621
+ exports.default = background;
1622
+
1623
+ /***/ }),
1624
+ /* 51 */
1625
+ /***/ (function(module, exports) {
1626
+
1627
+ module.exports = require("@babel/runtime/helpers/slicedToArray");
1628
+
1629
+ /***/ }),
1630
+ /* 52 */,
1631
+ /* 53 */,
1632
+ /* 54 */,
1633
+ /* 55 */,
1634
+ /* 56 */,
1635
+ /* 57 */,
1636
+ /* 58 */,
1637
+ /* 59 */,
1638
+ /* 60 */,
1639
+ /* 61 */,
1640
+ /* 62 */,
1641
+ /* 63 */,
1642
+ /* 64 */,
1643
+ /* 65 */,
1644
+ /* 66 */,
1645
+ /* 67 */,
1646
+ /* 68 */,
1647
+ /* 69 */
1648
+ /***/ (function(module, exports) {
1649
+
1650
+ module.exports = require("@splunk/themes");
1651
+
1652
+ /***/ }),
1653
+ /* 70 */,
1654
+ /* 71 */,
1655
+ /* 72 */,
1656
+ /* 73 */,
1657
+ /* 74 */,
1658
+ /* 75 */,
1659
+ /* 76 */,
1660
+ /* 77 */,
1661
+ /* 78 */,
1662
+ /* 79 */,
1663
+ /* 80 */,
1664
+ /* 81 */
1665
+ /***/ (function(module, exports) {
1666
+
1667
+ module.exports = require("@splunk/visualizations-shared/dataSourceUtils");
1668
+
1669
+ /***/ }),
1670
+ /* 82 */
1671
+ /***/ (function(module, exports) {
1672
+
1673
+ module.exports = require("@babel/runtime/helpers/typeof");
1674
+
1675
+ /***/ }),
1676
+ /* 83 */
1677
+ /***/ (function(module, exports) {
1678
+
1679
+ module.exports = require("@splunk/react-ui/Popover");
1680
+
1681
+ /***/ }),
1682
+ /* 84 */,
1683
+ /* 85 */,
1684
+ /* 86 */,
1685
+ /* 87 */,
1686
+ /* 88 */,
1687
+ /* 89 */,
1688
+ /* 90 */,
1689
+ /* 91 */,
1690
+ /* 92 */,
1691
+ /* 93 */,
1692
+ /* 94 */,
1693
+ /* 95 */,
1694
+ /* 96 */,
1695
+ /* 97 */,
1696
+ /* 98 */,
1697
+ /* 99 */,
1698
+ /* 100 */,
1699
+ /* 101 */,
1700
+ /* 102 */,
1701
+ /* 103 */,
1702
+ /* 104 */,
1703
+ /* 105 */,
1704
+ /* 106 */,
1705
+ /* 107 */
1706
+ /***/ (function(module, exports) {
1707
+
1708
+ module.exports = require("@splunk/react-ui/Menu");
1709
+
1710
+ /***/ }),
1711
+ /* 108 */
1712
+ /***/ (function(module, exports, __webpack_require__) {
1713
+
1714
+ "use strict";
1715
+
1716
+
1717
+ Object.defineProperty(exports, "__esModule", {
1718
+ value: true
1719
+ });
1720
+ exports.convertToArrOfObjects = void 0; // TODO: utilize this fn in ParallelCoordinates
1721
+
1722
+ var convertToArrOfObjects = function convertToArrOfObjects(columns, fields) {
1723
+ if (!columns || !columns[0].length) return [];
1724
+ var data = [];
1725
+
1726
+ var _loop = function _loop(i) {
1727
+ var newObj = {};
1728
+ fields.forEach(function (field, index) {
1729
+ var fieldName = typeof field === 'string' ? field : field.name;
1730
+
1731
+ if (columns[index][i] === '') {
1732
+ newObj[fieldName] = null;
1733
+ } else {
1734
+ newObj[fieldName] = columns[index][i];
1735
+ }
1736
+ });
1737
+ data.push(newObj);
1738
+ };
1739
+
1740
+ for (var i = 0; i < columns[0].length; i += 1) {
1741
+ _loop(i);
1742
+ }
1743
+
1744
+ return data;
1745
+ };
1746
+
1747
+ exports.convertToArrOfObjects = convertToArrOfObjects;
1748
+
1749
+ /***/ }),
1750
+ /* 109 */
1751
+ /***/ (function(module, exports) {
1752
+
1753
+ module.exports = require("@splunk/react-ui/Markdown");
1754
+
1755
+ /***/ }),
1756
+ /* 110 */,
1757
+ /* 111 */,
1758
+ /* 112 */,
1759
+ /* 113 */,
1760
+ /* 114 */,
1761
+ /* 115 */,
1762
+ /* 116 */,
1763
+ /* 117 */,
1764
+ /* 118 */,
1765
+ /* 119 */,
1766
+ /* 120 */,
1767
+ /* 121 */,
1768
+ /* 122 */,
1769
+ /* 123 */,
1770
+ /* 124 */,
1771
+ /* 125 */,
1772
+ /* 126 */,
1773
+ /* 127 */,
1774
+ /* 128 */,
1775
+ /* 129 */,
1776
+ /* 130 */,
1777
+ /* 131 */,
1778
+ /* 132 */
1779
+ /***/ (function(module, exports, __webpack_require__) {
1780
+
1781
+ "use strict";
1782
+
1783
+
1784
+ var __rest = this && this.__rest || function (s, e) {
1785
+ var t = {};
1786
+
1787
+ for (var p in s) {
1788
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1789
+ }
1790
+
1791
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1792
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1793
+ }
1794
+ return t;
1795
+ };
1796
+
1797
+ Object.defineProperty(exports, "__esModule", {
1798
+ value: true
1799
+ });
1800
+ exports.PureEvents = exports.config = exports.themes = exports.computeVizProps = exports.showPlaceHolderIcon = void 0;
1801
+
1802
+ var lodash_1 = __webpack_require__(3);
1803
+
1804
+ var dataSourceUtils_1 = __webpack_require__(81);
1805
+
1806
+ var withDashboardViz_1 = __webpack_require__(32);
1807
+
1808
+ var constants_1 = __webpack_require__(133);
1809
+
1810
+ var config_1 = __webpack_require__(184);
1811
+
1812
+ exports.config = config_1.default;
1813
+
1814
+ var PureEvents_1 = __webpack_require__(185);
1815
+
1816
+ exports.PureEvents = PureEvents_1.default;
1817
+ /**
1818
+ * @method showPlaceHolderIcon
1819
+ * @param {Object} dataSources
1820
+ * @returns {Boolean} return true if loading, error, non existent state or without columns in dataSources
1821
+ */
1822
+
1823
+ var showPlaceHolderIcon = function showPlaceHolderIcon(dataSources) {
1824
+ var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
1825
+ var noColumns = columns === undefined;
1826
+ var dataSourceState = dataSourceUtils_1.getDataSourceStateInfo(dataSources);
1827
+ return dataSourceState === dataSourceUtils_1.DataSourceState.ERROR || dataSourceState === dataSourceUtils_1.DataSourceState.LOADING || dataSourceState === dataSourceUtils_1.DataSourceState.NONEXISTENT || noColumns;
1828
+ };
1829
+
1830
+ exports.showPlaceHolderIcon = showPlaceHolderIcon;
1831
+
1832
+ var computeVizProps = function computeVizProps(_a) {
1833
+ // for specific changes to view type (List -> Raw, etc.), can create handling function here that calls onOptionsChange
1834
+ var _b;
1835
+
1836
+ var props = __rest(_a, []); // defaults to an empty datasource if one isn't provided, which shows the No Results Found UI:
1837
+
1838
+
1839
+ var dataSources = (_b = props === null || props === void 0 ? void 0 : props.dataSources) !== null && _b !== void 0 ? _b : constants_1.EMPTY_DATASOURCE;
1840
+ return Object.assign(Object.assign({}, props), {
1841
+ dataSources: dataSources
1842
+ });
1843
+ };
1844
+
1845
+ exports.computeVizProps = computeVizProps;
1846
+ var Events = withDashboardViz_1.default({
1847
+ ReactViz: PureEvents_1.default,
1848
+ vizConfig: config_1.default,
1849
+ computeVizProps: exports.computeVizProps,
1850
+ useIconPlaceholder: function useIconPlaceholder(dataSources) {
1851
+ return exports.showPlaceHolderIcon(dataSources);
1852
+ }
1853
+ });
1854
+ var themes = config_1.default.themes;
1855
+ exports.themes = themes;
1856
+ exports.default = Events;
1857
+
1858
+ /***/ }),
1859
+ /* 133 */
1860
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1861
+
1862
+ "use strict";
1863
+ __webpack_require__.r(__webpack_exports__);
1864
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rawEventPayload", function() { return rawEventPayload; });
1865
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "originalDataSourceData", function() { return originalDataSourceData; });
1866
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataSourceData", function() { return dataSourceData; });
1867
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY_DATASOURCE", function() { return EMPTY_DATASOURCE; });
1868
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIELDSUMMARY_DS_STORYBOOK", function() { return FIELDSUMMARY_DS_STORYBOOK; });
1869
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIELDSUMMARY_DS_DOC_HUB", function() { return FIELDSUMMARY_DS_DOC_HUB; });
1870
+ /* harmony import */ var _splunk_datasource_utils_DataSet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(152);
1871
+ /* harmony import */ var _splunk_datasource_utils_DataSet__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_datasource_utils_DataSet__WEBPACK_IMPORTED_MODULE_0__);
1872
+ // TODO: convert this file to .ts - created as .js as copied from SUI EventsViewer repo
1873
+
1874
+ var rawEventPayload = {
1875
+ preview: false,
1876
+ init_offset: 0,
1877
+ messages: [],
1878
+ fields: [{
1879
+ name: 'host'
1880
+ }, {
1881
+ name: 'source'
1882
+ }, {
1883
+ name: 'sourcetype'
1884
+ }, {
1885
+ name: 'splunk_server'
1886
+ }, {
1887
+ name: 'index'
1888
+ }, {
1889
+ name: '_raw'
1890
+ }, {
1891
+ name: '_time'
1892
+ }, {
1893
+ name: 'eventtype'
1894
+ }, {
1895
+ name: '_eventtype_color'
1896
+ }, {
1897
+ name: 'linecount'
1898
+ }, {
1899
+ name: '_fulllinecount'
1900
+ }],
1901
+ results: [{
1902
+ host: 'jbreeden-mbpr15',
1903
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1904
+ sourcetype: 'splunkd',
1905
+ splunk_server: 'jbreeden-mbpr15',
1906
+ index: '_internal',
1907
+ _raw: {
1908
+ value: '{"datetime":"07-16-2018 16:38:11.545 -0700","log_level":"INFO","component":"KVStoreServerStats","data":{"host":"ssingamneni-mbp13:8191","version":"3.4.9-splunk","process":"mongod","pid":21585,"uptime":20886,"uptimeMillis":20886042,"uptimeEstimate":20886,"localTime":1531784291541,"asserts":{"regular":0,"warning":0,"msg":0,"user":0,"rollovers":0},"backgroundFlushing":{"flushes":270,"total_ms":4429,"average_ms":16.403703703703705,"last_ms":27,"last_finished":1531784263582},"connections":{"current":9,"available":8183,"totalCreated":13},"dur":{"commits":28,"journaledMB":0,"writeToDataFilesMB":0,"compression":0,"commitsInWriteLock":0,"earlyCommits":0,"timeMs":{"dt":3013,"prepLogBuffer":0,"writeToJournal":0,"writeToDataFiles":0,"remapPrivateView":0,"commits":1,"commitsInWriteLock":0}},"extra_info":{"note":"fields vary by platform","page_faults":36543},"globalLock":{"totalTime":20885955000,"currentQueue":{"total":0,"readers":0,"writers":0},"activeClients":{"total":27,"readers":0,"writers":0}},"locks":{"Global":{"acquireCount":{"r":242994,"w":4136,"R":1,"W":5}},"MMAPV1Journal":{"acquireCount":{"r":127466,"w":4168,"R":149384,"W":190},"acquireWaitCount":{"w":28,"R":27},"timeAcquiringMicros":{"w":4320,"R":45261}},"Database":{"acquireCount":{"r":127257,"w":2479,"R":226,"W":36}},"Collection":{"acquireCount":{"R":105833,"W":573}},"Metadata":{"acquireCount":{"w":1906}},"oplog":{"acquireCount":{"R":21094,"W":1906}}},"network":{"bytesIn":4616571,"bytesOut":24319954,"physicalBytesIn":4616571,"physicalBytesOut":24319954,"numRequests":77719},"opLatencies":{"reads":{"latency":663793,"ops":17069},"writes":{"latency":12666524,"ops":569},"commands":{"latency":945488,"ops":21221}},"opcounters":{"insert":0,"query":17070,"update":569,"delete":0,"getmore":0,"command":21222},"opcountersRepl":{"insert":0,"query":0,"update":0,"delete":0,"getmore":0,"command":0},"repl":{"hosts":["127.0.0.1:8191"],"setName":"00BBEAFD-8B78-4F58-90B9-E7F3E9CBB249","setVersion":1,"ismain":true,"secondary":false,"primary":"127.0.0.1:8191","tags":{"all":"all","instance":"00BBEAFD-8B78-4F58-90B9-E7F3E9CBB249"},"me":"127.0.0.1:8191","electionId":{"$oid":"7fffffff000000000000000b"},"lastWrite":{"opTime":{"ts":{"$timestamp":{"t":1531784281,"i":2}},"t":11},"lastWriteDate":{"$date":1531784281000}},"rbid":673893},"security":{"SSLServerSubjectName":"O=SplunkUser,CN=SplunkServerDefaultCert","SSLServerHasCertificateAuthority":false,"SSLServerCertificateExpirationDate":{"$date":1622326898000}},"storageEngine":{"name":"mmapv1","supportsCommittedReads":false,"readOnly":false,"persistent":true},"mem":{"bits":64,"resident":123,"virtual":5307,"supported":true,"mapped":448,"mappedWithJournal":896},"metrics":{"commands":{"<UNKNOWN>":0,"_configsvrAddShard":{"failed":0,"total":0},"_configsvrAddShardToZone":{"failed":0,"total":0},"_configsvrBalancerStart":{"failed":0,"total":0},"_configsvrBalancerStatus":{"failed":0,"total":0},"_configsvrBalancerStop":{"failed":0,"total":0},"_configsvrCommitChunkMerge":{"failed":0,"total":0},"_configsvrCommitChunkMigration":{"failed":0,"total":0},"_configsvrCommitChunkSplit":{"failed":0,"total":0},"_configsvrMoveChunk":{"failed":0,"total":0},"_configsvrRemoveShardFromZone":{"failed":0,"total":0},"_configsvrSetFeatureCompatibilityVersion":{"failed":0,"total":0},"_configsvrUpdateZoneKeyRange":{"failed":0,"total":0},"_getUserCacheGeneration":{"failed":0,"total":0},"_isSelf":{"failed":0,"total":0},"_mergeAuthzCollections":{"failed":0,"total":0},"_migrateClone":{"failed":0,"total":0},"_recvChunkAbort":{"failed":0,"total":0},"_recvChunkCommit":{"failed":0,"total":0},"_recvChunkStart":{"failed":0,"total":0},"_recvChunkStatus":{"failed":0,"total":0},"_transferMods":{"failed":0,"total":0},"aggregate":{"failed":0,"total":0},"appendOplogNote":{"failed":0,"total":0},"applyOps":{"failed":0,"total":0},"authSchemaUpgrade":{"failed":0,"total":0},"authenticate":{"failed":0,"total":0},"availableQueryOptions":{"failed":0,"total":0},"buildInfo":{"failed":0,"total":0},"checkShardingIndex":{"failed":0,"total":0},"cleanupOrphaned":{"failed":0,"total":0},"clone":{"failed":0,"total":0},"cloneCollection":{"failed":0,"total":0},"cloneCollectionAsCapped":{"failed":0,"total":0},"collMod":{"failed":0,"total":0},"collStats":{"failed":0,"total":383},"compact":{"failed":0,"total":0},"connPoolStats":{"failed":0,"total":0},"connPoolSync":{"failed":0,"total":0},"connectionStatus":{"failed":0,"total":0},"convertToCapped":{"failed":0,"total":0},"copydb":{"failed":0,"total":0},"copydbgetnonce":{"failed":0,"total":0},"copydbsaslstart":{"failed":0,"total":0},"count":{"failed":0,"total":0},"create":{"failed":0,"total":0},"createIndexes":{"failed":0,"total":0},"createRole":{"failed":0,"total":0},"createUser":{"failed":0,"total":0},"currentOp":{"failed":0,"total":0},"currentOpCtx":{"failed":0,"total":0},"dataSize":{"failed":0,"total":0},"dbHash":{"failed":0,"total":0},"dbStats":{"failed":0,"total":0},"delete":{"failed":0,"total":0},"diagLogging":{"failed":0,"total":0},"distinct":{"failed":0,"total":0},"driverOIDTest":{"failed":0,"total":0},"drop":{"failed":0,"total":0},"dropAllRolesFromDatabase":{"failed":0,"total":0},"dropAllUsersFromDatabase":{"failed":0,"total":0},"dropDatabase":{"failed":0,"total":0},"dropIndexes":{"failed":0,"total":0},"dropRole":{"failed":0,"total":0},"dropUser":{"failed":0,"total":0},"eval":{"failed":0,"total":0},"explain":{"failed":0,"total":0},"features":{"failed":0,"total":0},"filemd5":{"failed":0,"total":0},"find":{"failed":0,"total":4088},"findAndModify":{"failed":0,"total":0},"forceerror":{"failed":0,"total":0},"fsync":{"failed":0,"total":0},"fsyncUnlock":{"failed":0,"total":0},"geoNear":{"failed":0,"total":0},"geoSearch":{"failed":0,"total":0},"getCmdLineOpts":{"failed":0,"total":3543},"getDiagnosticData":{"failed":0,"total":0},"getLastError":{"failed":0,"total":0},"getLog":{"failed":0,"total":0},"getMore":{"failed":0,"total":0},"getParameter":{"failed":0,"total":0},"getPrevError":{"failed":0,"total":0},"getShardMap":{"failed":0,"total":0},"getShardVersion":{"failed":0,"total":0},"getnonce":{"failed":0,"total":0},"grantPrivilegesToRole":{"failed":0,"total":0},"grantRolesToRole":{"failed":0,"total":0},"grantRolesToUser":{"failed":0,"total":0},"group":{"failed":0,"total":0},"handshake":{"failed":0,"total":0},"hostInfo":{"failed":0,"total":0},"insert":{"failed":0,"total":0},"invalidateUserCache":{"failed":0,"total":0},"isMain":{"failed":0,"total":4877},"killCursors":{"failed":0,"total":0},"killOp":{"failed":0,"total":0},"listCollections":{"failed":0,"total":220},"listCommands":{"failed":0,"total":0},"listDatabases":{"failed":0,"total":55},"listIndexes":{"failed":0,"total":0},"lockInfo":{"failed":0,"total":0},"logRotate":{"failed":0,"total":0},"logout":{"failed":0,"total":0},"mapReduce":{"failed":0,"total":0},"mapreduce":{"shardedfinish":{"failed":0,"total":0}},"mergeChunks":{"failed":0,"total":0},"moveChunk":{"failed":0,"total":0},"parallelCollectionScan":{"failed":0,"total":0},"ping":{"failed":0,"total":7692},"planCacheClear":{"failed":0,"total":0},"planCacheClearFilters":{"failed":0,"total":0},"planCacheListFilters":{"failed":0,"total":0},"planCacheListPlans":{"failed":0,"total":0},"planCacheListQueryShapes":{"failed":0,"total":0},"planCacheSetFilter":{"failed":0,"total":0},"profile":{"failed":0,"total":4},"reIndex":{"failed":0,"total":0},"renameCollection":{"failed":0,"total":0},"repairCursor":{"failed":0,"total":0},"repairDatabase":{"failed":0,"total":0},"replSetAbortPrimaryCatchUp":{"failed":0,"total":0},"replSetElect":{"failed":0,"total":0},"replSetFreeze":{"failed":0,"total":0},"replSetFresh":{"failed":0,"total":0},"replSetGetConfig":{"failed":0,"total":0},"replSetGetRBID":{"failed":0,"total":0},"replSetGetStatus":{"failed":0,"total":3816},"replSetHeartbeat":{"failed":0,"total":0},"replSetInitiate":{"failed":0,"total":0},"replSetMaintenance":{"failed":0,"total":0},"replSetReconfig":{"failed":0,"total":0},"replSetRequestVotes":{"failed":0,"total":0},"replSetStepDown":{"failed":0,"total":0},"replSetStepUp":{"failed":0,"total":0},"replSetSyncFrom":{"failed":0,"total":0},"replSetUpdatePosition":{"failed":0,"total":0},"resetError":{"failed":0,"total":0},"resync":{"failed":0,"total":0},"revokePrivilegesFromRole":{"failed":0,"total":0},"revokeRolesFromRole":{"failed":0,"total":0},"revokeRolesFromUser":{"failed":0,"total":0},"rolesInfo":{"failed":0,"total":0},"saslContinue":{"failed":0,"total":20},"saslStart":{"failed":0,"total":10},"serverStatus":{"failed":0,"total":602},"setFeatureCompatibilityVersion":{"failed":0,"total":0},"setParameter":{"failed":0,"total":0},"setShardVersion":{"failed":0,"total":0},"shardConnPoolStats":{"failed":0,"total":0},"shardingState":{"failed":0,"total":0},"shutdown":{"failed":0,"total":0},"splitChunk":{"failed":0,"total":0},"splitVector":{"failed":0,"total":0},"top":{"failed":0,"total":0},"touch":{"failed":0,"total":0},"unsetSharding":{"failed":0,"total":0},"update":{"failed":0,"total":569},"updateRole":{"failed":0,"total":0},"updateUser":{"failed":0,"total":0},"usersInfo":{"failed":0,"total":0},"validate":{"failed":0,"total":0},"whatsmyuri":{"failed":0,"total":0}},"cursor":{"timedOut":0,"open":{"noTimeout":0,"pinned":0,"total":0}},"document":{"deleted":0,"inserted":0,"returned":4101,"updated":569},"getLastError":{"wtime":{"num":569,"totalMillis":2},"wtimeouts":0},"operation":{"scanAndOrder":0,"writeConflicts":0},"queryExecutor":{"scanned":574,"scannedObjects":4670},"record":{"moves":0},"repl":{"executor":{"counters":{"eventCreated":6,"eventWait":6,"cancels":2,"waits":0,"scheduledNetCmd":0,"scheduledDBWork":2,"scheduledXclWork":0,"scheduledWorkAt":2,"scheduledWork":0,"schedulingFailures":0},"queues":{"networkInProgress":0,"dbWorkInProgress":0,"exclusiveInProgress":0,"sleepers":0,"ready":0,"free":3},"unsignaledEvents":0,"eventWaiters":0,"shuttingDown":false,"networkInterface":"\\nNetworkInterfaceASIO Operations\' Diagnostic:\\nOperation: Count: \\nConnecting 0 \\nIn Progress 0 \\nSucceeded 0 \\nCanceled 0 \\nFailed 0 \\nTimed Out 0 \\n\\n"},"apply":{"attemptsToBecomeSecondary":1,"batches":{"num":0,"totalMillis":0},"ops":0},"buffer":{"count":0,"maxSizeBytes":268435456,"sizeBytes":0},"initialSync":{"completed":0,"failedAttempts":0,"failures":0},"network":{"bytes":0,"getmores":{"num":0,"totalMillis":0},"ops":0,"readersCreated":0},"preload":{"docs":{"num":0,"totalMillis":0},"indexes":{"num":0,"totalMillis":0}}},"storage":{"freelist":{"search":{"bucketExhausted":0,"requests":0,"scanned":0}}},"ttl":{"deletedDocuments":0,"passes":270}},"ok":1}}'
1909
+ },
1910
+ _time: '2018-04-02T16:33:49.691-07:00',
1911
+ linecount: '1'
1912
+ }, {
1913
+ host: 'jbreeden-mbpr15',
1914
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1915
+ sourcetype: 'splunkd',
1916
+ splunk_server: 'jbreeden-mbpr15',
1917
+ index: '_internal',
1918
+ _raw: {
1919
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1920
+ },
1921
+ _time: '2018-04-02T16:33:49.691-07:00',
1922
+ linecount: '1'
1923
+ }, {
1924
+ host: 'jbreeden-mbpr15',
1925
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1926
+ sourcetype: 'splunkd',
1927
+ splunk_server: 'jbreeden-mbpr15',
1928
+ index: '_internal',
1929
+ _raw: {
1930
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1931
+ },
1932
+ _time: '2018-04-02T16:33:49.691-07:00',
1933
+ linecount: '1'
1934
+ }, {
1935
+ host: 'jbreeden-mbpr15',
1936
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1937
+ sourcetype: 'splunkd',
1938
+ splunk_server: 'jbreeden-mbpr15',
1939
+ index: '_internal',
1940
+ _raw: {
1941
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1942
+ },
1943
+ _time: '2018-04-02T16:33:49.691-07:00',
1944
+ linecount: '1'
1945
+ }, {
1946
+ host: 'jbreeden-mbpr15',
1947
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1948
+ sourcetype: 'splunkd',
1949
+ splunk_server: 'jbreeden-mbpr15',
1950
+ index: '_internal',
1951
+ _raw: {
1952
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1953
+ },
1954
+ _time: '2018-04-02T16:33:49.691-07:00',
1955
+ linecount: '1'
1956
+ }, {
1957
+ host: 'jbreeden-mbpr15',
1958
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1959
+ sourcetype: 'splunkd',
1960
+ splunk_server: 'jbreeden-mbpr15',
1961
+ index: '_internal',
1962
+ _raw: {
1963
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1964
+ },
1965
+ _time: '2018-04-02T16:33:49.691-07:00',
1966
+ linecount: '1'
1967
+ }, {
1968
+ host: 'jbreeden-mbpr15',
1969
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1970
+ sourcetype: 'splunkd',
1971
+ splunk_server: 'jbreeden-mbpr15',
1972
+ index: '_internal',
1973
+ _raw: {
1974
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1975
+ },
1976
+ _time: '2018-04-02T16:33:49.691-07:00',
1977
+ linecount: '1'
1978
+ }, {
1979
+ host: 'jbreeden-mbpr15',
1980
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1981
+ sourcetype: 'splunkd',
1982
+ splunk_server: 'jbreeden-mbpr15',
1983
+ index: '_internal',
1984
+ _raw: {
1985
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1986
+ },
1987
+ _time: '2018-04-02T16:33:49.691-07:00',
1988
+ linecount: '1'
1989
+ }, {
1990
+ host: 'jbreeden-mbpr15',
1991
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
1992
+ sourcetype: 'splunkd',
1993
+ splunk_server: 'jbreeden-mbpr15',
1994
+ index: '_internal',
1995
+ _raw: {
1996
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
1997
+ },
1998
+ _time: '2018-04-02T16:33:49.691-07:00',
1999
+ linecount: '1'
2000
+ }, {
2001
+ host: 'jbreeden-mbpr15',
2002
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2003
+ sourcetype: 'splunkd',
2004
+ splunk_server: 'jbreeden-mbpr15',
2005
+ index: '_internal',
2006
+ _raw: {
2007
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=thruput, instantaneous_kbps=0.8775482519547254, instantaneous_eps=3.5802456751680514, average_kbps=0.7280928568987709, total_k_processed=4794, kb=27.20703125, ev=111, load_average=2.87744140625'
2008
+ },
2009
+ _time: '2018-04-02T16:33:49.691-07:00',
2010
+ linecount: '1'
2011
+ }, {
2012
+ host: 'jbreeden-mbpr15',
2013
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2014
+ sourcetype: 'splunkd',
2015
+ splunk_server: 'jbreeden-mbpr15',
2016
+ index: '_internal',
2017
+ _raw: {
2018
+ value: '04-02-2018 16:33:49.691 -0700 INFO Metrics - group=thruput, name=syslog_output, instantaneous_kbps=0, instantaneous_eps=0, average_kbps=0, total_k_processed=0, kb=0, ev=0'
2019
+ },
2020
+ _time: '2018-04-02T16:33:49.691-07:00',
2021
+ linecount: '1'
2022
+ }, {
2023
+ host: 'jbreeden-mbpr15',
2024
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2025
+ sourcetype: 'splunkd',
2026
+ splunk_server: 'jbreeden-mbpr15',
2027
+ index: '_internal',
2028
+ _raw: {
2029
+ value: '04-02-2018 16:33:49.690 -0700 INFO Metrics - group=thruput, name=index_thruput, instantaneous_kbps=0.8775484783935827, instantaneous_eps=3.0319205432969385, average_kbps=0.7287044552121656, total_k_processed=4798, kb=27.20703125, ev=94'
2030
+ },
2031
+ _time: '2018-04-02T16:33:49.690-07:00',
2032
+ linecount: '1'
2033
+ }, {
2034
+ host: 'jbreeden-mbpr15',
2035
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2036
+ sourcetype: 'splunkd',
2037
+ splunk_server: 'jbreeden-mbpr15',
2038
+ index: '_internal',
2039
+ _raw: {
2040
+ value: '04-02-2018 16:33:49.690 -0700 INFO Metrics - group=queue, name=typingqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=24, smallest_size=0'
2041
+ },
2042
+ _time: '2018-04-02T16:33:49.690-07:00',
2043
+ linecount: '1'
2044
+ }, {
2045
+ host: 'jbreeden-mbpr15',
2046
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2047
+ sourcetype: 'splunkd',
2048
+ splunk_server: 'jbreeden-mbpr15',
2049
+ index: '_internal',
2050
+ _raw: {
2051
+ value: '04-02-2018 16:33:49.690 -0700 INFO Metrics - group=queue, name=tcpin_queue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2052
+ },
2053
+ _time: '2018-04-02T16:33:49.690-07:00',
2054
+ linecount: '1'
2055
+ }, {
2056
+ host: 'jbreeden-mbpr15',
2057
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2058
+ sourcetype: 'splunkd',
2059
+ splunk_server: 'jbreeden-mbpr15',
2060
+ index: '_internal',
2061
+ _raw: {
2062
+ value: '04-02-2018 16:33:49.690 -0700 INFO Metrics - group=queue, name=stashparsing, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2063
+ },
2064
+ _time: '2018-04-02T16:33:49.690-07:00',
2065
+ linecount: '1'
2066
+ }, {
2067
+ host: 'jbreeden-mbpr15',
2068
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2069
+ sourcetype: 'splunkd',
2070
+ splunk_server: 'jbreeden-mbpr15',
2071
+ index: '_internal',
2072
+ _raw: {
2073
+ value: '04-02-2018 16:33:49.690 -0700 INFO Metrics - group=queue, name=splunktcpin, max_size_kb=0, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2074
+ },
2075
+ _time: '2018-04-02T16:33:49.690-07:00',
2076
+ linecount: '1'
2077
+ }, {
2078
+ host: 'jbreeden-mbpr15',
2079
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2080
+ sourcetype: 'splunkd',
2081
+ splunk_server: 'jbreeden-mbpr15',
2082
+ index: '_internal',
2083
+ _raw: {
2084
+ value: '04-02-2018 16:33:49.689 -0700 INFO Metrics - group=queue, name=parsingqueue, max_size_kb=6144, current_size_kb=0, current_size=0, largest_size=2, smallest_size=0'
2085
+ },
2086
+ _time: '2018-04-02T16:33:49.689-07:00',
2087
+ linecount: '1'
2088
+ }, {
2089
+ host: 'jbreeden-mbpr15',
2090
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2091
+ sourcetype: 'splunkd',
2092
+ splunk_server: 'jbreeden-mbpr15',
2093
+ index: '_internal',
2094
+ _raw: {
2095
+ value: '04-02-2018 16:33:49.689 -0700 INFO Metrics - group=queue, name=nullqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=1, smallest_size=0'
2096
+ },
2097
+ _time: '2018-04-02T16:33:49.689-07:00',
2098
+ linecount: '1'
2099
+ }, {
2100
+ host: 'jbreeden-mbpr15',
2101
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2102
+ sourcetype: 'splunkd',
2103
+ splunk_server: 'jbreeden-mbpr15',
2104
+ index: '_internal',
2105
+ _raw: {
2106
+ value: '04-02-2018 16:33:49.689 -0700 INFO Metrics - group=queue, name=indexqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=74, smallest_size=0'
2107
+ },
2108
+ _time: '2018-04-02T16:33:49.689-07:00',
2109
+ linecount: '1'
2110
+ }, {
2111
+ host: 'jbreeden-mbpr15',
2112
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2113
+ sourcetype: 'splunkd',
2114
+ splunk_server: 'jbreeden-mbpr15',
2115
+ index: '_internal',
2116
+ _raw: {
2117
+ value: '04-02-2018 16:33:49.689 -0700 INFO Metrics - group=queue, name=httpinputq, max_size_kb=0, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2118
+ },
2119
+ _time: '2018-04-02T16:33:49.689-07:00',
2120
+ linecount: '1'
2121
+ }, {
2122
+ host: 'jbreeden-mbpr15',
2123
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2124
+ sourcetype: 'splunkd',
2125
+ splunk_server: 'jbreeden-mbpr15',
2126
+ index: '_internal',
2127
+ _raw: {
2128
+ value: '04-02-2018 16:33:49.688 -0700 INFO Metrics - group=queue, name=fschangemanager_queue, max_size_kb=5120, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2129
+ },
2130
+ _time: '2018-04-02T16:33:49.688-07:00',
2131
+ linecount: '1'
2132
+ }, {
2133
+ host: 'jbreeden-mbpr15',
2134
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2135
+ sourcetype: 'splunkd',
2136
+ splunk_server: 'jbreeden-mbpr15',
2137
+ index: '_internal',
2138
+ _raw: {
2139
+ value: '04-02-2018 16:33:49.688 -0700 INFO Metrics - group=queue, name=fifointernalq, max_size_kb=0, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2140
+ },
2141
+ _time: '2018-04-02T16:33:49.688-07:00',
2142
+ linecount: '1'
2143
+ }, {
2144
+ host: 'jbreeden-mbpr15',
2145
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2146
+ sourcetype: 'splunkd',
2147
+ splunk_server: 'jbreeden-mbpr15',
2148
+ index: '_internal',
2149
+ _raw: {
2150
+ value: '04-02-2018 16:33:49.688 -0700 INFO Metrics - group=queue, name=execprocessorinternalq, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2151
+ },
2152
+ _time: '2018-04-02T16:33:49.688-07:00',
2153
+ linecount: '1'
2154
+ }, {
2155
+ host: 'jbreeden-mbpr15',
2156
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2157
+ sourcetype: 'splunkd',
2158
+ splunk_server: 'jbreeden-mbpr15',
2159
+ index: '_internal',
2160
+ _raw: {
2161
+ value: '04-02-2018 16:33:49.688 -0700 INFO Metrics - group=queue, name=auditqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=1, smallest_size=0',
2162
+ trunc: false
2163
+ },
2164
+ _time: '2018-04-02T16:33:49.688-07:00',
2165
+ linecount: '1'
2166
+ }, {
2167
+ host: 'jbreeden-mbpr15',
2168
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2169
+ sourcetype: 'splunkd',
2170
+ splunk_server: 'jbreeden-mbpr15',
2171
+ index: '_internal',
2172
+ _raw: {
2173
+ value: '04-02-2018 16:33:49.687 -0700 INFO Metrics - group=queue, name=aggqueue, max_size_kb=1024, current_size_kb=0, current_size=0, largest_size=81, smallest_size=0'
2174
+ },
2175
+ _time: '2018-04-02T16:33:49.687-07:00',
2176
+ linecount: '1'
2177
+ }, {
2178
+ host: 'jbreeden-mbpr15',
2179
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2180
+ sourcetype: 'splunkd',
2181
+ splunk_server: 'jbreeden-mbpr15',
2182
+ index: '_internal',
2183
+ _raw: {
2184
+ value: '04-02-2018 16:33:49.687 -0700 INFO Metrics - group=queue, name=udp_queue, max_size_kb=0, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2185
+ },
2186
+ _time: '2018-04-02T16:33:49.687-07:00',
2187
+ linecount: '1'
2188
+ }, {
2189
+ host: 'jbreeden-mbpr15',
2190
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2191
+ sourcetype: 'splunkd',
2192
+ splunk_server: 'jbreeden-mbpr15',
2193
+ index: '_internal',
2194
+ _raw: {
2195
+ value: '04-02-2018 16:33:49.687 -0700 INFO Metrics - group=queue, name=aq, max_size_kb=10240, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2196
+ },
2197
+ _time: '2018-04-02T16:33:49.687-07:00',
2198
+ linecount: '1'
2199
+ }, {
2200
+ host: 'jbreeden-mbpr15',
2201
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2202
+ sourcetype: 'splunkd',
2203
+ splunk_server: 'jbreeden-mbpr15',
2204
+ index: '_internal',
2205
+ _raw: {
2206
+ value: '04-02-2018 16:33:49.687 -0700 INFO Metrics - group=queue, name=aeq, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0'
2207
+ },
2208
+ _time: '2018-04-02T16:33:49.687-07:00',
2209
+ linecount: '1'
2210
+ }, {
2211
+ host: 'jbreeden-mbpr15',
2212
+ source: '/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log',
2213
+ sourcetype: 'splunkd',
2214
+ splunk_server: 'jbreeden-mbpr15',
2215
+ index: '_internal',
2216
+ _raw: {
2217
+ value: '04-02-2018 16:33:49.687 -0700 INFO Metrics - group=per_sourcetype_thruput, series="splunkd_ui_access", kbps=0.07254104896811675, eps=0.5160714486728722, kb=2.2490234375, ev=16, avg_age=0.125, max_age=1'
2218
+ },
2219
+ _time: '2018-04-02T16:33:49.687-07:00',
2220
+ linecount: '1'
2221
+ }],
2222
+ highlighted: {
2223
+ index: {
2224
+ _internal: true
2225
+ }
2226
+ }
2227
+ }; // Datasource utilized in example on @splunk/react-events-viewer docs
2228
+
2229
+ var originalDataSourceData = _splunk_datasource_utils_DataSet__WEBPACK_IMPORTED_MODULE_0___default.a.fromJSONArray(rawEventPayload.fields, rawEventPayload.results); // Replaces _raw object with the value of the `value` key - this is the string expected in Dashboard Studio payload
2230
+
2231
+ originalDataSourceData.columns[5] = originalDataSourceData.columns[5].map(function (_raw) {
2232
+ return _raw.value;
2233
+ }); // Exports payload with expected shape of Dashboard Studio payload - fields as an array of strings, and columns
2234
+ // as arrays of data primitives like strings and numbers
2235
+ // Component works with either [{ name: `field` }, ...] or [`field`,...] format - leaving as array as objects as
2236
+ // expected in Dashboard Studio payload
2237
+
2238
+ var dataSourceData = {
2239
+ fields: rawEventPayload.fields,
2240
+ columns: originalDataSourceData.columns
2241
+ };
2242
+ var EMPTY_DATASOURCE = {
2243
+ primary: {
2244
+ requestParams: {
2245
+ offset: 0,
2246
+ count: 0
2247
+ },
2248
+ data: {
2249
+ fields: [],
2250
+ columns: []
2251
+ },
2252
+ meta: {
2253
+ totalCount: 0
2254
+ }
2255
+ }
2256
+ };
2257
+ var FIELDSUMMARY_DS_STORYBOOK = {
2258
+ requestParams: {},
2259
+ data: {
2260
+ fields: [{
2261
+ name: 'field'
2262
+ }, {
2263
+ name: 'count'
2264
+ }, {
2265
+ name: 'distinct_count'
2266
+ }, {
2267
+ name: 'is_exact'
2268
+ }, {
2269
+ name: 'max'
2270
+ }, {
2271
+ name: 'mean'
2272
+ }, {
2273
+ name: 'min'
2274
+ }, {
2275
+ name: 'numeric_count'
2276
+ }, {
2277
+ name: 'stdev'
2278
+ }, {
2279
+ name: 'values'
2280
+ }],
2281
+ columns: [['host', 'index', 'linecount', 'source', 'sourcetype', 'splunk_server'], ['29', '29', '29', '29', '29', '29'], ['1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1'], [null, null, '1', null, null, null], [null, null, '1', null, null, null], [null, null, '1', null, null, null], ['0', '0', '5', '0', '0', '0'], [null, null, '0', null, null, null], ['[{"value":"jbreeden-mbpr15","count":29}]', '[{"value":"_internal","count":29}]', '[{"value":"1","count":29}]', '[{"value":"/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log","count":29}]', '[{"value":"splunkd","count":29}]', '[{"value":"jbreeden-mbpr15","count":29}]']]
2282
+ },
2283
+ meta: {
2284
+ totalCount: 6
2285
+ }
2286
+ };
2287
+ var FIELDSUMMARY_DS_DOC_HUB = {
2288
+ requestParams: {},
2289
+ data: {
2290
+ fields: [{
2291
+ name: 'field'
2292
+ }, {
2293
+ name: 'count'
2294
+ }, {
2295
+ name: 'distinct_count'
2296
+ }, {
2297
+ name: 'is_exact'
2298
+ }, {
2299
+ name: 'max'
2300
+ }, {
2301
+ name: 'mean'
2302
+ }, {
2303
+ name: 'min'
2304
+ }, {
2305
+ name: 'numeric_count'
2306
+ }, {
2307
+ name: 'stdev'
2308
+ }, {
2309
+ name: 'values'
2310
+ }],
2311
+ columns: [['host', 'index', 'linecount', 'source', 'sourcetype', 'splunk_server'], ['5', '5', '5', '5', '5', '5'], ['1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1'], [null, null, '1', null, null, null], [null, null, '1', null, null, null], [null, null, '1', null, null, null], ['0', '0', '5', '0', '0', '0'], [null, null, '0', null, null, null], ['[{"value":"jbreeden-mbpr15","count":5}]', '[{"value":"_internal","count":5}]', '[{"value":"1","count":5}]', '[{"value":"/Users/jbreeden/splunk/releases-builds/splunk-nightlight/splunk/var/log/splunk/metrics.log","count":5}]', '[{"value":"splunkd","count":5}]', '[{"value":"jbreeden-mbpr15","count":5}]']]
2312
+ },
2313
+ meta: {
2314
+ totalCount: 6
2315
+ }
2316
+ };
2317
+
2318
+ /***/ }),
2319
+ /* 134 */
2320
+ /***/ (function(module, exports) {
2321
+
2322
+ module.exports = require("@splunk/visualization-context/EventsContext");
2323
+
2324
+ /***/ }),
2325
+ /* 135 */,
2326
+ /* 136 */,
2327
+ /* 137 */,
2328
+ /* 138 */,
2329
+ /* 139 */,
2330
+ /* 140 */,
2331
+ /* 141 */,
2332
+ /* 142 */,
2333
+ /* 143 */,
2334
+ /* 144 */,
2335
+ /* 145 */,
2336
+ /* 146 */,
2337
+ /* 147 */,
2338
+ /* 148 */,
2339
+ /* 149 */,
2340
+ /* 150 */,
2341
+ /* 151 */,
2342
+ /* 152 */
2343
+ /***/ (function(module, exports) {
2344
+
2345
+ module.exports = require("@splunk/datasource-utils/DataSet");
2346
+
2347
+ /***/ }),
2348
+ /* 153 */,
2349
+ /* 154 */,
2350
+ /* 155 */,
2351
+ /* 156 */,
2352
+ /* 157 */,
2353
+ /* 158 */,
2354
+ /* 159 */,
2355
+ /* 160 */,
2356
+ /* 161 */,
2357
+ /* 162 */,
2358
+ /* 163 */,
2359
+ /* 164 */,
2360
+ /* 165 */,
2361
+ /* 166 */,
2362
+ /* 167 */,
2363
+ /* 168 */,
2364
+ /* 169 */,
2365
+ /* 170 */,
2366
+ /* 171 */,
2367
+ /* 172 */,
2368
+ /* 173 */,
2369
+ /* 174 */,
2370
+ /* 175 */,
2371
+ /* 176 */,
2372
+ /* 177 */,
2373
+ /* 178 */,
2374
+ /* 179 */,
2375
+ /* 180 */,
2376
+ /* 181 */,
2377
+ /* 182 */,
2378
+ /* 183 */
2379
+ /***/ (function(module, exports, __webpack_require__) {
2380
+
2381
+ "use strict";
2382
+
2383
+
2384
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
2385
+ if (k2 === undefined) k2 = k;
2386
+ Object.defineProperty(o, k2, {
2387
+ enumerable: true,
2388
+ get: function get() {
2389
+ return m[k];
2390
+ }
2391
+ });
2392
+ } : function (o, m, k, k2) {
2393
+ if (k2 === undefined) k2 = k;
2394
+ o[k2] = m[k];
2395
+ });
2396
+
2397
+ var __exportStar = this && this.__exportStar || function (m, exports) {
2398
+ for (var p in m) {
2399
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2400
+ }
2401
+ };
2402
+
2403
+ Object.defineProperty(exports, "__esModule", {
2404
+ value: true
2405
+ });
2406
+ exports.default = void 0;
2407
+
2408
+ __exportStar(__webpack_require__(132), exports);
2409
+
2410
+ var Events_1 = __webpack_require__(132);
2411
+
2412
+ Object.defineProperty(exports, "default", {
2413
+ enumerable: true,
2414
+ get: function get() {
2415
+ return Events_1.default;
2416
+ }
2417
+ });
2418
+
2419
+ /***/ }),
2420
+ /* 184 */
2421
+ /***/ (function(module, exports, __webpack_require__) {
2422
+
2423
+ "use strict";
2424
+
2425
+
2426
+ Object.defineProperty(exports, "__esModule", {
2427
+ value: true
2428
+ });
2429
+
2430
+ var visualization_icons_1 = __webpack_require__(47);
2431
+
2432
+ var placeholders_1 = __webpack_require__(44);
2433
+
2434
+ var schemaUtils_1 = __webpack_require__(16);
2435
+
2436
+ var themes_1 = __webpack_require__(69);
2437
+
2438
+ var i18n_1 = __webpack_require__(2);
2439
+
2440
+ var VizBehavior_1 = __webpack_require__(6);
2441
+
2442
+ var VizCategory_1 = __webpack_require__(31);
2443
+
2444
+ var configUtils_1 = __webpack_require__(17);
2445
+
2446
+ var BackgroundColor_1 = __webpack_require__(50);
2447
+
2448
+ var defaultContext = {};
2449
+ var dataContract = {
2450
+ requiredDataSources: [{
2451
+ name: 'primary',
2452
+ description: 'DataSource that powers the visualization'
2453
+ }],
2454
+ optionalDataSources: [{
2455
+ name: 'fieldsummary',
2456
+ description: 'DataSource that powers the field summary popover on field click'
2457
+ }],
2458
+ initialRequestParams: {
2459
+ primary: function primary() {
2460
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2461
+ return {
2462
+ offset: 0,
2463
+ count: options.count ? options.count : 10,
2464
+ requestTotalCount: true
2465
+ };
2466
+ }
2467
+ }
2468
+ };
2469
+ var size = {
2470
+ initialWidth: 800,
2471
+ initialHeight: 500
2472
+ };
2473
+ var optionsSchema = {
2474
+ backgroundColor: {
2475
+ default: '> themes.defaultBackgroundColor',
2476
+ description: 'Specify the color used for the background by using a hexadecimal code. For example, #0000FF.',
2477
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2478
+ type: 'string'
2479
+ },
2480
+ eventActions: {
2481
+ default: [],
2482
+ description: 'Specify the available actions to take for an event. For example, `[{ "eventType": "eventAction.buildEventType.click, "label": "Build Event Type" }]`. Event types should end in `.click` if utilizing event handlers.',
2483
+ type: 'array',
2484
+ items: {
2485
+ type: 'object',
2486
+ properties: {
2487
+ eventType: {
2488
+ description: 'The distinct type for the event emitted upon event action click.',
2489
+ type: 'string',
2490
+ pattern: '.click$',
2491
+ default: ''
2492
+ },
2493
+ label: {
2494
+ description: 'The label for the event action.',
2495
+ type: 'string',
2496
+ default: ''
2497
+ }
2498
+ },
2499
+ required: ['eventType', 'label']
2500
+ }
2501
+ },
2502
+ fieldActions: {
2503
+ description: 'Specify the available actions for this field. For example, `{ default: [{ "eventType": "fieldAction.sharedAction1.click, "label": "Shared Action 1" }] }`. Event types should end in `.click` if utilizing event handlers. Actions under the `default` key are shared across all field dropdowns.',
2504
+ type: 'object'
2505
+ },
2506
+ showFieldSummary: {
2507
+ description: 'Specify that a field summary popup appears when a field is selected. To show field summaries for a search, configure an additional datasource called `fieldsummary` using the original search followed by the `... | fieldsummary maxvals=10` SPL command.',
2508
+ type: 'boolean',
2509
+ default: true
2510
+ },
2511
+ footerFields: {
2512
+ description: 'Specify field(s) that should be displayed in the footer component. Specify one or more fields to display in the footer component. For example, specify ["source", "dest"] to display the source and destination fields.',
2513
+ type: 'array',
2514
+ items: {
2515
+ type: 'string'
2516
+ },
2517
+ default: []
2518
+ } // footerFieldsHighlighted: {
2519
+ // description: 'Specify values to be highlighted in the footer component',
2520
+ // type: 'array',
2521
+ // items: {
2522
+ // type: 'string',
2523
+ // },
2524
+ // default: [],
2525
+ // },
2526
+
2527
+ };
2528
+ var themes = {
2529
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
2530
+ return themes_1.pick({
2531
+ enterprise: {
2532
+ dark: themes_1.variables.black(props),
2533
+ light: themes_1.variables.backgroundColor(props)
2534
+ },
2535
+ prisma: themes_1.variables.backgroundColorSidebar(props)
2536
+ })(props);
2537
+ }
2538
+ };
2539
+ var editorConfig = [{
2540
+ label: i18n_1._('Color and style'),
2541
+ layout: [BackgroundColor_1.default({
2542
+ themes: themes
2543
+ })]
2544
+ }, {
2545
+ label: i18n_1._('Data display'),
2546
+ layout: [[{
2547
+ label: i18n_1._('Show field summary'),
2548
+ option: 'showFieldSummary',
2549
+ editor: 'editor.checkbox',
2550
+ editorProps: {
2551
+ labelPosition: 'right'
2552
+ }
2553
+ }]]
2554
+ }];
2555
+ /**
2556
+ * visualization configuration
2557
+ */
2558
+
2559
+ var config = {
2560
+ /**
2561
+ * unique viz key
2562
+ */
2563
+ key: 'splunk.events',
2564
+
2565
+ /**
2566
+ * viz name
2567
+ */
2568
+ name: 'Events',
2569
+ category: VizCategory_1.VizCategory.TABLE,
2570
+ status: 'preview',
2571
+
2572
+ /**
2573
+ * viz icon
2574
+ */
2575
+ icon: visualization_icons_1.Events,
2576
+ placeholderIcon: placeholders_1.Events,
2577
+ dataContract: dataContract,
2578
+ size: size,
2579
+ defaultContext: defaultContext,
2580
+ optionsSchema: optionsSchema,
2581
+ editorConfig: editorConfig,
2582
+ events: {
2583
+ 'eventAction.<actionName>.click': {
2584
+ description: 'Triggered when a user selects the Event Actions button within an event. An application developer can configure workflow action retrieval and event handling, as described in the Concepts tab.'
2585
+ },
2586
+ 'fieldAction.<actionName>.click': {
2587
+ description: 'Triggered when a user selects an arrow under the Actions column heading. Application developers can configure workflow action retrieval and event handling. For more information, see the Concepts tab.'
2588
+ },
2589
+ 'events.search.<fieldSummaryReportActionName>': {
2590
+ description: 'Triggered when a user selects a report action in the field summary of an event. Application developers must pass context and handle events in their applications. For more information, see the Concepts tab.'
2591
+ }
2592
+ },
2593
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
2594
+ themes: themes,
2595
+ requiredProps: []
2596
+ };
2597
+ exports.default = configUtils_1.enhanceConfig(config);
2598
+
2599
+ /***/ }),
2600
+ /* 185 */
2601
+ /***/ (function(module, exports, __webpack_require__) {
2602
+
2603
+ "use strict";
2604
+
2605
+
2606
+ var _typeof = __webpack_require__(82);
2607
+
2608
+ var _slicedToArray = __webpack_require__(51);
2609
+
2610
+ Object.defineProperty(exports, "__esModule", {
2611
+ value: true
2612
+ });
2613
+
2614
+ var React = __webpack_require__(1);
2615
+
2616
+ var react_1 = __webpack_require__(1);
2617
+
2618
+ var T = __webpack_require__(0);
2619
+
2620
+ var EventsViewer_1 = __webpack_require__(186);
2621
+
2622
+ var styled_components_1 = __webpack_require__(4);
2623
+
2624
+ var pick_1 = __webpack_require__(21);
2625
+
2626
+ var variables_1 = __webpack_require__(9);
2627
+
2628
+ var colorUtils_1 = __webpack_require__(12);
2629
+
2630
+ var style_1 = __webpack_require__(15);
2631
+
2632
+ var EventsContext_1 = __webpack_require__(134);
2633
+
2634
+ var lodash_1 = __webpack_require__(3);
2635
+
2636
+ var Menu_1 = __webpack_require__(107);
2637
+
2638
+ var constants_1 = __webpack_require__(133);
2639
+
2640
+ var FixedSizeContainer_1 = __webpack_require__(13);
2641
+
2642
+ var EventUtils_1 = __webpack_require__(187);
2643
+
2644
+ var FieldSummaryTooltip_1 = __webpack_require__(188); // Inspired by VizTableContainer in PureTable.tsx
2645
+
2646
+
2647
+ var EventsContainer = styled_components_1.default.div.withConfig({
2648
+ displayName: "PureEvents__EventsContainer",
2649
+ componentId: "iniqvm-0"
2650
+ })(["width:", ";height:", ";box-sizing:border-box;padding:", ";display:flex;flex-flow:column nowrap;overflow:hidden;background-color:", ";table[data-test='main-table']{background-color:", ";}"], function (props) {
2651
+ return lodash_1.isNumber(props.width) ? "".concat(props.width, "px") : props.width;
2652
+ }, function (props) {
2653
+ return lodash_1.isNumber(props.height) ? "".concat(props.height, "px") : props.height;
2654
+ }, pick_1.default({
2655
+ enterprise: variables_1.default.spacingHalf,
2656
+ prisma: variables_1.default.spacingSmall
2657
+ }), function (props) {
2658
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
2659
+ }, pick_1.default({
2660
+ enterprise: variables_1.default.backgroundColorPage,
2661
+ prisma: variables_1.default.backgroundColorPage
2662
+ })); // Inspired by SUITableContainer in PureTable.tsx
2663
+
2664
+ var SUIEventsViewerContainer = styled_components_1.default.div.withConfig({
2665
+ displayName: "PureEvents__SUIEventsViewerContainer",
2666
+ componentId: "iniqvm-1"
2667
+ })(["box-sizing:border-box;flex-grow:1;overflow:hidden;", ";"], function (_ref) {
2668
+ var width = _ref.width,
2669
+ height = _ref.height,
2670
+ theme = _ref.theme;
2671
+ var padding = pick_1.default({
2672
+ enterprise: variables_1.default.spacingHalf({
2673
+ theme: theme
2674
+ }),
2675
+ prisma: variables_1.default.spacingSmall({
2676
+ theme: theme
2677
+ })
2678
+ })({
2679
+ theme: theme
2680
+ });
2681
+ var paddingOffset = parseInt(padding, 10) * 2;
2682
+ return style_1.toDimension({
2683
+ width: width - paddingOffset,
2684
+ height: height - paddingOffset
2685
+ });
2686
+ }); // Effectively the pure visualization component for Events, passing through the necessary state and callbacks.
2687
+
2688
+ var PureEvents = function PureEvents(props) {
2689
+ var width = props.width,
2690
+ height = props.height,
2691
+ backgroundColor = props.backgroundColor,
2692
+ dataSources = props.dataSources,
2693
+ eventActionsProps = props.eventActions,
2694
+ fieldActionsProps = props.fieldActions,
2695
+ showFieldSummary = props.showFieldSummary,
2696
+ footerFields = props.footerFields,
2697
+ onOptionsChange = props.onOptionsChange,
2698
+ onRequestParamsChange = props.onRequestParamsChange,
2699
+ onEventTrigger = props.onEventTrigger;
2700
+ var fieldSummaryMap = React.useMemo(function () {
2701
+ var _a, _b, _c, _d; // if the `fieldsummary` datasource isn't configured, no field summary can be shown
2702
+
2703
+
2704
+ if (!showFieldSummary || !lodash_1.get(dataSources, 'fieldsummary')) {
2705
+ return {};
2706
+ }
2707
+
2708
+ try {
2709
+ var fieldSummaryMapping = EventUtils_1.getFieldSummaryMapping((_b = (_a = dataSources.fieldsummary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.columns, (_d = (_c = dataSources.fieldsummary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.fields);
2710
+ return fieldSummaryMapping;
2711
+ } catch (e) {
2712
+ console.error("Unexpected error parsing fieldsummary datasource: + ".concat(e.message));
2713
+ return {};
2714
+ }
2715
+ }, [dataSources, showFieldSummary]);
2716
+
2717
+ var _react_1$useContext = react_1.useContext(EventsContext_1.default),
2718
+ _react_1$useContext$e = _react_1$useContext.eventActions,
2719
+ eventActionsContext = _react_1$useContext$e === void 0 ? [] : _react_1$useContext$e,
2720
+ _react_1$useContext$f = _react_1$useContext.fieldActions,
2721
+ fieldActionsContext = _react_1$useContext$f === void 0 ? {} : _react_1$useContext$f;
2722
+
2723
+ var eventActions = EventUtils_1.mergeEventActions(eventActionsProps, eventActionsContext);
2724
+ var fieldActions = EventUtils_1.mergeFieldActions(fieldActionsProps, fieldActionsContext);
2725
+
2726
+ var _React$useState = React.useState(null),
2727
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2728
+ fieldSummaryField = _React$useState2[0],
2729
+ setFieldSummaryField = _React$useState2[1];
2730
+
2731
+ var _React$useState3 = React.useState(null),
2732
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2733
+ fieldSummaryAnchor = _React$useState4[0],
2734
+ setFieldSummaryAnchor = _React$useState4[1]; // creates array menu components to display in the Event Actions dropdown
2735
+
2736
+
2737
+ var renderEventActions = React.useMemo(function () {
2738
+ return !Array.isArray(eventActions) || eventActions.length === 0 ? null : eventActions.map(function (_ref2) {
2739
+ var eventType = _ref2.eventType,
2740
+ label = _ref2.label;
2741
+
2742
+ var onMenuItemClick = function onMenuItemClick(e) {
2743
+ var payload = EventUtils_1.convertToPayloadFormat(e.event);
2744
+ onEventTrigger({
2745
+ originalEvent: e,
2746
+ type: eventType,
2747
+ payload: payload
2748
+ });
2749
+ }; // eslint-disable-next-line react/display-name
2750
+
2751
+
2752
+ return function (event) {
2753
+ return React.createElement(Menu_1.default.Item, {
2754
+ key: "event-action-".concat(label),
2755
+ onClick: function onClick() {
2756
+ return onMenuItemClick(event);
2757
+ }
2758
+ }, label);
2759
+ };
2760
+ });
2761
+ }, [eventActions]); // creates map of field names to array of menu components to display in its respective dropdown
2762
+ // in the Actions column
2763
+
2764
+ var renderFieldActions = React.useMemo(function () {
2765
+ // undefined hides the Actions column, per logic in SUI EventsViewer
2766
+ if (_typeof(fieldActions) !== 'object' || Object.keys(fieldActions).length === 0) return undefined;
2767
+ var fieldActionsMap = Object.keys(fieldActions).reduce(function (currFieldActionsMap, fieldName) {
2768
+ // eslint-disable-next-line no-param-reassign
2769
+ currFieldActionsMap[fieldName] = fieldActions[fieldName].map(function (_ref3) {
2770
+ var eventType = _ref3.eventType,
2771
+ label = _ref3.label;
2772
+
2773
+ var onMenuItemClick = function onMenuItemClick(e) {
2774
+ var payload = EventUtils_1.convertToPayloadFormat(e.event, {
2775
+ name: e.field,
2776
+ value: e.value
2777
+ });
2778
+ onEventTrigger({
2779
+ originalEvent: e,
2780
+ type: eventType,
2781
+ payload: payload
2782
+ });
2783
+ }; // eslint-disable-next-line react/display-name
2784
+
2785
+
2786
+ return function (event) {
2787
+ return React.createElement(Menu_1.default.Item, {
2788
+ key: "".concat(fieldName, "-field-action-").concat(label),
2789
+ onClick: function onClick() {
2790
+ return onMenuItemClick(event);
2791
+ }
2792
+ }, label);
2793
+ };
2794
+ });
2795
+ return currFieldActionsMap;
2796
+ }, {});
2797
+ return fieldActionsMap;
2798
+ }, [fieldActions]); // formulate the options object required by the SUI EventsViewer component
2799
+
2800
+ var suiEventsViewerOptions = {
2801
+ renderEventActions: renderEventActions,
2802
+ renderFieldActions: renderFieldActions,
2803
+ footerFields: footerFields
2804
+ };
2805
+
2806
+ var handleFieldClicked = showFieldSummary && function (e, _ref4) {
2807
+ var field = _ref4.field;
2808
+ setFieldSummaryField(field);
2809
+ setFieldSummaryAnchor(e.currentTarget.parentElement);
2810
+ };
2811
+
2812
+ var handleActionClicked = function handleActionClicked(event, data) {
2813
+ var actionType = data.action,
2814
+ field = data.field;
2815
+ onEventTrigger({
2816
+ originalEvent: event,
2817
+ type: "events.search.".concat(actionType),
2818
+ payload: {
2819
+ field: field
2820
+ }
2821
+ });
2822
+ };
2823
+
2824
+ return React.createElement(EventsContainer, {
2825
+ backgroundColor: backgroundColor,
2826
+ width: width,
2827
+ height: height
2828
+ }, React.createElement(SUIEventsViewerContainer, {
2829
+ width: width,
2830
+ height: height
2831
+ }, React.createElement(EventsViewer_1.default, {
2832
+ options: suiEventsViewerOptions,
2833
+ onOptionsChange: onOptionsChange,
2834
+ dataSources: dataSources,
2835
+ onRequestParamsChange: onRequestParamsChange,
2836
+ onFieldClicked: handleFieldClicked
2837
+ }), React.createElement(FieldSummaryTooltip_1.default, {
2838
+ open: !!fieldSummaryAnchor && !!fieldSummaryField,
2839
+ anchor: fieldSummaryAnchor,
2840
+ handleTooltipClose: function handleTooltipClose() {
2841
+ setFieldSummaryField(null);
2842
+ setFieldSummaryAnchor(null);
2843
+ },
2844
+ fieldName: fieldSummaryField,
2845
+ fieldSummaryMap: fieldSummaryMap,
2846
+ onActionClicked: handleActionClicked
2847
+ })));
2848
+ };
2849
+
2850
+ PureEvents.propTypes = {
2851
+ width: T.oneOfType([T.string, T.number]),
2852
+ height: T.oneOfType([T.string, T.number]),
2853
+ // need this to satisfy props interface
2854
+ // eslint-disable-next-line react/no-unused-prop-types
2855
+ mode: T.string,
2856
+ backgroundColor: T.string,
2857
+ eventActions: T.arrayOf(T.shape({
2858
+ // key to identify this event
2859
+ eventType: T.string,
2860
+ // label for the menu item
2861
+ label: T.string
2862
+ })),
2863
+ fieldActions: T.objectOf(T.arrayOf(T.shape({
2864
+ // key to identify this event
2865
+ eventType: T.string,
2866
+ // label for the menu item
2867
+ label: T.string
2868
+ }))),
2869
+ showFieldSummary: T.bool,
2870
+ footerFields: T.array,
2871
+ // footerFieldsHighlighted: T.array,
2872
+ onOptionsChange: T.func,
2873
+ dataSources: T.any,
2874
+ onRequestParamsChange: T.func,
2875
+ onEventTrigger: T.func
2876
+ };
2877
+ PureEvents.defaultProps = {
2878
+ width: 800,
2879
+ height: 500,
2880
+ mode: 'view',
2881
+ eventActions: [],
2882
+ fieldActions: {},
2883
+ dataSources: constants_1.EMPTY_DATASOURCE,
2884
+ showFieldSummary: true,
2885
+ footerFields: [],
2886
+ // footerFieldsHighlighted: [],
2887
+ onOptionsChange: lodash_1.noop,
2888
+ onRequestParamsChange: lodash_1.noop,
2889
+ onEventTrigger: lodash_1.noop
2890
+ };
2891
+ exports.default = FixedSizeContainer_1.default(PureEvents);
2892
+
2893
+ /***/ }),
2894
+ /* 186 */
2895
+ /***/ (function(module, exports) {
2896
+
2897
+ module.exports = require("@splunk/react-events-viewer/components/EventsViewer");
2898
+
2899
+ /***/ }),
2900
+ /* 187 */
2901
+ /***/ (function(module, exports, __webpack_require__) {
2902
+
2903
+ "use strict";
2904
+
2905
+
2906
+ var _defineProperty = __webpack_require__(7);
2907
+
2908
+ Object.defineProperty(exports, "__esModule", {
2909
+ value: true
2910
+ });
2911
+ exports.mergeFieldActions = exports.mergeEventActions = exports.getFieldSummaryMapping = exports.convertToPayloadFormat = void 0;
2912
+
2913
+ var lodash_1 = __webpack_require__(3);
2914
+
2915
+ var dataUtils_1 = __webpack_require__(108); // util to convert a field-value map into an object with row.<fieldname>.value keys for payloads
2916
+
2917
+
2918
+ var convertToPayloadFormat = function convertToPayloadFormat(obj) {
2919
+ var initialValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2920
+ if (!obj) return {};
2921
+ return Object.keys(obj).reduce(function (acc, curr) {
2922
+ var key = "row.".concat(curr, ".value");
2923
+ return Object.assign(Object.assign({}, acc), _defineProperty({}, key, obj[curr]));
2924
+ }, initialValue);
2925
+ };
2926
+
2927
+ exports.convertToPayloadFormat = convertToPayloadFormat;
2928
+
2929
+ var getFieldSummaryMapping = function getFieldSummaryMapping(columns, fields) {
2930
+ // convert the `fieldsummary` payload to an array of objects
2931
+ var arr = dataUtils_1.convertToArrOfObjects(columns, fields); // forms an array of FieldData elements expected by the @splunk/react-field-summary component
2932
+
2933
+ var fieldSummaryData = arr.map(function (d) {
2934
+ return {
2935
+ name: d.field,
2936
+ count: +d.count,
2937
+ distinctCount: +d.distinct_count,
2938
+ numericCount: +d.numeric_count,
2939
+ max: d.max === null ? null : +d.max,
2940
+ mean: d.mean === null ? null : +d.mean,
2941
+ min: d.min === null ? null : +d.min,
2942
+ stdev: d.stdev === null ? null : +d.stdev,
2943
+ modes: JSON.parse(d.values)
2944
+ };
2945
+ }); // creates a map of field name to its data for O(1) retrieval in the tooltip component
2946
+
2947
+ var fieldSummaryMapping = fieldSummaryData.reduce(function (map, fieldData) {
2948
+ return Object.assign(Object.assign({}, map), _defineProperty({}, fieldData.name, fieldData));
2949
+ }, {});
2950
+ return fieldSummaryMapping;
2951
+ };
2952
+
2953
+ exports.getFieldSummaryMapping = getFieldSummaryMapping;
2954
+ /**
2955
+ * Helper to merge event actions into one array of event actions.
2956
+ * @method mergeEventActions
2957
+ * @param {Action[]} fieldActions1
2958
+ * @param {Action[]} fieldActions2
2959
+ * @returns {Action[]} merged event actions
2960
+ */
2961
+
2962
+ var mergeEventActions = function mergeEventActions(eventActions1, eventActions2) {
2963
+ return eventActions1.concat(eventActions2);
2964
+ };
2965
+
2966
+ exports.mergeEventActions = mergeEventActions;
2967
+ /**
2968
+ * Helper to merge field actions. If same key exists in both field actions,
2969
+ * combine each array of actions under one key.
2970
+ * @method mergeFieldActions
2971
+ * @param {Record<string, Action[]>} fieldActions1
2972
+ * @param {Record<string, Action[]>} fieldActions2
2973
+ * @returns {Record<string, Action[]>} merged field actions
2974
+ */
2975
+
2976
+ var mergeFieldActions = function mergeFieldActions(fieldActions1, fieldActions2) {
2977
+ return lodash_1.mergeWith(fieldActions1, fieldActions2, function (fieldAction1value, fieldAction2value) {
2978
+ return Array.isArray(fieldAction1value) && Array.isArray(fieldAction2value) ? lodash_1.union(fieldAction1value, fieldAction2value) : undefined;
2979
+ });
2980
+ };
2981
+
2982
+ exports.mergeFieldActions = mergeFieldActions;
2983
+
2984
+ /***/ }),
2985
+ /* 188 */
2986
+ /***/ (function(module, exports, __webpack_require__) {
2987
+
2988
+ "use strict";
2989
+
2990
+
2991
+ Object.defineProperty(exports, "__esModule", {
2992
+ value: true
2993
+ });
2994
+
2995
+ var React = __webpack_require__(1);
2996
+
2997
+ var react_1 = __webpack_require__(1);
2998
+
2999
+ var Popover_1 = __webpack_require__(83);
3000
+
3001
+ var Markdown_1 = __webpack_require__(109);
3002
+
3003
+ var FieldSummary_1 = __webpack_require__(189);
3004
+
3005
+ var lodash_1 = __webpack_require__(3);
3006
+
3007
+ var i18n_1 = __webpack_require__(2);
3008
+
3009
+ var styled_components_1 = __webpack_require__(4);
3010
+
3011
+ var EventsContext_1 = __webpack_require__(134);
3012
+
3013
+ var popoverContainerStyle = {
3014
+ padding: '20px',
3015
+ width: 500
3016
+ };
3017
+ var StyledMarkdown = styled_components_1.default(Markdown_1.default).withConfig({
3018
+ displayName: "FieldSummaryTooltip__StyledMarkdown",
3019
+ componentId: "sc-1k26kpm-0"
3020
+ })(["p{margin:0;}"]);
3021
+
3022
+ var actionsForField = function actionsForField(field) {
3023
+ var actions = []; // this logic is used in determining whether to display numeric stats in ui-platform (FieldStats.tsx)
3024
+
3025
+ if (typeof field.mean === 'number') {
3026
+ actions.push({
3027
+ name: 'avgByTime',
3028
+ label: i18n_1._('Average over time')
3029
+ });
3030
+ actions.push({
3031
+ name: 'maxByTime',
3032
+ label: i18n_1._('Max value over time')
3033
+ });
3034
+ actions.push({
3035
+ name: 'minByTime',
3036
+ label: i18n_1._('Min value over time')
3037
+ });
3038
+ }
3039
+
3040
+ actions.push({
3041
+ name: 'topValues',
3042
+ label: i18n_1._('Top values')
3043
+ });
3044
+ actions.push({
3045
+ name: 'topValuesByTime',
3046
+ label: i18n_1._('Top values by time')
3047
+ });
3048
+ actions.push({
3049
+ name: 'rareValues',
3050
+ label: i18n_1._('Rare values')
3051
+ });
3052
+ actions.push({
3053
+ name: 'allValues',
3054
+ label: i18n_1._('Events with this field')
3055
+ });
3056
+ return actions;
3057
+ };
3058
+
3059
+ var FieldSummaryTooltip = function FieldSummaryTooltip(props) {
3060
+ var open = props.open,
3061
+ anchor = props.anchor,
3062
+ handleTooltipClose = props.handleTooltipClose,
3063
+ fieldName = props.fieldName,
3064
+ fieldSummaryMap = props.fieldSummaryMap,
3065
+ onActionClicked = props.onActionClicked;
3066
+
3067
+ var _react_1$useContext = react_1.useContext(EventsContext_1.default),
3068
+ isSplunkWebAvailable = _react_1$useContext.isSplunkWebAvailable;
3069
+
3070
+ var getActionsForField = react_1.useCallback(function (field) {
3071
+ return isSplunkWebAvailable ? actionsForField(field) : [];
3072
+ }, [isSplunkWebAvailable]); // if the anchor is null or no field has been clicked, do not render the tooltip
3073
+
3074
+ if (!open) return null; // retrieve the field summary for this field. if there is no field data, show fallback messaging
3075
+
3076
+ var field = fieldSummaryMap[fieldName];
3077
+ var fieldSummaryExists = !!field;
3078
+
3079
+ var fallbackText = i18n_1._("Please configure an additional datasource called `fieldsummary` using the `... | fieldsummary maxvals=10` SPL command for field summaries to be shown.");
3080
+
3081
+ return React.createElement(Popover_1.default, {
3082
+ open: open,
3083
+ defaultPlacement: "below",
3084
+ anchor: anchor,
3085
+ onRequestClose: handleTooltipClose
3086
+ }, React.createElement("div", {
3087
+ style: popoverContainerStyle
3088
+ }, fieldSummaryExists ? React.createElement(FieldSummary_1.default, {
3089
+ eventCount: field.count,
3090
+ field: field,
3091
+ actionsForField: getActionsForField,
3092
+ onActionClicked: onActionClicked
3093
+ }) : React.createElement(StyledMarkdown, {
3094
+ text: fallbackText
3095
+ })));
3096
+ };
3097
+
3098
+ FieldSummaryTooltip.defaultProps = {
3099
+ open: false,
3100
+ anchor: null,
3101
+ fieldName: '',
3102
+ fieldSummaryMap: {},
3103
+ handleTooltipClose: lodash_1.noop,
3104
+ onActionClicked: lodash_1.noop
3105
+ };
3106
+ exports.default = FieldSummaryTooltip;
3107
+
3108
+ /***/ }),
3109
+ /* 189 */
3110
+ /***/ (function(module, exports) {
3111
+
3112
+ module.exports = require("@splunk/react-field-summary/components/FieldSummary");
3113
+
3114
+ /***/ })
3115
+ /******/ ]);
3116
+ //# sourceMappingURL=Events.js.map