@infinilabs/discover 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +8 -0
  3. package/dist/abap-B988NUrV.js +122 -0
  4. package/dist/abap-obercqiY.cjs +1 -0
  5. package/dist/apex-B0_UGK1B.cjs +1 -0
  6. package/dist/apex-BlHPPQK-.js +168 -0
  7. package/dist/azcli-C7iyZFGk.js +53 -0
  8. package/dist/azcli-CEoytwx_.cjs +1 -0
  9. package/dist/bat-Buc0l0C3.js +123 -0
  10. package/dist/bat-D65OC-jj.cjs +1 -0
  11. package/dist/bicep-DvD_e5vW.cjs +2 -0
  12. package/dist/bicep-U66iJ-pV.js +219 -0
  13. package/dist/cameligo-C9Dwkdmm.js +189 -0
  14. package/dist/cameligo-DzMHfeEs.cjs +1 -0
  15. package/dist/chunk-BjqF3vbe.cjs +1 -0
  16. package/dist/chunk-CIp4IH9D.js +21 -0
  17. package/dist/classnames-BXjDNQ6Q.cjs +1 -0
  18. package/dist/classnames-eUba3oot.js +29 -0
  19. package/dist/clojure-BC7BzAFK.cjs +1 -0
  20. package/dist/clojure-DDWmWbSx.js +146 -0
  21. package/dist/coffee-7Sx2S8NH.js +260 -0
  22. package/dist/coffee-Ca9F0OWZ.cjs +1 -0
  23. package/dist/common-BeXEy5sz.cjs +18 -0
  24. package/dist/common-BlOHZJzI.js +64 -0
  25. package/dist/common-DuYIpe6b.cjs +1 -0
  26. package/dist/common-Tr1I-HCs.js +6725 -0
  27. package/dist/cpp-CHjqaSPQ.js +230 -0
  28. package/dist/cpp-DKy9h6xR.cjs +1 -0
  29. package/dist/createLucideIcon-239Z-2by.cjs +1 -0
  30. package/dist/createLucideIcon-BO6TDGE7.js +43 -0
  31. package/dist/csharp-CkbgT9vH.cjs +1 -0
  32. package/dist/csharp-jwStnVeK.js +260 -0
  33. package/dist/csp-C2qFd6iv.cjs +1 -0
  34. package/dist/csp-DkO8Np0h.js +46 -0
  35. package/dist/css-BFvwcljm.js +284 -0
  36. package/dist/css-DCKUCzD6.cjs +3 -0
  37. package/dist/cssMode-CU2AJQMM.js +1509 -0
  38. package/dist/cssMode-l7eR8WSG.cjs +4 -0
  39. package/dist/cypher-122TYSjJ.cjs +1 -0
  40. package/dist/cypher-DaQ7hFRL.js +212 -0
  41. package/dist/dart-D8p_2HKP.js +236 -0
  42. package/dist/dart-DshcPGU8.cjs +1 -0
  43. package/dist/dist-DCz_Qv0B.js +884 -0
  44. package/dist/dist-D_2dZQH5.cjs +11 -0
  45. package/dist/dockerfile-CL8dwZCe.cjs +1 -0
  46. package/dist/dockerfile-DKWOQrwp.js +191 -0
  47. package/dist/ecl-DP3PNWGB.js +226 -0
  48. package/dist/ecl-DVx2J_EE.cjs +1 -0
  49. package/dist/editor.api-CbUDOph7.js +70302 -0
  50. package/dist/editor.api-lY2thcaq.cjs +644 -0
  51. package/dist/elixir-Xgx_1krO.cjs +1 -0
  52. package/dist/elixir-e9tDp1p1.js +523 -0
  53. package/dist/filter_label-DRJC3vpe.js +58 -0
  54. package/dist/filter_label-DssaWGpx.cjs +1 -0
  55. package/dist/filter_operators-C-TaTcNc.js +70 -0
  56. package/dist/filter_operators-D0kyB-XI.cjs +1 -0
  57. package/dist/flow9-C9BjpX8h.js +176 -0
  58. package/dist/flow9-DR-EyjYV.cjs +1 -0
  59. package/dist/freemarker2-BTGUjvgA.cjs +3 -0
  60. package/dist/freemarker2-C6Iq5MB-.js +724 -0
  61. package/dist/fsharp-BWm_FISn.js +147 -0
  62. package/dist/fsharp-DaBEigN7.cjs +1 -0
  63. package/dist/go-Xyq33f0v.cjs +1 -0
  64. package/dist/go-cmqV0Vy_.js +165 -0
  65. package/dist/graphql-BkFHHVmI.js +174 -0
  66. package/dist/graphql-Cj7XAy25.cjs +1 -0
  67. package/dist/handlebars-B2b1q7PA.cjs +1 -0
  68. package/dist/handlebars-DGGN9u4Y.js +418 -0
  69. package/dist/hcl-5I-P7bYX.js +219 -0
  70. package/dist/hcl-C3dpBsgU.cjs +1 -0
  71. package/dist/html-RJa-j-qT.js +339 -0
  72. package/dist/html-qfcUzk8e.cjs +1 -0
  73. package/dist/htmlMode-CYIxo4hc.cjs +4 -0
  74. package/dist/htmlMode-DDZ48mdp.js +1520 -0
  75. package/dist/index.cjs +303 -0
  76. package/dist/index.d.ts +4 -0
  77. package/dist/index.js +72895 -0
  78. package/dist/index_pattern_select--iGeA3sP.js +93 -0
  79. package/dist/index_pattern_select-BeN5049F.cjs +1 -0
  80. package/dist/ini-ChENqKh8.cjs +1 -0
  81. package/dist/ini-DSIAxBZt.js +94 -0
  82. package/dist/java-DGeAxsRb.js +173 -0
  83. package/dist/java-LZ6g7weJ.cjs +1 -0
  84. package/dist/javascript-CN5gTHH2.js +19 -0
  85. package/dist/javascript-CZ97a-BN.cjs +1 -0
  86. package/dist/jsonMode-BZDeJMLL.cjs +10 -0
  87. package/dist/jsonMode-DraOl-ka.js +1885 -0
  88. package/dist/julia-BeebccKw.cjs +1 -0
  89. package/dist/julia-CU4CtsP4.js +414 -0
  90. package/dist/kotlin-B8NxXJ89.js +183 -0
  91. package/dist/kotlin-M82nl514.cjs +1 -0
  92. package/dist/less-B4Q3fV9Y.cjs +2 -0
  93. package/dist/less-DbeQQzer.js +242 -0
  94. package/dist/lexon-CXQaaecE.cjs +1 -0
  95. package/dist/lexon-Cw9JuAKc.js +185 -0
  96. package/dist/lib-C9j_E-l0.js +47 -0
  97. package/dist/lib-Chy_6VKj.cjs +1 -0
  98. package/dist/liquid-BYNEOJvX.cjs +1 -0
  99. package/dist/liquid-DvB-d2w7.js +205 -0
  100. package/dist/lodash-C_2NO1eK.cjs +35 -0
  101. package/dist/lodash-D-qGlPRW.js +3769 -0
  102. package/dist/lua-CnG8Tpu2.cjs +1 -0
  103. package/dist/lua-yl5NzA_S.js +200 -0
  104. package/dist/m3-CVcm-OIn.cjs +1 -0
  105. package/dist/m3-CdNAqvIX.js +193 -0
  106. package/dist/markdown-C1h-EuiT.js +262 -0
  107. package/dist/markdown-DrRHDVSU.cjs +1 -0
  108. package/dist/mdx-BbiOYPr2.cjs +1 -0
  109. package/dist/mdx-Fk8VTCUK.js +335 -0
  110. package/dist/mips-DIWpzGF0.js +128 -0
  111. package/dist/mips-D_p8UYQb.cjs +1 -0
  112. package/dist/monaco.contribution-BpuUCejv.cjs +1 -0
  113. package/dist/monaco.contribution-Cq4QrMn0.js +134 -0
  114. package/dist/msdax-BiazpDQ1.js +156 -0
  115. package/dist/msdax-xM1_j20x.cjs +1 -0
  116. package/dist/mysql-DMsJkSnA.cjs +1 -0
  117. package/dist/mysql-DphBFJlP.js +168 -0
  118. package/dist/objective-c-BG02Lrht.cjs +1 -0
  119. package/dist/objective-c-DWZ8Qpyc.js +144 -0
  120. package/dist/pascal-BcvlMOdu.js +176 -0
  121. package/dist/pascal-CnP2Fqes.cjs +1 -0
  122. package/dist/pascaligo-BzDEm-l_.cjs +1 -0
  123. package/dist/pascaligo-DHEp4kzh.js +201 -0
  124. package/dist/perl-USYKPHpO.js +316 -0
  125. package/dist/perl-nIxw-e4R.cjs +1 -0
  126. package/dist/pgsql-Buk6XzVf.cjs +1 -0
  127. package/dist/pgsql-DzPhAh9W.js +158 -0
  128. package/dist/php-B3sFYUqV.cjs +1 -0
  129. package/dist/php-PfpSTefE.js +471 -0
  130. package/dist/pla-CZtnfWl6.cjs +1 -0
  131. package/dist/pla-DrFOZwDB.js +146 -0
  132. package/dist/postiats-4OGxVVUT.js +504 -0
  133. package/dist/postiats-CgJZf83Q.cjs +1 -0
  134. package/dist/powerquery-D9gzk2Dq.cjs +1 -0
  135. package/dist/powerquery-_h9-HEnY.js +190 -0
  136. package/dist/powershell-CZHaQY6z.cjs +1 -0
  137. package/dist/powershell-nOzcY8gy.js +211 -0
  138. package/dist/protobuf-DAgxhnea.js +659 -0
  139. package/dist/protobuf-D_C8Guej.cjs +2 -0
  140. package/dist/public-1PveQco4.js +1756 -0
  141. package/dist/public-D1K7oN7t.cjs +3 -0
  142. package/dist/pug-quEtG4rz.cjs +1 -0
  143. package/dist/pug-raGZNmZ1.js +300 -0
  144. package/dist/python-C45c7K7W.js +260 -0
  145. package/dist/python-CQX8JcT4.cjs +1 -0
  146. package/dist/qsharp-C2jz5tuo.js +143 -0
  147. package/dist/qsharp-CX1SSV_j.cjs +1 -0
  148. package/dist/query_bar_top_row-3UclS1nm.cjs +1 -0
  149. package/dist/query_bar_top_row-CfV4Iu71.cjs +1 -0
  150. package/dist/query_bar_top_row-D6a48VTk.js +11 -0
  151. package/dist/query_bar_top_row-DonV1OzY.js +2930 -0
  152. package/dist/query_string_input-75waAcWy.js +9 -0
  153. package/dist/query_string_input-CHG9w1ze.cjs +1 -0
  154. package/dist/query_string_input-CyPZVKif.js +366 -0
  155. package/dist/query_string_input-SOULY6dl.cjs +1 -0
  156. package/dist/r-CXkPcYYf.js +189 -0
  157. package/dist/r-DpVDQTST.cjs +1 -0
  158. package/dist/razor-BnoJmj1k.js +525 -0
  159. package/dist/razor-DYx4yJJn.cjs +1 -0
  160. package/dist/redis-DsCuCZIT.cjs +1 -0
  161. package/dist/redis-giKZvbbg.js +123 -0
  162. package/dist/redshift-qKVxBsP_.js +158 -0
  163. package/dist/redshift-z5_aUfdC.cjs +1 -0
  164. package/dist/restructuredtext-D0n4pabr.js +287 -0
  165. package/dist/restructuredtext-DdXoKocW.cjs +1 -0
  166. package/dist/ruby-BNrBlpcw.js +527 -0
  167. package/dist/ruby-Dj0sNBey.cjs +1 -0
  168. package/dist/rust-D6mpPoli.js +178 -0
  169. package/dist/rust-DjkW1U4M.cjs +1 -0
  170. package/dist/sb-BCN0JcpS.cjs +1 -0
  171. package/dist/sb-DhS9GhXl.js +143 -0
  172. package/dist/scala-BqxBEpi8.js +551 -0
  173. package/dist/scala-CyXWhZaJ.cjs +1 -0
  174. package/dist/scheme-Bh4oGAk3.js +170 -0
  175. package/dist/scheme-Cs9G6QEE.cjs +1 -0
  176. package/dist/scss-Byf08jwC.js +417 -0
  177. package/dist/scss-Fl7taPuq.cjs +3 -0
  178. package/dist/search_bar-Caqi1NVo.js +1815 -0
  179. package/dist/search_bar-DyO_WsC5.cjs +1 -0
  180. package/dist/services-9wPHk1eh.js +2350 -0
  181. package/dist/services-BPC3fXx4.cjs +7 -0
  182. package/dist/shard_failure_open_modal_button-BYTThYch.js +199 -0
  183. package/dist/shard_failure_open_modal_button-Dx8ML4VE.cjs +2 -0
  184. package/dist/shell-Cw5yNfC4.cjs +1 -0
  185. package/dist/shell-UoRv_tpG.js +223 -0
  186. package/dist/solidity-B5t7Lkol.js +147 -0
  187. package/dist/solidity-BoAzg9X_.cjs +1 -0
  188. package/dist/sophia-BrXXWhvp.js +147 -0
  189. package/dist/sophia-L84Jz6Ow.cjs +1 -0
  190. package/dist/sparql-B8ZTY48u.js +124 -0
  191. package/dist/sparql-D6lnG7vO.cjs +1 -0
  192. package/dist/sql-D_74hUL-.js +171 -0
  193. package/dist/sql-VXdYzIyz.cjs +1 -0
  194. package/dist/src/App.d.ts +2 -0
  195. package/dist/src/components/ResultHeader/Info.d.ts +30 -0
  196. package/dist/src/components/ResultHeader/index.d.ts +13 -0
  197. package/dist/src/components/context.d.ts +82 -0
  198. package/dist/src/components/euiicons.d.ts +1 -0
  199. package/dist/src/components/index.d.ts +8 -0
  200. package/dist/src/main.d.ts +1 -0
  201. package/dist/src/utils/request.d.ts +1 -0
  202. package/dist/src/utils/utils.d.ts +1 -0
  203. package/dist/st-CxJLwAAK.cjs +1 -0
  204. package/dist/st-D8Rdx9Bz.js +476 -0
  205. package/dist/suggestions_component-BBHwbjYT.js +1243 -0
  206. package/dist/suggestions_component-CF4sehth.cjs +77 -0
  207. package/dist/swift-ZBC6wQdc.cjs +1 -0
  208. package/dist/swift-s19Ivx3X.js +213 -0
  209. package/dist/systemverilog-DoSgAb1I.cjs +1 -0
  210. package/dist/systemverilog-fA72PnKj.js +298 -0
  211. package/dist/tcl-B8QLbcxi.js +223 -0
  212. package/dist/tcl-IXmy-lJ0.cjs +1 -0
  213. package/dist/tsMode-BrPRpJvb.js +597 -0
  214. package/dist/tsMode-CNvH6xuC.cjs +11 -0
  215. package/dist/tsup.config.d.ts +2 -0
  216. package/dist/twig-CT2RXmm0.cjs +1 -0
  217. package/dist/twig-Dy7NkzKI.js +388 -0
  218. package/dist/typescript-BRKHcp4S.js +263 -0
  219. package/dist/typescript-Bbw9fxuo.cjs +1 -0
  220. package/dist/typescript-CQjO9XnF.js +3 -0
  221. package/dist/typescript-D6q4AO2z.cjs +1 -0
  222. package/dist/typespec-CkKpvaMv.cjs +1 -0
  223. package/dist/typespec-ndyv0mQx.js +234 -0
  224. package/dist/vb-DET0NIW-.js +260 -0
  225. package/dist/vb-R3Kcrzvd.cjs +1 -0
  226. package/dist/vite.config.d.ts +2 -0
  227. package/dist/wgsl-D5TeQchR.js +145 -0
  228. package/dist/wgsl-FTDBzylH.cjs +298 -0
  229. package/dist/xml-BZjE3dtf.js +136 -0
  230. package/dist/xml-CxbMIueA.cjs +1 -0
  231. package/dist/yaml-Di_6aXC4.js +229 -0
  232. package/dist/yaml-DvaGkWBl.cjs +1 -0
  233. package/package.json +98 -0
