@perses-dev/prometheus-plugin 0.57.0 → 0.58.0-beta.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 (271) hide show
  1. package/__mf/css/async/3829.85c2cbf6.css +1 -0
  2. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  3. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  4. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  5. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  6. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  8. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  10. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  11. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  12. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  13. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  14. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  17. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  18. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  26. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  27. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  28. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  29. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  30. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  31. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  32. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  33. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  34. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  35. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  36. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  37. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  38. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  39. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  40. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  42. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  43. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  44. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  45. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  47. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  49. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  50. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  51. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  52. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  53. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  54. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  55. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  56. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  57. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  58. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  59. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  60. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  61. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  62. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  63. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  64. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  66. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  67. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  68. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  69. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  70. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  71. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  72. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  73. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  74. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  75. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  77. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  79. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  80. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  82. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  83. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  84. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  85. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  86. package/__mf/js/Prometheus.c5cd832d.js +7 -0
  87. package/__mf/js/async/1432.0bb0ef6b.js +1 -0
  88. package/__mf/js/async/1605.7c7a0998.js +110 -0
  89. package/__mf/js/async/{1605.dc180cb8.js.LICENSE.txt → 1605.7c7a0998.js.LICENSE.txt} +1 -1
  90. package/__mf/js/async/1616.ed429c53.js +1 -0
  91. package/__mf/js/async/1728.310a7d33.js +1 -0
  92. package/__mf/js/async/1969.a1e1979e.js +1 -0
  93. package/__mf/js/async/2043.c2948add.js +2 -0
  94. package/__mf/js/async/{2186.e58838a5.js → 2186.9a98bd8f.js} +2 -2
  95. package/__mf/js/async/2292.27a5ec4d.js +4 -0
  96. package/__mf/js/async/{9010.ca50fa9e.js.LICENSE.txt → 2292.27a5ec4d.js.LICENSE.txt} +1 -1
  97. package/__mf/js/async/2506.baf20a10.js +1 -0
  98. package/__mf/js/async/2814.fbf52858.js +1 -0
  99. package/__mf/js/async/3499.19c4bfa6.js +1 -0
  100. package/__mf/js/async/3829.f250b55a.js +7 -0
  101. package/__mf/js/async/{3652.6b591718.js.LICENSE.txt → 3829.f250b55a.js.LICENSE.txt} +19 -1
  102. package/__mf/js/async/392.233c0945.js +2 -0
  103. package/__mf/js/async/3963.81c8be7e.js +1 -0
  104. package/__mf/js/async/4121.9ed83f2a.js +2 -0
  105. package/__mf/js/async/4402.99ae853d.js +1 -0
  106. package/__mf/js/async/4626.e7ed0d7d.js +1 -0
  107. package/__mf/js/async/4800.cc42977e.js +22 -0
  108. package/__mf/js/async/4887.8af3673d.js +1 -0
  109. package/__mf/js/async/4987.f7360bdf.js +1 -0
  110. package/__mf/js/async/5002.bd952313.js +1 -0
  111. package/__mf/js/async/5071.5fcfd9a8.js +1 -0
  112. package/__mf/js/async/5440.52ec91ad.js +2 -0
  113. package/__mf/js/async/5587.e4d331db.js +1 -0
  114. package/__mf/js/async/5697.e17ba256.js +1 -0
  115. package/__mf/js/async/5763.ccf403b7.js +1 -0
  116. package/__mf/js/async/5922.ba33c996.js +1 -0
  117. package/__mf/js/async/6274.f04c9ecd.js +2 -0
  118. package/__mf/js/async/6438.b86a2aba.js +1 -0
  119. package/__mf/js/async/6507.71182781.js +1 -0
  120. package/__mf/js/async/7177.0ab860e0.js +1 -0
  121. package/__mf/js/async/7192.bbf62500.js +1 -0
  122. package/__mf/js/async/7462.e9a1c8bc.js +2 -0
  123. package/__mf/js/async/7647.82297501.js +1 -0
  124. package/__mf/js/async/7862.e13fbb9d.js +2 -0
  125. package/__mf/js/async/7894.9fe90396.js +1 -0
  126. package/__mf/js/async/7968.253f5f1d.js +1 -0
  127. package/__mf/js/async/7978.be30c741.js +1 -0
  128. package/__mf/js/async/8292.11dc2ca3.js +1 -0
  129. package/__mf/js/async/8356.e845a073.js +1 -0
  130. package/__mf/js/async/8470.84935087.js +2 -0
  131. package/__mf/js/async/{3996.69a9c1dc.js → 8634.e3cfb057.js} +1 -1
  132. package/__mf/js/async/873.6aafbb7b.js +1 -0
  133. package/__mf/js/async/8888.3a188176.js +1 -0
  134. package/__mf/js/async/9184.e6de21be.js +1 -0
  135. package/__mf/js/async/9235.85fb6b63.js +1 -0
  136. package/__mf/js/async/941.075ed563.js +2 -0
  137. package/__mf/js/async/9588.dfdaeff2.js +1 -0
  138. package/__mf/js/async/9745.0a6c90a2.js +1 -0
  139. package/__mf/js/async/9836.888f4ed2.js +1 -0
  140. package/__mf/js/async/__federation_expose_PrometheusDatasource.d4892cae.js +1 -0
  141. package/__mf/js/async/__federation_expose_PrometheusExplorer.681841d8.js +1 -0
  142. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.86c44577.js +1 -0
  143. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.ff683936.js +1 -0
  144. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.bac03b61.js +1 -0
  145. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.9a495e56.js +1 -0
  146. package/__mf/js/main.afe2fc64.js +7 -0
  147. package/lib/cjs/model/prometheus-client.js +22 -17
  148. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +10 -48
  149. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +3 -2
  150. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +3 -2
  151. package/lib/cjs/plugins/PrometheusPromQLVariable.js +3 -2
  152. package/lib/cjs/plugins/interpolation.js +54 -0
  153. package/lib/cjs/plugins/prometheus-datasource.js +15 -42
  154. package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +10 -2
  155. package/lib/model/api-types.d.ts +1 -1
  156. package/lib/model/api-types.d.ts.map +1 -1
  157. package/lib/model/api-types.js.map +1 -1
  158. package/lib/model/prometheus-client.d.ts +16 -13
  159. package/lib/model/prometheus-client.d.ts.map +1 -1
  160. package/lib/model/prometheus-client.js +19 -16
  161. package/lib/model/prometheus-client.js.map +1 -1
  162. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
  163. package/lib/plugins/PrometheusDatasourceEditor.js +11 -8
  164. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -1
  165. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -1
  166. package/lib/plugins/PrometheusLabelNamesVariable.js +3 -2
  167. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -1
  168. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -1
  169. package/lib/plugins/PrometheusLabelValuesVariable.js +3 -2
  170. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -1
  171. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -1
  172. package/lib/plugins/PrometheusPromQLVariable.js +3 -2
  173. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -1
  174. package/lib/plugins/interpolation.d.ts +12 -0
  175. package/lib/plugins/interpolation.d.ts.map +1 -0
  176. package/lib/plugins/interpolation.js +38 -0
  177. package/lib/plugins/interpolation.js.map +1 -0
  178. package/lib/plugins/prometheus-datasource.d.ts.map +1 -1
  179. package/lib/plugins/prometheus-datasource.js +16 -43
  180. package/lib/plugins/prometheus-datasource.js.map +1 -1
  181. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
  182. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js +10 -2
  183. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
  184. package/lib/plugins/types.d.ts +2 -1
  185. package/lib/plugins/types.d.ts.map +1 -1
  186. package/lib/plugins/types.js.map +1 -1
  187. package/mf-manifest.json +305 -293
  188. package/mf-stats.json +321 -293
  189. package/package.json +6 -6
  190. package/__mf/css/async/1233.d3010b86.css +0 -1
  191. package/__mf/css/async/1324.d3010b86.css +0 -1
  192. package/__mf/css/async/9518.d3010b86.css +0 -1
  193. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  194. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  195. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  196. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  197. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  198. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  199. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  200. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  201. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  202. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  203. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  204. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  205. package/__mf/js/Prometheus.9877d89e.js +0 -6
  206. package/__mf/js/async/1233.0ab88b51.js +0 -1
  207. package/__mf/js/async/1324.ce01eced.js +0 -1
  208. package/__mf/js/async/1432.0c3e4ed0.js +0 -1
  209. package/__mf/js/async/1605.dc180cb8.js +0 -110
  210. package/__mf/js/async/1616.7587ce79.js +0 -1
  211. package/__mf/js/async/1728.531c96f9.js +0 -1
  212. package/__mf/js/async/1969.372d36b8.js +0 -1
  213. package/__mf/js/async/2043.d0fbb886.js +0 -2
  214. package/__mf/js/async/2506.1e336b3b.js +0 -1
  215. package/__mf/js/async/3184.6b4ad42e.js +0 -1
  216. package/__mf/js/async/3499.bef2e2e5.js +0 -1
  217. package/__mf/js/async/3652.6b591718.js +0 -7
  218. package/__mf/js/async/392.f1b4a590.js +0 -2
  219. package/__mf/js/async/3963.5fef6ffb.js +0 -1
  220. package/__mf/js/async/4121.828d661d.js +0 -2
  221. package/__mf/js/async/425.1ec8867f.js +0 -1
  222. package/__mf/js/async/4626.173e602a.js +0 -1
  223. package/__mf/js/async/4657.f0c3ccd6.js +0 -2
  224. package/__mf/js/async/4987.c12b89cb.js +0 -1
  225. package/__mf/js/async/5002.e4f54e8e.js +0 -1
  226. package/__mf/js/async/5071.e1c33fa7.js +0 -1
  227. package/__mf/js/async/529.2303b01b.js +0 -1
  228. package/__mf/js/async/54.e6002704.js +0 -22
  229. package/__mf/js/async/5440.8ced5513.js +0 -2
  230. package/__mf/js/async/5587.4d72fc35.js +0 -1
  231. package/__mf/js/async/5763.4ba478ff.js +0 -1
  232. package/__mf/js/async/5922.d1619ac1.js +0 -1
  233. package/__mf/js/async/6274.478a68f8.js +0 -2
  234. package/__mf/js/async/6283.181cb622.js +0 -2
  235. package/__mf/js/async/6969.b959b6f8.js +0 -1
  236. package/__mf/js/async/7177.205c9aaf.js +0 -1
  237. package/__mf/js/async/7192.d835931b.js +0 -1
  238. package/__mf/js/async/7894.9c5245d7.js +0 -1
  239. package/__mf/js/async/7968.6ac0ce96.js +0 -1
  240. package/__mf/js/async/7978.9532d5b8.js +0 -1
  241. package/__mf/js/async/8356.789e1dfb.js +0 -1
  242. package/__mf/js/async/8470.9b14a625.js +0 -2
  243. package/__mf/js/async/873.448eab23.js +0 -1
  244. package/__mf/js/async/8888.59eb50a2.js +0 -1
  245. package/__mf/js/async/9010.ca50fa9e.js +0 -2
  246. package/__mf/js/async/9020.ebc1cad3.js +0 -1
  247. package/__mf/js/async/9184.43a8d927.js +0 -1
  248. package/__mf/js/async/9235.36c3cd8c.js +0 -1
  249. package/__mf/js/async/9351.715f25c3.js +0 -1
  250. package/__mf/js/async/941.53b13124.js +0 -2
  251. package/__mf/js/async/9518.38e38a33.js +0 -1
  252. package/__mf/js/async/9588.9081c7de.js +0 -1
  253. package/__mf/js/async/9605.a92ec9c1.js +0 -1
  254. package/__mf/js/async/9836.00da6086.js +0 -1
  255. package/__mf/js/async/__federation_expose_PrometheusDatasource.b97f9012.js +0 -1
  256. package/__mf/js/async/__federation_expose_PrometheusExplorer.eba3b416.js +0 -1
  257. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.bd38a89c.js +0 -1
  258. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.eb12e168.js +0 -1
  259. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.7ccb0601.js +0 -1
  260. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.08f11ea9.js +0 -1
  261. package/__mf/js/main.78fc6444.js +0 -6
  262. /package/__mf/js/async/{2043.d0fbb886.js.LICENSE.txt → 2043.c2948add.js.LICENSE.txt} +0 -0
  263. /package/__mf/js/async/{392.f1b4a590.js.LICENSE.txt → 392.233c0945.js.LICENSE.txt} +0 -0
  264. /package/__mf/js/async/{4121.828d661d.js.LICENSE.txt → 4121.9ed83f2a.js.LICENSE.txt} +0 -0
  265. /package/__mf/js/async/{54.e6002704.js.LICENSE.txt → 4800.cc42977e.js.LICENSE.txt} +0 -0
  266. /package/__mf/js/async/{5440.8ced5513.js.LICENSE.txt → 5440.52ec91ad.js.LICENSE.txt} +0 -0
  267. /package/__mf/js/async/{6274.478a68f8.js.LICENSE.txt → 6274.f04c9ecd.js.LICENSE.txt} +0 -0
  268. /package/__mf/js/async/{4657.f0c3ccd6.js.LICENSE.txt → 7462.e9a1c8bc.js.LICENSE.txt} +0 -0
  269. /package/__mf/js/async/{6283.181cb622.js.LICENSE.txt → 7862.e13fbb9d.js.LICENSE.txt} +0 -0
  270. /package/__mf/js/async/{8470.9b14a625.js.LICENSE.txt → 8470.84935087.js.LICENSE.txt} +0 -0
  271. /package/__mf/js/async/{941.53b13124.js.LICENSE.txt → 941.075ed563.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.chunk_Prometheus=self.chunk_Prometheus||[]).push([["3996"],{315:function(e,t,i){i.d(t,{A:()=>s});var a=i(68335),r=i(77308),n=i(72052);let s=(0,a.A)({createStyledComponent:(0,r.A)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>(0,n.b)({props:e,name:"MuiStack"})})},68335:function(e,t,i){i.d(t,{A:()=>y});var a=i(70451),r=i(11750),n=i(6121),s=i(46733),o=i(81023),l=i(7939),c=i(51327),u=i(20523),h=i(80787),d=i(85351),p=i(89187),f=i(62540);let O=(0,h.A)(),m=(0,l.A)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function v(e){return(0,c.A)({props:e,name:"MuiStack",defaultTheme:O})}let g=({ownerState:e,theme:t})=>{let i={display:"flex",flexDirection:"column",...(0,d.NI)({theme:t},(0,d.kW)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){let a=(0,p.LX)(t),r=Object.keys(t.breakpoints.values).reduce((t,i)=>(("object"==typeof e.spacing&&null!=e.spacing[i]||"object"==typeof e.direction&&null!=e.direction[i])&&(t[i]=!0),t),{}),s=(0,d.kW)({values:e.direction,base:r}),o=(0,d.kW)({values:e.spacing,base:r});"object"==typeof s&&Object.keys(s).forEach((e,t,i)=>{if(!s[e]){let a=t>0?s[i[t-1]]:"column";s[e]=a}}),i=(0,n.A)(i,(0,d.NI)({theme:t},o,(t,i)=>e.useFlexGap?{gap:(0,p._W)(a,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[i?s[i]:e.direction]}`]:(0,p._W)(a,t)}}))}return(0,d.iZ)(t.breakpoints,i)};function y(e={}){let{createStyledComponent:t=m,useThemeProps:i=v,componentName:n="MuiStack"}=e,l=t(g);return a.forwardRef(function(e,t){let c,h=i(e),{component:d="div",direction:p="column",spacing:O=0,divider:m,children:v,className:g,useFlexGap:y=!1,...$}=(0,u.A)(h),b=(0,o.A)({root:["root"]},e=>(0,s.Ay)(n,e),{});return(0,f.jsx)(l,{as:d,ownerState:{direction:p,spacing:O,useFlexGap:y},ref:t,className:(0,r.A)(b.root,g),...$,children:m?(c=a.Children.toArray(v).filter(Boolean)).reduce((e,t,i)=>(e.push(t),i<c.length-1&&e.push(a.cloneElement(m,{key:`separator-${i}`})),e),[]):v})})}},7939:function(e,t,i){i.d(t,{A:()=>a});let a=(0,i(57867).Ay)()},70320:function(e,t,i){i.d(t,{A:()=>r});var a=i(52215);function r(e){let{theme:t,name:i,props:r}=e;return t&&t.components&&t.components[i]&&t.components[i].defaultProps?(0,a.A)(t.components[i].defaultProps,r):r}},51327:function(e,t,i){i.d(t,{A:()=>n});var a=i(70320),r=i(26041);function n({props:e,name:t,defaultTheme:i,themeId:n}){let s=(0,r.A)(i);return n&&(s=s[n]||s),(0,a.A)({theme:s,name:t,props:e})}},37856:function(e,t,i){async function a(...e){let t=await globalThis.fetch(...e);if(!1===t.ok){let e=t.headers.get("content-type");if(e?.includes("application/json")){let e=await t.clone().json();if(e.error)throw new s(e.error,t.status);if(e.message)throw new s(e.message,t.status)}let i=await t.clone().text();if(i)throw new s(i,t.status);throw new n(t)}return t}async function r(...e){let t=await a(...e);if(!t.ok)throw new n(t);return await t.json()}i.d(t,{P7:()=>s,fk:()=>n,hd:()=>a,x6:()=>r});class n extends Error{status;constructor(e){super(`${e.status} ${e.statusText}`),this.status=e.status,Object.setPrototypeOf(this,n.prototype)}}class s extends Error{status;constructor(e,t){super(e),this.status=t,Object.setPrototypeOf(this,s.prototype)}}},40565:function(e,t,i){i.d(t,{TI:()=>eo});var a,r,n,s,o,l,c,u,h=i(782),d=i(31650);let p={inf:167,nan:168,bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},f=(e,t)=>p[e.toLowerCase()]||-1,O={avg:8,atan2:7,bottomk:9,count:10,count_values:11,group:12,max:13,min:14,quantile:15,limitk:16,limit_ratio:17,stddev:18,stdvar:19,sum:20,topk:21,by:22,without:23,and:24,or:25,unless:26,start:27,end:28,smoothed:29,anchored:30},m=(e,t)=>O[e.toLowerCase()]||-1,v=(0,d.pn)({LineComment:d._A.comment,LabelName:d._A.labelName,StringLiteral:d._A.string,NumberDurationLiteral:d._A.number,NumberDurationLiteralInDurationContext:d._A.number,Identifier:d._A.variableName,"Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp Floor HistogramAvg HistogramCount HistogramFraction HistogramQuantile HistogramSum DoubleExponentialSmoothing Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":d._A.function(d._A.variableName),"Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk":d._A.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End Smoothed Anchored":d._A.modifier,"And Unless Or":d._A.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":d._A.operator,UnaryOp:d._A.arithmeticOperator,"( )":d._A.paren,"[ ]":d._A.squareBracket,"{ }":d._A.brace,"⚠":d._A.invalid}),g={__proto__:null,absent_over_time:353,absent:355,abs:357,acos:359,acosh:361,asin:363,asinh:365,atan:367,atanh:369,avg_over_time:371,ceil:373,changes:375,clamp:377,clamp_max:379,clamp_min:381,cos:383,cosh:385,count_over_time:387,days_in_month:389,day_of_month:391,day_of_week:393,day_of_year:395,deg:397,delta:399,deriv:401,exp:403,first_over_time:405,floor:407,histogram_count:409,histogram_fraction:411,histogram_quantile:413,histogram_stddev:415,histogram_stdvar:417,histogram_sum:419,histogram_avg:421,double_exponential_smoothing:423,hour:425,idelta:427,increase:429,info:431,irate:433,label_replace:435,label_join:437,last_over_time:439,ln:441,log10:443,log2:445,mad_over_time:447,max_over_time:449,min_over_time:451,ts_of_first_over_time:453,ts_of_max_over_time:455,ts_of_min_over_time:457,ts_of_last_over_time:459,minute:461,month:463,pi:465,predict_linear:467,present_over_time:469,quantile_over_time:471,rad:473,rate:475,resets:477,round:479,scalar:481,sgn:483,sin:485,sinh:487,sort:489,sort_desc:491,sort_by_label:493,sort_by_label_desc:495,sqrt:497,stddev_over_time:499,stdvar_over_time:501,sum_over_time:503,tan:505,tanh:507,timestamp:509,time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#ZQ#y#[Q#z#]R#{#^",nodeNames:"⚠ Bool Ignoring On GroupLeft GroupRight Offset Atan2 Avg Bottomk Count CountValues Group Max Min Quantile LimitK LimitRatio Stddev Stdvar Sum Topk By Without And Or Unless Start End Smoothed Anchored LineComment PromQL AggregateExpr AggregateOp AggregateModifier GroupingLabels LabelName QuotedLabelName StringLiteral FunctionCallBody BinaryExpr Pow BoolModifier MatchingModifierClause Mul Div Mod Add Sub Eql Gte Gtr Lte Lss Neq FunctionCall FunctionIdentifier AbsentOverTime Identifier Absent Abs Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp FirstOverTime Floor HistogramCount HistogramFraction HistogramQuantile HistogramStdDev HistogramStdVar HistogramSum HistogramAvg DoubleExponentialSmoothing Hour Idelta Increase Info Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MadOverTime MaxOverTime MinOverTime TsOfFirstOverTime TsOfMaxOverTime TsOfMinOverTime TsOfLastOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Timestamp Time Vector Year MatrixSelector NumberDurationLiteralInDurationContext NumberDurationLiteral OffsetExpr AnchoredExpr SmoothedExpr ParenExpr SubqueryExpr UnaryExpr UnaryOp VectorSelector LabelMatchers UnquotedLabelMatcher MatchOp EqlSingle EqlRegex NeqRegex QuotedLabelMatcher StepInvariantExpr At AtModifierPreprocessors MetricName",maxTerm:265,nodeProps:[["group",-14,33,39,41,56,141,143,144,145,146,147,148,149,151,159,"Expr"]],propSources:[v],skippedNodes:[0,31],repeatNodeCount:3,tokenData:"4k~RwX^#lpq#lqr$ars$tst&luv'Twx'Yxy({yz)Qz{)V{|)[|})c}!O)h!O!P)o!P!Q*u!Q!R*z!R![+u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q![-x#a#b.U#g#h.x~.ZQ&o~!Q![.a#g#h.s~.dR!Q![.a#a#b.m#g#h.x~.pP#g#h.s~.xO&o~~.}P&o~!Q![/Q~/TQ!Q![/Q#a#b.m~/`P&o~!Q![/c~/fT!Q![/c#W#X-X#[#]-p#a#b.U#g#h.x~/zP&o~!Q![/}~0QU!Q![/}#W#X-X#[#]-p#a#b.U#g#h.x#k#l/Z~0gR!Q![0p!c!i0p#T#Z0p~0uR&o~!Q![0p!c!i0p#T#Z0pV1VT&qS!]R!Q![1f![!]1f!c!}1f#R#S1f#T#o1fR1kT!]R!Q![1f![!]1f!c!}1f#R#S1f#T#o1f~2PP!W~!_!`2S~2XO!V~~2^Q$aP!_!`2d#r#s2iQ2iO!SQ~2nO$b~~2sP!U~!_!`2v~2{O!T~~3QO$f~V3XT!]RuS!Q![3Q![!]1f!c!}3Q#R#S3Q#T#o3Q~3mO&l~~3rO&p~~3wOz~~3zTO#S3w#S#T%c#T;'S3w;'S;=`4Z<%lO3w~4^P;=`<%l3w~4fO&r~~4kO&s~",tokenizers:[0,1,2],topRules:{PromQL:[0,32],MetricName:[1,162]},specialized:[{term:59,get:(e,t)=>f(e)<<1,external:f},{term:59,get:(e,t)=>m(e)<<1|1,external:m,extend:!0},{term:59,get:e=>g[e]||-1}],tokenPrec:0});(a=o||(o={})).none="none",a.vector="vector",a.scalar="scalar",a.matrix="matrix",a.string="string";let $={61:{name:"abs",argTypes:[o.vector],variadic:0,returnType:o.vector},60:{name:"absent",argTypes:[o.vector],variadic:0,returnType:o.vector},58:{name:"absent_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},62:{name:"acos",argTypes:[o.vector],variadic:0,returnType:o.vector},63:{name:"acosh",argTypes:[o.vector],variadic:0,returnType:o.vector},64:{name:"asin",argTypes:[o.vector],variadic:0,returnType:o.vector},65:{name:"asinh",argTypes:[o.vector],variadic:0,returnType:o.vector},66:{name:"atan",argTypes:[o.vector],variadic:0,returnType:o.vector},67:{name:"atanh",argTypes:[o.vector],variadic:0,returnType:o.vector},68:{name:"avg_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},69:{name:"ceil",argTypes:[o.vector],variadic:0,returnType:o.vector},70:{name:"changes",argTypes:[o.matrix],variadic:0,returnType:o.vector},71:{name:"clamp",argTypes:[o.vector,o.scalar,o.scalar],variadic:0,returnType:o.vector},72:{name:"clamp_max",argTypes:[o.vector,o.scalar],variadic:0,returnType:o.vector},73:{name:"clamp_min",argTypes:[o.vector,o.scalar],variadic:0,returnType:o.vector},74:{name:"cos",argTypes:[o.vector],variadic:0,returnType:o.vector},75:{name:"Cosh",argTypes:[o.vector],variadic:0,returnType:o.vector},76:{name:"count_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},77:{name:"days_in_month",argTypes:[o.vector],variadic:1,returnType:o.vector},78:{name:"day_of_month",argTypes:[o.vector],variadic:1,returnType:o.vector},79:{name:"day_of_week",argTypes:[o.vector],variadic:1,returnType:o.vector},80:{name:"day_of_year",argTypes:[o.vector],variadic:1,returnType:o.vector},81:{name:"deg",argTypes:[o.vector],variadic:0,returnType:o.vector},82:{name:"delta",argTypes:[o.matrix],variadic:0,returnType:o.vector},83:{name:"deriv",argTypes:[o.matrix],variadic:0,returnType:o.vector},84:{name:"exp",argTypes:[o.vector],variadic:0,returnType:o.vector},85:{name:"first_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},86:{name:"floor",argTypes:[o.vector],variadic:0,returnType:o.vector},93:{name:"histogram_avg",argTypes:[o.vector],variadic:0,returnType:o.vector},87:{name:"histogram_count",argTypes:[o.vector],variadic:0,returnType:o.vector},88:{name:"histogram_fraction",argTypes:[o.scalar,o.scalar,o.vector],variadic:0,returnType:o.vector},89:{name:"histogram_quantile",argTypes:[o.scalar,o.vector],variadic:0,returnType:o.vector},90:{name:"histogram_stddev",argTypes:[o.vector],variadic:0,returnType:o.vector},91:{name:"histogram_stdvar",argTypes:[o.vector],variadic:0,returnType:o.vector},92:{name:"histogram_sum",argTypes:[o.vector],variadic:0,returnType:o.vector},94:{name:"double_exponential_smoothing",argTypes:[o.matrix,o.scalar,o.scalar],variadic:0,returnType:o.vector},95:{name:"hour",argTypes:[o.vector],variadic:1,returnType:o.vector},96:{name:"idelta",argTypes:[o.matrix],variadic:0,returnType:o.vector},97:{name:"increase",argTypes:[o.matrix],variadic:0,returnType:o.vector},98:{name:"info",argTypes:[o.vector,o.vector],variadic:1,returnType:o.vector},99:{name:"irate",argTypes:[o.matrix],variadic:0,returnType:o.vector},100:{name:"label_replace",argTypes:[o.vector,o.string,o.string,o.string,o.string],variadic:0,returnType:o.vector},101:{name:"label_join",argTypes:[o.vector,o.string,o.string,o.string],variadic:-1,returnType:o.vector},102:{name:"last_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},103:{name:"ln",argTypes:[o.vector],variadic:0,returnType:o.vector},104:{name:"log10",argTypes:[o.vector],variadic:0,returnType:o.vector},105:{name:"log2",argTypes:[o.vector],variadic:0,returnType:o.vector},106:{name:"mad_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},107:{name:"max_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},108:{name:"min_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},109:{name:"ts_of_first_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},110:{name:"ts_of_max_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},111:{name:"ts_of_min_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},112:{name:"ts_of_last_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},113:{name:"minute",argTypes:[o.vector],variadic:1,returnType:o.vector},114:{name:"month",argTypes:[o.vector],variadic:1,returnType:o.vector},115:{name:"pi",argTypes:[],variadic:0,returnType:o.vector},116:{name:"predict_linear",argTypes:[o.matrix,o.scalar],variadic:0,returnType:o.vector},117:{name:"present_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},118:{name:"quantile_over_time",argTypes:[o.scalar,o.matrix],variadic:0,returnType:o.vector},119:{name:"rad",argTypes:[o.vector],variadic:0,returnType:o.vector},120:{name:"rate",argTypes:[o.matrix],variadic:0,returnType:o.vector},121:{name:"resets",argTypes:[o.matrix],variadic:0,returnType:o.vector},122:{name:"round",argTypes:[o.vector,o.scalar],variadic:1,returnType:o.vector},123:{name:"scalar",argTypes:[o.vector],variadic:0,returnType:o.scalar},124:{name:"sgn",argTypes:[o.vector],variadic:0,returnType:o.vector},125:{name:"sin",argTypes:[o.vector],variadic:0,returnType:o.vector},126:{name:"Sinh",argTypes:[o.vector],variadic:0,returnType:o.vector},127:{name:"sort",argTypes:[o.vector],variadic:0,returnType:o.vector},128:{name:"sort_desc",argTypes:[o.vector],variadic:0,returnType:o.vector},129:{name:"sort_by_label",argTypes:[o.vector,o.string],variadic:-1,returnType:o.vector},130:{name:"sort_by_label_desc",argTypes:[o.vector,o.string],variadic:-1,returnType:o.vector},131:{name:"sqrt",argTypes:[o.vector],variadic:0,returnType:o.vector},132:{name:"stddev_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},133:{name:"stdvar_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},134:{name:"sum_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},135:{name:"tan",argTypes:[o.vector],variadic:0,returnType:o.vector},136:{name:"tanh",argTypes:[o.vector],variadic:0,returnType:o.vector},138:{name:"time",argTypes:[],variadic:0,returnType:o.scalar},137:{name:"timestamp",argTypes:[o.vector],variadic:0,returnType:o.vector},139:{name:"vector",argTypes:[o.scalar],variadic:0,returnType:o.vector},140:{name:"year",argTypes:[o.vector],variadic:1,returnType:o.vector}};class b{constructor(e,t,i){this.type=e,this.name=t,this.value=i}matchesEmpty(){switch(this.type){case 155:return""===this.value;case 55:return""!==this.value;default:return!1}}}function _(e,t){let i=[];return e.forEach(e=>{i.push(function(e,t){let i=new b(0,"",""),a=e.cursor();switch(a.type.id){case 158:if(!a.next())break;do switch(a.type.id){case 38:i.name=t.sliceDoc(a.from,a.to).slice(1,-1);break;case 154:{let e=a.node.firstChild;e&&(i.type=e.type.id);break}case 39:i.value=t.sliceDoc(a.from,a.to).slice(1,-1)}while(a.nextSibling());break;case 153:if(!a.next())break;do switch(a.type.id){case 37:i.name=t.sliceDoc(a.from,a.to);break;case 154:{let e=a.node.firstChild;e&&(i.type=e.type.id);break}case 39:i.value=t.sliceDoc(a.from,a.to).slice(1,-1)}while(a.nextSibling());break;case 38:i.name="__name__",i.value=t.sliceDoc(a.from,a.to).slice(1,-1),i.type=155}return i}(e,t))}),i}function T(e,t,i){if(!t||0===t.length)return e;let a="";for(let e of t){if(e.name===i||""===e.value)continue;let t="";switch(e.type){case 155:default:t="=";break;case 55:t="!=";break;case 157:t="!~";break;case 156:t="=~"}let r=`${e.name}${t}"${e.value}"`;a=""===a?r:`${a},${r}`}return`${e}{${a}}`}function x(e,t){for(;;){if(!e||e.type.id===t)return e;e=e.parent}return null}function Q(e,...t){let i=e.cursor();if(!i.next())return!1;let a=!1;do a=t.some(e=>i.type.id===e||i.type.name===e);while(!a&&i.nextSibling());return a}function P(e,...t){let i=e.cursor();if(!i.next())return!1;let a=0;do i.type.is(t[a])&&a++;while(a<t.length&&i.nextSibling());return a>=t.length}function k(e){var t;if(!e)return o.none;switch(e.type.id){case 33:case 151:return o.vector;case 144:case 146:case 145:return k(e.firstChild);case 39:return o.string;case 143:return o.scalar;case 141:case 148:return o.matrix;case 147:case 149:case 159:return k(e.getChild("Expr"));case 41:{let t=k(e.firstChild),i=k(e.lastChild);if(t===o.scalar&&i===o.scalar)return o.scalar;return o.vector}case 56:{let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return o.none;return $[i.type.id].returnType}default:return o.none}}(r=l||(l={})).CardOneToOne="one-to-one",r.CardManyToOne="many-to-one",r.CardOneToMany="one-to-many",r.CardManyToMany="many-to-many";var S=i(63960);class X{constructor(e){this.tree=(0,S.mv)(e),this.state=e,this.diagnostics=[]}getDiagnostics(){return this.diagnostics.sort((e,t)=>e.from-t.from)}analyze(){this.checkAST(this.tree.topNode.firstChild),this.diagnoseAllErrorNodes()}diagnoseAllErrorNodes(){let e=this.tree.cursor();for(;e.next();)if(0===e.type.id&&e.to!==this.tree.topNode.to){let t=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:t?t.from:e.from,to:t?t.to:e.to})}}checkAST(e){if(!e)return o.none;switch(e.type.id){case 33:this.checkAggregationExpr(e);break;case 41:this.checkBinaryExpr(e);break;case 56:this.checkCallFunction(e);break;case 147:case 141:this.checkAST(e.getChild("Expr"));break;case 149:{let t=this.checkAST(e.getChild("Expr"));t!==o.scalar&&t!==o.vector&&this.addDiagnostic(e,`unary expression only allowed on expressions of type scalar or instant vector, got ${t}`);break}case 146:this.checkAnchoredSmoothedExpr(e,[120,97,82]);break;case 145:this.checkAnchoredSmoothedExpr(e,[121,70,120,97,82]);break;case 148:{let t=this.checkAST(e.getChild("Expr"));t!==o.vector&&this.addDiagnostic(e,`subquery is only allowed on instant vector, got ${t} in ${e.name} instead`);break}case 151:this.checkVectorSelector(e);break;case 159:{let t=this.checkAST(e.getChild("Expr"));t!==o.vector&&t!==o.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery")}}return k(e)}checkAggregationExpr(e){var t;let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return void this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing");let a=e.getChild(40),r=a?a.getChildren("Expr"):[];r.length?(this.expectType(r[r.length-1],o.vector,"aggregation expression"),(21===i.type.id||9===i.type.id||16===i.type.id||17===i.type.id||15===i.type.id)&&this.expectType(r[0],o.scalar,"aggregation parameter"),11===i.type.id&&this.expectType(r[0],o.string,"aggregation parameter")):this.addDiagnostic(e,"unable to find the parameter for the expression")}checkBinaryExpr(e){let t=e.firstChild,i=e.lastChild;if(!t||!i)return void this.addDiagnostic(e,"left or right expression is missing in binary expression");let a=this.checkAST(t),r=this.checkAST(i),n=e.getChild(43),s=Q(e,50,55,53,54,51,52),c=Q(e,24,25,26);n?s||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):s&&a===o.scalar&&r===o.scalar&&this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier");let u=function(e,t){if(!t||41!==t.type.id)return null;let i={card:l.CardOneToOne,matchingLabels:[],on:!1,include:[]},a=t.getChild(44);if(a){i.on=null!==a.getChild(3);let t=a.getChild(36);for(let a of t?t.getChildren(37):[])i.matchingLabels.push(e.sliceDoc(a.from,a.to));let r=a.getChild(4),n=a.getChild(5),s=r||n;if(s){i.card=r?l.CardManyToOne:l.CardOneToMany;let t=s.nextSibling;for(let a of(null==t?void 0:t.getChildren(37))||[])i.include.push(e.sliceDoc(a.from,a.to))}}return Q(t,24,25,26)&&i.card===l.CardOneToOne&&(i.card=l.CardManyToMany),i}(this.state,e);if(null!==u&&u.on)for(let t of u.matchingLabels)for(let i of u.include)t===i&&this.addDiagnostic(e,`label "${t}" must not occur in ON and GROUP clause at once`);a!==o.scalar&&a!==o.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),r!==o.scalar&&r!==o.vector&&this.addDiagnostic(i,"binary expression must contain only scalar and instant vector types"),(a!==o.vector||r!==o.vector)&&null!==u?u.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"):c&&(((null==u?void 0:u.card)===l.CardOneToMany||(null==u?void 0:u.card)===l.CardManyToOne)&&this.addDiagnostic(e,"no grouping allowed for set operations"),(null==u?void 0:u.card)!==l.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")),(a===o.scalar||r===o.scalar)&&c&&this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}checkCallFunction(e){var t;let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return void this.addDiagnostic(e,"function not defined");let a=e.getChild(40),r=a?a.getChildren("Expr"):[],n=$[i.type.id],s=n.argTypes.length;if(0===n.variadic)r.length!==s&&this.addDiagnostic(e,`expected ${s} argument(s) in call to "${n.name}", got ${r.length}`);else{let t=s-1;if(t>r.length)this.addDiagnostic(e,`expected at least ${t} argument(s) in call to "${n.name}", got ${r.length}`);else{let i=t+n.variadic;n.variadic>0&&i<r.length&&this.addDiagnostic(e,`expected at most ${i} argument(s) in call to "${n.name}", got ${r.length}`)}}"info"===n.name&&r.length>1&&r[1].getChild(59)&&this.addDiagnostic(e,`expected label selectors as the second argument to "info" function, got ${r[1].type}`);let o=0;for(let e=0;e<r.length;e++){if((o=e)>=n.argTypes.length){if(0===n.variadic)break;o=n.argTypes.length-1}this.expectType(r[e],n.argTypes[o],`call to function "${n.name}"`)}}checkAnchoredSmoothedExpr(e,t){var i,a;let r=k(e);if(r!==o.vector&&r!==o.matrix)return void this.addDiagnostic(e,`smoothed/anchored expression only allowed on instant vector or range vector selector, got ${r} instead`);let n=null==(i=e.parent)?void 0:i.parent;if(!n||56!==n.type.id)return;let s=null==(a=n.firstChild)?void 0:a.firstChild;s?t.includes(s.type.id)||this.addDiagnostic(e,"smoothed/anchored expression can only be used in specific functions"):this.addDiagnostic(e,"function not defined")}checkVectorSelector(e){let t=e.getChild(152),i=[];for(let e of[38,158,153])i=i.concat(_(t?t.getChildren(e):[],this.state));let a="",r=e.getChild(59);if(r&&(a=this.state.sliceDoc(r.from,r.to)),""!==a){let t=i.find(e=>"__name__"===e.name);t&&this.addDiagnostic(e,`metric name must not be set twice: ${a} or ${t.value}`),i.push(new b(155,"__name__",a))}else{let t=i.filter(e=>"__name__"===e.name);t.length>1&&this.addDiagnostic(e,`metric name must not be set twice: ${t[0].value} or ${t[1].value}`)}i.every(e=>e.matchesEmpty())&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}expectType(e,t,i){let a=this.checkAST(e);a!==t&&this.addDiagnostic(e,`expected type ${t} in ${i}, got ${a}`)}addDiagnostic(e,t){this.diagnostics.push({severity:"error",message:t,from:e.from,to:e.to})}}var w=i(9714);let A=[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],E=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],L=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"limitk",detail:"aggregation",info:"Sample k elements",type:"keyword"},{label:"limit_ratio",detail:"aggregation",info:"Sample given ratio of elements",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],C=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:(0,w.UA)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:(0,w.UA)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:(0,w.UA)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')},{label:"topk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Largest k elements by sample value",apply:(0,w.UA)("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:(0,w.UA)("bottomk(${__rank_number__}, ${__input_vector__})")},{label:'count_values("__label_name__", __input_vector__)',type:"function",detail:"snippet",info:"Count the number of series per distinct sample value",apply:(0,w.UA)('count_values("${__label_name__}", ${__metric__})')}],D=[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],M=[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],F=[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],z=[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"acos",detail:"function",info:"Calculate the arccosine, in radians, for input series",type:"function"},{label:"acosh",detail:"function",info:"Calculate the inverse hyperbolic cosine, in radians, for input series",type:"function"},{label:"asin",detail:"function",info:"Calculate the arcsine, in radians, for input series",type:"function"},{label:"asinh",detail:"function",info:"Calculate the inverse hyperbolic sine, in radians, for input series",type:"function"},{label:"atan",detail:"function",info:"Calculate the arctangent, in radians, for input series",type:"function"},{label:"atanh",detail:"function",info:"Calculate the inverse hyperbolic tangent, in radians, for input series",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp",detail:"function",info:"Limit the value of input series between a minimum and a maximum",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"cos",detail:"function",info:"Calculate the cosine, in radians, for input series",type:"function",boost:-1},{label:"cosh",detail:"function",info:"Calculate the hyperbolic cosine, in radians, for input series",type:"function",boost:-1},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"day_of_year",detail:"function",info:"Return the day of the year for provided timestamps",type:"function"},{label:"deg",detail:"function",info:"Convert radians to degrees for input series",type:"function",boost:-1},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_avg",detail:"function",info:"Return the average of observations from a native histogram",type:"function"},{label:"histogram_count",detail:"function",info:"Return the count of observations from a native histogram",type:"function"},{label:"histogram_fraction",detail:"function",info:"Calculate fractions of observations within an interval from a native histogram",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from native histograms and from conventional histogram buckets",type:"function"},{label:"histogram_sum",detail:"function",info:"Return the sum of observations from a native histogram",type:"function"},{label:"histogram_stddev",detail:"function",info:"Estimate the standard deviation of observations from a native histogram",type:"function"},{label:"histogram_stdvar",detail:"function",info:"Estimate the standard variance of observations from a native histogram",type:"function"},{label:"double_exponential_smoothing",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"info",detail:"function",info:"Add data labels from corresponding info metrics",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"last_over_time",detail:"function",info:"The most recent point value in specified interval.",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"mad_over_time",detail:"function",info:"Return the median absolute deviation over time for input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"ts_of_max_over_time",detail:"function",info:"Return the timestamp of the maximum value over time for input series",type:"function"},{label:"ts_of_min_over_time",detail:"function",info:"Return the timestamp of the minimum value over time for input series",type:"function"},{label:"ts_of_last_over_time",detail:"function",info:"Return the timestamp of the last value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"pi",detail:"function",info:"Return pi",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"present_over_time",detail:"function",info:"the value 1 for any series in the specified interval",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rad",detail:"function",info:"Convert degrees to radians for input series",type:"function",boost:-1},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sgn",detail:"function",info:"Returns the sign of the instant vector",type:"function"},{label:"sin",detail:"function",info:"Calculate the sine, in radians, for input series",type:"function"},{label:"sinh",detail:"function",info:"Calculate the hyperbolic sine, in radians, for input series",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sort_by_label",detail:"function",info:"Sort input series ascendingly by label value",type:"function"},{label:"sort_by_label_desc",detail:"function",info:"Sort input series descendingly by value value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variance within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"tan",detail:"function",info:"Calculate the tangent, in radians, for input series",type:"function"},{label:"tanh",detail:"function",info:"Calculate the hyperbolic tangent, in radians, for input series",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],R=[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],q=[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}];function V(e,t){let i=x(e,151);return i&&(i=i.getChild(59))?t.sliceDoc(i.from,i.to):""}function N(e){var t;let i=e.parent;if(null!==i&&(null==(t=i.firstChild)?void 0:t.type.id)===34){let e=i.firstChild.firstChild;if(null!==e&&[21,9,16,17,11].includes(e.type.id))return!0}return!1}(n=c||(c={}))[n.MetricName=0]="MetricName",n[n.LabelName=1]="LabelName",n[n.LabelValue=2]="LabelValue",n[n.Function=3]="Function",n[n.Aggregation=4]="Aggregation",n[n.BinOpModifier=5]="BinOpModifier",n[n.BinOp=6]="BinOp",n[n.MatchOp=7]="MatchOp",n[n.AggregateOpModifier=8]="AggregateOpModifier",n[n.Duration=9]="Duration",n[n.Offset=10]="Offset",n[n.Bool=11]="Bool",n[n.AtModifiers=12]="AtModifiers",n[n.Number=13]="Number";class Y{constructor(e,t=1e4){this.prometheusClient=e,this.maxMetricsMetadata=t}getPrometheusClient(){return this.prometheusClient}promQL(e){let{state:t,pos:i}=e,a=(0,S.mv)(t).resolve(i,-1),r=function(e,t,i){var a,r,n,s,o,l,u,h,d,p,f,O,m,v,g,y,$,b,T,k,S;let X=[];switch(t.type.id){case 0:{if((null==(a=t.parent)?void 0:a.type.id)===144){X.push({kind:c.Duration});break}if((null==(r=t.parent)?void 0:r.type.id)===153||(null==(n=t.parent)?void 0:n.type.id)===158){X.push({kind:c.MatchOp});break}if((null==(s=t.parent)?void 0:s.type.id)===141||(null==(o=t.parent)?void 0:o.type.id)===148&&Q(t.parent,142)){X.push({kind:c.Duration});break}let i=e.sliceDoc(t.from,t.to);E.filter(e=>e.label.includes(i)).length>0&&X.push({kind:c.BinOp});break}case 59:{if((null==(l=t.parent)?void 0:l.type.id)===0){let i=t.parent.parent;if((null==i?void 0:i.type.id)===159){X.push({kind:c.AtModifiers});break}if((null==i?void 0:i.type.id)===33){X.push({kind:c.AggregateOpModifier},{kind:c.BinOp});break}if((null==i?void 0:i.type.id)===151){let i=V(t,e);L.filter(e=>e.label===i).length>0&&X.push({kind:c.AggregateOpModifier}),X.push({kind:c.BinOp},{kind:c.Offset});break}if(i&&P(i,"Expr")){X.push({kind:c.BinOp},{kind:c.Offset});break}}let i=null==(u=t.parent)?void 0:u.parent;if(!i){X.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)});break}P(i,"Expr","Expr")&&40!==i.type.id?41!==i.type.id||Q(i,0)||(X.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:c.Function},{kind:c.Aggregation},{kind:c.BinOpModifier},{kind:c.Number}),Q(i,50,51,52,53,54,55)&&!Q(i,43)&&X.push({kind:c.Bool})):(X.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:c.Function},{kind:c.Aggregation}),40!==i.type.id&&141!==i.type.id&&X.push({kind:c.Number}));break}case 32:null!==t.firstChild&&0===t.firstChild.type.id&&X.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation},{kind:c.Number});break;case 36:X.push({kind:c.LabelName,metricName:function(e,t){let i=x(e,33);if(!i)return"";let a="";return i.cursor().iterate(e=>{if(151===e.type.id&&(a=V(e.node,t)))return!1}),a}(t,e)});break;case 152:X.push({kind:c.LabelName,metricName:V(t,e)});break;case 37:(null==(h=t.parent)?void 0:h.type.id)===36?X.push({kind:c.LabelName}):(null==(d=t.parent)?void 0:d.type.id)===153&&X.push({kind:c.LabelName,metricName:V(t,e)});break;case 39:if((null==(p=t.parent)?void 0:p.type.id)===153||(null==(f=t.parent)?void 0:f.type.id)===158){let i="";(null==(O=t.parent.firstChild)?void 0:O.type.id)===37?i=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to):(null==(m=t.parent.firstChild)?void 0:m.type.id)===38&&(i=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to).slice(1,-1));let a=V(t,e),r=x(t,152),n=[];for(let t of[38,158,153])n=n.concat(_(r?r.getChildren(t):[],e));X.push({kind:c.LabelValue,metricName:a,labelName:i,matchers:n})}else(null==(g=null==(v=t.parent)?void 0:v.parent)?void 0:g.type.id)===36?X.push({kind:c.LabelName}):(null==($=null==(y=t.parent)?void 0:y.parent)?void 0:$.type.id)===152&&X.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to).slice(1,-1)});break;case 143:(null==(b=t.parent)?void 0:b.type.id)===0&&(null==(T=t.parent.parent)?void 0:T.type.id)===148?X.push({kind:c.Duration}):X.push({kind:c.Number});break;case 142:case 144:X.push({kind:c.Duration});break;case 40:if(N(t)){if(null===t.firstChild||t.firstChild.from<=i&&t.firstChild.to>=i){X.push({kind:c.Number});break}X.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation});break}X.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation});break;case 55:(null==(k=t.parent)?void 0:k.type.id)===154?X.push({kind:c.MatchOp}):(null==(S=t.parent)?void 0:S.type.id)===41&&X.push({kind:c.BinOp});break;case 155:case 156:case 157:case 154:X.push({kind:c.MatchOp});break;case 42:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 24:case 26:case 25:case 41:X.push({kind:c.BinOp})}return X}(t,a,i),n=Promise.resolve([]),s=!1,o=!0;for(let e of r)switch(e.kind){case c.Aggregation:s=!0,n=n.then(e=>e.concat(L));break;case c.Function:s=!0,n=n.then(e=>e.concat(z));break;case c.BinOpModifier:n=n.then(e=>e.concat(M));break;case c.BinOp:n=n.then(e=>e.concat(E));break;case c.MatchOp:n=n.then(e=>e.concat(D));break;case c.AggregateOpModifier:n=n.then(e=>e.concat(R));break;case c.Duration:o=!1,n=n.then(e=>e.concat(A));break;case c.Offset:n=n.then(e=>e.concat([{label:"offset"}]));break;case c.Bool:n=n.then(e=>e.concat([{label:"bool"}]));break;case c.AtModifiers:n=n.then(e=>e.concat(F));break;case c.Number:n=n.then(e=>e.concat(q));break;case c.MetricName:n=n.then(t=>this.autocompleteMetricName(t,e));break;case c.LabelName:n=n.then(t=>this.autocompleteLabelName(t,e));break;case c.LabelValue:n=n.then(t=>this.autocompleteLabelValue(t,e))}return n.then(e=>(function(e,t,i,a=!1,r=!0){return a&&e.push(...C),{from:t,to:i,options:e,validFor:r?/^[a-zA-Z0-9_:]+$/:void 0}})(e,function(e,t,i){var a,r,n,s,o,l,c;let u=e.doc.slice(t.from,i).toString(),h=t.from;if(152===t.type.id||36===t.type.id){let e;e=t.from+1,null!==t.firstChild&&(e=i),h=e}else 40===t.type.id&&null===t.firstChild||39===t.type.id&&((null==(a=t.parent)?void 0:a.type.id)===153||(null==(r=t.parent)?void 0:r.type.id)===158)?h++:(144===t.type.id||142===t.type.id&&!A.map(e=>e.label).includes(u[u.length-1])||143===t.type.id&&(null==(n=t.parent)?void 0:n.type.id)===0&&(null==(s=t.parent.parent)?void 0:s.type.id)===148||40===t.type.id&&N(t)&&null!==t.firstChild||0===t.type.id&&((null==(o=t.parent)?void 0:o.type.id)===144||(null==(l=t.parent)?void 0:l.type.id)===141||(null==(c=t.parent)?void 0:c.type.id)===148&&Q(t.parent,142)))&&(h=i);return h}(t,a,i),i,s,o))}autocompleteMetricName(e,t){if(!this.prometheusClient)return e;let i=new Map;return this.prometheusClient.metricNames(t.metricName).then(e=>{var t;for(let t of e)i.set(t,{label:t,type:"constant"});if(e.length<=this.maxMetricsMetadata)return null==(t=this.prometheusClient)?void 0:t.metricMetadata()}).then(t=>{var a;if(t)for(let[e,r]of i){let i=null!=(a=t[e])?a:t[e.replace(/(_count|_sum|_bucket)$/,"")];if(i){if(i.length>1)for(let e of i)""===r.detail?r.detail=e.type:r.detail!==e.type&&(r.detail="unknown",r.info="multiple different definitions for this metric"),""===r.info?r.info=e.help:r.info!==e.help&&(r.info="multiple different definitions for this metric");else if(1===i.length){let{type:t,help:a}=i[0];("histogram"===t||"summary"===t)&&(e.endsWith("_count")&&(t="counter",a=`The total number of observations for: ${a}`),e.endsWith("_sum")&&(t="counter",a=`The total sum of observations for: ${a}`),e.endsWith("_bucket")&&(t="counter",a=`The total count of observations for a bucket in the histogram: ${a}`)),r.detail=t,r.info=a}}}return e.concat(Array.from(i.values()))})}autocompleteLabelName(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t.metricName).then(t=>e.concat(t.map(e=>({label:e,type:"constant"})))):e}autocompleteLabelValue(e,t){return this.prometheusClient&&t.labelName?this.prometheusClient.labelValues(t.labelName,t.metricName,t.matchers).then(t=>e.concat(t.map(e=>({label:e,type:"text"})))):e}}let W="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,U=new Set,I="object"==typeof process&&process?process:{},Z=(e,t,i,a)=>{"function"==typeof I.emitWarning?I.emitWarning(e,t,i,a):console.error(`[${i}] ${t}: ${e}`)},j=globalThis.AbortController,B=globalThis.AbortSignal;if(void 0===j){B=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},j=class{constructor(){t()}signal=new B;abort(e){if(!this.signal.aborted){for(let t of(this.signal.reason=e,this.signal.aborted=!0,this.signal._onabort))t(e);this.signal.onabort?.(e)}}};let e=I.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,Z("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");let G=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),H=e=>G(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=0x100000000?Uint32Array:e<=Number.MAX_SAFE_INTEGER?J:null:null;class J extends Array{constructor(e){super(e),this.fill(0)}}class K{heap;length;static #e=!1;static create(e){let t=H(e);if(!t)return[];K.#e=!0;let i=new K(e,t);return K.#e=!1,i}constructor(e,t){if(!K.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class ee{#t;#i;#a;#r;#n;#s;#o;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#u;#h;#d;#p;#f;#O;#m;#v;#g;#y;#$;#b;#_;#T;#x;#Q;#P;#k;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#_,autopurgeTimers:e.#T,sizes:e.#$,keyMap:e.#h,keyList:e.#d,valList:e.#p,next:e.#f,prev:e.#O,get head(){return e.#m},get tail(){return e.#v},free:e.#g,isBackgroundFetch:t=>e.#S(t),backgroundFetch:(t,i,a,r)=>e.#X(t,i,a,r),moveToTail:t=>e.#w(t),indexes:t=>e.#A(t),rindexes:t=>e.#E(t),isStale:t=>e.#L(t)}}get max(){return this.#t}get maxSize(){return this.#i}get calculatedSize(){return this.#u}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#o}get dispose(){return this.#a}get onInsert(){return this.#r}get disposeAfter(){return this.#n}constructor(e){const{max:t=0,ttl:i,ttlResolution:a=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:s,allowStale:o,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:O,fetchMethod:m,memoMethod:v,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:b,ignoreFetchAbort:_,perf:T}=e;if(void 0!==T&&"function"!=typeof T?.now)throw TypeError("perf option must have a now() method if specified");if(this.#l=T??W,0!==t&&!G(t))throw TypeError("max option must be a nonnegative integer");const x=t?H(t):Array;if(!x)throw Error("invalid max value: "+t);if(this.#t=t,this.#i=p,this.maxEntrySize=f||this.#i,this.sizeCalculation=O,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==v&&"function"!=typeof v)throw TypeError("memoMethod must be a function if defined");if(this.#o=v,void 0!==m&&"function"!=typeof m)throw TypeError("fetchMethod must be a function if specified");if(this.#s=m,this.#Q=!!m,this.#h=new Map,this.#d=Array(t).fill(void 0),this.#p=Array(t).fill(void 0),this.#f=new x(t),this.#O=new x(t),this.#m=0,this.#v=0,this.#g=K.create(t),this.#c=0,this.#u=0,"function"==typeof l&&(this.#a=l),"function"==typeof c&&(this.#r=c),"function"==typeof u?(this.#n=u,this.#y=[]):(this.#n=void 0,this.#y=void 0),this.#x=!!this.#a,this.#k=!!this.#r,this.#P=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!_,0!==this.maxEntrySize){if(0!==this.#i&&!G(this.#i))throw TypeError("maxSize must be a positive integer if specified");if(!G(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!s,this.ttlResolution=G(a)||0===a?a:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!G(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#D()}if(0===this.#t&&0===this.ttl&&0===this.#i)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#i){const e="LRU_CACHE_UNBOUNDED";U.has(e)||(U.add(e),Z("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,ee))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#D(){let e=new J(this.#t),t=new J(this.#t);this.#_=e,this.#b=t;let i=this.ttlAutopurge?Array(this.#t):void 0;this.#T=i,this.#M=(a,r,n=this.#l.now())=>{if(t[a]=0!==r?n:0,e[a]=r,i?.[a]&&(clearTimeout(i[a]),i[a]=void 0),0!==r&&i){let e=setTimeout(()=>{this.#L(a)&&this.#F(this.#d[a],"expire")},r+1);e.unref&&e.unref(),i[a]=e}},this.#z=i=>{t[i]=0!==e[i]?this.#l.now():0},this.#R=(i,n)=>{if(e[n]){let s=e[n],o=t[n];if(!s||!o)return;i.ttl=s,i.start=o,i.now=a||r();let l=i.now-o;i.remainingTTL=s-l}};let a=0,r=()=>{let e=this.#l.now();if(this.ttlResolution>0){a=e;let t=setTimeout(()=>a=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let n=this.#h.get(i);if(void 0===n)return 0;let s=e[n],o=t[n];return s&&o?s-((a||r())-o):1/0},this.#L=i=>{let n=t[i],s=e[i];return!!s&&!!n&&(a||r())-n>s}}#z=()=>{};#R=()=>{};#M=()=>{};#L=()=>!1;#C(){let e=new J(this.#t);this.#u=0,this.#$=e,this.#q=t=>{this.#u-=e[t],e[t]=0},this.#V=(e,t,i,a)=>{if(this.#S(t))return 0;if(!G(i))if(a){if("function"!=typeof a)throw TypeError("sizeCalculation must be a function");if(!G(i=a(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,i,a)=>{if(e[t]=i,this.#i){let i=this.#i-e[t];for(;this.#u>i;)this.#Y(!0)}this.#u+=e[t],a&&(a.entrySize=i,a.totalCalculatedSize=this.#u)}}#q=e=>{};#N=(e,t,i)=>{};#V=(e,t,i,a)=>{if(i||a)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#v;this.#W(t)&&((e||!this.#L(t))&&(yield t),t!==this.#m);)t=this.#O[t]}*#E({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#m;this.#W(t)&&((e||!this.#L(t))&&(yield t),t!==this.#v);)t=this.#f[t]}#W(e){return void 0!==e&&this.#h.get(this.#d[e])===e}*entries(){for(let e of this.#A())void 0===this.#p[e]||void 0===this.#d[e]||this.#S(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*rentries(){for(let e of this.#E())void 0===this.#p[e]||void 0===this.#d[e]||this.#S(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*keys(){for(let e of this.#A()){let t=this.#d[e];void 0===t||this.#S(this.#p[e])||(yield t)}}*rkeys(){for(let e of this.#E()){let t=this.#d[e];void 0===t||this.#S(this.#p[e])||(yield t)}}*values(){for(let e of this.#A())void 0===this.#p[e]||this.#S(this.#p[e])||(yield this.#p[e])}*rvalues(){for(let e of this.#E())void 0===this.#p[e]||this.#S(this.#p[e])||(yield this.#p[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let a=this.#p[i],r=this.#S(a)?a.__staleWhileFetching:a;if(void 0!==r&&e(r,this.#d[i],this))return this.get(this.#d[i],t)}}forEach(e,t=this){for(let i of this.#A()){let a=this.#p[i],r=this.#S(a)?a.__staleWhileFetching:a;void 0!==r&&e.call(t,r,this.#d[i],this)}}rforEach(e,t=this){for(let i of this.#E()){let a=this.#p[i],r=this.#S(a)?a.__staleWhileFetching:a;void 0!==r&&e.call(t,r,this.#d[i],this)}}purgeStale(){let e=!1;for(let t of this.#E({allowStale:!0}))this.#L(t)&&(this.#F(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#h.get(e);if(void 0===t)return;let i=this.#p[t],a=this.#S(i)?i.__staleWhileFetching:i;if(void 0===a)return;let r={value:a};if(this.#_&&this.#b){let e=this.#_[t],i=this.#b[t];e&&i&&(r.ttl=e-(this.#l.now()-i),r.start=Date.now())}return this.#$&&(r.size=this.#$[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#d[t],a=this.#p[t],r=this.#S(a)?a.__staleWhileFetching:a;if(void 0===r||void 0===i)continue;let n={value:r};if(this.#_&&this.#b){n.ttl=this.#_[t];let e=this.#l.now()-this.#b[t];n.start=Math.floor(Date.now()-e)}this.#$&&(n.size=this.#$[t]),e.unshift([i,n])}return e}load(e){for(let[t,i]of(this.clear(),e)){if(i.start){let e=Date.now()-i.start;i.start=this.#l.now()-e}this.set(t,i.value,i)}}set(e,t,i={}){if(void 0===t)return this.delete(e),this;let{ttl:a=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:o}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=this.#V(e,t,i.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this.#F(e,"set"),this;let u=0===this.#c?void 0:this.#h.get(e);if(void 0===u)u=0===this.#c?this.#v:0!==this.#g.length?this.#g.pop():this.#c===this.#t?this.#Y(!1):this.#c,this.#d[u]=e,this.#p[u]=t,this.#h.set(e,u),this.#f[this.#v]=u,this.#O[u]=this.#v,this.#v=u,this.#c++,this.#N(u,c,o),o&&(o.set="add"),l=!1,this.#k&&this.#r?.(t,e,"add");else{this.#w(u);let i=this.#p[u];if(t!==i){if(this.#Q&&this.#S(i)){i.__abortController.abort(Error("replaced"));let{__staleWhileFetching:t}=i;void 0!==t&&!n&&(this.#x&&this.#a?.(t,e,"set"),this.#P&&this.#y?.push([t,e,"set"]))}else!n&&(this.#x&&this.#a?.(i,e,"set"),this.#P&&this.#y?.push([i,e,"set"]));if(this.#q(u),this.#N(u,c,o),this.#p[u]=t,o){o.set="replace";let e=i&&this.#S(i)?i.__staleWhileFetching:i;void 0!==e&&(o.oldValue=e)}}else o&&(o.set="update");this.#k&&this.onInsert?.(t,e,t===i?"update":"replace")}if(0===a||this.#_||this.#D(),this.#_&&(l||this.#M(u,a,r),o&&this.#R(o,u)),!n&&this.#P&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#c;){let e=this.#p[this.#m];if(this.#Y(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#P&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}}#Y(e){let t=this.#m,i=this.#d[t],a=this.#p[t];return this.#Q&&this.#S(a)?a.__abortController.abort(Error("evicted")):(this.#x||this.#P)&&(this.#x&&this.#a?.(a,i,"evict"),this.#P&&this.#y?.push([a,i,"evict"])),this.#q(t),this.#T?.[t]&&(clearTimeout(this.#T[t]),this.#T[t]=void 0),e&&(this.#d[t]=void 0,this.#p[t]=void 0,this.#g.push(t)),1===this.#c?(this.#m=this.#v=0,this.#g.length=0):this.#m=this.#f[t],this.#h.delete(i),this.#c--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:a}=t,r=this.#h.get(e);if(void 0!==r){let e=this.#p[r];if(this.#S(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#L(r))return i&&this.#z(r),a&&(a.has="hit",this.#R(a,r)),!0;a&&(a.has="stale",this.#R(a,r))}else a&&(a.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,a=this.#h.get(e);if(void 0===a||!i&&this.#L(a))return;let r=this.#p[a];return this.#S(r)?r.__staleWhileFetching:r}#X(e,t,i,a){let r=void 0===t?void 0:this.#p[t];if(this.#S(r))return r;let n=new j,{signal:s}=i;s?.addEventListener("abort",()=>n.abort(s.reason),{signal:n.signal});let o={signal:n.signal,options:i,context:a},l=(a,r=!1)=>{let{aborted:s}=n.signal,l=i.ignoreFetchAbort&&void 0!==a;if(i.status&&(s&&!r?(i.status.fetchAborted=!0,i.status.fetchError=n.signal.reason,l&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),s&&!l&&!r)return c(n.signal.reason);let u=this.#p[t];return(u===h||l&&r&&void 0===u)&&(void 0===a?void 0!==h.__staleWhileFetching?this.#p[t]=h.__staleWhileFetching:this.#F(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,a,o.options))),a},c=a=>{let{aborted:r}=n.signal,s=r&&i.allowStaleOnFetchAbort,o=s||i.allowStaleOnFetchRejection,l=o||i.noDeleteOnFetchRejection;if(this.#p[t]===h&&(l&&void 0!==h.__staleWhileFetching?s||(this.#p[t]=h.__staleWhileFetching):this.#F(e,"fetch")),o)return i.status&&void 0!==h.__staleWhileFetching&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw a},u=(t,a)=>{let s=this.#s?.(e,r,o);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),a),n.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(u).then(l,e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),c(e))),d=Object.assign(h,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.set(e,d,{...o.options,status:void 0}),t=this.#h.get(e)):this.#p[t]=d,d}#S(e){return!!this.#Q&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof j}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:O=!1,status:m,signal:v}=t;if(!this.#Q)return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:r,status:m});let g={allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:s,size:o,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:m,signal:v},y=this.#h.get(e);if(void 0===y){m&&(m.fetch="miss");let t=this.#X(e,y,g,f);return t.__returned=t}{let t=this.#p[y];if(this.#S(t)){let e=i&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let r=this.#L(y);if(!O&&!r)return m&&(m.fetch="hit"),this.#w(y),a&&this.#z(y),m&&this.#R(m,y),t;let n=this.#X(e,y,g,f),s=void 0!==n.__staleWhileFetching&&i;return m&&(m.fetch=r?"stale":"refresh",s&&r&&(m.returnedStale=!0)),s?n.__staleWhileFetching:n.__returned=n}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(void 0===i)throw Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#o;if(!i)throw Error("no memoMethod provided to constructor");let{context:a,forceRefresh:r,...n}=t,s=this.get(e,n);if(!r&&void 0!==s)return s;let o=i(e,s,{options:n,context:a});return this.set(e,o,n),o}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=t,s=this.#h.get(e);if(void 0!==s){let t=this.#p[s],o=this.#S(t);return(n&&this.#R(n,s),this.#L(s))?(n&&(n.get="stale"),o)?(n&&i&&void 0!==t.__staleWhileFetching&&(n.returnedStale=!0),i?t.__staleWhileFetching:void 0):(r||this.#F(e,"expire"),n&&i&&(n.returnedStale=!0),i?t:void 0):(n&&(n.get="hit"),o)?t.__staleWhileFetching:(this.#w(s),a&&this.#z(s),t)}n&&(n.get="miss")}#U(e,t){this.#O[t]=e,this.#f[e]=t}#w(e){e!==this.#v&&(e===this.#m?this.#m=this.#f[e]:this.#U(this.#O[e],this.#f[e]),this.#U(this.#v,e),this.#v=e)}delete(e){return this.#F(e,"delete")}#F(e,t){let i=!1;if(0!==this.#c){let a=this.#h.get(e);if(void 0!==a)if(this.#T?.[a]&&(clearTimeout(this.#T?.[a]),this.#T[a]=void 0),i=!0,1===this.#c)this.#I(t);else{this.#q(a);let i=this.#p[a];if(this.#S(i)?i.__abortController.abort(Error("deleted")):(this.#x||this.#P)&&(this.#x&&this.#a?.(i,e,t),this.#P&&this.#y?.push([i,e,t])),this.#h.delete(e),this.#d[a]=void 0,this.#p[a]=void 0,a===this.#v)this.#v=this.#O[a];else if(a===this.#m)this.#m=this.#f[a];else{let e=this.#O[a];this.#f[e]=this.#f[a];let t=this.#f[a];this.#O[t]=this.#O[a]}this.#c--,this.#g.push(a)}}if(this.#P&&this.#y?.length){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return i}clear(){return this.#I("delete")}#I(e){for(let t of this.#E({allowStale:!0})){let i=this.#p[t];if(this.#S(i))i.__abortController.abort(Error("deleted"));else{let a=this.#d[t];this.#x&&this.#a?.(i,a,e),this.#P&&this.#y?.push([i,a,e])}}if(this.#h.clear(),this.#p.fill(void 0),this.#d.fill(void 0),this.#_&&this.#b){for(let e of(this.#_.fill(0),this.#b.fill(0),this.#T??[]))void 0!==e&&clearTimeout(e);this.#T?.fill(void 0)}if(this.#$&&this.#$.fill(0),this.#m=0,this.#v=0,this.#g.length=0,this.#u=0,this.#c=0,this.#P&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}}class et{constructor(e){this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=(e,t)=>fetch(e,t),this.requestHeaders=new Headers,this.url=e.url?e.url:"",this.errorHandler=e.httpErrorHandler,this.lookbackInterval=e.lookbackInterval,e.fetchFn&&(this.fetchFn=e.fetchFn),e.httpMethod&&(this.httpMethod=e.httpMethod),e.apiPrefix&&(this.apiPrefix=e.apiPrefix),e.requestHeaders&&(this.requestHeaders=e.requestHeaders)}labelNames(e){let t=new URLSearchParams;if(this.lookbackInterval){let e=new Date,i=new Date(e.getTime()-this.lookbackInterval);t.set("start",i.toISOString()),t.set("end",e.toISOString())}e&&e.length>0&&t.set("match[]",T(e));let i=this.buildRequest(this.labelsEndpoint(),t);return this.fetchAPI(i.uri,{method:this.httpMethod,body:i.body}).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}labelValues(e,t,i){let a=new URLSearchParams;if(this.lookbackInterval){let e=new Date,t=new Date(e.getTime()-this.lookbackInterval);a.set("start",t.toISOString()),a.set("end",e.toISOString())}return t&&t.length>0&&a.set("match[]",T(t,i,e)),this.fetchAPI(`${this.labelValuesEndpoint().replace(/:name/gi,e)}?${a}`).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}metricMetadata(){return this.fetchAPI(this.metricMetadataEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}series(e,t,i){let a=new URLSearchParams;if(this.lookbackInterval){let e=new Date,t=new Date(e.getTime()-this.lookbackInterval);a.set("start",t.toISOString()),a.set("end",e.toISOString())}a.set("match[]",T(e,t,i));let r=this.buildRequest(this.seriesEndpoint(),a);return this.fetchAPI(r.uri,{method:this.httpMethod,body:r.body}).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}metricNames(){return this.labelValues("__name__")}flags(){return this.fetchAPI(this.flagsEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}fetchAPI(e,t){return t?t.headers=this.requestHeaders:t={headers:this.requestHeaders},this.fetchFn(this.url+e,t).then(e=>{if(!e.ok&&![400,422,503].includes(e.status))throw Error(e.statusText);return e}).then(e=>e.json()).then(e=>{if("error"===e.status)throw Error(void 0!==e.error?e.error:'missing "error" field in response JSON');if(void 0===e.data)throw Error('missing "data" field in response JSON');return e.data})}buildRequest(e,t){let i=e,a=t;return"GET"===this.httpMethod&&(i=`${i}?${t}`,a=null),{uri:i,body:a}}labelsEndpoint(){return`${this.apiPrefix}/labels`}labelValuesEndpoint(){return`${this.apiPrefix}/label/:name/values`}seriesEndpoint(){return`${this.apiPrefix}/series`}metricMetadataEndpoint(){return`${this.apiPrefix}/metadata`}flagsEndpoint(){return`${this.apiPrefix}/status/flags`}}class ei{constructor(e){const t={ttl:e&&e.maxAge?e.maxAge:3e5,ttlAutopurge:!0};this.completeAssociation=new ee(t),this.metricMetadata={},this.labelValues=new ee(t),this.labelNames=[],this.flags={},(null==e?void 0:e.initialMetricList)&&this.setLabelValues("__name__",e.initialMetricList)}getAssociations(e){let t=this.completeAssociation.get(e);return t||(t=new Map,this.completeAssociation.set(e,t)),t}setAssociations(e,t){t.forEach(t=>{let i=this.getAssociations(e);for(let[e,a]of Object.entries(t)){if("__name__"===e)continue;let t=i.get(e);void 0===t?i.set(e,new Set([a])):t.add(a)}})}setLabelValuesAssociation(e,t,i){let a=this.getAssociations(e),r=a.get(t);void 0===r?a.set(t,new Set(i)):i.forEach(e=>{r.add(e)})}setLabelNamesAssociation(e,t){let i=this.getAssociations(e);t.forEach(e=>{"__name__"!==e&&(i.has(e)||i.set(e,new Set))})}setFlags(e){this.flags=e}getFlags(){return this.flags}setMetricMetadata(e){this.metricMetadata=e}getMetricMetadata(){return this.metricMetadata}setLabelNames(e,t){t&&t.length>0&&this.setLabelNamesAssociation(t,e),this.labelNames=e}getLabelNames(e){if(!e||0===e.length)return this.labelNames;let t=this.completeAssociation.get(e);return t?Array.from(t.keys()):[]}setLabelValues(e,t,i){i&&i.length>0&&this.setLabelValuesAssociation(i,e,t),this.labelValues.set(e,t)}getLabelValues(e,t){if(!t||0===t.length)return this.labelValues.get(e)||[];let i=this.completeAssociation.get(t);if(i){let t=i.get(e);return t?Array.from(t):[]}return[]}}class ea{constructor(e,t){this.client=e,this.cache=new ei(t)}labelNames(e){let t=this.cache.getLabelNames(e);return t&&t.length>0?Promise.resolve(t):this.client.labelNames(e).then(t=>(this.cache.setLabelNames(t,e),this.cache.getLabelNames(e)))}labelValues(e,t){let i=this.cache.getLabelValues(e,t);return i&&i.length>0?Promise.resolve(i):this.client.labelValues(e,t).then(i=>(this.cache.setLabelValues(e,i,t),i))}metricMetadata(){let e=this.cache.getMetricMetadata();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.metricMetadata().then(e=>(this.cache.setMetricMetadata(e),e))}series(e){return this.client.series(e).then(t=>(this.cache.setAssociations(e,t),t))}metricNames(){return this.labelValues("__name__")}flags(){let e=this.cache.getFlags();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.flags().then(e=>(this.cache.setFlags(e),e))}}function er(e){if(null==e?void 0:e.completeStrategy)return e.completeStrategy;if(null==e?void 0:e.remote){var t;return"function"==typeof(t=e.remote).labelNames&&"function"==typeof t.labelValues&&"function"==typeof t.metricMetadata&&"function"==typeof t.series&&"function"==typeof t.metricNames?new Y(e.remote,e.maxMetricsMetadata):new Y(new ea(new et(e.remote),e.remote.cache),e.maxMetricsMetadata)}return new Y}var en=i(13313);class es{promQL(){return e=>{let t=new X(e.state);return t.analyze(),t.getDiagnostics()}}}(s=u||(u={})).PromQL="PromQL",s.MetricName="MetricName";class eo{constructor(){this.complete=er(),this.lint=new es,this.enableLinter=!0,this.enableCompletion=!0}setComplete(e){return this.complete=er(e),this}getComplete(){return this.complete}activateCompletion(e){return this.enableCompletion=e,this}setLinter(e){return this.lint=e,this}getLinter(){return this.lint}activateLinter(e){return this.enableLinter=e,this}asExtension(e=u.PromQL){var t,i;let a=S.bj.define({parser:y.configure({top:e}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),r=[a];if(this.enableCompletion){let e=a.data.of({autocomplete:e=>this.complete.promQL(e)});r=r.concat(e)}return this.enableLinter&&(r=r.concat((t=this.lint.promQL,i=this.lint,(0,en.bu)(t.call(i))))),r}}},74830:function(e,t,i){var a;t.default=void 0,t.default=(0,((a=i(1448))&&a.__esModule?a:{default:a}).default)("M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","AlertCircle")},7800:function(e,t,i){var a;t.default=void 0,t.default=(0,((a=i(1448))&&a.__esModule?a:{default:a}).default)("M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z","Close")},93196:function(e,t,i){var a;t.default=void 0,t.default=(0,((a=i(1448))&&a.__esModule?a:{default:a}).default)("M3,3H9V7H3V3M15,10H21V14H15V10M15,17H21V21H15V17M13,13H7V18H13V20H7L5,20V9H7V11H13V13Z","FileTree")}}]);
1
+ "use strict";(self["chunk_Prometheus "]=self["chunk_Prometheus "]||[]).push([["8634"],{99123(e,t,i){i.d(t,{TI:()=>en});var a,r,n,s,o,l,c,u,h=i(782),d=i(31650);let O={inf:167,nan:168,bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},p=(e,t)=>O[e.toLowerCase()]||-1,f={avg:8,atan2:7,bottomk:9,count:10,count_values:11,group:12,max:13,min:14,quantile:15,limitk:16,limit_ratio:17,stddev:18,stdvar:19,sum:20,topk:21,by:22,without:23,and:24,or:25,unless:26,start:27,end:28,smoothed:29,anchored:30},m=(e,t)=>f[e.toLowerCase()]||-1,v=(0,d.pn)({LineComment:d._A.comment,LabelName:d._A.labelName,StringLiteral:d._A.string,NumberDurationLiteral:d._A.number,NumberDurationLiteralInDurationContext:d._A.number,Identifier:d._A.variableName,"Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp Floor HistogramAvg HistogramCount HistogramFraction HistogramQuantile HistogramSum DoubleExponentialSmoothing Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":d._A.function(d._A.variableName),"Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk":d._A.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End Smoothed Anchored":d._A.modifier,"And Unless Or":d._A.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":d._A.operator,UnaryOp:d._A.arithmeticOperator,"( )":d._A.paren,"[ ]":d._A.squareBracket,"{ }":d._A.brace,"⚠":d._A.invalid}),g={__proto__:null,absent_over_time:353,absent:355,abs:357,acos:359,acosh:361,asin:363,asinh:365,atan:367,atanh:369,avg_over_time:371,ceil:373,changes:375,clamp:377,clamp_max:379,clamp_min:381,cos:383,cosh:385,count_over_time:387,days_in_month:389,day_of_month:391,day_of_week:393,day_of_year:395,deg:397,delta:399,deriv:401,exp:403,first_over_time:405,floor:407,histogram_count:409,histogram_fraction:411,histogram_quantile:413,histogram_stddev:415,histogram_stdvar:417,histogram_sum:419,histogram_avg:421,double_exponential_smoothing:423,hour:425,idelta:427,increase:429,info:431,irate:433,label_replace:435,label_join:437,last_over_time:439,ln:441,log10:443,log2:445,mad_over_time:447,max_over_time:449,min_over_time:451,ts_of_first_over_time:453,ts_of_max_over_time:455,ts_of_min_over_time:457,ts_of_last_over_time:459,minute:461,month:463,pi:465,predict_linear:467,present_over_time:469,quantile_over_time:471,rad:473,rate:475,resets:477,round:479,scalar:481,sgn:483,sin:485,sinh:487,sort:489,sort_desc:491,sort_by_label:493,sort_by_label_desc:495,sqrt:497,stddev_over_time:499,stdvar_over_time:501,sum_over_time:503,tan:505,tanh:507,timestamp:509,time:511,vector:513,year:515},$=h.U1.deserialize({version:14,states:":^OYQPOOO(TQPOOOOQO'#DO'#DOO(YQPO'#C}Q(eQQOOOOQO'#Dg'#DgO(`QPO'#DfOOQO'#Fa'#FaO)xQPO'#FhOYQPO'#FeOYQPO'#FgO0|QSO'#FjO1XQQO'#FiOOQO'#Fi'#FiOOQO'#F}'#F}OOQO'#Dh'#DhOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpO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#hO~Ou%QOw#hO$t%WO~Ou%QOw#hO~O",goto:"*P$vPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP$w%T%a%gP%pP&Q$wP&Z&bPPPPPPPPPPP$w&l&xP&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x&x$w'U'_$w$w$w$w$w$w'n$w'z(Z(cPPP(Z$wP(jP(m(s(yPPPPP)QPPP)pe^OXY#V#w#x#y#z#{$_eROXY#V#w#x#y#z#{$_Q#WRR#r#XQ#o#UQ$b#tR%U$zQ#jZQ$^#nU$o$Y$r%PV%Q$t%S%XQ#XRQ#dUR#r#WZ#v#Y#Z#[#]#^Y#u#Y#Z#[#]#^R$c#veUOXY#V#w#x#y#z#{$_eTOXY#V#w#x#y#z#{$_Q$O#_Q$P#`R$|$kd^OXY#V#w#x#y#z#{$_R$S#ceYOXY#V#w#x#y#z#{$_d]OXY#V#w#x#y#z#{$_R#m[Q#lZV$p$Y$r%PQ$W#iT$X#j$oR$T#cQ$u$^R%T$uQ$`#qR$x$`S$Z#j#lR$s$ZQSOQ#fXQ#gYQ#q#VQ$d#wQ$e#xQ$f#yQ$g#zQ$h#{R$w$_Q#w#YQ#x#ZQ#y#[Q#z#]R#{#^",nodeNames:"⚠ Bool Ignoring On GroupLeft GroupRight Offset Atan2 Avg Bottomk Count CountValues Group Max Min Quantile LimitK LimitRatio Stddev Stdvar Sum Topk By Without And Or Unless Start End Smoothed Anchored LineComment PromQL AggregateExpr AggregateOp AggregateModifier GroupingLabels LabelName QuotedLabelName StringLiteral FunctionCallBody BinaryExpr Pow BoolModifier MatchingModifierClause Mul Div Mod Add Sub Eql Gte Gtr Lte Lss Neq FunctionCall FunctionIdentifier AbsentOverTime Identifier Absent Abs Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp FirstOverTime Floor HistogramCount HistogramFraction HistogramQuantile HistogramStdDev HistogramStdVar HistogramSum HistogramAvg DoubleExponentialSmoothing Hour Idelta Increase Info Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MadOverTime MaxOverTime MinOverTime TsOfFirstOverTime TsOfMaxOverTime TsOfMinOverTime TsOfLastOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Timestamp Time Vector Year MatrixSelector NumberDurationLiteralInDurationContext NumberDurationLiteral OffsetExpr AnchoredExpr SmoothedExpr ParenExpr SubqueryExpr UnaryExpr UnaryOp VectorSelector LabelMatchers UnquotedLabelMatcher MatchOp EqlSingle EqlRegex NeqRegex QuotedLabelMatcher StepInvariantExpr At AtModifierPreprocessors MetricName",maxTerm:265,nodeProps:[["group",-14,33,39,41,56,141,143,144,145,146,147,148,149,151,159,"Expr"]],propSources:[v],skippedNodes:[0,31],repeatNodeCount:3,tokenData:"4k~RwX^#lpq#lqr$ars$tst&luv'Twx'Yxy({yz)Qz{)V{|)[|})c}!O)h!O!P)o!P!Q*u!Q!R*z!R![+u![!]1O!^!_1z!_!`2X!`!a2n!b!c2{!c!}3Q!}#O3h#P#Q3m#Q#R3r#R#S3Q#S#T3w#T#o3Q#o#p4a#q#r4f#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~#qY$p~X^#lpq#l#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~$dQ!_!`$j#r#s$o~$oO!X~~$tO$c~~$yWw~OY$tZr$trs%cs#O$t#O#P%h#P;'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S1f#T#o1fR1kT!]R!Q![1f![!]1f!c!}1f#R#S1f#T#o1f~2PP!W~!_!`2S~2XO!V~~2^Q$aP!_!`2d#r#s2iQ2iO!SQ~2nO$b~~2sP!U~!_!`2v~2{O!T~~3QO$f~V3XT!]RuS!Q![3Q![!]1f!c!}3Q#R#S3Q#T#o3Q~3mO&l~~3rO&p~~3wOz~~3zTO#S3w#S#T%c#T;'S3w;'S;=`4Z<%lO3w~4^P;=`<%l3w~4fO&r~~4kO&s~",tokenizers:[0,1,2],topRules:{PromQL:[0,32],MetricName:[1,162]},specialized:[{term:59,get:(e,t)=>p(e)<<1,external:p},{term:59,get:(e,t)=>m(e)<<1|1,external:m,extend:!0},{term:59,get:e=>g[e]||-1}],tokenPrec:0});(a=o||(o={})).none="none",a.vector="vector",a.scalar="scalar",a.matrix="matrix",a.string="string";let y={61:{name:"abs",argTypes:[o.vector],variadic:0,returnType:o.vector},60:{name:"absent",argTypes:[o.vector],variadic:0,returnType:o.vector},58:{name:"absent_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},62:{name:"acos",argTypes:[o.vector],variadic:0,returnType:o.vector},63:{name:"acosh",argTypes:[o.vector],variadic:0,returnType:o.vector},64:{name:"asin",argTypes:[o.vector],variadic:0,returnType:o.vector},65:{name:"asinh",argTypes:[o.vector],variadic:0,returnType:o.vector},66:{name:"atan",argTypes:[o.vector],variadic:0,returnType:o.vector},67:{name:"atanh",argTypes:[o.vector],variadic:0,returnType:o.vector},68:{name:"avg_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},69:{name:"ceil",argTypes:[o.vector],variadic:0,returnType:o.vector},70:{name:"changes",argTypes:[o.matrix],variadic:0,returnType:o.vector},71:{name:"clamp",argTypes:[o.vector,o.scalar,o.scalar],variadic:0,returnType:o.vector},72:{name:"clamp_max",argTypes:[o.vector,o.scalar],variadic:0,returnType:o.vector},73:{name:"clamp_min",argTypes:[o.vector,o.scalar],variadic:0,returnType:o.vector},74:{name:"cos",argTypes:[o.vector],variadic:0,returnType:o.vector},75:{name:"Cosh",argTypes:[o.vector],variadic:0,returnType:o.vector},76:{name:"count_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},77:{name:"days_in_month",argTypes:[o.vector],variadic:1,returnType:o.vector},78:{name:"day_of_month",argTypes:[o.vector],variadic:1,returnType:o.vector},79:{name:"day_of_week",argTypes:[o.vector],variadic:1,returnType:o.vector},80:{name:"day_of_year",argTypes:[o.vector],variadic:1,returnType:o.vector},81:{name:"deg",argTypes:[o.vector],variadic:0,returnType:o.vector},82:{name:"delta",argTypes:[o.matrix],variadic:0,returnType:o.vector},83:{name:"deriv",argTypes:[o.matrix],variadic:0,returnType:o.vector},84:{name:"exp",argTypes:[o.vector],variadic:0,returnType:o.vector},85:{name:"first_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},86:{name:"floor",argTypes:[o.vector],variadic:0,returnType:o.vector},93:{name:"histogram_avg",argTypes:[o.vector],variadic:0,returnType:o.vector},87:{name:"histogram_count",argTypes:[o.vector],variadic:0,returnType:o.vector},88:{name:"histogram_fraction",argTypes:[o.scalar,o.scalar,o.vector],variadic:0,returnType:o.vector},89:{name:"histogram_quantile",argTypes:[o.scalar,o.vector],variadic:0,returnType:o.vector},90:{name:"histogram_stddev",argTypes:[o.vector],variadic:0,returnType:o.vector},91:{name:"histogram_stdvar",argTypes:[o.vector],variadic:0,returnType:o.vector},92:{name:"histogram_sum",argTypes:[o.vector],variadic:0,returnType:o.vector},94:{name:"double_exponential_smoothing",argTypes:[o.matrix,o.scalar,o.scalar],variadic:0,returnType:o.vector},95:{name:"hour",argTypes:[o.vector],variadic:1,returnType:o.vector},96:{name:"idelta",argTypes:[o.matrix],variadic:0,returnType:o.vector},97:{name:"increase",argTypes:[o.matrix],variadic:0,returnType:o.vector},98:{name:"info",argTypes:[o.vector,o.vector],variadic:1,returnType:o.vector},99:{name:"irate",argTypes:[o.matrix],variadic:0,returnType:o.vector},100:{name:"label_replace",argTypes:[o.vector,o.string,o.string,o.string,o.string],variadic:0,returnType:o.vector},101:{name:"label_join",argTypes:[o.vector,o.string,o.string,o.string],variadic:-1,returnType:o.vector},102:{name:"last_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},103:{name:"ln",argTypes:[o.vector],variadic:0,returnType:o.vector},104:{name:"log10",argTypes:[o.vector],variadic:0,returnType:o.vector},105:{name:"log2",argTypes:[o.vector],variadic:0,returnType:o.vector},106:{name:"mad_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},107:{name:"max_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},108:{name:"min_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},109:{name:"ts_of_first_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},110:{name:"ts_of_max_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},111:{name:"ts_of_min_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},112:{name:"ts_of_last_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},113:{name:"minute",argTypes:[o.vector],variadic:1,returnType:o.vector},114:{name:"month",argTypes:[o.vector],variadic:1,returnType:o.vector},115:{name:"pi",argTypes:[],variadic:0,returnType:o.vector},116:{name:"predict_linear",argTypes:[o.matrix,o.scalar],variadic:0,returnType:o.vector},117:{name:"present_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},118:{name:"quantile_over_time",argTypes:[o.scalar,o.matrix],variadic:0,returnType:o.vector},119:{name:"rad",argTypes:[o.vector],variadic:0,returnType:o.vector},120:{name:"rate",argTypes:[o.matrix],variadic:0,returnType:o.vector},121:{name:"resets",argTypes:[o.matrix],variadic:0,returnType:o.vector},122:{name:"round",argTypes:[o.vector,o.scalar],variadic:1,returnType:o.vector},123:{name:"scalar",argTypes:[o.vector],variadic:0,returnType:o.scalar},124:{name:"sgn",argTypes:[o.vector],variadic:0,returnType:o.vector},125:{name:"sin",argTypes:[o.vector],variadic:0,returnType:o.vector},126:{name:"Sinh",argTypes:[o.vector],variadic:0,returnType:o.vector},127:{name:"sort",argTypes:[o.vector],variadic:0,returnType:o.vector},128:{name:"sort_desc",argTypes:[o.vector],variadic:0,returnType:o.vector},129:{name:"sort_by_label",argTypes:[o.vector,o.string],variadic:-1,returnType:o.vector},130:{name:"sort_by_label_desc",argTypes:[o.vector,o.string],variadic:-1,returnType:o.vector},131:{name:"sqrt",argTypes:[o.vector],variadic:0,returnType:o.vector},132:{name:"stddev_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},133:{name:"stdvar_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},134:{name:"sum_over_time",argTypes:[o.matrix],variadic:0,returnType:o.vector},135:{name:"tan",argTypes:[o.vector],variadic:0,returnType:o.vector},136:{name:"tanh",argTypes:[o.vector],variadic:0,returnType:o.vector},138:{name:"time",argTypes:[],variadic:0,returnType:o.scalar},137:{name:"timestamp",argTypes:[o.vector],variadic:0,returnType:o.vector},139:{name:"vector",argTypes:[o.scalar],variadic:0,returnType:o.vector},140:{name:"year",argTypes:[o.vector],variadic:1,returnType:o.vector}};class b{constructor(e,t,i){this.type=e,this.name=t,this.value=i}matchesEmpty(){switch(this.type){case 155:return""===this.value;case 55:return""!==this.value;default:return!1}}}function _(e,t){let i=[];return e.forEach(e=>{i.push(function(e,t){let i=new b(0,"",""),a=e.cursor();switch(a.type.id){case 158:if(!a.next())break;do switch(a.type.id){case 38:i.name=t.sliceDoc(a.from,a.to).slice(1,-1);break;case 154:{let e=a.node.firstChild;e&&(i.type=e.type.id);break}case 39:i.value=t.sliceDoc(a.from,a.to).slice(1,-1)}while(a.nextSibling());break;case 153:if(!a.next())break;do switch(a.type.id){case 37:i.name=t.sliceDoc(a.from,a.to);break;case 154:{let e=a.node.firstChild;e&&(i.type=e.type.id);break}case 39:i.value=t.sliceDoc(a.from,a.to).slice(1,-1)}while(a.nextSibling());break;case 38:i.name="__name__",i.value=t.sliceDoc(a.from,a.to).slice(1,-1),i.type=155}return i}(e,t))}),i}function T(e,t,i){if(!t||0===t.length)return e;let a="";for(let e of t){if(e.name===i||""===e.value)continue;let t="";switch(e.type){case 155:default:t="=";break;case 55:t="!=";break;case 157:t="!~";break;case 156:t="=~"}let r=`${e.name}${t}"${e.value}"`;a=""===a?r:`${a},${r}`}return`${e}{${a}}`}function Q(e,t){for(;;){if(!e||e.type.id===t)return e;e=e.parent}return null}function x(e,...t){let i=e.cursor();if(!i.next())return!1;let a=!1;do a=t.some(e=>i.type.id===e||i.type.name===e);while(!a&&i.nextSibling());return a}function P(e,...t){let i=e.cursor();if(!i.next())return!1;let a=0;do i.type.is(t[a])&&a++;while(a<t.length&&i.nextSibling());return a>=t.length}function S(e){var t;if(!e)return o.none;switch(e.type.id){case 33:case 151:return o.vector;case 144:case 146:case 145:return S(e.firstChild);case 39:return o.string;case 143:return o.scalar;case 141:case 148:return o.matrix;case 147:case 149:case 159:return S(e.getChild("Expr"));case 41:{let t=S(e.firstChild),i=S(e.lastChild);if(t===o.scalar&&i===o.scalar)return o.scalar;return o.vector}case 56:{let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return o.none;return y[i.type.id].returnType}default:return o.none}}(r=l||(l={})).CardOneToOne="one-to-one",r.CardManyToOne="many-to-one",r.CardOneToMany="one-to-many",r.CardManyToMany="many-to-many";var X=i(63960);class w{constructor(e){this.tree=(0,X.mv)(e),this.state=e,this.diagnostics=[]}getDiagnostics(){return this.diagnostics.sort((e,t)=>e.from-t.from)}analyze(){this.checkAST(this.tree.topNode.firstChild),this.diagnoseAllErrorNodes()}diagnoseAllErrorNodes(){let e=this.tree.cursor();for(;e.next();)if(0===e.type.id&&e.to!==this.tree.topNode.to){let t=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:t?t.from:e.from,to:t?t.to:e.to})}}checkAST(e){if(!e)return o.none;switch(e.type.id){case 33:this.checkAggregationExpr(e);break;case 41:this.checkBinaryExpr(e);break;case 56:this.checkCallFunction(e);break;case 147:case 141:this.checkAST(e.getChild("Expr"));break;case 149:{let t=this.checkAST(e.getChild("Expr"));t!==o.scalar&&t!==o.vector&&this.addDiagnostic(e,`unary expression only allowed on expressions of type scalar or instant vector, got ${t}`);break}case 146:this.checkAnchoredSmoothedExpr(e,[120,97,82]);break;case 145:this.checkAnchoredSmoothedExpr(e,[121,70,120,97,82]);break;case 148:{let t=this.checkAST(e.getChild("Expr"));t!==o.vector&&this.addDiagnostic(e,`subquery is only allowed on instant vector, got ${t} in ${e.name} instead`);break}case 151:this.checkVectorSelector(e);break;case 159:{let t=this.checkAST(e.getChild("Expr"));t!==o.vector&&t!==o.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery")}}return S(e)}checkAggregationExpr(e){var t;let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return void this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing");let a=e.getChild(40),r=a?a.getChildren("Expr"):[];r.length?(this.expectType(r[r.length-1],o.vector,"aggregation expression"),(21===i.type.id||9===i.type.id||16===i.type.id||17===i.type.id||15===i.type.id)&&this.expectType(r[0],o.scalar,"aggregation parameter"),11===i.type.id&&this.expectType(r[0],o.string,"aggregation parameter")):this.addDiagnostic(e,"unable to find the parameter for the expression")}checkBinaryExpr(e){let t=e.firstChild,i=e.lastChild;if(!t||!i)return void this.addDiagnostic(e,"left or right expression is missing in binary expression");let a=this.checkAST(t),r=this.checkAST(i),n=e.getChild(43),s=x(e,50,55,53,54,51,52),c=x(e,24,25,26);n?s||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):s&&a===o.scalar&&r===o.scalar&&this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier");let u=function(e,t){if(!t||41!==t.type.id)return null;let i={card:l.CardOneToOne,matchingLabels:[],on:!1,include:[]},a=t.getChild(44);if(a){i.on=null!==a.getChild(3);let t=a.getChild(36);for(let a of t?t.getChildren(37):[])i.matchingLabels.push(e.sliceDoc(a.from,a.to));let r=a.getChild(4),n=a.getChild(5),s=r||n;if(s){i.card=r?l.CardManyToOne:l.CardOneToMany;let t=s.nextSibling;for(let a of(null==t?void 0:t.getChildren(37))||[])i.include.push(e.sliceDoc(a.from,a.to))}}return x(t,24,25,26)&&i.card===l.CardOneToOne&&(i.card=l.CardManyToMany),i}(this.state,e);if(null!==u&&u.on)for(let t of u.matchingLabels)for(let i of u.include)t===i&&this.addDiagnostic(e,`label "${t}" must not occur in ON and GROUP clause at once`);a!==o.scalar&&a!==o.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),r!==o.scalar&&r!==o.vector&&this.addDiagnostic(i,"binary expression must contain only scalar and instant vector types"),(a!==o.vector||r!==o.vector)&&null!==u?u.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"):c&&(((null==u?void 0:u.card)===l.CardOneToMany||(null==u?void 0:u.card)===l.CardManyToOne)&&this.addDiagnostic(e,"no grouping allowed for set operations"),(null==u?void 0:u.card)!==l.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")),(a===o.scalar||r===o.scalar)&&c&&this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}checkCallFunction(e){var t;let i=null==(t=e.firstChild)?void 0:t.firstChild;if(!i)return void this.addDiagnostic(e,"function not defined");let a=e.getChild(40),r=a?a.getChildren("Expr"):[],n=y[i.type.id],s=n.argTypes.length;if(0===n.variadic)r.length!==s&&this.addDiagnostic(e,`expected ${s} argument(s) in call to "${n.name}", got ${r.length}`);else{let t=s-1;if(t>r.length)this.addDiagnostic(e,`expected at least ${t} argument(s) in call to "${n.name}", got ${r.length}`);else{let i=t+n.variadic;n.variadic>0&&i<r.length&&this.addDiagnostic(e,`expected at most ${i} argument(s) in call to "${n.name}", got ${r.length}`)}}"info"===n.name&&r.length>1&&r[1].getChild(59)&&this.addDiagnostic(e,`expected label selectors as the second argument to "info" function, got ${r[1].type}`);let o=0;for(let e=0;e<r.length;e++){if((o=e)>=n.argTypes.length){if(0===n.variadic)break;o=n.argTypes.length-1}this.expectType(r[e],n.argTypes[o],`call to function "${n.name}"`)}}checkAnchoredSmoothedExpr(e,t){var i,a;let r=S(e);if(r!==o.vector&&r!==o.matrix)return void this.addDiagnostic(e,`smoothed/anchored expression only allowed on instant vector or range vector selector, got ${r} instead`);let n=null==(i=e.parent)?void 0:i.parent;if(!n||56!==n.type.id)return;let s=null==(a=n.firstChild)?void 0:a.firstChild;s?t.includes(s.type.id)||this.addDiagnostic(e,"smoothed/anchored expression can only be used in specific functions"):this.addDiagnostic(e,"function not defined")}checkVectorSelector(e){let t=e.getChild(152),i=[];for(let e of[38,158,153])i=i.concat(_(t?t.getChildren(e):[],this.state));let a="",r=e.getChild(59);if(r&&(a=this.state.sliceDoc(r.from,r.to)),""!==a){let t=i.find(e=>"__name__"===e.name);t&&this.addDiagnostic(e,`metric name must not be set twice: ${a} or ${t.value}`),i.push(new b(155,"__name__",a))}else{let t=i.filter(e=>"__name__"===e.name);t.length>1&&this.addDiagnostic(e,`metric name must not be set twice: ${t[0].value} or ${t[1].value}`)}i.every(e=>e.matchesEmpty())&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}expectType(e,t,i){let a=this.checkAST(e);a!==t&&this.addDiagnostic(e,`expected type ${t} in ${i}, got ${a}`)}addDiagnostic(e,t){this.diagnostics.push({severity:"error",message:t,from:e.from,to:e.to})}}var k=i(9714);let E=[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],A=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],C=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"limitk",detail:"aggregation",info:"Sample k elements",type:"keyword"},{label:"limit_ratio",detail:"aggregation",info:"Sample given ratio of elements",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],D=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:(0,k.UA)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:(0,k.UA)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:(0,k.UA)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')},{label:"topk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Largest k elements by sample value",apply:(0,k.UA)("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:(0,k.UA)("bottomk(${__rank_number__}, ${__input_vector__})")},{label:'count_values("__label_name__", __input_vector__)',type:"function",detail:"snippet",info:"Count the number of series per distinct sample value",apply:(0,k.UA)('count_values("${__label_name__}", ${__metric__})')}],R=[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],F=[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],q=[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],M=[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"acos",detail:"function",info:"Calculate the arccosine, in radians, for input series",type:"function"},{label:"acosh",detail:"function",info:"Calculate the inverse hyperbolic cosine, in radians, for input series",type:"function"},{label:"asin",detail:"function",info:"Calculate the arcsine, in radians, for input series",type:"function"},{label:"asinh",detail:"function",info:"Calculate the inverse hyperbolic sine, in radians, for input series",type:"function"},{label:"atan",detail:"function",info:"Calculate the arctangent, in radians, for input series",type:"function"},{label:"atanh",detail:"function",info:"Calculate the inverse hyperbolic tangent, in radians, for input series",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp",detail:"function",info:"Limit the value of input series between a minimum and a maximum",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"cos",detail:"function",info:"Calculate the cosine, in radians, for input series",type:"function",boost:-1},{label:"cosh",detail:"function",info:"Calculate the hyperbolic cosine, in radians, for input series",type:"function",boost:-1},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"day_of_year",detail:"function",info:"Return the day of the year for provided timestamps",type:"function"},{label:"deg",detail:"function",info:"Convert radians to degrees for input series",type:"function",boost:-1},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_avg",detail:"function",info:"Return the average of observations from a native histogram",type:"function"},{label:"histogram_count",detail:"function",info:"Return the count of observations from a native histogram",type:"function"},{label:"histogram_fraction",detail:"function",info:"Calculate fractions of observations within an interval from a native histogram",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from native histograms and from conventional histogram buckets",type:"function"},{label:"histogram_sum",detail:"function",info:"Return the sum of observations from a native histogram",type:"function"},{label:"histogram_stddev",detail:"function",info:"Estimate the standard deviation of observations from a native histogram",type:"function"},{label:"histogram_stdvar",detail:"function",info:"Estimate the standard variance of observations from a native histogram",type:"function"},{label:"double_exponential_smoothing",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"info",detail:"function",info:"Add data labels from corresponding info metrics",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"last_over_time",detail:"function",info:"The most recent point value in specified interval.",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"mad_over_time",detail:"function",info:"Return the median absolute deviation over time for input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"ts_of_max_over_time",detail:"function",info:"Return the timestamp of the maximum value over time for input series",type:"function"},{label:"ts_of_min_over_time",detail:"function",info:"Return the timestamp of the minimum value over time for input series",type:"function"},{label:"ts_of_last_over_time",detail:"function",info:"Return the timestamp of the last value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"pi",detail:"function",info:"Return pi",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"present_over_time",detail:"function",info:"the value 1 for any series in the specified interval",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rad",detail:"function",info:"Convert degrees to radians for input series",type:"function",boost:-1},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sgn",detail:"function",info:"Returns the sign of the instant vector",type:"function"},{label:"sin",detail:"function",info:"Calculate the sine, in radians, for input series",type:"function"},{label:"sinh",detail:"function",info:"Calculate the hyperbolic sine, in radians, for input series",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sort_by_label",detail:"function",info:"Sort input series ascendingly by label value",type:"function"},{label:"sort_by_label_desc",detail:"function",info:"Sort input series descendingly by value value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variance within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"tan",detail:"function",info:"Calculate the tangent, in radians, for input series",type:"function"},{label:"tanh",detail:"function",info:"Calculate the hyperbolic tangent, in radians, for input series",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],L=[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],V=[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}];function z(e,t){let i=Q(e,151);return i&&(i=i.getChild(59))?t.sliceDoc(i.from,i.to):""}function Y(e){var t;let i=e.parent;if(null!==i&&(null==(t=i.firstChild)?void 0:t.type.id)===34){let e=i.firstChild.firstChild;if(null!==e&&[21,9,16,17,11].includes(e.type.id))return!0}return!1}(n=c||(c={}))[n.MetricName=0]="MetricName",n[n.LabelName=1]="LabelName",n[n.LabelValue=2]="LabelValue",n[n.Function=3]="Function",n[n.Aggregation=4]="Aggregation",n[n.BinOpModifier=5]="BinOpModifier",n[n.BinOp=6]="BinOp",n[n.MatchOp=7]="MatchOp",n[n.AggregateOpModifier=8]="AggregateOpModifier",n[n.Duration=9]="Duration",n[n.Offset=10]="Offset",n[n.Bool=11]="Bool",n[n.AtModifiers=12]="AtModifiers",n[n.Number=13]="Number";class N{constructor(e,t=1e4){this.prometheusClient=e,this.maxMetricsMetadata=t}getPrometheusClient(){return this.prometheusClient}promQL(e){let{state:t,pos:i}=e,a=(0,X.mv)(t).resolve(i,-1),r=function(e,t,i){var a,r,n,s,o,l,u,h,d,O,p,f,m,v,g,$,y,b,T,S,X;let w=[];switch(t.type.id){case 0:{if((null==(a=t.parent)?void 0:a.type.id)===144){w.push({kind:c.Duration});break}if((null==(r=t.parent)?void 0:r.type.id)===153||(null==(n=t.parent)?void 0:n.type.id)===158){w.push({kind:c.MatchOp});break}if((null==(s=t.parent)?void 0:s.type.id)===141||(null==(o=t.parent)?void 0:o.type.id)===148&&x(t.parent,142)){w.push({kind:c.Duration});break}let i=e.sliceDoc(t.from,t.to);A.filter(e=>e.label.includes(i)).length>0&&w.push({kind:c.BinOp});break}case 59:{if((null==(l=t.parent)?void 0:l.type.id)===0){let i=t.parent.parent;if((null==i?void 0:i.type.id)===159){w.push({kind:c.AtModifiers});break}if((null==i?void 0:i.type.id)===33){w.push({kind:c.AggregateOpModifier},{kind:c.BinOp});break}if((null==i?void 0:i.type.id)===151){let i=z(t,e);C.filter(e=>e.label===i).length>0&&w.push({kind:c.AggregateOpModifier}),w.push({kind:c.BinOp},{kind:c.Offset});break}if(i&&P(i,"Expr")){w.push({kind:c.BinOp},{kind:c.Offset});break}}let i=null==(u=t.parent)?void 0:u.parent;if(!i){w.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)});break}P(i,"Expr","Expr")&&40!==i.type.id?41!==i.type.id||x(i,0)||(w.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:c.Function},{kind:c.Aggregation},{kind:c.BinOpModifier},{kind:c.Number}),x(i,50,51,52,53,54,55)&&!x(i,43)&&w.push({kind:c.Bool})):(w.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:c.Function},{kind:c.Aggregation}),40!==i.type.id&&141!==i.type.id&&w.push({kind:c.Number}));break}case 32:null!==t.firstChild&&0===t.firstChild.type.id&&w.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation},{kind:c.Number});break;case 36:w.push({kind:c.LabelName,metricName:function(e,t){let i=Q(e,33);if(!i)return"";let a="";return i.cursor().iterate(e=>{if(151===e.type.id&&(a=z(e.node,t)))return!1}),a}(t,e)});break;case 152:w.push({kind:c.LabelName,metricName:z(t,e)});break;case 37:(null==(h=t.parent)?void 0:h.type.id)===36?w.push({kind:c.LabelName}):(null==(d=t.parent)?void 0:d.type.id)===153&&w.push({kind:c.LabelName,metricName:z(t,e)});break;case 39:if((null==(O=t.parent)?void 0:O.type.id)===153||(null==(p=t.parent)?void 0:p.type.id)===158){let i="";(null==(f=t.parent.firstChild)?void 0:f.type.id)===37?i=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to):(null==(m=t.parent.firstChild)?void 0:m.type.id)===38&&(i=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to).slice(1,-1));let a=z(t,e),r=Q(t,152),n=[];for(let t of[38,158,153])n=n.concat(_(r?r.getChildren(t):[],e));w.push({kind:c.LabelValue,metricName:a,labelName:i,matchers:n})}else(null==(g=null==(v=t.parent)?void 0:v.parent)?void 0:g.type.id)===36?w.push({kind:c.LabelName}):(null==(y=null==($=t.parent)?void 0:$.parent)?void 0:y.type.id)===152&&w.push({kind:c.MetricName,metricName:e.sliceDoc(t.from,t.to).slice(1,-1)});break;case 143:(null==(b=t.parent)?void 0:b.type.id)===0&&(null==(T=t.parent.parent)?void 0:T.type.id)===148?w.push({kind:c.Duration}):w.push({kind:c.Number});break;case 142:case 144:w.push({kind:c.Duration});break;case 40:if(Y(t)){if(null===t.firstChild||t.firstChild.from<=i&&t.firstChild.to>=i){w.push({kind:c.Number});break}w.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation});break}w.push({kind:c.MetricName,metricName:""},{kind:c.Function},{kind:c.Aggregation});break;case 55:(null==(S=t.parent)?void 0:S.type.id)===154?w.push({kind:c.MatchOp}):(null==(X=t.parent)?void 0:X.type.id)===41&&w.push({kind:c.BinOp});break;case 155:case 156:case 157:case 154:w.push({kind:c.MatchOp});break;case 42:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 24:case 26:case 25:case 41:w.push({kind:c.BinOp})}return w}(t,a,i),n=Promise.resolve([]),s=!1,o=!0;for(let e of r)switch(e.kind){case c.Aggregation:s=!0,n=n.then(e=>e.concat(C));break;case c.Function:s=!0,n=n.then(e=>e.concat(M));break;case c.BinOpModifier:n=n.then(e=>e.concat(F));break;case c.BinOp:n=n.then(e=>e.concat(A));break;case c.MatchOp:n=n.then(e=>e.concat(R));break;case c.AggregateOpModifier:n=n.then(e=>e.concat(L));break;case c.Duration:o=!1,n=n.then(e=>e.concat(E));break;case c.Offset:n=n.then(e=>e.concat([{label:"offset"}]));break;case c.Bool:n=n.then(e=>e.concat([{label:"bool"}]));break;case c.AtModifiers:n=n.then(e=>e.concat(q));break;case c.Number:n=n.then(e=>e.concat(V));break;case c.MetricName:n=n.then(t=>this.autocompleteMetricName(t,e));break;case c.LabelName:n=n.then(t=>this.autocompleteLabelName(t,e));break;case c.LabelValue:n=n.then(t=>this.autocompleteLabelValue(t,e))}return n.then(e=>(function(e,t,i,a=!1,r=!0){return a&&e.push(...D),{from:t,to:i,options:e,validFor:r?/^[a-zA-Z0-9_:]+$/:void 0}})(e,function(e,t,i){var a,r,n,s,o,l,c;let u=e.doc.slice(t.from,i).toString(),h=t.from;if(152===t.type.id||36===t.type.id){let e;e=t.from+1,null!==t.firstChild&&(e=i),h=e}else 40===t.type.id&&null===t.firstChild||39===t.type.id&&((null==(a=t.parent)?void 0:a.type.id)===153||(null==(r=t.parent)?void 0:r.type.id)===158)?h++:(144===t.type.id||142===t.type.id&&!E.map(e=>e.label).includes(u[u.length-1])||143===t.type.id&&(null==(n=t.parent)?void 0:n.type.id)===0&&(null==(s=t.parent.parent)?void 0:s.type.id)===148||40===t.type.id&&Y(t)&&null!==t.firstChild||0===t.type.id&&((null==(o=t.parent)?void 0:o.type.id)===144||(null==(l=t.parent)?void 0:l.type.id)===141||(null==(c=t.parent)?void 0:c.type.id)===148&&x(t.parent,142)))&&(h=i);return h}(t,a,i),i,s,o))}autocompleteMetricName(e,t){if(!this.prometheusClient)return e;let i=new Map;return this.prometheusClient.metricNames(t.metricName).then(e=>{var t;for(let t of e)i.set(t,{label:t,type:"constant"});if(e.length<=this.maxMetricsMetadata)return null==(t=this.prometheusClient)?void 0:t.metricMetadata()}).then(t=>{var a;if(t)for(let[e,r]of i){let i=null!=(a=t[e])?a:t[e.replace(/(_count|_sum|_bucket)$/,"")];if(i){if(i.length>1)for(let e of i)""===r.detail?r.detail=e.type:r.detail!==e.type&&(r.detail="unknown",r.info="multiple different definitions for this metric"),""===r.info?r.info=e.help:r.info!==e.help&&(r.info="multiple different definitions for this metric");else if(1===i.length){let{type:t,help:a}=i[0];("histogram"===t||"summary"===t)&&(e.endsWith("_count")&&(t="counter",a=`The total number of observations for: ${a}`),e.endsWith("_sum")&&(t="counter",a=`The total sum of observations for: ${a}`),e.endsWith("_bucket")&&(t="counter",a=`The total count of observations for a bucket in the histogram: ${a}`)),r.detail=t,r.info=a}}}return e.concat(Array.from(i.values()))})}autocompleteLabelName(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t.metricName).then(t=>e.concat(t.map(e=>({label:e,type:"constant"})))):e}autocompleteLabelValue(e,t){return this.prometheusClient&&t.labelName?this.prometheusClient.labelValues(t.labelName,t.metricName,t.matchers).then(t=>e.concat(t.map(e=>({label:e,type:"text"})))):e}}var W={hasSubscribers:!1},U="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,Z=new Set,G="object"==typeof process&&process?process:{},j=(Symbol("type"),e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e)),H=e=>j(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=0x100000000?Uint32Array:e<=Number.MAX_SAFE_INTEGER?I:null:null,I=class extends Array{constructor(e){super(e),this.fill(0)}},B=class e{heap;length;static #e=!1;static create(t){let i=H(t);if(!i)return[];e.#e=!0;let a=new e(t,i);return e.#e=!1,a}constructor(t,i){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},J=class e{#e;#t;#i;#a;#r;#n;#s;#o;get perf(){return this.#o}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#c;#u;#h;#d;#O;#p;#f;#m;#v;#g;#$;#y;#b;#_;#T;#Q;#x;#P;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#b,autopurgeTimers:e.#_,sizes:e.#$,keyMap:e.#u,keyList:e.#h,valList:e.#d,next:e.#O,prev:e.#p,get head(){return e.#f},get tail(){return e.#m},free:e.#v,isBackgroundFetch:t=>e.#S(t),backgroundFetch:(t,i,a,r)=>e.#X(t,i,a,r),moveToTail:t=>e.#w(t),indexes:t=>e.#k(t),rindexes:t=>e.#E(t),isStale:t=>e.#A(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#c}get size(){return this.#l}get fetchMethod(){return this.#n}get memoMethod(){return this.#s}get dispose(){return this.#i}get onInsert(){return this.#a}get disposeAfter(){return this.#r}constructor(t){let{max:i=0,ttl:a,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:c,onInsert:u,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:O,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:m,fetchMethod:v,memoMethod:g,noDeleteOnFetchRejection:$,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:_,ignoreFetchAbort:T,perf:Q}=t;if(void 0!==Q&&"function"!=typeof Q?.now)throw TypeError("perf option must have a now() method if specified");if(this.#o=Q??U,0!==i&&!j(i))throw TypeError("max option must be a nonnegative integer");let x=i?H(i):Array;if(!x)throw Error("invalid max value: "+i);if(this.#e=i,this.#t=p,this.maxEntrySize=f||this.#t,this.sizeCalculation=m,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw TypeError("memoMethod must be a function if defined");if(this.#s=g,void 0!==v&&"function"!=typeof v)throw TypeError("fetchMethod must be a function if specified");if(this.#n=v,this.#Q=!!v,this.#u=new Map,this.#h=Array.from({length:i}).fill(void 0),this.#d=Array.from({length:i}).fill(void 0),this.#O=new x(i),this.#p=new x(i),this.#f=0,this.#m=0,this.#v=B.create(i),this.#l=0,this.#c=0,"function"==typeof c&&(this.#i=c),"function"==typeof u&&(this.#a=u),"function"==typeof h?(this.#r=h,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#i,this.#P=!!this.#a,this.#x=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!$,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!T,0!==this.maxEntrySize){if(0!==this.#t&&!j(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!j(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=j(r)||0===r?r:1,this.ttlAutopurge=!!n,this.ttl=a||0,this.ttl){if(!j(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#D()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!Z.has(e))(t)&&(Z.add(t),((e,t,i,a)=>{"function"==typeof G.emitWarning?G.emitWarning(e,t,i,a):console.error(`[${i}] ${t}: ${e}`)})("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new I(this.#e),t=new I(this.#e);this.#b=e,this.#y=t;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#_=i,this.#R=(i,r,n=this.#o.now())=>{t[i]=0!==r?n:0,e[i]=r,a(i,r)},this.#F=i=>{t[i]=0!==e[i]?this.#o.now():0,a(i,e[i])};let a=this.ttlAutopurge?(e,t)=>{if(i?.[e]&&(clearTimeout(i[e]),i[e]=void 0),t&&0!==t&&i){let a=setTimeout(()=>{this.#A(e)&&this.#q(this.#h[e],"expire")},t+1);a.unref&&a.unref(),i[e]=a}}:()=>{};this.#M=(i,a)=>{if(e[a]){let s=e[a],o=t[a];if(!s||!o)return;i.ttl=s,i.start=o,i.now=r||n();let l=i.now-o;i.remainingTTL=s-l}};let r=0,n=()=>{let e=this.#o.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#u.get(i);if(void 0===a)return 0;let s=e[a],o=t[a];return s&&o?s-((r||n())-o):1/0},this.#A=i=>{let a=t[i],s=e[i];return!!s&&!!a&&(r||n())-a>s}}#F=()=>{};#M=()=>{};#R=()=>{};#A=()=>!1;#C(){let e=new I(this.#e);this.#c=0,this.#$=e,this.#L=t=>{this.#c-=e[t],e[t]=0},this.#V=(e,t,i,a)=>{if(this.#S(t))return 0;if(!j(i))if(a){if("function"!=typeof a)throw TypeError("sizeCalculation must be a function");if(!j(i=a(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#z=(t,i,a)=>{if(e[t]=i,this.#t){let i=this.#t-e[t];for(;this.#c>i;)this.#Y(!0)}this.#c+=e[t],a&&(a.entrySize=i,a.totalCalculatedSize=this.#c)}}#L=e=>{};#z=(e,t,i)=>{};#V=(e,t,i,a)=>{if(i||a)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#m;this.#N(t)&&((e||!this.#A(t))&&(yield t),t!==this.#f);)t=this.#p[t]}*#E({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#f;this.#N(t)&&((e||!this.#A(t))&&(yield t),t!==this.#m);)t=this.#O[t]}#N(e){return void 0!==e&&this.#u.get(this.#h[e])===e}*entries(){for(let e of this.#k())void 0===this.#d[e]||void 0===this.#h[e]||this.#S(this.#d[e])||(yield[this.#h[e],this.#d[e]])}*rentries(){for(let e of this.#E())void 0===this.#d[e]||void 0===this.#h[e]||this.#S(this.#d[e])||(yield[this.#h[e],this.#d[e]])}*keys(){for(let e of this.#k()){let t=this.#h[e];void 0===t||this.#S(this.#d[e])||(yield t)}}*rkeys(){for(let e of this.#E()){let t=this.#h[e];void 0===t||this.#S(this.#d[e])||(yield t)}}*values(){for(let e of this.#k())void 0===this.#d[e]||this.#S(this.#d[e])||(yield this.#d[e])}*rvalues(){for(let e of this.#E())void 0===this.#d[e]||this.#S(this.#d[e])||(yield this.#d[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#k()){let a=this.#d[i],r=this.#S(a)?a.__staleWhileFetching:a;if(void 0!==r&&e(r,this.#h[i],this))return this.#W(this.#h[i],t)}}forEach(e,t=this){for(let i of this.#k()){let a=this.#d[i],r=this.#S(a)?a.__staleWhileFetching:a;void 0!==r&&e.call(t,r,this.#h[i],this)}}rforEach(e,t=this){for(let i of this.#E()){let a=this.#d[i],r=this.#S(a)?a.__staleWhileFetching:a;void 0!==r&&e.call(t,r,this.#h[i],this)}}purgeStale(){let e=!1;for(let t of this.#E({allowStale:!0}))this.#A(t)&&(this.#q(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#u.get(e);if(void 0===t)return;let i=this.#d[t],a=this.#S(i)?i.__staleWhileFetching:i;if(void 0===a)return;let r={value:a};if(this.#b&&this.#y){let e=this.#b[t],i=this.#y[t];e&&i&&(r.ttl=e-(this.#o.now()-i),r.start=Date.now())}return this.#$&&(r.size=this.#$[t]),r}dump(){let e=[];for(let t of this.#k({allowStale:!0})){let i=this.#h[t],a=this.#d[t],r=this.#S(a)?a.__staleWhileFetching:a;if(void 0===r||void 0===i)continue;let n={value:r};if(this.#b&&this.#y){n.ttl=this.#b[t];let e=this.#o.now()-this.#y[t];n.start=Math.floor(Date.now()-e)}this.#$&&(n.size=this.#$[t]),e.unshift([i,n])}return e}load(e){for(let[t,i]of(this.clear(),e)){if(i.start){let e=Date.now()-i.start;i.start=this.#o.now()-e}this.#U(t,i.value,i)}}set(e,t,i={}){let{status:a=W.hasSubscribers?{}:void 0}=i;i.status=a,a&&(a.op="set",a.key=e,void 0!==t&&(a.value=t));let r=this.#U(e,t,i);return a&&W.hasSubscribers&&W.publish(a),r}#U(e,t,i={}){let{ttl:a=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:o}=i;if(void 0===t)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:l=this.noUpdateTTL}=i;o&&!this.#S(t)&&(o.value=t);let c=this.#V(e,t,i.size||0,s,o);if(this.maxEntrySize&&c>this.maxEntrySize)return this.#q(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=0===this.#l?void 0:this.#u.get(e);if(void 0===u)u=0===this.#l?this.#m:0!==this.#v.length?this.#v.pop():this.#l===this.#e?this.#Y(!1):this.#l,this.#h[u]=e,this.#d[u]=t,this.#u.set(e,u),this.#O[this.#m]=u,this.#p[u]=this.#m,this.#m=u,this.#l++,this.#z(u,c,o),o&&(o.set="add"),l=!1,this.#P&&this.#a?.(t,e,"add");else{this.#w(u);let i=this.#d[u];if(t!==i){if(this.#Q&&this.#S(i)){i.__abortController.abort(Error("replaced"));let{__staleWhileFetching:t}=i;void 0!==t&&!n&&(this.#T&&this.#i?.(t,e,"set"),this.#x&&this.#g?.push([t,e,"set"]))}else n||(this.#T&&this.#i?.(i,e,"set"),this.#x&&this.#g?.push([i,e,"set"]));if(this.#L(u),this.#z(u,c,o),this.#d[u]=t,o){o.set="replace";let e=i&&this.#S(i)?i.__staleWhileFetching:i;void 0!==e&&(o.oldValue=e)}}else o&&(o.set="update");this.#P&&this.onInsert?.(t,e,t===i?"update":"replace")}if(0===a||this.#b||this.#D(),this.#b&&(l||this.#R(u,a,r),o&&this.#M(o,u)),!n&&this.#x&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#l;){let e=this.#d[this.#f];if(this.#Y(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#x&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#Y(e){let t=this.#f,i=this.#h[t],a=this.#d[t];return this.#Q&&this.#S(a)?a.__abortController.abort(Error("evicted")):(this.#T||this.#x)&&(this.#T&&this.#i?.(a,i,"evict"),this.#x&&this.#g?.push([a,i,"evict"])),this.#L(t),this.#_?.[t]&&(clearTimeout(this.#_[t]),this.#_[t]=void 0),e&&(this.#h[t]=void 0,this.#d[t]=void 0,this.#v.push(t)),1===this.#l?(this.#f=this.#m=0,this.#v.length=0):this.#f=this.#O[t],this.#u.delete(i),this.#l--,t}has(e,t={}){let{status:i=W.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e);let a=this.#Z(e,t);return W.hasSubscribers&&W.publish(i),a}#Z(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:a}=t,r=this.#u.get(e);if(void 0!==r){let e=this.#d[r];if(this.#S(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#A(r))return i&&this.#F(r),a&&(a.has="hit",this.#M(a,r)),!0;a&&(a.has="stale",this.#M(a,r))}else a&&(a.has="miss");return!1}peek(e,t={}){let{status:i=W.hasSubscribers||W.hasSubscribers?{}:void 0}=t;i&&(i.op="peek",i.key=e),t.status=i;let a=this.#G(e,t);return W.hasSubscribers&&W.publish(i),a}#G(e,t){let{status:i,allowStale:a=this.allowStale}=t,r=this.#u.get(e);if(void 0===r||!a&&this.#A(r)){i&&(i.peek=void 0===r?"miss":"stale");return}let n=this.#d[r],s=this.#S(n)?n.__staleWhileFetching:n;return i&&(void 0!==s?(i.peek="hit",i.value=s):i.peek="miss"),s}#X(e,t,i,a){let r=void 0===t?void 0:this.#d[t];if(this.#S(r))return r;let n=new AbortController,{signal:s}=i;s?.addEventListener("abort",()=>n.abort(s.reason),{signal:n.signal});let o={signal:n.signal,options:i,context:a},l=(a,r=!1)=>{let{aborted:s}=n.signal,l=i.ignoreFetchAbort&&void 0!==a,u=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&void 0!==a);if(i.status&&(s&&!r?(i.status.fetchAborted=!0,i.status.fetchError=n.signal.reason,l&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),s&&!l&&!r)return c(n.signal.reason,u);let d=this.#d[t];return(d===h||void 0===d&&l&&r)&&(void 0===a?void 0!==h.__staleWhileFetching?this.#d[t]=h.__staleWhileFetching:this.#q(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#U(e,a,o.options))),a},c=(a,r)=>{let{aborted:s}=n.signal,o=s&&i.allowStaleOnFetchAbort,l=o||i.allowStaleOnFetchRejection,c=l||i.noDeleteOnFetchRejection;if(this.#d[t]===h&&(c&&(r||void 0!==h.__staleWhileFetching)?o||(this.#d[t]=h.__staleWhileFetching):this.#q(e,"fetch")),l)return i.status&&void 0!==h.__staleWhileFetching&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw a},u=(t,a)=>{let s=this.#n?.(e,r,o);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),a),n.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(u).then(l,e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),c(e,!1))),d=Object.assign(h,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.#U(e,d,{...o.options,status:void 0}),t=this.#u.get(e)):this.#d[t]=d,d}#S(e){return!!this.#Q&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:a=W.hasSubscribers||W.hasSubscribers?{}:void 0}=t;t.status=a,a&&t.context&&(a.context=t.context);let r=this.#j(e,t);return a&&(W.hasSubscribers||W.hasSubscribers)&&i&&(a.trace=!0,W.tracePromise(()=>r,a).catch(()=>{})),r}async #j(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:p,forceRefresh:f=!1,status:m,signal:v}=t;if(m&&(m.op="fetch",m.key=e,f&&(m.forceRefresh=!0)),!this.#Q)return m&&(m.fetch="get"),this.#W(e,{allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:r,status:m});let g={allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:s,size:o,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:O,ignoreFetchAbort:d,status:m,signal:v},$=this.#u.get(e);if(void 0===$){m&&(m.fetch="miss");let t=this.#X(e,$,g,p);return t.__returned=t}{let t=this.#d[$];if(this.#S(t)){let e=i&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let r=this.#A($);if(!f&&!r)return m&&(m.fetch="hit"),this.#w($),a&&this.#F($),m&&this.#M(m,$),t;let n=this.#X(e,$,g,p),s=void 0!==n.__staleWhileFetching&&i;return m&&(m.fetch=r?"stale":"refresh",s&&r&&(m.returnedStale=!0)),s?n.__staleWhileFetching:n.__returned=n}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:a=W.hasSubscribers||W.hasSubscribers?{}:void 0}=t;t.status=a,a&&t.context&&(a.context=t.context);let r=this.#H(e,t);return a&&(W.hasSubscribers||W.hasSubscribers)&&i&&(a.trace=!0,W.tracePromise(()=>r,a).catch(()=>{})),r}async #H(e,t={}){let i=await this.#j(e,t);if(void 0===i)throw Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=W.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context));let a=this.#I(e,t);return i&&(i.value=a),W.hasSubscribers&&W.publish(i),a}#I(e,t={}){let i=this.#s;if(!i)throw Error("no memoMethod provided to constructor");let{context:a,status:r,forceRefresh:n,...s}=t;r&&n&&(r.forceRefresh=!0);let o=this.#W(e,s),l=n||void 0===o;if(r&&(r.memo=l?"miss":"hit",l||(r.value=o)),!l)return o;let c=i(e,o,{options:s,context:a});return r&&(r.value=c),this.#U(e,c,s),c}get(e,t={}){let{status:i=W.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e);let a=this.#W(e,t);return i&&(void 0!==a&&(i.value=a),W.hasSubscribers&&W.publish(i)),a}#W(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=t,s=this.#u.get(e);if(void 0===s){n&&(n.get="miss");return}let o=this.#d[s],l=this.#S(o);return n&&this.#M(n,s),this.#A(s)?l?(n&&(n.get="stale-fetching"),i&&void 0!==o.__staleWhileFetching?(n&&(n.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#q(e,"expire"),n&&(n.get="stale"),i?(n&&(n.returnedStale=!0),o):void 0):(n&&(n.get=l?"fetching":"hit"),this.#w(s),a&&this.#F(s),l?o.__staleWhileFetching:o)}#B(e,t){this.#p[t]=e,this.#O[e]=t}#w(e){e!==this.#m&&(e===this.#f?this.#f=this.#O[e]:this.#B(this.#p[e],this.#O[e]),this.#B(this.#m,e),this.#m=e)}delete(e){return this.#q(e,"delete")}#q(e,t){W.hasSubscribers&&W.publish({op:"delete",delete:t,key:e});let i=!1;if(0!==this.#l){let a=this.#u.get(e);if(void 0!==a)if(this.#_?.[a]&&(clearTimeout(this.#_?.[a]),this.#_[a]=void 0),i=!0,1===this.#l)this.#J(t);else{this.#L(a);let i=this.#d[a];if(this.#S(i)?i.__abortController.abort(Error("deleted")):(this.#T||this.#x)&&(this.#T&&this.#i?.(i,e,t),this.#x&&this.#g?.push([i,e,t])),this.#u.delete(e),this.#h[a]=void 0,this.#d[a]=void 0,a===this.#m)this.#m=this.#p[a];else if(a===this.#f)this.#f=this.#O[a];else{let e=this.#p[a];this.#O[e]=this.#O[a];let t=this.#O[a];this.#p[t]=this.#p[a]}this.#l--,this.#v.push(a)}}if(this.#x&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return i}clear(){return this.#J("delete")}#J(e){for(let t of this.#E({allowStale:!0})){let i=this.#d[t];if(this.#S(i))i.__abortController.abort(Error("deleted"));else{let a=this.#h[t];this.#T&&this.#i?.(i,a,e),this.#x&&this.#g?.push([i,a,e])}}if(this.#u.clear(),this.#d.fill(void 0),this.#h.fill(void 0),this.#b&&this.#y){for(let e of(this.#b.fill(0),this.#y.fill(0),this.#_??[]))void 0!==e&&clearTimeout(e);this.#_?.fill(void 0)}if(this.#$&&this.#$.fill(0),this.#f=0,this.#m=0,this.#v.length=0,this.#c=0,this.#l=0,this.#x&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}};class K{constructor(e){this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=(e,t)=>fetch(e,t),this.requestHeaders=new Headers,this.url=e.url?e.url:"",this.errorHandler=e.httpErrorHandler,this.lookbackInterval=e.lookbackInterval,e.fetchFn&&(this.fetchFn=e.fetchFn),e.httpMethod&&(this.httpMethod=e.httpMethod),e.apiPrefix&&(this.apiPrefix=e.apiPrefix),e.requestHeaders&&(this.requestHeaders=e.requestHeaders)}labelNames(e){let t=new URLSearchParams;if(this.lookbackInterval){let e=new Date,i=new Date(e.getTime()-this.lookbackInterval);t.set("start",i.toISOString()),t.set("end",e.toISOString())}e&&e.length>0&&t.set("match[]",T(e));let i=this.buildRequest(this.labelsEndpoint(),t);return this.fetchAPI(i.uri,{method:this.httpMethod,body:i.body}).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}labelValues(e,t,i){let a=new URLSearchParams;if(this.lookbackInterval){let e=new Date,t=new Date(e.getTime()-this.lookbackInterval);a.set("start",t.toISOString()),a.set("end",e.toISOString())}return t&&t.length>0&&a.set("match[]",T(t,i,e)),this.fetchAPI(`${this.labelValuesEndpoint().replace(/:name/gi,e)}?${a}`).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}metricMetadata(){return this.fetchAPI(this.metricMetadataEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}series(e,t,i){let a=new URLSearchParams;if(this.lookbackInterval){let e=new Date,t=new Date(e.getTime()-this.lookbackInterval);a.set("start",t.toISOString()),a.set("end",e.toISOString())}a.set("match[]",T(e,t,i));let r=this.buildRequest(this.seriesEndpoint(),a);return this.fetchAPI(r.uri,{method:this.httpMethod,body:r.body}).catch(e=>(this.errorHandler&&this.errorHandler(e),[]))}metricNames(){return this.labelValues("__name__")}flags(){return this.fetchAPI(this.flagsEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}fetchAPI(e,t){return t?t.headers=this.requestHeaders:t={headers:this.requestHeaders},this.fetchFn(this.url+e,t).then(e=>{if(!e.ok&&![400,422,503].includes(e.status))throw Error(e.statusText);return e}).then(e=>e.json()).then(e=>{if("error"===e.status)throw Error(void 0!==e.error?e.error:'missing "error" field in response JSON');if(void 0===e.data)throw Error('missing "data" field in response JSON');return e.data})}buildRequest(e,t){let i=e,a=t;return"GET"===this.httpMethod&&(i=`${i}?${t}`,a=null),{uri:i,body:a}}labelsEndpoint(){return`${this.apiPrefix}/labels`}labelValuesEndpoint(){return`${this.apiPrefix}/label/:name/values`}seriesEndpoint(){return`${this.apiPrefix}/series`}metricMetadataEndpoint(){return`${this.apiPrefix}/metadata`}flagsEndpoint(){return`${this.apiPrefix}/status/flags`}}class ee{constructor(e){const t={ttl:e&&e.maxAge?e.maxAge:3e5,ttlAutopurge:!0};this.completeAssociation=new J(t),this.metricMetadata={},this.labelValues=new J(t),this.labelNames=[],this.flags={},(null==e?void 0:e.initialMetricList)&&this.setLabelValues("__name__",e.initialMetricList)}getAssociations(e){let t=this.completeAssociation.get(e);return t||(t=new Map,this.completeAssociation.set(e,t)),t}setAssociations(e,t){t.forEach(t=>{let i=this.getAssociations(e);for(let[e,a]of Object.entries(t)){if("__name__"===e)continue;let t=i.get(e);void 0===t?i.set(e,new Set([a])):t.add(a)}})}setLabelValuesAssociation(e,t,i){let a=this.getAssociations(e),r=a.get(t);void 0===r?a.set(t,new Set(i)):i.forEach(e=>{r.add(e)})}setLabelNamesAssociation(e,t){let i=this.getAssociations(e);t.forEach(e=>{"__name__"!==e&&(i.has(e)||i.set(e,new Set))})}setFlags(e){this.flags=e}getFlags(){return this.flags}setMetricMetadata(e){this.metricMetadata=e}getMetricMetadata(){return this.metricMetadata}setLabelNames(e,t){t&&t.length>0&&this.setLabelNamesAssociation(t,e),this.labelNames=e}getLabelNames(e){if(!e||0===e.length)return this.labelNames;let t=this.completeAssociation.get(e);return t?Array.from(t.keys()):[]}setLabelValues(e,t,i){i&&i.length>0&&this.setLabelValuesAssociation(i,e,t),this.labelValues.set(e,t)}getLabelValues(e,t){if(!t||0===t.length)return this.labelValues.get(e)||[];let i=this.completeAssociation.get(t);if(i){let t=i.get(e);return t?Array.from(t):[]}return[]}}class et{constructor(e,t){this.client=e,this.cache=new ee(t)}labelNames(e){let t=this.cache.getLabelNames(e);return t&&t.length>0?Promise.resolve(t):this.client.labelNames(e).then(t=>(this.cache.setLabelNames(t,e),this.cache.getLabelNames(e)))}labelValues(e,t){let i=this.cache.getLabelValues(e,t);return i&&i.length>0?Promise.resolve(i):this.client.labelValues(e,t).then(i=>(this.cache.setLabelValues(e,i,t),i))}metricMetadata(){let e=this.cache.getMetricMetadata();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.metricMetadata().then(e=>(this.cache.setMetricMetadata(e),e))}series(e){return this.client.series(e).then(t=>(this.cache.setAssociations(e,t),t))}metricNames(){return this.labelValues("__name__")}flags(){let e=this.cache.getFlags();return e&&Object.keys(e).length>0?Promise.resolve(e):this.client.flags().then(e=>(this.cache.setFlags(e),e))}}function ei(e){if(null==e?void 0:e.completeStrategy)return e.completeStrategy;if(null==e?void 0:e.remote){var t;return"function"==typeof(t=e.remote).labelNames&&"function"==typeof t.labelValues&&"function"==typeof t.metricMetadata&&"function"==typeof t.series&&"function"==typeof t.metricNames?new N(e.remote,e.maxMetricsMetadata):new N(new et(new K(e.remote),e.remote.cache),e.maxMetricsMetadata)}return new N}var ea=i(13313);class er{promQL(){return e=>{let t=new w(e.state);return t.analyze(),t.getDiagnostics()}}}(s=u||(u={})).PromQL="PromQL",s.MetricName="MetricName";class en{constructor(){this.complete=ei(),this.lint=new er,this.enableLinter=!0,this.enableCompletion=!0}setComplete(e){return this.complete=ei(e),this}getComplete(){return this.complete}activateCompletion(e){return this.enableCompletion=e,this}setLinter(e){return this.lint=e,this}getLinter(){return this.lint}activateLinter(e){return this.enableLinter=e,this}asExtension(e=u.PromQL){var t,i;let a=X.bj.define({parser:$.configure({top:e}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),r=[a];if(this.enableCompletion){let e=a.data.of({autocomplete:e=>this.complete.promQL(e)});r=r.concat(e)}return this.enableLinter&&(r=r.concat((t=this.lint.promQL,i=this.lint,(0,ea.bu)(t.call(i))))),r}}},74830(e,t,i){var a;t.default=void 0,t.default=(0,((a=i(1448))&&a.__esModule?a:{default:a}).default)("M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","AlertCircle")},93196(e,t,i){var a;t.default=void 0,t.default=(0,((a=i(1448))&&a.__esModule?a:{default:a}).default)("M3,3H9V7H3V3M15,10H21V14H15V10M15,17H21V21H15V17M13,13H7V18H13V20H7L5,20V9H7V11H13V13Z","FileTree")}}]);