@@ -0,0 +1,1756 @@
1
+ import { n as __esmMin, o as __toESM } from "./chunk-CIp4IH9D.js";
2
+ import { n as require_jsx_runtime, t as require_lodash } from "./lodash-D-qGlPRW.js";
3
+ import { c as require_query_string, h as toMountPoint, m as withKibana, r as getUiSettings } from "./services-9wPHk1eh.js";
4
+ import { a as ILLEGAL_CHARACTERS_VISIBLE, i as ILLEGAL_CHARACTERS_KEY, l as IndexPatternMissingIndices, n as CONTAINS_SPACES_KEY, o as isDefault, r as ILLEGAL_CHARACTERS, s as getFromSavedObject, t as validateIndexPattern } from "./lib-C9j_E-l0.js";
5
+ import { C as intervalOptions, Ct as moment_default, D as uniqFilters, E as require_target, G as FILTERS, H as fromKueryExpression, I as baseFormatters, K as isQueryStringFilter, L as FieldFormat, M as flattenHitWrapper, N as isFilterable, O as COMPARE_ALL_OPTIONS, P as isNestedField, R as KBN_FIELD_TYPES, St as init_moment, T as getTime, U as toElasticsearchQuery, V as nodeTypes, Z as isFilterPinned, _ as isValidEsInterval, _t as isExistsFilter, a as termsAggFilter, at as isMissingFilter, b as InvalidEsIntervalFormatError, bt as UI_SETTINGS, c as isType, ct as isPhrasesFilter, d as propFilter, dt as isPhraseFilter, f as Ipv4Address, ft as isScriptedPhraseFilter, g as isValidInterval, gt as isGeoBoundingBoxFilter, h as parseInterval, ht as isGeoPolygonFilter, i as parentPipelineType, j as formatHitProvider, k as compareFilters, l as CidrMask, lt as getPhraseFilterField, m as toAbsoluteDates, n as tabifyGetColumns, o as isNumberType, ot as isRangeFilter, p as getFormatWithAggs, q as FilterStateStore, r as siblingPipelineType, rt as isMatchAllFilter, s as isStringType, st as isScriptedRangeFilter, t as tabifyAggResponse, u as isDateHistogramBucketAggConfig, ut as getPhraseFilterValue, v as dateHistogramInterval, w as calculateBounds, x as InvalidEsCalendarIntervalError, y as parseEsInterval, yt as buildFilter, z as FIELD_FORMAT_IDS } from "./common-Tr1I-HCs.js";
6
+ import React, { useEffect, useRef, useState } from "react";
7
+ import { EuiButton, EuiCallOut, EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from "@elastic/eui";
8
+ function __extends(f, V) {
9
+ if (typeof V != "function" && V !== null) throw TypeError("Class extends value " + String(V) + " is not a constructor or null");
10
+ extendStatics(f, V);
11
+ function H() {
12
+ this.constructor = f;
13
+ }
14
+ f.prototype = V === null ? Object.create(V) : (H.prototype = V.prototype, new H());
15
+ }
16
+ function __values(f) {
17
+ var V = typeof Symbol == "function" && Symbol.iterator, H = V && f[V], U = 0;
18
+ if (H) return H.call(f);
19
+ if (f && typeof f.length == "number") return { next: function() {
20
+ return f && U >= f.length && (f = void 0), {
21
+ value: f && f[U++],
22
+ done: !f
23
+ };
24
+ } };
25
+ throw TypeError(V ? "Object is not iterable." : "Symbol.iterator is not defined.");
26
+ }
27
+ function __read(f, V) {
28
+ var H = typeof Symbol == "function" && f[Symbol.iterator];
29
+ if (!H) return f;
30
+ var U = H.call(f), W, G = [], K;
31
+ try {
32
+ for (; (V === void 0 || V-- > 0) && !(W = U.next()).done;) G.push(W.value);
33
+ } catch (f) {
34
+ K = { error: f };
35
+ } finally {
36
+ try {
37
+ W && !W.done && (H = U.return) && H.call(U);
38
+ } finally {
39
+ if (K) throw K.error;
40
+ }
41
+ }
42
+ return G;
43
+ }
44
+ function __spreadArray(f, V, H) {
45
+ if (H || arguments.length === 2) for (var U = 0, W = V.length, G; U < W; U++) (G || !(U in V)) && (G ||= Array.prototype.slice.call(V, 0, U), G[U] = V[U]);
46
+ return f.concat(G || Array.prototype.slice.call(V));
47
+ }
48
+ var extendStatics, init_tslib_es6 = __esmMin((() => {
49
+ extendStatics = function(f, V) {
50
+ return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(f, V) {
51
+ f.__proto__ = V;
52
+ } || function(f, V) {
53
+ for (var H in V) Object.prototype.hasOwnProperty.call(V, H) && (f[H] = V[H]);
54
+ }, extendStatics(f, V);
55
+ };
56
+ }));
57
+ function isFunction(f) {
58
+ return typeof f == "function";
59
+ }
60
+ function createErrorClass(f) {
61
+ var V = f(function(f) {
62
+ Error.call(f), f.stack = (/* @__PURE__ */ Error()).stack;
63
+ });
64
+ return V.prototype = Object.create(Error.prototype), V.prototype.constructor = V, V;
65
+ }
66
+ var UnsubscriptionError = createErrorClass(function(f) {
67
+ return function(V) {
68
+ f(this), this.message = V ? V.length + " errors occurred during unsubscription:\n" + V.map(function(f, V) {
69
+ return V + 1 + ") " + f.toString();
70
+ }).join("\n ") : "", this.name = "UnsubscriptionError", this.errors = V;
71
+ };
72
+ });
73
+ function arrRemove(f, V) {
74
+ if (f) {
75
+ var H = f.indexOf(V);
76
+ 0 <= H && f.splice(H, 1);
77
+ }
78
+ }
79
+ init_tslib_es6();
80
+ var Subscription = function() {
81
+ function f(f) {
82
+ this.initialTeardown = f, this.closed = !1, this._parentage = null, this._finalizers = null;
83
+ }
84
+ return f.prototype.unsubscribe = function() {
85
+ var f, V, H, U, W;
86
+ if (!this.closed) {
87
+ this.closed = !0;
88
+ var G = this._parentage;
89
+ if (G) if (this._parentage = null, Array.isArray(G)) try {
90
+ for (var K = __values(G), q = K.next(); !q.done; q = K.next()) q.value.remove(this);
91
+ } catch (V) {
92
+ f = { error: V };
93
+ } finally {
94
+ try {
95
+ q && !q.done && (V = K.return) && V.call(K);
96
+ } finally {
97
+ if (f) throw f.error;
98
+ }
99
+ }
100
+ else G.remove(this);
101
+ var J = this.initialTeardown;
102
+ if (isFunction(J)) try {
103
+ J();
104
+ } catch (f) {
105
+ W = f instanceof UnsubscriptionError ? f.errors : [f];
106
+ }
107
+ var Y = this._finalizers;
108
+ if (Y) {
109
+ this._finalizers = null;
110
+ try {
111
+ for (var X = __values(Y), Z = X.next(); !Z.done; Z = X.next()) {
112
+ var Q = Z.value;
113
+ try {
114
+ execFinalizer(Q);
115
+ } catch (f) {
116
+ W ??= [], f instanceof UnsubscriptionError ? W = __spreadArray(__spreadArray([], __read(W)), __read(f.errors)) : W.push(f);
117
+ }
118
+ }
119
+ } catch (f) {
120
+ H = { error: f };
121
+ } finally {
122
+ try {
123
+ Z && !Z.done && (U = X.return) && U.call(X);
124
+ } finally {
125
+ if (H) throw H.error;
126
+ }
127
+ }
128
+ }
129
+ if (W) throw new UnsubscriptionError(W);
130
+ }
131
+ }, f.prototype.add = function(V) {
132
+ if (V && V !== this) if (this.closed) execFinalizer(V);
133
+ else {
134
+ if (V instanceof f) {
135
+ if (V.closed || V._hasParent(this)) return;
136
+ V._addParent(this);
137
+ }
138
+ (this._finalizers = this._finalizers ?? []).push(V);
139
+ }
140
+ }, f.prototype._hasParent = function(f) {
141
+ var V = this._parentage;
142
+ return V === f || Array.isArray(V) && V.includes(f);
143
+ }, f.prototype._addParent = function(f) {
144
+ var V = this._parentage;
145
+ this._parentage = Array.isArray(V) ? (V.push(f), V) : V ? [V, f] : f;
146
+ }, f.prototype._removeParent = function(f) {
147
+ var V = this._parentage;
148
+ V === f ? this._parentage = null : Array.isArray(V) && arrRemove(V, f);
149
+ }, f.prototype.remove = function(V) {
150
+ var H = this._finalizers;
151
+ H && arrRemove(H, V), V instanceof f && V._removeParent(this);
152
+ }, f.EMPTY = (function() {
153
+ var V = new f();
154
+ return V.closed = !0, V;
155
+ })(), f;
156
+ }(), EMPTY_SUBSCRIPTION = Subscription.EMPTY;
157
+ function isSubscription(f) {
158
+ return f instanceof Subscription || f && "closed" in f && isFunction(f.remove) && isFunction(f.add) && isFunction(f.unsubscribe);
159
+ }
160
+ function execFinalizer(f) {
161
+ isFunction(f) ? f() : f.unsubscribe();
162
+ }
163
+ var config = {
164
+ onUnhandledError: null,
165
+ onStoppedNotification: null,
166
+ Promise: void 0,
167
+ useDeprecatedSynchronousErrorHandling: !1,
168
+ useDeprecatedNextContext: !1
169
+ };
170
+ init_tslib_es6();
171
+ var timeoutProvider = {
172
+ setTimeout: function(f, V) {
173
+ var H = [...arguments].slice(2), U = timeoutProvider.delegate;
174
+ return U?.setTimeout ? U.setTimeout.apply(U, __spreadArray([f, V], __read(H))) : setTimeout.apply(void 0, __spreadArray([f, V], __read(H)));
175
+ },
176
+ clearTimeout: function(f) {
177
+ return (timeoutProvider.delegate?.clearTimeout || clearTimeout)(f);
178
+ },
179
+ delegate: void 0
180
+ };
181
+ function reportUnhandledError(f) {
182
+ timeoutProvider.setTimeout(function() {
183
+ var V = config.onUnhandledError;
184
+ if (V) V(f);
185
+ else throw f;
186
+ });
187
+ }
188
+ function noop$3() {}
189
+ var COMPLETE_NOTIFICATION = (function() {
190
+ return createNotification("C", void 0, void 0);
191
+ })();
192
+ function errorNotification(f) {
193
+ return createNotification("E", void 0, f);
194
+ }
195
+ function nextNotification(f) {
196
+ return createNotification("N", f, void 0);
197
+ }
198
+ function createNotification(f, V, H) {
199
+ return {
200
+ kind: f,
201
+ value: V,
202
+ error: H
203
+ };
204
+ }
205
+ var context = null;
206
+ function errorContext(f) {
207
+ if (config.useDeprecatedSynchronousErrorHandling) {
208
+ var V = !context;
209
+ if (V && (context = {
210
+ errorThrown: !1,
211
+ error: null
212
+ }), f(), V) {
213
+ var H = context, U = H.errorThrown, W = H.error;
214
+ if (context = null, U) throw W;
215
+ }
216
+ } else f();
217
+ }
218
+ function captureError(f) {
219
+ config.useDeprecatedSynchronousErrorHandling && context && (context.errorThrown = !0, context.error = f);
220
+ }
221
+ init_tslib_es6();
222
+ var Subscriber = function(f) {
223
+ __extends(V, f);
224
+ function V(V) {
225
+ var H = f.call(this) || this;
226
+ return H.isStopped = !1, V ? (H.destination = V, isSubscription(V) && V.add(H)) : H.destination = EMPTY_OBSERVER, H;
227
+ }
228
+ return V.create = function(f, V, H) {
229
+ return new SafeSubscriber(f, V, H);
230
+ }, V.prototype.next = function(f) {
231
+ this.isStopped ? handleStoppedNotification(nextNotification(f), this) : this._next(f);
232
+ }, V.prototype.error = function(f) {
233
+ this.isStopped ? handleStoppedNotification(errorNotification(f), this) : (this.isStopped = !0, this._error(f));
234
+ }, V.prototype.complete = function() {
235
+ this.isStopped ? handleStoppedNotification(COMPLETE_NOTIFICATION, this) : (this.isStopped = !0, this._complete());
236
+ }, V.prototype.unsubscribe = function() {
237
+ this.closed || (this.isStopped = !0, f.prototype.unsubscribe.call(this), this.destination = null);
238
+ }, V.prototype._next = function(f) {
239
+ this.destination.next(f);
240
+ }, V.prototype._error = function(f) {
241
+ try {
242
+ this.destination.error(f);
243
+ } finally {
244
+ this.unsubscribe();
245
+ }
246
+ }, V.prototype._complete = function() {
247
+ try {
248
+ this.destination.complete();
249
+ } finally {
250
+ this.unsubscribe();
251
+ }
252
+ }, V;
253
+ }(Subscription), _bind = Function.prototype.bind;
254
+ function bind(f, V) {
255
+ return _bind.call(f, V);
256
+ }
257
+ var ConsumerObserver = function() {
258
+ function f(f) {
259
+ this.partialObserver = f;
260
+ }
261
+ return f.prototype.next = function(f) {
262
+ var V = this.partialObserver;
263
+ if (V.next) try {
264
+ V.next(f);
265
+ } catch (f) {
266
+ handleUnhandledError(f);
267
+ }
268
+ }, f.prototype.error = function(f) {
269
+ var V = this.partialObserver;
270
+ if (V.error) try {
271
+ V.error(f);
272
+ } catch (f) {
273
+ handleUnhandledError(f);
274
+ }
275
+ else handleUnhandledError(f);
276
+ }, f.prototype.complete = function() {
277
+ var f = this.partialObserver;
278
+ if (f.complete) try {
279
+ f.complete();
280
+ } catch (f) {
281
+ handleUnhandledError(f);
282
+ }
283
+ }, f;
284
+ }(), SafeSubscriber = function(f) {
285
+ __extends(V, f);
286
+ function V(V, H, U) {
287
+ var W = f.call(this) || this, G;
288
+ if (isFunction(V) || !V) G = {
289
+ next: V ?? void 0,
290
+ error: H ?? void 0,
291
+ complete: U ?? void 0
292
+ };
293
+ else {
294
+ var K;
295
+ W && config.useDeprecatedNextContext ? (K = Object.create(V), K.unsubscribe = function() {
296
+ return W.unsubscribe();
297
+ }, G = {
298
+ next: V.next && bind(V.next, K),
299
+ error: V.error && bind(V.error, K),
300
+ complete: V.complete && bind(V.complete, K)
301
+ }) : G = V;
302
+ }
303
+ return W.destination = new ConsumerObserver(G), W;
304
+ }
305
+ return V;
306
+ }(Subscriber);
307
+ function handleUnhandledError(f) {
308
+ config.useDeprecatedSynchronousErrorHandling ? captureError(f) : reportUnhandledError(f);
309
+ }
310
+ function defaultErrorHandler(f) {
311
+ throw f;
312
+ }
313
+ function handleStoppedNotification(f, V) {
314
+ var H = config.onStoppedNotification;
315
+ H && timeoutProvider.setTimeout(function() {
316
+ return H(f, V);
317
+ });
318
+ }
319
+ var EMPTY_OBSERVER = {
320
+ closed: !0,
321
+ next: noop$3,
322
+ error: defaultErrorHandler,
323
+ complete: noop$3
324
+ }, observable = (function() {
325
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
326
+ })();
327
+ function identity$1(f) {
328
+ return f;
329
+ }
330
+ function pipeFromArray(f) {
331
+ return f.length === 0 ? identity$1 : f.length === 1 ? f[0] : function(V) {
332
+ return f.reduce(function(f, V) {
333
+ return V(f);
334
+ }, V);
335
+ };
336
+ }
337
+ var Observable = function() {
338
+ function f(f) {
339
+ f && (this._subscribe = f);
340
+ }
341
+ return f.prototype.lift = function(V) {
342
+ var H = new f();
343
+ return H.source = this, H.operator = V, H;
344
+ }, f.prototype.subscribe = function(f, V, H) {
345
+ var U = this, W = isSubscriber(f) ? f : new SafeSubscriber(f, V, H);
346
+ return errorContext(function() {
347
+ var f = U, V = f.operator, H = f.source;
348
+ W.add(V ? V.call(W, H) : H ? U._subscribe(W) : U._trySubscribe(W));
349
+ }), W;
350
+ }, f.prototype._trySubscribe = function(f) {
351
+ try {
352
+ return this._subscribe(f);
353
+ } catch (V) {
354
+ f.error(V);
355
+ }
356
+ }, f.prototype.forEach = function(f, V) {
357
+ var H = this;
358
+ return V = getPromiseCtor(V), new V(function(V, U) {
359
+ var W = new SafeSubscriber({
360
+ next: function(V) {
361
+ try {
362
+ f(V);
363
+ } catch (f) {
364
+ U(f), W.unsubscribe();
365
+ }
366
+ },
367
+ error: U,
368
+ complete: V
369
+ });
370
+ H.subscribe(W);
371
+ });
372
+ }, f.prototype._subscribe = function(f) {
373
+ return this.source?.subscribe(f);
374
+ }, f.prototype[observable] = function() {
375
+ return this;
376
+ }, f.prototype.pipe = function() {
377
+ return pipeFromArray([...arguments])(this);
378
+ }, f.prototype.toPromise = function(f) {
379
+ var V = this;
380
+ return f = getPromiseCtor(f), new f(function(f, H) {
381
+ var U;
382
+ V.subscribe(function(f) {
383
+ return U = f;
384
+ }, function(f) {
385
+ return H(f);
386
+ }, function() {
387
+ return f(U);
388
+ });
389
+ });
390
+ }, f.create = function(V) {
391
+ return new f(V);
392
+ }, f;
393
+ }();
394
+ function getPromiseCtor(f) {
395
+ return f ?? config.Promise ?? Promise;
396
+ }
397
+ function isObserver(f) {
398
+ return f && isFunction(f.next) && isFunction(f.error) && isFunction(f.complete);
399
+ }
400
+ function isSubscriber(f) {
401
+ return f && f instanceof Subscriber || isObserver(f) && isSubscription(f);
402
+ }
403
+ function hasLift(f) {
404
+ return isFunction(f?.lift);
405
+ }
406
+ function operate(f) {
407
+ return function(V) {
408
+ if (hasLift(V)) return V.lift(function(V) {
409
+ try {
410
+ return f(V, this);
411
+ } catch (f) {
412
+ this.error(f);
413
+ }
414
+ });
415
+ throw TypeError("Unable to lift unknown Observable type");
416
+ };
417
+ }
418
+ init_tslib_es6();
419
+ function createOperatorSubscriber(f, V, H, U, W) {
420
+ return new OperatorSubscriber(f, V, H, U, W);
421
+ }
422
+ var OperatorSubscriber = function(f) {
423
+ __extends(V, f);
424
+ function V(V, H, U, W, G, K) {
425
+ var q = f.call(this, V) || this;
426
+ return q.onFinalize = G, q.shouldUnsubscribe = K, q._next = H ? function(f) {
427
+ try {
428
+ H(f);
429
+ } catch (f) {
430
+ V.error(f);
431
+ }
432
+ } : f.prototype._next, q._error = W ? function(f) {
433
+ try {
434
+ W(f);
435
+ } catch (f) {
436
+ V.error(f);
437
+ } finally {
438
+ this.unsubscribe();
439
+ }
440
+ } : f.prototype._error, q._complete = U ? function() {
441
+ try {
442
+ U();
443
+ } catch (f) {
444
+ V.error(f);
445
+ } finally {
446
+ this.unsubscribe();
447
+ }
448
+ } : f.prototype._complete, q;
449
+ }
450
+ return V.prototype.unsubscribe = function() {
451
+ var V;
452
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
453
+ var H = this.closed;
454
+ f.prototype.unsubscribe.call(this), !H && ((V = this.onFinalize) == null || V.call(this));
455
+ }
456
+ }, V;
457
+ }(Subscriber), ObjectUnsubscribedError = createErrorClass(function(f) {
458
+ return function() {
459
+ f(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
460
+ };
461
+ });
462
+ init_tslib_es6();
463
+ var Subject = function(f) {
464
+ __extends(V, f);
465
+ function V() {
466
+ var V = f.call(this) || this;
467
+ return V.closed = !1, V.currentObservers = null, V.observers = [], V.isStopped = !1, V.hasError = !1, V.thrownError = null, V;
468
+ }
469
+ return V.prototype.lift = function(f) {
470
+ var V = new AnonymousSubject(this, this);
471
+ return V.operator = f, V;
472
+ }, V.prototype._throwIfClosed = function() {
473
+ if (this.closed) throw new ObjectUnsubscribedError();
474
+ }, V.prototype.next = function(f) {
475
+ var V = this;
476
+ errorContext(function() {
477
+ var H, U;
478
+ if (V._throwIfClosed(), !V.isStopped) {
479
+ V.currentObservers ||= Array.from(V.observers);
480
+ try {
481
+ for (var W = __values(V.currentObservers), G = W.next(); !G.done; G = W.next()) G.value.next(f);
482
+ } catch (f) {
483
+ H = { error: f };
484
+ } finally {
485
+ try {
486
+ G && !G.done && (U = W.return) && U.call(W);
487
+ } finally {
488
+ if (H) throw H.error;
489
+ }
490
+ }
491
+ }
492
+ });
493
+ }, V.prototype.error = function(f) {
494
+ var V = this;
495
+ errorContext(function() {
496
+ if (V._throwIfClosed(), !V.isStopped) {
497
+ V.hasError = V.isStopped = !0, V.thrownError = f;
498
+ for (var H = V.observers; H.length;) H.shift().error(f);
499
+ }
500
+ });
501
+ }, V.prototype.complete = function() {
502
+ var f = this;
503
+ errorContext(function() {
504
+ if (f._throwIfClosed(), !f.isStopped) {
505
+ f.isStopped = !0;
506
+ for (var V = f.observers; V.length;) V.shift().complete();
507
+ }
508
+ });
509
+ }, V.prototype.unsubscribe = function() {
510
+ this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
511
+ }, Object.defineProperty(V.prototype, "observed", {
512
+ get: function() {
513
+ return this.observers?.length > 0;
514
+ },
515
+ enumerable: !1,
516
+ configurable: !0
517
+ }), V.prototype._trySubscribe = function(V) {
518
+ return this._throwIfClosed(), f.prototype._trySubscribe.call(this, V);
519
+ }, V.prototype._subscribe = function(f) {
520
+ return this._throwIfClosed(), this._checkFinalizedStatuses(f), this._innerSubscribe(f);
521
+ }, V.prototype._innerSubscribe = function(f) {
522
+ var V = this, H = this, U = H.hasError, W = H.isStopped, G = H.observers;
523
+ return U || W ? EMPTY_SUBSCRIPTION : (this.currentObservers = null, G.push(f), new Subscription(function() {
524
+ V.currentObservers = null, arrRemove(G, f);
525
+ }));
526
+ }, V.prototype._checkFinalizedStatuses = function(f) {
527
+ var V = this, H = V.hasError, U = V.thrownError, W = V.isStopped;
528
+ H ? f.error(U) : W && f.complete();
529
+ }, V.prototype.asObservable = function() {
530
+ var f = new Observable();
531
+ return f.source = this, f;
532
+ }, V.create = function(f, V) {
533
+ return new AnonymousSubject(f, V);
534
+ }, V;
535
+ }(Observable), AnonymousSubject = function(f) {
536
+ __extends(V, f);
537
+ function V(V, H) {
538
+ var U = f.call(this) || this;
539
+ return U.destination = V, U.source = H, U;
540
+ }
541
+ return V.prototype.next = function(f) {
542
+ var V, H;
543
+ (H = (V = this.destination)?.next) == null || H.call(V, f);
544
+ }, V.prototype.error = function(f) {
545
+ var V, H;
546
+ (H = (V = this.destination)?.error) == null || H.call(V, f);
547
+ }, V.prototype.complete = function() {
548
+ var f, V;
549
+ (V = (f = this.destination)?.complete) == null || V.call(f);
550
+ }, V.prototype._subscribe = function(f) {
551
+ return this.source?.subscribe(f) ?? EMPTY_SUBSCRIPTION;
552
+ }, V;
553
+ }(Subject);
554
+ init_tslib_es6();
555
+ var BehaviorSubject = function(f) {
556
+ __extends(V, f);
557
+ function V(V) {
558
+ var H = f.call(this) || this;
559
+ return H._value = V, H;
560
+ }
561
+ return Object.defineProperty(V.prototype, "value", {
562
+ get: function() {
563
+ return this.getValue();
564
+ },
565
+ enumerable: !1,
566
+ configurable: !0
567
+ }), V.prototype._subscribe = function(V) {
568
+ var H = f.prototype._subscribe.call(this, V);
569
+ return !H.closed && V.next(this._value), H;
570
+ }, V.prototype.getValue = function() {
571
+ var f = this, V = f.hasError, H = f.thrownError, U = f._value;
572
+ if (V) throw H;
573
+ return this._throwIfClosed(), U;
574
+ }, V.prototype.next = function(V) {
575
+ f.prototype.next.call(this, this._value = V);
576
+ }, V;
577
+ }(Subject);
578
+ function map(f, V) {
579
+ return operate(function(H, U) {
580
+ var W = 0;
581
+ H.subscribe(createOperatorSubscriber(U, function(H) {
582
+ U.next(f.call(V, H, W++));
583
+ }));
584
+ });
585
+ }
586
+ let QuerySuggestionTypes = /* @__PURE__ */ function(f) {
587
+ return f.Field = "field", f.Value = "value", f.Operator = "operator", f.Conjunction = "conjunction", f.RecentSearch = "recentSearch", f;
588
+ }({});
589
+ var import_lodash$30 = require_lodash();
590
+ function resolver(f, V, H, U) {
591
+ return [
592
+ Math.floor(Date.now() / 1e3 / 60),
593
+ H,
594
+ f,
595
+ V.name,
596
+ JSON.stringify(U)
597
+ ].join("|");
598
+ }
599
+ const getEmptyValueSuggestions = (() => Promise.resolve([])), setupValueSuggestionProvider = (f) => {
600
+ let V = (0, import_lodash$30.memoize)((V, H, U, W = [], G) => f.http.fetch(`${f.http.getServerBasePath()}/suggestions/values/${V}`, {
601
+ method: "POST",
602
+ body: JSON.stringify({
603
+ query: U,
604
+ field: H.name,
605
+ boolFilter: W
606
+ }),
607
+ signal: G
608
+ }), resolver);
609
+ return async ({ indexPattern: f, field: H, query: U, boolFilter: W, signal: G }) => {
610
+ let { title: K } = f;
611
+ return H.type === "boolean" ? [!0, !1] : !H.aggregatable || H.type !== "string" ? [] : await V(K, H, U, W, G);
612
+ };
613
+ };
614
+ var import_lodash$29 = require_lodash();
615
+ function escapeQuotes(f) {
616
+ return f.replace(/[\\"]/g, "\\$&");
617
+ }
618
+ const escapeKuery = (0, import_lodash$29.flow)(escapeSpecialCharacters, escapeAndOr, escapeNot, escapeWhitespace);
619
+ function escapeSpecialCharacters(f) {
620
+ return f.replace(/[\\():<>"*]/g, "\\$&");
621
+ }
622
+ function escapeAndOr(f) {
623
+ return f.replace(/(\s+)(and|or)(\s+)/gi, "$1\\$2$3");
624
+ }
625
+ function escapeNot(f) {
626
+ return f.replace(/not(\s+)/gi, "\\$&");
627
+ }
628
+ function escapeWhitespace(f) {
629
+ return f.replace(/\t/g, "\\t").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
630
+ }
631
+ var import_lodash$28 = require_lodash();
632
+ function sortPrefixFirst(f, V, H) {
633
+ if (!V) return f;
634
+ let U = ("" + V).toLowerCase(), W = (0, import_lodash$28.partition)(f, (f) => ("" + (H ? f[H] : f)).toLowerCase().startsWith(U));
635
+ return [...W[0], ...W[1]];
636
+ }
637
+ function getRequestInspectorStats(f) {
638
+ let V = {}, H = f.getField("index");
639
+ return H && (V.indexPattern = {
640
+ label: "Index pattern",
641
+ value: H.title,
642
+ description: "The index pattern that connected to the Elasticsearch indices."
643
+ }, V.indexPatternId = {
644
+ label: "Index pattern ID",
645
+ value: H.id,
646
+ description: "The ID in the .kibana index."
647
+ }), V;
648
+ }
649
+ function getResponseInspectorStats(f, V) {
650
+ let H = V?.history && V.history[V.history.length - 1], U = {};
651
+ return f && f.took && (U.queryTime = {
652
+ label: "Query time",
653
+ value: `${f.took}ms`,
654
+ description: "The time it took to process the query. Does not include the time to send the request or parse it in the browser."
655
+ }), f && f.hits && (U.hitsTotal = {
656
+ label: "Hits (total)",
657
+ value: `${f.hits.total}`,
658
+ description: "The number of documents that match the query."
659
+ }, U.hits = {
660
+ label: "Hits",
661
+ value: `${f.hits.hits.length}`,
662
+ description: "The number of documents returned by the query."
663
+ }), H && (H.ms === 0 || H.ms) && (U.requestTime = {
664
+ label: "Request time",
665
+ value: `${H.ms}ms`,
666
+ description: "The time of the request from the browser to Elasticsearch and back. Does not include the time the requested waited in the queue."
667
+ }), U;
668
+ }
669
+ var import_lodash$27 = require_lodash(), import_jsx_runtime = require_jsx_runtime(), indexPatternsUtils = { isFilterable }, getDescription$1 = (f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: ["Filter results that contain ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
670
+ className: "kbnSuggestionItem__callout",
671
+ children: f.name
672
+ })] }), keywordComparator = (f, V) => {
673
+ let H = ["raw", "keyword"];
674
+ return H.map((V) => `${f.name}.${V}`).includes(V.name) ? 1 : H.map((f) => `${V.name}.${f}`).includes(f.name) ? -1 : f.name.localeCompare(V.name);
675
+ };
676
+ const setupGetFieldSuggestions = (f) => ({ indexPatterns: f }, { start: V, end: H, prefix: U, suffix: W, nestedPath: G = "" }) => {
677
+ let K = (0, import_lodash$27.flatten)(f.map((f) => f.fields.filter(indexPatternsUtils.isFilterable))), q = `${U}${W}`.trim().toLowerCase(), J = sortPrefixFirst(K.filter((f) => (!G || G && f.subType && f.subType.nested && f.subType.nested.path.includes(G)) && f.name.toLowerCase().includes(q)).sort(keywordComparator), q, "name").map((f) => {
678
+ let U = f.subType && f.subType.nested ? f.subType.nested.path.slice(G ? G.length + 1 : 0) : "", W = f.subType && f.subType.nested && U.length > 0 ? `${escapeKuery(U)}:{ ${escapeKuery(f.name.slice(f.subType.nested.path.length + 1))} }` : `${escapeKuery(f.name.slice(G ? G.length + 1 : 0))} `, K = getDescription$1(f), q = f.subType && f.subType.nested && U.length > 0 ? W.length - 2 : W.length;
679
+ return {
680
+ type: QuerySuggestionTypes.Field,
681
+ text: W,
682
+ description: K,
683
+ start: V,
684
+ end: H,
685
+ cursorIndex: q,
686
+ field: f
687
+ };
688
+ });
689
+ return Promise.resolve(J);
690
+ };
691
+ var import_lodash$26 = require_lodash(), wrapAsSuggestions = (f, V, H, U) => (U || []).filter((f) => f.toLowerCase().includes(H.toLowerCase())).map((H) => ({
692
+ type: QuerySuggestionTypes.Value,
693
+ text: `${H} `,
694
+ start: f,
695
+ end: V
696
+ }));
697
+ const setupGetValueSuggestions = (f) => {
698
+ let { onSuggestions: V } = f;
699
+ return async ({ indexPatterns: f, boolFilter: H, useTimeRange: U, signal: W }, { start: G, end: K, prefix: q, suffix: J, fieldName: Y, nestedPath: X }) => {
700
+ let Z = X ? `${X}.${Y}` : Y, Q = [];
701
+ f.forEach((f) => {
702
+ f.fields.filter((f) => f.name === Z).forEach((V) => Q.push([f, V]));
703
+ });
704
+ let $ = `${q}${J}`.trim();
705
+ return (0, import_lodash$26.flatten)(await Promise.all(Q.map(([f, U]) => {
706
+ let W = {
707
+ size: 0,
708
+ query: { bool: { filter: H } },
709
+ aggs: { suggestions: { terms: {
710
+ field: U.name,
711
+ include: $ + ".*",
712
+ execution_hint: "map",
713
+ shard_size: 10
714
+ } } }
715
+ };
716
+ return V(f.title, W).then((f) => {
717
+ let V = [], H = f?.aggregations?.suggestions;
718
+ H?.buckets && Array.isArray(H.buckets) && H.buckets.forEach((f) => {
719
+ V.push(f.key);
720
+ });
721
+ let U = V?.map((f) => typeof f == "string" ? `"${escapeQuotes(f)}"` : `${f}`);
722
+ return wrapAsSuggestions(G, K, $, U);
723
+ });
724
+ })));
725
+ };
726
+ };
727
+ var import_lodash$25 = require_lodash(), equalsText = "equals", lessThanOrEqualToText = "less than or equal to", greaterThanOrEqualToText = "greater than or equal to", lessThanText = "less than", greaterThanText = "greater than", existsText = "exists", operators = {
728
+ ":": {
729
+ description: `${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
730
+ className: "kbnSuggestionItem__callout",
731
+ children: equalsText
732
+ })} some value`,
733
+ fieldTypes: [
734
+ "string",
735
+ "number",
736
+ "number_range",
737
+ "date",
738
+ "date_range",
739
+ "ip",
740
+ "ip_range",
741
+ "geo_point",
742
+ "geo_shape",
743
+ "boolean"
744
+ ]
745
+ },
746
+ "<=": {
747
+ description: `is ${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
748
+ className: "kbnSuggestionItem__callout",
749
+ children: lessThanOrEqualToText
750
+ })} some value`,
751
+ fieldTypes: [
752
+ "number",
753
+ "number_range",
754
+ "date",
755
+ "date_range",
756
+ "ip",
757
+ "ip_range"
758
+ ]
759
+ },
760
+ ">=": {
761
+ description: `is ${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
762
+ className: "kbnSuggestionItem__callout",
763
+ children: greaterThanOrEqualToText
764
+ })} some value`,
765
+ fieldTypes: [
766
+ "number",
767
+ "number_range",
768
+ "date",
769
+ "date_range",
770
+ "ip",
771
+ "ip_range"
772
+ ]
773
+ },
774
+ "<": {
775
+ description: `is ${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
776
+ className: "kbnSuggestionItem__callout",
777
+ children: lessThanText
778
+ })} some value`,
779
+ fieldTypes: [
780
+ "number",
781
+ "number_range",
782
+ "date",
783
+ "date_range",
784
+ "ip",
785
+ "ip_range"
786
+ ]
787
+ },
788
+ ">": {
789
+ description: `is ${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
790
+ className: "kbnSuggestionItem__callout",
791
+ children: greaterThanText
792
+ })} some value`,
793
+ fieldTypes: [
794
+ "number",
795
+ "number_range",
796
+ "date",
797
+ "date_range",
798
+ "ip",
799
+ "ip_range"
800
+ ]
801
+ },
802
+ ": *": {
803
+ description: `${/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
804
+ className: "kbnSuggestionItem__callout",
805
+ children: existsText
806
+ })} in any form`,
807
+ fieldTypes: void 0
808
+ }
809
+ }, getOperatorByName = (f) => operators[f], getDescription = (f) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: getOperatorByName(f).description });
810
+ const setupGetOperatorSuggestions = () => ({ indexPatterns: f }, { end: V, fieldName: H, nestedPath: U }) => {
811
+ let W = (0, import_lodash$25.flatten)(f.map((f) => f.fields.slice())), G = U ? `${U}.${H}` : H, K = W.filter((f) => f.name === G).map((f) => Object.keys(operators).filter((V) => {
812
+ let { fieldTypes: H } = getOperatorByName(V);
813
+ return !H || H.includes(f.type);
814
+ }).map((f) => ({
815
+ type: QuerySuggestionTypes.Operator,
816
+ text: f + " ",
817
+ description: getDescription(f),
818
+ start: V,
819
+ end: V
820
+ })));
821
+ return Promise.resolve((0, import_lodash$25.flatten)(K));
822
+ };
823
+ var conjunctions = {
824
+ and: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
825
+ "Requires ",
826
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
827
+ className: "kbnSuggestionItem__callout",
828
+ children: "both arguments"
829
+ }),
830
+ " to be true"
831
+ ] }),
832
+ or: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
833
+ "Requires ",
834
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
835
+ className: "kbnSuggestionItem__callout",
836
+ children: "one or more arguments"
837
+ }),
838
+ " to be true"
839
+ ] })
840
+ };
841
+ const setupGetConjunctionSuggestions = (f) => (f, { text: V, end: H }) => {
842
+ let U = [];
843
+ return V.endsWith(" ") && (U = Object.keys(conjunctions).map((f) => ({
844
+ type: QuerySuggestionTypes.Conjunction,
845
+ text: `${f} `,
846
+ description: conjunctions[f],
847
+ start: H,
848
+ end: H
849
+ }))), Promise.resolve(U);
850
+ };
851
+ var import_lodash$24 = require_lodash(), esKuery = {
852
+ nodeTypes,
853
+ fromKueryExpression,
854
+ toElasticsearchQuery
855
+ }, cursorSymbol = "@kuery-cursor@", dedup = (f) => (0, import_lodash$24.uniqBy)(f, ({ type: f, text: V, start: H, end: U }) => [
856
+ f,
857
+ V,
858
+ H,
859
+ U
860
+ ].join("|"));
861
+ const setupKqlQuerySuggestionProvider = (f) => {
862
+ let V = {
863
+ field: setupGetFieldSuggestions(f),
864
+ value: setupGetValueSuggestions(f),
865
+ operator: setupGetOperatorSuggestions(f),
866
+ conjunction: setupGetConjunctionSuggestions(f)
867
+ }, H = (f, H) => {
868
+ try {
869
+ let U = esKuery.fromKueryExpression(f, {
870
+ cursorSymbol,
871
+ parseCursor: !0
872
+ });
873
+ return U.suggestionTypes.map((f) => V[f](H, U));
874
+ } catch {
875
+ return [];
876
+ }
877
+ };
878
+ return (f) => {
879
+ let { query: V, selectionStart: U, selectionEnd: W } = f, G = `${V.substr(0, U)}${cursorSymbol}${V.substr(W)}`;
880
+ return Promise.all(H(G, f)).then((f) => dedup((0, import_lodash$24.flatten)(f)));
881
+ };
882
+ };
883
+ var AutocompleteService = class {
884
+ autocompleteConfig;
885
+ constructor(f) {
886
+ this.autocompleteConfig = f;
887
+ }
888
+ querySuggestionProviders = /* @__PURE__ */ new Map();
889
+ getValueSuggestions;
890
+ addQuerySuggestionProvider = (f, V) => {
891
+ f && V && this.autocompleteConfig.querySuggestions.enabled && this.querySuggestionProviders.set(f, V);
892
+ };
893
+ getQuerySuggestions = (f) => {
894
+ let { language: V } = f, H = this.querySuggestionProviders.get(V);
895
+ if (H) return H(f);
896
+ };
897
+ hasQuerySuggestions = (f) => this.querySuggestionProviders.has(f);
898
+ setup(f) {
899
+ return this.getValueSuggestions = this.autocompleteConfig.valueSuggestions.enabled && f.onSuggestions ? setupValueSuggestionProvider(f) : getEmptyValueSuggestions, this.autocompleteConfig.querySuggestions.enabled && this.querySuggestionProviders.set("kuery", setupKqlQuerySuggestionProvider(f)), {
900
+ addQuerySuggestionProvider: this.addQuerySuggestionProvider,
901
+ getQuerySuggestions: this.getQuerySuggestions
902
+ };
903
+ }
904
+ start() {
905
+ return {
906
+ getQuerySuggestions: this.getQuerySuggestions,
907
+ hasQuerySuggestions: this.hasQuerySuggestions,
908
+ getValueSuggestions: this.getValueSuggestions
909
+ };
910
+ }
911
+ clearProviders() {
912
+ this.querySuggestionProviders.clear();
913
+ }
914
+ };
915
+ const sortFilters = ({ $state: f }, { $state: V }) => f.store === V.store ? 0 : f.store === FilterStateStore.GLOBAL_STATE && V.store !== FilterStateStore.GLOBAL_STATE ? -1 : 1, mapSpatialFilter = (f) => {
916
+ if (f.meta && f.meta.key && f.meta.alias && f.meta.type === FILTERS.SPATIAL_FILTER) return {
917
+ key: f.meta.key,
918
+ type: f.meta.type,
919
+ value: ""
920
+ };
921
+ throw f;
922
+ }, mapMatchAll = (f) => {
923
+ if (isMatchAllFilter(f)) return {
924
+ type: FILTERS.MATCH_ALL,
925
+ key: f.meta.field,
926
+ value: f.meta.formattedValue || "all"
927
+ };
928
+ throw f;
929
+ };
930
+ var import_lodash$23 = require_lodash(), getScriptedPhraseValue = (f) => (0, import_lodash$23.get)(f, [
931
+ "script",
932
+ "script",
933
+ "params",
934
+ "value"
935
+ ]), getFormattedValueFn$3 = (f) => (V) => V ? V.convert(f) : f, getParams$3 = (f) => {
936
+ let V = getScriptedPhraseValue(f), H = V ? f.meta.field || "" : getPhraseFilterField(f), U = V || getPhraseFilterValue(f);
937
+ return {
938
+ key: H,
939
+ params: { query: U },
940
+ type: FILTERS.PHRASE,
941
+ value: getFormattedValueFn$3(U)
942
+ };
943
+ };
944
+ const isMapPhraseFilter = (f) => isPhraseFilter(f) || isScriptedPhraseFilter(f), mapPhrase = (f) => {
945
+ if (!isMapPhraseFilter(f)) throw f;
946
+ return getParams$3(f);
947
+ }, mapPhrases = (f) => {
948
+ if (!isPhrasesFilter(f)) throw f;
949
+ let { type: V, key: H, value: U, params: W } = f.meta;
950
+ return {
951
+ type: V,
952
+ key: H,
953
+ value: U,
954
+ params: W
955
+ };
956
+ };
957
+ var import_lodash$22 = require_lodash(), getFormattedValueFn$2 = (f, V) => (H) => {
958
+ let U = `${f} to ${V}`;
959
+ if (H) {
960
+ let W = H.getConverterFor("text");
961
+ U = `${W(f)} to ${W(V)}`;
962
+ }
963
+ return U;
964
+ }, getFirstRangeKey = (f) => f.range && Object.keys(f.range)[0], getRangeByKey = (f, V) => (0, import_lodash$22.get)(f, ["range", V]);
965
+ function getParams$2(f) {
966
+ let V = isScriptedRangeFilter(f), H = (V ? f.meta.field : getFirstRangeKey(f)) || "", U = V ? (0, import_lodash$22.get)(f, "script.script.params") : getRangeByKey(f, H), W = (0, import_lodash$22.hasIn)(U, "gte") ? U.gte : U.gt;
967
+ W ??= -Infinity;
968
+ let G = (0, import_lodash$22.hasIn)(U, "lte") ? U.lte : U.lt;
969
+ G ??= Infinity;
970
+ let K = getFormattedValueFn$2(W, G);
971
+ return {
972
+ type: FILTERS.RANGE,
973
+ key: H,
974
+ value: K,
975
+ params: U
976
+ };
977
+ }
978
+ const isMapRangeFilter = (f) => isRangeFilter(f) || isScriptedRangeFilter(f), mapRange = (f) => {
979
+ if (!isMapRangeFilter(f)) throw f;
980
+ return getParams$2(f);
981
+ };
982
+ var import_lodash$21 = require_lodash();
983
+ const mapExists = (f) => {
984
+ if (isExistsFilter(f)) return {
985
+ type: FILTERS.EXISTS,
986
+ value: FILTERS.EXISTS,
987
+ key: (0, import_lodash$21.get)(f, "exists.field")
988
+ };
989
+ throw f;
990
+ }, mapMissing = (f) => {
991
+ if (isMissingFilter(f)) return {
992
+ type: FILTERS.MISSING,
993
+ value: FILTERS.MISSING,
994
+ key: f.missing.field
995
+ };
996
+ throw f;
997
+ }, mapQueryString = (f) => {
998
+ if (isQueryStringFilter(f)) return {
999
+ type: FILTERS.QUERY_STRING,
1000
+ key: "query",
1001
+ value: f.query.query_string.query
1002
+ };
1003
+ throw f;
1004
+ };
1005
+ var getFormattedValueFn$1 = (f) => (V) => {
1006
+ let H = V ? {
1007
+ topLeft: V.convert(f.top_left),
1008
+ bottomRight: V.convert(f.bottom_right)
1009
+ } : {
1010
+ topLeft: JSON.stringify(f.top_left),
1011
+ bottomRight: JSON.stringify(f.bottom_right)
1012
+ };
1013
+ return H.topLeft + " to " + H.bottomRight;
1014
+ }, getParams$1 = (f) => {
1015
+ let V = Object.keys(f.geo_bounding_box).filter((f) => f !== "ignore_unmapped")[0], H = f.geo_bounding_box[V];
1016
+ return {
1017
+ key: V,
1018
+ params: H,
1019
+ type: FILTERS.GEO_BOUNDING_BOX,
1020
+ value: getFormattedValueFn$1(H)
1021
+ };
1022
+ };
1023
+ const mapGeoBoundingBox = (f) => {
1024
+ if (!isGeoBoundingBoxFilter(f)) throw f;
1025
+ return getParams$1(f);
1026
+ };
1027
+ var POINTS_SEPARATOR = ", ", getFormattedValueFn = (f) => (V) => f.map((f) => V ? V.convert(f) : JSON.stringify(f)).join(POINTS_SEPARATOR);
1028
+ function getParams(f) {
1029
+ let V = Object.keys(f.geo_polygon).filter((f) => f !== "ignore_unmapped")[0], H = f.geo_polygon[V];
1030
+ return {
1031
+ key: V,
1032
+ params: H,
1033
+ type: FILTERS.GEO_POLYGON,
1034
+ value: getFormattedValueFn(H.points || [])
1035
+ };
1036
+ }
1037
+ function mapGeoPolygon(f) {
1038
+ if (!isGeoPolygonFilter(f)) throw f;
1039
+ return getParams(f);
1040
+ }
1041
+ var import_lodash$20 = require_lodash();
1042
+ const mapDefault = (f) => {
1043
+ let V = /(^\$|meta)/, H = (0, import_lodash$20.find)((0, import_lodash$20.keys)(f), (f) => !f.match(V));
1044
+ if (H) return {
1045
+ type: FILTERS.CUSTOM,
1046
+ key: H,
1047
+ value: JSON.stringify((0, import_lodash$20.get)(f, H, {}))
1048
+ };
1049
+ throw f;
1050
+ };
1051
+ var noop$2 = () => {
1052
+ throw Error("No mappings have been found for filter.");
1053
+ };
1054
+ const generateMappingChain = (f, V = noop$2) => (H) => {
1055
+ try {
1056
+ return f(H);
1057
+ } catch (f) {
1058
+ if (f === H) return V(H);
1059
+ throw f;
1060
+ }
1061
+ };
1062
+ var import_lodash$19 = require_lodash();
1063
+ function mapFilter(f) {
1064
+ let V = [
1065
+ mapSpatialFilter,
1066
+ mapMatchAll,
1067
+ mapRange,
1068
+ mapPhrase,
1069
+ mapPhrases,
1070
+ mapExists,
1071
+ mapMissing,
1072
+ mapQueryString,
1073
+ mapGeoBoundingBox,
1074
+ mapGeoPolygon,
1075
+ mapDefault
1076
+ ], H = (0, import_lodash$19.reduceRight)(V, (f, V) => generateMappingChain(V, f), () => {
1077
+ throw Error("No mappings have been found for filter.");
1078
+ })(f);
1079
+ return f.meta = f.meta || {}, f.meta.type = H.type, f.meta.key = H.key, f.meta.value = H.value, f.meta.params = H.params, f.meta.disabled = !!f.meta.disabled, f.meta.negate = !!f.meta.negate, f.meta.alias = f.meta.alias || null, f;
1080
+ }
1081
+ var import_lodash$18 = require_lodash();
1082
+ const mapAndFlattenFilters = (f) => (0, import_lodash$18.compact)((0, import_lodash$18.flatten)(f)).map((f) => mapFilter(f));
1083
+ var import_lodash$17 = require_lodash(), isEnabled = (f) => f && f.meta && !f.meta.disabled;
1084
+ const onlyDisabledFiltersChanged = (f, V) => {
1085
+ let H = (0, import_lodash$17.filter)(f || [], isEnabled);
1086
+ return compareFilters((0, import_lodash$17.filter)(V || [], isEnabled), H, COMPARE_ALL_OPTIONS);
1087
+ };
1088
+ var import_lodash$16 = /* @__PURE__ */ __toESM(require_lodash(), 1), FilterManager = class f {
1089
+ filters = [];
1090
+ updated$ = new Subject();
1091
+ fetch$ = new Subject();
1092
+ uiSettings;
1093
+ constructor(f) {
1094
+ this.uiSettings = f;
1095
+ }
1096
+ mergeIncomingFilters(V) {
1097
+ let H = V.globalFilters, U = V.appFilters, W = [];
1098
+ return import_lodash$16.default.each(U, function(f, V) {
1099
+ let U = import_lodash$16.default.find(H, function(V) {
1100
+ return compareFilters(V, f);
1101
+ });
1102
+ if (!U) return W.push(f);
1103
+ import_lodash$16.default.assignIn(U.meta, f.meta);
1104
+ }), f.mergeFilters(W, H);
1105
+ }
1106
+ static mergeFilters(f, V) {
1107
+ return uniqFilters(f.reverse().concat(V.reverse())).reverse();
1108
+ }
1109
+ static partitionFilters(f) {
1110
+ let [V, H] = import_lodash$16.default.partition(f, isFilterPinned);
1111
+ return {
1112
+ globalFilters: V,
1113
+ appFilters: H
1114
+ };
1115
+ }
1116
+ handleStateUpdate(f) {
1117
+ f.sort(sortFilters);
1118
+ let V = !compareFilters(this.filters, f, COMPARE_ALL_OPTIONS), H = onlyDisabledFiltersChanged(f, this.filters);
1119
+ this.filters = f, V && (this.updated$.next(), H || this.fetch$.next());
1120
+ }
1121
+ getFilters() {
1122
+ return import_lodash$16.default.cloneDeep(this.filters);
1123
+ }
1124
+ getAppFilters() {
1125
+ let { appFilters: f } = this.getPartitionedFilters();
1126
+ return f;
1127
+ }
1128
+ getGlobalFilters() {
1129
+ let { globalFilters: f } = this.getPartitionedFilters();
1130
+ return f;
1131
+ }
1132
+ getPartitionedFilters() {
1133
+ return f.partitionFilters(this.getFilters());
1134
+ }
1135
+ getUpdates$() {
1136
+ return this.updated$.asObservable();
1137
+ }
1138
+ getFetches$() {
1139
+ return this.fetch$.asObservable();
1140
+ }
1141
+ addFilters(V, H = !0) {
1142
+ if (Array.isArray(V) || (V = [V]), V.length === 0) return;
1143
+ let U = H ? FilterStateStore.GLOBAL_STATE : FilterStateStore.APP_STATE;
1144
+ f.setFiltersStore(V, U);
1145
+ let W = mapAndFlattenFilters(V), G = f.partitionFilters(W), K = this.getPartitionedFilters();
1146
+ K.appFilters.push(...G.appFilters), K.globalFilters.push(...G.globalFilters);
1147
+ let q = this.mergeIncomingFilters(K);
1148
+ this.handleStateUpdate(q);
1149
+ }
1150
+ setFilters(V, H = !0) {
1151
+ let U = H ? FilterStateStore.GLOBAL_STATE : FilterStateStore.APP_STATE;
1152
+ f.setFiltersStore(V, U);
1153
+ let W = mapAndFlattenFilters(V), G = f.partitionFilters(W), K = this.mergeIncomingFilters(G);
1154
+ this.handleStateUpdate(K);
1155
+ }
1156
+ setGlobalFilters(V) {
1157
+ V = mapAndFlattenFilters(V), f.setFiltersStore(V, FilterStateStore.GLOBAL_STATE, !0);
1158
+ let { appFilters: H } = this.getPartitionedFilters(), U = this.mergeIncomingFilters({
1159
+ appFilters: H,
1160
+ globalFilters: V
1161
+ });
1162
+ this.handleStateUpdate(U);
1163
+ }
1164
+ setAppFilters(V) {
1165
+ V = mapAndFlattenFilters(V), f.setFiltersStore(V, FilterStateStore.APP_STATE, !0);
1166
+ let { globalFilters: H } = this.getPartitionedFilters(), U = this.mergeIncomingFilters({
1167
+ globalFilters: H,
1168
+ appFilters: V
1169
+ });
1170
+ this.handleStateUpdate(U);
1171
+ }
1172
+ removeFilter(f) {
1173
+ let V = import_lodash$16.default.findIndex(this.filters, (V) => import_lodash$16.default.isEqual(V.meta, f.meta) && import_lodash$16.default.isEqual(V.query, f.query));
1174
+ if (V >= 0) {
1175
+ let f = import_lodash$16.default.cloneDeep(this.filters);
1176
+ f.splice(V, 1), this.handleStateUpdate(f);
1177
+ }
1178
+ }
1179
+ removeAll() {
1180
+ this.setFilters([]);
1181
+ }
1182
+ static setFiltersStore(f, V, H = !1) {
1183
+ import_lodash$16.default.map(f, (f) => {
1184
+ (H || f.$state === void 0) && (f.$state = { store: V });
1185
+ });
1186
+ }
1187
+ }, import_lodash$15 = /* @__PURE__ */ __toESM(require_lodash(), 1), valueOf = function(f) {
1188
+ if (f) return f.valueOf();
1189
+ };
1190
+ function areRefreshIntervalsDifferent(f, V) {
1191
+ if (import_lodash$15.default.isObject(f) && import_lodash$15.default.isObject(V)) {
1192
+ if (valueOf(f.value) !== valueOf(V.value) || valueOf(f.pause) !== valueOf(V.pause)) return !0;
1193
+ } else return !import_lodash$15.default.isEqual(f, V);
1194
+ return !1;
1195
+ }
1196
+ function areTimeRangesDifferent(f, V) {
1197
+ if (f && V && import_lodash$15.default.isObject(f) && import_lodash$15.default.isObject(V)) {
1198
+ if (valueOf(f.to) !== valueOf(V.to) || valueOf(f.from) !== valueOf(V.from)) return !0;
1199
+ } else return !import_lodash$15.default.isEqual(f, V);
1200
+ return !1;
1201
+ }
1202
+ var import_query_string = require_query_string();
1203
+ function parseQueryString() {
1204
+ let f = window.location.href.split("?");
1205
+ return f.length <= 1 ? {} : (0, import_query_string.parse)(f[1], { sort: !1 });
1206
+ }
1207
+ function getForceNow() {
1208
+ let f = parseQueryString().forceNow;
1209
+ if (!f) return;
1210
+ let V = Date.parse(f);
1211
+ if (isNaN(V)) throw Error(`forceNow query parameter, ${f}, can't be parsed by Date.parse`);
1212
+ return new Date(V);
1213
+ }
1214
+ var import_lodash$14 = /* @__PURE__ */ __toESM(require_lodash(), 1);
1215
+ init_moment();
1216
+ var Timefilter = class {
1217
+ enabledUpdated$ = new BehaviorSubject(!1);
1218
+ timeUpdate$ = new Subject();
1219
+ refreshIntervalUpdate$ = new Subject();
1220
+ autoRefreshFetch$ = new Subject();
1221
+ fetch$ = new Subject();
1222
+ _time;
1223
+ _refreshInterval;
1224
+ _history;
1225
+ _isTimeRangeSelectorEnabled = !1;
1226
+ _isAutoRefreshSelectorEnabled = !1;
1227
+ _autoRefreshIntervalId = 0;
1228
+ timeDefaults;
1229
+ refreshIntervalDefaults;
1230
+ constructor(f, V) {
1231
+ this._history = V, this.timeDefaults = f.timeDefaults, this.refreshIntervalDefaults = f.refreshIntervalDefaults, this._time = f.timeDefaults, this.setRefreshInterval(f.refreshIntervalDefaults);
1232
+ }
1233
+ isTimeRangeSelectorEnabled() {
1234
+ return this._isTimeRangeSelectorEnabled;
1235
+ }
1236
+ isAutoRefreshSelectorEnabled() {
1237
+ return this._isAutoRefreshSelectorEnabled;
1238
+ }
1239
+ getEnabledUpdated$ = () => this.enabledUpdated$.asObservable();
1240
+ getTimeUpdate$ = () => this.timeUpdate$.asObservable();
1241
+ getRefreshIntervalUpdate$ = () => this.refreshIntervalUpdate$.asObservable();
1242
+ getAutoRefreshFetch$ = () => this.autoRefreshFetch$.asObservable();
1243
+ getFetch$ = () => this.fetch$.asObservable();
1244
+ getTime = () => {
1245
+ let { from: f, to: V } = this._time;
1246
+ return {
1247
+ ...this._time,
1248
+ from: moment_default.isMoment(f) ? f.toISOString() : f,
1249
+ to: moment_default.isMoment(V) ? V.toISOString() : V
1250
+ };
1251
+ };
1252
+ setTime = (f) => {
1253
+ let V = Object.assign(this.getTime(), f);
1254
+ areTimeRangesDifferent(this.getTime(), V) && (this._time = {
1255
+ from: V.from,
1256
+ to: V.to
1257
+ }, this._history.add(this._time), this.timeUpdate$.next(), this.fetch$.next());
1258
+ };
1259
+ getRefreshInterval = () => import_lodash$14.default.clone(this._refreshInterval);
1260
+ setRefreshInterval = (f) => {
1261
+ let V = this.getRefreshInterval(), H = {
1262
+ ...V,
1263
+ ...f
1264
+ };
1265
+ H.value <= 0 && (H.value = 0, H.pause = !0), this._refreshInterval = {
1266
+ value: H.value,
1267
+ pause: H.pause
1268
+ }, V && areRefreshIntervalsDifferent(V, H) && (this.refreshIntervalUpdate$.next(), !H.pause && H.value !== 0 && this.fetch$.next()), clearInterval(this._autoRefreshIntervalId), H.pause || (this._autoRefreshIntervalId = window.setInterval(() => this.autoRefreshFetch$.next(), H.value));
1269
+ };
1270
+ createFilter = (f, V) => getTime(f, V || this._time, { forceNow: this.getForceNow() });
1271
+ getBounds() {
1272
+ return this.calculateBounds(this._time);
1273
+ }
1274
+ calculateBounds(f) {
1275
+ return typeof calculateBounds != "function" && console.log(typeof calculateBounds, calculateBounds), calculateBounds(f, { forceNow: this.getForceNow() });
1276
+ }
1277
+ getActiveBounds() {
1278
+ if (this.isTimeRangeSelectorEnabled()) return this.getBounds();
1279
+ }
1280
+ enableTimeRangeSelector = () => {
1281
+ this._isTimeRangeSelectorEnabled = !0, this.enabledUpdated$.next(!0);
1282
+ };
1283
+ disableTimeRangeSelector = () => {
1284
+ this._isTimeRangeSelectorEnabled = !1, this.enabledUpdated$.next(!1);
1285
+ };
1286
+ enableAutoRefreshSelector = () => {
1287
+ this._isAutoRefreshSelectorEnabled = !0, this.enabledUpdated$.next(!0);
1288
+ };
1289
+ disableAutoRefreshSelector = () => {
1290
+ this._isAutoRefreshSelectorEnabled = !1, this.enabledUpdated$.next(!1);
1291
+ };
1292
+ getTimeDefaults() {
1293
+ return import_lodash$14.default.cloneDeep(this.timeDefaults);
1294
+ }
1295
+ getRefreshIntervalDefaults() {
1296
+ return import_lodash$14.default.cloneDeep(this.refreshIntervalDefaults);
1297
+ }
1298
+ getForceNow = () => getForceNow();
1299
+ }, import_lodash$13 = /* @__PURE__ */ __toESM(require_lodash(), 1), defaultIsDuplicate = (f, V) => import_lodash$13.default.isEqual(f, V), PersistedLog = class {
1300
+ name;
1301
+ maxLength;
1302
+ filterDuplicates;
1303
+ isDuplicate;
1304
+ storage;
1305
+ items;
1306
+ update$ = new BehaviorSubject(void 0);
1307
+ constructor(f, V = {}, H) {
1308
+ this.name = f, this.maxLength = typeof V.maxLength == "string" ? this.maxLength = parseInt(V.maxLength, 10) : V.maxLength, this.filterDuplicates = V.filterDuplicates || !1, this.isDuplicate = V.isDuplicate || defaultIsDuplicate, this.storage = H, this.items = this.storage.get(this.name) || [], this.maxLength !== void 0 && !isNaN(this.maxLength) && (this.items = import_lodash$13.default.take(this.items, this.maxLength));
1309
+ }
1310
+ add(f) {
1311
+ return f == null ? this.items : (this.filterDuplicates && import_lodash$13.default.remove(this.items, (V) => this.isDuplicate(V, f)), this.items.unshift(f), this.maxLength && !isNaN(this.maxLength) && (this.items = import_lodash$13.default.take(this.items, this.maxLength)), this.storage.set(this.name, this.items), this.update$.next(void 0), this.items);
1312
+ }
1313
+ get() {
1314
+ return import_lodash$13.default.cloneDeep(this.items);
1315
+ }
1316
+ get$() {
1317
+ return this.update$.pipe(map(() => this.get()));
1318
+ }
1319
+ };
1320
+ init_moment();
1321
+ var TimeHistory = class {
1322
+ history;
1323
+ constructor(f) {
1324
+ this.history = new PersistedLog("infini.timepicker.timeHistory", {
1325
+ maxLength: 10,
1326
+ filterDuplicates: !0,
1327
+ isDuplicate: (f, V) => f.from === V.from && f.to === V.to
1328
+ }, f);
1329
+ }
1330
+ add(f) {
1331
+ if (!f || !f.from || !f.to) return;
1332
+ let V = {
1333
+ from: moment_default.isMoment(f.from) ? f.from.toISOString() : f.from,
1334
+ to: moment_default.isMoment(f.to) ? f.to.toISOString() : f.to
1335
+ };
1336
+ this.history.add(V);
1337
+ }
1338
+ get() {
1339
+ return this.history.get();
1340
+ }
1341
+ };
1342
+ init_moment(), require_lodash(), require_lodash(), require_target();
1343
+ var bannerId;
1344
+ const onRedirectNoIndexPattern = (f, V, H) => () => {
1345
+ let U = f.management.kibana.indexPatterns ? "/management/kibana/indexPatterns" : "/home", W;
1346
+ W && clearTimeout(W);
1347
+ let K = "To visualize and explore data in Kibana, you must create an index pattern to retrieve data from Elasticsearch.";
1348
+ return bannerId = H.banners.replace(bannerId, toMountPoint(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiCallOut, {
1349
+ color: "warning",
1350
+ iconType: "iInCircle",
1351
+ title: K
1352
+ }))), W = setTimeout(() => {
1353
+ H.banners.remove(bannerId), W = void 0;
1354
+ }, 15e3), U === "/home" ? V("home") : V("management", { path: `/kibana/indexPatterns?bannerMessage=${K}` }), new Promise(() => {});
1355
+ }, onUnsupportedTimePattern = (f, V) => ({ id: H, title: U, index: W }) => {
1356
+ let K = `Currently querying all indices matching ${W}. ${U} should be migrated to a wildcard-based index pattern.`;
1357
+ f.addWarning({
1358
+ title: "Support for time interval index patterns removed",
1359
+ text: toMountPoint(/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: K }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiFlexGroup, {
1360
+ justifyContent: "flexEnd",
1361
+ gutterSize: "s",
1362
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiFlexItem, {
1363
+ grow: !1,
1364
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiButton, {
1365
+ size: "s",
1366
+ onClick: () => V("management", { path: `/kibana/index_patterns/index_pattern/${H || ""}` }),
1367
+ children: "Edit index pattern"
1368
+ })
1369
+ })
1370
+ })] }))
1371
+ });
1372
+ };
1373
+ var API_BASE_URL = "/view/", IndexPatternsApiClient = class {
1374
+ http;
1375
+ constructor(f) {
1376
+ this.http = f;
1377
+ }
1378
+ _request(f, V) {
1379
+ return this.http.fetch(f, { query: V }).catch((f) => {
1380
+ throw f.body.statusCode === 404 && f.body.attributes?.code === "no_matching_indices" ? new IndexPatternMissingIndices(f.body.message) : Error(f.body.message || f.body.error || `${f.body.statusCode} Response`);
1381
+ });
1382
+ }
1383
+ _getUrl(f) {
1384
+ return this.http.getServerBasePath() + API_BASE_URL + f.filter(Boolean).map(encodeURIComponent).join("/");
1385
+ }
1386
+ getFieldsForTimePattern(f = {}) {
1387
+ let { pattern: V, lookBack: H, metaFields: U } = f, W = this._getUrl(["_fields_for_time_pattern"]);
1388
+ return this._request(W, {
1389
+ pattern: V,
1390
+ look_back: H,
1391
+ meta_fields: U
1392
+ }).then((f) => f.fields);
1393
+ }
1394
+ getFieldsForWildcard(f = {}) {
1395
+ let { pattern: V, metaFields: H, type: U, params: W } = f, G, K;
1396
+ return G = this._getUrl(["_fields_for_wildcard"]), K = {
1397
+ pattern: V,
1398
+ meta_fields: H
1399
+ }, this._request(G, K).then((f) => f.fields);
1400
+ }
1401
+ }, import_lodash$10 = require_lodash(), simpleSavedObjectToSavedObject = (f) => ({
1402
+ version: f._version,
1403
+ ...(0, import_lodash$10.omit)(f, "_version")
1404
+ }), SavedObjectsClientPublicToCommon = class {
1405
+ savedObjectClient;
1406
+ constructor(f) {
1407
+ this.savedObjectClient = f;
1408
+ }
1409
+ async find(f) {
1410
+ return (await this.savedObjectClient.find(f)).savedObjects.map(simpleSavedObjectToSavedObject);
1411
+ }
1412
+ async get(f, V) {
1413
+ return simpleSavedObjectToSavedObject(await this.savedObjectClient.get(f, V));
1414
+ }
1415
+ async update(f, V, H, U) {
1416
+ return simpleSavedObjectToSavedObject(await this.savedObjectClient.update(f, V, H, U));
1417
+ }
1418
+ async create(f, V, H) {
1419
+ return simpleSavedObjectToSavedObject(await this.savedObjectClient.create(f, V, H));
1420
+ }
1421
+ delete(f, V) {
1422
+ return this.savedObjectClient.delete(f, V);
1423
+ }
1424
+ }, import_lodash$9 = require_lodash(), getConfig = (f, V) => getUiSettings().get(f, V), DefaultFieldFormat = FieldFormat.from(import_lodash$9.identity);
1425
+ const deserializeFieldFormat = function(f) {
1426
+ return f ? getFormatWithAggs((f) => {
1427
+ let { id: V, params: H = {} } = f;
1428
+ if (V) {
1429
+ let f = this.getType(V);
1430
+ if (f) return new f(H, getConfig);
1431
+ }
1432
+ return new DefaultFieldFormat();
1433
+ })(f) : new DefaultFieldFormat();
1434
+ };
1435
+ function getTimezone() {
1436
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
1437
+ }
1438
+ var import_lodash$8 = require_lodash();
1439
+ init_moment();
1440
+ var ISO_FORMAT = "YYYY-MM-DDTHH:mm:ss.SSSZ", tz = getTimezone(), DateFormat = class extends FieldFormat {
1441
+ static id = FIELD_FORMAT_IDS.DATE;
1442
+ static title = "Date";
1443
+ static fieldType = KBN_FIELD_TYPES.DATE;
1444
+ memoizedConverter = import_lodash$8.noop;
1445
+ memoizedPattern = "";
1446
+ timeZone = "";
1447
+ getParamDefaults() {
1448
+ return {
1449
+ pattern: this.getConfig("dateFormat") ?? ISO_FORMAT,
1450
+ timezone: this.getConfig("dateFormat:tz") ?? tz
1451
+ };
1452
+ }
1453
+ textConvert = (f) => {
1454
+ let V = this.param("pattern"), H = this.param("timezone"), U = this.timeZone !== H, W = this.memoizedPattern !== V;
1455
+ return (U || W) && (this.timeZone = H, this.memoizedPattern = V, this.memoizedConverter = (0, import_lodash$8.memoize)(function(f) {
1456
+ if (f == null) return "-";
1457
+ let U = moment_default(f).tz(H, !0);
1458
+ return U.isValid() ? U.format(V) : f;
1459
+ })), this.memoizedConverter(f);
1460
+ };
1461
+ }, import_lodash$7 = require_lodash();
1462
+ init_moment();
1463
+ function analysePatternForFract(f) {
1464
+ let V = f.match("S+"), H = V ? V[0] : "";
1465
+ return {
1466
+ length: H.length,
1467
+ patternNanos: H,
1468
+ pattern: f,
1469
+ patternEscaped: H ? f.replace(V, `[${V}]`) : ""
1470
+ };
1471
+ }
1472
+ function formatWithNanos(f, V, H) {
1473
+ if (H.length <= 3) return f.format(H.pattern);
1474
+ {
1475
+ let U = f.format(H.patternEscaped), W = V.substr(20, V.length - 21).padEnd(9, "0").substr(0, H.patternNanos.length);
1476
+ return U.replace(H.patternNanos, W);
1477
+ }
1478
+ }
1479
+ const baseFormattersPublic = [
1480
+ DateFormat,
1481
+ class extends FieldFormat {
1482
+ static id = FIELD_FORMAT_IDS.DATE_NANOS;
1483
+ static title = "Date nanos";
1484
+ static fieldType = KBN_FIELD_TYPES.DATE;
1485
+ memoizedConverter = import_lodash$7.noop;
1486
+ memoizedPattern = "";
1487
+ timeZone = "";
1488
+ getParamDefaults() {
1489
+ return {
1490
+ pattern: this.getConfig("dateNanosFormat"),
1491
+ fallbackPattern: this.getConfig("dateFormat"),
1492
+ timezone: this.getConfig("dateFormat:tz")
1493
+ };
1494
+ }
1495
+ textConvert = (f) => {
1496
+ let V = this.param("pattern"), H = this.param("timezone"), U = analysePatternForFract(V), W = this.param("patternFallback"), G = this.timeZone !== H, K = this.memoizedPattern !== V;
1497
+ return (G || K) && (this.timeZone = H, this.memoizedPattern = V, this.memoizedConverter = (0, import_lodash$7.memoize)(function(f) {
1498
+ if (f == null) return "-";
1499
+ let V = moment_default(f);
1500
+ return typeof f != "string" && V.isValid() ? V.format(W) : V.isValid() ? formatWithNanos(V, f, U) : f;
1501
+ })), this.memoizedConverter(f);
1502
+ };
1503
+ },
1504
+ ...baseFormatters
1505
+ ];
1506
+ var Fallback$2 = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}), LazySearchBar = React.lazy(() => import("./search_bar-Caqi1NVo.js"));
1507
+ const SearchBar = withKibana((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Suspense, {
1508
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback$2, {}),
1509
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LazySearchBar, { ...f })
1510
+ })), useFilterManager = (f) => {
1511
+ let [V, H] = useState(f.filters || f.filterManager.getFilters());
1512
+ return useEffect(() => {
1513
+ let V = new Subscription();
1514
+ return V.add(f.filterManager.getUpdates$().subscribe({ next: () => {
1515
+ H(f.filterManager.getFilters());
1516
+ } })), () => {
1517
+ V.unsubscribe();
1518
+ };
1519
+ }, [f.filterManager]), { filters: V };
1520
+ }, useTimefilter = (f) => {
1521
+ let V = {
1522
+ from: f.dateRangeFrom || f.timefilter.getTime().from,
1523
+ to: f.dateRangeTo || f.timefilter.getTime().to
1524
+ }, H = {
1525
+ value: f.refreshInterval || f.timefilter.getRefreshInterval().value,
1526
+ pause: f.isRefreshPaused || f.timefilter.getRefreshInterval().pause
1527
+ }, [U, W] = useState(V), [G, K] = useState(H);
1528
+ return useEffect(() => {
1529
+ let V = new Subscription();
1530
+ return V.add(f.timefilter.getRefreshIntervalUpdate$().subscribe({ next: () => {
1531
+ K(f.timefilter.getRefreshInterval());
1532
+ } })), V.add(f.timefilter.getTimeUpdate$().subscribe({ next: () => {
1533
+ W(f.timefilter.getTime());
1534
+ } })), () => {
1535
+ V.unsubscribe();
1536
+ };
1537
+ }, [f.timefilter]), {
1538
+ refreshInterval: G,
1539
+ timeRange: U
1540
+ };
1541
+ }, useQueryStringManager = (f) => {
1542
+ let [V, H] = useState(f.query || f.queryStringManager.getQuery());
1543
+ return useEffect(() => {
1544
+ let V = new Subscription();
1545
+ return V.add(f.queryStringManager.getUpdates$().subscribe({ next: () => {
1546
+ H(f.queryStringManager.getQuery());
1547
+ } })), () => {
1548
+ V.unsubscribe();
1549
+ };
1550
+ }, [f.queryStringManager]), { query: V };
1551
+ };
1552
+ var import_lodash$6 = /* @__PURE__ */ __toESM(require_lodash(), 1), defaultFiltersUpdated = (f) => (V) => {
1553
+ f.filterManager.setFilters(V), f.onQuerySubmit && f.onQuerySubmit();
1554
+ }, defaultOnRefreshChange = (f) => {
1555
+ let V = f.timefilter;
1556
+ return (f) => {
1557
+ V.setRefreshInterval({
1558
+ value: f.refreshInterval,
1559
+ pause: f.isPaused
1560
+ });
1561
+ };
1562
+ }, defaultOnQuerySubmit = (f, V) => {
1563
+ if (!f.useDefaultBehaviors) return f.onQuerySubmit;
1564
+ let H = f.timefilter;
1565
+ return (U) => {
1566
+ !import_lodash$6.default.isEqual(H.getTime(), U.dateRange) || !import_lodash$6.default.isEqual(U.query, V) ? (H.setTime(U.dateRange), U.query ? f.queryString.setQuery(U.query) : f.queryString.clearQuery(), f.onQuerySubmit && f.onQuerySubmit({
1567
+ dateRange: U.dateRange,
1568
+ query: U.query || V
1569
+ }, !0)) : f.onQuerySubmit && f.onQuerySubmit({
1570
+ dateRange: H.getTime(),
1571
+ query: V
1572
+ }, !1);
1573
+ };
1574
+ }, overrideDefaultBehaviors = (f) => f.useDefaultBehaviors ? {} : f;
1575
+ function createSearchBar() {
1576
+ return (f) => {
1577
+ let { useDefaultBehaviors: V, indexPatterns: H } = f, U = useRef(f.onQuerySubmit), { filters: W } = useFilterManager({
1578
+ filters: f.filters,
1579
+ filterManager: f.filterManager
1580
+ }), { query: G } = useQueryStringManager({
1581
+ query: f.query,
1582
+ queryStringManager: f.queryStringManager
1583
+ }), { timeRange: K, refreshInterval: q } = useTimefilter({
1584
+ dateRangeFrom: f.dateRangeFrom,
1585
+ dateRangeTo: f.dateRangeTo,
1586
+ refreshInterval: f.refreshInterval,
1587
+ isRefreshPaused: f.isRefreshPaused,
1588
+ timefilter: f.timefilter
1589
+ });
1590
+ return useEffect(() => {
1591
+ !V || U.current;
1592
+ }, [
1593
+ G,
1594
+ K,
1595
+ V
1596
+ ]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SearchBar, {
1597
+ showAutoRefreshOnly: f.showAutoRefreshOnly,
1598
+ showDatePicker: f.showDatePicker,
1599
+ showFilterBar: f.showFilterBar,
1600
+ showQueryBar: f.showQueryBar,
1601
+ showQueryInput: f.showQueryInput,
1602
+ showSaveQuery: f.showSaveQuery,
1603
+ screenTitle: f.screenTitle,
1604
+ indexPatterns: f.indexPatterns,
1605
+ indicateNoData: f.indicateNoData,
1606
+ timeHistory: f.timefilter.history,
1607
+ dateRangeFrom: K.from,
1608
+ dateRangeTo: K.to,
1609
+ refreshInterval: q.value,
1610
+ isRefreshPaused: q.pause,
1611
+ filters: W,
1612
+ query: G,
1613
+ onFiltersUpdated: defaultFiltersUpdated(f),
1614
+ onRefreshChange: defaultOnRefreshChange(f),
1615
+ onQuerySubmit: defaultOnQuerySubmit(f, G),
1616
+ ...overrideDefaultBehaviors(f),
1617
+ storage: f.storage,
1618
+ services: f.services,
1619
+ selectedIndexPattern: f.selectedIndexPattern,
1620
+ setIndexPattern: f.setIndexPattern,
1621
+ indices: f.indices,
1622
+ renderTimeField: f.renderTimeField,
1623
+ histogramData: f.histogramData,
1624
+ timefilterUpdateHandler: f.timefilterUpdateHandler,
1625
+ histogramOpts: f.histogramOpts,
1626
+ timeSetting: f.timeSetting
1627
+ });
1628
+ };
1629
+ }
1630
+ var import_lodash$5 = /* @__PURE__ */ __toESM(require_lodash(), 1);
1631
+ function getExistingFilter(f, V, H) {
1632
+ return import_lodash$5.default.find(f, function(f) {
1633
+ if (f) {
1634
+ if (V === "_exists_" && isExistsFilter(f)) return f.exists.field === H;
1635
+ if (isPhraseFilter(f)) return getPhraseFilterField(f) === V && getPhraseFilterValue(f) === H;
1636
+ if (isScriptedPhraseFilter(f)) return f.meta.field === V && f.script.script.params.value === H;
1637
+ }
1638
+ });
1639
+ }
1640
+ function updateExistingFilter(f, V) {
1641
+ f.meta.disabled = !1, f.meta.negate !== V && (f.meta.negate = !f.meta.negate);
1642
+ }
1643
+ function generateFilters(f, V, H, U, W) {
1644
+ H = Array.isArray(H) ? H : [H];
1645
+ let G = import_lodash$5.default.isObject(V) ? V : { name: V }, K = G.name, q = [], J = f.getAppFilters(), Y = U === "-", X;
1646
+ return import_lodash$5.default.each(H, function(f) {
1647
+ let V = getExistingFilter(J, K, f);
1648
+ if (V) updateExistingFilter(V, Y), X = V;
1649
+ else {
1650
+ let V = { id: W }, H = K === "_exists_" ? FILTERS.EXISTS : FILTERS.PHRASE, U = K === "_exists_" ? { name: f } : G, q = f == null;
1651
+ X = buildFilter(V, U, q ? FILTERS.EXISTS : H, q ? !Y : Y, !1, f, null, FilterStateStore.APP_STATE);
1652
+ }
1653
+ q.push(X);
1654
+ }), q;
1655
+ }
1656
+ var Fallback$1 = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}), LazyFilterLabel = React.lazy(() => import("./filter_label-DRJC3vpe.js"));
1657
+ const FilterLabel = (f) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Suspense, {
1658
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback$1, {}),
1659
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LazyFilterLabel, { ...f })
1660
+ });
1661
+ React.lazy(() => import("./query_bar_top_row-D6a48VTk.js")), withKibana(React.lazy(() => import("./query_string_input-75waAcWy.js")));
1662
+ var Fallback = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}), LazySuggestionsComponent = React.lazy(() => import("./suggestions_component-BBHwbjYT.js"));
1663
+ const SuggestionsComponent = (f) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Suspense, {
1664
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {}),
1665
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LazySuggestionsComponent, { ...f })
1666
+ });
1667
+ function getQueryLog(f, V, H, U) {
1668
+ return new PersistedLog(`typeahead:${H}-${U}`, {
1669
+ maxLength: f.get(UI_SETTINGS.HISTORY_LIMIT),
1670
+ filterDuplicates: !0
1671
+ }, V);
1672
+ }
1673
+ var import_lodash$4 = /* @__PURE__ */ __toESM(require_lodash(), 1);
1674
+ function fromUser(f) {
1675
+ if (import_lodash$4.default.isEmpty(f)) return "";
1676
+ if (import_lodash$4.default.isObject(f)) return f;
1677
+ if (f ||= "", typeof f == "string") {
1678
+ let V = f.trim();
1679
+ if (V.length === 0) return "";
1680
+ if (V[0] === "{") try {
1681
+ return JSON.parse(V);
1682
+ } catch {
1683
+ return f;
1684
+ }
1685
+ else return f;
1686
+ }
1687
+ }
1688
+ var pairs = [
1689
+ "()",
1690
+ "[]",
1691
+ "{}",
1692
+ "''",
1693
+ "\"\""
1694
+ ], openers = pairs.map((f) => f[0]), closers = pairs.map((f) => f[1]);
1695
+ function matchPairs({ value: f, selectionStart: V, selectionEnd: H, key: U, metaKey: W, updateQuery: G, preventDefault: K }) {
1696
+ shouldMoveCursorForward(U, f, V, H) ? (K(), G(f, V + 1, H + 1)) : shouldInsertMatchingCloser(U, f, V, H) ? (K(), G(f.substr(0, V) + U + f.substring(V, H) + closers[openers.indexOf(U)] + f.substr(H), V + 1, H + 1)) : shouldRemovePair(U, W, f, V, H) && (K(), G(f.substr(0, H - 1) + f.substr(H + 1), V - 1, H - 1));
1697
+ }
1698
+ function shouldMoveCursorForward(f, V, H, U) {
1699
+ return !closers.includes(f) || H !== U ? !1 : V.charAt(U) === f;
1700
+ }
1701
+ function shouldInsertMatchingCloser(f, V, H, U) {
1702
+ if (!openers.includes(f)) return !1;
1703
+ if (H !== U) return !0;
1704
+ let W = V.charAt(H - 1), G = V.charAt(H + 1);
1705
+ return W === "\\" ? !1 : !(["\"", "'"].includes(f) && (isAlphanumeric(W) || isAlphanumeric(G)));
1706
+ }
1707
+ function shouldRemovePair(f, V, H, U, W) {
1708
+ return f !== "Backspace" || V || U !== W ? !1 : pairs.includes(H.substr(W - 1, 2));
1709
+ }
1710
+ function isAlphanumeric(f = "") {
1711
+ return f.match(/[a-zA-Z0-9_]/);
1712
+ }
1713
+ function toUser(f) {
1714
+ return f == null ? "" : typeof f == "object" ? f.query_string ? toUser(f.query_string.query) : JSON.stringify(f) : "" + f;
1715
+ }
1716
+ require_lodash(), React.lazy(() => import("./shard_failure_open_modal_button-BYTThYch.js")), require_lodash(), require_lodash(), require_lodash(), React.lazy(() => import("./index_pattern_select--iGeA3sP.js"));
1717
+ const indexPatterns = {
1718
+ ILLEGAL_CHARACTERS_KEY,
1719
+ CONTAINS_SPACES_KEY,
1720
+ ILLEGAL_CHARACTERS_VISIBLE,
1721
+ ILLEGAL_CHARACTERS,
1722
+ isDefault,
1723
+ isFilterable,
1724
+ isNestedField,
1725
+ validate: validateIndexPattern,
1726
+ getFromSavedObject,
1727
+ flattenHitWrapper,
1728
+ formatHitProvider
1729
+ }, search = {
1730
+ aggs: {
1731
+ CidrMask,
1732
+ dateHistogramInterval,
1733
+ intervalOptions,
1734
+ InvalidEsCalendarIntervalError,
1735
+ InvalidEsIntervalFormatError,
1736
+ Ipv4Address,
1737
+ isDateHistogramBucketAggConfig,
1738
+ isNumberType,
1739
+ isStringType,
1740
+ isType,
1741
+ isValidEsInterval,
1742
+ isValidInterval,
1743
+ parentPipelineType,
1744
+ parseEsInterval,
1745
+ parseInterval,
1746
+ propFilter,
1747
+ siblingPipelineType,
1748
+ termsAggFilter,
1749
+ toAbsoluteDates
1750
+ },
1751
+ getRequestInspectorStats,
1752
+ getResponseInspectorStats,
1753
+ tabifyAggResponse,
1754
+ tabifyGetColumns
1755
+ };
1756
+ export { BehaviorSubject as C, QuerySuggestionTypes as S, operate as T, onRedirectNoIndexPattern as _, fromUser as a, FilterManager as b, FilterLabel as c, baseFormattersPublic as d, getTimezone as f, onUnsupportedTimePattern as g, IndexPatternsApiClient as h, matchPairs as i, generateFilters as l, SavedObjectsClientPublicToCommon as m, search as n, getQueryLog as o, deserializeFieldFormat as p, toUser as r, SuggestionsComponent as s, indexPatterns as t, createSearchBar as u, TimeHistory as v, createOperatorSubscriber as w, AutocompleteService as x, Timefilter as y };